From: Jinkun Jang Date: Fri, 15 Mar 2013 16:17:24 +0000 (+0900) Subject: merge with master X-Git-Tag: accepted/tizen_2.1/20130425.033138~884 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98f16efa144b07304e1543015bfaa3041a4873f6;p=platform%2Fframework%2Fnative%2Fuifw.git merge with master --- diff --git a/NOTICE b/NOTICE index 13d0a7a..cca4178 100644 --- a/NOTICE +++ b/NOTICE @@ -1,9 +1,9 @@ Copyright (c) Samsung Electronics Co., Ltd. All rights reserved. -Except as noted, this software is licensed under Flora License, Version 1. -Please, see the LICENSE.Flora file for Flora License terms and conditions. +Except as noted, this software is licensed under Apache License, Version 2. +Please, see the LICENSE file for Apache License terms and conditions. Several source codes may have its original copyright owner and/or -be licensed under other than Flora License, Version 1, say, Apache License, Version 2. +be licensed under other than Apache License, Version 2, say, Flora License, Version 1. Please, see copyright and license comments section in the header of each file, -and the LICENSE.APLv2 for Apache License terms and conditions. +and the LICENSE.Flora for Flora License terms and conditions. diff --git a/inc/FGraphics.h b/inc/FGraphics.h index e10e972..815a7e1 100644 --- a/inc/FGraphics.h +++ b/inc/FGraphics.h @@ -92,89 +92,43 @@ using namespace Tizen::Base; using namespace Tizen::Graphics; bool -MyClass::GraphicsSample(void) +MyClass::GraphicsSample(Canvas& canvas) { result r = E_SUCCESS; - // Creates a canvas instance. - Canvas* pCanvas = new Canvas(); - r = pCanvas->Construct(); - if (IsFailed(r)) - { - goto CATCH; - } - - // Clears - pCanvas->SetBackgroundColor(Color(0xFF, 0xFF, 0xFF)); - r = pCanvas->Clear(); - if (IsFailed(r)) - { - goto CATCH; - } - - // Sets the foreground color of this canvas. - pCanvas->SetForegroundColor(Color::GetColor(COLOR_ID_GREEN)); + // Sets the background color of the canvas and then clears it + canvas.SetBackgroundColor(Color(0xFF, 0xFF, 0xFF)); + canvas.Clear(); - // Draws an ellipse. - r = pCanvas->DrawEllipse(Rectangle(50, 50, 50, 80)); - if (IsFailed(r)) - { - goto CATCH; - } - - r = pCanvas->DrawLine(Point(100, 100), Point(150, 150)); - if (IsFailed(r)) - { - goto CATCH; - } + // Sets the foreground color of this canvas + canvas.SetForegroundColor(Color::GetColor(COLOR_ID_GREEN)); - // Draws a circular arc. - r = pCanvas->DrawArc(Rectangle(10, 200, 50, 50), 30, 60, ARC_STYLE_PIE); - if (IsFailed(r)) - { - goto CATCH; - } + // Draws shapes + canvas.DrawEllipse(Rectangle(50, 50, 50, 80)); + canvas.DrawLine(Point(100, 100), Point(150, 150)); + canvas.DrawArc(Rectangle(10, 200, 50, 50), 30, 60, ARC_STYLE_PIE); { - // Creates a font instance. + // Creates an instance of Font Font font; r = font.Construct(FONT_STYLE_PLAIN, 32); if (IsFailed(r)) { - goto CATCH; + return false; } - // Sets the font to canvas. - r = pCanvas->SetFont(font); - if (IsFailed(r)) - { - goto CATCH; - } + // Sets the canvas font + canvas.SetFont(font); } - // Draws text at the specified location. - r = pCanvas->DrawText(Point(50, 50), String(L"Hello World")); - if (IsFailed(r)) - { - goto CATCH; - } + // Draws text at the specified location + canvas.DrawText(Point(50, 50), String(L"Hello World")); - // Shows the drawing result on the device screen. - r = pCanvas->Show(); - if (IsFailed(r)) - { - goto CATCH; - } - - // Cleans up. - delete pCanvas; + // Shows the drawing as a result on the device screen + canvas.Show(); return true; -CATCH: - delete pCanvas; - - return false; } * @endcode * diff --git a/inc/FGrpBitmap.h b/inc/FGrpBitmap.h index 69b71eb..e1d3477 100644 --- a/inc/FGrpBitmap.h +++ b/inc/FGrpBitmap.h @@ -33,8 +33,11 @@ #include #include #include +#include #include +#include #include +#include #include #include #include @@ -200,6 +203,85 @@ public: */ result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, BufferScaling bufferScaling); + /* + * Initializes this instance of %Bitmap by copying a rectangular area of the Frame. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The rectangular area of the Frame to be copied into bitmap @n + * The width and height of the rectangle must be greater than @c 0. @n + * The area defined by @c rect is clipped to the edges of the Frame so that + * the rectangle does not fall outside the edges of the Frame. @n + * The rectangle must not fall outside the edges of the Frame entirely. @n + * If these conditions are not satisfied, an E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * + */ + result Construct(const FloatRectangle& rect); + + /* + * Initializes this instance of %Bitmap with the specified dimensions and pixel format. + * + * @since 2.1 + * + * @return An error code + * @param[in] dim The dimensions of the bitmap @n + * The width and height must be greater than @c 0. + * @param[in] format The pixel format + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * + */ + result Construct(const FloatDimension& dim, BitmapPixelFormat format); + + /* + * Initializes this instance of %Bitmap by copying the specified rectangular area of the specified canvas. + * + * @since 2.1 + * + * @return An error code + * @param[in] canvas The canvas to copy @n + * The canvas must be constructed successfully before it is passed into this method. @n + * If not, an E_INVALID_ARG exception is returned. + * @param[in] rect The rectangular area of the canvas to be copied into a bitmap @n + * The width and height of the rectangle must be greater than @c 0. @n + * The rectangle defined by @c rect is clipped to the edges of the canvas so that + * the rectangle does not fall outside the edges of the canvas. @n + * The rectangle must not fall outside the edges of the canvas entirely. @n + * If these conditions are not satisfied, an E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * + */ + result Construct(const Canvas& canvas, const FloatRectangle& rect); + + /* + * Initializes this instance of %Bitmap by copying a rectangular area of the specified bitmap. + * + * @since 2.1 + * + * @return An error code + * @param[in] bitmap The source bitmap @n + * The bitmap must be constructed successfully before it is passed into this method. @n + * If not, an E_INVALID_ARG exception is returned. + * @param[in] rect The rectangular area of the source bitmap to be copied into this bitmap @n + * The width and height of the rectangle must be greater than @c 0. @n + * The rectangle defined by @c rect is clipped to the edges of the source bitmap so that + * the rectangle does not fall outside the edges of the source bitmap. @n + * The rectangle must not fall outside the edges of the source bitmap entirely. @n + * If these conditions are not satisfied, an E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * + */ + result Construct(const Bitmap& bitmap, const FloatRectangle& rect); + public: /** * Scales the bitmap to the specified width and height. @@ -215,6 +297,20 @@ public: */ result Scale(const Dimension& dim); + /* + * Scales the bitmap to the specified width and height. + * + * @since 2.1 + * + * @return An error code + * @param[in] dim The dimensions of the specified rectangular area @n + * The width and height must be greater than @c 0. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * + */ + result Scale(const FloatDimension& dim); + /** * Merges the specified area of the source bitmap into the calling bitmap at the given Point. * @@ -235,6 +331,26 @@ public: */ result Merge(const Point& destPoint, const Bitmap& srcBitmap, const Rectangle& srcRect); + /* + * Merges the specified area of the source bitmap into the calling bitmap at the given Point. + * + * @since 2.1 + * + * @return An error code + * @param[in] destPoint The X and Y coordinate of the top-left corner of the destination area in the calling bitmap instance + * @param[in] srcBitmap The source bitmap instance to copy from + * @param[in] srcRect The rectangular area to copy from the source bitmap @n + The width and height of the rectangle must be greater than or equal to @c 0. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE Either of the following conditions has occurred: @n + * - The value of the argument is outside the valid range defined by the method. @n + * - The destX, destY, srcX, or srcY has a negative value. @n + * - The specified @c srcWidth or @c srcHeight is less than @c 0. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * + */ + result Merge(const FloatPoint& destPoint, const Bitmap& srcBitmap, const FloatRectangle& srcRect); + /** * Gets the height of the bitmap. * @@ -246,6 +362,28 @@ public: */ int GetHeight(void) const; + /* + * Gets the height of the bitmap. + * + * @since 2.1 + * + * @return The height of the bitmap, @n + * else @c -1 if the method fails + * + */ + float GetHeightF(void) const; + + /* + * Gets the actual height of the bitmap. + * + * @since 2.1 + * + * @return The actual height of the bitmap, @n + * else @c -1.0f if the method fails + * + */ + float GetActualHeight(void) const; + /** * Gets the width of the bitmap. * @@ -257,6 +395,28 @@ public: */ int GetWidth(void) const; + /* + * Gets the width of the bitmap. + * + * @since 2.1 + * + * @return The width of the bitmap, @n + * else @c -1 if the method fails + * + */ + float GetWidthF(void) const; + + /* + * Gets the actual width of the bitmap. + * + * @since 2.1 + * + * @return The actual width of the bitmap, @n + * else @c -1.0f if the method fails + * + */ + float GetActualWidth(void) const; + /** * Gets the number of bits per pixel of the bitmap. * diff --git a/inc/FGrpCanvas.h b/inc/FGrpCanvas.h index 1d60357..e454507 100644 --- a/inc/FGrpCanvas.h +++ b/inc/FGrpCanvas.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,20 @@ public: */ result Construct(const Rectangle& rect); + /* + * Initializes this instance of %Canvas with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the canvas control on the device screen @n + * The width and height of the rectangle must be greater than @c 0.0f. + * If this condition is not satisfied, the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result Construct(const FloatRectangle& rect); + /** * Initializes this instance of %Canvas with the buffer information. * @@ -143,6 +158,22 @@ public: */ result Clear(const Rectangle& rect); + /* + * Clears a rectangular region of the current instance of %Canvas with the background color. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the rectangular region @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangular region must not fall outside the edges of the + * current instance of %Canvas entirely.If these conditions are not + * satisfied, the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result Clear(const FloatRectangle& rect); + /** * Copies the specified rectangular region from the specified instance of %Canvas to the current instance of * %Canvas at the specified location. @@ -162,6 +193,25 @@ public: */ result Copy(const Point& destPoint, const Canvas& srcCanvas, const Rectangle& srcRect); + /* + * Copies the specified rectangular region from the specified instance of %Canvas to the current instance of + * %Canvas at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] destPoint The location to copy the rectangular region + * @param[in] srcCanvas The source %Canvas + * @param[in] srcRect The location and size of the rectangular region on the source %Canvas @n + * The rectangular region must not fall outside the edges of + * the current instance of %Canvas entirely. If this condition is + * not satisfied, the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result Copy(const FloatPoint& destPoint, const Canvas& srcCanvas, const FloatRectangle& srcRect); + /** * Copies the scaled image of the specified rectangular region from the specified instance of * %Canvas to the current instance of %Canvas. @@ -185,6 +235,29 @@ public: */ result Copy(const Rectangle& destRect, const Canvas& srcCanvas, const Rectangle& srcRect); + /* + * Copies the scaled image of the specified rectangular region from the specified instance of + * %Canvas to the current instance of %Canvas. + * + * @since 2.1 + * + * @return An error code + * @param[in] destRect The location and size of the destination image @n + * The value of @c destRect must not fall outside the edges of + * the current instance of %Canvas entirely. If this condition is + * not satisfied, the E_OUT_OF_RANGE exception is returned. + * @param[in] srcCanvas The source %Canvas + * @param[in] srcRect The location and size of the source image @n + * The value of @c srcRect must not fall outside the edges of + * the current instance of %Canvas entirely. If this condition is + * not satisfied, the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of this operation. + */ + result Copy(const FloatRectangle& destRect, const Canvas& srcCanvas, const FloatRectangle& srcRect); + /** * Gets the line style set for the current instance of %Canvas. * @@ -206,6 +279,17 @@ public: */ int GetLineWidth(void) const; + /* + * Gets the line width of the current instance of %Canvas. + * + * @since 2.1 + * + * @return The line width, @n + * else @c -1.0f if the method fails + * @remarks The default value is 1.0f. + */ + float GetLineWidthF(void) const; + /** * Sets the line style for the current instance of %Canvas. * @@ -231,6 +315,19 @@ public: */ result SetLineWidth(int width); + /* + * Sets the line width for the current instance of %Canvas. + * + * @since 2.1 + * + * @return An error code + * @param[in] width The new width for the %Canvas control @n + * The width for the %Canvas control must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result SetLineWidth(float width); + /** * Gets the dash pattern of the current instance of %Canvas. * @@ -244,6 +341,19 @@ public: */ result GetDashPattern(Tizen::Base::Collection::IListT& pattern, int& offset) const; + /* + * Gets the dash pattern of the current instance of %Canvas. + * + * @since 2.1 + * + * @return An error code + * @param[out] pattern The list containing the information of dash pattern. + * @param[out] offset The offset into the dash pattern at which the stroke must start + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specific input parameter is invalid. + */ + result GetDashPattern(Tizen::Base::Collection::IListT& pattern, float& offset) const; + /** * Sets the dash pattern for the current instance of %Canvas. * @@ -257,6 +367,63 @@ public: */ result SetDashPattern(const Tizen::Base::Collection::IListT& pattern, int offset); + /* + * Sets the dash pattern for the current instance of %Canvas. + * + * @since 2.1 + * + * @return An error code + * @param[in] pattern The list containing the information of dash pattern. + * @param[in] offset The offset into the dash pattern at which the stroke must start + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specific input parameter is invalid. + */ + result SetDashPattern(const Tizen::Base::Collection::IListT& pattern, float offset); + + /** + * Sets the line cap style. + * + * @since 2.1 + * + * @return An error code + * @param[in] lineCapStyle The new line cap style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is invalid. + */ + result SetLineCapStyle(LineCapStyle lineCapStyle); + + /** + * Gets the line cap style for the current instance. + * + * @since 2.1 + * + * @return Current line cap style + * @remarks The default style is LINE_CAP_STYLE_ROUND. + */ + LineCapStyle GetLineCapStyle(void) const; + + /** + * Sets the line join style. + * + * @since 2.1 + * + * @return An error code + * @param[in] lineJoinStyle The new line join style. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is invalid. + */ + result SetLineJoinStyle(LineJoinStyle lineJoinStyle); + + /** + * Gets the line join style for the current instance. + * + * @since 2.1 + * + * @return Current line join style + * @remarks The default style is LINE_JOIN_STYLE_ROUND. + */ + LineJoinStyle GetLineJoinStyle(void) const; + /** * Gets the color information at the specified point. * @@ -272,6 +439,21 @@ public: */ result GetPixel(const Point& point, Color& color) const; + /* + * Gets the color information at the specified point. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n + * The point must not fall outside the edges of %Canvas. If this + * condition is not satisfied, the E_OUT_OF_RANGE exception is returned. + * @param[out] color An instance of Color + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result GetPixel(const FloatPoint& point, Color& color) const; + /** * Sets a point at the specified coordinate. * @@ -287,6 +469,21 @@ public: */ result SetPixel(const Point& point); + /* + * Sets a point at the specified coordinate. + * + * @since 2.0 + * + * @return An error code + * @param[in] point The location of the point relative to the upper-left corner of the current instance of %Canvas @n + * The point must not entirely fall outside the edges of %Canvas. + * If this condition is not satisfied, the E_OUT_OF_RANGE exception + * is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result SetPixel(const FloatPoint& point); + /** * Draws a line between the two specified points. * @@ -299,6 +496,18 @@ public: */ result DrawLine(const Point& point1, const Point& point2); + /* + * Draws a line between the two specified points. + * + * @since 2.1 + * + * @return An error code + * @param[in] point1 The starting point + * @param[in] point2 The end point + * @exception E_SUCCESS The method is successful. + */ + result DrawLine(const FloatPoint& point1, const FloatPoint& point2); + /** * Draws a rectangle. * @@ -315,6 +524,22 @@ public: */ result DrawRectangle(const Rectangle& rect); + /* + * Draws a rectangle. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The rectangle to be drawn on the %Canvas control @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of + * the %Canvas control. If these conditions are not satisfied, + * the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result DrawRectangle(const FloatRectangle& rect); + /** * Fills a rectangular region of the current instance of %Canvas with the specified color. * @@ -332,6 +557,23 @@ public: */ result FillRectangle(const Color& color, const Rectangle& rect); + /* + * Fills a rectangular region of the current instance of %Canvas with the specified color. + * + * @since 2.1 + * + * @return An error code + * @param[in] color The fill color + * @param[in] rect The rectangular region on the %Canvas control @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result FillRectangle(const Color& color, const FloatRectangle& rect); + /** * Draws a round-edged rectangle. * @@ -350,6 +592,24 @@ public: */ result DrawRoundRectangle(const Rectangle& rect, const Dimension& arcDim); + /* + * Draws a round-edged rectangle. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @param[in] arcDim The width and height of the round edge @n + * The width and height in the @c arcDim parameter must be greater than or equal to @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result DrawRoundRectangle(const FloatRectangle& rect, const FloatDimension& arcDim); + /** * Draws a filled rectangle. * @@ -369,6 +629,25 @@ public: */ result FillRoundRectangle(const Color& color, const Rectangle& rect, const Dimension& arcDim); + /* + * Draws a filled rectangle. + * + * @since 2.1 + * + * @return An error code + * @param[in] color The fill color + * @param[in] rect The location and size of the rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @param[in] arcDim The width and height of the round edge @n + * The width and height mentioned in the @c arcDim parameter must be greater than or equal to @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result FillRoundRectangle(const Color& color, const FloatRectangle& rect, const FloatDimension& arcDim); + /** * Draws an ellipse. * @@ -385,6 +664,22 @@ public: */ result DrawEllipse(const Rectangle& rect); + /* + * Draws an ellipse. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the bounding rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result DrawEllipse(const FloatRectangle& rect); + /** * Draws a filled ellipse with the specified color. * @@ -402,6 +697,23 @@ public: */ result FillEllipse(const Color& color, const Rectangle& rect); + /* + * Draws a filled ellipse with the specified color. + * + * @since 2.1 + * + * @return An error code + * @param[in] color The fill color + * @param[in] rect The location and size of the bounding rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. @n + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result FillEllipse(const Color& color, const FloatRectangle& rect); + /** * Draws a circular arc. * @@ -422,6 +734,26 @@ public: */ result DrawArc(const Rectangle& rect, int startAngle, int endAngle, ArcStyle arcStyle); + /* + * Draws a circular arc. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the bounding rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If these conditions are not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @param[in] startAngle The starting angle + * @param[in] endAngle The ending angle + * @param[in] arcStyle The arc style + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result DrawArc(const FloatRectangle& rect, float startAngle, float endAngle, ArcStyle arcStyle); + /** * Draws a triangle. * @@ -435,6 +767,19 @@ public: */ result DrawTriangle(const Point& point1, const Point& point2, const Point& point3); + /* + * Draws a triangle. + * + * @since 2.1 + * + * @return An error code + * @param[in] point1 The location of the first vertex + * @param[in] point2 The location of the second vertex + * @param[in] point3 The location of the third vertex + * @exception E_SUCCESS The method is successful. + */ + result DrawTriangle(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); + /** * Draw a filled triangle with the specified color. * @@ -449,6 +794,20 @@ public: */ result FillTriangle(const Color& color, const Point& point1, const Point& point2, const Point& point3); + /* + * Draw a filled triangle with the specified color. + * + * @since 2.1 + * + * @return An error code + * @param[in] color The fill color + * @param[in] point1 The location of the first vertex + * @param[in] point2 The location of the second vertex + * @param[in] point3 The location of the third vertex + * @exception E_SUCCESS The method is successful. + */ + result FillTriangle(const Color& color, const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); + /** * Draws a poly-line. * @@ -532,6 +891,22 @@ public: */ result DrawText(const Point& point, const Tizen::Base::String& text); + /* + * Draws a text at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the text + * @param[in] text The text to draw + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OPERATION_FAILED The operation has failed. + * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color. + * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn. + */ + result DrawText(const FloatPoint& point, const Tizen::Base::String& text); + /** * Draws a text at the specified location and length. * @@ -551,6 +926,25 @@ public: */ result DrawText(const Point& point, const Tizen::Base::String& text, int length); + /* + * Draws a text at the specified location and length. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the text + * @param[in] text The text to draw + * @param[in] length The number of characters in the string @n + * It must be greater than or equal to @c 0. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_OPERATION_FAILED The operation has failed. + * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color. + * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn. + */ + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length); + /** * Draws a text with an outline rendering at the specified location. * @@ -569,6 +963,24 @@ public: */ result DrawText(const Point& point, const Tizen::Base::String& text, const Color& outlineColor); + /* + * Draws a text with an outline rendering at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the text + * @param[in] text The text to draw @n + * @param[in] outlineColor The color that is set as outline color + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_OPERATION_FAILED The operation has failed. + * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color. + * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn. + */ + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, const Color& outlineColor); + /** * Draws a text with an outline rendering at the specified location and length. * @@ -590,6 +1002,27 @@ public: */ result DrawText(const Point& point, const Tizen::Base::String& text, int length, const Color& outlineColor); + /* + * Draws a text with an outline rendering at the specified location and length. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the text + * @param[in] text The text to draw + * @param[in] length The number of characters in the string @n + * It must be greater than or equal to @c 0. + * @param[in] outlineColor The color that is set as outline color + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_OPERATION_FAILED The operation has failed. + * + * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color. + * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn. + */ + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int length, const Color& outlineColor); + /** * Draws an enriched text at the specified area. * @@ -606,6 +1039,22 @@ public: */ result DrawText(const Point& point, const EnrichedText& enrichedText); + /* + * Draws an enriched text at the specified area. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the text + * @param[in] enrichedText The TextElement to draw + * @exception E_SUCCESS The method is successful. + * @exception E_DEVICE_UNAVAILABLE A specified device is invalid. + * + * @remarks The foreground color (RGB value only) of the %Canvas control is used as the text color. + * @remarks The em square has a defined font size. As a result, if the font's glyph exceeds its em square, it will be scaled down when it is drawn. + */ + result DrawText(const FloatPoint& point, const EnrichedText& enrichedText); + /** * Draws a bitmap image at the specified location. * @@ -625,6 +1074,25 @@ public: */ result DrawBitmap(const Point& point, const Bitmap& bitmap); + /* + * Draws a bitmap image at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location of the upper-left corner of the bitmap + * @param[in] bitmap The bitmap to draw @n + * It must be constructed before being passed into this + * method. BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is + * not applicable for this method. The bitmap must not + * entirely fall outside the edges of the %Canvas control. If + * this condition is not satisfied, the E_OUT_OF_RANGE exception + * is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap); + /** * Draws a bitmap image at the specified location. * @@ -645,6 +1113,26 @@ public: */ result DrawBitmap(const Rectangle& rect, const Bitmap& bitmap); + /* + * Draws a bitmap image at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the scaled bitmap @n + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If this condition is not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @param[in] bitmap The bitmap to draw @n + * It must be constructed well before being passed into this + * method. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. + */ + result DrawBitmap(const FloatRectangle& rect, const Bitmap& bitmap); + /** * Draws a color data corresponding to a rectangle of pixels from the specified bitmap onto %Canvas. * @@ -677,6 +1165,38 @@ public: */ result DrawBitmap(const Rectangle& destRect, const Bitmap& srcBitmap, const Rectangle& srcRect); + /* + * Draws a color data corresponding to a rectangle of pixels from the specified bitmap onto %Canvas. + * + * @since 2.1 + * + * @return An error code + * @param[in] destRect The destination rectangle of %Canvas @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle defined by @c destRect will be clipped at the edges + * of the %Canvas control to prevent the rectangle from falling + * outside the edges of the %Canvas control. The destination + * rectangle of a %Canvas control must not fall outside the edges + * of the %Canvas control entirely. If these conditions are not + * satisfied, the E_OUT_OF_RANGE exception is returned. + * @param[in] srcBitmap The bitmap to draw + * @param[in] srcRect The source rectangle of a bitmap @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The rectangle defined by @c srcRect will be clipped at the edges + * of the bitmap to prevent the rectangle from falling outside the + * edges of the bitmap. The source rectangle of a bitmap must not + * fall outside the edges of the bitmap entirely. If these + * conditions are not satisfied, the E_OUT_OF_RANGE exception is + * thrown. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @remarks If the source and destination rectangles are not of the same size, + * the source bitmap is stretched to match the destination rectangle. @n + * BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. + */ + result DrawBitmap(const FloatRectangle& destRect, const Bitmap& srcBitmap, const FloatRectangle& srcRect); + /** * Draws a flipped bitmap image at the specified location. * @@ -693,6 +1213,22 @@ public: */ result DrawBitmap(const Point& point, const Bitmap& bitmap, FlipDirection dir); + /* + * Draws a flipped bitmap image at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The location to draw the bitmap + * @param[in] bitmap The bitmap to draw @n + * It must be constructed before being passed to this method. + * @param[in] dir The flip direction + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. + */ + result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, FlipDirection dir); + /** * Draws a rotated bitmap image at the specified location. * @@ -715,6 +1251,28 @@ public: */ result DrawBitmap(const Point& point, const Bitmap& bitmap, const Point& pivot, int degree); + /* + * Draws a rotated bitmap image at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] point A location to draw a bitmap image @n + * This location is relatively defined from the origin (upper-left + * corner) of the %Canvas control. + * @param[in] bitmap The bitmap to draw @n + * It must be constructed before being passed to this method. + * @param[in] pivot The center of rotation of a bitmap image @n + * This center is relatively defined from the origin (upper-left + * corner) of the bitmap. + * @param[in] degree The amount of rotation in degrees + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. + * @image html graphics_rotatebitmap.PNG + */ + result DrawBitmap(const FloatPoint& point, const Bitmap& bitmap, const FloatPoint& pivot, float degree); + /** * Draws a nine-patched bitmap at the specified location. * @@ -739,6 +1297,30 @@ public: */ result DrawNinePatchedBitmap(const Rectangle& rect, const Bitmap& bitmap); + /* + * Draws a nine-patched bitmap at the specified location. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the nine-patched bitmap @n + * The rectangle must not entirely fall outside the edges of the + * %Canvas control. If this condition is not satisfied, the + * E_OUT_OF_RANGE exception is returned. + * @param[in] bitmap The bitmap to draw @n + * It must be constructed before being passed to this method. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * + * @remarks BitmapPixelFormat::BITMAP_PIXEL_FORMAT_R8G8B8A8 is not applicable for this method. @n + * The nine-patched bitmap must have a stretchable section by drawing one (or more) 1-pixel-wide black line(s) in the + * left and top part of the border. + * @image html graphics_ninepatchedbitmap.PNG + * + */ + result DrawNinePatchedBitmap(const FloatRectangle& rect, const Bitmap& bitmap); + /** * Shows the current instance of %Canvas on the device screen. * @@ -804,6 +1386,26 @@ public: */ Rectangle GetBounds(void) const; + /* + * Gets the location and size of the current %Canvas instance on the device screen. + * + * @since 2.1 + * + * @return The Rectangle instance containing the location and size of the current %Canvas instance + * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h). + */ + FloatRectangle GetBoundsF(void) const; + + /* + * Gets the actual location and size of the current %Canvas instance on the device screen. + * + * @since 2.1 + * + * @return The Rectangle instance containing the actual location and size of the current %Canvas instance + * @remarks If this %Canvas instance is a Window %Canvas, it returns FloatRectangle(0.0f, 0.0f, w, h). + */ + FloatRectangle GetActualBounds(void) const; + /** * Sets the clip rectangle for a %Canvas control. @n * When a clip rectangle is set, any drawing is restricted within the specified rectangular area. The @@ -823,6 +1425,25 @@ public: */ result SetClipBounds(const Rectangle& rect); + /* + * Sets the clip rectangle for a %Canvas control. @n + * When a clip rectangle is set, any drawing is restricted within the specified rectangular area. The + * rectangular area defined is clipped at the edges of the %Canvas control so as to prevent the clipped rectangle + * from falling outside the %Canvas control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the clip rectangle @n + * The width and height of the rectangle must be greater than or equal to @c 0.0f. + * The clip rectangle for a %Canvas control must not entirely fall + * outside the edges of the %Canvas control. If these conditions are + * not satisfied, the E_OUT_OF_RANGE exception is returned. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result SetClipBounds(const FloatRectangle& rect); + /** * Gets the bounds of the clip rectangle of a %Canvas control. * @@ -832,6 +1453,15 @@ public: */ Rectangle GetClipBounds(void) const; + /* + * Gets the bounds of the clip rectangle of a %Canvas control. + * + * @since 2.1 + * + * @return An instance of Rectangle indicating the bounds of the clip rectangle + */ + FloatRectangle GetClipBoundsF(void) const; + /** * Locks the %Canvas control for direct pixel access. @n * This sets up a %Canvas control for accessing the pixels directly. Between the calls to the @@ -929,6 +1559,29 @@ public: */ result SetPosition(int x, int y); + /** + * Sets the composite mode. + * + * @since 2.1 + * + * @return An error code + * @param[in] compositeMode The new composite mode + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is invalid. + */ + result SetCompositeMode(CompositeMode compositeMode); + + /** + * Gets the composite mode for the current instance. + * + * @since 2.1 + * + * @return Current composite mode + * @remarks The default value is COMPOSITE_MODE_SRC_OVER. + */ + CompositeMode GetCompositeMode(void) const; + + private: // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. diff --git a/inc/FGrpCanvasCommon.h b/inc/FGrpCanvasCommon.h index 9b1746a..cec684f 100644 --- a/inc/FGrpCanvasCommon.h +++ b/inc/FGrpCanvasCommon.h @@ -74,6 +74,64 @@ enum FlipDirection FLIP_DIRECTION_MIN = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. }; +/** + * @enum LineCapStyle + * + * Defines the line cap style. + * + * @since 2.1 + */ +enum LineCapStyle +{ + LINE_CAP_STYLE_ROUND, /**< A rounded end */ + LINE_CAP_STYLE_BUTT, /**< A flat end */ + LINE_CAP_STYLE_SQUARE /**< A square end */ +}; + +/** + * @enum LineJoin + * + * Defines the line join style. + * + * @since 2.1 + */ +enum LineJoinStyle +{ + LINE_JOIN_STYLE_ROUND, /**< A rounded corner */ + LINE_JOIN_STYLE_MITER, /**< A sharp corner */ + LINE_JOIN_STYLE_BEVEL /**< A beveled corner */ +}; + +/** +* @enum CompositeMode +* +* Defines the composite mode. +* +* @since 2.1 +*/ +enum CompositeMode +{ + COMPOSITE_MODE_CLEAR, /**< Clearing destination layer */ + COMPOSITE_MODE_SRC, /**< Replacing destination layer */ + COMPOSITE_MODE_DST, /**< Ignoring the source */ + COMPOSITE_MODE_SRC_OVER, /**< Drawing source layer on top of destination layer */ + COMPOSITE_MODE_DST_OVER, /**< Drawing destination on top of source */ + COMPOSITE_MODE_SRC_IN, /**< Drawing source where there was destination content */ + COMPOSITE_MODE_DST_IN, /**< Leaving destination only where there was source content */ + COMPOSITE_MODE_SRC_OUT, /**< Drawing source where there was no destination content */ + COMPOSITE_MODE_DST_OUT, /**< Leaving destination only where there was no source content */ + COMPOSITE_MODE_SRC_ATOP, /**< Drawing source on top of destination content and only there */ + COMPOSITE_MODE_DST_ATOP, /**< Leaving destination on top of source content and only there */ + COMPOSITE_MODE_DST_XOR, /**< Source and destination are shown where there is only one of them. */ + COMPOSITE_MODE_ADD, /**< Source and destination layers are accumulated */ + COMPOSITE_MODE_SATURATE, /**< Assuming source and destination are disjoint geometries, like over */ + COMPOSITE_MODE_MULTIPLY, /**< Source and destination layers are multiplied. This causes the result to be at least as dark as the darker inputs. */ + COMPOSITE_MODE_SCREEN, /**< Source and destination are complemented and multiplied. This causes the result to be at least as light as the lighter inputs. */ + COMPOSITE_MODE_OVERLAY, /**< This mode multiplies or screens, depending on the lightness of the destination color. */ + COMPOSITE_MODE_DARKEN, /**< This mode replaces the destination with the source if it is darker, otherwise keeps the source. */ + COMPOSITE_MODE_LIGHTEN /**< This mode replaces the destination with the source if it is lighter, otherwise keeps the source. */ +}; + } } // Tizen::Graphics #endif // _FGRP_CANVAS_COMMON_H_ diff --git a/inc/FGrpCanvasTexture.h b/inc/FGrpCanvasTexture.h index af87599..3fc2f2c 100644 --- a/inc/FGrpCanvasTexture.h +++ b/inc/FGrpCanvasTexture.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, @@ -79,7 +79,7 @@ public: * @exception E_INVALID_ARG Input parameter is invalid. * @exception E_UNSUPPORTED_OPERATION The target device does not support full features for %CanvasTexture. * @exception E_INVALID_STATE Getting egl information failed. It is necessary to bind egl context by using eglMakeCurrent funtion. - * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. + * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. */ result Construct(int textureId, int width, int height); diff --git a/inc/FGrpCoordinateSystem.h b/inc/FGrpCoordinateSystem.h index 1fdc0d6..f95ba3e 100644 --- a/inc/FGrpCoordinateSystem.h +++ b/inc/FGrpCoordinateSystem.h @@ -27,6 +27,9 @@ #include +#include +#include +#include namespace Tizen { namespace Graphics @@ -73,6 +76,16 @@ public: static int ConvertToLogicalX(int physicalX); /** + * Converts the physical value along x-axis to the logical one. + * + * @since 2.1 + * + * @return The converted logical value for the physical one + * @param[in] physicalX An input physical value to be converted + */ + static float ConvertToLogicalX(float physicalX); + + /** * Converts the physical value along y-axis to the logical one. * * @since 2.0 @@ -83,6 +96,16 @@ public: static int ConvertToLogicalY(int physicalY); /** + * Converts the physical value along y-axis to the logical one. + * + * @since 2.1 + * + * @return The converted logical value for the physical one + * @param[in] physicalY An input physical value to be converted + */ + static float ConvertToLogicalY(float physicalY); + + /** * Converts the logical value along x-axis to the physical one. * * @since 2.0 @@ -93,6 +116,16 @@ public: static int ConvertToPhysicalX(int logicalX); /** + * Converts the logical value along x-axis to the physical one. + * + * @since 2.1 + * + * @return The converted physical X value + * @param[in] logicalX An input logical value to be converted + */ + static float ConvertToPhysicalX(float logicalX); + + /** * Converts the logical value along y-axis to the physical one. * * @since 2.0 @@ -102,6 +135,46 @@ public: */ static int ConvertToPhysicalY(int logicalY); + /** + * Converts the logical value along y-axis to the physical one. + * + * @since 2.1 + * + * @return The converted physical Y value + * @param[in] logicalY An input logical value to be converted + */ + static float ConvertToPhysicalY(float logicalY); + + /** + * Returns the FloatPoint which will be pixel-exact in the device coordinate system, for best appearance on the display. + * + * @since 2.1 + * + * @return Device aligned point + * @param[in] point input point to be aligned. + */ + static FloatPoint AlignToDevice(const FloatPoint& point); + + /** + * Returns the FloatDimension which will be pixel-exact in the device coordinate system, for best appearance on the display. + * + * @since 2.1 + * + * @return Device aligned dimension + * @param[in] dimension input dimension to be aligned. + */ + static FloatDimension AlignToDevice(const FloatDimension& dimension); + + /** + * Returns the FloatRectangle which will be pixel-exact in the device coordinate system, for best appearance on the display. + * + * @since 2.1 + * + * @return Device aligned rectangle + * @param[in] rectangle input rectangle to be aligned. + */ + static FloatRectangle AlignToDevice(const FloatRectangle& rectangle); + private: // // This default constructor is intentionally declared as private because this class cannot be constructed. @@ -118,3 +191,4 @@ private: }} // Tizen::Graphics #endif // _FGRP_COORDINATE_SYSTEM_H_ + diff --git a/inc/FGrpEnrichedText.h b/inc/FGrpEnrichedText.h old mode 100644 new mode 100755 index cf9f8dd..c1d1f72 --- a/inc/FGrpEnrichedText.h +++ b/inc/FGrpEnrichedText.h @@ -1,4 +1,5 @@ // +// // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // @@ -6,7 +7,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, @@ -105,13 +106,12 @@ using namespace Tizen::App; using namespace Tizen::Graphics; bool -MyClass::EnrichedTextSample(void) +MyClass::EnrichedTextSample(Canvas& canvas) { result r = E_SUCCESS; EnrichedText* pEnrichedText = null; TextElement* pTextElement1 = null; TextElement* pTextElement2 = null; - Bitmap* pBitmap = null; // Creates an EnrichedText instance and sets the attributes pEnrichedText = new EnrichedText(); @@ -148,23 +148,12 @@ MyClass::EnrichedTextSample(void) } pTextElement2->SetTextColor(Color::GetColor(COLOR_ID_VIOLET)); - // Creates a bitmap and scales the size - pBitmap = App::GetInstance()->GetAppResource()->GetBitmapN(L"example.bmp"); - pBitmap->Scale(Dimension(40, 40)); - // Adds the TextElement and the bitmap to the EnrichedText pEnrichedText->Add(*pTextElement1); pEnrichedText->Add(*pTextElement2); - pEnrichedText->Add(*pBitmap); // Draws { - Canvas canvas; - r = canvas.Construct(); - if (IsFailed(r)) - { - goto CATCH; - } canvas.SetBackgroundColor(Color::GetColor(COLOR_ID_BLACK)); canvas.Clear(); canvas.FillRectangle(Color::GetColor(COLOR_ID_WHITE), Rectangle(50, 50, 380, 380)); @@ -237,6 +226,20 @@ public: result Construct(const Tizen::Graphics::Dimension& dim); /** + * Initializes this instance of %EnrichedText with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] dim The FloatDimension to set for %EnrichedText @n + * The width and height must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_INVALID_ARG The specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatDimension& dim); + + /** * Inserts the TextElement instance in the %EnrichedText instance at the specified index. * * @since 2.0 @@ -362,6 +365,19 @@ public: /** * Sets the text size. * + * @since 2.1 + * + * @return An error code + * @param[in] size The new size of the %EnrichedText @n + * The width and height must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the parameter is outside the valid range defined by the method. + */ + result SetSize(const Tizen::Graphics::FloatDimension& size); + + /** + * Sets the text size. + * * @since 2.0 * * @return An error code @@ -375,6 +391,21 @@ public: result SetSize(int width, int height); /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] width The new width of %EnrichedText @n + * It must be greater than @c 0.0f. + * @param[in] height The new height of %EnrichedText @n + * It must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + */ + result SetSize(float width, float height); + + /** * Gets the size. * * @since 2.0 @@ -385,6 +416,16 @@ public: Tizen::Graphics::Dimension GetSize(void) const; /** + * Gets the size. + * + * @since 2.1 + * + * @return An instance of %FloatDimension containing the width and the height of the %EnrichedText instance + * + */ + Tizen::Graphics::FloatDimension GetSizeF(void) const; + + /** * Gets the size of the %EnrichedText instance. * * @since 2.0 @@ -395,6 +436,16 @@ public: void GetSize(int& width, int& height) const; /** + * Gets the size of the %EnrichedText instance. + * + * @since 2.1 + * + * @param[out] width The width of the control + * @param[out] height The height of the control + */ + void GetSize(float& width, float& height) const; + + /** * Gets the width of the %EnrichedText instance. * * @since 2.0 @@ -404,6 +455,15 @@ public: int GetWidth(void) const; /** + * Gets the width of the %EnrichedText instance. + * + * @since 2.1 + * + * @return The width + */ + float GetWidthF(void) const; + + /** * Gets the height of the %EnrichedText instance. * * @since 2.0 @@ -412,6 +472,14 @@ public: */ int GetHeight(void) const; + /** + * Gets the height of the %EnrichedText instance. + * + * @since 2.1 + * + * @return The height + */ + float GetHeightF(void) const; /** * Sets the vertical alignment. @@ -512,6 +580,19 @@ public: result SetLineSpace(int lineSpace); /** + * Sets the line spacing. + * + * @since 2.1 + * + * @return An error code + * @param[in] lineSpace The space between lines + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * + */ + result SetLineSpace(float lineSpace); + + /** * Gets the line spacing. * * @since 2.0 @@ -521,6 +602,15 @@ public: int GetLineSpace(void) const; /** + * Gets the line spacing. + * + * @since 2.1 + * + * @return space The space between lines + */ + float GetLineSpaceF(void) const; + + /** * Refreshes the texts and bitmap according to the %EnrichedText instance's attributes. @n * If some attributes are changed (such as changes using @ref SetSize), you can get the exact * information of the text position or the number of lines after this method is called. @@ -548,7 +638,16 @@ public: int GetTotalLineHeight(void) const; /** - * Gets the displayed line count of the text in the %EnrichedText instance. @n + * Gets the height of the text in the %EnrichedText instance. + * + * @since 2.1 + * + * @return The line height + */ + float GetTotalLineHeightF(void) const; + + /** + * Gets the displayed line count of the text in the %EnrichedText instance. * * @since 2.0 * @@ -613,6 +712,20 @@ public: int GetLineHeight(int lineIndex) const; /** + * Gets the line height of the specified line. + * + * @since 2.1 + * + * @return The line height, @n + * else @c -1.0f if the method fails + * @param[in] lineIndex The line index + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + float GetLineHeightF(int lineIndex) const; + + /** * Gets the text length of the %EnrichedText object. * * @since 2.0 @@ -641,6 +754,25 @@ public: result GetTextExtent(int startTextIndex, int textLength, int& width, int& height, int& actualLength) const; /** + * Gets the extent of the %EnrichedText instance on the assumption that all TextElements are + * expanded to one line. + * + * @since 2.1 + * + * @return An error code + * @param[in] startTextIndex The starting text index of the %EnrichedText + * @param[in] textLength The length of the specified text @n + * It must be greater than or equal to @c 0. + * @param[out] width The width of the specified text + * @param[out] height The height of the specified text + * @param[out] actualLength The actual text length measured + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const; + + /** * Gets the extent of the %EnrichedText instance on the assumption that all %TextElements are * expanded to one line. * @@ -659,6 +791,23 @@ public: /** * Gets the extent of the %EnrichedText instance on the assumption that all %TextElements are + * expanded to one line. + * + * @since 2.1 + * @return An error code + * @param[in] startTextIndex The starting text index of the EnrichedText + * @param[in] textLength The length of the specified text @n + * It must be greater than or equal to @c 0. + * @param[out] size The extent of the specified text + * @param[out] actualLength The actual text length measured + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int& actualLength) const; + + /** + * Gets the extent of the %EnrichedText instance on the assumption that all %TextElements are * not expanded to one line. This function is useful for finding the extent of EnrichedText spanning multiple lines. * * @since 2.0 @@ -668,6 +817,16 @@ public: Tizen::Graphics::Dimension GetTextExtent(void) const; /** + * Gets the extent of the %EnrichedText instance on the assumption that all %TextElements are + * not expanded to one line. This function is useful for finding the extent of EnrichedText spanning multiple lines. + * + * @since 2.1 + * @return An instance of %FloatDimension containing the extent of the %EnrichedText instance, @n + * else (-1.0f, -1.0f) if the method fails + */ + Tizen::Graphics::FloatDimension GetTextExtentF(void) const; + + /** * Adds the specified bitmap image to the %EnrichedText instance. * * @since 2.0 @@ -715,6 +874,21 @@ public: */ result GetLinkInfoFromPosition(const Point& point, Tizen::Base::Utility::LinkInfo& linkInfo) const; + /* + * Gets the information about the link at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] point A point that is within the %EnrichedText object + * @param[out] linkInfo The LinkInfo object that represents the link at the specified position + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OBJ_NOT_FOUND The required instance is not found. + * @remarks The method throws @c E_OBJ_NOT_FOUND if there is no linked text at the specified position. + * @see Tizen::Base::Utility::LinkInfo + */ + result GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const; /** * Gets the information about the link at the specified position. @@ -734,6 +908,23 @@ public: result GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const; /** + * Gets the information about the link at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The x-coordinate of a point that is within the %EnrichedText object + * @param[in] y The y-coordinate of a point that is within the %EnrichedText object + * @param[out] linkInfo The LinkInfo object that represents the link at the specified position + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OBJ_NOT_FOUND The required instance is not found. + * @remarks The method throws @c E_OBJ_NOT_FOUND if there is no linked text at the specified position. + * @see Tizen::Base::Utility::LinkInfo + */ + result GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const; + + /** * Gets the vertical alignment among text and bitmap element. * * @since 2.0 @@ -764,19 +955,16 @@ private: // This value is for internal use only. Using this value can cause behavioral, security-related, // and consistency-related issues in the application. // + /** + * @since 2.0 + */ class _EnrichedTextImpl * __pImpl; - // - // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // EnrichedText(const EnrichedText& font); - - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // EnrichedText& operator =(const EnrichedText& rhs); + }; // EnrichedText -}} // Tizen::Graphics +} } // Tizen::Graphics -#endif // _FGRP_ENRICHED_TEXT_H_ +#endif // _FGRP_ENRICHED_TEXT_H_ diff --git a/inc/FGrpFloatDimension.h b/inc/FGrpFloatDimension.h index 4d5b46a..1b3a162 100644 --- a/inc/FGrpFloatDimension.h +++ b/inc/FGrpFloatDimension.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, diff --git a/inc/FGrpFloatMatrix4.h b/inc/FGrpFloatMatrix4.h index ceaec8c..0c96507 100644 --- a/inc/FGrpFloatMatrix4.h +++ b/inc/FGrpFloatMatrix4.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, diff --git a/inc/FGrpFloatPoint.h b/inc/FGrpFloatPoint.h index d7de906..851f543 100644 --- a/inc/FGrpFloatPoint.h +++ b/inc/FGrpFloatPoint.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, diff --git a/inc/FGrpFloatPoint3.h b/inc/FGrpFloatPoint3.h index fe91906..e578416 100644 --- a/inc/FGrpFloatPoint3.h +++ b/inc/FGrpFloatPoint3.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, diff --git a/inc/FGrpFloatRectangle.h b/inc/FGrpFloatRectangle.h index 63b6cfb..5271950 100644 --- a/inc/FGrpFloatRectangle.h +++ b/inc/FGrpFloatRectangle.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, @@ -345,3 +345,4 @@ private: }} // Tizen::Graphics #endif // _FGRP_FLOAT_RECTANGLE_H_ + diff --git a/inc/FGrpFloatVector4.h b/inc/FGrpFloatVector4.h index d9633bc..878d70b 100644 --- a/inc/FGrpFloatVector4.h +++ b/inc/FGrpFloatVector4.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, diff --git a/inc/FGrpFont.h b/inc/FGrpFont.h index 1320d26..d0ac1db 100644 --- a/inc/FGrpFont.h +++ b/inc/FGrpFont.h @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace Tizen { namespace Graphics @@ -97,7 +98,7 @@ public: * @endif * @return An error code * @param[in] fontNameOrPath The local file path of a font-resource file or app font name or system font name @n - * The app font name is retrieved using GetFaceName(Osp::Base::String& filepath). + * The app font name is retrieved using GetFaceName(Tizen::Base::String& filepath). * The system font name is retrieved using GetSystemFontListN(). * @param[in] style The font style @n * Multiple styles can be combined using the bitwise OR operator. @@ -143,6 +144,63 @@ public: result Construct(const Tizen::Base::ByteBuffer& fontData, int style, int size); /** + * Initializes this instance of %Font with the specified size and style. @n + * If the size and style are not specified, the default system font is set. + * + * @since 2.1 + * + * @return An error code + * @param[in] style The font style @n + * For more information, see Tizen::Graphics::FontStyle. + * @param[in] size The font size in pixels @n + * The size must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(int style, float size); + + /** + * Initializes this instance of %Font with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] fontNameOrPath The local file path of a font-resource file or system font name @n + * The system font name is retrieved using GetSystemFontListN(). + * @param[in] style The font style @n + * Multiple styles can be combined using the bitwise OR operator. + * @param[in] size The font size in pixels @n + * The size must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. + * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks Only TrueType font is supported. + * The value of fontNameOrPath is considered system font name if it matches one of the retrieved values using GetSystemFontListN(). + * If not, it is considered local file path of a font-resource file. + */ + result Construct(const Tizen::Base::String& fontNameOrPath, int style, float size); + + /** + * Initializes this instance of %Font with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] fontData The font data + * @param[in] style The font style @n + * Multiple styles can be combined using the bitwise OR operator. + * @param[in] size The font size in pixels @n + * The size must be greater than @c 0.0f. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ + result Construct(const Tizen::Base::ByteBuffer& fontData, int style, float size); + + /** * Gets the maximum height of the current instance of %Font. * * @since 2.0 @@ -153,6 +211,16 @@ public: int GetMaxHeight(void) const; /** + * Gets the maximum height of the current instance of %Font. + * + * @since 2.1 + * + * @return The maximum height of the current instance of %Font, @n + * else @c -1.0f if the method fails + */ + float GetMaxHeightF(void) const; + + /** * Gets the maximum width of the current instance of %Font. * * @since 2.0 @@ -163,6 +231,16 @@ public: int GetMaxWidth(void) const; /** + * Gets the maximum width of the current instance of %Font. + * + * @since 2.1 + * + * @return The maximum width of the current instance of %Font, @n + * else @c -1.0f if the method fails + */ + float GetMaxWidthF(void) const; + + /** * Gets the ascender of the current instance of %Font. * * @since 2.0 @@ -173,6 +251,16 @@ public: int GetAscender(void) const; /** + * Gets the ascender of the current instance of %Font. + * + * @since 2.1 + * + * @return The ascender of the current instance of %Font, @n + * else @c -1.0f if the method fails + */ + float GetAscenderF(void) const; + + /** * Gets the descender of the current instance of %Font. * * @since 2.0 @@ -183,6 +271,16 @@ public: int GetDescender(void) const; /** + * Gets the descender of the current instance of %Font. + * + * @since 2.1 + * + * @return The descender of the current instance of %Font, @n + * else @c -1.0f if the method fails + */ + float GetDescenderF(void) const; + + /** * Gets the left bear of a character. * * @since 2.0 @@ -196,6 +294,19 @@ public: result GetLeftBear(wchar_t character, int& leftBear) const; /** + * Gets the left bear of a character. + * + * @since 2.1 + * + * @return An error code + * @param[in] character A character for getting left bear + * @param[out] leftBear The left bear of the specified @c character + * @exception E_SUCCESS The method is successful. + * @exception E_DATA_NOT_FOUND The requested data does not exist. + */ + result GetLeftBear(wchar_t character, float& leftBear) const; + + /** * Gets the right bear of a character. * * @since 2.0 @@ -209,6 +320,19 @@ public: result GetRightBear(wchar_t character, int& rightBear) const; /** + * Gets the right bear of a character. + * + * @since 2.1 + * + * @return An error code + * @param[in] character A character for getting the right bear + * @param[out] rightBear The right bear of the specified @c character + * @exception E_SUCCESS The method is successful. + * @exception E_DATA_NOT_FOUND The requested data does not exist. + */ + result GetRightBear(wchar_t character, float& rightBear) const; + + /** * Gets the width and height of the font used in the specified text. @n * This method retrieves the font dimension of the text. * @@ -246,6 +370,22 @@ public: */ /** + * Gets the width and height of the font used in the specified text. @n + * This method retrieves the font dimension of the text. + * + * @since 2.1 + * + * @return An error code + * @param[in] text The string + * @param[in] length The length of @c text @n + * The length must be greater than or equal to @c 0.0f. + * @param[out] dim The width and height of the font of the @c text + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of @c length is greater than the actual length of @c text. + */ + result GetTextExtent(const Tizen::Base::String& text, int length, FloatDimension& dim) const; + + /** * Checks whether the font style of the current instance is bold. * * @since 2.0 @@ -306,6 +446,16 @@ public: int GetSize(void) const; /** + * Gets the font size of the current instance of %Font. + * + * @since 2.1 + * + * @return The font size, @n + * else @c -1.0f if the method fails + */ + float GetSizeF(void) const; + + /** * Sets the strikeout style for the current instance of %Font. * * @since 2.0 @@ -355,6 +505,15 @@ public: */ void SetCharSpace(int space); + /* + * Sets the character space. + * + * @since 2.1 + * + * @param[in] space A character space + */ + void SetCharSpace(float space); + /** * Gets the character space. * @@ -365,6 +524,16 @@ public: */ int GetCharSpace(void) const; + /* + * Gets the character space. + * + * @since 2.1 + * + * @return The character space of this font instance, @n + * else @c -1.0f if the method fails + */ + float GetCharSpaceF(void) const; + /** * Gets the face name. * @@ -378,20 +547,21 @@ private: friend class _FontImpl; // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. + // This variable is for internal use only. + // Using this variable can cause behavioral, security-related, and consistency-related issues in the application. + // + // @since 2.0 // - /** - * @since 2.0 - */ class _FontImpl* __pImpl; - /* - * This is the copy constructor for the Font class. - * - * @remarks Do not use this constructor. - */ + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // Font(const Font& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // Font& operator =(const Font& rhs); }; // Font diff --git a/inc/FGrpGlPlayer.h b/inc/FGrpGlPlayer.h index 345d3ac..2526b33 100644 --- a/inc/FGrpGlPlayer.h +++ b/inc/FGrpGlPlayer.h @@ -10,7 +10,7 @@ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // diff --git a/inc/FGrpIGlRenderer.h b/inc/FGrpIGlRenderer.h index 8748f7e..96d6353 100644 --- a/inc/FGrpIGlRenderer.h +++ b/inc/FGrpIGlRenderer.h @@ -10,7 +10,7 @@ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // diff --git a/inc/FGrpIVideoTextureUpdateListener.h b/inc/FGrpIVideoTextureUpdateListener.h index fe55f0c..85e4049 100644 --- a/inc/FGrpIVideoTextureUpdateListener.h +++ b/inc/FGrpIVideoTextureUpdateListener.h @@ -6,7 +6,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, @@ -92,4 +92,4 @@ protected: }}} // Tizen::Graphics -#endif //_FGRP_IVIDEO_TEXTURE_UPDATE_LISTENER_H_ \ No newline at end of file +#endif //_FGRP_IVIDEO_TEXTURE_UPDATE_LISTENER_H_ diff --git a/inc/FGrpTextElement.h b/inc/FGrpTextElement.h index f2dfa28..2006978 100644 --- a/inc/FGrpTextElement.h +++ b/inc/FGrpTextElement.h @@ -1,4 +1,5 @@ // +// // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // @@ -6,7 +7,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an AS IS BASIS, @@ -34,281 +35,281 @@ namespace Tizen { namespace Graphics { /** - * @class TextElement - * @brief This class provides methods for the text elements. - * - * @since 2.0 - * - * @final This class is not intended for extension. - * - * The %TextElement class encapsulates the characteristics of a text, such as the constant string and font style. - * A text element draws the text on to a canvas. - * - * For more information on the attributes of %TextElement, see EnrichedText. - * - */ +* @class TextElement +* @brief This class provides methods for the text elements. +* +* @since 2.0 +* +* @final This class is not intended for extension. +* +* The %TextElement class encapsulates the characteristics of a text, such as the constant string and font style. +* A text element draws the text on to a canvas. +* +* For more information on the attributes of %TextElement, see EnrichedText. +* +*/ class _OSP_EXPORT_ TextElement : public Tizen::Base::Object { public: /** - * This is the default constructor for this class. - * - * @since 2.0 - * - * @remarks After creating an instance of this class, one of the - * Construct() methods must be called explicitly to initialize this instance. - */ + * This is the default constructor for this class. + * + * @since 2.0 + * + * @remarks After creating an instance of this class, one of the + * Construct() methods must be called explicitly to initialize this instance. + */ TextElement(void); /** - * This is the destructor for this class. - * - * @since 2.0 - */ + * This is the destructor for this class. + * + * @since 2.0 + */ virtual ~TextElement(void); /** - * Initializes the current instance of %TextElement with the specified text. @n - * If the text is not specified, the default system font is set. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text string - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_INVALID_ARG The specified input parameter is invalid. - */ + * Initializes the current instance of %TextElement with the specified text. @n + * If the text is not specified, the default system font is set. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text string + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_INVALID_ARG The specified input parameter is invalid. + */ result Construct(const Tizen::Base::String& text); /** - * Initializes the current instance of %TextElement with the specified text. @n - * The canvas is used for initializing the font's color attributes, such as the foreground color and the background color. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text string - * @param[in] canvas The canvas to initialize the text element @n - * It sets the foreground and background colors of the text element. - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes the current instance of %TextElement with the specified text. @n + * The canvas is used for initializing the font's color attributes, such as the foreground color and the background color. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text string + * @param[in] canvas The canvas to initialize the text element @n + * It sets the foreground and background colors of the text element. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Base::String& text, const Tizen::Graphics::Canvas& canvas); /** - * Initializes the current instance of %TextElement. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_SYSTEM An unknown operating system error has occurred. - * @remarks To set the text, use the SetText() method. - * @see SetText() - */ + * Initializes the current instance of %TextElement. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_SYSTEM An unknown operating system error has occurred. + * @remarks To set the text, use the SetText() method. + * @see SetText() + */ result Construct(void); /** - * Initializes the current instance of %TextElement to represent a linked text with the specified link information. @n - * If the link information is not specified, the default system font is set. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The linked text string - * @param[in] linkType The link type - * @param[in] link The string that contains the actual link - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM An unknown operating system error has occurred. - * @remarks If the specified @c text is an empty string or - * @c linkType is LINK_TYPE_NONE, the method returns E_INVALID_ARG. - * @see Tizen::Base::Utility::LinkInfo - */ + * Initializes the current instance of %TextElement to represent a linked text with the specified link information. @n + * If the link information is not specified, the default system font is set. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The linked text string + * @param[in] linkType The link type + * @param[in] link The string that contains the actual link + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM An unknown operating system error has occurred. + * @remarks If the specified @c text is an empty string or + * @c linkType is LINK_TYPE_NONE, the method returns E_INVALID_ARG. + * @see Tizen::Base::Utility::LinkInfo + */ result Construct(const Tizen::Base::String& text, Tizen::Base::Utility::LinkType linkType, const Tizen::Base::String& link); /** - * Initializes the current instance of %TextElement with the specified text and autolink mask. @n - * If the text and autolink mask are not specified, the default system font is set. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text string - * @param[in] autoLink The autolink mask @n - * Multiple link types can be combined using the bitwise OR operator (Tizen::Base::Utility::LinkType). @n - * For more information, see AutoLink Detection. - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_SYSTEM An unknown operating system error has occurred. - * @remarks If @c text contains more than one detectable link, the first link is converted - * to a linked text and the rest of the links are ignored. - * @see Tizen::Base::Utility::LinkType - */ + * Initializes the current instance of %TextElement with the specified text and autolink mask. @n + * If the text and autolink mask are not specified, the default system font is set. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text string + * @param[in] autoLink The autolink mask @n + * Multiple link types can be combined using the bitwise OR operator (Tizen::Base::Utility::LinkType). @n + * For more information, see AutoLink Detection. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_SYSTEM An unknown operating system error has occurred. + * @remarks If @c text contains more than one detectable link, the first link is converted + * to a linked text and the rest of the links are ignored. + * @see Tizen::Base::Utility::LinkType + */ result Construct(const Tizen::Base::String& text, unsigned long autoLink); /** - * Initializes the current instance of %TextElement to represent a linked text with the specified link information. @n - * If the link information is not specified, the default system font is set. - * - * @since 2.0. - * - * @return An error code - * @param[in] text The linked text string - * @param[in] linkType The link type - * @param[in] link The string that contains the actual link - * @param[in] canvas The canvas to initialize the text element @n - * It sets the foreground and background colors of the text element. - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM An unknown operating system error has occurred. - * @remarks If the specified @c text is an empty string or - * @c linkType is LINK_TYPE_NONE, the method returns E_INVALID_ARG. - * @see Tizen::Base::Utility::LinkType - */ + * Initializes the current instance of %TextElement to represent a linked text with the specified link information. @n + * If the link information is not specified, the default system font is set. + * + * @since 2.0. + * + * @return An error code + * @param[in] text The linked text string + * @param[in] linkType The link type + * @param[in] link The string that contains the actual link + * @param[in] canvas The canvas to initialize the text element @n + * It sets the foreground and background colors of the text element. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM An unknown operating system error has occurred. + * @remarks If the specified @c text is an empty string or + * @c linkType is LINK_TYPE_NONE, the method returns E_INVALID_ARG. + * @see Tizen::Base::Utility::LinkType + */ result Construct(const Tizen::Base::String& text, Tizen::Base::Utility::LinkType linkType, const Tizen::Base::String& link, const Tizen::Graphics::Canvas& canvas); /** - * Initializes the current instance of %TextElement with the specified text, autolink mask, and graphics canvas. @n - * If the parameters are not specified, the default system font is set. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text string - * @param[in] autoLink The autolink mask @n - * Multiple link types can be combined using the bitwise OR operator (Tizen::Base::Utility::LinkType). @n - * For more information, see AutoLink Detection. - * @param[in] canvas The canvas to initialize the text element @n - * It sets the foreground and background colors of the text element. - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_SYSTEM An unknown operating system error has occurred. - * @remarks If @c text contains more than one detectable link, the first link is converted - * to a linked text and rest of the links are ignored. - * @see Tizen::Base::Utility::LinkType - */ + * Initializes the current instance of %TextElement with the specified text, autolink mask, and graphics canvas. @n + * If the parameters are not specified, the default system font is set. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text string + * @param[in] autoLink The autolink mask @n + * Multiple link types can be combined using the bitwise OR operator (Tizen::Base::Utility::LinkType). @n + * For more information, see AutoLink Detection. + * @param[in] canvas The canvas to initialize the text element @n + * It sets the foreground and background colors of the text element. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @exception E_SYSTEM An unknown operating system error has occurred. + * @remarks If @c text contains more than one detectable link, the first link is converted + * to a linked text and rest of the links are ignored. + * @see Tizen::Base::Utility::LinkType + */ result Construct(const Tizen::Base::String& text, unsigned long autoLink, const Tizen::Graphics::Canvas& canvas); /** - * Gets the string that contains the actual link. - * - * @since 2.0 - * - * @return The string that contains the actual link - * @remarks If the text element contains no linked text, the method returns an empty string. - */ + * Gets the string that contains the actual link. + * + * @since 2.0 + * + * @return The string that contains the actual link + * @remarks If the text element contains no linked text, the method returns an empty string. + */ Tizen::Base::String GetLink(void) const; /** - * Gets the type of the link of the text element. - * - * @since 2.0 - * - * @return The string that contains the actual link - * @remarks If the text element contains no linked text, the method returns LINK_TYPE_NONE. @n - * The link type of the first auto-detected link is returned. - */ + * Gets the type of the link of the text element. + * + * @since 2.0 + * + * @return The string that contains the actual link + * @remarks If the text element contains no linked text, the method returns LINK_TYPE_NONE. @n + * The link type of the first auto-detected link is returned. + */ Tizen::Base::Utility::LinkType GetLinkType(void) const; /** - * Sets the text of %TextElement with the specified string. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The string to set - * @exception E_SUCCESS The method is successful. - */ + * Sets the text of %TextElement with the specified string. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The string to set + * @exception E_SUCCESS The method is successful. + */ result SetText(const Tizen::Base::String& text); /** - * Sets the font of %TextElement. - * - * @since 2.0 - * - * @return An error code - * @param[in] font The font to set - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid. - */ + * Sets the font of %TextElement. + * + * @since 2.0 + * + * @return An error code + * @param[in] font The font to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + */ result SetFont(const Tizen::Graphics::Font& font); /** - * Sets the text color of %TextElement. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The color to set - * @exception E_SUCCESS The method is successful. - */ + * Sets the text color of %TextElement. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The color to set + * @exception E_SUCCESS The method is successful. + */ result SetTextColor(const Tizen::Graphics::Color& color); /** - * Sets the background color of %TextElement. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The color to set - * @exception E_SUCCESS The method is successful. + * Sets the background color of %TextElement. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The color to set + * @exception E_SUCCESS The method is successful. */ result SetBackgroundColor(const Tizen::Graphics::Color& color); /** - * Sets the outline color of %TextElement. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The color to set - * @exception E_SUCCESS The method is successful. - */ + * Sets the outline color of %TextElement. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The color to set + * @exception E_SUCCESS The method is successful. + */ result SetOutlineColor(const Tizen::Graphics::Color& color); /** - * Gets the text of %TextElement. - * - * @since 2.0 - * - * @return A string containing the text - */ + * Gets the text of %TextElement. + * + * @since 2.0 + * + * @return A string containing the text + */ Tizen::Base::String GetText(void) const; /** - * Gets the text color of %TextElement. - * - * @since 2.0 - * - * @return The foreground color - */ + * Gets the text color of %TextElement. + * + * @since 2.0 + * + * @return The foreground color + */ Tizen::Graphics::Color GetTextColor(void) const; /** - * Gets the background color of %TextElement. - * - * @since 2.0 - * - * @return The background color - */ + * Gets the background color of %TextElement. + * + * @since 2.0 + * + * @return The background color + */ Tizen::Graphics::Color GetBackgroundColor(void) const; /** - * Gets the outline color of %TextElement. - * - * @since 2.0 - * - * @return The outline color - */ + * Gets the outline color of %TextElement. + * + * @since 2.0 + * + * @return The outline color + */ Tizen::Graphics::Color GetOutlineColor(void) const; private: @@ -318,20 +319,19 @@ private: // This value is for internal use only. Using this value can cause behavioral, security-related, // and consistency-related issues in the application. // + /** + * @since 2.0 + */ class _TextElementImpl * __pImpl; - // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // TextElement(const TextElement& font); - // // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // TextElement& operator =(const TextElement& rhs); }; // TextElement -}} // Tizen::Graphics +} } // Tizen::Graphics #endif // _FGRP_TEXT_ELEMENT_H_ diff --git a/inc/FGrpVideoTexture.h b/inc/FGrpVideoTexture.h index 5d7f867..ccdb704 100644 --- a/inc/FGrpVideoTexture.h +++ b/inc/FGrpVideoTexture.h @@ -78,7 +78,7 @@ public: * @exception E_INVALID_ARG A specified input parameter is invalid. * @exception E_UNSUPPORTED_OPERATION The target device does not support full features for %VideoTexture. * @exception E_INVALID_STATE Getting egl information failed. It is necessary to bind egl context by using eglMakeCurrent funtion. - * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. + * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. */ result Construct(int textureId, int width, int height); diff --git a/inc/FUi.h b/inc/FUi.h old mode 100644 new mode 100755 index 5667f90..6d07fc3 --- a/inc/FUi.h +++ b/inc/FUi.h @@ -28,9 +28,7 @@ // Includes #include #include -#include #include -#include #include #include #include @@ -59,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -72,6 +71,8 @@ #include #include #include +#include +#include #include #include #include @@ -91,7 +92,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -108,7 +111,6 @@ #include #include #include -#include #include #include #include diff --git a/inc/FUiAccessibilityContainer.h b/inc/FUiAccessibilityContainer.h old mode 100644 new mode 100755 index 6c013af..11c5852 --- a/inc/FUiAccessibilityContainer.h +++ b/inc/FUiAccessibilityContainer.h @@ -84,119 +84,210 @@ private: * @endcode * - * @final This class is not intended for extension. - * This class represents a container for accessibility element. + * @code + +// Sample code for AccessibilitySample.cpp +#include "FApp.h" +#include "FMedia.h" +#include "AccessibilitySample.h" + +using namespace Tizen::App; +using namespace Tizen::Base; +using namespace Tizen::Graphics; +using namespace Tizen::Media; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; + +AccessibilitySample::AccessibilitySample(void) + : __pTizenBitmap(null) +{ +} + +AccessibilitySample::~AccessibilitySample(void) +{ + delete __pTizenBitmap; + __pTizenBitmap = null; +} + +result +AccessibilitySample::Initialize(void) +{ + Image image; + result r = Form::Construct(FORM_STYLE_NORMAL| FORM_STYLE_INDICATOR| FORM_STYLE_HEADER| FORM_STYLE_FOOTER); + r = image.Construct(); + String filepath = App::GetInstance()->GetAppResourcePath() + L"screen-density-xhigh/tizen.png"; + + __pTizenBitmap = image.DecodeN(filepath, BITMAP_PIXEL_FORMAT_ARGB8888); + return r; +} + +result +AccessibilitySample::OnInitializing(void) +{ + result r = E_SUCCESS; + + Header * pHeader = GetHeader(); + if (pHeader != null) + { + pHeader->SetStyle(HEADER_STYLE_TITLE); + pHeader->SetTitleText(L"Acessibility Sample"); + } + + //Draw Image + Canvas* pCanvas = GetCanvasN(); + Rectangle rt = pCanvas->GetBounds(); + int width = rt.width; + int height = rt.width * __pTizenBitmap->GetHeight() / __pTizenBitmap->GetWidth(); + r = pCanvas->DrawBitmap(Rectangle(rt.x, (rt.y + ( (rt.height - height) / 2)), width, height), *__pTizenBitmap); + + //Make accessibility element for drawn image. + AccessibilityElement* pAccessibilityElement = new AccessibilityElement(); + r = pAccessibilityElement->Construct(GetBounds(), L"Tizen Image"); + pAccessibilityElement->SetLabel(L"Tizen Image"); + pAccessibilityElement->SetTrait(L"Image"); + pAccessibilityElement->SetHint(L"This image rotates automatically."); + GetAccessibilityContainer()->AddElement(*pAccessibilityElement); + pAccessibilityElement->SetBounds(Rectangle(rt.x, (rt.y + ( (rt.height - height) / 2)), width, height)); + + Footer* pFooter = GetFooter(); + if (pFooter != null) + { + pFooter->SetStyle(FOOTER_STYLE_TAB); + + FooterItem footerItem1; + footerItem1.Construct(ID_FOOTER_ITEM1); + footerItem1.SetText(L"Item1"); + pFooter->AddItem(footerItem1); + + FooterItem footerItem2; + footerItem2.Construct(ID_FOOTER_ITEM2); + footerItem2.SetText(L"Item2"); + pFooter->AddItem(footerItem2); + + //Set information to system accessibility element. + AccessibilityContainer* pContainer = pFooter->GetAccessibilityContainer(); + AccessibilityElement* pElement = pContainer->GetElement(L"Tab2Text"); + pElement->SetHint(L"Test accessibility"); + } + delete pCanvas; + Invalidate(true); + return r; +} + * @endcode + * */ + class _OSP_EXPORT_ AccessibilityContainer : public Tizen::Base::Object { public: /** - * Gets the owner of the accessibility container - * - * @since 2.0 - * @return The control which owns this %AccessibilityContainer - * @see Control::GetAccessibilityContainer() - */ + * Gets the owner of the accessibility container + * + * @since 2.0 + * @return The control which owns this %AccessibilityContainer + * @see Control::GetAccessibilityContainer() + */ const Control* GetOwner(void) const; /** - * Gets the owner of the accessibility container - * - * @since 2.0 - * @return The control which owns this %AccessibilityContainer - * @see Control::GetAccessibilityContainer() - */ + * Gets the owner of the accessibility container + * + * @since 2.0 + * @return The control which owns this %AccessibilityContainer + * @see Control::GetAccessibilityContainer() + */ Control* GetOwner(void); /** - * Adds the IAccessibilityListener instance to the %AccessibilityContainer. @n - * The added listener gets notified when the accessibility status is changed. - * - * @since 2.0 - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The instance of IAccessibilityListener is already registered. - * @see RemoveAccessibilityListener() - */ + * Adds the IAccessibilityListener instance to the %AccessibilityContainer. @n + * The added listener gets notified when the accessibility status is changed. + * + * @since 2.0 + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The instance of IAccessibilityListener is already registered. + * @see RemoveAccessibilityListener() + */ result AddAccessibilityListener(IAccessibilityListener& listener); /** - * Removes the IAccessibilityListener listener instance. @n - * The removed listener is not notified even when the accessibility status is changed. - * - * - * @since 2.0 - * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The instance of listener is not found. - * @see AddAccessibilityListener() - */ + * Removes the IAccessibilityListener listener instance. @n + * The removed listener is not notified even when the accessibility status is changed. + * + * + * @since 2.0 + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The instance of listener is not found. + * @see AddAccessibilityListener() + */ result RemoveAccessibilityListener(IAccessibilityListener& listener); /** - * Adds the accessibility element to the %AccessibilityContainer. - * - * @since 2.0 - * @return An error code - * @param[in] element The instance of AccessibilityElement - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The instance of AccessibilityElement is already registered. - * @see RemoveElement(), RemoveAllElements() - * - */ + * Adds the accessibility element to the %AccessibilityContainer. + * + * @since 2.0 + * @return An error code + * @param[in] element The instance of AccessibilityElement + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The instance of AccessibilityElement is already registered. + * @see RemoveElement() + * @see RemoveAllElements() + * + */ result AddElement(AccessibilityElement& element); /** - * Removes the accessibility element in the %AccessibilityContainer. - * - * @since 2.0 - * - * @return An error code - * - * @param[in] element The instance of AccessibilityElement - * - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The instance of AccessibilityElement is already registered. - * @see AddElement(), InsertElement() - * - */ + * Removes the accessibility element in the %AccessibilityContainer. + * + * @since 2.0 + * + * @return An error code + * + * @param[in] element The instance of AccessibilityElement + * + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The instance of AccessibilityElement is already registered. + * @see AddElement() + * + */ result RemoveElement(AccessibilityElement& element); /** - * Removes all of the accessibility elements in the %AccessibilityContainer. - * - * @since 2.0 - * - * @see AddElement, InsertElement - * - */ + * Removes all of the accessibility elements in the %AccessibilityContainer. + * + * @since 2.0 + * + * @see AddElement() + * + */ void RemoveAllElements(void); /** - * Gets the instance of accessibility element which is the child of the %AccessibilityContainer by the name. - * - * @since 2.0 - * - * @return The instance of child element, if there exists an element which has the given name @n - * else @c null - * - * @param[in] name The name of AccessibilityElement - * - */ + * Gets the instance of accessibility element which is the child of the %AccessibilityContainer by the name. + * + * @since 2.0 + * + * @return The instance of child element, if there exists an element which has the given name @n + * else @c null + * + * @param[in] name The name of AccessibilityElement + * + */ AccessibilityElement* GetElement(const Tizen::Base::String& name) const; /** - * Gets the list of accessibility elements that are the child of the %AccessibilityContainer. - * - * @since 2.0 - * - * @return The list of child element, if there exists some elements in the container. @n - * else @c null. - * - */ + * Gets the list of accessibility elements that are the child of the %AccessibilityContainer. + * + * @since 2.0 + * + * @return The list of child element, if there exists some elements in the container. @n + * else @c null. + * + */ Tizen::Base::Collection::IList* GetElementsN(void) const; private: diff --git a/inc/FUiAccessibilityElement.h b/inc/FUiAccessibilityElement.h index 824b66a..e5fce5a 100644 --- a/inc/FUiAccessibilityElement.h +++ b/inc/FUiAccessibilityElement.h @@ -32,12 +32,13 @@ namespace Tizen { namespace Base { - class String; + class String; }} //Tizen::Base namespace Tizen { namespace Graphics { - class Rectangle; + class Rectangle; + class FloatRectangle; }} //Tizen::Graphics namespace Tizen { namespace Ui @@ -45,131 +46,160 @@ namespace Tizen { namespace Ui class _AccessibilityElementImpl; /** - * @class AccessibilityElement - * @brief This class represents an accessibility element. - * @since 2.0 - * - * @final This class is not intended for extension. - * This class represents an accessibility element. - */ +* @class AccessibilityElement +* @brief This class represents an accessibility element. +* @since 2.0 +* +* @final This class is not intended for extension. +* This class represents an accessibility element. +*/ class _OSP_EXPORT_ AccessibilityElement : public Tizen::Base::Object { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ AccessibilityElement(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~AccessibilityElement(void); /** - * Initializes the instance of %AccessibilityElement with the specified parameters. - * - * @since 2.0 - * - * @return An error code - * @param[in] bounds The bounds of the accessibility element - * @param[in] name The name of the accessibility element - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG Either the length of name parameter is @c 0, or the bounds are smaller than @c 0. - */ + * Initializes the instance of %AccessibilityElement with the specified parameters. + * + * @since 2.0 + * + * @return An error code + * @param[in] bounds The bounds of the accessibility element + * @param[in] name The name of the accessibility element + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either the length of name parameter is @c 0, or the bounds are smaller than @c 0. + */ result Construct(const Tizen::Graphics::Rectangle& bounds, const Tizen::Base::String& name); /** - * Gets the name of the element. - * - * @since 2.0 - * @return The name of the element - */ + * Initializes the instance of %AccessibilityElement with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] bounds The bounds of the accessibility element + * @param[in] name The name of the accessibility element + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either the length of name parameter is @c 0, or the bounds are smaller than @c 0. + */ + result Construct(const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& name); + + /** + * Gets the name of the element. + * + * @since 2.0 + * @return The name of the element + */ Tizen::Base::String GetName(void) const; /** - * Sets the bounds to the element. - * - * @since 2.0 - * @param[in] bounds The bounds of the accessibility element. - */ + * Sets the bounds to the element. + * + * @since 2.0 + * @param[in] bounds The bounds of the accessibility element. + */ void SetBounds(const Tizen::Graphics::Rectangle& bounds); /** - * Gets the bounds of the element. - * - * @since 2.0 - * @return The bounds of the element - */ + * Sets the bounds to the element. + * + * @since 2.1 + * @param[in] bounds The bounds of the accessibility element. + */ + void SetBounds(const Tizen::Graphics::FloatRectangle& bounds); + + /** + * Gets the bounds of the element. + * + * @since 2.0 + * @return The bounds of the element + */ Tizen::Graphics::Rectangle GetBounds(void) const; /** - * Sets the label to the element. - * - * @since 2.0 - * @param[in] label The label of the accessibility element. - */ + * Gets the bounds of the element. + * + * @since 2.1 + * @return The bounds of the element + */ + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; + + /** + * Sets the label to the element. + * + * @since 2.0 + * @param[in] label The label of the accessibility element. + */ void SetLabel(const Tizen::Base::String& label); /** - * Gets the label of the element. - * - * @since 2.0 - * @return The label of the element - */ + * Gets the label of the element. + * + * @since 2.0 + * @return The label of the element + */ Tizen::Base::String GetLabel(void) const; /** - * Sets the hint to the element. - * - * @since 2.0 - * @param[in] hint The hint of the accessibility element. - */ + * Sets the hint to the element. + * + * @since 2.0 + * @param[in] hint The hint of the accessibility element. + */ void SetHint(const Tizen::Base::String& hint); /** - * Gets the hint of the element. - * - * @since 2.0 - * @return The hint of the element - */ + * Gets the hint of the element. + * + * @since 2.0 + * @return The hint of the element + */ Tizen::Base::String GetHint(void) const; /** - * Sets the trait to the element. - * - * @since 2.0 - * @param[in] trait The trait of the accessibility element. - */ + * Sets the trait to the element. + * + * @since 2.0 + * @param[in] trait The trait of the accessibility element. + */ void SetTrait(const Tizen::Base::String& trait); /** - * Gets the trait of the element. - * - * @since 2.0 - * @return The trait of the element - */ + * Gets the trait of the element. + * + * @since 2.0 + * @return The trait of the element + */ Tizen::Base::String GetTrait(void) const; /** - * Sets the value to the element. - * - * @since 2.0 - * @param[in] value The value of the accessibility element. - */ + * Sets the value to the element. + * + * @since 2.0 + * @param[in] value The value of the accessibility element. + */ void SetValue(const Tizen::Base::String& value); /** - * Gets the value of the element. - * - * @since 2.0 - * @return The value of the element - */ + * Gets the value of the element. + * + * @since 2.0 + * @return The value of the element + */ Tizen::Base::String GetValue(void) const; private: @@ -189,4 +219,4 @@ private: }; // AccessibilityElement }} // Tizen::Ui -#endif //_FUI_ACCESSIBILITY_ELEMENT_H_ +#endif //_FUI_ACCESSIBILITY_ELEMENT_H_ \ No newline at end of file diff --git a/inc/FUiAccessibilityTypes.h b/inc/FUiAccessibilityTypes.h index 5972e35..e6a13b8 100644 --- a/inc/FUiAccessibilityTypes.h +++ b/inc/FUiAccessibilityTypes.h @@ -37,11 +37,11 @@ namespace Tizen { namespace Ui */ enum AccessibilityScreenReaderStatus { - ACCESSIBILITY_SCREEN_READER_STATUS__NONE, /**< initial value.*/ - ACCESSIBILITY_SCREEN_READER_STATUS_ERROR, /**Animating UI Controls. diff --git a/inc/FUiAnimFrameAnimator.h b/inc/FUiAnimFrameAnimator.h index 683632d..5783d3d 100644 --- a/inc/FUiAnimFrameAnimator.h +++ b/inc/FUiAnimFrameAnimator.h @@ -113,14 +113,30 @@ public: * * @return An error code * @param[in] form The form object to set - * @exception E_SUCCESS The method is successful. + * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_SYSTEM A system error has occurred. + * @exception E_SYSTEM A system error has occurred. * @remarks Control::Invalidate() need not be called to display the form. @n * To select the animation to be used during this method, use SetFormTransitionAnimation() before calling this method. */ result SetCurrentForm(const Tizen::Ui::Controls::Form& form); + /** + * Sets the specified form as the current form of the frame with an animation. + * + * @since 2.1 + * + * @return An error code + * @param[in] pForm A pointer to form object to set. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pForm is @c null. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_SYSTEM A system error has occurred. + * @remarks Control::Invalidate() need not be called to display the form. @n + * To select the animation to be used during this method, use SetFormTransitionAnimation() before calling this method. + */ + result SetCurrentForm(Tizen::Ui::Controls::Form* pForm); + /** * Sets the type of the form transition animation. diff --git a/inc/FUiAnimIVisualElementEventListener.h b/inc/FUiAnimIVisualElementEventListener.h index a70d77c..712697a 100644 --- a/inc/FUiAnimIVisualElementEventListener.h +++ b/inc/FUiAnimIVisualElementEventListener.h @@ -63,7 +63,7 @@ public: /** * Called when the child is attached to VisualElement. @n * Overrides the %OnChildAttached() method to provide user-specific code just after the child is attached to the %VisualElement. - * This method is invoked when @c child is attached to @c source by @c AttachChild, @c InsertChild, @c ChangeZOder, or @c SetZOrderGroup. + * This method is invoked when @c child is attached to @c source by @c AttachChild, @c InsertChild, @c ChangeZOder. * * @since 2.0 * @@ -78,7 +78,7 @@ public: /** * Called when the child is detached to VisualElement. @n * Overrides the %OnChildDetached() method to provide user-specific code just after the child is detached from the %VisualElement. - * This method is invoked when @c child is detached from @c source by @c AttachChild, @c InsertChild, @c ChangeZOder, or @c SetZOrderGroup. + * This method is invoked when @c child is detached from @c source by @c DetachChild, @c InsertChild, @c ChangeZOder. * * @since 2.0 * @@ -92,7 +92,7 @@ public: /** * Called when VisualElement is attached to the parent. @n * Overrides the %OnAttached() method to provide user-specific code just after the %VisualElement is attached to the parent. - * This method is invoked when @c source is attached to @c parent by @c AttachChild, @c InsertChild, @c ChangeZOder, or @c SetZOrderGroup. + * This method is invoked when @c source is attached to @c parent by @c AttachChild, @c InsertChild, @c ChangeZOder. * * @since 2.0 * @@ -107,7 +107,7 @@ public: /** * Called when VisualElement is detached to the parent. @n * Overrides the %OnDetached() method to provide user-specific code just after the %VisualElement is detached from the parent. - * This method is invoked when @c source is detached from @c parent by @c AttachChild, @c InsertChild, @c ChangeZOder, @c SetZOrderGroup, or @c DetachChild. + * This method is invoked when @c source is detached from @c parent by @c DetachChild, @c InsertChild, @c ChangeZOder. * * @since 2.0 * diff --git a/inc/FUiAnimVisualElement.h b/inc/FUiAnimVisualElement.h index a25ad79..c684858 100644 --- a/inc/FUiAnimVisualElement.h +++ b/inc/FUiAnimVisualElement.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ class _VisualElementImpl; * It also provides infrastructure necessary for animations (AddAnimation(), RemoveAnimation() and so on). * A %VisualElement object instantiated by applications works as a model object and may have a cloned counter part for presentation on screen which has a separated life-cycle. * The presentation object is managed by system and applications must not change properties of it. + * Use the presentation instance only for getting the current state of the visual element in the tree. If you call the setter methods of the presentation instance, it can cause unexpected behavior. * Most animations of %VisualElement are applied on presentation objects. Properties set by applications are stored in model objects while properties of presentation objects * are changing during implicit or explicit animations. * @@ -182,6 +184,7 @@ public: * * @since 2.0 * + * @return An error code * @param[in] pProvider The content provider to customize information on content * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION This instance does not allow to set a content provider. @n @@ -210,6 +213,7 @@ public: * * @since 2.0 * + * @return An error code * @param[in] pListener The %VisualElement event listener * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION This instance does not allow to set an event listener. @n @@ -388,6 +392,20 @@ public: bool IsChildOf(const VisualElement& other) const; /** + * Checks whether this instance is a child or descendant of the specified one. + * + * @since 2.1 + * + * @return @c true if this instance is a child or descendant of the specified one, @n + * else @c false + * @param[in] pOther A Pointer to %VisualElement instance to test relationship + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pOther is null. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + bool IsChildOf(const VisualElement* pOther) const; + + /** * Attaches a child to this instance. @n * The %AttachChild() method attaches the specified @c child at the highest position in the Z order group of the @c child. * If you need to change Z-Order group, you can change it using the SetZOrderGroup() method. @@ -395,9 +413,9 @@ public: * @since 2.0 * * @return An error code - * @param[in] child The %VisualElement instance to attach to this instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The input parameter is incorrect. Either of the following conditions has occurred: @n + * @param[in] child The %VisualElement instance to attach to this instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is incorrect. Either of the following conditions has occurred: @n * - The specified @c child is not instantiated successfully. @n * - The specified @c child is this instance. @n * - The specified @c child is already an ancestor of this instance. @@ -409,6 +427,28 @@ public: result AttachChild(const VisualElement& child); /** + * Attaches a child to this instance. @n + * The %AttachChild() method attaches the specified @c pChild at the highest position in the Z order group of the @c pChild. + * If you need to change Z-Order group, you can change it using the SetZOrderGroup() method. + * + * @since 2.1 + * + * @return An error code + * @param[in] pChild A pointer to %VisualElement instance to attach to this instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is incorrect. Either of the following conditions has occurred: @n + * - The specified @c pChild is not instantiated successfully. @n + * - The specified @c pChild is this instance. @n + * - The specified @c pChild is already an ancestor of this instance.@n + * - The specified @c pChild is @c null. + * @see SetZOrderGroup() + * @see InsertChild() + * @see DetachChild() + * @see ChangeZOrder() + */ + result AttachChild(VisualElement* pChild); + + /** * Inserts a child to this instance. @n * If @c pReference is not @c null, the Z order group of @c child will be changed into that of @c pReference and @c child will be * placed right above or below the @c pReference instance according to the @c above parameter. @@ -438,13 +478,44 @@ public: result InsertChild(const VisualElement& child, const VisualElement* pReference, bool above); /** + * Inserts a child to this instance. @n + * If @c pReference is not @c null, the Z order group of @c pChild will be changed into that of @c pReference and @c child will be + * placed right above or below the @c pReference instance according to the @c above parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] pChild A pointer to %VisualElement instance to attach to this instance + * @param[in] pReference A pointer to the %VisualElement instance that is referenced + * @param[in] above Specifies the position of @c pChild relative to the @c pReference + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is incorrect. Either of the following conditions has occurred: @n + * - The specified @c pChild is not instantiated successfully. @n + * - The specified @c pChild is this instance. @n + * - The specified @c pChild and @c pReference are same. @n + * - The specified @c pChild is already an ancestor of this instance. @n + * - The parent of @c pReference is not this instance if @c pReference is not @c null. @n + * - The specified @c pChild is @c null. + * @remarks If @c above is @c true, the @c pChild will be attached above @c pReference in Z order, + * else it will be attached below the @c pReference %VisualElement. @n + * If @c pReference is @c null, the @c pChild will be attached at the highest position in the @c pChild's Z order group, + * else the child will be attached at the lowest position in the @c pChild's Z order group. + * @see SetZOrderGroup() + * @see AttachChild() + * @see DetachChild() + * @see ChangeZOrder() + */ + result InsertChild(VisualElement* pChild, const VisualElement* pReference, bool above); + + /** * Detaches a child from this instance. * * @since 2.0 * + * @return An error code * @param[in] child The %VisualElement instance to detach from this instance - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c child is not a child of this instance. + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c child is not a child of this instance. * @remarks This method detaches @c child from this instance. If you need to deallocate %VisualElement, call Destroy() method, not C++ delete. * @see InsertChild() * @see AttachChild() @@ -452,10 +523,27 @@ public: result DetachChild(const VisualElement& child); /** + * Detaches a child from this instance. + * + * @since 2.1 + * + * @return An error code + * @param[in] pChild A pointer to %VisualElement instance to detach from this instance + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c pChild is not a child of this instance. + * @exception E_INVALID_ARG The specified @c pChild is @c null. + * @remarks This method detaches @c pChild from this instance. If you need to deallocate %VisualElement, call Destroy() method, not C++ delete. + * @see InsertChild() + * @see AttachChild() + */ + result DetachChild(VisualElement* pChild); + + /** * Changes Z order of this instance. * * @since 2.0 * + * @return An error code * @param[in] pReference A pointer to the %VisualElement instance that is referenced * @param[in] above Specifies the position of this instance relative to the @c pReference * @exception E_SUCCESS The method is successful. @@ -612,9 +700,7 @@ public: * * @since 2.0 * - * @return The rectangle to update - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks If an exception occurs, this method returns FloatRectangle(0.0, 0.0, -1.0, -1.0). + * @return The rectangle to update * @see InvalidateRectangle() */ Tizen::Graphics::FloatRectangle GetUpdateRectangle(void) const; @@ -656,8 +742,8 @@ public: * else @c null if an exception occurs * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE This instance is in an invalid state. - * @exception E_INVALID_OPERATION The contents of this instance is set by the SetSurface() method. - * @exception E_OUT_OF_RANGE The size of the %VisualElement instance is @c 0 or smaller. + * @exception E_INVALID_OPERATION The contents of this instance is set by the SetSurface() method. @n + The canvas can be created for the model instance only. * @remarks This method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the %VisualElement. * It is the developer's responsibility to deallocate the canvas after use. * The canvas is guaranteed to be valid only if the properties of the parent %VisualElement of the canvas remain unchanged. @@ -666,10 +752,10 @@ public: * @remarks The specific error code can be accessed using the GetLastResult() method. * @remarks If an exception occurs, this method returns @c null. * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) + * @see GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) */ Tizen::Graphics::Canvas* GetCanvasN(void) const; - /** * Creates and returns a graphic canvas of the specified area. * @@ -680,9 +766,10 @@ public: * @param[in] bounds The position relative to the top-left corner of the %VisualElement and size * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE This instance is in an invalid state. - * @exception E_INVALID_OPERATION The contents of this instance is set by the SetSurface() method. + * @exception E_INVALID_OPERATION The contents of this instance is set by the SetSurface() method. @n + The canvas can be created for the model instance only. * @exception E_OUT_OF_RANGE The specified @c bounds do not intersect with the bounds of the %VisualElement. @n - * The width and height must be greater than @c 0. + * The width and height must be greater than or equal to @c 0. * @remarks Only the graphic canvas of displayable %VisualElement can be obtained. * If the specified area is not inside the %VisualElement, * the graphics canvas of overlapped area between the %VisualElement and the specified @c bound is returned. @n @@ -694,10 +781,40 @@ public: * @remarks The specific error code can be accessed using the GetLastResult() method. * @remarks If an exception occurs, this method returns @c null. * @see GetCanvasN() + * @see GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) */ Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const; /** + * Creates and returns a graphic canvas of the specified area. + * + * @since 2.1 + * + * @return The graphic canvas of the %VisualElement, @n + * else @c null if an exception occurs + * @param[in] bounds The position relative to the top-left corner of the %VisualElement and size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @exception E_INVALID_OPERATION The contents of this instance is set by the SetSurface() method. @n + The canvas can be created for the model instance only. + * @exception E_OUT_OF_RANGE The specified @c bounds do not intersect with the bounds of the %VisualElement. @n + * The width and height must be greater than or equal to @c 0. + * @remarks Only the graphic canvas of displayable %VisualElement can be obtained. + * If the specified area is not inside the %VisualElement, + * the graphics canvas of overlapped area between the %VisualElement and the specified @c bound is returned. @n + * This method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the %VisualElement. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if the properties of the parent %VisualElement of the canvas remain unchanged. + * Therefore, one must delete previously allocated canvas and create a new canvas using this method, + * if the size or position of the control is changed. @n + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks If an exception occurs, this method returns @c null. + * @see GetCanvasN() + * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) + */ + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const; + + /** * Gets the name of this instance. * * @since 2.0 @@ -738,7 +855,7 @@ public: * * @since 2.0 * - * @return The property's value + * @return An error code * @param[in] property The %VisualElement's property * @param[in] value The value of the %VisualElement's property to set * @exception E_SUCCESS The method is successful. @@ -1123,6 +1240,7 @@ public: /** * Converts the specified @c point in @c pFromVisualElement coordinate space to this instance's coordinate space. + * The coordinate is converted by projecting it on the root coordinate space. * * @since 2.0 * @@ -1131,14 +1249,17 @@ public: * @param[in] pFromVisualElement The %VisualElement instance with @c point in its coordinate space * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The input parameter is incorrect. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + The matrix for this conversion is singular which has zero determinant. * @remarks This instance and @c pFromVisualElement must share a common ancestor. @n - * If @c null, it is regarded that @c point is in the screen coordinate space. + * If @c null, it is regarded that @c point is in the root coordinate space. * @see ConvertCoordinates(Tizen::Graphics::FloatRectangle& rectangle, const VisualElement* pFromVisualElement) */ result ConvertCoordinates(Tizen::Graphics::FloatPoint& point, const VisualElement* pFromVisualElement) const; /** * Converts the specified @c rectangle in @c pFromVisualElement coordinate space to this instance's coordinate space. + * The coordinate is converted by projecting it on the root coordinate space. * * @since 2.0 * @@ -1147,14 +1268,32 @@ public: * @param[in] pFromVisualElement The %VisualElement instance with @c rectangle in its coordinate space * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The input parameter is incorrect. - * @exception E_SYSTEM A system error has occurred. - * @remarks This instance and @c pFromVisualElement must share a common parent. @n - * If @c null, it is regarded that @c rectangle is in the screen coordinate space. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + The matrix for this conversion is singular which has zero determinant. + * @remarks This instance and @c pFromVisualElement must share a common ancestor. @n + * If @c null, it is regarded that @c rectangle is in the root coordinate space. * @see ConvertCoordinates(Tizen::Graphics::FloatPoint& point, const VisualElement* pFromVisualElement) */ result ConvertCoordinates(Tizen::Graphics::FloatRectangle& rectangle, const VisualElement* pFromVisualElement) const; /** + * Transforms point in @c pOriginVisualElement coordinate space into the specified vector in this instance's coordinate space. + * + * @since 2.1 + * + * @return The transformed vector + * @param[in] originPoint The point in @c pOriginVisualElement coordinate space + * @param[in] pOriginVisualElement The %VisualElement instance with @c originPoint in its coordinate space + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The input parameter is incorrect. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + The matrix for this conversion is singular which has zero determinant. + * @remarks This instance and @c pOriginVisualElement must share a common ancestor. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::FloatPoint3 TransformVectorFromOrigin(const Tizen::Graphics::FloatPoint3& originPoint, const VisualElement* pOriginVisualElement) const; + + /** * Sets the sub-rectangle of contents which this instance must display. * * @since 2.0 diff --git a/inc/FUiAnimVisualElementSurface.h b/inc/FUiAnimVisualElementSurface.h index 2351ece..e445271 100644 --- a/inc/FUiAnimVisualElementSurface.h +++ b/inc/FUiAnimVisualElementSurface.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace Tizen { namespace Graphics { @@ -111,6 +112,23 @@ public: result Construct(const DisplayContext& displayContext, const Tizen::Graphics::Dimension& size); /** + * Initializes this instance of %VisualElementSurface with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] displayContext The display context of the window + * @param[in] size The size of the %VisualElementSurface instance + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The value of the argument is outside the valid range defined by the method. + * @exception E_INVALID_ARG The display context is invalid. + * @remarks The width and height of the @c size parameter is the logical size and must be greater than @c 0. + * @remarks If this condition is not satisfied, the E_OUT_OF_RANGE exception is returned. + * @see Tizen::Ui::Window::GetDisplayContext() + */ + result Construct(const DisplayContext& displayContext, const Tizen::Graphics::FloatDimension& size); + + /** * Gets the buffer-related information of the %VisualElementSurface instance. * * @since 2.0 @@ -135,6 +153,19 @@ public: Tizen::Graphics::Dimension GetSize(void) const; /** + * Gets the size of the %VisualElementSurface instance. + * + * @since 2.1 + * + * @return The size of the %VisualElementSurface instance + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks If an error occurs, this method returns Tizen::Graphics:Dimension(0, 0). + */ + + Tizen::Graphics::FloatDimension GetSizeF(void) const; + + /** * Compares the Tizen::Base::Object instance with the calling %VisualElementSurface instance for equivalence. * * @since 2.0 diff --git a/inc/FUiClipboard.h b/inc/FUiClipboard.h index 3a06497..6360d58 100644 --- a/inc/FUiClipboard.h +++ b/inc/FUiClipboard.h @@ -140,7 +140,7 @@ ClipboardSample::OnActionPerformed(const Tizen::Ui::Control& source, int actionI | CLIPBOARD_DATA_TYPE_HTML | CLIPBOARD_DATA_TYPE_AUDIO | CLIPBOARD_DATA_TYPE_VIDEO ); - + //Gets data from the clipboard item String* pString = dynamic_cast(pItem->GetData()); @@ -171,7 +171,7 @@ public: * clipboard that can be obtained through this method. @n * The method returns @c null if a system error occurs. */ - static Clipboard* GetInstance(void); + static Clipboard* GetInstance(void); /** * Copies the specified @c item to the system clipboard. diff --git a/inc/FUiClipboardItem.h b/inc/FUiClipboardItem.h index dacd7a8..1c36612 100644 --- a/inc/FUiClipboardItem.h +++ b/inc/FUiClipboardItem.h @@ -58,7 +58,7 @@ public: ClipboardItem(void); /** - * This destructor overrides Osp::Base::Object::~Object(). + * This destructor overrides Tizen::Base::Object::~Object(). * * @since 2.0 */ @@ -103,12 +103,12 @@ public: private: // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // + // ClipboardItem(const ClipboardItem& rhs); // // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // + // ClipboardItem& operator =(const ClipboardItem& rhs); private: diff --git a/inc/FUiCompositeMode.h b/inc/FUiCompositeMode.h index b5654c8..a296288 100644 --- a/inc/FUiCompositeMode.h +++ b/inc/FUiCompositeMode.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiContainer.h b/inc/FUiContainer.h old mode 100644 new mode 100755 index 9418b31..ce9ecda --- a/inc/FUiContainer.h +++ b/inc/FUiContainer.h @@ -102,6 +102,46 @@ public: */ result AddControl(const Control& control); + /* + * Adds the control at the end of the list maintained by the container. + * + * @since 2.1 + * + * @return An error code + * @param[in] control The control to be added to the container + * @param[in] pControl Pointer of the control to be added to the container + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pControl is null. + * The specified @c control is an instance of Window, or this control's parent container. + * @exception E_MAX_EXCEEDED The number of child controls has exceeded the maximum limit. + * @exception E_INVALID_ARG + * @exception E_SYSTEM A system error has occurred. + * @remarks When the control is added, it is placed at the top of the drawing stack maintained by the container.@n + * This means the last control added is drawn last + * @remarks A control becomes displayable only after it has been added to a displayable container. Some methods may not work normally if the methods + * of the control are called before adding the control to a container. After the control is added to a %Container, the OnInitializing() + * method of the control are called before adding the control to a container. After the control is added to a %Container, the + * OnInitializing() method of the control is invoked for the initialization of the control such as creating and adding child controls. + * @see Tizen::Ui::Control::OnInitializing() + * @see Tizen::Ui::Control::OnTerminating() + * @code + * { + * // Uses Panel instead of Container, because Container is an abstract class. + * Panel* pPanel = new Panel(); + * pPanel->Construct(Rectangle(100, 250, 300, 300)); + * + * Form* pForm = new Form(); + * pForm->Construct(FORM_STYLE_NORMAL|FORM_STYLE_TITLE|FORM_STYLE_INDICATOR); + * pForm->AddControl(pPanel); + * + * //... + * pForm->Invalidate(true); + * //... + * } + * @endcode + */ + result AddControl(Control* pControl); + /** * Before the system calls OnDraw() method to allow the user to do custom drawing, this method is called to clear the canvas. The user can override this method to change this default behavior. * @@ -135,11 +175,11 @@ public: /** * @if OSPCOMPAT * @page CompOnDrawPage Compatibility for OnDraw() - * @section CompOnDrawPage IssueSection Issues + * @section CompOnDrawPageIssueSection Issues * Implementing this method in OSP compatible applications has the following issues: @n * -# The platform draws the control by calling the parent's OnDraw() callback before invoking the control's OnDraw() callback. So, the users can't control the control's drawing behavior by overriding the OnDraw() callback. * - * @section CompOnDrawPage SolutionSection Resolutions + * @section CompOnDrawPageSolutionSection Resolutions * This issue has been resolved in Tizen. @n * -# The platform does not call the parent's OnDraw() callback before invoking the control's OnDraw() callback. Therefore, you needs to call the parent container's OnDraw() callback in the OnDraw() callback if you override this method. * @endif @@ -151,7 +191,7 @@ public: * @since 2.0 * * @param[in] showState The new show state of the control - * @see Osp::Ui::Control::SetShowState() + * @see Tizen::Ui::Control::SetShowState() */ virtual void OnShowStateChanging(bool showState); @@ -218,10 +258,28 @@ public: * @exception E_OBJ_NOT_FOUND The specified instance is not found within the indicated range (that is, the @c control is not found). * @exception E_SYSTEM A system error has occurred. * @remarks The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called. + * If OnTerminating() method is overrided and returns an exception, that exception will be propagated. * @see Tizen::Ui::Control::OnTerminating() */ result RemoveControl(const Control& control); + /* + * Removes the specified control from the container. + * + * @since 2.1 + * + * @return An error code + * @param[in] pControl Pointer of the child control to be removed + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified instance is not found within the indicated range (that is, the @c control is not found). + * @exception E_INVALID_ARG The specified @c pControl is null. + * @exception E_SYSTEM A system error has occurred. + * @remarks The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called. + * If OnTerminating() method is overrided and returns an exception, that exception will be propagated. + * @see Tizen::Ui::Control::OnTerminating() + */ + result RemoveControl(Control* pControl); + /** * Removes the specified control from the container. * @@ -233,6 +291,7 @@ public: * @exception E_OUT_OF_RANGE The specified @c index is out of range. * @exception E_SYSTEM A system error has occurred. * @remarks The removed child control is deleted from the memory. Before deletion, OnTerminating() of the child control is called. + * If OnTerminating() method is overrided and returns an exception, that exception will be propagated. * @see Tizen::Ui::Control::OnTerminating() */ result RemoveControl(int index); @@ -283,12 +342,12 @@ public: /** * @if OSPCOMPAT * @page CompGetControlPage Compatibility for GetControl() - * @section CompGetControlPage IssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# GetControl() method searches for itself first and then child controls in OSP, whereas only @n - * child controls are searched for from Tizen. + * @section CompGetControlPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# GetControl() method searches for itself first and then child controls in API version 2.0, whereas only @n + * child controls are searched for from 2.1. * - * @section CompGetControlPage SolutionSection Resolutions + * @section CompGetControlPageSolutionSection Resolutions * This issue has been resolved in Tizen. @n * @endif */ @@ -361,6 +420,20 @@ public: */ bool IsAncestorOf(const Control& control) const; + /* + * Checks whether the specified control is a child or descendant of the container. + * + * @since 2.1 + * + * @return @c true if the specified control is within the containment hierarchy of the container, @n + * else @c false + * @param[in] pControl Pointer of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pControl is null. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + bool IsAncestorOf(const Control* pControl) const; + /** * Sets whether the specified child control must always be above other children. * @@ -428,6 +501,25 @@ public: */ bool IsControlAlwaysAtBottom(const Tizen::Ui::Control& control) const; + /* + * Checks whether the specified child control is always at the bottom of + * the drawing stack. + * + * @since 2.1 + * + * @return @c true if the specified child control is set as always at the bottom, @n + * else @c false + * @param[in] pControl Pointer of child control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid.@n + * The specified control is not a child of this + * container or @c pControl is null . + * @remarks The specific error code can be accessed using the GetLastResult() + * method. + * @see SetControlAlwaysAtBottom() + */ + bool IsControlAlwaysAtBottom(const Tizen::Ui::Control* pControl) const; + /** * Checks whether the specified child control is always on the top of * the drawing stack. @@ -447,6 +539,25 @@ public: */ bool IsControlAlwaysOnTop(const Tizen::Ui::Control& control) const; + /* + * Checks whether the specified child control is always on the top of + * the drawing stack. + * + * @since 2.1 + * + * @return @c true if the specified child control is set as always on the top, @n + * else @c false + * @param[in] pControl Pointer of child control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified control is not a child of this + * container. or @c pControl is null + * @remarks The specific error code can be accessed using the GetLastResult() + * method. + * @see SetControlAlwaysOnTop() + */ + bool IsControlAlwaysOnTop(const Tizen::Ui::Control* pControl) const; + protected: /** * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. @@ -485,6 +596,25 @@ protected: */ result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + /* + * Initializes this instance of %Container. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The rectangle bounds to be set + * @param[in] resizable Set to @c true to make the container resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the container movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + /** * Initializes this instance of %Container with the specified layout and rectangular region. * @@ -507,6 +637,28 @@ protected: */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + /* + * Initializes this instance of %Container with the specified layout and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] rect The location and size of the %Container + * @param[in] resizable Set to @c true to make the container resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the container movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + /** * Initializes this instance of %Container with the specified layouts and rectangular region. * @@ -532,6 +684,31 @@ protected: */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + /* + * Initializes this instance of %Container with the specified layouts and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %Container + * @param[in] resizable Set to @c true to make the container resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the container movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + * @see Tizen::Ui::Container::GetPortraitLayoutN() + * @see Tizen::Ui::Container::GetLandscapeLayoutN() + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + /** * Gets the index of the specified control. * @@ -545,6 +722,20 @@ protected: * */ result GetControlAt(const Control& control, int& index) const; + /* + * Gets the index of the specified control. + * + * @since 2.1 + * @return An error code + * @param[in] pControl Pointer of the control + * @param[out] index The index of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pControl is null. + * @exception E_OBJ_NOT_FOUND The specified instance of Control is not found. + * @see SetControlAt() + * + */ + result GetControlAt(const Control* pControl, int& index) const; /** * Sets the control at the specified index. @@ -559,32 +750,74 @@ protected: * @exception E_SYSTEM A system error has occurred. * @remarks The @c control must be first added to this container. @n * Call the Invalidate() method after this, to apply the change to be shown. - * @see Invalidate(), GetControlAt() + * @see Invalidate() + * @see GetControlAt() * */ result SetControlAt(const Control& control, int index); -private: - // - // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // - Container(const Container& rhs); - - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // - Container& operator =(const Container& rhs); + /* + * Sets the control at the specified index. + * + * @since 2.1 + * + * @return An error code + * @param[in] pControl Pointer of the control + * @param[in] index The index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is out of range. + * @exception E_INVALID_ARG The specified @c pControl is null. + * @exception E_SYSTEM A system error has occurred. + * @remarks The @c control must be first added to this container. @n + * Call the Invalidate() method after this, to apply the change to be shown. + * @see Invalidate() + * @see GetControlAt() + * + */ + result SetControlAt(Control* pControl, int index); protected: - friend class _ContainerImpl; + /* + * Called to notify that the bounds of the control is changing. + * + * @since 2.1 + * + * @return An error code + * @param[in] oldRect The old position and size values of the control + * @param[in] newRect The new position and size values of the control + * @remarks If the method returns an exception, the resulting exception + * is propagated and the control's size is unchanged.@n + * Provide control specific exceptions. + * @see Tizen::Ui::Control::SetBounds() + * @see Tizen::Ui::Control::SetSize() + */ + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect); - // - // This method is for internal use only. - // Using this method can cause behavioral, security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Container_Reserved1(void) {} + /* + * Called to notify that the bounds of the control is changed. + * + * @since 2.1 + * + * @return An error code + * @param[in] oldRect The old position and size values of the control + * @param[in] newRect The new position and size values of the control + * @see Tizen::Ui::Control::SetBounds() + * @see Tizen::Ui::Control::SetSize() + */ + virtual void OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect); + + /* + * Overrides this method to indicate that the specified @c width and @c height + * can be supported or a new @c width and @c height should be applied instead + * of the specified values. + * + * @since 2.1 + * + * @return A Boolean flag that indicates whether the specified @c width + * and @ height are supported. + * @param[in, out] evaluatedSize The width and the height that need to be evaluated. + */ + virtual void OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize); // // This method is for internal use only. @@ -592,7 +825,7 @@ protected: // // This method is reserved and may change its name at any time without prior notice. // - virtual void Container_Reserved2(void) {} + virtual void Container_Reserved4(void) {} // // This method is for internal use only. @@ -600,24 +833,21 @@ protected: // // This method is reserved and may change its name at any time without prior notice. // - virtual void Container_Reserved3(void) {} + virtual void Container_Reserved5(void) {} +private: // - // This method is for internal use only. - // Using this method can cause behavioral, security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. // - virtual void Container_Reserved4(void) {} + Container(const Container& rhs); // - // This method is for internal use only. - // Using this method can cause behavioral, security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. // - virtual void Container_Reserved5(void) {} + Container& operator =(const Container& rhs); +private: + friend class _ContainerImpl; }; // Container }} //Tizen::Ui diff --git a/inc/FUiControl.h b/inc/FUiControl.h old mode 100644 new mode 100755 index 622b764..0457734 --- a/inc/FUiControl.h +++ b/inc/FUiControl.h @@ -1,1489 +1,2187 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUiControl.h - * @brief This is the header file for the %Control class. - * - * This header file contains the declarations of the %Control class. - */ - -#ifndef _FUI_CONTROL_H_ -#define _FUI_CONTROL_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Tizen { namespace Ui { namespace Animations { -class ControlAnimator; -class VisualElement; -}}} - -namespace Tizen { namespace Ui { - -class AccessibilityContainer; -class Container; -class _ControlImpl; -class TouchGestureDetector; - -/** - * @class Control - * @brief This class is the abstract base class of all the UI control classes. - * - * @since 2.0 - * - * @remarks In order for a control to be displayed, it must first be bound to a window of the underlying window system. The control's window is - * created when it (or its ancestor) is added to a valid control containment hierarchy. A containment hierarchy is valid if and - * only if the root of the hierarchy is an instance of the Window class. - * - * The %Control class is the abstract base class of all user interface elements. It encapsulates a - * "window" of the underlying window system, and provides the infrastructure necessary for the - * elements to respond to user inputs. The %Control class also determines how a key event is dispatched - * and processed. - * - * For more information on the class features, see UI Controls. - * - * - * The following examples demonstrate how to use the %Control class. - * - * Size and Position - * - * @code - * // Sets the size - * pControl->SetSize(100, 100); // 100 pixels wide and 100 pixels long - * - * // Sets the position - * pControl->SetPosition(5, 5); // Control is drawn 5 pixels down and 5 pixels left from the top-left corner of its parent - * @endcode - * - * Draw and Show - * - * @code - * // Gets a instance of Canvas - * Canvas* pCanvas = pControl->GetCanvasN(); - * - * // Fills the canvas with white color - * pCanvas->Clear(Tizen::Graphics::Color(255, 255, 255)); - * - * // Shows changes on screen - * pControl->Invalidate(true); - * - * delete pCanvas; - * @endcode - * - * Key and input focus - * - * @code - * // Implements MyKeyEventListener - * IKeyEventListener* pKeyListener = new MyKeyEventListener(); - * pControl->SetFocus(); - * - * // The added key listener should be deleted after use - * pControl->AddKeyEventListener(*pKeyListener); - * @endcode - * - */ -class _OSP_EXPORT_ Control - : public Tizen::Base::Object -{ - -public: - /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ - virtual ~Control(void); - - /** - * Adds the IFocusEventListener instance to the %Control instance. @n - * The added listener gets notified when the control gains or loses its focus. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveFocusEventListener() - */ - void AddFocusEventListener(IFocusEventListener& listener); - - /** - * Adds the IKeyEventListener instance to the %Control instance. @n - * The added listener gets notified when a key is pressed, released, or long pressed. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveKeyEventListener() - */ - void AddKeyEventListener(IKeyEventListener& listener); - - /** - * Adds the ITouchEventListener instance to the %Control instance. @n - * The added listener gets notified when a touch event such as a press or a release is fired. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveTouchEventListener() - */ - void AddTouchEventListener(ITouchEventListener& listener); - - /** - * Adds the ITouchModeChangedEventListener instance to the %Control instance. @n - * The added listener gets notified when the device's touch mode is changed. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveTouchModeChangedEventListener() - */ - void AddTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener); - - /** - * Adds the IDragDropEventListener instance to the %Control instance. @n - * The added listener gets notified when a drag or a drop happens in the control. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveDragDropEventListener() - */ - void AddDragDropEventListener(IDragDropEventListener& listener); - - /** - * Removes the focus listener instance. @n - * The removed listener is not notified even when focus events are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddFocusEventListener() - */ - void RemoveFocusEventListener(IFocusEventListener& listener); - - /** - * Removes the key event listener instance. @n - * The removed listener is not notified even when key events are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddKeyEventListener() - */ - void RemoveKeyEventListener(IKeyEventListener& listener); - - /** - * Removes the touch event listener instance. @n - * The removed listener is not notified even when touch events are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddTouchEventListener() - */ - void RemoveTouchEventListener(ITouchEventListener& listener); - - /** - * Removes the touch mode changed event listener instance. @n - * The removed listener is not notified even when the touch mode changed events are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddTouchModeChangedEventListener() - */ - void RemoveTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener); - - /** - * Adds the IDragDropEventListener instance to the %Control instance. @n - * The added listener gets notified when a drag or a drop happens in the control. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see Tizen::Ui::IDragDropEventListener::OnTouchDragged() - * @see Tizen::Ui::IDragDropEventListener::OnTouchDropped() - * @see RemoveDragDropEventListener() - */ - void RemoveDragDropEventListener(IDragDropEventListener& listener); - - /** - * Overrides this method to provide user-specific initialization code before the control is added to a container. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_FAILURE The method has failed. - * @remarks This method is called when the control is about to be added to a container. - * @remarks To cancel adding this control to the parent, return @c E_FAILURE in this method. - * @see OnTerminating() - */ - virtual result OnInitializing(void); - - /** - * Overrides this method to provide user-specific termination code. - * - * @if OSPCOMPAT - * @brief [Compatibility] - * @endif - * @since 2.0 - * - * @if OSPCOMPAT - * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompOnTerminatingPage "here". - * @endif - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_FAILURE The method has failed. - * @remarks This method is called right before the control is removed successfully from the container. - * @remarks To cancel removing this control from the parent, return @c E_FAILURE in this method. - * @see OnInitializing() - */ - virtual result OnTerminating(void); - - /** - * @if OSPCOMPAT - * @page CompOnTerminatingPage Compatibility for OnTerminating() - * @section CompOnterminatingPage IssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# OnTerminating() callback is called from child to parent. - * - * @section CompOnTerminatingPage SolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# OnTerminating() callback is called from parent to child. - * @endif - */ - - /** - * Called asynchronously when the user event that is sent by SendUserEvent() method is - * dispatched to the control. - * - * @since 2.0 - * - * @param[in] requestId The user-defined event ID - * @param[in] pArgs A pointer to the argument list - * @see SendUserEvent() - */ - virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs); - - /** - * Checks whether the control is movable. - * - * @since 2.0 - * - * @return @c true if the control is movable, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks When control is not movable SetPosition() and SetBounds() return @c E_UNSUPPORTED_OPERATION. - * @see SetPosition() - * @see SetBounds() - */ - bool IsMovable(void) const; - - /** - * Checks whether the control is resizable. - * - * @since 2.0 - * - * @return @c true if the control is resizable, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @remarks Even if this method returns @c true, the size can be changed internally. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks When control is not resizable, - * SetSize(), SetBounds(), SetMinimumSize() and SetMaximumSize() return @c E_UNSUPPORTED_OPERATION. - * @see SetSize() - * @see SetBounds() - * @see SetMinimumSize() - * @see SetMaximumSize() - */ - bool IsResizable(void) const; - - /** - * Gets the position and the size of the control. - * - * @since 2.0 - * - * @return An instance of the Tizen::Graphics::Rectangle that represents the position of top-left corner, - * the width, and the height of the control - * @remarks The shape of the control is rectangular that is defined by the top-left point, - * and the width or height. The position - * of the top-left point is relative to the top-left corner of the parent container. - * @see SetBounds() - */ - Tizen::Graphics::Rectangle GetBounds(void) const; - - /** - * Gets the position and the size of the control. - * - * @since 2.0 - * - * @param[out] x The x position of top-left corner of the control - * @param[out] y The y position of top-left corner of the control - * @param[out] width The width of the rectangular region - * @param[out] height The height of the rectangular region - * @remarks The shape of the control is regarded as a rectangle that is defined - * by the top-left point and the width or height. - * The position of the top-left point is relative to the top-left corner of - * the parent container. - * @see SetBounds() - */ - void GetBounds(int& x, int& y, int& width, int& height) const; - - /** - * Gets the position of the control's top-left corner. - * - * @since 2.0 - * - * @return The position of the control's top-left corner - * @remarks The position of top-left corner is relative to the top-left corner of its parent container. - * @see GetBounds() - */ - Tizen::Graphics::Point GetPosition(void) const; - - /** - * Gets the position of the control's top-left corner. - * - * @since 2.0 - * - * @param[out] x The x position of the control's top-left corner - * @param[out] y The y position of the control's top-left corner - * @remarks The position of top-left corner is relative to the top-left corner of its parent container. - * @see GetBounds() - */ - void GetPosition(int& x, int& y) const; - - /** - * Gets the size of the control. - * - * @since 2.0 - * - * @return The size of the control - * @see GetBounds() - */ - Tizen::Graphics::Dimension GetSize(void) const; - - /** - * Gets the size of the control. - * - * @since 2.0 - * - * @param[out] width The width of the control - * @param[out] height The height of the control - * @see GetBounds() - */ - void GetSize(int& width, int& height) const; - - /** - * Gets the x position of the control. @n - * The position of control is relative to the top-left corner of its parent container. - * - * @since 2.0 - * - * @return The x position of the control - * @see GetBounds() - * @see GetPosition() - * @see GetY() - */ - int GetX(void) const; - - /** - * Gets the y position of the control. @n - * The position of control is relative to the top-left corner of its parent container. - * - * @since 2.0 - * - * @return The y position of the control - * @see GetBounds() - * @see GetPosition() - * @see GetX() - */ - int GetY(void) const; - - /** - * Gets the width of the control. - * - * @since 2.0 - * - * @return The width of the control - * @see GetBounds() - * @see GetSize() - * @see GetHeight() - */ - int GetWidth(void) const; - - /** - * Gets the height of the control. - * - * @since 2.0 - * - * @return The height of the control - * @see GetBounds() - * @see GetSize() - * @see GetWidth() - */ - int GetHeight(void) const; - - /** - * Gets the minimum size of the control. - * - * @since 2.0 - * - * @return The minimum size of the control - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The first call of the method returns the system-defined minimum size. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ - Tizen::Graphics::Dimension GetMinimumSize(void) const; - - /** - * Gets the maximum size of the control. - * - * @since 2.0 - * - * @return The maximum size of the control - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The first call of the method returns the system-defined maximum size. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ - Tizen::Graphics::Dimension GetMaximumSize(void) const; - - /** - * Gets a font of the control. - * - * @since 2.0 - * - * @return The font name set in the control, @n - * else an empty string if the font is not set - * @see SetFont() - */ - Tizen::Base::String GetFont(void) const; - - /** - * Sets the position and size of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] rect The new bounds of the control - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. - * @exception E_INVALID_ARG The specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. - * @see IsMovable() - * @see IsResizable() - * @see GetMinimumSize() - * @see GetMaximumSize() - * @see SetPosition() - * @see SetSize() - */ - result SetBounds(const Tizen::Graphics::Rectangle& rect); - - /** - * Sets the position and size of the control. @n - * The position is set at (x, y), and the @c width and @c height parameters contain - * the width and height values of the object, respectively. - * - * @since 2.0 - * - * @return An error code - * @param[in] x The new x position of the control - * @param[in] y The new y position of the control - * @param[in] width The new width of the control - * @param[in] height The new height of the control - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. - * @see IsMovable() - * @see IsResizable() - * @see GetMinimumSize() - * @see GetMaximumSize() - * @see SetPosition() - * @see SetSize() - */ - result SetBounds(int x, int y, int width, int height); - - /** - * Sets the relative position of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] Position The new position - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is not movable. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The position of the control are relative to the top-left corner of its parent. - * @see IsMovable() - * @see SetBounds() - */ - result SetPosition(const Tizen::Graphics::Point& Position); - - /** - * Sets the position of the control. - * - * @since 2.0 - * @return An error code - * @param[in] x The new x position of the control - * @param[in] y The new y position of the control - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is not movable. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The x,y position of the control are relative to the top-left corner of its parent. - * @see IsMovable() - * @see SetBounds() - */ - result SetPosition(int x, int y); - - /** - * Sets the size of the control. @n - * - * @since 2.0 - * - * @return An error code - * @param[in] size The new width and height - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is not resizable. - * @exception E_INVALID_ARG The specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. - * @see IsResizable() - * @see GetMinimumSize() - * @see GetMaximumSize() - * @see SetBounds() - */ - result SetSize(const Tizen::Graphics::Dimension& size); - - /** - * Sets the size of the control. @n - * The @c width and @c height parameters contain the width and height values of the object, respectively. - * - * @since 2.0 - * - * @return An error code - * @param[in] width The new width of the control - * @param[in] height The new height of the control - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The control has not been constructed as yet. - * @exception E_UNSUPPORTED_OPERATION This control is not resizable. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. - * @see IsResizable() - * @see GetMinimumSize() - * @see GetMaximumSize() - * @see SetBounds() - */ - result SetSize(int width, int height); - - /** - * Sets the minimum size of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] newMinDim The new minimum size of the control - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This control is not resizable. - * @exception E_INVALID_ARG The specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks This method can affect the maximum size and the current size of the control. @n - * The control needs to be redrawn to reflect the change in its size. @n - * If the current maximum size or the control size is smaller than the new minimum size, - * it becomes the same as the new minimum size. - * @see IsResizable() - */ - result SetMinimumSize(const Tizen::Graphics::Dimension& newMinDim); - - /** - * Sets the maximum size of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] newMaxDim The new maximum size of the control - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This control is not resizable. - * @exception E_INVALID_ARG The specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks This method can affect the minimum size and the current size of the control. @n - * The control needs to be redrawn to reflect the change in its size. @n - * If the current minimum size or the control size is greater than the new maximum size, - * it becomes the same as the new maximum size. - * @see IsResizable() - */ - result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxDim); - - /** - * Converts the specified screen position to the position in control's coordinate system. - * - * @since 2.0 - * - * @return The position relative to the top-left corner of the control's client-area - * @param[in] screenPosition The position relative to the top-left corner of the screen - * @see ConvertToScreenPosition() - */ - Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const; - - /** - * Converts the specified position in the control's coordinate system to the screen position. - * - * @since 2.0 - * - * @return The position relative to the top-left corner of the screen - * @param[in] controlPosition The position relative to the top-left corner of the control's client-area - * @see ConvertToControlPosition() - */ - Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const; - - /** - * Sets the font of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] fontName The app font name or system font name @n - * The app font name is retrieved using Tizen::Graphics::Font::GetFaceName(Tizen::Base::String& filepath). @n - * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN(). - * Sets an empty string to reset. - * @exception E_SUCCESS The method is successful. - * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. - * @remarks At first, the value of @c fontName is considered app font name if it matches one of the face names of the font files which are located in @b '/res/font'. - * If not, the value of @c fontName is considered system font name if it matches one of the retrieved values using Tizen::Graphics::Font::GetSystemFontListN(). - * @remarks The control first attempts to find the control font. If it fails, then it searches for the application default font and the system font, in sequence. - * @see GetFont() - */ - result SetFont(const Tizen::Base::String& fontName); - - /** - * Checks whether the specified @c point is inside the control. - * - * @since 2.0 - * - * @return @c true if the specified @c point is inside the control, @n - * else @c false - * @param[in] point The point to check - * @remarks The specified @c point must be defined relative to the top-left corner of the control. - */ - bool Contains(const Tizen::Graphics::Point& point) const; - - /** - * Checks whether the specified point is inside the control. - * - * @since 2.0 - * - * @return @c true if the specified point is inside the control, @n - * else @c false - * @param[in] x The x position of the point to check - * @param[in] y The y position of the point to check - * @remarks The specified point must be defined relative to the top-left corner of the control. - */ - bool Contains(int x, int y) const; - - /** - * Draws child controls recursively. - * - * @if OSPCOMPAT - * @brief [Compatibility] - * @endif - * @since 2.0 - * - * @if OSPCOMPAT - * @compatibility This method has compatibility issues with OSP compatible applications. @n - * For more information, see @ref CompDrawPage "here". - * @endif - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * Note: This control cannot be displayed. - * @exception E_SYSTEM A system error has occurred. - * @remarks This method calls OnDraw() immediately in a synchronous way. - * @see Show() - */ - result Draw(void); - - /** - * @if OSPCOMPAT - * @page CompDrawPage Compatibility for Draw() - * @section CompDrawPage IssueSection Issues - * Implementing this method in OSP compatible applications has the following issues: @n - * -# Draw() method draws child controls in a recursive way regardless of the visibility of the parent. - * - * @section CompDrawPage SolutionSection Resolutions - * This issue has been resolved in Tizen. @n - * -# Draw() method does not draw child controls if the control itself is not visible. - * @endif - */ - - /** - * Draws the control. - * - * @since 2.0 - * - * @param[in] recursive Set to @c true to draw child controls recursively, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * Note: This control cannot be displayed. - * @exception E_SYSTEM A system error has occurred. - * @remarks This method calls OnDraw() immediately in a synchronous way. - * @see Show() - */ - result Draw(bool recursive); - - /** - * Shows the control on the screen. - * - * @since 2.0 - * @final Although this method is virtual, it should not be overridden. - * If overridden, it may not work as expected. - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * Note: This control cannot be displayed. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - */ - virtual result Show(void); - - /** - * Invalidates the control. - * - * @since 2.0 - * - * @param[in] recursive Set to @c true to invalidate child controls recursively, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * Note: This control cannot be displayed. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks OnDraw() is not called immediately, but called asynchronously just before the screen is updated. - * @see Show() - */ - void Invalidate(bool recursive); - - /** - * Invalidates the control of the specified position and size. - * - * @since 2.0 - * - * @param[in] bounds The position relative to the top-left corner of the control - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * Note: This control cannot be displayed. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see Show() - */ - void InvalidateBounds(const Tizen::Graphics::Rectangle& bounds); - - /** - * Draws the control asynchronously. - * - * @since 2.0 - * - * @param[in] show Set to @c true to also show the control, @n - * else @c false - * @remarks This method posts a draw event in the event queue. @n - * Drawing requested by %RequestRedraw() occurs when the draw event is fired to the control. - */ - void RequestRedraw(bool show = true) const; - - /** - * Creates and returns a graphics canvas whose bounds (that is, position and size) are equal to those - * of the control. - * - * @since 2.0 - * - * @return The graphic canvas of the control, @n - * else @c null if an exception occurs - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @remarks The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the control. - * It is the developer's responsibility to deallocate the canvas after use. - * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged. - * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method - * if the size or position of the control is changed. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, - * if custom drawing is performed on the graphic canvas of Frame and Form - * then it will appear on the screen regardless of which control is currently visible on the screen. - * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const - * @see GetCanvasN(int x, int y, int width, int height) const - * @code - * result - * MyForm::OnDraw(void) - * { - * result r = E_SUCCESS; - * Canvas* pCanvas = GetCanvasN(); - * if (pCanvas != null) - * { - * // add your drawing code here - * } - * if (pCanvas) - * delete pCanvas; - * // Do not call Show(). It will be called automatically after OnDraw() callback. - * return r; - * } - * @endcode - */ - Tizen::Graphics::Canvas* GetCanvasN(void) const; - - /** - * Creates and returns a graphic canvas of the control of the specified position and size. - * - * @since 2.0 - * - * @return The graphic canvas of the control, @n - * else @c null if an exception occurs - * @param[in] bounds The bounds of the graphic canvas - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @remarks Only the graphic canvas of displayable controls can be obtained. - * If the specified area is not inside the control, - * the graphics canvas of overlapped area between the control and the specified bound is returned. @n - * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. - * It is the developer's responsibility to deallocate the canvas after use. - * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged. - * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method - * if the size or position of the control is changed. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, - * if custom drawing is performed on the graphic canvas of Frame and Form - * then it will appear on the screen regardless of which control is currently visible on the screen. - * @see GetCanvasN(void) const - * @see GetCanvasN(int x, int y, int width, int height) const - */ - Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const; - - /** - * Creates and returns a graphic canvas of the specified position and size in the control. - * - * @since 2.0 - * - * @return The graphic canvas of the control, @n - * else @c null if an exception occurs - * @param[in] x The x position relative to the top-left corner of the control - * @param[in] y The y position relative to the top-left corner of the control - * @param[in] width The width of a graphic canvas - * @param[in] height The height of a graphic canvas - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @remarks Only the graphic canvas of displayable controls can be obtained. - * If the specified area is not inside the control, - * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n - * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. - * It is the developer's responsibility to deallocate the canvas after use. - * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged. - * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method - * if the size or position of the control is changed. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, - * if custom drawing is performed on the graphic canvas of Frame and Form - * then it will appear on the screen regardless of which control is currently visible on the screen. - * @see GetCanvasN(void) const - * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const - */ - Tizen::Graphics::Canvas* GetCanvasN(int x, int y, int width, int height) const; - - /** - * Checks whether the control is currently visible on the screen. - * - * @since 2.0 - * - * @return @c true if the control is currently visible on the screen, @n - * else @c false - * @remarks If this method is called before the control is added to a parent, @c false is returned. - * @see GetShowState() - * @see SetShowState() - */ - bool IsVisible(void) const; - - /** - * Gets the current show state of the control. - * - * @since 2.0 - * - * @return The show state of the control - * @remarks Even if the control's state is "show", the control may not be visible. - * @see SetShowState() - * @see IsVisible() - */ - bool GetShowState(void) const; - - /** - * Sets the show state of the control. - * - * @since 2.0 - * - * @return An error code - * @param[in] state The new show state - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * Note: This control cannot be displayed. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - * @remarks Even if this method is invoked, the control is not drawn or shown. @n - * To draw and show the control, use Invalidate() method. @n - * Once the control's show state is set to @c false, - * the show state needs to be set to @c true again before you draw and show the control. - * @see GetShowState() - * @see Invalidate() - */ - result SetShowState(bool state); - - /** - * Gets the dedicated %VisualElement instance for this control. - * - * @since 2.0 - * - * @return An instance of the VisualElement - * @remarks If an application developer modifies the state of the returned VisualElement - * and the host control is not aware of this change, then the control may behave egregiously. - * It is highly recommended to restore the %VisualElement state to avoid such conflicts. - */ - Tizen::Ui::Animations::VisualElement* GetVisualElement(void) const; - - /** - * Gets the parent of the control. - * - * @since 2.0 - * - * @return The current parent of the control - */ - Container* GetParent(void) const; - - /** - * Gets the name of the control. - * - * @since 2.0 - * - * @return The name of the control - */ - Tizen::Base::String GetName(void) const; - - /** - * Sets the name of the control. - * - * @since 2.0 - * - * @param[in] name The name of the control - */ - void SetName(const Tizen::Base::String& name); - - /** - * Checks whether the control is focusable. - * - * @since 2.0 - * - * @return @c true if control is focusable, @n - * else @c false - * @remarks The focus ability of the container classes like Panel is @c false by default. - */ - bool IsFocusable(void) const; - - /** - * Sets the focus ability of the control. @n - * Non-Focusable controls cannot take the key focus. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * Note: The control does not permit to change its focus ability. - * @exception E_SYSTEM A system error has occurred. - * @remarks The focus ability of the container classes like Panel is @c false by default. - * @remarks The RadioGroup class does not render the UI. - * Therefore, RadioGroup::SetFocusable() returns @c E_SYSTEM. - */ - result SetFocusable(bool focusable); - - /** - * Checks whether the control currently has the input focus. - * - * @since 2.0 - * - * @return @c true if the control currently has the input focus, @n - * else @c false - * @remarks If this method is called before the control is added to a parent, @c false is returned. - * @see SetFocus() - */ - bool HasFocus(void) const; - - /** - * Sets the focus to the control. @n - * This method is called if the control needs to listen to user input events such as key pressed. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * Note: This control cannot be displayed. - * @exception E_INVALID_CONDITION The control is not contained in, or is not the top z-order frame or form. - * @remarks Do not override this method. - */ - result SetFocus(void); - - /** - * Checks whether the control is enabled. - * - * @since 2.0 - * - * @return @c true if the control is enabled, @n - * else @c false - * @remarks If this method is called before the control is added to a parent, @c false is returned. - * @see SetEnabled() - */ - bool IsEnabled(void) const; - - /** - * Enables or disables the control. @n - * Only an enabled control can respond to the user input. By default, the control is enabled. - * - * @since 2.0 - * - * @return An error code - * @param[in] enable The new state of the object - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_SYSTEM A system error has occurred. - * @remarks Do not override this method. - */ - result SetEnabled(bool enable); - - /** - * Checks whether the device is in touch mode. @n - * When the user interacts with the device by touching it, the device is in touch mode. - * - * @since 2.0 - * - * @return @c true if the device is in touch mode, @n - * else @c false - * @remarks This method returns @c false, for devices with QWERTY keyboard. - * The user can navigate the UI using directional keys. - */ - bool IsInTouchMode(void) const; - - /** - * Enables or disables the drag operation in the %Control. - * - * @since 2.0 - * - * @param[in] enable Set to @c true to enable the drag operation, @n - * else @c false - * @see SetDropEnabled() - */ - void SetDragEnabled(bool enable); - - /** - * Enables or disables the drop operations in the %Control. - * - * @since 2.0 - * - * @param[in] enable Set to @c true to enable drop operations, @n - * else @c false - * @remarks To receive drop event, control's drag property has to be enabled. - * @see SetDragEnabled() - */ - void SetDropEnabled(bool enable); - - /** - * Sends a user event to the control. - * - * @since 2.0 - * - * @param[in] requestId The user-defined event ID - * @param[in] pArgs A pointer to the argument list - * @remarks This method posts a user event in the event queue - * and returns immediately to support asynchronous actions of the framework. - * @see OnUserEventReceived() - */ - void SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs) const; - - /** - * Stops the current UI event dispatch sequence by indicating the current input event is consumed. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks If this method is invoked during an UI event (key or touch) propagation sequence, - * the method will stop the propagation and consequently the system will not be notified of the event. @n - * The method will not have any effect if no UI event is being dispatched. @n - * It is recommended that this method is called within IKeyEventListener or - * ITouchEventListener to stop the event from propagating to the next step. - */ - result ConsumeInputEvent(void); - - /** - * Gets the control animator of the current instance of %Control - * - * @since 2.0 - * - * @return A pointer to ControlAnimator, @n - * else @c null if this instance is not constructed or not added to a parent or non-animatable - */ - Tizen::Ui::Animations::ControlAnimator* GetControlAnimator(void) const; - - /** - * Adds the gesture detector to the %Control. @n - * The added gesture detector receives touch events prior to %Control. - * - * @since 2.0 - * - * @return An error code - * @param[in] gestureDetector The gesture detector - * @exception E_SUCCESS The method is successful. - * @see RemoveGestureDetector() - */ - result AddGestureDetector(const TouchGestureDetector& gestureDetector); - - /** - * Removes the gesture detector from the %Control. - * - * @since 2.0 - * - * @return An error code - * @param[in] gestureDetector The gesture detector - * @exception E_SUCCESS The method is successful. - * @see AddGestureDetector() - */ - result RemoveGestureDetector(const TouchGestureDetector& gestureDetector); - - /** - * @if OSPDEPREC - * Gets the composite mode for merging with other controls. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because changing composition mode is not allowed any more. - * @since 2.0 - * - * @return The composite mode - * @exception E_SUCCESS The method is successful. - * @remarks In Tizen, this method only returns @c COMPOSITE_MODE_ALPHA_BLENDING. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @endif - */ - Tizen::Ui::CompositeMode GetCompositeMode(void) const; - - /** - * @if OSPDEPREC - * Sets the composite mode for merging with other controls. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because changing composition mode is not allowed any more. - * @since 2.0 - * - * @return An error code - * @param[in] compositeMode The composite mode - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The method is not supported. - * @remarks In Tizen, only @c COMPOSITE_MODE_ALPHA_BLENDING is allowed. - * Otherwise, this method returns @c E_UNSUPPORTED_OPERATION. - * @endif - */ - result SetCompositeMode(Tizen::Ui::CompositeMode compositeMode); - - /** - * @if OSPDEPREC - * Gets the chroma key color value that is used for the control composition. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because chroma key color is not supported any more. - * @since 2.0 - * - * @return The chroma key color - * @exception E_UNSUPPORTED_OPERATION The method is not supported. - * @remarks In Tizen, this method always fails and returns Tizen::Graphics::Color(0, 0, 0, 0). - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @endif - */ - Tizen::Graphics::Color GetChromaKeyColor(void) const; - - /** - * @if OSPDEPREC - * Sets the chroma key color value that is used for the control composition. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because chroma key color is not supported any more. - * @since 2.0 - * - * @return An error code - * @param[in] chromaKeyColor The chroma key color - * @exception E_UNSUPPORTED_OPERATION The method is not supported. - * @remarks In Tizen, this method always fails. - * @endif - */ - result SetChromaKeyColor(Tizen::Graphics::Color chromaKeyColor); - - /** - * Captures the composited scene of the Panel control. - * - * @since 2.0 - * - * @return A Tizen::Graphics::Bitmap instance that captures the current composited scene of the Panel control, @n - * else @c null if an error occurs - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This method is not supported. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks This method is not supported in the following class that is derived from Panel class: - * @li OverlayPanel - * @remarks The bounds of the %Panel control must be within the client area of the Form control to get a valid composited scene. - */ - Tizen::Graphics::Bitmap* GetCapturedBitmapN(void) const; - - /** - * Gets the position and the size of the invalidated bounds. - * - * @since 2.0 - * - * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner, - * the width, and the height of the invalidated bounds - */ - Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const; - - /** - * Enables or disables the multi-point touch of the %Control. - * - * @since 2.0 - * - * @param[in] enable A Boolean flag indicating whether to enable the multi-point touch - * - * @see IsMultipointTouchEnabled() - */ - - void SetMultipointTouchEnabled(bool enable); - - /** - * Checks whether the multi-point touch is enabled. - * - * @since 2.0 - * - * @return @c true if the multi-point touch is enabled, @n - * else @c false - * @see SetMultipointTouchEnabled() - */ - bool IsMultipointTouchEnabled(void) const; - - /** - * Gets the accessibility container. - * - * @since 2.0 - * - * @return The accessibilit container of the control, if the control supports accessibility feature. @n - * Else @c null. - * @see AccessibilityContainer::GetOwner() - */ - const AccessibilityContainer* GetAccessibilityContainer(void) const; - - /** - * Gets the accessibility container. - * - * @since 2.0 - * - * @return The accessibilit container of the control, if the control supports accessibility feature. @n - * Else @c null. - * @see AccessibilityContainer::GetOwner() - */ - AccessibilityContainer* GetAccessibilityContainer(void); - -protected: - /** - * Gets the default key event listener. - * - * @since 2.0 - * - * @return The default key event listener, @n - * else @null is returned if listener is not set or a system error has occurred - * @see SetDefaultKeyEventListener() - */ - IKeyEventListener* GetDefaultkeyEventListener(void) const; - - /** - * Gets the default touch event listener. - * - * @since 2.0 - * - * @return The default touch event listener @n - * If not listener has been set or a system error has occurred @c null is returned. - * @see SetDefaultTouchEventListener() - */ - ITouchEventListener* GetDefaultTouchEventListener(void) const; - - /** - * Sets the default key event listener. - * - * @since 2.0 - * - * @return An error code - * @param[in] pDefaultListener The default key event listener - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The registered listener will be notified to handle the key events - * after all application event listeners have been notified. - * @see GetDefaultkeyEventListener() - */ - result SetDefaultKeyEventListener(IKeyEventListener* pDefaultListener); - - /** - * Sets the default touch event listener. - * - * @since 2.0 - * - * @return An error code - * @param[in] pDefaultListener The default touch event listener - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The registered listener will be notified to handle the touch events - * after all application event listeners have been notified. - * @see GetDefaultTouchEventListener() - */ - result SetDefaultTouchEventListener(ITouchEventListener* pDefaultListener); - - /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. - * - * @since 2.0 - */ - Control(void); - - /** - * This method is for internal use only. Using this method can cause behavioral, security-related, - * and consistency-related issues in the application. - * - * Initializes this instance of %Control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ - result Construct(void); - - /** - * Frees the resources allocated by Construct(). - * - * @since 2.0 - */ - void Dispose(void); - -protected: - _ControlImpl* _pControlImpl; - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved1(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved2(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved3(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved4(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved5(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Control_Reserved6(void) {} - -private: - // - // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // - Control(const Control& rhs); - - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // - Control& operator =(const Control& rhs); - -private: - friend class _ControlImpl; -}; // Control - -}} // Tizen::Ui - -#endif // _FUI_CONTROL_H_ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiControl.h + * @brief This is the header file for the %Control class. + * + * This header file contains the declarations of the %Control class. + */ + +#ifndef _FUI_CONTROL_H_ +#define _FUI_CONTROL_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Ui { namespace Animations { +class ControlAnimator; +class VisualElement; +}}} + +namespace Tizen { namespace Ui { + +class AccessibilityContainer; +class Container; +class _ControlImpl; +class TouchGestureDetector; + +/** + * @class Control + * @brief This class is the abstract base class of all the UI control classes. + * + * @since 2.0 + * + * @remarks In order for a control to be displayed, it must first be bound to a window of the underlying window system. The control's window is + * created when it (or its ancestor) is added to a valid control containment hierarchy. A containment hierarchy is valid if and + * only if the root of the hierarchy is an instance of the Window class. + * + * The %Control class is the abstract base class of all user interface elements. It encapsulates a + * "window" of the underlying window system, and provides the infrastructure necessary for the + * elements to respond to user inputs. The %Control class also determines how a key event is dispatched + * and processed. + * + * For more information on the class features, see UI Controls. + * + * + * The following examples demonstrate how to use the %Control class. + * + * Size and Position + * + * @code + * // Sets the size + * pControl->SetSize(100, 100); // 100 pixels wide and 100 pixels long + * + * // Sets the position + * pControl->SetPosition(5, 5); // Control is drawn 5 pixels down and 5 pixels left from the top-left corner of its parent + * @endcode + * + * Draw and Show + * + * @code + * // Gets a instance of Canvas + * Canvas* pCanvas = pControl->GetCanvasN(); + * + * // Fills the canvas with white color + * pCanvas->Clear(Tizen::Graphics::Color(255, 255, 255)); + * + * // Shows changes on screen + * pControl->Invalidate(true); + * + * delete pCanvas; + * @endcode + * + * Key and input focus + * + * @code + * // Implements MyKeyEventListener + * IKeyEventListener* pKeyListener = new MyKeyEventListener(); + * pControl->SetFocus(); + * + * // The added key listener should be deleted after use + * pControl->AddKeyEventListener(*pKeyListener); + * @endcode + * + */ +class _OSP_EXPORT_ Control + : public Tizen::Base::Object +{ + +public: + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Control(void); + + /** + * Adds the IFocusEventListener instance to the %Control instance. @n + * The added listener gets notified when the control gains or loses its focus. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveFocusEventListener() + */ + void AddFocusEventListener(IFocusEventListener& listener); + + /** + * Adds the IKeyEventListener instance to the %Control instance. @n + * The added listener gets notified when a key is pressed, released, or long pressed. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveKeyEventListener() + */ + void AddKeyEventListener(IKeyEventListener& listener); + + /** + * Adds the ITouchEventListener instance to the %Control instance. @n + * The added listener gets notified when a touch event such as a press or a release is fired. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveTouchEventListener() + */ + void AddTouchEventListener(ITouchEventListener& listener); + + /** + * Adds the ITouchModeChangedEventListener instance to the %Control instance. @n + * The added listener gets notified when the device's touch mode is changed. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveTouchModeChangedEventListener() + */ + void AddTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener); + + /** + * Adds the IDragDropEventListener instance to the %Control instance. @n + * The added listener gets notified when a drag or a drop happens in the control. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveDragDropEventListener() + */ + void AddDragDropEventListener(IDragDropEventListener& listener); + + /* + * Adds the IDragDropEventListenerF instance to the %Control instance. @n + * The added listener gets notified when a drag or a drop happens in the control. + * + * @since 2.1 + * + * @param[in] listener The event listener to add + * @see RemoveDragDropEventListenerF() + */ + void AddDragDropEventListener(IDragDropEventListenerF& listener); + + /** + * Removes the focus listener instance. @n + * The removed listener is not notified even when focus events are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddFocusEventListener() + */ + void RemoveFocusEventListener(IFocusEventListener& listener); + + /** + * Removes the key event listener instance. @n + * The removed listener is not notified even when key events are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddKeyEventListener() + */ + void RemoveKeyEventListener(IKeyEventListener& listener); + + /** + * Removes the touch event listener instance. @n + * The removed listener is not notified even when touch events are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddTouchEventListener() + */ + void RemoveTouchEventListener(ITouchEventListener& listener); + + /** + * Removes the touch mode changed event listener instance. @n + * The removed listener is not notified even when the touch mode changed events are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddTouchModeChangedEventListener() + */ + void RemoveTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener); + + /** + * Adds the IDragDropEventListener instance to the %Control instance. @n + * The added listener gets notified when a drag or a drop happens in the control. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see Tizen::Ui::IDragDropEventListener::OnTouchDragged() + * @see Tizen::Ui::IDragDropEventListener::OnTouchDropped() + * @see RemoveDragDropEventListener() + */ + void RemoveDragDropEventListener(IDragDropEventListener& listener); + + /* + * Adds the IDragDropEventListenerF instance to the %Control instance. @n + * The added listener gets notified when a drag or a drop happens in the control. + * + * @since 2.1 + * + * @param[in] listener The event listener to add + * @see Tizen::Ui::IDragDropEventListenerF::OnTouchDraggedF() + * @see Tizen::Ui::IDragDropEventListenerF::OnTouchDroppedF() + * @see RemoveDragDropEventListenerF() + */ + void RemoveDragDropEventListenerF(IDragDropEventListenerF& listener); + + /** + * Overrides this method to provide user-specific initialization code before the control is added to a container. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_FAILURE The method has failed. + * @remarks This method is called when the control is about to be added to a container. + * @remarks To cancel adding this control to the parent, return @c E_FAILURE in this method. + * @see OnTerminating() + */ + virtual result OnInitializing(void); + + /** + * Overrides this method to provide user-specific termination code. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompOnTerminatingPage "here". + * @endif + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_FAILURE The method has failed. + * @remarks This method is called right before the control is removed from the container, or Destroy() method is being called. + * @remarks To cancel the removal or Destroy() operation, return any exception other than E_SUCCESS. + * @see OnInitializing() + */ + virtual result OnTerminating(void); + + /** + * @if OSPCOMPAT + * @page CompOnTerminatingPage Compatibility for OnTerminating() + * @section CompOnterminatingPageIssueSection Issues + * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n + * -# OnTerminating() callback is called from child to parent. + * + * @section CompOnTerminatingPageSolutionSection Resolutions + * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n + * -# OnTerminating() callback is called from parent to child. + * @endif + */ + + /** + * Called asynchronously when the user event that is sent by SendUserEvent() method is + * dispatched to the control. + * + * @since 2.0 + * + * @param[in] requestId The user-defined event ID + * @param[in] pArgs A pointer to the argument list + * @see SendUserEvent() + */ + virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs); + + /** + * Deallocates this instance after removing all child controls of this control + * + * @since 2.1 + * + * @exception E_SUCCESS The method is successful. + * @remarks The control will be deleted from memory. Before it is deleted, OnTerminating() is called if it is attached to the main tree. + * @remarks If OnTerminating() method is overrided and returns an exception, that exception will be propagated. + * @see Tizen::Ui::Control:OnTerminating() + */ + result Destroy(void); + + /** + * Checks whether the control is movable. + * + * @since 2.0 + * + * @return @c true if the control is movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks When control is not movable SetPosition() and SetBounds() return @c E_UNSUPPORTED_OPERATION. + * @see SetPosition() + * @see SetBounds() + */ + bool IsMovable(void) const; + + /** + * Checks whether the control is resizable. + * + * @since 2.0 + * + * @return @c true if the control is resizable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @remarks Even if this method returns @c true, the size can be changed internally. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks When control is not resizable, + * SetSize(), SetBounds(), SetMinimumSize() and SetMaximumSize() return @c E_UNSUPPORTED_OPERATION. + * @see SetSize() + * @see SetBounds() + * @see SetMinimumSize() + * @see SetMaximumSize() + */ + bool IsResizable(void) const; + + /** + * Gets the position and the size of the control. + * + * @since 2.0 + * + * @return An instance of the Tizen::Graphics::Rectangle that represents the position of top-left corner, + * the width, and the height of the control + * @remarks The shape of the control is rectangular that is defined by the top-left point, + * and the width or height. The position + * of the top-left point is relative to the top-left corner of the parent container. + * @see SetBounds() + */ + Tizen::Graphics::Rectangle GetBounds(void) const; + + /* + * Gets the position and the size of the control. + * + * @since 2.1 + * + * @return An instance of the Tizen::Graphics::FloatRectangle that represents the position of top-left corner, + * the width, and the height of the control + * @remarks The shape of the control is rectangular that is defined by the top-left point, + * and the width or height. The position + * of the top-left point is relative to the top-left corner of the parent container. + * @see SetBounds() + */ + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; + + /** + * Gets the position and the size of the control. + * + * @since 2.0 + * + * @param[out] x The x position of top-left corner of the control + * @param[out] y The y position of top-left corner of the control + * @param[out] width The width of the rectangular region + * @param[out] height The height of the rectangular region + * @remarks The shape of the control is regarded as a rectangle that is defined + * by the top-left point and the width or height. + * The position of the top-left point is relative to the top-left corner of + * the parent container. + * @see SetBounds() + */ + void GetBounds(int& x, int& y, int& width, int& height) const; + + /* + * Gets the position and the size of the control. + * + * @since 2.1 + * + * @param[out] x The x position of top-left corner of the control + * @param[out] y The y position of top-left corner of the control + * @param[out] width The width of the rectangular region + * @param[out] height The height of the rectangular region + * @remarks The shape of the control is regarded as a rectangle that is defined + * by the top-left point and the width or height. + * The position of the top-left point is relative to the top-left corner of + * the parent container. + * @see SetBounds() + */ + void GetBounds(float& x, float& y, float& width, float& height) const; + + /** + * Gets the position of the control's top-left corner. + * + * @since 2.0 + * + * @return The position of the control's top-left corner + * @remarks The position of top-left corner is relative to the top-left corner of its parent container. + * @see GetBounds() + */ + Tizen::Graphics::Point GetPosition(void) const; + + /* + * Gets the position of the control's top-left corner. + * + * @since 2.1 + * + * @return The position of the control's top-left corner + * @remarks The position of top-left corner is relative to the top-left corner of its parent container. + * @see GetBounds() + */ + Tizen::Graphics::FloatPoint GetPositionF(void) const; + + /** + * Gets the position of the control's top-left corner. + * + * @since 2.0 + * + * @param[out] x The x position of the control's top-left corner + * @param[out] y The y position of the control's top-left corner + * @remarks The position of top-left corner is relative to the top-left corner of its parent container. + * @see GetBounds() + */ + void GetPosition(int& x, int& y) const; + + /* + * Gets the position of the control's top-left corner. + * + * @since 2.1 + * + * @param[out] x The x position of the control's top-left corner + * @param[out] y The y position of the control's top-left corner + * @remarks The position of top-left corner is relative to the top-left corner of its parent container. + * @see GetBounds() + */ + void GetPosition(float& x, float& y) const; + + /** + * Gets the size of the control. + * + * @since 2.0 + * + * @return The size of the control + * @see GetBounds() + */ + Tizen::Graphics::Dimension GetSize(void) const; + + /* + * Gets the size of the control. + * + * @since 2.1 + * + * @return The size of the control + * @see GetBounds() + */ + Tizen::Graphics::FloatDimension GetSizeF(void) const; + + /** + * Gets the size of the control. + * + * @since 2.0 + * + * @param[out] width The width of the control + * @param[out] height The height of the control + * @see GetBounds() + */ + void GetSize(int& width, int& height) const; + + /* + * Gets the size of the control. + * + * @since 2.1 + * + * @param[out] width The width of the control + * @param[out] height The height of the control + * @see GetBounds() + */ + void GetSize(float& width, float& height) const; + + /** + * Gets the x position of the control. @n + * The position of control is relative to the top-left corner of its parent container. + * + * @since 2.0 + * + * @return The x position of the control + * @see GetBounds() + * @see GetPosition() + * @see GetY() + */ + int GetX(void) const; + + /* + * Gets the x position of the control. @n + * The position of control is relative to the top-left corner of its parent container. + * + * @since 2.1 + * + * @return The x position of the control + * @see GetBounds() + * @see GetPosition() + * @see GetYF() + */ + float GetXF(void) const; + + /** + * Gets the y position of the control. @n + * The position of control is relative to the top-left corner of its parent container. + * + * @since 2.0 + * + * @return The y position of the control + * @see GetBounds() + * @see GetPosition() + * @see Get() + */ + int GetY(void) const; + + /* + * Gets the y position of the control. @n + * The position of control is relative to the top-left corner of its parent container. + * + * @since 2.1 + * + * @return The y position of the control + * @see GetBounds() + * @see GetPosition() + * @see GetXF() + */ + float GetYF(void) const; + + /** + * Gets the width of the control. + * + * @since 2.0 + * + * @return The width of the control + * @see GetBounds() + * @see GetSize() + * @see GetHeight() + */ + int GetWidth(void) const; + + /* + * Gets the width of the control. + * + * @since 2.1 + * + * @return The width of the control + * @see GetBounds() + * @see GetSizeF() + * @see GetHeightF() + */ + float GetWidthF(void) const; + + /** + * Gets the height of the control. + * + * @since 2.0 + * + * @return The height of the control + * @see GetBounds() + * @see GetSize() + * @see GetWidth() + */ + int GetHeight(void) const; + + /* + * Gets the height of the control. + * + * @since 2.1 + * + * @return The height of the control + * @see GetBounds() + * @see GetSizeF() + * @see GetWidthF() + */ + float GetHeightF(void) const; + + /** + * Gets the minimum size of the control. + * + * @since 2.0 + * + * @return The minimum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The first call of the method returns the system-defined minimum size. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::Dimension GetMinimumSize(void) const; + + /* + * Gets the minimum size of the control. + * + * @since 2.1 + * + * @return The minimum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The first call of the method returns the system-defined minimum size. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::FloatDimension GetMinimumSizeF(void) const; + + /** + * Gets the maximum size of the control. + * + * @since 2.0 + * + * @return The maximum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The first call of the method returns the system-defined maximum size. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::Dimension GetMaximumSize(void) const; + + /* + * Gets the maximum size of the control. + * + * @since 2.1 + * + * @return The maximum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The first call of the method returns the system-defined maximum size. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::FloatDimension GetMaximumSizeF(void) const; + + /** + * Gets a font of the control. + * + * @since 2.0 + * + * @return The font name set in the control @n + * else an empty string if the font is not set + * @see SetFont() + */ + Tizen::Base::String GetFont(void) const; + + /** + * Sets the position and size of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect The new bounds of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsMovable() + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetPosition() + * @see SetSize() + */ + result SetBounds(const Tizen::Graphics::Rectangle& rect); + + /* + * Sets the position and size of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The new bounds of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsMovable() + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetPosition() + * @see SetSiz() + */ + result SetBounds(const Tizen::Graphics::FloatRectangle& rect); + + /** + * Sets the position and size of the control. @n + * The position is set at (x, y), and the @c width and @c height parameters contain + * the width and height values of the object, respectively. + * + * @since 2.0 + * + * @return An error code + * @param[in] x The new x position of the control + * @param[in] y The new y position of the control + * @param[in] width The new width of the control + * @param[in] height The new height of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsMovable() + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetPosition() + * @see SetSize() + */ + result SetBounds(int x, int y, int width, int height); + + /* + * Sets the position and size of the control. @n + * The position is set at (x, y), and the @c width and @c height parameters contain + * the width and height values of the object, respectively. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The new x position of the control + * @param[in] y The new y position of the control + * @param[in] width The new width of the control + * @param[in] height The new height of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsMovable() + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetPosition() + * @see SetSize() + */ + result SetBounds(float x, float y, float width, float height); + + /** + * Sets the relative position of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] Position The new position + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not movable. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The position of the control are relative to the top-left corner of its parent. + * @see IsMovable() + * @see SetBounds() + */ + result SetPosition(const Tizen::Graphics::Point& position); + + /* + * Sets the relative position of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] Position The new position + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not movable. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The position of the control are relative to the top-left corner of its parent. + * @see IsMovable() + * @see SetBounds() + */ + result SetPosition(const Tizen::Graphics::FloatPoint& position); + + /** + * Sets the position of the control. + * + * @since 2.0 + * @return An error code + * @param[in] x The new x position of the control + * @param[in] y The new y position of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not movable. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The x,y position of the control are relative to the top-left corner of its parent. + * @see IsMovable() + * @see SetBounds() + */ + result SetPosition(int x, int y); + + /* + * Sets the position of the control. + * + * @since 2.1 + * @return An error code + * @param[in] x The new x position of the control + * @param[in] y The new y position of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not movable. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The x,y position of the control are relative to the top-left corner of its parent. + * @see IsMovable() + * @see SetBounds() + */ + result SetPosition(float x, float y); + + /** + * Sets the size of the control. + * The @c width and @c height parameters contain the width and height values of the object, respectively. + * + * @since 2.0 + * + * @return An error code + * @param[in] size The new width and height + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetBounds() + */ + result SetSize(const Tizen::Graphics::Dimension& size); + + /* + * Sets the size of the control. + * The @c width and @c height parameters contain the width and height values of the object, respectively. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The new width and height + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetBounds() + */ + result SetSize(const Tizen::Graphics::FloatDimension& size); + + /** + * Sets the size of the control. + * The @c width and @c height parameters contain the width and height values of the object, respectively. + * + * @since 2.0 + * + * @return An error code + * @param[in] width The new width of the control + * @param[in] height The new height of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetBounds() + */ + result SetSize(int width, int height); + + /* + * Sets the size of the control. + * The @c width and @c height parameters contain the width and height values of the object, respectively. + * + * @since 2.1 + * + * @return An error code + * @param[in] width The new width of the control + * @param[in] height The new height of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The control has not been constructed as yet. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see IsResizable() + * @see GetMinimumSize() + * @see GetMaximumSize() + * @see SetBounds() + */ + result SetSize(float width, float height); + + /** + * Sets the minimum size of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] newMinDim The new minimum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method can affect the maximum size and the current size of the control. @n + * The control needs to be redrawn to reflect the change in its size. @n + * If the current maximum size or the control size is smaller than the new minimum size, + * it becomes the same as the new minimum size. + * @see IsResizable() + */ + result SetMinimumSize(const Tizen::Graphics::Dimension& newMinDim); + + /* + * Sets the minimum size of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] newMinDim The new minimum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method can affect the maximum size and the current size of the control. @n + * The control needs to be redrawn to reflect the change in its size. @n + * If the current maximum size or the control size is smaller than the new minimum size, + * it becomes the same as the new minimum size. + * @see IsResizable() + */ + result SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinDim); + + /** + * Sets the maximum size of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] newMaxDim The new maximum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method can affect the minimum size and the current size of the control. @n + * The control needs to be redrawn to reflect the change in its size. @n + * If the current minimum size or the control size is greater than the new maximum size, + * it becomes the same as the new maximum size. + * @see IsResizable() + */ + result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxDim); + + /* + * Sets the maximum size of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] newMaxDim The new maximum size of the control + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This control is not resizable. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method can affect the minimum size and the current size of the control. @n + * The control needs to be redrawn to reflect the change in its size. @n + * If the current minimum size or the control size is greater than the new maximum size, + * it becomes the same as the new maximum size. + * @see IsResizable() + */ + result SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxDim); + + /** + * Converts the specified screen position to the position in control's coordinate system. + * + * @since 2.0 + * + * @return The position relative to the top-left corner of the control's client-area + * @param[in] screenPosition The position relative to the top-left corner of the screen + * @see ConvertToScreenPosition() + */ + Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const; + + /* + * Converts the specified screen position to the position in control's coordinate system. + * + * @since 2.1 + * + * @return The position relative to the top-left corner of the control's client-area + * @param[in] screenPosition The position relative to the top-left corner of the screen + * @see ConvertToScreenPosition() + */ + Tizen::Graphics::FloatPoint ConvertToControlPosition(const Tizen::Graphics::FloatPoint& screenPosition) const; + + /** + * Converts the specified position in the control's coordinate system to the screen position. + * + * @since 2.0 + * + * @return The position relative to the top-left corner of the screen + * @param[in] controlPosition The position relative to the top-left corner of the control's client-area + * @see ConvertToControlPosition() + */ + Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const; + + /* + * Converts the specified position in the control's coordinate system to the screen position. + * + * @since 2.1 + * + * @return The position relative to the top-left corner of the screen + * @param[in] controlPosition The position relative to the top-left corner of the control's client-area + * @see ConvertToControlPosition() + */ + Tizen::Graphics::FloatPoint ConvertToScreenPosition(const Tizen::Graphics::FloatPoint& controlPosition) const; + + /** + * Sets the font of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] fontName The app font name or system font name @n + * The app font name is retrieved using Tizen::Graphics::Font::GetFaceName(Tizen::Base::String& filepath). @n + * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN(). + * Sets an empty string to reset. + * @exception E_SUCCESS The method is successful. + * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. + * @remarks At first, the value of @c fontName is considered app font name if it matches one of the face names of the font files which are located in @b '/res/font'. + * If not, the value of @c fontName is considered system font name if it matches one of the retrieved values using Tizen::Graphics::Font::GetSystemFontListN(). + * @remarks The control first attempts to find the control font. If it fails, then it searches for the application default font and the system font, in sequence. + * @see GetFont() + */ + result SetFont(const Tizen::Base::String& fontName); + + /** + * Checks whether the specified @c point is inside the control. + * + * @since 2.0 + * + * @return @c true if the specified @c point is inside the control, @n + * else @c false + * @param[in] point The point to check + * @remarks The specified @c point must be defined relative to the top-left corner of the control. + */ + bool Contains(const Tizen::Graphics::Point& point) const; + + /* + * Checks whether the specified @c point is inside the control. + * + * @since 2.1 + * + * @return @c true if the specified @c point is inside the control, @n + * else @c false + * @param[in] point The point to check + * @remarks The specified @c point must be defined relative to the top-left corner of the control. + */ + bool Contains(const Tizen::Graphics::FloatPoint& point) const; + + /** + * Checks whether the specified point is inside the control. + * + * @since 2.0 + * + * @return @c true if the specified point is inside the control, @n + * else @c false + * @param[in] x The x position of the point to check + * @param[in] y The y position of the point to check + * @remarks The specified point must be defined relative to the top-left corner of the control. + */ + bool Contains(int x, int y) const; + + /* + * Checks whether the specified point is inside the control. + * + * @since 2.1 + * + * @return @c true if the specified point is inside the control, @n + * else @c false + * @param[in] x The x position of the point to check + * @param[in] y The y position of the point to check + * @remarks The specified point must be defined relative to the top-left corner of the control. + */ + bool Contains(float x, float y) const; + + /** + * Draws child controls recursively. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.0 + * + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompDrawPage "here". + * @endif + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method calls OnDraw() immediately in a synchronous way. + * @see Show() + */ + result Draw(void); + + /** + * @if OSPCOMPAT + * @page CompDrawPage Compatibility for Draw() + * @section CompDrawPageIssueSection Issues + * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n + * -# Draw() method draws child controls in a recursive way regardless of the visibility of the parent. + * + * @section CompDrawPageSolutionSection Resolutions + * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n + * -# Draw() method does not draw child controls if the control itself is not visible. + * @endif + */ + + /** + * Draws the control. + * + * @since 2.0 + * + * @param[in] recursive Set to @c true to draw child controls recursively, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method calls OnDraw() immediately in a synchronous way. + * @see Show() + */ + result Draw(bool recursive); + + /** + * Shows the control on the screen. + * + * @since 2.0 + * @final Although this method is virtual, it should not be overridden. + * If overridden, it may not work as expected. + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + */ + virtual result Show(void); + + /** + * Invalidates the control. + * + * @since 2.0 + * + * @param[in] recursive Set to @c true to invalidate child controls recursively, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks OnDraw() is not called immediately, but called asynchronously just before the screen is updated. + * @see InvalidateBounds() + * @see Show() + */ + void Invalidate(bool recursive); + + /** + * Invalidates the control of the specified position and size. + * + * @since 2.0 + * + * @param[in] bounds The position relative to the top-left corner of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see Invalidate() + * @see Show() + */ + void InvalidateBounds(const Tizen::Graphics::Rectangle& bounds); + + /* + * Invalidates the control of the specified position and size. + * + * @since 2.1 + * + * @param[in] bounds The position relative to the top-left corner of the control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * Note: This control cannot be displayed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see Invalidate() + * @see Show() + */ + void InvalidateBounds(const Tizen::Graphics::FloatRectangle& bounds); + + /** + * Draws the control asynchronously. + * + * @since 2.0 + * + * @param[in] show Set to @c true to also show the %Control, @n + * else @c false + * @remarks This method posts a draw event in the event queue. @n + * Drawing requested by %RequestRedraw() occurs when the draw event is fired to the control. + */ + void RequestRedraw(bool show = true) const; + + /** + * Creates and returns a graphics canvas whose bounds (that is, position and size) are equal to those + * of the control. + * + * @since 2.0 + * + * @return The graphic canvas of the control, @n + * else @c null if an exception occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the control. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged. + * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method + * if the size or position of the control is changed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, + * if custom drawing is performed on the graphic canvas of Frame and Form + * then it will appear on the screen regardless of which control is currently visible on the screen. + * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const + * @see GetCanvasN(int x, int y, int width, int height) const + * @code + * result + * MyForm::OnDraw(void) + * { + * result r = E_SUCCESS; + * Canvas* pCanvas = GetCanvasN(); + * if (pCanvas != null) + * { + * // add your drawing code here + * } + * if (pCanvas) + * delete pCanvas; + * // Do not call Show(). It will be called automatically after OnDraw() callback. + * return r; + * } + * @endcode + */ + Tizen::Graphics::Canvas* GetCanvasN(void) const; + + /** + * Creates and returns a graphic canvas of the control of the specified position and size. + * + * @since 2.0 + * + * @return The graphic canvas of the control, @n + * else @c null if an exception occurs + * @param[in] bounds The bounds of the graphic canvas + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks Only the graphic canvas of displayable controls can be obtained. + * If the specified area is not inside the control, + * the graphics canvas of overlapped area between the control and the specified bound is returned. @n + * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged. + * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method + * if the size or position of the control is changed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, + * if custom drawing is performed on the graphic canvas of Frame and Form + * then it will appear on the screen regardless of which control is currently visible on the screen. + * @see GetCanvasN(void) const + * @see GetCanvasN(int x, int y, int width, int height) const + */ + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const; + + /* + * Creates and returns a graphic canvas of the control of the specified position and size. + * + * @since 2.1 + * + * @return The graphic canvas of the control, @n + * else @c null if an exception occurs + * @param[in] bounds The bounds of the graphic canvas + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks Only the graphic canvas of displayable controls can be obtained. + * If the specified area is not inside the control, + * the graphics canvas of overlapped area between the control and the specified bound is returned. @n + * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged. + * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method + * if the size or position of the control is changed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, + * if custom drawing is performed on the graphic canvas of Frame and Form + * then it will appear on the screen regardless of which control is currently visible on the screen. + * @see GetCanvasN(void) const + * @see GetCanvasN(float x, float y, float width, float height) const + */ + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const; + + /** + * Creates and returns a graphic canvas of the specified position and size in the control. + * + * @since 2.0 + * + * @return The graphic canvas of the control, @n + * else @c null if an exception occurs + * @param[in] x The x position relative to the top-left corner of the control + * @param[in] y The y position relative to the top-left corner of the control + * @param[in] width The width of a graphic canvas + * @param[in] height The height of a graphic canvas + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks Only the graphic canvas of displayable controls can be obtained. + * If the specified area is not inside the control, + * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n + * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged. + * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method + * if the size or position of the control is changed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, + * if custom drawing is performed on the graphic canvas of Frame and Form + * then it will appear on the screen regardless of which control is currently visible on the screen. + * @see GetCanvasN(void) const + * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const + */ + Tizen::Graphics::Canvas* GetCanvasN(int x, int y, int width, int height) const; + + /* + * Creates and returns a graphic canvas of the specified position and size in the control. + * + * @since 2.1 + * + * @return The graphic canvas of the control, @n + * else @c null if an exception occurs + * @param[in] x The x position relative to the top-left corner of the control + * @param[in] y The y position relative to the top-left corner of the control + * @param[in] width The width of a graphic canvas + * @param[in] height The height of a graphic canvas + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @remarks Only the graphic canvas of displayable controls can be obtained. + * If the specified area is not inside the control, + * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n + * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control. + * It is the developer's responsibility to deallocate the canvas after use. + * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged. + * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method + * if the size or position of the control is changed. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore, + * if custom drawing is performed on the graphic canvas of Frame and Form + * then it will appear on the screen regardless of which control is currently visible on the screen. + * @see GetCanvasN(void) const + * @see GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const + */ + Tizen::Graphics::Canvas* GetCanvasN(float x, float y, float width, float height) const; + + /** + * Checks whether the control is currently visible on the screen. + * + * @since 2.0 + * + * @return @c true if the control is currently visible on the screen, @n + * else @c false + * @remarks If this method is called before the control is added to a parent, @c false is returned. + * @see GetShowState() + * @see SetShowState() + */ + bool IsVisible(void) const; + + /** + * Gets the current show state of the control. + * + * @since 2.0 + * + * @return The show state of the control + * @remarks Even if the control's state is "show", the control may not be visible. + * @see SetShowState() + * @see IsVisible() + */ + bool GetShowState(void) const; + + /** + * Sets the show state of the control. + * + * @since 2.0 + * + * @return An error code + * @param[in] state The new show state + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * Note: This control cannot be displayed. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + * @remarks Even if this method is invoked, the control is not drawn or shown. @n + * To display the control, use Invalidate() methods. @n + * Once the control's show state is set to @c false, + * the show state needs to be set to @c true again before you invalidate the control. + * @see GetShowState() + * @see Invalidate() + */ + result SetShowState(bool state); + + /** + * Gets the dedicated %VisualElement instance for this control. + * + * @since 2.0 + * + * @return An instance of the VisualElement + * @remarks If an application developer modifies the state of the returned VisualElement + * and the host control is not aware of this change, then the control may behave egregiously. + * It is highly recommended to restore the %VisualElement state to avoid such conflicts. + */ + Tizen::Ui::Animations::VisualElement* GetVisualElement(void) const; + + /** + * Gets the parent of the control. + * + * @since 2.0 + * + * @return The current parent of the control + */ + Container* GetParent(void) const; + + /** + * Gets the name of the control. + * + * @since 2.0 + * + * @return The name of the control + */ + Tizen::Base::String GetName(void) const; + + /** + * Sets the name of the control. + * + * @since 2.0 + * + * @param[in] name The name of the control + */ + void SetName(const Tizen::Base::String& name); + + /** + * Checks whether the control is focusable. + * + * @since 2.0 + * + * @return @c true if control is focusable, @n + * else @c false + * @remarks The focus ability of the container classes like Panel is @c false by default. + */ + bool IsFocusable(void) const; + + /** + * Sets the focus ability of the control. @n + * Non-Focusable controls cannot take the key focus. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * Note: The control does not permit to change its focus ability. + * @exception E_SYSTEM A system error has occurred. + * @remarks The focus ability of the container classes like Panel is @c false by default. + * @remarks The RadioGroup class does not render the UI. + * Therefore, RadioGroup::SetFocusable() returns @c E_SYSTEM. + */ + result SetFocusable(bool focusable); + + /** + * Checks whether the control currently has the input focus. + * + * @since 2.0 + * + * @return @c true if the control currently has the input focus, @n + * else @c false + * @remarks If this method is called before the control is added to a parent, @c false is returned. + * @see SetFocus() + */ + bool HasFocus(void) const; + + /** + * Sets the focus to the control. @n + * This method is called if the control needs to listen to user input events such as key pressed. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * Note: This control cannot be displayed. + * @exception E_INVALID_CONDITION The control is not contained in, or is not the top z-order frame or form. + * @remarks Do not override this method. + */ + result SetFocus(void); + + /** + * Checks whether the control is enabled. + * + * @since 2.0 + * + * @return @c true if the control is enabled, @n + * else @c false + * @remarks If this method is called before the control is added to a parent, @c false is returned. + * @see SetEnabled() + */ + bool IsEnabled(void) const; + + /** + * Enables or disables the control. @n + * Only an enabled control can respond to the user input. By default, the control is enabled. + * + * @since 2.0 + * + * @return An error code + * @param[in] enable The new state of the object + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not override this method. + */ + result SetEnabled(bool enable); + + /** + * Checks whether the device is in touch mode. @n + * When the user interacts with the device by touching it, the device is in touch mode. + * + * @since 2.0 + * + * @return @c true if the device is in touch mode, @n + * else @c false + * @remarks This method returns @c false, for devices with QWERTY keyboard. + * The user can navigate the UI using directional keys. + */ + bool IsInTouchMode(void) const; + + /** + * Enables or disables the drag operation in the %Control. + * + * @since 2.0 + * + * @param[in] enable Set to @c true to enable the drag operation, @n + * else @c false + * @see SetDropEnabled() + */ + void SetDragEnabled(bool enable); + + /** + * Enables or disables the drop operations in the %Control. + * + * @since 2.0 + * + * @param[in] enable Set to @c true to enable drop operations, @n + * else @c false + * @remarks To receive drop event, control's drag property has to be enabled. + * @see SetDragEnabled() + */ + void SetDropEnabled(bool enable); + + /** + * Sends a user event to the control. + * + * @since 2.0 + * + * @param[in] requestId The user-defined event ID + * @param[in] pArgs A pointer to the argument list + * @remarks This method posts a user event in the event queue + * and returns immediately to support asynchronous actions of the framework. + * @see OnUserEventReceived() + */ + void SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs) const; + + /** + * Stops the current UI event dispatch sequence by indicating the current input event is consumed. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, return true inside Propagated Event Listeners which derived from IPropagatedKeyEventListener/IPropagatedTouchEventListener to consume event. + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks If this method is invoked during an UI event (key or touch) propagation sequence, + * the method will stop the propagation and consequently the system will not be notified of the event.@n + * The method will not have any effect if no UI event is being dispatched. @n + * It is recommended that this method is called within IKeyEventListener or + * ITouchEventListener to stop the event from propagating to the next step. + */ + result ConsumeInputEvent(void); + + /** + * Gets the control animator of the current instance of %Control. + * + * @since 2.0 + * + * @return A pointer to ControlAnimator, @n + * else @c null if this instance is not constructed or not added to a parent or non-animatable + */ + Tizen::Ui::Animations::ControlAnimator* GetControlAnimator(void) const; + + /** + * Adds the gesture detector to the %Control. @n + * The added gesture detector receives touch events prior to %Control. + * + * @since 2.0 + * + * @return An error code + * @param[in] gestureDetector The gesture detector + * @exception E_SUCCESS The method is successful. + * @see RemoveGestureDetector() + */ + result AddGestureDetector(const TouchGestureDetector& gestureDetector); + + /* + * Adds the gesture detector to the %Control. @n + * The added gesture detector receives touch events prior to %Control. + * + * @since 2.1 + * + * @return An error code + * @param[in] pGestureDetector Pointer of gesture detector + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pGestureDetector is null. + * @see RemoveGestureDetector() + */ + result AddGestureDetector(TouchGestureDetector* pGestureDetector); + + /** + * Removes the gesture detector from the %Control. + * + * @since 2.0 + * + * @return An error code + * @param[in] gestureDetector The gesture detector + * @exception E_SUCCESS The method is successful. + * @see AddGestureDetector() + */ + result RemoveGestureDetector(const TouchGestureDetector& gestureDetector); + + /* + * Removes the gesture detector from the %Control. + * + * @since 2.1 + * + * @return An error code + * @param[in] pGestureDetector Pointer of gesture detector + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c pGestureDetector is null. + * @see AddGestureDetector() + */ + result RemoveGestureDetector(TouchGestureDetector* pGestureDetector); + + /** + * @if OSPDEPREC + * Gets the composite mode for merging with other controls. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because changing composition mode is not allowed any more. + * @since 2.0 + * + * @return The composite mode + * @exception E_SUCCESS The method is successful. + * @remarks Since API version 2.1, this method only returns COMPOSITE_MODE_ALPHA_BLENDING. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + Tizen::Ui::CompositeMode GetCompositeMode(void) const; + + /** + * @if OSPDEPREC + * Sets the composite mode for merging with other controls. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because changing composition mode is not allowed any more. + * @since 2.0 + * + * @return An error code + * @param[in] compositeMode The composite mode + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The method is not supported. + * @remarks In Tizen, only @c COMPOSITE_MODE_ALPHA_BLENDING is allowed. + * Otherwise, this method returns @c E_UNSUPPORTED_OPERATION. + * @endif + */ + result SetCompositeMode(Tizen::Ui::CompositeMode compositeMode); + + /** + * @if OSPDEPREC + * Gets the chroma key color value that is used for the control composition. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because chromakey color is not supported any more. + * @since 2.0 + * + * @return The chroma key color + * @exception E_UNSUPPORTED_OPERATION The method is not supported. + * @remarks In Tizen, this method always fails and returns Tizen::Graphics::Color(0, 0, 0, 0). + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @endif + */ + Tizen::Graphics::Color GetChromaKeyColor(void) const; + + /** + * @if OSPDEPREC + * Sets the chroma key color value that is used for the control composition. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because chromakey color is not supported any more. + * @since 2.0 + * + * @return An error code + * @param[in] chromaKeyColor The chroma key color + * @exception E_UNSUPPORTED_OPERATION The method is not supported. + * @remarks In Tizen, this method always fails. + * @endif + */ + result SetChromaKeyColor(Tizen::Graphics::Color chromaKeyColor); + + /** + * Sets the bounds of the content area. + * + * @since 2.1 + * + * @param[in] rect The bounds of the content area + * @see GetContentAreaBounds() + */ + void SetContentAreaBounds(const Tizen::Graphics::Rectangle& rect); + + /* + * Sets the bounds of the content area. + * + * @since 2.1 + * + * @param[in] rect The bounds of the content area + * @see GetContentAreaBoundsF() + */ + void SetContentAreaBounds(const Tizen::Graphics::FloatRectangle& rect); + + /** + * Gets the bounds of the content area. + * + * @since 2.1 + * + * @return The bounds of the content area + * @see SetContentAreaBounds() + */ + Tizen::Graphics::Rectangle GetContentAreaBounds(void) const; + + /* + * Gets the bounds of the content area. + * + * @since 2.1 + * + * @return The bounds of the content area + * @see SetContentAreaBounds() + */ + Tizen::Graphics::FloatRectangle GetContentAreaBoundsF(void) const; + + /** + * Captures the composited scene of the %Panel control. + * + * @since 2.0 + * + * @return A Tizen::Graphics::Bitmap instance that captures the current composited scene of the Panel control, @n + * else @c null if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This method is not supported. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks This method is not supported in the following class that is derived from Panel class: + * @li OverlayPanel + * @remarks The bounds of the %Panel control must be within the client area of the Form control to get a valid composited scene. + */ + Tizen::Graphics::Bitmap* GetCapturedBitmapN(void) const; + + /** + * Gets the position and the size of the invalidated bounds. + * + * @since 2.0 + * + * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner, + * the width, and the height of the invalidated bounds + */ + Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const; + + /* + * Gets the position and the size of the invalidated bounds. + * + * @since 2.1 + * + * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner, + * the width, and the height of the invalidated bounds + */ + Tizen::Graphics::FloatRectangle GetInvalidatedBoundsF(void) const; + + /** + * Enables or disables the multi-point touch of the %Control. + * + * @since 2.0 + * + * @param[in] enable A Boolean flag indicating whether to enable the multi-point touch + * + * @see IsMultipointTouchEnabled() + */ + void SetMultipointTouchEnabled(bool enable); + + /** + * Checks whether the multi-point touch is enabled. + * + * @since 2.0 + * + * @return @c true if the multi-point touch is enabled, @n + * else @c false + * @see SetMultipointTouchEnabled() + */ + bool IsMultipointTouchEnabled(void) const; + + /** + * Gets the accessibility container. + * + * @since 2.0 + * + * @return The accessibilit container of the control, if the control supports accessibility feature. @n + * Else @c null. + * @see AccessibilityContainer::GetOwner() + */ + const AccessibilityContainer* GetAccessibilityContainer(void) const; + + /** + * Gets the accessibility container. + * + * @since 2.0 + * + * @return The accessibilit container of the control, if the control supports accessibility feature. @n + * Else @c null. + * @see AccessibilityContainer::GetOwner() + */ + AccessibilityContainer* GetAccessibilityContainer(void); + + /** + * Sets a propagated touch event listener to the Control. + * The registered listener will be notified when a touch event occurs in the control. Using the propagated touch event listener, an application can control the touch event routing path. + * + * @since 2.1 + * + * @param[in] pListener The event listener to which propagated touch events are dispatched. + * @remarks The specified event listener should be allocated in heap memory. + * To unregister the event listener, pass @c null to @c pListener. + + */ + void SetPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener); + + /** + * Sets a propagated key event listener to the Control. + * The registered listener will be notified when a key event occurs in the control. Using the propagated key event listener, an application can control the key event routing path. + * + * @since 2.1 + * + * @param[in] pListener The event listener to which propagated touch events are dispatched. + * @remarks The specified event listener should be allocated in heap memory. + * To unregister the event listener, pass @c null to @c pListener. + + */ + void SetPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener); + + + /** + * Sets the previous focus of the control. + * + * @since 2.1 + * + * @param[in] The pointer to the previous focus of the control + * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior. + * @remarks The platform will not take the ownership of pPreviousFocus after this call. + * @see SetNextFocus() + * @see GetPreviousFocus() + */ + void SetPreviousFocus(Control* pPreviousFocus); + + /** + * Sets the next focus of the control. + * + * @since 2.1 + * + * @param[in] The pointer to the next focus of the control + * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior. + * @remarks The platform will not take the ownership of pNextFocus after this call. + * @see SetPreviousFocus() + * @see GetNextFocus() + */ + void SetNextFocus(Control* pNextFocus); + + /** + * Gets the previous focus of the control + * + * @since 2.1 + * + * @return The pointer to the previous focus of the control, + * else @c null if the previous focus of the control is not set + * @see GetNextFocus() + * @see SetNextFocus () + */ + Control* GetPreviousFocus(void) const; + + + /** + * Gets the next focus of the control + * + * @since 2.1 + * + * @return The pointer to the next focus of the control + * else @c null if the next focus of the control is not set + * @see GetPreviousFocus() + * @see SetPreviousFocus () + */ + Control* GetNextFocus(void) const; + + /** + * Sets the touch press threshold of the Control in inches. + * A touch move event will start to fire if the move distance exceeds the touch press threshold value. + * For example, if the value is 0.5, a touch move event will be fired if the move distance exceeds 0.5 inch. + * This method is offered to control sensitivity of touch move event. + * + * @since 2.1 + * + * @param[in] distance The threshold to fire touch move event in inch + */ + void SetTouchPressThreshold(float distance); + + /** + * Gets the touch press threshold of the Control in inches. + * If the threshold has not been set, it returns the default value. + * + * @since 2.1 + * + * @return The threshold to fire touch move event + */ + float GetTouchPressThreshold(void) const; + + + /** + * Sets the font of the control with the specified file name. + * + * @since 2.1 + * + * @return An error code + * @param[in] file name The file name of a font-resource which are located in ‘/res/font’ + * Sets an empty string to reset. + * @exception E_SUCCESS The method is successful. + * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. + * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported. + * @see GetFontFile() + */ + result SetFontFromFile(const Tizen::Base::String& fileName); + + /** + * Gets a font file name of the control. + * + * @since 2.1 + * + * @return The font name set in the control @n + * else an empty string if the font is not set + * @see SetFontFromFile() + */ + Tizen::Base::String GetFontFile(void) const; + +protected: + /** + * Gets the default key event listener. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. + * @since 2.0 + * + * @return The default key event listener. @n + * If no listener has been set or a system error has occurred, @c null is returned. + * @see SetDefaultKeyEventListener() + */ + IKeyEventListener* GetDefaultkeyEventListener(void) const; + + /** + * Gets the default touch event listener. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. + * @since 2.0 + * + * @return The default touch event listener. + * If no listener has been set or a system error has occurred @c null is returned. + * @see SetDefaultTouchEventListener() + */ + ITouchEventListener* GetDefaultTouchEventListener(void) const; + + /** + * Sets the default key event listener. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedKeyEventListener() method. + * @since 2.0 + * + * @return An error code + * @param[in] pDefaultListener The default key event listener + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The registered listener will be notified to handle the key events + * after all application event listeners has been notified. + * @see GetDefaultkeyEventListener() + */ + result SetDefaultKeyEventListener(IKeyEventListener* pDefaultListener); + + /** + * Sets the default touch event listener. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedTouchEventListener() method. + * @since 2.0 + * + * @return An error code + * @param[in] pDefaultListener The default key event listener + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The registered listener will be notified to handle the touch events + * after all application event listeners has been notified. + * @see GetDefaultTouchEventListener() + */ + result SetDefaultTouchEventListener(ITouchEventListener* pDefaultListener); + + /** + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ + Control(void); + + /** + * This method is for internal use only. Using this method can cause behavioral, security-related, + * and consistency-related issues in the application. + * + * Initializes this instance of %Control. + * + * @since 2.0 + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(void); + + /** + * Frees the resources allocated by Construct(). + * + * @since 2.0 + */ + void Dispose(void); + +protected: + _ControlImpl* _pControlImpl; + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Control_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Control_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Control_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Control_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + + virtual void Control_Reserved5(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Control_Reserved6(void) {} + +private: + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + Control(const Control& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + Control& operator =(const Control& rhs); + +private: + friend class _ControlImpl; +}; // Control + +}} // Tizen::Ui + +#endif // _FUI_CONTROL_H_ diff --git a/inc/FUiControls.h b/inc/FUiControls.h old mode 100644 new mode 100755 index 2e63307..5e806b2 --- a/inc/FUiControls.h +++ b/inc/FUiControls.h @@ -55,12 +55,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -78,22 +79,28 @@ #include #include #include +#include #include #include +#include #include #include #include #include +#include #include #include #include +#include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -146,7 +153,7 @@ namespace Tizen * @brief This namespace contains the classes and interfaces for creating rich user interface components for the applications. * @since 2.0 * - * @remarks @b %Header @b %file: @b \#include @b @n + * @remarks @b Header @b %file: @b \#include @b @n * @b Library : @b osp-uifw * * The %Ui::Controls namespace contains classes that have graphical representations that can be displayed on the screen as UI elements and with @@ -174,7 +181,6 @@ namespace Controls * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_TITLE_TEXT; @@ -198,7 +203,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_TITLE_TEXT; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_BODY_TEXT; @@ -222,7 +225,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_BODY_TEXT; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_FOREGROUND; @@ -246,7 +247,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_FOREGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_BACKGROUND; @@ -270,7 +269,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_BACKGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_BACKGROUND; @@ -294,7 +291,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_BACKGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_FORM_BACKGROUND; @@ -318,7 +313,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_FORM_BACKGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_FORM_GROUP_BACKGROUND; @@ -342,7 +335,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_FORM_GROUP_BACKGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_POPUP_BACKGROUND; @@ -366,7 +357,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_POPUP_BACKGROUND; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_GROUP_ITEM_TEXT; @@ -390,7 +379,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_GROUP_ITEM_TEXT; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_ITEM_TEXT; @@ -414,7 +401,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_ITEM_TEXT; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_ITEM_PRESSED_TEXT; @@ -438,7 +423,6 @@ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_ITEM_PRESSED_TEXT; * @endif */ /** - * @if OSPDEPREC * @htmlonly * * @endhtmlonly - * @endif */ extern const Tizen::Graphics::Color SYSTEM_COLOR_LIST_ITEM_HIGHLIGHTED_TEXT; diff --git a/inc/FUiCtrlAnimation.h b/inc/FUiCtrlAnimation.h index ed84d47..573f161 100644 --- a/inc/FUiCtrlAnimation.h +++ b/inc/FUiCtrlAnimation.h @@ -219,6 +219,25 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, const Tizen::Base::Collection::IList& aniFrames); + /* + * Initializes this instance of %Animation with the specified parameters. @n + * The input list of the AnimationFrame instances (@c aniFrames) should be deleted explicitly after use. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * its width and height. + * @param[in] aniFrames An IList of %AnimationFrames used in the animation + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier. @n + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @see AnimationFrame + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::Collection::IList& aniFrames); public: /** @@ -260,8 +279,9 @@ public: * * @since 2.0 * - * @return The total repeat count, @n - * else @c -1 if the %Animation instance is not constructed + * @return The total repeat count + * + * @remarks The default repeat count is 1. */ int GetRepeatCount(void) const; @@ -271,8 +291,9 @@ public: * * @since 2.0 * - * @return The current repeated count, @n - * else @c -1 if the %Animation instance is not constructed + * @return The current repeated count + * + * @remarks The default current repeated count is 0. */ int GetCurrentRepeatedCount(void) const; @@ -282,8 +303,9 @@ public: * * @since 2.0 * - * @return The total image count, @n - * else @c -1 if the %Animation instance is not constructed + * @return The total image count + * + * @remarks The default image count is 0. */ int GetImageCount(void) const; @@ -317,8 +339,9 @@ public: * * @since 2.0 * - * @return The status of animation, @n - * else ANIMATION_STOPPED if the %Animation control is not constructed + * @return The status of animation + * + * @remarks The default animation status is ANIMATION_STOPPED. */ AnimationStatus GetStatus(void) const; diff --git a/inc/FUiCtrlButton.h b/inc/FUiCtrlButton.h index 7c969cb..1ec7b85 100644 --- a/inc/FUiCtrlButton.h +++ b/inc/FUiCtrlButton.h @@ -211,6 +211,26 @@ public: result Construct(const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& text = L""); /** + * Initializes this instance of %Button with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Rectangle class @n + * This instance represents the x and y coordinates of the top-left corner @n + * of the created window along with its width and height. @n + * @param[in] text The text to be displayed on the button + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully functional only after it has been added to a container. Therefore, some methods may fail if they are used before + * adding the control to the container. + * @remarks To display the text in multi-lines or to denote the end of line, use '\\n'. + * @remarks The size of the control must be within the range defined by the minimum and maximum sizes. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& text = L""); + + /** * Adds a listener instance. @n * The added listener can listen to events on the given event dispatcher's context when they are fired. * @@ -393,6 +413,36 @@ public: void SetNormalBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); /** + * Sets a bitmap that is to be displayed when the button is not pressed. + * + * @since 2.1 + * + * @param[in] position The location of a bitmap where it is to be displayed on the button + * @param[in] bitmap The bitmap of to be set + */ + void SetNormalBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + + /** + * Sets the disabled bitmap of the button. + * + * @since 2.0 + * + * @param[in] position The location of disabled bitmap + * @param[in] bitmap The disabled bitmap of the button + */ + void SetDisabledBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + + /** + * Sets the disabled bitmap of the button. + * + * @since 2.1 + * + * @param[in] position The location of disabled bitmap + * @param[in] bitmap The disabled bitmap of the button + */ + void SetDisabledBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + + /** * Sets the bitmap that is to be displayed on the button when it is pressed. * * @since 2.0 @@ -403,14 +453,34 @@ public: void SetPressedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); /** - * Sets the disabled bitmap of the button. - * - * @since 2.0 - * - * @param[in] position The location of disabled bitmap - * @param[in] bitmap The disabled bitmap of the button - */ - void SetDisabledBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + * Sets the bitmap that is to be displayed on the button when it is pressed. + * + * @since 2.1 + * + * @param[in] position The location of a bitmap where it is to be displayed on the Button control + * @param[in] bitmap The bitmap to be set + */ + void SetPressedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + + /** + * Sets the highlighted bitmap of the button. + * + * @since 2.1 + * + * @param[in] position The location of highlighted bitmap + * @param[in] bitmap The highlighted bitmap of the button + */ + void SetHighlightedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + + /** + * Sets the highlighted bitmap of the button. + * + * @since 2.1 + * + * @param[in] position The location of highlighted bitmap + * @param[in] bitmap The highlighted bitmap of the button + */ + void SetHighlightedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); /** * Sets the normal background bitmap of the button. @@ -422,6 +492,15 @@ public: void SetNormalBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); /** + * Sets the disabled background bitmap of the button. + * + * @since 2.1 + * + * @param[in] bitmap The disabled background image + */ + void SetDisabledBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); + + /** * Sets the pressed background bitmap of the button. * * @since 2.0 @@ -481,6 +560,20 @@ public: int GetTextSize(void) const; /** + * Gets the text size. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1.0f if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + + /** * Sets the text size. * * @since 2.0 @@ -495,6 +588,21 @@ public: */ result SetTextSize(int size); + /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c size must be greater than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSize() + */ + result SetTextSize(float size); + protected: friend class _ButtonImpl; diff --git a/inc/FUiCtrlCheckButton.h b/inc/FUiCtrlCheckButton.h index 66501a7..0d71a09 100644 --- a/inc/FUiCtrlCheckButton.h +++ b/inc/FUiCtrlCheckButton.h @@ -32,7 +32,6 @@ #include #include #include -#include namespace Tizen { namespace Ui { namespace Controls { @@ -64,14 +63,15 @@ enum CheckButtonStyle CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER, /**< @if OSPDEPREC @deprecated This enumeration field is deprecated because the use of the divider style is no longer recommended @n Instead of using the divider style, use the detailed button style. @endif */ CHECK_BUTTON_STYLE_ONOFF, /**< @if OSPDEPREC @deprecated This enumeration field is deprecated because the use of the on-off style is no longer recommended @n - Instead of using the on-off style, use the on-off sliding style @endif */ + Instead of using the on-off style, use the on-off sliding style @endif*/ CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER, /**< @if OSPDEPREC @deprecated This enumeration field is deprecated because the use of the on-off style is no longer recommended @endif */ CHECK_BUTTON_STYLE_RADIO, /**< The radio style for single selection */ CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER, /**< @if OSPDEPREC @deprecated This enumeration field is deprecated because the use of the divider style is no longer recommended @n - Instead of using the divider style, use the detailed button style @endif */ + Instead of using the divider style, use the detailed button style @endif*/ CHECK_BUTTON_STYLE_ONOFF_SLIDING, /**< The slider style on/off */ CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON, /**< The mark style with detail button */ CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON, /**< The radio style with detail button */ + CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER, /**< The slider style On/Off with divider @b Since: @b 2.1 */ }; /** @@ -217,6 +217,32 @@ public: BACKGROUND_STYLE_DEFAULT, bool showTitle = false, const Tizen::Base::String& text = L"", GroupStyle groupStyle = GROUP_STYLE_NONE); /** + * Initializes this instance of %CheckButton with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Rectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window + * along with the width and height of the window. + * @param[in] style The style of the %CheckButton control + * @param[in] backgroundStyle The background style set of the %CheckButton control + * @param[in] showTitle Set to @c true to enable the title, @n + * else @c false + * @param[in] text The text of the %CheckButton control + * @param[in] groupStyle The group style of the %CheckButton control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid.@n + * The specified size is less than the minimum size of the control. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The background style of BACKGROUND_STYLE_NONE does not work with group styles except GROUP_STYLE_NONE. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier. @n + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, CheckButtonStyle style, BackgroundStyle backgroundStyle = + BACKGROUND_STYLE_DEFAULT, bool showTitle = false, const Tizen::Base::String& text = L"", GroupStyle groupStyle = GROUP_STYLE_NONE); + + /** * Sets the selected status of the %CheckButton control. * * @since 2.0 diff --git a/inc/FUiCtrlColorPicker.h b/inc/FUiCtrlColorPicker.h index 28cc03b..e98f169 100644 --- a/inc/FUiCtrlColorPicker.h +++ b/inc/FUiCtrlColorPicker.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlColorPicker.h - * @brief This is the header file for the %ColorPicker class. - * - * This header file contains the declarations of the %ColorPicker class. - */ +* @file FUiCtrlColorPicker.h +* @brief This is the header file for the %ColorPicker class. +* +* This header file contains the declarations of the %ColorPicker class. +*/ #ifndef _FUI_CTRL_COLOR_PICKER_H_ #define _FUI_CTRL_COLOR_PICKER_H_ @@ -32,18 +32,18 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class ColorPicker - * @brief This class defines the common behavior of a %ColorPicker control. - * - * @since 2.0 - * - * The %ColorPicker class displays a set of 3 sliders (hue, saturation, and luminance) with which the user can define a color. - * - * For more information on the class features, see ColorPicker. - * - * The following example demonstrates how to use the %ColorPicker class. - * - * @code +* @class ColorPicker +* @brief This class defines the common behavior of a %ColorPicker control. +* +* @since 2.0 +* +* The %ColorPicker class displays a set of 3 sliders (hue, saturation, and luminance) with which the user can define a color. +* +* For more information on the class features, see ColorPicker. +* +* The following example demonstrates how to use the %ColorPicker class. +* +* @code // Sample code for ColorPickerSample.h #include #include @@ -105,8 +105,8 @@ ColorPickerSample::OnColorChanged(const Control& source, const Color& color) { // .... } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ ColorPicker : public Tizen::Ui::Control @@ -139,6 +139,19 @@ public: */ result Construct(const Tizen::Graphics::Point& point); + /* + * Initializes this instance of %ColorPicker with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The position of this %ColorPicker in the container + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control is used earlier. + */ + result Construct(const Tizen::Graphics::FloatPoint& point); + /** * Gets the current color value of %ColorPicker. * diff --git a/inc/FUiCtrlContextMenu.h b/inc/FUiCtrlContextMenu.h old mode 100644 new mode 100755 index 9296d01..93869be --- a/inc/FUiCtrlContextMenu.h +++ b/inc/FUiCtrlContextMenu.h @@ -197,7 +197,7 @@ ContextMenuSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the __pContextMenu - delete __pContextMenu; + __pContextMenu->Destroy(); return r; } @@ -265,6 +265,20 @@ public: */ result Construct(const Tizen::Graphics::Point& point, ContextMenuStyle style); + /* + * Initializes this instance of %ContextMenu with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The x and y coordinates of the anchor of %ContextMenu + * @param[in] style The context menu style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance has already been constructed. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style); + /** * Initializes this instance of %ContextMenu with the specified parameters. * @@ -280,6 +294,21 @@ public: */ result Construct(const Tizen::Graphics::Point& point, ContextMenuStyle style, ContextMenuAnchorDirection direction); + /* + * Initializes this instance of %ContextMenu with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The x and y coordinates of the anchor of the %ContextMenu control + * @param[in] style The context menu style + * @param[in] direction The anchor arrow direction + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance has already been constructed. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction); + /** * Adds a listener instance. * The added listener can listen to events on the given context of the event dispatcher when they are fired. @@ -523,6 +552,7 @@ public: * @return An error code * @param[in] index The location * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index less than @c 0 or greater than the number of items in %ContextMenu. * @exception E_SYSTEM A system error has occurred. */ result RemoveItemAt(int index); @@ -608,6 +638,20 @@ public: */ result SetAnchorPosition(const Tizen::Graphics::Point& position); + /* + * Sets the position of the anchor. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The new position + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @remarks The x and y coordinates of the anchor are defined in the coordinate space of its parent, + * which means that @c x and @c y must be defined relative to the top-left corner (0,0) of its parent. + */ + result SetAnchorPosition(const Tizen::Graphics::FloatPoint& position); + /** * Gets the position of the anchor. * @@ -618,6 +662,16 @@ public: */ Tizen::Graphics::Point GetAnchorPosition(void) const; + /* + * Gets the position of the anchor. + * + * @since 2.1 + * + * @return The position of the anchor + * @remarks The coordinate of the anchor position is defined from the top-left corner of its parent Container. + */ + Tizen::Graphics::FloatPoint GetAnchorPositionF(void) const; + /** * Gets the color of the %ContextMenu control. * diff --git a/inc/FUiCtrlControlsTypes.h b/inc/FUiCtrlControlsTypes.h old mode 100644 new mode 100755 index 34cc315..1ccba1f --- a/inc/FUiCtrlControlsTypes.h +++ b/inc/FUiCtrlControlsTypes.h @@ -78,7 +78,7 @@ enum HorizontalAlignment { ALIGNMENT_LEFT, /**< The text is left-aligned */ ALIGNMENT_CENTER, /**< The text is center-aligned horizontally */ - ALIGNMENT_RIGHT /**< The text is right-aligned */ + ALIGNMENT_RIGHT /**< The text is right-aligned */ }; /** @@ -95,6 +95,22 @@ enum VerticalAlignment ALIGNMENT_BOTTOM /**< The text is bottom-aligned */ }; +/** + * @enum GroupStyle + * + * Defines the table view style of a control's border. + * + * @since 2.0 + */ +enum GroupStyle +{ + GROUP_STYLE_NONE, /**< A rectangle with no outline */ + GROUP_STYLE_SINGLE, /**< A rectangle with all corners rounded */ + GROUP_STYLE_TOP, /**< A rectangle with the two top corners rounded */ + GROUP_STYLE_MIDDLE, /**< A rectangle positioned at the center of a group */ + GROUP_STYLE_BOTTOM /**< A rectangle with the two bottom corners rounded */ +}; + }}}// Tizen::Ui::Controls #endif //_FUI_CTRL_CONTROLS_TYPES_H_ diff --git a/inc/FUiCtrlCustomItem.h b/inc/FUiCtrlCustomItem.h index 06d763f..9b0b01f 100644 --- a/inc/FUiCtrlCustomItem.h +++ b/inc/FUiCtrlCustomItem.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,19 @@ public: */ result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + /* + * Initializes this instance of %CustomItem with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @param[in] style The style of the annex + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); + /** * Adds an instance of EnrichedText as an element to the %CustomItem control. * @@ -100,6 +114,21 @@ public: */ result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::EnrichedText& text); + /* + * Adds an instance of EnrichedText as an element to the %CustomItem control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the element + * @param[in] elementId The element ID + * @param[in] text The instance of EnrichedText + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + */ + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::EnrichedText& text); + /** * Adds the text as an element to the %CustomItem control. * @@ -119,6 +148,25 @@ public: */ result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = true); + /* + * Adds the text as an element to the %CustomItem control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the element + * @param[in] elementId The element ID + * @param[in] text The text string to add + * @param[in] textSliding Set to @c true to allow a long text to slide, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks If the width of the specified @c text exceeds the width of the element and @c textSliding is set to @c true, the text slides + * automatically when the user long-presses. + */ + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = true); + /** * Adds the text as an element to the %CustomItem control. * @@ -141,6 +189,28 @@ public: */ result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Base::String& text, int textSize, const Tizen::Graphics::Color& normalTextColor, const Tizen::Graphics::Color& pressedTextColor, const Tizen::Graphics::Color& highlightedTextColor, bool textSliding = true); + /* + * Adds the text as an element to the %CustomItem control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the element + * @param[in] elementId The element ID + * @param[in] text The text string to add + * @param[in] textSize The size of the text + * @param[in] normalTextColor The color of the text in the normal status + * @param[in] pressedTextColor The color of the text in the pressed status + * @param[in] highlightedTextColor The color of the text in the highlighted status + * @param[in] textSliding Set to @c true to allow a long text to slide, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks The default size of text is 38 on a WVGA screen, 22 on a HVGA screen and 20 on a WQVGA screen. + */ + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, float textSize, const Tizen::Graphics::Color& normalTextColor, const Tizen::Graphics::Color& pressedTextColor, const Tizen::Graphics::Color& highlightedTextColor, bool textSliding = true); + /** * Adds the bitmap image as an element to the %CustomItem control. * @@ -158,6 +228,23 @@ public: */ result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = NULL, const Tizen::Graphics::Bitmap* pHighlightedBitmap = NULL); + /* + * Adds the bitmap image as an element to the %CustomItem control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the element + * @param[in] elementId The element ID + * @param[in] normalBitmap The bitmap image displayed when the item is in normal status + * @param[in] pPressedBitmap The bitmap image displayed when the item is pressed + * @param[in] pHighlightedBitmap The bitmap image displayed when the item is highlighted + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + */ + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = NULL, const Tizen::Graphics::Bitmap* pHighlightedBitmap = NULL); + /** * Adds the custom drawing element to the %CustomItem control. * @@ -173,6 +260,21 @@ public: */ result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const ICustomElement& element); + /* + * Adds the custom drawing element to the %CustomItem control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of the element + * @param[in] elementId The element ID + * @param[in] element The custom element + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + */ + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const ICustomElement& element); + /** * Removes the element from the %CustomItem control. * diff --git a/inc/FUiCtrlCustomList.h b/inc/FUiCtrlCustomList.h index eb11c03..d38e9a3 100644 --- a/inc/FUiCtrlCustomList.h +++ b/inc/FUiCtrlCustomList.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -353,7 +353,7 @@ public: * @since 2.0 * * @param[in] listener The event listener to be removed - * @endif + * @endif */ void RemoveCustomItemEventListener(Tizen::Ui::ICustomItemEventListener& listener); @@ -812,7 +812,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. * @exception E_INVALID_ARG The specified input parameter is invalid. @n - * The specified @c index is less than @c 0 or greater than the item count. + * The specified @c index is less than @c 0 or greater than the item count. * @endif */ result ScrollToTop(int index); diff --git a/inc/FUiCtrlCustomListItem.h b/inc/FUiCtrlCustomListItem.h index c5c6a3a..b44408d 100644 --- a/inc/FUiCtrlCustomListItem.h +++ b/inc/FUiCtrlCustomListItem.h @@ -34,7 +34,7 @@ namespace Tizen { namespace Ui { namespace Controls class _CustomListItemImpl; class CustomListItemFormat; /** - * @if OSPDEPREC + * @if OSPDEPREC * @class CustomListItem * @brief [Deprecated] This class defines the common behavior of an item of the CustomList control. * diff --git a/inc/FUiCtrlCustomListTypes.h b/inc/FUiCtrlCustomListTypes.h index e2874eb..1bc394e 100644 --- a/inc/FUiCtrlCustomListTypes.h +++ b/inc/FUiCtrlCustomListTypes.h @@ -28,7 +28,7 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @if OSPDEPREC + * @if OSPDEPREC * @enum CustomListStyle * * Defines the styles of CustomList. @@ -45,8 +45,8 @@ enum CustomListStyle CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER, /**< @if OSPDEPREC The radio style with divider for single selection @endif */ CUSTOM_LIST_STYLE_MARK, /**< @if OSPDEPREC The mark style for multiple selection @endif */ CUSTOM_LIST_STYLE_MARK_WITH_DIVIDER, /**< @if OSPDEPREC The mark style with divider for multiple selection @endif */ - CUSTOM_LIST_STYLE_ONOFF, /**< @if OSPDEPREC The On/Off style */ - CUSTOM_LIST_STYLE_ONOFF_WITH_DIVIDER /**< @if OSPDEPREC The On/Off style with divider */ + CUSTOM_LIST_STYLE_ONOFF, /**< @if OSPDEPREC The On/Off style @endif */ + CUSTOM_LIST_STYLE_ONOFF_WITH_DIVIDER /**< @if OSPDEPREC The On/Off style with divider @endif */ }; }}} // Tizen::Ui::Controls diff --git a/inc/FUiCtrlDatePicker.h b/inc/FUiCtrlDatePicker.h old mode 100644 new mode 100755 index 11b88dc..852253f --- a/inc/FUiCtrlDatePicker.h +++ b/inc/FUiCtrlDatePicker.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlDatePicker.h - * @brief This is the header file for the %DatePicker class. - * - * This header file contains the declarations of the %DatePicker class. - */ +* @file FUiCtrlDatePicker.h +* @brief This is the header file for the %DatePicker class. +* +* This header file contains the declarations of the %DatePicker class. +*/ #ifndef _FUI_CTRL_DATE_PICKER_H_ #define _FUI_CTRL_DATE_PICKER_H_ @@ -31,20 +31,20 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class DatePicker - * @brief This class displays a full screen %DatePicker on top of the screen. - * - * @since 2.0 - * - * @remarks One cannot change the size and the position of the %DatePicker. - * - * The %DatePicker class displays a full screen window-based selector that allows the user to select a certain date. - * - * For more information on the class features, see DatePicker, TimePicker, and DateTimePicker. - * - * The following example demonstrates how to use the %DatePicker class. - * - * @code +* @class DatePicker +* @brief This class displays a full screen %DatePicker on top of the screen. +* +* @since 2.0 +* +* @remarks One cannot change the size and the position of the %DatePicker. +* +* The %DatePicker class displays a full screen window-based selector that allows the user to select a certain date. +* +* For more information on the class features, see DatePicker, TimePicker, and DateTimePicker. +* +* The following example demonstrates how to use the %DatePicker class. +* +* @code // Sample code for DatePickerSample.h #include @@ -142,7 +142,7 @@ DatePickerSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the date picker - delete __pDatePicker; + __pDatePicker->Destroy(); return r; } @@ -175,188 +175,188 @@ DatePickerSample::OnDateChangeCanceled(const Control& source) { // .... } - * @endcode - */ +* @endcode +**/ class _OSP_EXPORT_ DatePicker : public Tizen::Ui::Window { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ DatePicker(void); /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~DatePicker(void); /** - * Adds a data change event listener instance. @n - * The added listener is called when the date of the %DatePicker is changed either through user manipulation or by calling one of its setters. - * - * @since 2.0 - * - * @param[in] listener The listener to be added - * @see IDateChangeEventListener::OnDateChanged() - * @see IDateChangeEventListener::OnDateChangeCanceled() - * @see RemoveDateChangeEventListener() - */ + * Adds a data change event listener instance. @n + * The added listener is called when the date of the %DatePicker is changed either through user manipulation or by calling one of its setters. + * + * @since 2.0 + * + * @param[in] listener The listener to be added + * @see IDateChangeEventListener::OnDateChanged() + * @see IDateChangeEventListener::OnDateChangeCanceled() + * @see RemoveDateChangeEventListener() + */ void AddDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); /** - * Removes a date changed event listener instance. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to be removed - * @see IDateChangeEventListener::OnDateChanged() - * @see IDateChangeEventListener::OnDateChangeCanceled() - * @see AddDateChangeEventListener() - */ + * Removes a date changed event listener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to be removed + * @see IDateChangeEventListener::OnDateChanged() + * @see IDateChangeEventListener::OnDateChangeCanceled() + * @see AddDateChangeEventListener() + */ void RemoveDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); /** - * Initializes this instance of %DatePicker with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] title The title - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ + * Initializes this instance of %DatePicker with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] title The title + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ result Construct(const Tizen::Base::String& title = L""); /** - * Gets the current date value of the %DatePicker control. - * - * @since 2.0 - * - * @return A %DateTime instance - */ + * Gets the current date value of the %DatePicker control. + * + * @since 2.0 + * + * @return A %DateTime instance + */ Tizen::Base::DateTime GetDate(void) const; /** - * Gets the current day value of the %DatePicker control. @n - * The day value is between @c 1 to @c 31. - * - * @since 2.0 - * - * @return The current day value, @n - * else @c -1 if an error occurs - */ + * Gets the current day value of the %DatePicker control. @n + * The day value is between @c 1 to @c 31. + * + * @since 2.0 + * + * @return The current day value, @n + * else @c -1 if an error occurs + */ int GetDay(void) const; /** - * Gets the current month value of the %DatePicker control. @n - * The month value is between @c 1 to @c 12. - * - * @since 2.0 - * - * @return The current month value, @n - * else @c -1 if an error occurs - */ + * Gets the current month value of the %DatePicker control. @n + * The month value is between @c 1 to @c 12. + * + * @since 2.0 + * + * @return The current month value, @n + * else @c -1 if an error occurs + */ int GetMonth(void) const; /** - * Gets the current year value of the %DatePicker control. - * The year value is between @c 1 to @c 9999. - * - * @since 2.0 - * - * @return The current year value, @n - * else @c -1 if an error occurs - * - */ + * Gets the current year value of the %DatePicker control. + * The year value is between @c 1 to @c 9999. + * + * @since 2.0 + * + * @return The current year value, @n + * else @c -1 if an error occurs + * + */ int GetYear(void) const; /** - * Sets the date value of the %DatePicker control. - * - * @since 2.0 - * - * @param[in] date The date to be set - */ + * Sets the date value of the %DatePicker control. + * + * @since 2.0 + * + * @param[in] date The date to be set + */ void SetDate(const Tizen::Base::DateTime& date); /** - * Sets the date value of the %DatePicker control with the current date. - * - * @since 2.0 - */ + * Sets the date value of the %DatePicker control with the current date. + * + * @since 2.0 + */ void SetCurrentDate(void); /** - * Sets the year value. @n - * The year value should be between @c 1 and @c 9999. - * - * @since 2.0 - * - * @return An error code - * @param[in] year The year value - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified year value is invalid. - */ + * Sets the year value. @n + * The year value should be between @c 1 and @c 9999. + * + * @since 2.0 + * + * @return An error code + * @param[in] year The year value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified year value is invalid. + */ result SetYear(int year); /** - * Sets the month value. @n - * The month value should be between @c 1 and @c 12. - * - * @since 2.0 - * - * @return An error code - * @param[in] month The month value - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified month value is invalid. - */ + * Sets the month value. @n + * The month value should be between @c 1 and @c 12. + * + * @since 2.0 + * + * @return An error code + * @param[in] month The month value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified month value is invalid. + */ result SetMonth(int month); /** - * Sets the day value. @n - * The day value should be between @c 1 and @c 31. - * - * @since 2.0 - * - * @return An error code - * @param[in] day The day value - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c day is invalid. - */ + * Sets the day value. @n + * The day value should be between @c 1 and @c 31. + * + * @since 2.0 + * + * @return An error code + * @param[in] day The day value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c day is invalid. + */ result SetDay(int day); /** - * Sets the valid year range. - * The range should be set in between @c 1 and @c 9999. - * - * @since 2.0 - * - * @return An error code - * @param[in] minYear The minimum year for the valid range - * @param[in] maxYear The maximum year for the valid range - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The given year range is invalid. - * @exception E_SYSTEM A system error has occurred. - */ + * Sets the valid year range. + * The range should be set in between @c 1 and @c 9999. + * + * @since 2.0 + * + * @return An error code + * @param[in] minYear The minimum year for the valid range + * @param[in] maxYear The maximum year for the valid range + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given year range is invalid. + * @exception E_SYSTEM A system error has occurred. + */ result SetYearRange(int minYear, int maxYear); /** - * Gets the valid year range. - * - * @since 2.0 - * - * @return An error code - * @param[out] minYear The minimum year for the valid range - * @param[out] maxYear The maximum year for the valid range - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ + * Gets the valid year range. + * + * @since 2.0 + * + * @return An error code + * @param[out] minYear The minimum year for the valid range + * @param[out] maxYear The maximum year for the valid range + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ result GetYearRange(int& minYear, int& maxYear) const; protected: diff --git a/inc/FUiCtrlDateTimePicker.h b/inc/FUiCtrlDateTimePicker.h old mode 100644 new mode 100755 index 543246e..867abca --- a/inc/FUiCtrlDateTimePicker.h +++ b/inc/FUiCtrlDateTimePicker.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlDateTimePicker.h - * @brief This is the header file for the %DateTimePicker class. - * - * This header file contains the declarations of the %DateTimePicker class. - */ +* @file FUiCtrlDateTimePicker.h +* @brief This is the header file for the %DateTimePicker class. +* +* This header file contains the declarations of the %DateTimePicker class. +*/ #ifndef _FUI_CTRL_DATE_TIME_PICKER_H_ #define _FUI_CTRL_DATE_TIME_PICKER_H_ @@ -31,18 +31,18 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class DateTimePicker - * @brief This class displays a full screen %DateTimePicker on top of the screen. - * - * @since 2.0 - * - * The %DateTimePicker class displays a full screen window-based selector that allows the user to select a certain date and time. - * - * For more information on the class features, see DatePicker, TimePicker, and DateTimePicker. - * - * The following example demonstrates how to use the %DateTimePicker class. - * - * @code +* @class DateTimePicker +* @brief This class displays a full screen %DateTimePicker on top of the screen. +* +* @since 2.0 +* +* The %DateTimePicker class displays a full screen window-based selector that allows the user to select a certain date and time. +* +* For more information on the class features, see DatePicker, TimePicker, and DateTimePicker. +* +* The following example demonstrates how to use the %DateTimePicker class. +* +* @code // Sample code for DateTimePickerSample.h #include @@ -141,7 +141,7 @@ DateTimePickerSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the date time picker - delete __pDateTimePicker; + __pDateTimePicker->Destroy(); return r; } @@ -174,8 +174,8 @@ DateTimePickerSample::OnDateTimeChangeCanceled(const Control& source) { // .... } - * @endcode - */ +* @endcode +**/ class _OSP_EXPORT_ DateTimePicker : public Tizen::Ui::Window diff --git a/inc/FUiCtrlEditArea.h b/inc/FUiCtrlEditArea.h old mode 100644 new mode 100755 index b424610..39d47e7 --- a/inc/FUiCtrlEditArea.h +++ b/inc/FUiCtrlEditArea.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -176,6 +177,28 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000); + /** + * Initializes this instance of the %EditArea control with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the control. + * @param[in] inputStyle Determines whether the fullscreen keypad or overlay keypad is displayed + * @param[in] limitLength The maximum limit of the length of the text that can be displayed by %EditArea + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid.@n + * The specified @c limitLength is less than or equal to @c 0. @n + * The @c rect.width or the @c rect.height is less than 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks Some methods of the control will only work as expected when it becomes 'displayable'. + * For more information, see Control::IsDisplayable() @n + * The orientation of the full-screen style keypad is determined by the current device orientation. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000); + public: /** * Gets the horizontal text alignment. @@ -306,6 +329,19 @@ public: int GetLineSpacing(void) const; /** + * Gets the line spacing. + * + * @since 2.1 + * + * @return The line spacing, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult()() method. + * @see SetLineSpacing() + */ + float GetLineSpacingF(void) const; + + /** * Sets the line spacing. @n * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. * @@ -326,6 +362,26 @@ public: result SetLineSpacing(int multiplier, int extra); /** + * Sets the line spacing. @n + * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. + * + * @code + * The line spacing = (default line spacing) * multiplier + extra + * @endcode + * @since 2.1 + * + * @return An error code + * @param[in] multiplier The line spacing multiplier + * @param[in] extra The extra line spacing + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or @n + * the specified line spacing value cannot be supported. + * @exception E_SYSTEM A system error has occurred. + * @see GetLineSpacingF() + */ + result SetLineSpacing(int multiplier, float extra); + + /** * Gets the margin value of the specified margin type. * * @since 2.0 @@ -341,6 +397,21 @@ public: int GetMargin(EditMarginType marginType) const; /** + * Gets the margin value of the specified margin type. + * + * @since 2.1 + * + * @return The margin value, @n + * else @c -1 if an error occurs + * @param[in] marginType The margin type + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult()() method. + * @see SetMargin() + */ + float GetMarginF(EditMarginType marginType) const; + + /** * Sets the margin value for the specified margin type. * * @since 2.0 @@ -357,6 +428,22 @@ public: result SetMargin(EditMarginType marginType, int margin); /** + * Sets the margin value for the specified margin type. + * + * @since 2.1 + * + * @return An error code + * @param[in] marginType The margin type + * @param[in] margin The margin value to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified @c margin cannot be a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetMarginF() + */ + result SetMargin(EditMarginType marginType, float margin); + + /** * Enables or disables the keypad action. * * @since 2.0 @@ -437,27 +524,27 @@ public: result SetKeypadStyle(KeypadStyle keypadStyle); /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @see SetTextPredictionEnabled() - */ + * Checks whether the text prediction is enabled. + * + * @since 2.0 + * @return @c true if the text prediction is enabled, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @see SetTextPredictionEnabled() + */ bool IsTextPredictionEnabled(void) const; /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. - * @see IsTextPredictionEnabled() - */ + * Enables or disables the text prediction. + * + * @since 2.0 + * @param[in] enable Set to @c true to enable the text prediction, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is not supported. + * @see IsTextPredictionEnabled() + */ result SetTextPredictionEnabled(bool enable); /** @@ -519,6 +606,20 @@ public: int GetTextSize(void) const; /** + * Gets the text size. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + + /** * Sets the text size. * * @since 2.0 @@ -534,6 +635,21 @@ public: result SetTextSize(int size); /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c size cannot be a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSizeF() + */ + result SetTextSize(float size); + + /** * Gets the color of %EditArea for the specified status. * * @since 2.0 @@ -1155,7 +1271,7 @@ public: /** * Checks whether a portion of the text is blocked. * - * @since 2.0 + * @since 2.0 * * @return @c true if the text is blocked, @n * else @c false @@ -1287,6 +1403,27 @@ public: */ result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; + /** + * Sets the text filter. + * + * @since 2.1 + * + * @param[in] pFilter The filter + * @remarks The %EditArea control checks with the registered filter to decide whether the user-entered text should be replaced. + */ + void SetEditTextFilter(IEditTextFilter* pFilter); + + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); + protected: friend class _EditAreaImpl; diff --git a/inc/FUiCtrlEditDate.h b/inc/FUiCtrlEditDate.h index 827aede..0f725ba 100644 --- a/inc/FUiCtrlEditDate.h +++ b/inc/FUiCtrlEditDate.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlEditDate.h - * @brief This is the header file for the %EditDate class. - * - * This header file contains the declarations of the %EditDate class. - */ +* @file FUiCtrlEditDate.h +* @brief This is the header file for the %EditDate class. +* +* This header file contains the declarations of the %EditDate class. +*/ #ifndef _FUI_CTRL_EDITDATE_H_ #define _FUI_CTRL_EDITDATE_H_ @@ -32,18 +32,18 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class EditDate - * @brief This class defines the common behavior of an %EditDate control. - * - * @since 2.0 - * - * The %EditDate class displays a small, fixed-size selector that allows the user to select a date. Unlike the DatePicker, %EditDate can be placed in a container. - * - * For more information on the class features, see EditDate and EditTime. - * - * The following example demonstrates how to use the %EditDate class. - * - * @code +* @class EditDate +* @brief This class defines the common behavior of an %EditDate control. +* +* @since 2.0 +* +* The %EditDate class displays a small, fixed-size selector that allows the user to select a date. Unlike the DatePicker, %EditDate can be placed in a container. +* +* For more information on the class features, see EditDate and EditTime. +* +* The following example demonstrates how to use the %EditDate class. +* +* @code // Sample code for EditDateSample.h #include @@ -112,210 +112,227 @@ EditDateSample::OnDateChangeCanceled(const Tizen::Ui::Control& source) { // .... } - * @endcode - */ +* @endcode +**/ class _OSP_EXPORT_ EditDate : public Tizen::Ui::Control { public: /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ EditDate(void); /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~EditDate(void); /** - * Adds a data change event listener instance. - * Added listener is called when the date of the DatePicker is changed either through user manipulation or by calling one of its setters. - * - * @since 2.0 - * - * @param[in] listener The listener to be added - * @see IDateChangeEventListener::OnDateChanged() - * @see IDateChangeEventListener::OnDateChangeCanceled() - * @see RemoveDateChangeEventListener() - */ + * Adds a data change event listener instance. + * Added listener is called when the date of the DatePicker is changed either through user manipulation or by calling one of its setters. + * + * @since 2.0 + * + * @param[in] listener The listener to be added + * @see IDateChangeEventListener::OnDateChanged() + * @see IDateChangeEventListener::OnDateChangeCanceled() + * @see RemoveDateChangeEventListener() + */ void AddDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); /** - * Removes a date changed event listener instance. @n - * Removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to be removed - * @see IDateChangeEventListener::OnDateChanged() - * @see IDateChangeEventListener::OnDateChangeCanceled() - * @see AddDateChangeEventListener() - */ + * Removes a date changed event listener instance. @n + * Removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to be removed + * @see IDateChangeEventListener::OnDateChanged() + * @see IDateChangeEventListener::OnDateChangeCanceled() + * @see AddDateChangeEventListener() + */ void RemoveDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); /** - * Initializes this instance of %EditDate with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] point The position of the %EditDate in the container - * @param[in] title The title - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks A control is fully usable only after it has been added to a container, therefore, some methods may fail if used earlier. - */ + * Initializes this instance of %EditDate with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] point The position of the %EditDate in the container + * @param[in] title The title + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore, some methods may fail if used earlier. + */ result Construct(const Tizen::Graphics::Point& point, const Tizen::Base::String& title = L""); + /* + * Initializes this instance of %EditDate with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The position of the %EditDate in the container + * @param[in] title The title + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore, some methods may fail if used earlier. + */ + result Construct(const Tizen::Graphics::FloatPoint& point, const Tizen::Base::String& title = L""); + /** - * Gets the current date value of the %EditDate control. - * - * @since 2.0 - * - * @return The date value - */ + * Gets the current date value of the %EditDate control. + * + * @since 2.0 + * + * @return The date value + */ Tizen::Base::DateTime GetDate(void) const; /** - * Gets the current day value of the %EditDate control. - * - * @since 2.0 - * - * @return The current day value as an integer, @n - * else @c -1 if the %EditDate instance is not constructed - */ + * Gets the current day value of the %EditDate control. + * + * @since 2.0 + * + * @return The current day value + * + * @remarks The default day value is the current system day. + */ int GetDay(void) const; /** - * Gets the current month value of the %EditDate control. - * - * @since 2.0 - * - * @return The current month value as an integer, @n - * else @c -1 if the %EditDate instance is not constructed - */ + * Gets the current month value of the %EditDate control. + * + * @since 2.0 + * + * @return The current month value as an integer + * + * @remarks The default month value is the current system month. + */ int GetMonth(void) const; /** - * Gets the current year value of the %EditDate control. - * - * @since 2.0 - * - * @return The current year value, @n - * else @c -1 if the %EditDate instance is not constructed - */ + * Gets the current year value of the %EditDate control. + * + * @since 2.0 + * + * @return The current year value + * + * @remarks The default year value is the current system year. + */ int GetYear(void) const; /** - * Sets the designated time value of the %EditDate control. - * - * @since 2.0 - * - * @param[in] date The date to be set - */ + * Sets the designated time value of the %EditDate control. + * + * @since 2.0 + * + * @param[in] date The date to be set + */ void SetDate(const Tizen::Base::DateTime& date); /** - * Sets the value of the %EditDate control using the current system date. - * - * @since 2.0 - */ + * Sets the value of the %EditDate control using the current system date. + * + * @since 2.0 + */ void SetCurrentDate(void); /** - * Sets the year value. - * The year value should be between @c 1 and @c 9999. - * - * @since 2.0 - * - * @return An error code - * @param[in] year The year to be set - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The given year value is invalid. - * @exception E_SYSTEM A system error has occurred. - */ + * Sets the year value. + * The year value should be between @c 1 and @c 9999. + * + * @since 2.0 + * + * @return An error code + * @param[in] year The year to be set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given year value is invalid. + * @exception E_SYSTEM A system error has occurred. + */ result SetYear(int year); /** - * Sets the month value of the %EditDate control. - * The month value should be between @c 1 and @c 12. - * - * @since 2.0 - * - * @return An error code - * @param[in] month The month to be set - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The given month value is invalid. - * @exception E_SYSTEM A system error has occurred. - * - */ + * Sets the month value of the %EditDate control. + * The month value should be between @c 1 and @c 12. + * + * @since 2.0 + * + * @return An error code + * @param[in] month The month to be set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given month value is invalid. + * @exception E_SYSTEM A system error has occurred. + * + */ result SetMonth(int month); /** - * Sets the day value of the %EditDate control. - * The day value should be between @c 1 and @c 31. - * - * @since 2.0 - * - * @return An error code - * @param[in] day The day to be set - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The given day value is invalid. - * @exception E_SYSTEM A system error has occurred. - */ + * Sets the day value of the %EditDate control. + * The day value should be between @c 1 and @c 31. + * + * @since 2.0 + * + * @return An error code + * @param[in] day The day to be set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given day value is invalid. + * @exception E_SYSTEM A system error has occurred. + */ result SetDay(int day); /** - * Enables the %DatePicker control. - * - * @since 2.0 - * - * @param[in] enable Set to @c true to enable the DatePicker control, @n - * else @c false - */ + * Enables the %DatePicker control. + * + * @since 2.0 + * + * @param[in] enable Set to @c true to enable the DatePicker control, @n + * else @c false + */ void SetDatePickerEnabled(bool enable); /** - * Checks whether the DatePicker control is enabled. - * - * @since 2.0 - * - * @return @c true if the DatePicker control is enabled, @n - * else @c false - */ + * Checks whether the DatePicker control is enabled. + * + * @since 2.0 + * + * @return @c true if the DatePicker control is enabled, @n + * else @c false + */ bool IsDatePickerEnabled(void) const; /** - * Sets the valid year range. @n - * The range should be set in between @c 1 and @c 9999. - * - * @since 2.0 - * - * @return An error code - * @param[in] minYear The minimum year for the valid range - * @param[in] maxYear The maximum year for the valid range - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The given year range is invalid. - * @exception E_SYSTEM A system error has occurred. - */ + * Sets the valid year range. @n + * The range should be set in between @c 1 and @c 9999. + * + * @since 2.0 + * + * @return An error code + * @param[in] minYear The minimum year for the valid range + * @param[in] maxYear The maximum year for the valid range + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given year range is invalid. + * @exception E_SYSTEM A system error has occurred. + */ result SetYearRange(int minYear, int maxYear); /** - * Gets the valid year range. - * - * @since 2.0 - * - * @return An error code - * @param[out] minYear The minimum year for the valid range - * @param[out] maxYear The maximum year for the valid range - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ + * Gets the valid year range. + * + * @since 2.0 + * + * @return An error code + * @param[out] minYear The minimum year for the valid range + * @param[out] maxYear The maximum year for the valid range + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ result GetYearRange(int& minYear, int& maxYear) const; private: diff --git a/inc/FUiCtrlEditField.h b/inc/FUiCtrlEditField.h old mode 100644 new mode 100755 index 4eb2d6b..719247e --- a/inc/FUiCtrlEditField.h +++ b/inc/FUiCtrlEditField.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -149,10 +149,10 @@ public: EditField(void); /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~EditField(void); /** @@ -186,6 +186,36 @@ public: result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); /** + * Initializes this instance of the %EditField control with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the control. + * @param[in] style The style of the %EditField control + * @param[in] inputStyle The input style of the %EditField control + * @param[in] showTitle Set to @c true to display the title, @n + * else @c false + * @param[in] limitLength The limit for the length of the text in the %EditField control + * @param[in] groupStyle The table view style of the %EditField control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c limitLength is less than or equal to @c 0, or @n + * either the @c rect.width or the @c rect.height is less than @c 0. + * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n + * The title is not supported by small style %EditField. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control has been used + * earlier. The %EditField style of SMALL property cannot be used together with group styles. @n + * If the specified size is less than the minimum size, %EditField is constructed with the minimum size. + * @remarks Following are the input styles used for creating the different orientations of a keypad: @n + * - INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value. @n + * - INPUT_STYLE_OVERLAY: The orientation is the same as that of a parent form. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, bool showTitle = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); + + /** * Initializes this instance of the %EditField control. * * @since 2.0 @@ -215,6 +245,36 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); + /** + * Initializes this instance of the %EditField control. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The bounds of %EditField + * @param[in] style The style of the %EditField control + * @param[in] inputStyle The input style of the %EditField control + * @param[in] titleStyle The title style + * @param[in] enableClear Set to @c true to enable the clear button, @n + * else @c false + * @param[in] limitLength The limit of the length of text in the %EditField control + * @param[in] groupStyle The table view style of the %EditField control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified @c limitLength is less than or equal to @c 0. @n + * The specified @c rect.width or the @c rect.height is less than @c 0. + * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n + * Title is not supported in small style %EditField. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if the control is used earlier. + * The %EditField style of SMALL property cannot be used together with group styles. @n + * If the specified size is less than the minimum size, EditFied() is constructed with the minimum size. + * @remarks Following are the input styles used for creating different orientations of a keypad: @n + * - INPUT_STYLE_FULLSCREEN: The orientation is decided by the G-sensor value.@n + * - INPUT_STYLE_OVERLAY: The orientation is similar to the parent Form. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); + public: /** * Gets the horizontal text alignment of the %EditField control. @@ -347,6 +407,21 @@ public: int GetMargin(EditMarginType marginType) const; /** + * Gets the margin value of the specified margin type. + * + * @since 2.1 + * + * @return The margin value of the specified margin type, @n + * else @c -1 if an error occurs + * @param[in] marginType The margin type + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetMargin() + */ + float GetMarginF(EditMarginType marginType) const; + + /** * Sets the margin for the specified margin type. * * @since 2.0 @@ -363,6 +438,22 @@ public: result SetMargin(EditMarginType marginType, int margin); /** + * Sets the margin for the specified margin type. + * + * @since 2.1 + * + * @return An error code + * @param[in] marginType The margin type + * @param[in] margin The margin to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified @c margin cannot be a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetMarginF() + */ + result SetMargin(EditMarginType marginType, float margin); + + /** * Enables or disables the keypad action. * * @since 2.0 @@ -500,6 +591,20 @@ public: int GetTextSize(void) const; /** + * Gets the text size. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + + /** * Sets the text size. * * @since 2.0 @@ -515,6 +620,21 @@ public: result SetTextSize(int size); /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The @c size cannot be a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSizeF() + */ + result SetTextSize(float size); + + /** * Gets the color of the %EditField control for the specified status. * * @since 2.0 @@ -658,13 +778,13 @@ public: void AddTextEventListener(Tizen::Ui::ITextEventListener& listener); /** - * Removes the ITextEventListener instance. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to be removed - */ + * Removes the ITextEventListener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to be removed + */ void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener); /** @@ -681,13 +801,13 @@ public: void AddScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener); /** - * Removes the specified scroll panel event listener instance. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to be removed - */ + * Removes the specified scroll panel event listener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to be removed + */ void RemoveScrollPanelEventListener(Tizen::Ui::IScrollPanelEventListener& listener); /** @@ -736,7 +856,7 @@ public: /** * Gets the remaining length of the %EditField control. * - * @since 2.0 + * @since 2.0 * * @return The remaining length of the %EditField control, @n * else @c -1 if an error occurs @@ -756,7 +876,7 @@ public: /** * Checks whether the lowercase mode is enabled. * - * @since 2.0 + * @since 2.0 * * @return @c true if the lowercase mode is enabled, @n * else @c false @@ -1063,26 +1183,26 @@ public: bool IsKeypadEnabled(void) const; /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @see SetTextPredictionEnabled() - */ + * Checks whether the text prediction is enabled. + * + * @since 2.0 + * @return @c true if the text prediction is enabled, @n + * else @c false + * @see SetTextPredictionEnabled() + */ bool IsTextPredictionEnabled(void) const; /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. - * @see IsTextPredictionEnabled() - */ + * Enables or disables the text prediction. + * + * @since 2.0 + * @param[in] enable Set to @c true to enable the text prediction, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is not supported. + * @see IsTextPredictionEnabled() + */ result SetTextPredictionEnabled(bool enable); /** @@ -1268,30 +1388,51 @@ public: int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const; /** - * Sets the input language. - * - * @since 2.0 - * - * @return An error code - * @param[in] languageCode The language to be set - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks The application can set the language of the current keypad that is associated with the current %EditField. @n - * This method only works if the language to set is supported by the current preloaded keypad. - */ + * Sets the input language. + * + * @since 2.0 + * + * @return An error code + * @param[in] languageCode The language to be set + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The application can set the language of the current keypad that is associated with the current %EditField. @n + * This method only works if the language to set is supported by the current preloaded keypad. + */ result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode); /** - * Gets the current input language. + * Gets the current input language. + * + * @since 2.0 + * + * @return An error code + * @param[out] language The current input language + * @exception E_SUCCESS The method is successful. + * @remarks The application can get the current language of the keypad that is associated with the current %EditField. + */ + result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; + + /** + * Sets the text filter. * - * @since 2.0 + * @since 2.1 * - * @return An error code - * @param[out] language The current input language - * @exception E_SUCCESS The method is successful. - * @remarks The application can get the current language of the keypad that is associated with the current %EditField. + * @param[in] pFilter The filter + * @remarks The %EditField control checks with the registered filter to decide whether the user-entered text should be replaced. */ - result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; + void SetEditTextFilter(IEditTextFilter* pFilter); + + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); protected: friend class _EditFieldImpl; diff --git a/inc/FUiCtrlEditTime.h b/inc/FUiCtrlEditTime.h index 178efa6..ea67098 100644 --- a/inc/FUiCtrlEditTime.h +++ b/inc/FUiCtrlEditTime.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlEditTime.h - * @brief This is the header file for the %EditTime class. - * - * This header file contains the declarations of the %EditTime class. - */ +* @file FUiCtrlEditTime.h +* @brief This is the header file for the %EditTime class. +* +* This header file contains the declarations of the %EditTime class. +*/ #ifndef _FUI_CTRL_EDIT_TIME_H_ #define _FUI_CTRL_EDIT_TIME_H_ @@ -32,19 +32,19 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class EditTime - * @brief This class defines the common behavior of an %EditTime control. - * - * @since 2.0 - * - * The %EditTime class displays a small, fixed-size selector that allows the user to select a time. - * Unlike TimePicker, %EditTime can be placed in a container. - * - * For more information on the class features, see EditDate and EditTime. - * - * The following example demonstrates how to use the %EditTime class. - * - * @code +* @class EditTime +* @brief This class defines the common behavior of an %EditTime control. +* +* @since 2.0 +* +* The %EditTime class displays a small, fixed-size selector that allows the user to select a time. +* Unlike TimePicker, %EditTime can be placed in a container. +* +* For more information on the class features, see EditDate and EditTime. +* +* The following example demonstrates how to use the %EditTime class. +* +* @code // Sample code for EditTimeSample.h #include @@ -112,8 +112,8 @@ EditTimeSample::OnTimeChangeCanceled(const Control& source) { // .... } - * @endcode - */ +* @endcode +**/ class _OSP_EXPORT_ EditTime : public Tizen::Ui::Control { @@ -126,7 +126,7 @@ public: EditTime(void); /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. * * @since 2.0 */ @@ -162,20 +162,34 @@ public: * * @return An error code * @param[in] point The position of %EditTime in container - * @param[in] title The title + * @param[in] title The title * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. */ result Construct(const Tizen::Graphics::Point& point, const Tizen::Base::String& title = L""); + /* + * Initializes this instance of %EditTime with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] point The position of %EditTime in container + * @param[in] title The title + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatPoint& point, const Tizen::Base::String& title = L""); + /** * Gets the current hour value of the %EditTime control. * * @since 2.0 * - * @return The current hour value, @n - * else @c -1 if the %EditTime instance is not constructed @n + * @return The current hour value. @n * The hour value is between @c 0 to @c 23. + * + * @remarks The default hour value is the current system hour. */ int GetHour(void) const; @@ -184,8 +198,9 @@ public: * * @since 2.0 * - * @return The current minute value, @n - * else @c -1 if this %EditTime instance is not constructed + * @return The current minute value + * + * @remarks The default minute value is the current system minute. */ int GetMinute(void) const; diff --git a/inc/FUiCtrlEditTypes.h b/inc/FUiCtrlEditTypes.h old mode 100644 new mode 100755 diff --git a/inc/FUiCtrlExpandableEditArea.h b/inc/FUiCtrlExpandableEditArea.h index 4f2fd73..4bf31bd 100644 --- a/inc/FUiCtrlExpandableEditArea.h +++ b/inc/FUiCtrlExpandableEditArea.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -97,12 +98,12 @@ enum ExpandableEditAreaTokenStatus * @since 2.0 * * The %ExpandableEditArea class displays a multi-line text editor the height of that is automatically adjusted according to the number of lines currently visible in the text box. +* +* For more information on the class features, see ExpandableEditArea. * - * For more information on the class features, see ExpandableEditArea. - * - * The following sample code demonstrates how to use the %ExpandableEditArea class. - * - * @code +* The following sample code demonstrates how to use the %ExpandableEditArea class. +* +* @code // Sample code for ExpandableEditAreaSample.h #include @@ -206,8 +207,8 @@ ExpandableEditAreaSample::OnExpandableEditAreaLineRemoved(Tizen::Ui::Controls::E { // .... } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ ExpandableEditArea : public Tizen::Ui::Control { @@ -249,6 +250,29 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines = 10); + /* + * Initializes this instance of %ExpandableEditArea with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the expandable edit area along with + * the width and height. + * @param[in] style The style of the expandable edit area + * @param[in] titleStyle The title style + * @param[in] maxExpandableLines The maximum number of lines to which the control can be expanded. + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPTION The specified option is not supported. @n + * The token style %ExpandabledEditArea does not support EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP. + * @exception E_MAX_EXCEEDED The number of lines has exceeded the maximum limit. + * @exception E_INVALID_ARG A specified input parameter is invalid, or @n + * the specified @c maxLines is either negative or @c 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the line count is @c 1. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines = 10); + // TEXT MANAGEMENT /** * Appends the specified character at the end of the existing text. @@ -283,168 +307,168 @@ public: result AppendText(const Tizen::Base::String& text); /** - * Appends the text that will be displayed by bitmap at the end of the existing text. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text to be appended @n - * It will be displayed by the @c textImage - * @param[in] textImage The alternate bitmap to be displayed - * @exception E_SUCCESS The method is successful. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n - * To display the changes, the control must be drawn again. The text to be appended will be displayed by the @c textImage. - */ + * Appends the text that will be displayed by bitmap at the end of the existing text. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text to be appended @n + * It will be displayed by the @c textImage + * @param[in] textImage The alternate bitmap to be displayed + * @exception E_SUCCESS The method is successful. + * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n + * To display the changes, the control must be drawn again. The text to be appended will be displayed by the @c textImage. + */ result AppendText(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage); /** - * Deletes the character present at the current cursor position. - * - * @since 2.0 - * - * @return An error code - * @param[in] index The index - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid. @n - * The specified @c index is negative. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n - * Either the specified @c index is greater than the number of elements or less than @c 0. - * @exception E_SYSTEM A system error has occurred. - * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n - * To display the changes, the control must be drawn again. - */ + * Deletes the character present at the current cursor position. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c index is negative. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n + * Either the specified @c index is greater than the number of elements or less than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n + * To display the changes, the control must be drawn again. + */ result DeleteCharacterAt(int index); /** - * Inserts a character at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] index The position to insert the character - * @param[in] character The character to be inserted - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n - * Either the specified @c index is greater than the number of elements or less than @c 0. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations. - * @exception E_SYSTEM A system error has occurred. - * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n - * To display the changes, the control must be drawn again. - */ + * Inserts a character at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The position to insert the character + * @param[in] character The character to be inserted + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n + * Either the specified @c index is greater than the number of elements or less than @c 0. + * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations. + * @exception E_SYSTEM A system error has occurred. + * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. @n + * To display the changes, the control must be drawn again. + */ result InsertCharacterAt(int index, const Tizen::Base::Character& character); /** - * Inserts the text at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] index The position to insert the text - * @param[in] text The text to be inserted - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n - * Either the specified @c index is greater than the number of elements or less than @c 0. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations. - * @exception E_SYSTEM A system error has occurred. - */ + * Inserts the text at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The position to insert the text + * @param[in] text The text to be inserted + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n + * Either the specified @c index is greater than the number of elements or less than @c 0. + * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds system limitations. + * @exception E_SYSTEM A system error has occurred. + */ result InsertTextAt(int index, const Tizen::Base::String& text); /** - * Inserts the text that will be displayed by bitmap at the specified text position. - * - * @since 2.0 - * - * @return An error code - * @param[in] position The position to insert the text - * @param[in] text The text to be inserted @n - * It will be displayed by the @c textImage - * @param[in] textImage The alternate bitmap to be displayed - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c position is outside the valid range. @n - * Either the specified @c position is greater than the number of existing text in the % ExpanableEditArea or less than @c 0. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n - * To display the changes, the control must be drawn again. The text to be inserted will be displayed by the @c textImage. - */ + * Inserts the text that will be displayed by bitmap at the specified text position. + * + * @since 2.0 + * + * @return An error code + * @param[in] position The position to insert the text + * @param[in] text The text to be inserted @n + * It will be displayed by the @c textImage + * @param[in] textImage The alternate bitmap to be displayed + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c position is outside the valid range. @n + * Either the specified @c position is greater than the number of existing text in the % ExpanableEditArea or less than @c 0. + * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the maximum length of the text that can be displayed by % ExpanableEditArea. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @remarks The method modifies the text buffer that is managed by the %ExpanableEditArea control. @n + * To display the changes, the control must be drawn again. The text to be inserted will be displayed by the @c textImage. + */ result InsertTextAt(int position, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& textImage); /** - * Gets the portion of the text that is displayed by the %ExpandableEditArea control. - * - * @since 2.0 - * - * @return The specified portion of the text, @n - * else an empty string if an error occurs - * @param[in] start The starting index of the range - * @param[in] end The last index of the range - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n - * The specified @c start or @c end is greater than the number of elements or less than @c 0. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see GetText() - * @see SetText() - */ + * Gets the portion of the text that is displayed by the %ExpandableEditArea control. + * + * @since 2.0 + * + * @return The specified portion of the text, @n + * else an empty string if an error occurs + * @param[in] start The starting index of the range + * @param[in] end The last index of the range + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n + * The specified @c start or @c end is greater than the number of elements or less than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see GetText() + * @see SetText() + */ Tizen::Base::String GetText(int start, int end) const; /** - * Gets the text of the %ExpandableEditArea control. - * - * @since 2.0 - * - * @return The text of the %ExpandableEditArea control, @n - * else an empty string if an error occurs - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Gets the text of the %ExpandableEditArea control. + * + * @since 2.0 + * + * @return The text of the %ExpandableEditArea control, @n + * else an empty string if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ Tizen::Base::String GetText(void) const; /** - * Gets the text length. - * - * @since 2.0 - * - * @return The length of the text, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Gets the text length. + * + * @since 2.0 + * + * @return The length of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ int GetTextLength(void) const; /** - * Sets the text to be displayed by the %ExpandableEditArea control. - * - * @since 2.0 - * - * @param[in] text The text to be set - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid, @n - * or the length of the specified @c text exceeds system limitations. - * @exception E_SYSTEM A system error has occurred. - * @remarks To denote the end of a line use '\\n'. - * The method modifies the text buffer that is managed by the %ExpandableEditArea control. - * To display the changes, the control must be drawn again. - */ + * Sets the text to be displayed by the %ExpandableEditArea control. + * + * @since 2.0 + * + * @param[in] text The text to be set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, @n + * or the length of the specified @c text exceeds system limitations. + * @exception E_SYSTEM A system error has occurred. + * @remarks To denote the end of a line use '\\n'. + * The method modifies the text buffer that is managed by the %ExpandableEditArea control. + * To display the changes, the control must be drawn again. + */ result SetText(const Tizen::Base::String& text); /** - * Clears the text that is displayed by the %ExpandableEditArea control. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. - * To display the changes, the control must be drawn again. - */ + * Clears the text that is displayed by the %ExpandableEditArea control. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The method modifies the text buffer that is managed by the %ExpandableEditArea control. + * To display the changes, the control must be drawn again. + */ result Clear(void); /** @@ -488,16 +512,16 @@ public: Tizen::Base::String GetGuideText(void) const; /** - * Sets the guide text to be displayed, when there is no data in the search field. - * - * @since 2.0 - * - * @return An error code - * @param[in] guideText The guide text - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see GetGuideText() - */ + * Sets the guide text to be displayed, when there is no data in the search field. + * + * @since 2.0 + * + * @return An error code + * @param[in] guideText The guide text + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @see GetGuideText() + */ result SetGuideText(const Tizen::Base::String& guideText); // LINE MANAGEMENT @@ -522,7 +546,18 @@ public: * else @c -1 if an error occurs * @see SetLineSpacing () */ - int GetLineSpacing (void) const; + int GetLineSpacing(void) const; + + /* + * Gets the line spacing. + * + * @since 2.1 + * @return The line spacing, @n + * else @c -1.0f if an error occurs + * @see SetLineSpacing () + */ + + float GetLineSpacingF(void) const; /** * Sets the line spacing. @n @@ -540,18 +575,36 @@ public: * @exception E_INVALID_ARG This exception is returned when @c multiplier or @c extra is less than 0. * @see GetLineSpacing () */ - result SetLineSpacing (int multiplier, int extra); + result SetLineSpacing(int multiplier, int extra); - /** - * Gets the current line count. + /* + * Sets the line spacing. @n + * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. * - * @since 2.0 + * @code + * The line spacing = (default line spacing) * multiplier + extra + * @endcode * - * @return The line count of the text + * @since 2.1 + * @return An error code + * @param[in] multiplier The line spacing multiplier + * @param[in] extra The extra line spacing * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. + * @exception E_INVALID_ARG This exception is returned when @c multiplier or @c extra is less than 0. + * @see GetLineSpacing () */ + result SetLineSpacing(int multiplier, float extra); + + /** + * Gets the current line count. + * + * @since 2.0 + * + * @return The line count of the text + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ int GetTextLineCount(void) const; // TEXT SIZE @@ -570,20 +623,49 @@ public: int GetTextSize(void) const; /** - * Sets the text size. + * Gets the text size. * - * @since 2.0 + * @since 2.1 * - * @return An error code - * @param[in] size The text size + * @return The size of the text, @n + * else @c -1 if an error occurs * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c size is invalid, @n - * or the specified @c size is a negative integer. * @exception E_SYSTEM A system error has occurred. - * @see GetTextSize() + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() */ + float GetTextSizeF(void) const; + + /** + * Sets the text size. + * + * @since 2.0 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c size is invalid, @n + * or the specified @c size is a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSize() + */ result SetTextSize(int size); + /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c size is invalid, @n + * or the specified @c size is a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSizeF() + */ + result SetTextSize(float size); + // MARGINS /** * Gets the margin of the specified margin type. @@ -600,6 +682,21 @@ public: */ int GetMargin(EditMarginType marginType) const; + /* + * Gets the margin of the specified margin type. + * + * @since 2.1 + * + * @return The margin value of the specified margin type, @n + * else @c -1.0f if an error occurs + * @param[in] marginType The margin type + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetMargin() + */ + float GetMarginF(EditMarginType marginType) const; + /** * Sets the margin for the specified margin type. * @@ -630,13 +727,46 @@ public: * * @section CompSetMarginPageSolutionSection Resolutions * This issue has been resolved in Tizen. @n + * @endif + */ + + /* + * Sets the margin for the specified margin type. + * + * @if OSPCOMPAT + * @brief [Compatibility] + * @endif + * @since 2.1 + * @if OSPCOMPAT + * @compatibility This method has compatibility issues with OSP compatible applications. @n + * For more information, see @ref CompSetMarginPage "here". + * @endif + * @return An error code + * @param[in] marginType The margin type + * @param[in] margin The margin to be set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified @c margin cannot be negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetMargin() + */ + result SetMargin(EditMarginType marginType, float margin); + /* + * @if OSPCOMPAT + * @page CompSetMarginPage Compatibility for SetMargin() + * @section CompSetMarginPageIssueSection Issues + * Implementing this method in OSP compatible applications has the following issues: @n + * -# The SetMargin() method sets the margin value for ExpandableEditArea with only EXPANDABLE_EDIT_AREA_STYLE_NORMAL in API version 2.0. @n + * + * @section CompSetMarginPageSolutionSection Resolutions + * This issue has been resolved in Tizen. @n * @endif */ // LOWER CASE /** * Enables or disables the lowercase mode. - * + * @since 2.0 * * @return An error code @@ -708,46 +838,46 @@ public: result GetBlockRange(int& start, int& end) const; /** - * Releases the selection of the current text block. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see GetBlockRange() - * @see SetBlockRange() - */ + * Releases the selection of the current text block. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @see GetBlockRange() + * @see SetBlockRange() + */ result ReleaseBlock(void); /** - * Removes the text content of the current text block. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified instance is not found, @n - * or the text block is not selected. - * @exception E_SYSTEM A system error has occurred. - */ + * Removes the text content of the current text block. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified instance is not found, @n + * or the text block is not selected. + * @exception E_SYSTEM A system error has occurred. + */ result RemoveTextBlock(void); /** - * Sets the block range for the text. - * - * @since 2.0 - * - * @return An error code - * @param[in] start The start index of the text block - * @param[in] end The end index of the text block - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n - * Either the index is greater than the number of elements or less than @c 0. - * @exception E_SYSTEM A system error has occurred. - * @see ReleaseBlock() - * @see GetBlockRange() - */ + * Sets the block range for the text. + * + * @since 2.0 + * + * @return An error code + * @param[in] start The start index of the text block + * @param[in] end The end index of the text block + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n + * Either the index is greater than the number of elements or less than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @see ReleaseBlock() + * @see GetBlockRange() + */ result SetBlockRange(int start, int end); // KEYPAD MANAGEMENT @@ -765,42 +895,42 @@ public: Tizen::Ui::KeypadAction GetKeypadAction(void) const; /** - * Gets the keypad style. - * - * @since 2.0 - * - * @return The keypad style - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetKeypadStyle() - */ + * Gets the keypad style. + * + * @since 2.0 + * + * @return The keypad style + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetKeypadStyle() + */ KeypadStyle GetKeypadStyle(void) const; /** - * Hides the keypad associated with the %ExpandableEditArea control. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see ShowKeypad() - */ + * Hides the keypad associated with the %ExpandableEditArea control. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @see ShowKeypad() + */ result HideKeypad(void); /** - * Checks whether the keypad is enabled. - * - * @since 2.0 - * - * @return @c true if the keypad is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetKeypadEnabled() - */ + * Checks whether the keypad is enabled. + * + * @since 2.0 + * + * @return @c true if the keypad is enabled, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetKeypadEnabled() + */ bool IsKeypadEnabled(void) const; /** @@ -818,68 +948,68 @@ public: result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction); /** - * Sets the keypad style. - * - * @since 2.0 - * - * @return An error code - * @param[in] keypadStyle The keypad style - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid. @n - * The specified @c keypadStyle is KEYPAD_STYLE_PASSWORD. - * @exception E_SYSTEM A system error has occurred. - * @remarks Depending on the value of the keypad style, the layout of the keypad will change accordingly. - * @see GetKeypadStyle() - */ + * Sets the keypad style. + * + * @since 2.0 + * + * @return An error code + * @param[in] keypadStyle The keypad style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c keypadStyle is KEYPAD_STYLE_PASSWORD. + * @exception E_SYSTEM A system error has occurred. + * @remarks Depending on the value of the keypad style, the layout of the keypad will change accordingly. + * @see GetKeypadStyle() + */ result SetKeypadStyle(KeypadStyle keypadStyle); /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @see SetTextPredictionEnabled() - */ + * Checks whether the text prediction is enabled. + * + * @since 2.0 + * @return @c true if the text prediction is enabled, @n + * else @c false + * @see SetTextPredictionEnabled() + */ bool IsTextPredictionEnabled(void) const; /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. - * @see IsTextPredictionEnabled() - */ + * Enables or disables the text prediction. + * + * @since 2.0 + * @param[in] enable Set to @c true to enable the text prediction, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is not supported. + * @see IsTextPredictionEnabled() + */ result SetTextPredictionEnabled(bool enable); /** - * Enables or disables the keypad. - * - * @since 2.0 - * - * @return An error code - * @param[in] enable Set to @c true to enable the virtual keypad, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see IsKeypadEnabled() - */ + * Enables or disables the keypad. + * + * @since 2.0 + * + * @return An error code + * @param[in] enable Set to @c true to enable the virtual keypad, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @see IsKeypadEnabled() + */ result SetKeypadEnabled(bool enable); /** - * Shows the keypad. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see HideKeypad() - */ + * Shows the keypad. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @see HideKeypad() + */ result ShowKeypad(void); // TOKEN FILTER @@ -899,34 +1029,34 @@ public: result SetTokenFilter(const ITokenFilter* pFilter); /** - * Gets the text token filter. - * - * @since 2.0 - * - * @return The filter, @n - * else @c null if an error occurs - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Gets the text token filter. + * + * @since 2.0 + * + * @return The filter, @n + * else @c null if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ ITokenFilter* GetTokenFilter(void) const; /** - * Appends the specified token. - * - * @since 2.0 - * - * @return An error code - * @param[in] token The token to be appended - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_INVALID_ARG The specified input parameter is invalid. @n - * The length of the specified @c token is @c 0. - * @exception E_SYSTEM A system error has occurred. - */ + * Appends the specified token. + * + * @since 2.0 + * + * @return An error code + * @param[in] token The token to be appended + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The length of the specified @c token is @c 0. + * @exception E_SYSTEM A system error has occurred. + */ result AppendToken(const Tizen::Base::String& token); /** @@ -995,68 +1125,68 @@ public: int GetSelectedTokenIndex(void) const; /** - * Checks whether the token editing mode is enabled. - * - * @since 2.0 - * - * @return @c true if the editing mode is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Checks whether the token editing mode is enabled. + * + * @since 2.0 + * + * @return @c true if the editing mode is enabled, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ bool IsTokenEditModeEnabled(void) const; /** - * Removes the token at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] index The index of the token to be removed - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n - * Either the index is greater than the number of elements or less than @c 0. - * @exception E_SYSTEM A system error has occurred. - */ + * Removes the token at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index of the token to be removed + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n + * Either the index is greater than the number of elements or less than @c 0. + * @exception E_SYSTEM A system error has occurred. + */ result RemoveTokenAt(int index); /** - * Sets the selected state of the specified token. - * - * @since 2.0 - * - * @return An error code - * @param[in] index The index of the token to select - * @param[in] selected Set to @c true to select the specified token, @n - * else @c false to unselect - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n - * Either the index is greater than the number of elements or less than @c 0. - * @exception E_SYSTEM A system error has occurred. - * @remarks The currently selected token gets unselected automatically. - */ + * Sets the selected state of the specified token. + * + * @since 2.0 + * + * @return An error code + * @param[in] index The index of the token to select + * @param[in] selected Set to @c true to select the specified token, @n + * else @c false to unselect + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n + * Either the index is greater than the number of elements or less than @c 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks The currently selected token gets unselected automatically. + */ result SetTokenSelected(int index, bool selected); /** - * Enables or disables the token edit mode. - * - * @since 2.0 - * - * @return An error code - * @param[in] enable Set to @c true to enable the token editing mode, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. - * @exception E_SYSTEM A system error has occurred. - */ + * Enables or disables the token edit mode. + * + * @since 2.0 + * + * @return An error code + * @param[in] enable Set to @c true to enable the token editing mode, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The operation is not supported if the style is not EXPANDABLE_EDIT_AREA_STYLE_TOKEN. + * @exception E_SYSTEM A system error has occurred. + */ result SetTokenEditModeEnabled(bool enable); // LIMIT LENGTH @@ -1359,29 +1489,29 @@ public: bool IsAutoResizingEnabled(void) const; /** - * Sets the input language. - * - * @since 2.0 - * - * @return An error code - * @param[in] languageCode The language to set - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks The application can set the language of the current keypad that is associated with the current %ExpandableEditArea. @n - * This method only works if the language to set is supported by the current preloaded keypad. - */ + * Sets the input language. + * + * @since 2.0 + * + * @return An error code + * @param[in] languageCode The language to set + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The application can set the language of the current keypad that is associated with the current %ExpandableEditArea. @n + * This method only works if the language to set is supported by the current preloaded keypad. + */ result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode); /** - * Gets the current input language. - * - * @since 2.0 - * - * @return An error code - * @param[out] language The current input language - * @exception E_SUCCESS The method is successful. - * @remarks The application can get the current language of the keypad that is associated with the current %ExpandableEditArea. - */ + * Gets the current input language. + * + * @since 2.0 + * + * @return An error code + * @param[out] language The current input language + * @exception E_SUCCESS The method is successful. + * @remarks The application can get the current language of the keypad that is associated with the current %ExpandableEditArea. + */ result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; // EVENT LISTENER MANAGEMENT @@ -1419,14 +1549,14 @@ public: void AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener); /** - * Adds the specified ITextEventListener instance. @n - * The added listener can listen to the text-changed event. - * - * @since 2.0 - * - * @param[in] listener The listener to be added - * @see RemoveTextEventListener() - */ + * Adds the specified ITextEventListener instance. @n + * The added listener can listen to the text-changed event. + * + * @since 2.0 + * + * @param[in] listener The listener to be added + * @see RemoveTextEventListener() + */ void AddTextEventListener(Tizen::Ui::ITextEventListener& listener); /** @@ -1474,27 +1604,27 @@ public: void RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener); /** - * Adds a listener instance for language events. @n - * The added listener is notified when the input language is changed. - * - * @since 2.0 - * - * @param[in] listener The listener to add - * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener. - * @see RemoveLanguageEventListener() - */ + * Adds a listener instance for language events. @n + * The added listener is notified when the input language is changed. + * + * @since 2.0 + * + * @param[in] listener The listener to add + * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener. + * @see RemoveLanguageEventListener() + */ void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); /** - * Removes the specified listener instance. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddLanguageEventListener() - */ + * Removes the specified listener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddLanguageEventListener() + */ void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); @@ -1522,6 +1652,26 @@ public: */ bool IsAutoShrinkModeEnabled(void) const; + /** + * Sets the text filter. + * + * @since 2.1 + * + * @param[in] pFilter The filter + * @remarks The %ExpandableEditArea control checks with the registered filter to decide whether the user-entered text should be replaced. + */ + void SetEditTextFilter(IEditTextFilter* pFilter); + + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); protected: friend class _ExpandableEditAreaImpl; diff --git a/inc/FUiCtrlExpandableList.h b/inc/FUiCtrlExpandableList.h index 5a08381..77a8e68 100644 --- a/inc/FUiCtrlExpandableList.h +++ b/inc/FUiCtrlExpandableList.h @@ -1069,7 +1069,7 @@ public: * @deprecated This class is deprecated. Instead of using this class, use GroupedTableView class. * @since 2.0 * - * @param[in] color The background color + * @param[in] color The background color * @endif */ void SetBackgroundColor(const Tizen::Graphics::Color& color); diff --git a/inc/FUiCtrlFooter.h b/inc/FUiCtrlFooter.h index b2eeea3..fb62ec2 100644 --- a/inc/FUiCtrlFooter.h +++ b/inc/FUiCtrlFooter.h @@ -68,9 +68,9 @@ enum FooterStyle * The %Footer class displays a multi-purpose area at the bottom of the screen. It is used to switch between different application * "views", or to host buttons for performing user-defined actions. * - * For more information on the class features, see Footer. + *For more information on the class features, see Footer. * - * The following examples demonstrate how to use the %Footer class. + *The following examples demonstrate how to use the %Footer class. * - Constructing a footer * When creating a %Form, specify the FORM_STYLE_FOOTER parameter in the Form::Construct() method. * @@ -351,8 +351,8 @@ public: * @return The selected item index,@n * else @c -1 if an error occurs * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is supported only when the style of the %Footer control is either segmented or tab. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Footer control is @c FOOTER_STYLE_BUTTON_TEXT, @n + * @c FOOTER_STYLE_BUTTON_ICON or @c FOOTER_STYLE_BUTTON_ICON_TEXT. * @remarks The specific error code can be accessed using the GetLastResult() method. */ int GetSelectedItemIndex(void) const; @@ -465,9 +465,7 @@ public: * The specified item is not constructed. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.@n * There are more than 2 footer items. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is supported when the style of the %Footer control is either - * @c FOOTER_STYLE_SEGMENTED_TEXT or @c FOOTER_STYLE_SEGMENTED_ICON. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Footer control is @c FOOTER_STYLE_TAB. * @exception E_SYSTEM A system error has occurred. * @remarks If there is an existing button item at the specified position, it is replaced with the new item.@n * However, the contents of the specified item are copied to the %Footer control. @@ -618,11 +616,7 @@ public: * @param[in] status The item status * @param[in] color The item color to be set * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The current style of the %Footer control does not support the operation. * @exception E_SYSTEM A system error has occurred. - * @remarks It is not possible to set the item colors for the normal and disabled status of the @c FOOTER_STYLE_TAB style %Footer control. @n - Furthermore, @c FOOTER_STYLE_BUTTON_ICON style %Footer control does not support this operation. * @see GetItemColor() */ result SetItemColor(FooterItemStatus status, const Tizen::Graphics::Color& color); @@ -658,8 +652,6 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n * The index is greater than or equal to the number of elements or less than @c 0. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Footer control is @c FOOTER_STYLE_BUTTON_ICON. * @exception E_SYSTEM A system error has occurred. */ result SetItemBadgeIcon(int itemIndex, const Tizen::Graphics::Bitmap* pBadgeIcon); @@ -677,8 +669,6 @@ public: * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999. * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n * The index is greater than or equal to the number of elements or less than @c 0. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Footer control is @c FOOTER_STYLE_BUTTON_ICON. * @exception E_SYSTEM A system error has occurred. * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number. */ @@ -711,8 +701,8 @@ public: * The specified index is either greater than or equal to the number of items or is less than zero. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n * The item at the specified index is disabled. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported if the %Footer control style is either @c FOOTER_STYLE_BUTTON_TEXT or @c FOOTER_STYLE_BUTTON_ICON. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported if the %Footer control style is @c FOOTER_STYLE_BUTTON_TEXT, @n + * @c FOOTER_STYLE_BUTTON_ICON or @c FOOTER_STYLE_BUTTON_ICON_TEXT. * @exception E_SYSTEM A system error has occurred. */ result SetItemSelected(int itemIndex); @@ -753,8 +743,7 @@ public: * @param[in] enable Set to @c true to enable the edit mode, @n * else @c false * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Footer control style is not @c FOOTER_STYLE_TAB. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Footer control style is @c FOOTER_STYLE_TAB. */ result SetTabEditModeEnabled(bool enable); @@ -783,9 +772,23 @@ public: /** + * Gets the position and size of the specified button item. + * + * @since 2.0 + * + * @return The position and size of the button item at the specified position. + * @param[in] position The position of the button item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * There is no button set at the specified position. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const; + + /** * Gets the position and size of the specified button item. * - * @since 2.0 + * @since 2.1 * * @return The position and size of the button item at the specified position. * @param[in] position The position of the button item @@ -794,7 +797,7 @@ public: * There is no button set at the specified position. * @remarks The specific error code can be accessed using the GetLastResult() method. */ - Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const; + Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const; protected: diff --git a/inc/FUiCtrlForm.h b/inc/FUiCtrlForm.h old mode 100644 new mode 100755 index 5c5ee9a..c4f8e12 --- a/inc/FUiCtrlForm.h +++ b/inc/FUiCtrlForm.h @@ -170,13 +170,13 @@ public: /** * Initializes this instance of %Form with the specified parameters. * - * @since 2.0 + * @since 2.0 * * @return An error code * @param[in] formStyle The form style @n * Multiple form styles can be combined using bitwise OR (see Tizen::Ui::Controls::FormStyle). * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid @if OSPCOMPAT @b Since: @b 2.0 @endif. @n + * @exception E_INVALID_ARG The specified input parameter is invalid. @n * - FORM_STYLE_HEADER and FORM_STYLE_TITLE are specified at the same time. @n * - FORM_STYLE_FOOTER and FORM_STYLE_SOFTKEY_0 are specified at the same time. @n * - FORM_STYLE_FOOTER and FORM_STYLE_SOFTKEY_1 are specified at the same time. @n @@ -364,6 +364,17 @@ public: */ Tizen::Graphics::Rectangle GetClientAreaBounds(void) const; + /* + * Gets the bounds of the client area. + * + * @since 2.0 + * + * @return The bounds of the client area + * @remarks The client area of the %Form control does not include the title, indicator, header and footer areas. + * header and footer areas. + * + */ + Tizen::Graphics::FloatRectangle GetClientAreaBoundsF(void) const; /** * Gets the style of the %Form control. @@ -579,7 +590,7 @@ public: * @param[in] formStyle The form style to set @n * This parameter can be a combination of Tizen::Ui::Controls::FormStyle. * @exception E_SUCCESS The method is successful @if OSPCOMPAT @b Since: @b 2.0 @endif. - * @exception E_INVALID_ARG A specified input parameter is invalid @if OSPCOMPAT @b Since: @b 2.0 @endif. @n + * @exception E_INVALID_ARG A specified input parameter is invalid. @n * - FORM_STYLE_HEADER and FORM_STYLE_TITLE are specified at the same time. @n * - FORM_STYLE_FOOTER and FORM_STYLE_SOFTKEY_0 are specified at the same time. @n * - FORM_STYLE_FOOTER and FORM_STYLE_SOFTKEY_1 are specified at the same time. @n @@ -902,6 +913,31 @@ public: */ OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::Rectangle& rect, OverlayRegionType regionType); + /* + * Creates and returns an overlay region of the specified position and size. @n + * Due to the hardware accelerated rendering, there are limitations for an overlay region. @n + * The hardware capability for an overlay region is checked by using OverlayRegion::GetWidthUnit(), OverlayRegion::GetHeightUnit() and + * OverlayRegion::GetMaxCount(). + * If the specified condition is not satisfied, E_INVALID_ARG exception is returned. + * + * @since 2.1 + * + * @return An overlay region instance + * @param[in] rect The x and y coordinates relative to the top-left corner of the form along with the width and height + * @param[in] regionType The type of the overlay region + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_MAX_EXCEEDED The number of overlay regions has reached the maximum limit. + * @exception E_UNSUPPORTED_OPTION The specified option of the overlay region type is not supported. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * If the application runs on multi-screen resolutions, the specified bounds may not meet the hardware limitations of the overlay region. @n + * In such cases, GetOverlayRegionNF() returns the E_INVALID_ARG exception. To prevent this problem, the application should use the + * OverlayRegion::EvaluateBoundsF() method to get the validated bounds that can be used as the input bounds of the GetOverlayRegionNF() method. + * @remarks Do not use OverlayRegion with OverlayPanel. If used, the E_SYSTEM exception is thrown. + */ + OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::FloatRectangle& rect, OverlayRegionType regionType); + /** * Creates and returns a graphics canvas whose bounds (position and size) are equal to the bounds of the client area of the %Form. @@ -915,7 +951,7 @@ public: * @remarks The method allocates Tizen::Graphics::Canvas whose bounds are equal to that of the client area of the %Form. @n * It is the responsibility of the developers to deallocate the canvas after use. * @remarks The canvas is valid only if the properties of the parent control of the canvas remain unchanged. @n - * Therefore, delete the previously allocated canvas and create a new canvas using the GetCanvasN() method @n + * Therefore, delete the previously allocated canvas and create a new canvas using the GetClientAreaCanvasN() method @n * if the size or position of the control is changed. * @remarks The specific error code can be accessed using the GetLastResult() method. * @remarks The Frame and %Form instances share a single frame-buffer. @n @@ -936,6 +972,18 @@ public: */ Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + /* + * Translates the specified position to the client coordinate. + * + * @since 2.0 + * + * @return The position relative to the top-left corner of the client area, @n + * else @c (-1,-1) if the instance is invalid + * @param[in] position The position relative to the top-left corner of the %Form control + * @see TranslateFromClientAreaPosition() + */ + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; + /** * Translates the specified client position to the control coordinate. * @@ -948,6 +996,17 @@ public: */ Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; + /* + * Translates the specified client position to the control coordinate. + * + * @since 2.0 + * + * @return The position relative to the top-left corner of the %Form control, @n + * else @c (-1,-1) if the instance is invalid + * @param[in] clientPosition The position relative to the top-left corner of the client area + * @see TranslateToClientAreaPosition() + */ + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; /** * Sets the %Form back event listener. diff --git a/inc/FUiCtrlFrame.h b/inc/FUiCtrlFrame.h old mode 100644 new mode 100755 index b09eacc..ada5e35 --- a/inc/FUiCtrlFrame.h +++ b/inc/FUiCtrlFrame.h @@ -126,6 +126,26 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %Frame with the specified position and size. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect An instance of the FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner @n + * of the created window along with its width and height. @n + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation (that + * is, the method is called on an instance that is constructed). + * @exception E_MAX_EXCEEDED The number of Frames and Forms exceeds the system limitation. + * @exception E_SYSTEM A system error has occurred. + * @remarks The maximum number of Forms that an application can construct is limited by available memory. + * @remarks The specified position and size are only applied when the show mode is not #FRAME_SHOW_MODE_FULL_SCREEN. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect); + // Operation public: /** @@ -205,6 +225,24 @@ public: */ result SetCurrentForm(const Form& form); + /* + * Sets the specified Form control as the current %Form of the %Frame control. + * + * @since 2.0 + * + * @return An error code + * @param[in] pForm The form to be set as the current form of the %Frame control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * The specified @c form is not a child control of the %Frame control. + * @exception E_SYSTEM A system error has occurred. + * @remarks If a form is set as the current form, it becomes the topmost form amongst its siblings. @n + * SetCurrentForm() does not call Invalidate() internally, so if the current form needs to be drawn + * immediately, Invalidate() should be called after SetCurrentForm(). + * Only Frame whose show mode is @c FRAME_SHOW_MODE_FULL_SCREEN can set a Form which has the style of @c FORM_STYLE_INDICATOR as the current form. + */ + result SetCurrentForm(Form* pForm); + /** * Gets the background color of the %Frame control. * diff --git a/inc/FUiCtrlFrameTypes.h b/inc/FUiCtrlFrameTypes.h index fee88bb..7778b48 100644 --- a/inc/FUiCtrlFrameTypes.h +++ b/inc/FUiCtrlFrameTypes.h @@ -37,11 +37,12 @@ namespace Tizen { namespace Ui { namespace Controls */ enum FrameShowMode { - FRAME_SHOW_MODE_FULL_SCREEN, /**< The full screen mode */ - FRAME_SHOW_MODE_PARTIAL_SCREEN, /**< The partial screen mode */ - FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING, /**< The partial screen mode which is always on top of other Frames */ + FRAME_SHOW_MODE_FULL_SCREEN, /**< The Frame occupies the whole screen */ + FRAME_SHOW_MODE_PARTIAL_SCREEN, /**< The Frame occupies the partial screen */ + FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING, /**< The Frame is always on top of other Frames, occupying the partial screen */ + FRAME_SHOW_MODE_MINIMIZED, // The Frame is minimized @b Since: @b 2.1 }; }}} // Tizen::Ui::Controls -#endif // _FUI_CTRL_FRAME_TYPES_H_ +#endif // _FUI_CTRL_FRAME_TYPES_H_ \ No newline at end of file diff --git a/inc/FUiCtrlGallery.h b/inc/FUiCtrlGallery.h index 208c6ed..b0cc832 100644 --- a/inc/FUiCtrlGallery.h +++ b/inc/FUiCtrlGallery.h @@ -213,6 +213,21 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %Gallery with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created %Gallery control along with the + * width and height. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect); + /** * Sets the item provider that creates and deletes the items from the %Gallery control. * diff --git a/inc/FUiCtrlGroupContainer.h b/inc/FUiCtrlGroupContainer.h new file mode 100644 index 0000000..ddf5177 --- /dev/null +++ b/inc/FUiCtrlGroupContainer.h @@ -0,0 +1,444 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +* @file FUiCtrlGroupContainer.h +* @brief This is the header file for the %GroupContainer class. +* +* This header file contains the declarations of the %GroupContainer class. +*/ +#ifndef _FUI_CTRL_GROUP_CONTAINER_H_ +#define _FUI_CTRL_GROUP_CONTAINER_H_ + +#include +#include + +namespace Tizen { namespace Ui { namespace Controls +{ +/** +* @class GroupContainer +* @brief This class defines common behavior for a %GroupContainer container. +* +* @since 2.1 +* +* The %GroupContainer class displays child controls in grouping look. It is a concrete implementation of the Container class. +*/ + +class _OSP_EXPORT_ GroupContainer + : public Tizen::Ui::Container +{ +public: + /** + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.1 + */ + GroupContainer(void); + + /** + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~GroupContainer(void); + + /** + * Initializes this instance of %GroupContainer with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %GroupContainer control as an instance of FloatRectangle + * @param[in] rowCount The number of rows + * @param[in] columnCount The number of columns + * @param[in] lineWidth Width of the grid lines to draw + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The width or height of @c rect or @c rowCount or @c columnnCount is negative or the value of @c lineWidth is @c 0 or negative. + * @exception E_OPERATION_FAILED The operation has failed. + * @remarks The available space for controls is less than the width or height of the container by the total width or height of the grid lines. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, int rowCount, int columnCount, float lineWidth = 1.0f); + + /** + * Adds a control at the specified row and column index. + * + * @since 2.1 + * + * @return An error code + * @param[in] control The control to add to the container + * @param[in] rowIndex The row index of the cell + * @param[in] columnIndex The column index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_OPERATION The specified operation is not allowed + * @see Merge() + * @remarks If a control is being added to the merged cells, the row index and column index of a representative cell should be given. + * @remarks The control to add should be allocated in heap memory, and the ownership of the control is transferred to the platform. + */ + result AddControlAt(Control& control, int rowIndex, int columnIndex); + + /** + * Gets the control at the specified cell index in the GroupContainer. + * + * @since 2.1 + * + * @return The control at the specified index of the list, @n + * else @c null if the cell index is not valid or no control is added + * @param[in] rowIndex The row index of the cell + * @param[in] columnIndex The column index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_OPERATION The specified operation is not allowed + * @remarks When you get the control from the merged cell, the row index and column index of a representative cell should be given. + */ + const Tizen::Ui::Control* GetControlAt(int rowIndex, int columnIndex) const; + + /** + * Gets the control at the specified cell index in the GroupContainer. + * + * @since 2.1 + * + * @return The control at the specified index of the list, @n + * else @c null if the cell index is not valid or no control is added + * @param[in] rowIndex The row index of the cell + * @param[in] columnIndex The column index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_OPERATION The specified operation is not allowed + * @remarks When you get the control from the merged cells, the row index and column index of a representative cell should be given. + */ + Tizen::Ui::Control* GetControlAt(int rowIndex, int columnIndex); + + /** + * Removes the specified control from the specified row and column index + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index of the control to remove + * @param[in] columnIndex The column index of the control to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_OPERATION_FAILED The operation has failed. + * @exception E_OBJ_NOT_FOUND The specified cell does not have any control. + * @exception E_INVALID_OPERATION The specified operation is not allowed + * @remarks When you remove the control from the merged cell, the row index and column index of a representative cell should be given. + * @remarks The removed child control is deleted from the memory. Before it is removed from the container, OnTerminating() of the child control is called. + * @see Tizen::Ui::Control::OnTerminating() + */ + result RemoveControlAt (int rowIndex, int columnIndex); + + /** + * Sets the width of a column. + * + * @since 2.1 + * + * @return An error code + * @param[in] columnIndex The column index + * @param[in] width The new width of the column + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_ARG The specified @c width must be greater than or equal to @c 0. + * + */ + result SetColumnWidth(int columnIndex, float width); + + /** + * Gets the width of a column. + * + * @since 2.1 + * + * @return The width of the column + * @param[in] columnIndex The column index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0. + */ + float GetColumnWidth(int columnIndex) const; + + /** + * Sets the height of a row. + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index + * @param[in] height The new height of the row + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_ARG The specified @c height must be greater than or equal to @c 0. + * + */ + result SetRowHeight(int rowIndex, float height); + + /** + * Gets the height of a row. + * + * @since 2.1 + * + * @return The height of the row + * @param[in] rowIndex The row index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0. + * + */ + float GetRowHeight(int rowIndex) const; + /** + * Merges the cells for the given row and column index. + * + * @since 2.1 + * + * @return An error code + * @param[in] rowStartIndex The start index of the row from which the merge should happen + * @param[in] columnStartIndex The start index of the column from which the merge should happen + * @param[in] rowCount The number of cells to merge along the row + * @param[in] columnCount The number of cells to merge along the column + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowStartIndex or @c columnStartIndex is greater than the number of elements or less than @c 0 + * @remarks When the cells are merged, the top-left cell will play the role of representative cell on behalf of merged cells. @n + * To manipulate the merge cell, the row index and column index of the representative cell has to be given. Merging cells with the merged cell + * is allowed, but the newly merged cell should completely contain the all cells to merge. + */ + result Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount); + + /** + * Enables/disables resizing of the control in a cell + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index of the row in which the control should be resized + * @param[in] columnIndex The column index of the column in which the control should be resized + * @param[in] enable boolean value to enable or disable the resizing of control + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @ccolumnIndex is greater than the number of elements or less than @c 0. + * + */ + result SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable); + + /** + * Sets the margin of a cell + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index of the cell + * @param[in] columnIndex The column index of the cell + * @param[in] leftMargin The left margin + * @param[in] rightMargin The right margin + * @param[in] topMargin The top margin + * @param[in] bottomMargin The bottom margin + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_ARG The specified @c leftMargin or @c topMargin or @c rightMargin or @c bottomMargin must be greater than or equal to @c 0. + * @remarks The default margin value is 2 logical pixel. + */ + result SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin); + /** + * Splits the merged cells + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index of the representative cell of the merged cells + * @param[in] columnIndex The column index of the representative cell of the merged cells + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + * @exception E_INVALID_ARG The specified row and column index are not those of the representative cell of the merged cells. + */ + result Split(int rowIndex, int columnIndex); + + /** + * Gets the bounds of specified cell + * + * @since 2.1 + * + * @return An instance of the FloatRectangle that represents the position of top-left corner, + * the width, and the height of the cell, @n else Rectangle(0.0f, 0.0f, -1.0f, -1.0f) if an error occurs + * @param[in] rowIndex The row index of the cell + * @param[in] columnIndex The column index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0. + */ + Tizen::Graphics::FloatRectangle GetBoundsAt(int rowIndex, int columnIndex) const; + + /** + * Enables/disables stretchable or shrinkable property of a column + * + * @since 2.1 + * + * @return An error code + * @param[in] columnIndex The column index of the cell + * @param[in] stretchable boolean value to set stretchable or shrinkable property + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0. + */ + result SetColumnStretchable(int columnIndex, bool stretchable); + + /** + * Checks whether the column is stretchable or shrinkable + * + * @since 2.1 + * + * @return @c true if the column is stretchable or shrinkable + * else @c false + * @param[in] columnIndex The column index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0. + */ + bool IsColumnStretchable(int columnIndex) const; + + /** + * Enables/disables stretchable or shrinkable property of a row + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index of the cell + * @param[in] stretchable boolean value to set stretchable or shrinkable property + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0. + */ + result SetRowStretchable(int rowIndex, bool stretchable); + + /** + * Checks whether the row is stretchable or shrinkable + * + * @since 2.1 + * + * @return @c true if the row is stretchable or shrinkable + * else @c false + * @param[in] rowIndex The row index of the cell + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0. + */ + bool IsRowStretchable(int rowIndex) const; + + /** + * Gets the background color of the %GroupContainer control. + * + * @since 2.1 + * + * @return The background color, @n + * else RGBA(0, 0, 0, 0) if an error occurs + */ + Tizen::Graphics::Color GetBackgroundColor(void) const; + + /** + * Sets the background color of the %GroupContainer control. + * + * @since 2.1 + * + * @param[in] color The background color + */ + void SetBackgroundColor(const Tizen::Graphics::Color& color); + + /** + * Gets the row and column divider line color of the %GroupContainer control. + * + * @since 2.1 + * + * @return The row and column divider line color, @n + * else RGBA(0, 0, 0, 255) if line color is not set. + */ + Tizen::Graphics::Color GetLineColor(void) const; + + /** + * Sets the row and column divider line color of the %GroupContainer control. + * + * @since 2.1 + * + * @param[in] color The line color + */ + void SetLineColor(const Tizen::Graphics::Color& color); + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.1 + // + virtual void GroupContainer_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.1 + // + virtual void GroupContainer_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.1 + // + virtual void GroupContainer_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.1 + // + virtual void GroupContainer_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // Following method is reserved and may change its name at any time without + // prior notice. + // + // @since 2.1 + // + virtual void GroupContainer_Reserved5(void) {} + +private: + friend class _GroupContainerImpl; + + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + // @since 2.1 + // + GroupContainer(const GroupContainer& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + GroupContainer& operator =(const GroupContainer& rhs); + +}; // GroupContainer + +}}} //Tizen::Ui::Controls + +#endif // _FUI_CTRL_GROUP_CONTAINER_H_ diff --git a/inc/FUiCtrlGroupItem.h b/inc/FUiCtrlGroupItem.h index 0b079c2..7b1b202 100644 --- a/inc/FUiCtrlGroupItem.h +++ b/inc/FUiCtrlGroupItem.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,18 @@ public: */ result Construct(const Tizen::Graphics::Dimension& itemSize); + /* + * Initializes this instance of %GroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize); + /** * Sets the background image of the item. * @@ -156,6 +169,20 @@ public: */ result SetTextSize(int size); + /* + * Sets the size of the text. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The size of the text + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSize() + */ + result SetTextSize(float size); + /** * Gets the size of the text. * @@ -168,6 +195,18 @@ public: */ int GetTextSize(void) const; + /* + * Gets the size of the text. + * + * @since 2.1 + * + * @return The size of the text, + * else @c -1.0f if an error occurs + * + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + /** * Sets the text and bitmap of the element for %GroupItem. * diff --git a/inc/FUiCtrlGroupTypes.h b/inc/FUiCtrlGroupTypes.h deleted file mode 100644 index 48b605b..0000000 --- a/inc/FUiCtrlGroupTypes.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/** - * @file FUiCtrlGroupTypes.h - * @brief This is the header file for the table view style enumeration. - * - * This header file contains the declarations of the table view style enumeration. - */ -#ifndef _FUI_CTRL_GROUP_TYPES_H_ -#define _FUI_CTRL_GROUP_TYPES_H_ - -namespace Tizen { namespace Ui { namespace Controls -{ - -/** - * @enum GroupStyle - * - * Defines the table view style of a control's border. - * - * @since 2.0 - */ -enum GroupStyle -{ - GROUP_STYLE_NONE, /**< A rectangle with no outline */ - GROUP_STYLE_SINGLE, /**< A rectangle with all corners rounded */ - GROUP_STYLE_TOP, /**< A rectangle with the two top corners rounded */ - GROUP_STYLE_MIDDLE, /**< A rectangle positioned at the center of a group */ - GROUP_STYLE_BOTTOM /**< A rectangle with the two bottom corners rounded */ -}; - -}}} // Tizen::Ui::Controls - -#endif // _FUI_CTRL_GROUP_TYPES_H_ diff --git a/inc/FUiCtrlGroupedList.h b/inc/FUiCtrlGroupedList.h index 8be75e8..a7c5c53 100644 --- a/inc/FUiCtrlGroupedList.h +++ b/inc/FUiCtrlGroupedList.h @@ -39,7 +39,7 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @if OSPDEPREC + * @if OSPDEPREC * @class GroupedList * @brief [Deprecated] This class defines the common behavior of a %GroupedList control. * diff --git a/inc/FUiCtrlGroupedListView.h b/inc/FUiCtrlGroupedListView.h old mode 100644 new mode 100755 index e0b0cf1..b1b159d --- a/inc/FUiCtrlGroupedListView.h +++ b/inc/FUiCtrlGroupedListView.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -34,8 +35,11 @@ #include #include #include +#include #include +#include #include +#include #include namespace Tizen { namespace Ui { namespace Controls @@ -433,6 +437,26 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, GroupedListViewStyle style, bool itemDivider, ListScrollStyle scrollStyle); + /* + * Initializes this instance of %GroupedListView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::Rectangle class + * This instance represents the x and y coordinates of the top-left corner of the created + * %GroupedListView control along with the width and height. + * @param[in] style The style of the %GroupedListView control + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle Set to scroll style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * Either the @c rect.width or @c rect.height parameter has a negative value. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, GroupedListViewStyle style, bool itemDivider, ListScrollStyle scrollStyle); + /** * Sets the item provider that creates and deletes items from the list. * @@ -447,6 +471,20 @@ public: */ result SetItemProvider(IGroupedListViewItemProvider& provider); + /* + * Sets the item provider that creates and deletes items from the list. + * + * @since 2.1 + * + * @return An error code + * @param[in] provider The item provider to create and delete items + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks If an item provider is not set for the list, the list does not work. @n + * A provider should be allocated on a heap memory. + */ + result SetItemProvider(IGroupedListViewItemProviderF& provider); + /** * Adds an IGroupedListViewItemEventListener instance that listens to the state changes of the list view items. @n * The added listener can listen to events on the specified event dispatcher's context when they are fired. @@ -499,6 +537,18 @@ public: */ void AddScrollEventListener(IScrollEventListener& listener); + /* + * Adds an IScrollEventListener instance that listens to the state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be added + * @see IScrollEventListener::OnScrollEndReached() + * @see RemoveScrollEventListener() + */ + void AddScrollEventListener(IScrollEventListenerF& listener); + /** * Removes an IScrollEventListener instance that listens to the state changes of a scroll event. @n * The removed listener cannot listen to events when they are fired. @@ -511,6 +561,18 @@ public: */ void RemoveScrollEventListener(IScrollEventListener& listener); + /* + * Removes an IScrollEventListener instance that listens to the state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be removed + * @see IScrollEventListener::OnScrollEndReached() + * @see AddScrollEventListener() + */ + void RemoveScrollEventListener(IScrollEventListenerF& listener); + /** * Adds a link event listener. * @@ -602,6 +664,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ScrollToItem(int groupIndex, int itemIndex); @@ -618,6 +681,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ScrollToItem(int groupIndex, int itemIndex, ListScrollItemAlignment itemAlignment); @@ -636,6 +700,7 @@ public: * @exception E_INVALID_OPERATION The item is disabled. * @exception E_SYSTEM A system error has occurred. * @remarks This method works only when the annex style of the item allows selection. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result SetItemChecked(int groupIndex, int itemIndex, bool check); @@ -649,6 +714,7 @@ public: * @param[in] groupIndex The group index * @param[in] itemIndex The item index * @remarks This method returns @c false, if the annex style of the item does not allow selection. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemChecked(int groupIndex, int itemIndex) const; @@ -666,6 +732,7 @@ public: * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. * @remarks This method can only be used when the annex style of the list allows selection. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result SetItemEnabled(int groupIndex, int itemIndex, bool enable); @@ -678,6 +745,7 @@ public: * else @c false * @param[in] groupIndex The group index * @param[in] itemIndex The item index + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemEnabled(int groupIndex, int itemIndex) const; @@ -697,6 +765,7 @@ public: * * @return The total number of items in the specified group * @param[in] groupIndex The group index + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ int GetItemCountAt(int groupIndex) const; @@ -712,6 +781,7 @@ public: * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. * @remarks If no description text is set for the item at the specified index, it is not displayed. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). * */ result ShowItemDescriptionText(int groupIndex, int itemIndex); @@ -727,6 +797,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result HideItemDescriptionText(int groupIndex, int itemIndex); @@ -794,9 +865,27 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred, or @n * there is no item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(int x, int y, int& groupIndex, int& itemIndex) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The X position of the item + * @param[in] y The Y position of the item + * @param[out] groupIndex The index of the group that the item belongs to + * @param[out] itemIndex The index of the item + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or @n + * there is no item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(float x, float y, int& groupIndex, int& itemIndex) const; + /** * Gets the index of the item at the specified position. * @@ -809,9 +898,26 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred, or @n * there is no item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of the item + * @param[out] groupIndex The index of the group that the item belongs to + * @param[out] itemIndex The index of the item + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or @n + * there is no item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; + /** * Gets the index of the item and ID of the element at the specified position. * @@ -828,9 +934,30 @@ public: * there is no item at the specified position. * @remarks @c groupIndex and @c itemIndex are -1 when there is no list item at the specified position. * @remarks @c elementId is -1 when there is no element at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(int x, int y, int& groupIndex, int& itemIndex, int& elementId) const; + /* + * Gets the index of the item and ID of the element at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The X position of the item + * @param[in] y The Y position of the item + * @param[out] groupIndex The index of the group that the item belongs to + * @param[out] itemIndex The index of the item + * @param[out] elementId The ID of the element + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or + * there is no item at the specified position. + * @remarks @c groupIndex and @c itemIndex are -1 when there is no list item at the specified position. + * @remarks @c elementId is -1 when there is no element at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(float x, float y, int& groupIndex, int& itemIndex, int& elementId) const; + /** * Gets the index of the item and ID of the element at the specified position. * @@ -845,10 +972,30 @@ public: * @exception E_SYSTEM A system error has occurred, or * there is no item at the specified position. * @remarks @c groupIndex and @c itemIndex are -1 when there is no list item at the specified position. - * @remarks @c elementId is -1 when there is no element at the specified position + * @remarks @c elementId is -1 when there is no element at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex, int& elementId) const; + /* + * Gets the index of the item and ID of the element at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of the point + * @param[out] groupIndex The index of the group that the item belongs to + * @param[out] itemIndex The index of the item + * @param[out] elementId The ID of the element + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or + * there is no item at the specified position. + * @remarks @c groupIndex and @c itemIndex are -1 when there is no list item at the specified position. + * @remarks @c elementId is -1 when there is no element at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex, int& elementId) const; + /** * Sets the color of a section. * @@ -998,6 +1145,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ExpandGroup(int groupIndex); @@ -1011,6 +1159,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result CollapseGroup(int groupIndex); @@ -1023,10 +1172,33 @@ public: * @c else false * * @param[in] groupIndex The index of the group + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsGroupExpanded(int groupIndex) const; /** + * Expands all groups of list. + * + * @since 2.1 + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The feature of expanding all groups is only supported when %GroupedListView% is constructed with GroupedListViewStyle::GROUPED_LIST_VIEW_STYLE_INDEXED style. + * @see GroupedListView::Construct() + */ + result ExpandAllGroups(void); + + /** + * Collapses all groups of list. + * + * @since 2.1 + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The feature of collapsing all groups is only supported when %GroupedListView% is constructed with GroupedListViewStyle::GROUPED_LIST_VIEW_STYLE_INDEXED style. + * @see GroupedListView::Construct() + */ + result CollapseAllGroups(void); + + /** * Begins the reordering mode. * * @since 2.0 @@ -1062,6 +1234,26 @@ public: */ bool IsInReorderingMode(void) const; + /** + * Sets the scroll input handling mode. + * + * @since 2.1 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ + void SetScrollInputMode(ScrollInputMode mode); + + /** + * Gets the scroll input handling mode. + * + * @since 2.1 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ + ScrollInputMode GetScrollInputMode(void) const; + protected: friend class _GroupedListViewImpl; diff --git a/inc/FUiCtrlGroupedTableView.h b/inc/FUiCtrlGroupedTableView.h index 1dc8933..f48a366 100644 --- a/inc/FUiCtrlGroupedTableView.h +++ b/inc/FUiCtrlGroupedTableView.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlGroupedTableView.h - * @brief This is the header file for the %GroupedTableView class. - * - * This header file contains the declarations of the %GroupedTableView class and its helper classes. - */ +* @file FUiCtrlGroupedTableView.h +* @brief This is the header file for the %GroupedTableView class. +* +* This header file contains the declarations of the %GroupedTableView class and its helper classes. +*/ #ifndef _FUI_CTRL_GROUPED_TABLE_VIEW_H_ #define _FUI_CTRL_GROUPED_TABLE_VIEW_H_ @@ -29,13 +29,16 @@ #include #include #include +#include namespace Tizen { namespace Ui { namespace Controls { class IGroupedTableViewItemProvider; +class IGroupedTableViewItemProviderF; class IGroupedTableViewItemEventListener; class IFastScrollListener; class IScrollEventListener; +class IScrollEventListenerF; /** * @class GroupedTableView @@ -250,7 +253,7 @@ GroupedTableViewSample::CreateItem(int groupIndex, int itemIndex, int itemWidth) TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL; TableViewItem* pItem = new TableViewItem(); - switch (itemIndex % 5) + switch (itemIndex % 6) { case 0: style = TABLE_VIEW_ANNEX_STYLE_NORMAL; @@ -267,6 +270,9 @@ GroupedTableViewSample::CreateItem(int groupIndex, int itemIndex, int itemWidth) case 4: style = TABLE_VIEW_ANNEX_STYLE_RADIO; break; + case 5: + style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER; + break; default: break; } @@ -307,495 +313,639 @@ class _OSP_EXPORT_ GroupedTableView { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ GroupedTableView(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~GroupedTableView(void); /** - * Initializes this instance of %GroupedTableView with the specified parameters. - * - * @since 2.0 - * - * @return An error code - * @param[in] rect An instance of the Graphics::Rectangle class - * This instance represents the x and y coordinates of the left top corner of the created %GroupedTableView along with the width and height. - * @param[in] itemDivider Set to @c true to display an item divider, @n - * else @c false - * @param[in] scrollStyle The style of %GroupedTableView scroll bar style - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. - * - */ + * Initializes this instance of %GroupedTableView with the specified parameters. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect An instance of the Graphics::Rectangle class + * This instance represents the x and y coordinates of the left top corner of the created %GroupedTableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %GroupedTableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); + /* + * Initializes this instance of %GroupedTableView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class + * This instance represents the x and y coordinates of the left top corner of the created %GroupedTableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %GroupedTableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); + /** - * Sets the item provider that creates and deletes items for the grouped style table view. - * - * @since 2.0 - * - * @param[in] pProvider The item provider to create and delete items - * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. - * To reset the item provider, pass @c null to @c pProvider. - */ + * Sets the item provider that creates and deletes items for the grouped style table view. + * + * @since 2.0 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. + * To reset the item provider, pass @c null to @c pProvider. + */ void SetItemProvider(IGroupedTableViewItemProvider* pProvider); - /** - * Expands the group's items. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The index of the group - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + /* + * Sets the item provider that creates and deletes items for the grouped style table view. + * + * @since 2.1 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. + * To reset the item provider, pass @c null to @c pProvider. + */ + void SetItemProviderF(IGroupedTableViewItemProviderF* pProvider); + + /** + * Expands the group's items. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The index of the group + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result ExpandGroup(int groupIndex); /** - * Collapses the group's items. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The index of the group - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Collapses the group's items. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The index of the group + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result CollapseGroup(int groupIndex); /** - * Expands all groups of table view. - * - * @since 2.0 - * - */ - void ExpandAllGroup(void); + * Expands all groups of table view. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ + result ExpandAllGroups(void); /** - * Collapses all groups of table view. - * - * @since 2.0 - * - */ - void CollapseAllGroup(void); + * Collapses all groups of table view. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ + result CollapseAllGroups(void); + + /* + * Expands all groups of table view. + * + * @since 2.0 + * + */ + inline void ExpandAllGroup(void) + { + ExpandAllGroups(); + } + + /* + * Collapses all groups of table view. + * + * @since 2.0 + * + */ + inline void CollapseAllGroup(void) + { + CollapseAllGroups(); + } /** - * Returns whether the group is expanded or not. - * - * @since 2.0 - * - * @return @c true if the group is expanded, else @c false - * @param[in] groupIndex The index of the group - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Returns whether the group is expanded or not. + * + * @since 2.0 + * + * @return @c true if the group is expanded, else @c false + * @param[in] groupIndex The index of the group + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsGroupExpanded(int groupIndex) const; /** - * Sets the grouped look is enabled. - * - * @since 2.0 - * - * @param[in] enable The enabled/disabled status - */ + * Sets the grouped look is enabled. + * + * @since 2.0 + * + * @param[in] enable The enabled/disabled status + */ void SetGroupedLookEnabled(bool enable); /** - * Returns whether the grouped look is enabled or not. - * - * @since 2.0 - * - * @return @c true if the grouped look is enabled, else @c false - */ + * Returns whether the grouped look is enabled or not. + * + * @since 2.0 + * + * @return @c true if the grouped look is enabled, else @c false + */ bool IsGroupedLookEnabled(void) const; /** - * Adds a listener instance that listens to state changes of table view items. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of table view items. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener); /** - * Removes a listener instance that listens to state changes of table view items. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of table view items. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener); /** - * Adds a listener instance that listens to state changes of a fast scroll. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a fast scroll. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddFastScrollListener(IFastScrollListener& listener); /** - * Removes a listener instance that listens to state changes of a fast scroll. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a fast scroll. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveFastScrollListener(IFastScrollListener& listener); /** - * Adds a listener instance that listens to state changes of a scroll event. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @see IScrollEventListener::OnScrollEndReached() - * @see RemoveScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListener::OnScrollEndReached() + * @see RemoveScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddScrollEventListener(IScrollEventListener& listener); /** - * Removes a listener instance that listens to state changes of a scroll event. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @see IScrollEventListener::OnScrollEndReached() - * @see AddScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListener::OnScrollEndReached() + * @see AddScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveScrollEventListener(IScrollEventListener& listener); + /* + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListenerF::OnScrollEndReached() + * @see RemoveScrollEventListenerF() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ + result AddScrollEventListener(IScrollEventListenerF& listener); + + /* + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListenerF::OnScrollEndReached() + * @see AddScrollEventListenerF() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ + result RemoveScrollEventListener(IScrollEventListenerF& listener); + /** - * Enables or disables the collapse by pinch gesture. - * - * @since 2.0 - * - * @param[in] enable Set to @c true to enable the collapse by pinch gesture, else @c false - */ + * Enables or disables the collapse by pinch gesture. + * + * @since 2.0 + * + * @param[in] enable Set to @c true to enable the collapse by pinch gesture, else @c false + */ void SetCollapseByPinchGestureEnabled(bool enable); /** - * Returns whether the collapse by pinch gesture is enabled or not. - * - * @since 2.0 - * - * @return @c true if the collapse by pinch gesture is enabled, else @c false - */ + * Returns whether the collapse by pinch gesture is enabled or not. + * + * @since 2.0 + * + * @return @c true if the collapse by pinch gesture is enabled, else @c false + */ bool IsCollapseByPinchGestureEnabled(void) const; /** - * Sets the text index of the fast scroll. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text of the index - * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - */ + * Sets the text index of the fast scroll. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text of the index + * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon); /** - * Gets the group and item indexes of the top item. - * - * @since 2.0 - * - * @return An error code - * @param[out] groupIndex The group index - * @param[out] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Top drawn item is not found. - */ + * Gets the group and item indexes of the top item. + * + * @since 2.0 + * + * @return An error code + * @param[out] groupIndex The group index + * @param[out] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Top drawn item is not found. + */ result GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const; /** - * Gets the group and item indexes of the bottom item. - * - * @since 2.0 - * - * @return An error code - * @param[out] groupIndex The group index - * @param[out] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. - */ + * Gets the group and item indexes of the bottom item. + * + * @since 2.0 + * + * @return An error code + * @param[out] groupIndex The group index + * @param[out] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. + */ result GetBottomDrawnItemIndex(int& groupIndex, int& itemIndex) const; /** - * Scrolls to the item at the specified index. - * The specified item is drawn at the position specified by the item alignment. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] itemAlignment The item alignment - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index. - */ + * Scrolls to the item at the specified index. + * The specified item is drawn at the position specified by the item alignment. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] itemAlignment The item alignment + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP); /** - * Checks or unchecks the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] check Set to @c true to select the item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @exception E_INVALID_OPERATION The item is disabled. - * @remarks This method works only when the annex style of the item allows selection. - */ + * Checks or unchecks the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] check Set to @c true to select the item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The item is disabled. + * @remarks This method works only when the annex style of the item allows selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemChecked(int groupIndex, int itemIndex, bool check); /** - * Returns whether the item at the specified index is selected or not. - * - * @since 2.0 - * - * @return @c true if the item is selected, @n - * else @c false - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks This method returns @c false, if the annex style of the item does not allow selection. + * Returns whether the item at the specified index is selected or not. + * + * @since 2.0 + * + * @return @c true if the item is selected, @n + * else @c false + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method returns @c false, if the annex style of the item does not allow selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemChecked(int groupIndex, int itemIndex) const; /** - * Enables or disables the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] enable Set to @c true to enable the specified item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Enables or disables the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] enable Set to @c true to enable the specified item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemEnabled(int groupIndex, int itemIndex, bool enable); /** - * Returns whether the item at the specified index is enabled or disabled. - * - * @since 2.0 - * - * @return @c true if the item is enabled, @n - * else @c false - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Returns whether the item at the specified index is enabled or disabled. + * + * @since 2.0 + * + * @return @c true if the item is enabled, @n + * else @c false + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsItemEnabled(int groupIndex, int itemIndex) const; /** - * Counts the total number of groups. - * - * @since 2.0 - * - * @return The total number of groups - */ + * Counts the total number of groups. + * + * @since 2.0 + * + * @return The total number of groups + */ int GetGroupCount(void) const; /** - * Counts all the items of the specified group. - * - * @since 2.0 - * - * @return The total number of items in the specified group - * @param[in] groupIndex The group index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Counts all the items of the specified group. + * + * @since 2.0 + * + * @return The total number of items in the specified group + * @param[in] groupIndex The group index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + */ int GetItemCountAt(int groupIndex) const; /** - * Updates the specified item. @n - * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the - * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. - * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. - * - * @since 2.0 - * - * @return An error code - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] type The item to be added, removed, or modified - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index. - * Note that if TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a group item, all the items in the group (including the group item itself) are - * removed from the table view. - */ + * Updates the specified item. @n + * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the + * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. + * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. + * + * @since 2.0 + * + * @return An error code + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] type The item to be added, removed, or modified + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks If the specified item. itemIndex is -1, then the method is applied to the group item with the given index. + * Note that if TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a group item, all the items in the group (including the group item itself) are + * removed from the table view. + */ result RefreshItem(int groupIndex, int itemIndex, TableViewRefreshType type); /** - * Updates all the items of a table view. - * - * @since 2.0 - * - * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. - */ + * Updates all items of the table view. @n + * Note that calling this method invokes its item provider's UpdateItem() for all loaded items. + * + * @since 2.1 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The %GroupedTableView item provider is processing the other request. + */ + result RefreshAllItems(void); + + /** + * Updates all the items of a table view. + * + * @since 2.0 + * + * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. + */ void UpdateTableView(void); /** - * Gets the index of the item at the specified position. - * - * @since 2.0 - * - * @param[in] position The position of the item - * @param[out] groupIndex The group index of the item on specified position - * @param[out] itemIndex The item index of the item on specified position - * @remarks This method sets both of groupIndex and itemIndex to -1 if no item is found at the given position. - */ + * Gets the index of the item at the specified position. + * + * @since 2.0 + * + * @param[in] position The position of the item + * @param[out] groupIndex The group index of the item on specified position + * @param[out] itemIndex The item index of the item on specified position + * @remarks This method sets both of groupIndex and itemIndex to -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ void GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @param[in] position The position of the item + * @param[out] groupIndex The group index of the item on specified position + * @param[out] itemIndex The item index of the item on specified position + * @remarks This method sets both of groupIndex and itemIndex to -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + void GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; + /** - * Sets the color of a division line between items. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The division line color - */ + * Sets the color of a division line between items. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The division line color + */ void SetItemDividerColor(const Tizen::Graphics::Color& color); /** - * Gets the color of a division line between items. - * - * @since 2.0 - * - * @return The color of a division line - */ + * Gets the color of a division line between items. + * + * @since 2.0 + * + * @return The color of a division line + */ Tizen::Graphics::Color GetItemDividerColor(void) const; /** - * Sets the background color of this control. - * - * @since 2.0 - * - * @param[in] color The background color - * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, - * only the bitmap image is displayed. - */ + * Sets the background color of this control. + * + * @since 2.0 + * + * @param[in] color The background color + * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, + * only the bitmap image is displayed. + */ void SetBackgroundColor(const Tizen::Graphics::Color& color); /** - * Sets the scroll input handling mode. - * - * @since 2.0 - * - * @param[in] mode The scroll input handling mode - * @see GetScrollInputMode() - */ + * Sets the scroll input handling mode. + * + * @since 2.0 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ void SetScrollInputMode(ScrollInputMode mode); /** - * Gets the scroll input handling mode. - * - * @since 2.0 - * - * @return The scroll input handling mode - * @see SetScrollInputMode() - */ + * Gets the scroll input handling mode. + * + * @since 2.0 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ ScrollInputMode GetScrollInputMode(void) const; /** - * Gets the background color of this control. - * - * @since 2.0 - * - * @return The background color - */ + * Gets the background color of this control. + * + * @since 2.0 + * + * @return The background color + */ Tizen::Graphics::Color GetBackgroundColor(void) const; /* - * Scrolls the list contents with the amount of pixels. - * - * @since 2.0 - * - * @return An error code - * @param[in] pixel The amount of pixels to scroll - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. - * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. - * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. - */ + * Scrolls the list contents with the amount of pixels. + * + * @since 2.0 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ result ScrollByPixel(int pixel); /* - * Gets the current scroll position - * - * @since 2.0 - */ + * Scrolls the list contents with the amount of pixels. + * + * @since 2.1 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ + result ScrollByPixel(float pixel); + + /* + * Gets the current scroll position + * + * @since 2.0 + */ int GetCurrentScrollPosition(void) const; /* - * Enables or disables the scroll of GroupedTableView items. - * - * @since 2.0 - */ + * Gets the current scroll position + * + * @since 2.1 + */ + float GetCurrentScrollPositionF(void) const; + + /* + * Enables or disables the scroll of GroupedTableView items. + * + * @since 2.0 + */ void SetScrollEnabled(bool enable); /* - * Checks whether the scroll is enabled or disabled. - * - * @since 2.0 - */ + * Checks whether the scroll is enabled or disabled. + * + * @since 2.0 + */ bool IsScrollEnabled(void) const; private: diff --git a/inc/FUiCtrlHeader.h b/inc/FUiCtrlHeader.h index cf8c5fd..0b63bc2 100644 --- a/inc/FUiCtrlHeader.h +++ b/inc/FUiCtrlHeader.h @@ -349,8 +349,9 @@ public: * * @return The selected item index, @n * else @c -1 if an error occurs - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported when the style of the %Header control is not @c HEADER_STYLE_SEGMENTED. + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is supported when the style of the %Header control is @c HEADER_STYLE_SEGMENTED, @n + * @c HEADER_STYLE_SEGMENTED_WITH_TITLE, @c HEADER_STYLE_TAB or @c HEADER_STYLE_TAB_WITH_TITLE. * @remarks The specific error code can be accessed using the GetLastResult() method. */ int GetSelectedItemIndex(void) const; @@ -635,15 +636,14 @@ public: * * @since 2.0 * - * @return An error code - * @param[in] itemIndex The item index - * @param[in] pBadgeIcon The bitmap for the icon - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n - * The index is greater than or equal to the number of elements or less than @c 0. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Header control is not @c HEADER_STYLE_SEGMENTED. - * @exception E_SYSTEM A system error has occurred. + * @return An error code + * @param[in] itemIndex The item index + * @param[in] pBadgeIcon The bitmap for the icon + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n + * The index is greater than or equal to the number of elements or less than @c 0. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TITLE. + * @exception E_SYSTEM A system error has occurred. */ result SetItemBadgeIcon(int itemIndex, const Tizen::Graphics::Bitmap* pBadgeIcon); @@ -660,8 +660,7 @@ public: * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999. * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure. @n * The index is greater than or equal to the number of elements or less than @c 0. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Header control is not @c HEADER_STYLE_SEGMENTED. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the style of the %Header control is @c HEADER_STYLE_TITLE. * @exception E_SYSTEM A system error has occurred. * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number. */ @@ -728,8 +727,8 @@ public: * The index is greater than or equal to the number of elements or less than @c 0. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n * The item at the specified index is disabled. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the %Header control style is @c HEADER_STYLE_TITLE. + * @exception E_UNSUPPORTED_OPERATION The operation is not supported when the %Header control style is @c HEADER_STYLE_TITLE, @n + * @c HEADER_STYLE_TITLE_BUTTON or @c HEADER_STYLE_BUTTON. * @exception E_SYSTEM A system error has occurred. */ result SetItemSelected(int itemIndex); @@ -770,8 +769,8 @@ public: * @param[in] pIcon The title icon to be set @n * Set to @c null to remove the title icon. * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation @n - * The style of the %Header control is not @c HEADER_STYLE_TITLE. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is @c HEADER_STYLE_TITLE, @n + * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE. * @exception E_SYSTEM A system error has occurred. */ result SetTitleIcon(const Tizen::Graphics::Bitmap* pIcon); @@ -785,9 +784,9 @@ public: * @return An error code * @param[in] text The text to be set * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n - * The style of the %Header control is not @c HEADER_STYLE_TITLE. - * @exception E_SYSTEM A system error has occurred. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style is @c HEADER_STYLE_TITLE, @n + * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE. + * @exception E_SYSTEM A system error has occurred. * @remarks If the text cannot be displayed in a line, then the ellipsis is applied at the end. @n * When the title icon is set along with the title text, the title retains the left alignment. */ @@ -802,8 +801,8 @@ public: * @return An error code * @param[in] color The title text color to be set * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION The current state of the instance does not support the execution of the specified operation. @n - * The style of the %Header control is not @c HEADER_STYLE_TITLE. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the %Header control style ist @c HEADER_STYLE_TITLE, @n + * @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE. * @exception E_SYSTEM A system error has occurred. */ result SetTitleTextColor(const Tizen::Graphics::Color& color); @@ -901,94 +900,136 @@ public: * @param[in] enable Set to @c true to enable the edit mode, @n * else @c false * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Header control style is not @c Header_STYLE_TAB. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control style is @c HEADER_STYLE_TAB @n + * or @c HEADER_STYLE_TAB_WITH_TITLE. */ result SetTabEditModeEnabled(bool enable); /** - * Sets the back button. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * There are more than 2 header items. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n - * The operation is not supported when the style of the %Header control is @c HEADER_STYLE_BUTTON. @n - * This device does not support the software back button. - * @remarks When the back button is pressed, OnFormBackRequested() of IFormBackEventListener is called. @n - * If the right button is already set, then the button is replaced with the back button. - */ + * Sets the back button. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * There are more than 2 header items. + * @exception E_UNSUPPORTED_OPERATION The operation is supported when the style of the %Header control is @c HEADER_STYLE_BUTTON. @n + * This device does not support the software back button. + * @remarks When the back button is pressed, OnFormBackRequested() of IFormBackEventListener is called. @n + * If the right button is already set, then the button is replaced with the back button. + */ result SetBackButton(void); /** - * Checks whether the back button item is set. - * - * @since 2.0 - * - * @return @c true if the back button item is set, @n - * else @c false - */ + * Checks whether the back button item is set. + * + * @since 2.0 + * + * @return @c true if the back button item is set, @n + * else @c false + */ bool IsBackButtonSet(void) const; /** - * Removes the back button item. - * - * @since 2.0 - * - */ + * Removes the back button item. + * + * @since 2.0 + * + */ void RemoveBackButton(void); /** - * Enables or disables the back button. - * - * @since 2.0 - * - * @return An error code - * @param[in] enable Set to @c true to enable the back button, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The back button item is not set. - */ + * Enables or disables the back button. + * + * @since 2.0 + * + * @return An error code + * @param[in] enable Set to @c true to enable the back button, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The back button item is not set. + */ result SetBackButtonEnabled(bool enable); /** - * Gets the state of the back button. - * - * @since 2.0 - * - * @return The state of the back button, @n - * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs. - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * The back button is not set. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Gets the state of the back button. + * + * @since 2.0 + * + * @return The state of the back button, @n + * else @c BUTTON_ITEM_STATUS_NORMAL if an error occurs. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The back button is not set. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ ButtonItemStatus GetBackButtonStatus(void) const; /** - * Gets the position and size of the specified button item. - * - * @since 2.0 - * - * @return The position and size of the button item at the specified position. - * @param[in] position The position of the button item - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n - * There is no button set at the specified position. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ + * Gets the position and size of the specified button item. + * + * @since 2.0 + * + * @return The position and size of the button item at the specified position. + * @param[in] position The position of the button item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * There is no button set at the specified position. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const; + /** + * Gets the position and size of the specified button item. + * + * @since 2.1 + * + * @return The position and size of the button item at the specified position. + * @param[in] position The position of the button item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * There is no button set at the specified position. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const; + + /** + * Sets the badge icon. + * + * @since 2.1 + * + * @return An error code + * @param[in] pBadgeIcon The bitmap for the badge icon + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION This operation is invalid. @n + * The operation is invalid when the style of the %Header control is not @c HEADER_STYLE_TITLE or @c HEADER_STYLE_SEGMENTED_WITH_TITLE or @c HEADER_STYLE_TAB_WITH_TITLE. + * @remarks For icon size details, see here. + */ + result SetTitleBadgeIcon(const Tizen::Graphics::Bitmap* pBadgeIcon); + + /** + * Sets the numbered badge icon. + * + * @since 2.1 + * + * @return An error code + * @param[in] number The number value that should be displayed as the badge icon + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999. + * @exception E_INVALID_OPERATION This operation is invalid. @n + * The operation is invalid when the style of the %Header control is not @c HEADER_STYLE_TITLE or @c HEADER_STYLE_SEGMENTED_WITH_TITLE TITLE or @c HEADER_STYLE_TAB_WITH_TITLE. + * @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number. + */ + result SetTitleNumberedBadgeIcon(int number); + protected: // diff --git a/inc/FUiCtrlHeaderItem.h b/inc/FUiCtrlHeaderItem.h index 5d2b625..531c115 100644 --- a/inc/FUiCtrlHeaderItem.h +++ b/inc/FUiCtrlHeaderItem.h @@ -72,7 +72,7 @@ public: /** * This is the destructor for this class. - * + * * @since 2.0 */ virtual ~HeaderItem(void); diff --git a/inc/FUiCtrlIEditTextFilter.h b/inc/FUiCtrlIEditTextFilter.h new file mode 100644 index 0000000..11753f7 --- /dev/null +++ b/inc/FUiCtrlIEditTextFilter.h @@ -0,0 +1,119 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrlIEditTextFilter.h + * @brief This is the header file for the %IEditTextFilter interface. + * + * This header file contains the declarations of the %IEditTextFilter interface. + * + */ +#ifndef _FUI_CTRL_IEDIT_TEXT_FILTER_H_ +#define _FUI_CTRL_IEDIT_TEXT_FILTER_H_ + +#include + +namespace Tizen {namespace Ui { namespace Controls +{ + +/** + * @interface IEditTextFilter + * @brief This interface defines the text filter. + * + * @since 2.1 + * + * The %IEditTextFilter interface is the listener interface for handling texts, for example, from EditFields. + * The class that processes a text event implements this interface, and the instance created with that class is registered with a + * UI control, using the control's SetEditTextFilter() method. + * + */ + +class _OSP_EXPORT_ IEditTextFilter +{ +public: + /** + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called + * when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IEditTextFilter(void) {} + + /** + * Checks whether the text to be pasted from the %Clipboard needs to be replaced by other text. + * + * @since 2.1 + * + * @return @c true if the pasted text needs to be replaced, @n + * else @c false + * @param[in] pastedText The pasted text + * @param[out] replacedText The user-defined replacement text + */ + virtual bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IEditTextFilter_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IEditTextFilter_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IEditTextFilter_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IEditTextFilter_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IEditTextFilter_Reserved5(void) {} +}; // IEditTextFilter + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_IEDIT_TEXT_FILTER_H_ + diff --git a/inc/FUiCtrlIFastScrollListener.h b/inc/FUiCtrlIFastScrollListener.h index 0890518..b57b6a6 100644 --- a/inc/FUiCtrlIFastScrollListener.h +++ b/inc/FUiCtrlIFastScrollListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -70,7 +70,7 @@ _OSP_EXPORT_ extern const wchar_t* const FAST_SCROLL_SEARCH_ICON_INDEX_STRING; * OnFastScrollIndexChanged() method of that instance is invoked. * * For more information on the class features, see ListViews. - * + */ class _OSP_EXPORT_ IFastScrollListener : public Tizen::Base::Runtime::IEventListener diff --git a/inc/FUiCtrlIFrameEventListener.h b/inc/FUiCtrlIFrameEventListener.h index 7ab468a..986b998 100644 --- a/inc/FUiCtrlIFrameEventListener.h +++ b/inc/FUiCtrlIFrameEventListener.h @@ -76,7 +76,7 @@ public: * * @param[in] source The source of the event */ - virtual void OnFrameActivated(const Tizen::Ui::Controls::Frame& source) { } + virtual void OnFrameActivated(const Tizen::Ui::Controls::Frame& source) {} /** * Called when a Frame instance is about to be deactivated. @n @@ -86,8 +86,27 @@ public: * * @param[in] source The source of the event */ - virtual void OnFrameDeactivated(const Tizen::Ui::Controls::Frame& source) { } + virtual void OnFrameDeactivated(const Tizen::Ui::Controls::Frame& source) {} + /* + * Called after a Frame instance is minimized. @n + * This method is called just after the system minimizes the %Frame instance of an application. + * + * @since 2.1 + * + * @param[in] source The source of the event + */ + virtual void OnFrameMinimized(const Tizen::Ui::Controls::Frame& source) {} + + /* + * Called after a Frame instance is restored. @n + * This method is called just after the system restores the %Frame instance of an application. + * + * @since 2.1 + * + * @param[in] source The source of the event + */ + virtual void OnFrameRestored(const Tizen::Ui::Controls::Frame& source) {} // Reserves protected: @@ -100,18 +119,7 @@ protected: // // @since 2.0 // - virtual void IFrameEventListener_Reserved1(void) { } - - // - //This method is for internal use only. Using this method can cause behavioral, security-related, - //and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without - // prior notice. - // - // @since 2.0 - // - virtual void IFrameEventListener_Reserved2(void) { } + virtual void IFrameEventListener_Reserved3(void) {} // //This method is for internal use only. Using this method can cause behavioral, security-related, @@ -122,7 +130,7 @@ protected: // // @since 2.0 // - virtual void IFrameEventListener_Reserved3(void) { } + virtual void IFrameEventListener_Reserved4(void) {} // //This method is for internal use only. Using this method can cause behavioral, security-related, @@ -133,19 +141,7 @@ protected: // // @since 2.0 // - virtual void IFrameEventListener_Reserved4(void) { } - - // - //This method is for internal use only. Using this method can cause behavioral, security-related, - //and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without - // prior notice. - // - // @since 2.0 - // - virtual void IFrameEventListener_Reserved5(void) { } - + virtual void IFrameEventListener_Reserved5(void) {} }; // IFrameEventListener }}} // Tizen::Ui::Controls diff --git a/inc/FUiCtrlIGroupedListViewItemProvider.h b/inc/FUiCtrlIGroupedListViewItemProvider.h index f0a5375..828f2d9 100644 --- a/inc/FUiCtrlIGroupedListViewItemProvider.h +++ b/inc/FUiCtrlIGroupedListViewItemProvider.h @@ -150,7 +150,6 @@ public: */ virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth) = 0; - /** * Checks whether the item can be reordered. * diff --git a/inc/FUiCtrlIGroupedListViewItemProviderF.h b/inc/FUiCtrlIGroupedListViewItemProviderF.h new file mode 100644 index 0000000..0439967 --- /dev/null +++ b/inc/FUiCtrlIGroupedListViewItemProviderF.h @@ -0,0 +1,175 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +/** + * @file FUiCtrlIGroupedListViewItemProviderF.h + * @brief This is the header file for the %IGroupedListViewItemProviderF interface. + * + * This header file contains the declarations of the %IGroupedListViewItemProviderF interface. @n + * If an event is generated, a method of this class is called. @n + * Therefore, if an application performs jobs related to the item events, it uses the methods of this class. + * + */ +#ifndef _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_PROVIDERF_H_ +#define _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_PROVIDERF_H_ + +#include +#include + +namespace Tizen {namespace Ui { namespace Controls +{ + +/** + * @interface IGroupedListViewItemProviderF + * @brief This interface implements the provider for the events generated by the GroupedListView control. + * + * @since 2.1 + * + * The %IGroupedListViewItemProviderF interface is the interface for handling GroupedListView items. + * The class that handles list items implements this interface, and the instance created using the GroupedListView's Construct() + * method. + * + * For more information on the class features, see ListViews. + */ +class _OSP_EXPORT_ IGroupedListViewItemProviderF +{ +// Operation +public: + /* + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called + * when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IGroupedListViewItemProviderF(void) {} + + /* + * Gets the total number of groups. + * + * @since 2.1 + * + * @return The total number of groups + * @remarks This method must be implemented so that it returns the total number of groups in the GroupedListView control. + */ + virtual int GetGroupCount(void) = 0; + + /* + * Gets the total number of items in the specified group. + * + * @since 2.1 + * + * @return The total number of items in the specified group + * @param[in] groupIndex The index of the group + * @remarks This method must be implemented so that it returns the total number of items for the specified group in the GroupedListView control. + */ + virtual int GetItemCount(int groupIndex) = 0; + + /* + * Creates the group item for the specified index from the item provider. + * + * @since 2.1 + * + * @return A group item of the GroupedListView control + * @param[in] groupIndex The index of the group + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedListView control must implement this method. This method is expected to return a group item that is + * allocated on a heap memory. @n + * Note that when the item is not required, the GroupedListView control calls %IGroupedListViewItemProvider::DeleteGroupItem() and the + * application deallocates the item. + */ + virtual Tizen::Ui::Controls::GroupItem* CreateGroupItem(int groupIndex, float itemWidth) = 0; + + /* + * Deletes the specified group item. + * + * @since 2.1 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] groupIndex The index of the group + * @param[in] pItem The pointer to GroupItem that is to be deleted + * @param[in] itemWidth The width of the item + * @remarks An application that uses the %GroupedListView control must implement this method. @n + * Using this method, an application can deallocate the item. @n + * If an application deallocates the item, this method must return true. This notifies the GroupedListView control not to release the + * item. Otherwise, the item is deallocated by the GroupedListView control. + * @see CreateItem() + */ + virtual bool DeleteGroupItem(int groupIndex, Tizen::Ui::Controls::GroupItem* pItem, float itemWidth) = 0; + + /* + * Creates the specified item. + * + * @since 2.1 + * + * @return An item of the list + * @param[in] groupIndex The index of the group + * @param[in] itemIndex The index of the item + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedListView control must implement this method. @n + * This method is expected to return an item that is allocated on a heap memory. @n + * The returned item can be a simple or custom item. @n + * Note that when the item is not required, the GroupedListView control calls %IGroupedListViewItemProvider::DeleteItem() and the application + * deallocates the item. + * @see DeleteItem() + */ + virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int groupIndex, int itemIndex, float itemWidth) = 0; + + /* + * Deletes the specified item. + * + * @since 2.1 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] groupIndex The index of the group + * @param[in] itemIndex The index of the item + * @param[in] pItem The pointer to ListItemBase that is to be deleted + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedListView control must implement this method. @n + * Using this method, an application can deallocate the item. @n + * If the application deallocates the item, this method must return true. This notifies the %GroupedListView control not to release the + * item. Otherwise, the item is deallocated by the %GroupedListView control. + * @see CreateItem() + */ + virtual bool DeleteItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::ListItemBase* pItem, float itemWidth) = 0; + + /* + * Checks whether the item can be reordered. + * + * @since 2.1 + * + * @return @c true if the item can be reordered, else @c false + * @param[in] groupIndexFrom The source group index of the item + * @param[in] groupIndexTo The target group index of the item + */ + virtual bool IsReorderable(int groupIndexFrom, int groupIndexTo); + +protected: + // + // Following methods are reserved and may change its name at any time without prior notice. + // + virtual void IGroupedListViewItemProvider_Reserved1(void) {} + virtual void IGroupedListViewItemProvider_Reserved2(void) {} + virtual void IGroupedListViewItemProvider_Reserved3(void) {} +}; // IGroupedListViewItemProviderF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_IGROUPED_LIST_VIEW_ITEM_PROVIDERF_H_ diff --git a/inc/FUiCtrlIGroupedTableViewItemEventListener.h b/inc/FUiCtrlIGroupedTableViewItemEventListener.h index f91fbf2..131926d 100644 --- a/inc/FUiCtrlIGroupedTableViewItemEventListener.h +++ b/inc/FUiCtrlIGroupedTableViewItemEventListener.h @@ -15,14 +15,14 @@ // limitations under the License. // /** - * @file FUiCtrlIGroupedTableViewItemEventListener.h - * @brief This is the header file for the %IGroupedTableViewItemEventListener interface. - * - * This header file contains the declarations of the %IGroupedTableViewItemEventListener interface. @n - * If an item event is generated, a method of this interface is called. - * So, if an application does some jobs related to the item event, use the methods of this interface. - * - */ +* @file FUiCtrlIGroupedTableViewItemEventListener.h +* @brief This is the header file for the %IGroupedTableViewItemEventListener interface. +* +* This header file contains the declarations of the %IGroupedTableViewItemEventListener interface. @n +* If an item event is generated, a method of this interface is called. +* So, if an application does some jobs related to the item event, use the methods of this interface. +* +*/ #ifndef _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_EVENT_LISTENER_H_ #define _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_EVENT_LISTENER_H_ @@ -37,67 +37,67 @@ class TableViewContextItem; /** - * @interface IGroupedTableViewItemEventListener - * @brief This interface implements the listener for item event. - * - * @since 2.0 - * - * The %IGroupedTableViewItemEventListener interface implements a listener for receiving item change events. - * The class that is interested in processing an item event implements this interface, - * and the instance created with that class is registered with a UI control, using the control's - * AddGroupedTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. - */ +* @interface IGroupedTableViewItemEventListener +* @brief This interface implements the listener for item event. +* +* @since 2.0 +* +* The %IGroupedTableViewItemEventListener interface implements a listener for receiving item change events. +* The class that is interested in processing an item event implements this interface, +* and the instance created with that class is registered with a UI control, using the control's +* AddGroupedTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. +*/ class _OSP_EXPORT_ IGroupedTableViewItemEventListener : virtual public Tizen::Base::Runtime::IEventListener { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~IGroupedTableViewItemEventListener(void) {} /** - * Called when the state of a TableViewGroupItem is changed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] groupIndex The group index - * @param[in] pItem The target item - * @param[in] status The status of the item - * @remarks This method is called when the TableViewGroupItem in the GroupedTableView is checked, unchecked, or selected. - */ + * Called when the state of a TableViewGroupItem is changed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] groupIndex The group index + * @param[in] pItem The target item + * @param[in] status The status of the item + * @remarks This method is called when the TableViewGroupItem in the GroupedTableView is checked, unchecked, or selected. + */ virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0; /** - * Called when the state of a TableViewItem in the GroupedTableView is changed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] pItem The target item - * @param[in] status The status of the item - * @remarks This method is called when the TableViewItem in the GroupedTableView is checked, unchecked, or selected. - */ + * Called when the state of a TableViewItem in the GroupedTableView is changed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pItem The target item + * @param[in] status The status of the item + * @remarks This method is called when the TableViewItem in the GroupedTableView is checked, unchecked, or selected. + */ virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0; /** - * Called when the TableViewContextItem is opened or closed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] pContextItem The context item which is opened or closed - * @param[in] activated @c true if a context item is opened,@n - * @c false, otherwise - */ + * Called when the TableViewContextItem is opened or closed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pContextItem The context item which is opened or closed + * @param[in] activated @c true if a context item is opened,@n + * @c false, otherwise + */ virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated) = 0; protected: diff --git a/inc/FUiCtrlIGroupedTableViewItemProvider.h b/inc/FUiCtrlIGroupedTableViewItemProvider.h index 58e8a5d..271c0dd 100644 --- a/inc/FUiCtrlIGroupedTableViewItemProvider.h +++ b/inc/FUiCtrlIGroupedTableViewItemProvider.h @@ -33,160 +33,160 @@ class TableViewItem; class TableViewGroupItem; /** - * @interface IGroupedTableViewItemProvider - * @brief This interface implements the listener for events on GroupedTableView. - * - * @since 2.0 - * - * The %IGroupedTableViewItemProvider interface implements an item provider which generates items for GroupedTableView. %GroupedTableView calls the item provider - * to request an item which is about to be displayed on a screen. Applications which use %GroupedTableView must implement the item provider. - * The class is registered with a %GroupedTableView, using the GroupedTableView's SetGroupedStyleItemProvider() method. - */ +* @interface IGroupedTableViewItemProvider +* @brief This interface implements the listener for events on GroupedTableView. +* +* @since 2.0 +* +* The %IGroupedTableViewItemProvider interface implements an item provider which generates items for GroupedTableView. %GroupedTableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %GroupedTableView must implement the item provider. +* The class is registered with a %GroupedTableView, using the GroupedTableView's SetGroupedStyleItemProvider() method. +*/ class _OSP_EXPORT_ IGroupedTableViewItemProvider { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~IGroupedTableViewItemProvider(void) {} /** - * Gets the total number of groups. - * - * @since 2.0 - * - * @return The total number of groups - * @remarks This method must be implemented so that it returns the total number of groups in the GroupedTableView control. - */ + * Gets the total number of groups. + * + * @since 2.0 + * + * @return The total number of groups + * @remarks This method must be implemented so that it returns the total number of groups in the GroupedTableView control. + */ virtual int GetGroupCount(void) = 0; /** - * Gets the total number of items in the specified group. - * - * @since 2.0 - * - * @return The total number of items in the specified group - * @param[in] groupIndex The index of the group - * @remarks This method must be implemented so that it returns the total number of items for the specified group in the GroupedTableView control. - */ + * Gets the total number of items in the specified group. + * + * @since 2.0 + * + * @return The total number of items in the specified group + * @param[in] groupIndex The index of the group + * @remarks This method must be implemented so that it returns the total number of items for the specified group in the GroupedTableView control. + */ virtual int GetItemCount(int groupIndex) = 0; /** - * Gets the group item for the specified index from the item provider. - * - * @since 2.0 - * - * @return A group item of the GroupedTableView control - * @param[in] groupIndex The index of the group - * @param[in] itemWidth The width of the item - * @remarks An application that uses the GroupedTableView control must implement this method. This method is expected to return a group item that is - * allocated on a heap memory. - * Note that when the group item is not required, the %GroupedTableView control calls IGroupedTableViewItemProvider::DeleteGroupItem() and the - * application deallocates the item. - */ + * Gets the group item for the specified index from the item provider. + * + * @since 2.0 + * + * @return A group item of the GroupedTableView control + * @param[in] groupIndex The index of the group + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedTableView control must implement this method. This method is expected to return a group item that is + * allocated on a heap memory. + * Note that when the group item is not required, the %GroupedTableView control calls IGroupedTableViewItemProvider::DeleteGroupItem() and the + * application deallocates the item. + */ virtual TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth) = 0; /** - * Deletes the specified group item. - * - * @since 2.0 - * - * @return @c true if the group item is deallocated by this method, - * else @c false - * @param[in] groupIndex The index of the group - * @param[in] pItem The pointer to TableViewGroupItem that is to be deleted - * @remarks An application that uses the GroupedTableView control must implement this method. - * Using this method, an application can deallocate the item. - * If an application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the - * item. Otherwise, the item is deallocated by the %GroupedTableView control. - * @see CreateGroupItem() - */ + * Deletes the specified group item. + * + * @since 2.0 + * + * @return @c true if the group item is deallocated by this method, + * else @c false + * @param[in] groupIndex The index of the group + * @param[in] pItem The pointer to TableViewGroupItem that is to be deleted + * @remarks An application that uses the GroupedTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If an application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the + * item. Otherwise, the item is deallocated by the %GroupedTableView control. + * @see CreateGroupItem() + */ virtual bool DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0; /** - * Updates the specified group item. - * - * @since 2.0 - * - * @param[in] groupIndex The group index - * @param[in] pItem The pointer to TableViewGroupItem that is to be updated - * @remarks An application that uses the GroupedTableView control must implement this method. - * This method is called when the modification of an group item is requested. - * The application can change @c pItem in this method, but should not keep @c pItem for later use. - */ + * Updates the specified group item. + * + * @since 2.0 + * + * @param[in] groupIndex The group index + * @param[in] pItem The pointer to TableViewGroupItem that is to be updated + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is called when the modification of an group item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ virtual void UpdateGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0; /** - * Creates the specified item. - * - * @since 2.0 - * - * @return An item of the GroupedTableView - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] itemWidth The width of the item - * @remarks An application that uses the GroupedTableView control must implement this method. - * This method is expected to return an item that is allocated on a heap memory. - * The returned item can be a simple or custom item. - * Note that when the item is not required, the %GroupedTableView control calls IGroupedTableViewItemProvider::DeleteItem() and the application - * deallocates the item. - * @see DeleteItem() - */ + * Creates the specified item. + * + * @since 2.0 + * + * @return An item of the GroupedTableView + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a simple or custom item. + * Note that when the item is not required, the %GroupedTableView control calls IGroupedTableViewItemProvider::DeleteItem() and the application + * deallocates the item. + * @see DeleteItem() + */ virtual TableViewItem* CreateItem(int groupIndex, int itemIndex, int itemWidth) = 0; /** - * Deletes the specified item. - * - * @since 2.0 - * - * @return @c true if the item is deallocated by this method, @n - * else @c false - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem that is to be deleted - * @remarks An application that uses the GroupedTableView control must implement this method. - * Using this method, an application can deallocate the item. - * If the application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the - * item. Otherwise, the item is deallocated by the %GroupedTableView control. - * @see CreateItem() - */ + * Deletes the specified item. + * + * @since 2.0 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be deleted + * @remarks An application that uses the GroupedTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the + * item. Otherwise, the item is deallocated by the %GroupedTableView control. + * @see CreateItem() + */ virtual bool DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0; /** - * Updates the specified item. - * - * @since 2.0 - * - * @param[in] groupIndex The group index - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem that is to be updated - * @remarks An application that uses the GroupedTableView control must implement this method. - * This method is calle when the modification of an item is requested. - * The application can change @c pItem in this method, but should not keep @c pItem for later use. - */ + * Updates the specified item. + * + * @since 2.0 + * + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be updated + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is calle when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ virtual void UpdateItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0; /** - * Gets the default height of an group item. - * - * @since 2.0 - * - * @return The default height of an group item - * @remarks This method must be implemented so that it returns the default height of group items in the GroupedTableView control. - */ + * Gets the default height of an group item. + * + * @since 2.0 + * + * @return The default height of an group item + * @remarks This method must be implemented so that it returns the default height of group items in the GroupedTableView control. + */ virtual int GetDefaultGroupItemHeight(void) = 0; /** - * Gets the default height of an item. - * - * @since 2.0 - * - * @return The default height of an item - * @remarks This method must be implemented so that it returns the default height of items in the GroupedTableView control. - */ + * Gets the default height of an item. + * + * @since 2.0 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the GroupedTableView control. + */ virtual int GetDefaultItemHeight(void) = 0; protected: diff --git a/inc/FUiCtrlIGroupedTableViewItemProviderF.h b/inc/FUiCtrlIGroupedTableViewItemProviderF.h new file mode 100644 index 0000000..884e1ad --- /dev/null +++ b/inc/FUiCtrlIGroupedTableViewItemProviderF.h @@ -0,0 +1,226 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +* @file FUiCtrlIGroupedTableViewItemProviderF.h +* @brief This is the header file for the %IGroupedTableViewItemProviderF interface. +* +* This header file contains the declarations of the %IGroupedTableViewItemProviderF interface. +* If the event is generated, a method of this interface is called. +* So, if applications do jobs related to item events, use the methods of this interface. +* +*/ +#ifndef _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_ +#define _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_ + +namespace Tizen { namespace Ui { namespace Controls +{ +class TableViewItem; +class TableViewGroupItem; + +/* +* @interface IGroupedTableViewItemProviderF +* @brief This interface implements the listener for events on GroupedTableView. +* +* @since 2.1 +* +* The %IGroupedTableViewItemProviderF interface implements an item provider which generates items for GroupedTableView. %GroupedTableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %GroupedTableView must implement the item provider. +* The class is registered with a %GroupedTableView, using the GroupedTableView's SetGroupedStyleItemProvider() method. +*/ +class _OSP_EXPORT_ IGroupedTableViewItemProviderF +{ +public: + /* + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IGroupedTableViewItemProviderF(void) {} + + /* + * Gets the total number of groups. + * + * @since 2.1 + * + * @return The total number of groups + * @remarks This method must be implemented so that it returns the total number of groups in the GroupedTableView control. + */ + virtual int GetGroupCount(void) = 0; + + /* + * Gets the total number of items in the specified group. + * + * @since 2.1 + * + * @return The total number of items in the specified group + * @param[in] groupIndex The index of the group + * @remarks This method must be implemented so that it returns the total number of items for the specified group in the GroupedTableView control. + */ + virtual int GetItemCount(int groupIndex) = 0; + + /* + * Gets the group item for the specified index from the item provider. + * + * @since 2.1 + * + * @return A group item of the GroupedTableView control + * @param[in] groupIndex The index of the group + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedTableView control must implement this method. This method is expected to return a group item that is + * allocated on a heap memory. + * Note that when the group item is not required, the %GroupedTableView control calls IGroupedTableViewItemProviderF::DeleteGroupItem() and the + * application deallocates the item. + */ + virtual TableViewGroupItem* CreateGroupItem(int groupIndex, float itemWidth) = 0; + + /* + * Deletes the specified group item. + * + * @since 2.1 + * + * @return @c true if the group item is deallocated by this method, + * else @c false + * @param[in] groupIndex The index of the group + * @param[in] pItem The pointer to TableViewGroupItem that is to be deleted + * @remarks An application that uses the GroupedTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If an application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the + * item. Otherwise, the item is deallocated by the %GroupedTableView control. + * @see CreateGroupItem() + */ + virtual bool DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0; + + /* + * Updates the specified group item. + * + * @since 2.1 + * + * @param[in] groupIndex The group index + * @param[in] pItem The pointer to TableViewGroupItem that is to be updated + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is called when the modification of an group item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ + virtual void UpdateGroupItem(int groupIndex, TableViewGroupItem* pItem) = 0; + + /* + * Creates the specified item. + * + * @since 2.1 + * + * @return An item of the GroupedTableView + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a simple or custom item. + * Note that when the item is not required, the %GroupedTableView control calls IGroupedTableViewItemProviderF::DeleteItem() and the application + * deallocates the item. + * @see DeleteItem() + */ + virtual TableViewItem* CreateItem(int groupIndex, int itemIndex, float itemWidth) = 0; + + /* + * Deletes the specified item. + * + * @since 2.1 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be deleted + * @remarks An application that uses the GroupedTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return @c true. This notifies the %GroupedTableView control not to release the + * item. Otherwise, the item is deallocated by the %GroupedTableView control. + * @see CreateItem() + */ + virtual bool DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0; + + /* + * Updates the specified item. + * + * @since 2.1 + * + * @param[in] groupIndex The group index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be updated + * @remarks An application that uses the GroupedTableView control must implement this method. + * This method is calle when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ + virtual void UpdateItem(int groupIndex, int itemIndex, TableViewItem* pItem) = 0; + + /* + * Gets the default height of an group item. + * + * @since 2.1 + * + * @return The default height of an group item + * @remarks This method must be implemented so that it returns the default height of group items in the GroupedTableView control. + */ + virtual float GetDefaultGroupItemHeight(void) = 0; + + + /* + * Gets the default height of an item. + * + * @since 2.1 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the GroupedTableView control. + */ + virtual float GetDefaultItemHeight(void) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void IGroupedTableViewItemProviderF_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void IGroupedTableViewItemProviderF_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void IGroupedTableViewItemProviderF_Reserved3(void) {} +}; // IGroupedTableViewItemProviderF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_IGROUPED_TABLE_VIEW_ITEM_PROVIDER_F_H_ \ No newline at end of file diff --git a/inc/FUiCtrlIIconListViewItemEventListener.h b/inc/FUiCtrlIIconListViewItemEventListener.h index b3e9be8..2b9d677 100644 --- a/inc/FUiCtrlIIconListViewItemEventListener.h +++ b/inc/FUiCtrlIIconListViewItemEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiCtrlIIconListViewItemProvider.h b/inc/FUiCtrlIIconListViewItemProvider.h index 1c7a343..d1884a3 100644 --- a/inc/FUiCtrlIIconListViewItemProvider.h +++ b/inc/FUiCtrlIIconListViewItemProvider.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiCtrlIListViewItemProviderF.h b/inc/FUiCtrlIListViewItemProviderF.h new file mode 100644 index 0000000..3fab075 --- /dev/null +++ b/inc/FUiCtrlIListViewItemProviderF.h @@ -0,0 +1,116 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrlIListViewItemProviderF.h + * @brief This is the header file for the %IListViewItemProviderF interface. + * + * This header file contains the declarations of the %IListViewItemProviderF interface. @n + * If the event is generated, a method of this interface is called. @n + * So, if applications do jobs related to item events, use the methods of this interface. + * + */ +#ifndef _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDERF_H_ +#define _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDERF_H_ + +#include + +namespace Tizen {namespace Ui { namespace Controls +{ + +/* + * @interface IListViewItemProviderF + * @brief This interface implements the listener for events on %ListView. + * + * @since 2.1 + * + * The %IListViewItemProviderF interface is the interface for handling ListView items. + * The class that handles list items implements this interface, and the instance created using the ListView's Construct() method. + * + * For more information on the class features, see ListViews. + */ +class _OSP_EXPORT_ IListViewItemProviderF +{ +// Operation +public: + /* + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called + * when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IListViewItemProviderF(void) {} + + /* + * Called when the ListView is about to be drawn and returns the number of total items. + * + * @since 2.1 + * + * @return The count of all items of the list + * @remarks This method must be implemented so that it returns the number of total items in the list. + * + */ + virtual int GetItemCount(void) = 0; + + /* + * Called when items need to be loaded. + * + * @since 2.1 + * + * @return An item of the ListView + * @param[in] index The index of the item + * @param[in] itemWidth The width of the item + * @remarks The applications that use ListView must implement this method. @n + * This method is expected to return an item which is allocated in a heap memory. @n + * The returned item can be a SimpleItem or CustomItem. @n + * Note that when the item becomes unnecessary, the ListView calls IListViewItemProvider::DeleteItem() and the application is in charge of + * deallocating the item. + * @see DeleteItem() + */ + virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, float itemWidth) = 0; + + /* + * Called when an item becomes no longer used by the %ListView. + * + * @since 2.1 + * + * @return @c true, if the item is deallocated by this method, @n + * else @c false + * @param[in] index The index of the item + * @param[in] pItem The pointer to the item to be deleted + * @param[in] itemWidth The width of the item + * @remarks Applications which use ListView must implement this method. @n + * In this method, the applications have the chance of deallocating the item. @n + * If the application deallocates the item, this method returns @c true, notifying the %ListView not to free the item. @n + * Otherwise, the item will be deallocated by %ListView. + * @see CreateItem() + */ + virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, float itemWidth) = 0; + +protected: + // + // Following methods are reserved and may change its name at any time without prior notice. + // + virtual void IListViewItemProvider_Reserved1(void) {} + virtual void IListViewItemProvider_Reserved2(void) {} + virtual void IListViewItemProvider_Reserved3(void) {} +}; // IListViewItemProviderF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_ILIST_VIEW_ITEM_PROVIDERF_H_ diff --git a/inc/FUiCtrlIProgressPopupEventListener.h b/inc/FUiCtrlIProgressPopupEventListener.h old mode 100644 new mode 100755 index 6fd376e..d24a199 --- a/inc/FUiCtrlIProgressPopupEventListener.h +++ b/inc/FUiCtrlIProgressPopupEventListener.h @@ -14,8 +14,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** - * @file FUiCtrlIProgressPopupEventListener.h + * @file FUiICtrlProgressPopupEventListener.h * @brief This is the header file for the %IProgressPopupEventListener interface. * * This header file contains the declarations of the %IProgressPopupEventListener interface. @n @@ -47,7 +48,7 @@ namespace Tizen { namespace Ui * implements this interface, and the instance created with that class is registered with a UI control, using the control's * AddProgressPopupEventListener() method. When the ProgressPopup event occurs, the OnProgressPopupCanceled() method of that instance is invoked. * - * For more information on the class features, see in individual control topics under UI Controls. + * For more information on the class features, see in individual control topics under UI Controls. */ class _OSP_EXPORT_ IProgressPopupEventListener : virtual public Tizen::Base::Runtime::IEventListener diff --git a/inc/FUiCtrlIScrollEventListener.h b/inc/FUiCtrlIScrollEventListener.h index bcc3cd5..02d15d0 100644 --- a/inc/FUiCtrlIScrollEventListener.h +++ b/inc/FUiCtrlIScrollEventListener.h @@ -39,7 +39,7 @@ namespace Tizen {namespace Ui { namespace Controls /** * @interface IScrollEventListener - * @brief This interface implements a listener for ScrollPanel events. + * @brief This interface implements a listener for scroll events. * * @since 2.0 * @@ -79,9 +79,9 @@ public: * @since 2.0 * *@param[in] source The control being scrolled - *@param[in] scrollPos The scrolled position + *@param[in] scrollPosition The scrolled position */ - virtual void OnScrollPositionChanged(Tizen::Ui::Control& source, int scrollPos) {}; + virtual void OnScrollPositionChanged(Tizen::Ui::Control& source, int scrollPosition) {}; /** * Called when the control's scroll movement has come to a stop. @@ -110,7 +110,6 @@ protected: virtual void ScrollEventListener_Reserved2(void) {} // - // // This method is for internal use only. // Using this method can cause behavioral, security-related, and consistency-related issues in the application. // diff --git a/inc/FUiCtrlIScrollEventListenerF.h b/inc/FUiCtrlIScrollEventListenerF.h new file mode 100644 index 0000000..21f79bc --- /dev/null +++ b/inc/FUiCtrlIScrollEventListenerF.h @@ -0,0 +1,125 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrlIScrollEventListenerF.h + * @brief This is the header file for the %IScrollEventListenerF interface. + * + * This header file contains the declarations of the %IScrollEventListenerF interface. @n + * If a change event is generated, a method of this interface is called. @n + * The applications that perform tasks related to the change events, call the methods of this interface. + * + */ +#ifndef _FUI_CTRL_ISCROLL_EVENT_LISTENER_F_H_ +#define _FUI_CTRL_ISCROLL_EVENT_LISTENER_F_H_ + +#include +#include + +namespace Tizen { namespace Ui +{ +class Control; +}} // Tizen::Ui + +namespace Tizen {namespace Ui { namespace Controls +{ + +/* + * @interface IScrollEventListenerF + * @brief This interface implements a listener for scroll events. + * + * @since 2.1 + * + * The %IScrollEventListenerF interface is the listener interface for receiving scroll events. + * The class that processes a scroll event implements this interface, and the instance created with that class is registered with + * a UI control, using the control's AddScrollEventListener() method. When the scroll event occurs, the OnScrollEndReached() + * method of that instance is invoked. + * + * For more information on the class features, see Panels and ListViews. + */ +class _OSP_EXPORT_ IScrollEventListenerF + : public Tizen::Base::Runtime::IEventListener +{ +// Operation +public: + /* + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + * + */ + virtual ~IScrollEventListenerF(void) {} + + /* + * Called when the scroll reaches the top, bottom, left or right end. + * + * @since 2.1 + * + * @param[in] source The source of the event + * @param[in] type The type of scroll end event + */ + virtual void OnScrollEndReached(Tizen::Ui::Control& source, Tizen::Ui::Controls::ScrollEndEvent type) = 0; + + /* + * Called continuously when the control is being scrolled. + * + * @since 2.1 + * + *@param[in] source The control being scrolled + *@param[in] scrollPosition The scrolled position + */ + virtual void OnScrollPositionChanged(Tizen::Ui::Control& source, float scrollPosition) = 0; + + /* + * Called when the control's scroll movement has come to a stop. + * + * @since 2.1 + * + * @param[in] source The control being scrolled + */ + virtual void OnScrollStopped(Tizen::Ui::Control& source) = 0; + +protected: + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void ScrollEventListener_Reserved1(void) {} + + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void ScrollEventListener_Reserved2(void) {} + + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void ScrollEventListener_Reserved3(void) {} + +}; // IScrollEventListenerF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_ISCROLL_EVENT_LISTENER_F_H_ diff --git a/inc/FUiCtrlISectionTableViewItemEventListener.h b/inc/FUiCtrlISectionTableViewItemEventListener.h index 46b41f7..88ee2bc 100644 --- a/inc/FUiCtrlISectionTableViewItemEventListener.h +++ b/inc/FUiCtrlISectionTableViewItemEventListener.h @@ -15,14 +15,14 @@ // limitations under the License. // /** - * @file FUiCtrlISectionTableViewItemEventListener.h - * @brief This is the header file for the %ISectionTableViewItemEventListener interface. - * - * This header file contains the declarations of the %ISectionTableViewItemEventListener interface. @n - * If an item event is generated, a method of this interface is called. - * So, if an application does some jobs related to the item event, use the methods of this interface. - * - */ +* @file FUiCtrlISectionTableViewItemEventListener.h +* @brief This is the header file for the %ISectionTableViewItemEventListener interface. +* +* This header file contains the declarations of the %ISectionTableViewItemEventListener interface. @n +* If an item event is generated, a method of this interface is called. +* So, if an application does some jobs related to the item event, use the methods of this interface. +* +*/ #ifndef _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_EVENT_LISTENER_H_ #define _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_EVENT_LISTENER_H_ @@ -36,53 +36,53 @@ class TableViewContextItem; /** - * @interface ISectionTableViewItemEventListener - * @brief This interface implements the listener for item event. - * - * @since 2.0 - * - * The %ISectionTableViewItemEventListener interface implements a listener for receiving item change events. - * The class that is interested in processing an item event implements this interface, - * and the instance created with that class is registered with a UI control, using the control's - * AddSectionTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. - */ +* @interface ISectionTableViewItemEventListener +* @brief This interface implements the listener for item event. +* +* @since 2.0 +* +* The %ISectionTableViewItemEventListener interface implements a listener for receiving item change events. +* The class that is interested in processing an item event implements this interface, +* and the instance created with that class is registered with a UI control, using the control's +* AddSectionTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. +*/ class _OSP_EXPORT_ ISectionTableViewItemEventListener : virtual public Tizen::Base::Runtime::IEventListener { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~ISectionTableViewItemEventListener(void) {} /** - * Called when the state of a TableViewItem in the SectionTableView is changed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] pItem The target item - * @param[in] status The status of the item - * @remarks This method is called when the TableViewItem in the SectionTableView is checked, unchecked, or selected. - */ + * Called when the state of a TableViewItem in the SectionTableView is changed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pItem The target item + * @param[in] status The status of the item + * @remarks This method is called when the TableViewItem in the SectionTableView is checked, unchecked, or selected. + */ virtual void OnSectionTableViewItemStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0; /** - * Called when the TableViewContextItem is opened or closed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] pContextItem The context item which is opened or closed - * @param[in] activated @c true if a context item is opened,@n - * @c false, otherwise - */ + * Called when the TableViewContextItem is opened or closed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pContextItem The context item which is opened or closed + * @param[in] activated @c true if a context item is opened,@n + * @c false, otherwise + */ virtual void OnSectionTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::SectionTableView& tableView, int sectionIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated) = 0; protected: diff --git a/inc/FUiCtrlISectionTableViewItemProvider.h b/inc/FUiCtrlISectionTableViewItemProvider.h index 29067b4..7e52ef9 100644 --- a/inc/FUiCtrlISectionTableViewItemProvider.h +++ b/inc/FUiCtrlISectionTableViewItemProvider.h @@ -16,14 +16,14 @@ // /** - * @file FUiCtrlISectionTableViewItemProvider.h - * @brief This is the header file for the %ISectionTableViewItemProvider interface. - * - * This header file contains the declarations of the %ISectionTableViewItemProvider interface. - * If the event is generated, a method of this interface is called. - * So, if applications do jobs related to item events, use the methods of this interface. - * - */ +* @file FUiCtrlISectionTableViewItemProvider.h +* @brief This is the header file for the %ISectionTableViewItemProvider interface. +* +* This header file contains the declarations of the %ISectionTableViewItemProvider interface. +* If the event is generated, a method of this interface is called. +* So, if applications do jobs related to item events, use the methods of this interface. +* +*/ #ifndef _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_H_ #define _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_H_ @@ -32,152 +32,152 @@ namespace Tizen { namespace Ui { namespace Controls class TableViewItem; /** - * @interface ISectionTableViewItemProvider - * @brief This interface implements the listener for events on SectionTableView. - * - * @since 2.0 - * - * The %ISectionTableViewItemProvider interface implements an item provider which generates items for SectionTableView. %SectionTableView calls the item provider - * to request an item which is about to be displayed on a screen. Applications which use %SectionTableView must implement the item provider. - * The class is registered with a %SectionTableView, using the SectionTableView's SetSectionStyleItemProvider() method. - */ +* @interface ISectionTableViewItemProvider +* @brief This interface implements the listener for events on SectionTableView. +* +* @since 2.0 +* +* The %ISectionTableViewItemProvider interface implements an item provider which generates items for SectionTableView. %SectionTableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %SectionTableView must implement the item provider. +* The class is registered with a %SectionTableView, using the SectionTableView's SetSectionStyleItemProvider() method. +*/ class _OSP_EXPORT_ ISectionTableViewItemProvider { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~ISectionTableViewItemProvider(void) {} /** - * Gets the total number of groups. - * - * @since 2.0 - * - * @return The total number of groups - * @remarks This method must be implemented so that it returns the total number of groups in the SectionTableView control. - */ + * Gets the total number of groups. + * + * @since 2.0 + * + * @return The total number of groups + * @remarks This method must be implemented so that it returns the total number of groups in the SectionTableView control. + */ virtual int GetSectionCount(void) = 0; /** - * Gets the total number of items in the specified group. - * - * @since 2.0 - * - * @return The total number of items in the specified group - * @param[in] sectionIndex The index of the section - * @remarks This method must be implemented so that it returns the total number of items for the specified section in the %SectionTableView control. - */ + * Gets the total number of items in the specified group. + * + * @since 2.0 + * + * @return The total number of items in the specified group + * @param[in] sectionIndex The index of the section + * @remarks This method must be implemented so that it returns the total number of items for the specified section in the %SectionTableView control. + */ virtual int GetItemCount(int sectionIndex) = 0; /** - * Creates the specified item. - * - * @since 2.0 - * - * @return An item of the SectionTableView - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] itemWidth The width of the item - * @remarks An application that uses the SectionTableView control must implement this method. - * This method is expected to return an item that is allocated on a heap memory. - * The returned item can be a simple or custom item. - * Note that when the item is not required, the %SectionTableView control calls ISectionTableViewItemProvider::DeleteItem() and the application - * deallocates the item. - * @see DeleteItem() - */ + * Creates the specified item. + * + * @since 2.0 + * + * @return An item of the SectionTableView + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the SectionTableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a simple or custom item. + * Note that when the item is not required, the %SectionTableView control calls ISectionTableViewItemProvider::DeleteItem() and the application + * deallocates the item. + * @see DeleteItem() + */ virtual TableViewItem* CreateItem(int sectionIndex, int itemIndex, int itemWidth) = 0; /** - * Deletes the specified item. - * - * @since 2.0 - * - * @return @c true if the item is deallocated by this method, @n - * else @c false - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem to be deleted - * @remarks An application that uses the SectionTableView control must implement this method. - * Using this method, an application can deallocate the item. - * If the application deallocates the item, this method must return true. This notifies the %SectionTableView control not to release the - * item. Otherwise, the item is deallocated by the %SectionTableView control. - * @see CreateItem() - */ + * Deletes the specified item. + * + * @since 2.0 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem to be deleted + * @remarks An application that uses the SectionTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return true. This notifies the %SectionTableView control not to release the + * item. Otherwise, the item is deallocated by the %SectionTableView control. + * @see CreateItem() + */ virtual bool DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0; /** - * Updates the specified item. - * - * @since 2.0 - * - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem to be updated - * @remarks An application that uses the SectionTableView control must implement this method. - * This method is calle when the modification of an item is requested. - * The application can change @c pItem in this method, but should not keep @c pItem for later use. - */ + * Updates the specified item. + * + * @since 2.0 + * + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem to be updated + * @remarks An application that uses the SectionTableView control must implement this method. + * This method is calle when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ virtual void UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0; /** - * Gets the header text of a specified section. - * - * @since 2.0 - * - * @return The section header text of specified section - * @param[in] sectionIndex The index of the group - * @remarks An application that uses the SectionTableView control must implement this method. @n - * The header text will be aligned left - */ + * Gets the header text of a specified section. + * + * @since 2.0 + * + * @return The section header text of specified section + * @param[in] sectionIndex The index of the group + * @remarks An application that uses the SectionTableView control must implement this method. @n + * The header text will be aligned left + */ virtual Tizen::Base::String GetSectionHeader(int sectionIndex) = 0; /** - * Returns whether the group has the section header or not. - * - * @since 2.0 - * - * @return @c true, if the section has an header @n - * @c false, otherwise - * @param[in] sectionIndex The index of the section - * @remarks An application that uses the SectionTableView control must implement this method. - */ + * Returns whether the group has the section header or not. + * + * @since 2.0 + * + * @return @c true, if the section has an header @n + * @c false, otherwise + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. + */ virtual bool HasSectionHeader(int sectionIndex) = 0; /** - * Gets the footer text of a specified section. - * - * @since 2.0 - * - * @return The footer text of specified section - * @param[in] sectionIndex The index of the section - * @remarks An application that uses the SectionTableView control must implement this method. @n - * The footer text will be aligned right. - */ + * Gets the footer text of a specified section. + * + * @since 2.0 + * + * @return The footer text of specified section + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. @n + * The footer text will be aligned right. + */ virtual Tizen::Base::String GetSectionFooter(int sectionIndex) = 0; /** - * Returns whether the section has the footer or not. - * - * @since 2.0 - * - * @return @c true, if the section has the footer @n - * @c false, - * @param[in] sectionIndex The index of the section - * @remarks An application that uses the SectionTableView control must implement this method. - */ + * Returns whether the section has the footer or not. + * + * @since 2.0 + * + * @return @c true, if the section has the footer @n + * @c false, + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. + */ virtual bool HasSectionFooter(int sectionIndex) = 0; /** - * Gets the default height of an item. - * - * @since 2.0 - * - * @return The default height of an item - * @remarks This method must be implemented so that it returns the default height of items in the SectionTableView control. - */ + * Gets the default height of an item. + * + * @since 2.0 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the SectionTableView control. + */ virtual int GetDefaultItemHeight(void) = 0; protected: diff --git a/inc/FUiCtrlISectionTableViewItemProviderF.h b/inc/FUiCtrlISectionTableViewItemProviderF.h new file mode 100644 index 0000000..508b0f9 --- /dev/null +++ b/inc/FUiCtrlISectionTableViewItemProviderF.h @@ -0,0 +1,217 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +* @file FUiCtrlISectionTableViewItemProviderF.h +* @brief This is the header file for the %ISectionTableViewItemProviderF interface. +* +* This header file contains the declarations of the %ISectionTableViewItemProviderF interface. +* If the event is generated, a method of this interface is called. +* So, if applications do jobs related to item events, use the methods of this interface. +* +*/ +#ifndef _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_ +#define _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_ + +namespace Tizen { namespace Ui { namespace Controls +{ +class TableViewItem; + +/* +* @interface ISectionTableViewItemProviderF +* @brief This interface implements the listener for events on SectionTableView. +* +* @since 2.1 +* +* The %ISectionTableViewItemProviderF interface implements an item provider which generates items for SectionTableView. %SectionTableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %SectionTableView must implement the item provider. +* The class is registered with a %SectionTableView, using the SectionTableView's SetSectionStyleItemProvider() method. +*/ +class _OSP_EXPORT_ ISectionTableViewItemProviderF +{ +public: + /* + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~ISectionTableViewItemProviderF(void) {} + + /* + * Gets the total number of groups. + * + * @since 2.1 + * + * @return The total number of groups + * @remarks This method must be implemented so that it returns the total number of groups in the SectionTableView control. + */ + virtual int GetSectionCount(void) = 0; + + /* + * Gets the total number of items in the specified group. + * + * @since 2.1 + * + * @return The total number of items in the specified group + * @param[in] sectionIndex The index of the section + * @remarks This method must be implemented so that it returns the total number of items for the specified section in the %SectionTableView control. + */ + virtual int GetItemCount(int sectionIndex) = 0; + + /* + * Creates the specified item. + * + * @since 2.1 + * + * @return An item of the SectionTableView + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the SectionTableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a simple or custom item. + * Note that when the item is not required, the %SectionTableView control calls ISectionTableViewItemProviderF::DeleteItem() and the application + * deallocates the item. + * @see DeleteItem() + */ + virtual TableViewItem* CreateItem(int sectionIndex, int itemIndex, float itemWidth) = 0; + + /* + * Deletes the specified item. + * + * @since 2.1 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem to be deleted + * @remarks An application that uses the SectionTableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return true. This notifies the %SectionTableView control not to release the + * item. Otherwise, the item is deallocated by the %SectionTableView control. + * @see CreateItem() + */ + virtual bool DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0; + + /* + * Updates the specified item. + * + * @since 2.1 + * + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem to be updated + * @remarks An application that uses the SectionTableView control must implement this method. + * This method is calle when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ + virtual void UpdateItem(int sectionIndex, int itemIndex, TableViewItem* pItem) = 0; + + /* + * Gets the header text of a specified section. + * + * @since 2.1 + * + * @return The section header text of specified section + * @param[in] sectionIndex The index of the group + * @remarks An application that uses the SectionTableView control must implement this method. @n + * The header text will be aligned left + */ + virtual Tizen::Base::String GetSectionHeader(int sectionIndex) = 0; + + /* + * Returns whether the group has the section header or not. + * + * @since 2.1 + * + * @return @c true, if the section has an header @n + * @c false, otherwise + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. + */ + virtual bool HasSectionHeader(int sectionIndex) = 0; + + /* + * Gets the footer text of a specified section. + * + * @since 2.1 + * + * @return The footer text of specified section + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. @n + * The footer text will be aligned right. + */ + virtual Tizen::Base::String GetSectionFooter(int sectionIndex) = 0; + + /* + * Returns whether the section has the footer or not. + * + * @since 2.1 + * + * @return @c true, if the section has the footer @n + * @c false, + * @param[in] sectionIndex The index of the section + * @remarks An application that uses the SectionTableView control must implement this method. + */ + virtual bool HasSectionFooter(int sectionIndex) = 0; + + /* + * Gets the default height of an item. + * + * @since 2.1 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the SectionTableView control. + */ + virtual float GetDefaultItemHeight(void) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ISectionTableViewItemProviderF_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ISectionTableViewItemProviderF_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ISectionTableViewItemProviderF_Reserved3(void) {} +}; // ISectionTableViewItemProviderF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_ISECTION_TABLE_VIEW_ITEM_PROVIDER_F_H_ \ No newline at end of file diff --git a/inc/FUiCtrlISliderEventListener.h b/inc/FUiCtrlISliderEventListener.h index a343014..618a795 100644 --- a/inc/FUiCtrlISliderEventListener.h +++ b/inc/FUiCtrlISliderEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlISliderEventListener.h * @brief This is the header file for the %ISliderEventListener interface. diff --git a/inc/FUiCtrlISplitPanelEventListener.h b/inc/FUiCtrlISplitPanelEventListener.h index 77b118c..5deb7c7 100644 --- a/inc/FUiCtrlISplitPanelEventListener.h +++ b/inc/FUiCtrlISplitPanelEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlISplitPanelEventListener.h * @brief This is the header file for the %ISplitPanelEventListener interface. diff --git a/inc/FUiCtrlISplitPanelEventListenerF.h b/inc/FUiCtrlISplitPanelEventListenerF.h new file mode 100644 index 0000000..eeaa144 --- /dev/null +++ b/inc/FUiCtrlISplitPanelEventListenerF.h @@ -0,0 +1,116 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrlISplitPanelEventListenerF.h + * @brief This is the header file for the %ISplitPanelEventListenerF interface. + * + * This header file contains the declarations of the %ISplitPanelEventListenerF interface. @n + * If a change event is generated, a method of this class is called. @n + * So, if the applications perform tasks related to change events, use the methods of this class. + * + */ +#ifndef _FUI_CTRL_ISPLIT_PANEL_EVENT_LISTENER_F_H_ +#define _FUI_CTRL_ISPLIT_PANEL_EVENT_LISTENER_F_H_ + +#include +#include +#include + +namespace Tizen { namespace Ui { namespace Controls +{ + +/** + * @interface ISplitPanelEventListenerF + * @brief This interface implements the listener for all splitpanel events. + * + * @since 2.1 + * + * The %ISplitPanelEventListenerF interface is the listener interface for receiving splitpanel events. + * The class that processes a splitpanel event implements this interface, and the instance created with that class is registered with + * a UI control, using the control's AddSplitPanelEventListener() method. When the splitpanel event occurs, a method of that instance is invoked. + * + * For more information on the class features, see SplitPanel. + */ +class _OSP_EXPORT_ ISplitPanelEventListenerF + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called + * + * @since 2.1 + */ + virtual ~ISplitPanelEventListenerF(void) {} + + /** + * + * Called when the divider moves. + * + * @since 2.1 + * + * @param[in] source The source of the event + * @param[in] position The position of the divider + */ + virtual void OnDividerPositionChanged(Tizen::Ui::Controls::SplitPanel& source, float position) = 0; + + /** + * Called when the divider is double pressed. + * + * @since 2.1 + * + * @param[in] source The source of the event + * @remark This method is invoked when an divider is double pressed. + */ + virtual void OnDividerDoublePressed(Tizen::Ui::Controls::SplitPanel& source) = 0; + +protected: + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void ISplitPanelEventListenerF_Reserved1(void) {} + + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void ISplitPanelEventListenerF_Reserved2(void) {} + + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + // @since 2.1 + // + virtual void ISplitPanelEventListenerF_Reserved3(void) {} + +}; // ISplitPanelEventListenerF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_ISPLIT_PANEL_EVENT_LISTENER_F_H_ diff --git a/inc/FUiCtrlITableViewItemEventListener.h b/inc/FUiCtrlITableViewItemEventListener.h index 2f3a0d6..f7251cb 100644 --- a/inc/FUiCtrlITableViewItemEventListener.h +++ b/inc/FUiCtrlITableViewItemEventListener.h @@ -15,14 +15,14 @@ // limitations under the License. // /** - * @file FUiCtrlITableViewItemEventListener.h - * @brief This is the header file for the %ITableViewItemEventListener interface. - * - * This header file contains the declarations of the %ITableViewItemEventListener interface. @n - * If an item event is generated, a method of this interface is called. - * So, if an application does some jobs related to the item event, use the methods of this interface. - * - */ +* @file FUiCtrlITableViewItemEventListener.h +* @brief This is the header file for the %ITableViewItemEventListener interface. +* +* This header file contains the declarations of the %ITableViewItemEventListener interface. @n +* If an item event is generated, a method of this interface is called. +* So, if an application does some jobs related to the item event, use the methods of this interface. +* +*/ #ifndef _FUI_CTRL_ITABLE_VIEW_ITEM_EVENT_LISTENER_H_ #define _FUI_CTRL_ITABLE_VIEW_ITEM_EVENT_LISTENER_H_ @@ -36,63 +36,63 @@ class TableViewItem; class TableViewContextItem; /** - * @interface ITableViewItemEventListener - * @brief This interface implements the listener for item event. - * - * @since 2.0 - * - * The %ITableViewItemEventListener interface implements a listener for receiving item change events. - * The class that is interested in processing an item event implements this interface, - * and the instance created with that class is registered with a UI control, using the control's - * AddTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. - */ +* @interface ITableViewItemEventListener +* @brief This interface implements the listener for item event. +* +* @since 2.0 +* +* The %ITableViewItemEventListener interface implements a listener for receiving item change events. +* The class that is interested in processing an item event implements this interface, +* and the instance created with that class is registered with a UI control, using the control's +* AddTableViewItemEventListener() method. When the item event occurs, the OnItemStateChanged() method of that object is invoked. +*/ class _OSP_EXPORT_ ITableViewItemEventListener : virtual public Tizen::Base::Runtime::IEventListener { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~ITableViewItemEventListener(void) {} /** - * Called when the state of a TableViewItem in the TableView is changed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] itemIndex The item index - * @param[in] pItem The target item - * @param[in] status The status of the item - * @remarks This method is called when a TableViewItem in the TableView is checked, unchecked, or selected. - * The application can change @c pItem in this method, but should not keep @c pItem for later use. - */ + * Called when the state of a TableViewItem in the TableView is changed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] itemIndex The item index + * @param[in] pItem The target item + * @param[in] status The status of the item + * @remarks This method is called when a TableViewItem in the TableView is checked, unchecked, or selected. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) = 0; /** - * Called when the TableViewContextItem is opened or closed. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] itemIndex The item index - * @param[in] pContextItem The context item which is opened or closed - * @param[in] activated @c true if a context item is opened,@n - * @c false, otherwise - */ + * Called when the TableViewContextItem is opened or closed. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] itemIndex The item index + * @param[in] pContextItem The context item which is opened or closed + * @param[in] activated @c true if a context item is opened,@n + * @c false, otherwise + */ virtual void OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated) = 0; /** - * Called when the item is reordered. - * - * @since 2.0 - * - * @param[in] tableView The source of the event - * @param[in] itemIndexFrom The start item index of the item - * @param[in] itemIndexTo The final item index of the item - */ + * Called when the item is reordered. + * + * @since 2.0 + * + * @param[in] tableView The source of the event + * @param[in] itemIndexFrom The start item index of the item + * @param[in] itemIndexTo The final item index of the item + */ virtual void OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo) = 0; protected: diff --git a/inc/FUiCtrlITableViewItemProvider.h b/inc/FUiCtrlITableViewItemProvider.h index 0bef40d..3901cde 100644 --- a/inc/FUiCtrlITableViewItemProvider.h +++ b/inc/FUiCtrlITableViewItemProvider.h @@ -16,14 +16,14 @@ // /** - * @file FUiCtrlITableViewItemProvider.h - * @brief This is the header file for the %ITableViewItemProvider interface. - * - * This header file contains the declarations of the %ITableViewItemProvider interface. - * If the event is generated, a method of this interface is called. - * So, if applications do jobs related to item events, use the methods of this interface. - * - */ +* @file FUiCtrlITableViewItemProvider.h +* @brief This is the header file for the %ITableViewItemProvider interface. +* +* This header file contains the declarations of the %ITableViewItemProvider interface. +* If the event is generated, a method of this interface is called. +* So, if applications do jobs related to item events, use the methods of this interface. +* +*/ #ifndef _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_ #define _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_H_ @@ -33,89 +33,89 @@ namespace Tizen { namespace Ui { namespace Controls class TableViewItem; /** - * @interface ITableViewItemProvider - * @brief This interface implements the listener for events on TableView. - * - * @since 2.0 - * - * The %ITableViewItemProvider interface implements an item provider which generates items for TableView. %TableView calls the item provider - * to request an item which is about to be displayed on a screen. Applications which use %TableView must implement the item provider. - * The class is registered with a %TableView, using the TableView's SetSimpleStyleItemProvider() method. - */ +* @interface ITableViewItemProvider +* @brief This interface implements the listener for events on TableView. +* +* @since 2.0 +* +* The %ITableViewItemProvider interface implements an item provider which generates items for TableView. %TableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %TableView must implement the item provider. +* The class is registered with a %TableView, using the TableView's SetSimpleStyleItemProvider() method. +*/ class _OSP_EXPORT_ ITableViewItemProvider { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~ITableViewItemProvider(void) {} /** - * Gets the total number of items in the specified group. - * - * @since 2.0 - * - * @return The total number of items - * @remarks This method must be implemented so that it returns the total number of items for the specified group in the TableView control. - */ + * Gets the total number of items in the specified group. + * + * @since 2.0 + * + * @return The total number of items + * @remarks This method must be implemented so that it returns the total number of items for the specified group in the TableView control. + */ virtual int GetItemCount(void) = 0; /** - * Creates the specified item. - * - * @since 2.0 - * - * @return An item of the TableView - * @param[in] itemIndex The item index - * @param[in] itemWidth The width of the item - * @remarks An application that uses the TableView control must implement this method. - * This method is expected to return an item that is allocated on a heap memory. - * The returned item can be a %TableViewItem or a class derived from TableViewItem. - * Note that when the item is not required, the %TableView control calls ITableViewItemProvider::DeleteItem(), allowing the application to deallocate the item. - * @see DeleteItem() - */ + * Creates the specified item. + * + * @since 2.0 + * + * @return An item of the TableView + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the TableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a %TableViewItem or a class derived from TableViewItem. + * Note that when the item is not required, the %TableView control calls ITableViewItemProvider::DeleteItem(), allowing the application to deallocate the item. + * @see DeleteItem() + */ virtual TableViewItem* CreateItem(int itemIndex, int itemWidth) = 0; /** - * Deletes the specified item. - * - * @since 2.0 - * - * @return @c true if the item is deallocated by this method, @n - * else @c false - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem that is to be deleted - * @remarks An application that uses the TableView control must implement this method. - * Using this method, an application can deallocate the item. - * If the application deallocates the item, this method must return @c true. This notifies the %TableView not to release the - * item. Otherwise, the item is deallocated by the %TableView. - * @see CreateItem() - */ + * Deletes the specified item. + * + * @since 2.0 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be deleted + * @remarks An application that uses the TableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return @c true. This notifies the %TableView not to release the + * item. Otherwise, the item is deallocated by the %TableView. + * @see CreateItem() + */ virtual bool DeleteItem(int itemIndex, TableViewItem* pItem) = 0; /** - * Updates the specified item. - * - * @since 2.0 - * - * @param[in] itemIndex The item index - * @param[in] pItem The pointer to TableViewItem that is to be updated - * @remarks An application that uses the TableView control must implement this method. - * This method is called when the modification of an item is requested. - * The application can change @c pItem in this method, but should not keep @c pItem for later use. - */ + * Updates the specified item. + * + * @since 2.0 + * + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be updated + * @remarks An application that uses the TableView control must implement this method. + * This method is called when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ virtual void UpdateItem(int itemIndex, TableViewItem* pItem) = 0; /** - * Gets the default height of an item. - * - * @since 2.0 - * - * @return The default height of an item - * @remarks This method must be implemented so that it returns the default height of items in the TableView control. - */ + * Gets the default height of an item. + * + * @since 2.0 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the TableView control. + */ virtual int GetDefaultItemHeight(void) = 0; protected: diff --git a/inc/FUiCtrlITableViewItemProviderF.h b/inc/FUiCtrlITableViewItemProviderF.h new file mode 100644 index 0000000..b43d864 --- /dev/null +++ b/inc/FUiCtrlITableViewItemProviderF.h @@ -0,0 +1,155 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +* @file FUiCtrlITableViewItemProviderF.h +* @brief This is the header file for the %ITableViewItemProviderF interface. +* +* This header file contains the declarations of the %ITableViewItemProviderF interface. +* If the event is generated, a method of this interface is called. +* So, if applications do jobs related to item events, use the methods of this interface. +* +*/ + +#ifndef _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_F_H_ +#define _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_F_H_ + +namespace Tizen { namespace Ui { namespace Controls +{ +class TableViewItem; + +/* +* @interface ITableViewItemProviderF +* @brief This interface implements the listener for events on TableView. +* +* @since 2.1 +* +* The %ITableViewItemProviderF interface implements an item provider which generates items for TableView. %TableView calls the item provider +* to request an item which is about to be displayed on a screen. Applications which use %TableView must implement the item provider. +* The class is registered with a %TableView, using the TableView's SetSimpleStyleItemProvider() method. +*/ +class _OSP_EXPORT_ ITableViewItemProviderF +{ +public: + /* + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~ITableViewItemProviderF(void) {} + + /* + * Gets the total number of items in the specified group. + * + * @since 2.1 + * + * @return The total number of items + * @remarks This method must be implemented so that it returns the total number of items for the specified group in the TableView control. + */ + virtual int GetItemCount(void) = 0; + + /* + * Creates the specified item. + * + * @since 2.1 + * + * @return An item of the TableView + * @param[in] itemIndex The item index + * @param[in] itemWidth The width of the item + * @remarks An application that uses the TableView control must implement this method. + * This method is expected to return an item that is allocated on a heap memory. + * The returned item can be a %TableViewItem or a class derived from TableViewItem. + * Note that when the item is not required, the %TableView control calls ITableViewItemProvider::DeleteItem(), allowing the application to deallocate the item. + * @see DeleteItem() + */ + virtual TableViewItem* CreateItem(int itemIndex, float itemWidth) = 0; + + /* + * Deletes the specified item. + * + * @since 2.1 + * + * @return @c true if the item is deallocated by this method, @n + * else @c false + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be deleted + * @remarks An application that uses the TableView control must implement this method. + * Using this method, an application can deallocate the item. + * If the application deallocates the item, this method must return @c true. This notifies the %TableView not to release the + * item. Otherwise, the item is deallocated by the %TableView. + * @see CreateItem() + */ + virtual bool DeleteItem(int itemIndex, TableViewItem* pItem) = 0; + + /* + * Updates the specified item. + * + * @since 2.1 + * + * @param[in] itemIndex The item index + * @param[in] pItem The pointer to TableViewItem that is to be updated + * @remarks An application that uses the TableView control must implement this method. + * This method is called when the modification of an item is requested. + * The application can change @c pItem in this method, but should not keep @c pItem for later use. + */ + virtual void UpdateItem(int itemIndex, TableViewItem* pItem) = 0; + + /* + * Gets the default height of an item. + * + * @since 2.1 + * + * @return The default height of an item + * @remarks This method must be implemented so that it returns the default height of items in the TableView control. + */ + virtual float GetDefaultItemHeight(void) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ITableViewItemProviderF_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ITableViewItemProviderF_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // The following method is reserved, and its name can be changed at any time without prior notice. + // + // @since 2.1 + // + virtual void ITableViewItemProviderF_Reserved3(void) {} +}; // ITableViewItemProviderF + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_ITABLE_VIEW_ITEM_PROVIDER_F_H_ \ No newline at end of file diff --git a/inc/FUiCtrlITokenFilter.h b/inc/FUiCtrlITokenFilter.h index 69da6db..fb48fa7 100644 --- a/inc/FUiCtrlITokenFilter.h +++ b/inc/FUiCtrlITokenFilter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlITokenFilter.h * @brief This is the header file for the %ITokenFilter interface. diff --git a/inc/FUiCtrlIconList.h b/inc/FUiCtrlIconList.h old mode 100644 new mode 100755 diff --git a/inc/FUiCtrlIconListTypes.h b/inc/FUiCtrlIconListTypes.h index 63ece76..9b3ebce 100644 --- a/inc/FUiCtrlIconListTypes.h +++ b/inc/FUiCtrlIconListTypes.h @@ -48,7 +48,7 @@ enum IconListStyle }; /** - * @if OSPDEPREC + * if OSPDEPREC * @enum IconListCheckBoxPosition * * Defines the check-box position. diff --git a/inc/FUiCtrlIconListView.h b/inc/FUiCtrlIconListView.h index 86d55f5..3ddd013 100644 --- a/inc/FUiCtrlIconListView.h +++ b/inc/FUiCtrlIconListView.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -26,22 +26,17 @@ #define _FUI_CTRL_ICON_LIST_VIEW_H_ //Includes -#include -#include -#include -#include -#include -#include +#include #include #include -#include #include #include -#include #include #include #include +#include #include +#include namespace Tizen { namespace Ui { namespace Controls { @@ -247,8 +242,7 @@ public: * * @return An error code * @param[in] rect An instance of the Graphics::Rectangle class @n - * This instance represents the x and y coordinates of the top-left corner of the created %IconListView along with - * the width and height. + * This instance represents the x and y coordinates of the top-left corner of the created %IconListView along with the width and height. * @param[in] itemBitmapSize The size of an icon in the %IconListView * @param[in] style The style set of %IconListView * @param[in] direction The direction of scroll @@ -263,6 +257,28 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, const Tizen::Graphics::Dimension& itemBitmapSize, IconListViewStyle style = ICON_LIST_VIEW_STYLE_NORMAL, IconListViewScrollDirection direction = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL, IconListViewScrollStyle scrollStyle = ICON_LIST_SCROLL_STYLE_FADE_OUT); + /* + * Initializes this instance of %IconListView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created %IconListView along with the width and height. + * @param[in] itemBitmapSize The size of an icon in the %IconListView + * @param[in] style The style set of %IconListView + * @param[in] direction The direction of scroll + * @param[in] scrollStyle The scroll style of %IconListView + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier. + * @remarks The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and margins. @n + * The %IconListView cannot display more than 256 items on the screen at once. + * @remarks The actual size of bitmap to be displayed in %IconListView is smaller than the specified size when the border style is ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, const Tizen::Graphics::FloatDimension& itemBitmapSize, IconListViewStyle style = ICON_LIST_VIEW_STYLE_NORMAL, IconListViewScrollDirection direction = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL, IconListViewScrollStyle scrollStyle = ICON_LIST_SCROLL_STYLE_FADE_OUT); + /** * Sets the item provider that creates and deletes items for the %IconListView control. * @@ -310,6 +326,18 @@ public: void AddScrollEventListener(IScrollEventListener& listener); /** + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the context of the given event dispatcher when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be added + * @see IScrollEventListenerF::OnScrollEndReached() + * @see RemoveScrollEventListener() + */ + void AddScrollEventListener(IScrollEventListenerF& listener); + + /** * Removes a listener instance that listens to state changes of a scroll event. @n * The removed listener cannot listen to events when they are fired. * @@ -322,6 +350,18 @@ public: void RemoveScrollEventListener(IScrollEventListener& listener); /** + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be removed + * @see IScrollEventListenerF::OnScrollEndReached() + * @see RemoveScrollEventListener() + */ + void RemoveScrollEventListener(IScrollEventListenerF& listener); + + /** * Sets the background bitmap of the %IconListView. * * @since 2.0 @@ -375,6 +415,22 @@ public: */ result SetMargin(MarginType type, int value); + /* + * Sets the margin of %IconListView. + * + * @since 2.1 + * + * @return An error code + * @param[in] type The type of margin + * @param[in] value The marginal value + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and + * margins. The %IconListView cannot display more than 256 items on screen at once. + */ + result SetMargin(MarginType type, float value); + /** * Gets the margin of %IconListView. * @@ -386,6 +442,17 @@ public: */ int GetMargin(MarginType type) const; + /* + * Gets the margin of %IconListView. + * + * @since 2.1 + * + * @return The marginal value of %IconListView, @n + * else @c -1 if an error occurs + * @param[in] type The type of margin + */ + float GetMarginF(MarginType type) const; + /** * Sets the horizontal and vertical spacing between the items. * @@ -402,6 +469,22 @@ public: */ result SetItemSpacing(int horizontalSpacing, int verticalSpacing); + /* + * Sets the horizontal and vertical spacing between the items. + * + * @since 2.1 + * + * @return An error code + * @param[in] horizontalSpacing The spacing between items in horizontal direction + * @param[in] verticalSpacing The spacing between items in vertical direction + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks The number of items to be displayed on a screen is calculated based on %IconListView size, item size, item spacing, and + * margins. The %IconListView cannot display more than 256 items on screen at once. + */ + result SetItemSpacing(float horizontalSpacing, float verticalSpacing); + /** * Gets the horizontal spacing between items of %IconListView. * @@ -413,6 +496,16 @@ public: int GetItemHorizontalSpacing(void) const; /** + * Gets the horizontal spacing between items of %IconListView. + * + * @since 2.1 + * + * @return The value of space between items in horizontal direction, @n + * else @c -1 if an error occurs + */ + float GetItemHorizontalSpacingF(void) const; + + /** * Gets the vertical spacing between items of %IconListView. * * @since 2.0 @@ -422,6 +515,16 @@ public: */ int GetItemVerticalSpacing(void) const; + /* + * Gets the vertical spacing between items of %IconListView. + * + * @since 2.1 + * + * @return The value of space between items in vertical direction, @n + * else @c -1 if an error occurs + */ + float GetItemVerticalSpacingF(void) const; + /** * Sets the checked status of the specified item of %IconListView. * @@ -435,6 +538,7 @@ public: * @exception E_OUT_OF_RANGE The specified @c index is out of range. * @remarks This method can only be used when the style of the list allows selection. * @remarks The method only changes the state of the list item. %IconListView needs to be redrawn to reflect the change on the screen. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the IconListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result SetItemChecked(int index, bool check); @@ -447,6 +551,7 @@ public: * else @c false * @param[in] index The index of the item * @remarks This method can only be used when the style of the list allows selection. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the IconListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemChecked(int index) const; @@ -462,6 +567,18 @@ public: */ int GetItemIndexFromPosition(int x, int y) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return The index of the item, @n + * else @c -1 when there is no list item at the specified position or when the %IconListView instance is invalid + * @param[in] x The x position of a point + * @param[in] y The y position of a point + */ + int GetItemIndexFromPosition(float x, float y) const; + /** * Gets the index of the item at the specified position. * @@ -473,6 +590,17 @@ public: */ int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return The index of the item, @n + * else @c -1 if there is no list item at the specified position or when the %IconListView instance is invalid + * @param[in] position The position of a point + */ + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; + /** * Sets the horizontal alignment of the text of an item. * @@ -600,16 +728,38 @@ public: result SetItemTextSize(int size); /** + * Sets the size of the text of the %IconListView control. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The size of the text + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks If the specified @c size is less than the minimum size, this method fails. The minimum font size is @c 6 on devices of high screen density. + */ + result SetItemTextSize(float size); + + /** * Gets the size of the text of the %IconListView control. * * @since 2.0 * - * @return The size of the text of the %IconListView control, @n - * else @c -1 if the instance is invalid + * @return The size of the text of the %IconListView control, else @c -1 if the instance is invalid */ int GetItemTextSize(void) const; /** + * Gets the size of the text of the %IconListView control. + * + * @since 2.1 + * + * @return The size of the text of the %IconListView control, else @c -1.0f if the instance is invalid + */ + float GetItemTextSizeF(void) const; + + /** * Sets the position of the checkbox of the %IconListView control. * * @since 2.0 @@ -672,9 +822,38 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. * @exception E_OUT_OF_RANGE The specified @c index is out of range. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the IconListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ScrollToItem(int index); + /* + * Scrolls the list contents with the amount of pixels. + * + * @since 2.0 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ + result ScrollByPixel(int pixel); + + /* + * Scrolls the list contents with the amount of pixels. + * + * @since 2.1 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ + result ScrollByPixel(float pixel); + /** * Refreshes the specified item of %IconListView. * @@ -716,6 +895,19 @@ public: */ result GetItemBitmapSize(int& width, int& height) const; + /* + * Gets the size of bitmap of the item. + * + * @since 2.1 + * + * @return An error code + * @param[out] width The width of bitmap of the item + * @param[out] height The height of bitmap of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + */ + result GetItemBitmapSize(float& width, float& height) const; + /** * Gets the size of bitmap of the item. * @@ -726,6 +918,16 @@ public: */ Tizen::Graphics::Dimension GetItemBitmapSize(void) const; + /* + * Gets the size of bitmap of the item. + * + * @since 2.1 + * + * @return The size of bitmap of the item, @n + * else (-1, -1) if the instance is invalid + */ + Tizen::Graphics::FloatDimension GetItemBitmapSizeF(void) const; + /** * Gets the size of the item. * @@ -739,6 +941,19 @@ public: */ result GetItemSize(int& width, int& height) const; + /* + * Gets the size of the item. + * + * @since 2.1 + * + * @return An error code + * @param[out] width The width of the item + * @param[out] height The height of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + */ + result GetItemSize(float& width, float& height) const; + /** * Gets the size of the item. * @@ -749,6 +964,16 @@ public: */ Tizen::Graphics::Dimension GetItemSize(void) const; + /* + * Gets the size of the item. + * + * @since 2.1 + * + * @return The size of the item, @n + * else (-1, -1) if the instance is invalid + */ + Tizen::Graphics::FloatDimension GetItemSizeF(void) const; + /** * Sets the number of item lines to be scrolled for the magnetic scroll of %IconListView. * @@ -899,24 +1124,43 @@ public: */ bool IsInReorderingMode(void) const; + /** + * Sets the scroll input handling mode. + * + * @since 2.1 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ + void SetScrollInputMode(ScrollInputMode mode); + + /** + * Gets the scroll input handling mode. + * + * @since 2.1 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ + ScrollInputMode GetScrollInputMode(void) const; + public: friend class _IconListViewImpl; private: - // - // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // - // @since 2.0 - // + /** + * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ IconListView(const IconListView& rhs); - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // - // @since 2.0 - // + /** + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.0 + */ IconListView& operator =(const IconListView& rhs); - }; // IconListView }}} // Tizen::Ui::Controls diff --git a/inc/FUiCtrlIconListViewItem.h b/inc/FUiCtrlIconListViewItem.h index 01d13f2..bf308de 100644 --- a/inc/FUiCtrlIconListViewItem.h +++ b/inc/FUiCtrlIconListViewItem.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiCtrlIconListViewTypes.h b/inc/FUiCtrlIconListViewTypes.h index daf5405..b13004a 100644 --- a/inc/FUiCtrlIconListViewTypes.h +++ b/inc/FUiCtrlIconListViewTypes.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiCtrlInputTypes.h b/inc/FUiCtrlInputTypes.h old mode 100644 new mode 100755 diff --git a/inc/FUiCtrlKeypad.h b/inc/FUiCtrlKeypad.h old mode 100644 new mode 100755 index 347c9cc..9f6376c --- a/inc/FUiCtrlKeypad.h +++ b/inc/FUiCtrlKeypad.h @@ -14,18 +14,20 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** - * @file FUiCtrlKeypad.h - * @brief This is the header file for the %Keypad class. - * - * This header file contains the declarations of the %Keypad class. - */ +* @file FUiCtrlKeypad.h +* @brief This is the header file for the %Keypad class. +* +* This header file contains the declarations of the %Keypad class. +*/ #ifndef _FUI_CTRL_KEYPAD_H_ #define _FUI_CTRL_KEYPAD_H_ #include #include +#include #include #include @@ -33,38 +35,38 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @if OSPDEPREC - * @enum KeypadInputModeCategory - * - * Defines the keypad input mode. - * - * @brief [Deprecated] - * @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n - * or the current mode to initially set the keypad to, from this list. It is recommended to use the styles offered KeypadStyle enumeration instead. - * @since 2.0 - * @endif - */ +* @if OSPDEPREC +* @enum KeypadInputModeCategory +* +* Defines the keypad input mode. +* +* @brief [Deprecated] +* @deprecated We no longer provide a method to specify the list of styles which the user can set the keypad to, @n +* or the current mode to initially set the keypad to, from this list. It is recommended to use the styles offered KeypadStyle enumeration instead. +* @since 2.0 +* @endif +*/ enum KeypadInputModeCategory { KEYPAD_MODE_ALPHA = 0x0001, /**< @if OSPDEPREC The alphabetic input mode @endif */ - KEYPAD_MODE_PREDICTIVE = 0x0002, /**< @if OSPDEPREC The predictive input mode @endif*/ + KEYPAD_MODE_PREDICTIVE = 0x0002, /**< @if OSPDEPREC The predictive input mode @endif */ KEYPAD_MODE_NUMERIC = 0x0004, /**< @if OSPDEPREC The numeric input mode @endif */ KEYPAD_MODE_SYMBOL = 0x0008 /**< @if OSPDEPREC The symbolic input mode @endif */ }; /** - * @class Keypad - * @brief This class displays a keypad on top of the screen. - * - * @since 2.0 - * - * The %Keypad class displays the full screen keypad without using an EditField or EditArea. - * - * For more information on the class features, see Keypad. - * - * The following example demonstrates how to use the %Keypad class. - * - * @code +* @class Keypad +* @brief This class displays a keypad on top of the screen. +* +* @since 2.0 +* +* The %Keypad class displays the full screen keypad without using an EditField or EditArea. +* +* For more information on the class features, see Keypad. +* +* The following example demonstrates how to use the %Keypad class. +* +* @code // Sample code for KeypadSample.h #include @@ -155,7 +157,7 @@ KeypadSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the keypad - delete __pKeypad; + __pKeypad->Destroy(); return r; } @@ -189,8 +191,8 @@ KeypadSample::OnTextValueChangeCanceled(const Tizen::Ui::Control& source) { // .... } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ Keypad : public Tizen::Ui::Window @@ -252,26 +254,26 @@ public: result Construct(KeypadStyle keypadStyle, KeypadInputModeCategory category, int limitLength = 100); /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @see SetTextPredictionEnabled() - */ + * Checks whether the text prediction is enabled. + * + * @since 2.0 + * @return @c true if the text prediction is enabled, @n + * else @c false + * @see SetTextPredictionEnabled() + */ bool IsTextPredictionEnabled(void) const; /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. - * @see IsTextPredictionEnabled() - */ + * Enables or disables the text prediction. + * + * @since 2.0 + * @param[in] enable Set to @c true to enable the text prediction, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is not supported. + * @see IsTextPredictionEnabled() + */ result SetTextPredictionEnabled(bool enable); /** @@ -340,6 +342,27 @@ public: */ void SetText(Tizen::Base::String text); + /** + * Sets the text filter. + * + * @since 2.1 + * + * @param[in] pFilter The filter + * @remarks The %Keypad control checks with the registered filter to decide whether the user-entered text should be replaced. + */ + void SetEditTextFilter(IEditTextFilter* pFilter); + + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); + protected: friend class _KeypadImpl; diff --git a/inc/FUiCtrlLabel.h b/inc/FUiCtrlLabel.h index 160daa6..6c6f50d 100644 --- a/inc/FUiCtrlLabel.h +++ b/inc/FUiCtrlLabel.h @@ -70,9 +70,9 @@ public: private: Tizen::Ui::Controls::Label *__pLabel; }; - * @endcode - * - * @code +* @endcode +* +* @code // Sample code for LabelSample.cpp #include @@ -144,6 +144,25 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& text); + /** + * Initializes this instance of %Label with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Rectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the window. + * @param[in] text The text for this label instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier. + * To display text in multi-lines or to denote the end of line use '\\n'. @n + * The size of the control must be within the range defined by the minimum size and the maximum size. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& text); + public: /** * Sets the specified text for the %Label control. @@ -222,12 +241,12 @@ public: void SetBackgroundColor(const Tizen::Graphics::Color& color); /** - * Gets the background color of the %Label control. - * - * @since 2.0 - * - * @return The background color - */ + * Gets the background color of the %Label control. + * + * @since 2.0 + * + * @return The background color + */ Tizen::Graphics::Color GetBackgroundColor(void) const; /** @@ -263,6 +282,20 @@ public: void SetTextConfig(int size, LabelTextStyle style); /** + * Sets the text attributes of the %Label control. + * + * @since 2.1 + * + * @param[in] size The size of the text + * @param[in] style The style of the text + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * If @c size is less than the minimum size, this method fails. The minimum font size is 6 on devices of high screen density. + */ + void SetTextConfig(float size, LabelTextStyle style); + + /** * Gets the text size of the %Label control. * * @since 2.0 @@ -273,6 +306,16 @@ public: int GetTextSize(void) const; /** + * Gets the text size of the %Label control. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1.0f if an error occurs + */ + float GetTextSizeF(void) const; + + /** * Gets the text style of the %Label control. * * @since 2.0 @@ -293,12 +336,28 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The specified input parameter is invalid. @n * The specified @c size must be greater than @c 0. - - * @see GetTopMargin(), GetLeftMargin() + * @see GetTopMargin() + * @see GetLeftMargin() */ result SetMargin(int topMargin, int leftMargin); /** + * Sets the top and left margins. + * + * @since 2.1 + * + * @return An error code + * @param[in] topMargin The top margin. + * @param[in] leftMargin The left margin. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c size must be greater than @c 0. + * @see GetTopMargin() + * @see GetLeftMargin() + */ + result SetMargin(float topMargin, float leftMargin); + + /** * Gets the top margin. * * @since 2.0 @@ -309,6 +368,17 @@ public: */ int GetTopMargin(void) const; + /** + * Gets the top margin. + * + * @since 2.1 + * + * @return The size of the top margin, @n + * else @c -1.0f if an error occurs + * @see SetMargin() + */ + float GetTopMarginF(void) const; + /** * Gets the left margin. * @@ -320,6 +390,17 @@ public: */ int GetLeftMargin(void) const; + /** + * Gets the left margin. + * + * @since 2.1 + * + * @return The size of the left margin, @n + * else @c -1.0f if an error occurs. + * @see SetMargin() + */ + float GetLeftMarginF(void) const; + protected: friend class _LabelImpl; diff --git a/inc/FUiCtrlLabelTypes.h b/inc/FUiCtrlLabelTypes.h index ef33afe..cafbe46 100644 --- a/inc/FUiCtrlLabelTypes.h +++ b/inc/FUiCtrlLabelTypes.h @@ -15,18 +15,18 @@ // limitations under the License. // /** - * @file FUiCtrlLabelTypes.h - * @brief This is the header file for the LabelTextStyle enumeration. - * - * This header file contains the declarations of the LabelTextStyle enumeration. - */ +* @file FUiCtrlLabelTypes.h +* @brief This is the header file for the LabelTextStyle enumeration. +* +* This header file contains the declarations of the LabelTextStyle enumeration. +*/ #ifndef _FUI_CTRL_LABEL_ENUM_H_ #define _FUI_CTRL_LABEL_ENUM_H_ namespace Tizen { namespace Ui { namespace Controls { - /** +/** * @enum LabelTextStyle * * Defines the text styles of the label. @@ -40,7 +40,7 @@ enum LabelTextStyle LABEL_TEXT_STYLE_ITALIC, /**< The italic text style */ }; - /** +/** * @enum LabelContentHint * * Defines the content update type. diff --git a/inc/FUiCtrlList.h b/inc/FUiCtrlList.h index 7aeb2e4..1f9aa62 100644 --- a/inc/FUiCtrlList.h +++ b/inc/FUiCtrlList.h @@ -81,7 +81,7 @@ namespace Tizen { namespace Ui { namespace Controls * This is a simple UI application which uses a list control. * * - * @code +* @code //Sample code for ListSample.h #include diff --git a/inc/FUiCtrlListItemBase.h b/inc/FUiCtrlListItemBase.h index 2790b09..8e07fe1 100644 --- a/inc/FUiCtrlListItemBase.h +++ b/inc/FUiCtrlListItemBase.h @@ -168,6 +168,19 @@ public: */ result SetProgressMargins(int leftMargin, int rightMargin); + /* + * Sets the margin of the progress bar. + * + * @since 2.1 + * + * @return An error code + * @param[in] leftMargin The left margin of the progress bar + * @param[in] rightMargin The right margin of the progress bar + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result SetProgressMargins(float leftMargin, float rightMargin); + /** * Gets the width of the annex area. * @@ -179,6 +192,17 @@ public: */ static int GetAnnexWidth(ListAnnexStyle style); + /* + * Gets the width of the annex area. + * + * @since 2.1 + * + * @return The width of the annex + * @param[in] style The style of the annex + * @remarks The width of the annex area is different among annex styles. + */ + static float GetAnnexWidthF(ListAnnexStyle style); + protected: friend class _ListItemBaseImpl; @@ -204,6 +228,20 @@ protected: result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); // + // Initializes this instance of ListItem with the specified parameter. + // + // @since 2.1 + // + // @return An error code + // + // @param[in] itemSize The size of the item + // @param[in] style The style of Annex + // @exception E_SUCCESS The method is successful. + // @exception E_SYSTEM A system error has occurred. + // + result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); + + // // The following methods are reserved and may change its name at any time without prior notice. // virtual void ListItemBase_Reserved1(void) {} diff --git a/inc/FUiCtrlListTypes.h b/inc/FUiCtrlListTypes.h index 617b945..b2240e9 100644 --- a/inc/FUiCtrlListTypes.h +++ b/inc/FUiCtrlListTypes.h @@ -106,7 +106,7 @@ enum ListItemText }; /** - * @if OSPDEPREC + * if OSPDEPREC * @enum FastScrollIndexDigit * * Defines the number of digits or characters of the fast scroll index. diff --git a/inc/FUiCtrlListView.h b/inc/FUiCtrlListView.h old mode 100644 new mode 100755 index e8000e1..deb63be --- a/inc/FUiCtrlListView.h +++ b/inc/FUiCtrlListView.h @@ -27,14 +27,18 @@ #include #include +#include #include #include #include #include #include #include +#include #include +#include #include +#include #include namespace Tizen { namespace Ui { namespace Controls @@ -345,6 +349,25 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, ListScrollStyle scrollStyle); + /* + * Initializes this instance of %ListView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::Rectangle class @n + * This instance represents the x and y coordinates of the left top corner of the created %ListView along with the width + * and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle Set to scroll style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * Either the @c rect.width or @c rect.height parameter has a negative value. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, ListScrollStyle scrollStyle); + /** * Sets the item provider that creates and deletes items for the list. * @@ -359,6 +382,19 @@ public: */ result SetItemProvider(IListViewItemProvider& provider); + /* + * Sets the item provider that creates and deletes items for the list. + * + * @since 2.1 + * + * @return An error code + * @param[in] provider The item provider to create and delete items + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks If an item provider is not set for the list, the list does not work. @n + * The specified @c provider should be allocated in heap memory. + */ + result SetItemProvider(IListViewItemProviderF& provider); /** * Adds a listener instance that listens to state changes of list view items. @n @@ -412,6 +448,18 @@ public: */ void AddScrollEventListener(IScrollEventListener& listener); + /* + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to add + * @see IScrollEventListener::OnScrollEndReached() + * @see RemoveScrollEventListener() + */ + void AddScrollEventListener(IScrollEventListenerF& listener); + /** * Removes a listener instance that listens to state changes of a scroll event. @n * The removed listener cannot listen to events when they are fired. @@ -424,6 +472,18 @@ public: */ void RemoveScrollEventListener(IScrollEventListener& listener); + /* + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to remove + * @see IScrollEventListener::OnScrollEndReached() + * @see AddScrollEventListener() + */ + void RemoveScrollEventListener(IScrollEventListenerF& listener); + /** * Adds a link event listener. * @@ -504,6 +564,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE The specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ScrollToItem(int index); @@ -534,6 +595,7 @@ public: * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_INVALID_OPERATION The item is disabled. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result SetItemChecked(int index, bool check); @@ -545,6 +607,7 @@ public: * @return @c true if the item is checked, @n * else @c false * @param[in] index The item index + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemChecked(int index) const; @@ -559,6 +622,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). * */ result SetItemEnabled(int index, bool enable); @@ -571,6 +635,7 @@ public: * @return @c true if the item is enabled, @n * else @c false * @param[in] index The item index + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ bool IsItemEnabled(int index) const; @@ -594,7 +659,7 @@ public: * @exception E_OUT_OF_RANGE The specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. * @remarks If no description text is set to the item of the specified index, this method does not show the description text. - * + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result ShowItemDescriptionText(int index); @@ -608,6 +673,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE The specified input parameter is invalid. * @exception E_SYSTEM A system error has occurred. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result HideItemDescriptionText(int index); @@ -670,9 +736,24 @@ public: * @param[in] x The X position of the point * @param[in] y The Y position of the point * @remarks The method returns -1 when there is no list item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ int GetItemIndexFromPosition(int x, int y) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return The index of the item, @n + * else @c -1 if there is no list item at the specified position + * @param[in] x The X position of the point + * @param[in] y The Y position of the point + * @remarks The method returns -1 when there is no list item at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + int GetItemIndexFromPosition(float x, float y) const; + /** * Gets the index of the item at the specified position. * @@ -681,9 +762,22 @@ public: * @return The index of the item * @param[in] position The position of the point, @n * else @c -1 if there is no list item at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return The index of the item + * @param[in] position The position of the point, @n + * else @c -1 if there is no list item at the specified position + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; + /** * Gets the index of the item and ID of the element at the specified position. * @@ -698,10 +792,30 @@ public: * @exception E_SYSTEM A system error has occurred, or @n * there is no item at the specified position. * @remarks The specified @c itemIndex is -1 when there is no list item at the specified position. - * @remarks The specified @c elementId is -1 when there is no element at the specified position. + * @remarks The specified @c elementId is -1 when there is no element at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(int x, int y, int& itemIndex, int& elementId) const; + /* + * Gets the index of the item and ID of the element at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The X position of the item + * @param[in] y The Y position of the item + * @param[out] itemIndex The index of the item + * @param[out] elementId The ID of the element + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or @n + * there is no item at the specified position. + * @remarks The specified @c itemIndex is -1 when there is no list item at the specified position. + * @remarks The specified @c elementId is -1 when there is no element at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(float x, float y, int& itemIndex, int& elementId) const; + /** * Gets the index of the item and ID of the element at the specified position. * @@ -716,9 +830,28 @@ public: * there is no item at the specified position. * @remarks The specified @c itemIndex is -1 when there is no list item at the specified position. * @remarks The specified @c elementId is -1 when there is no element at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). */ result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& itemIndex, int& elementId) const; + /* + * Gets the index of the item and ID of the element at the specified position. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of the point + * @param[out] itemIndex The index of the item + * @param[out] elementId The ID of the element + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred, or @n + * there is no item at the specified position. + * @remarks The specified @c itemIndex is -1 when there is no list item at the specified position. + * @remarks The specified @c elementId is -1 when there is no element at the specified position. + * @remarks This method should be called only after list items are created. If this method needs to be called early in the lifecycle of the ListView, then UpdateList() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& itemIndex, int& elementId) const; + /** * Sets the color of a division line between items. * @@ -865,6 +998,27 @@ public: */ bool IsInReorderingMode(void) const; + /** + * Sets the scroll input handling mode. + * + * @since 2.1 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ + void SetScrollInputMode(ScrollInputMode mode); + + + /** + * Gets the scroll input handling mode. + * + * @since 2.1 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ + ScrollInputMode GetScrollInputMode(void) const; + protected: friend class _ListViewImpl; diff --git a/inc/FUiCtrlListViewTypes.h b/inc/FUiCtrlListViewTypes.h index 9c51fe5..424013b 100644 --- a/inc/FUiCtrlListViewTypes.h +++ b/inc/FUiCtrlListViewTypes.h @@ -40,7 +40,8 @@ enum ListAnnexStyle LIST_ANNEX_STYLE_MARK, /**< The mark style annex for multiple selection */ LIST_ANNEX_STYLE_ONOFF_SLIDING, /**< The slider style On/Off */ LIST_ANNEX_STYLE_DETAILED, /**< Detailed style for further interaction */ - LIST_ANNEX_STYLE_RADIO /**< The radio style for simple look */ + LIST_ANNEX_STYLE_RADIO, /**< The radio style for simple look */ + LIST_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER /**< The slider style On/Off with divider @b Since: @b 2.1 */ }; /** @@ -52,9 +53,9 @@ enum ListAnnexStyle */ enum ListItemDrawingStatus { - LIST_ITEM_DRAWING_STATUS_NORMAL = 0, /**< The normal drawing state */ - LIST_ITEM_DRAWING_STATUS_PRESSED, /**< The pressed drawing state */ - LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED /**< The highlighted drawing state */ + LIST_ITEM_DRAWING_STATUS_NORMAL = 0, /**< The normal drawing state */ + LIST_ITEM_DRAWING_STATUS_PRESSED, /**< The pressed drawing state */ + LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED /**< The highlighted drawing state */ }; /** @@ -66,9 +67,9 @@ enum ListItemDrawingStatus */ enum ListRefreshType { - LIST_REFRESH_TYPE_ITEM_ADD = 0, /**< The add type */ - LIST_REFRESH_TYPE_ITEM_REMOVE, /**< The remove type */ - LIST_REFRESH_TYPE_ITEM_MODIFY /**< The modify type */ + LIST_REFRESH_TYPE_ITEM_ADD = 0, /**< The add type */ + LIST_REFRESH_TYPE_ITEM_REMOVE, /**< The remove type */ + LIST_REFRESH_TYPE_ITEM_MODIFY /**< The modify type */ }; /** @@ -80,11 +81,11 @@ enum ListRefreshType */ enum ListItemStatus { - LIST_ITEM_STATUS_SELECTED = 0, /**< The selected item state */ - LIST_ITEM_STATUS_HIGHLIGHTED, /**< The highlighted item state */ - LIST_ITEM_STATUS_CHECKED, /**< The check item state */ - LIST_ITEM_STATUS_UNCHECKED, /**< The uncheck item state */ - LIST_ITEM_STATUS_MORE /**< The more item state */ + LIST_ITEM_STATUS_SELECTED = 0, /**< The selected item state */ + LIST_ITEM_STATUS_HIGHLIGHTED, /**< The highlighted item state */ + LIST_ITEM_STATUS_CHECKED, /**< The check item state */ + LIST_ITEM_STATUS_UNCHECKED, /**< The uncheck item state */ + LIST_ITEM_STATUS_MORE /**< The more item state */ }; /** @@ -96,8 +97,8 @@ enum ListItemStatus */ enum ListContextItemStatus { - LIST_CONTEXT_ITEM_STATUS_SELECTED = 0, /**< The selected context item state */ - LIST_CONTEXT_ITEM_STATUS_HIGHLIGHTED /**< The highlighted context item state */ + LIST_CONTEXT_ITEM_STATUS_SELECTED = 0, /**< The selected context item state */ + LIST_CONTEXT_ITEM_STATUS_HIGHLIGHTED /**< The highlighted context item state */ }; /** @@ -109,8 +110,8 @@ enum ListContextItemStatus */ enum SweepDirection { - SWEEP_DIRECTION_LEFT = 0, /**< The left direction */ - SWEEP_DIRECTION_RIGHT /**< The right direction */ + SWEEP_DIRECTION_LEFT = 0, /**< The left direction */ + SWEEP_DIRECTION_RIGHT /**< The right direction */ }; /** @@ -122,8 +123,8 @@ enum SweepDirection */ enum ListScrollItemAlignment { - LIST_SCROLL_ITEM_ALIGNMENT_TOP = 0, /**< The item is aligned at the top of the ListView at item scroll*/ - LIST_SCROLL_ITEM_ALIGNMENT_BOTTOM /**< The item is aligned at the bottom of the ListView at item scroll */ + LIST_SCROLL_ITEM_ALIGNMENT_TOP = 0, /**< The item is aligned at the top of the ListView at item scroll*/ + LIST_SCROLL_ITEM_ALIGNMENT_BOTTOM /**< The item is aligned at the bottom of the ListView at item scroll */ }; /** @@ -135,11 +136,11 @@ enum ListScrollItemAlignment */ enum ListScrollStyle { - SCROLL_STYLE_FADE_OUT = 0, /**< The fade-out scroll style */ - SCROLL_STYLE_FIXED, /**< The fixed scroll style */ - SCROLL_STYLE_FAST_SCROLL, /**< The fast scroll style */ - SCROLL_STYLE_JUMP_TO_TOP, /**< The jump to top scroll style */ - SCROLL_STYLE_THUMB /**< The thumb scroll style */ + SCROLL_STYLE_FADE_OUT = 0, /**< The fade-out scroll style */ + SCROLL_STYLE_FIXED, /**< The fixed scroll style */ + SCROLL_STYLE_FAST_SCROLL, /**< The fast scroll style */ + SCROLL_STYLE_JUMP_TO_TOP, /**< The jump to top scroll style */ + SCROLL_STYLE_THUMB /**< The thumb scroll style */ }; }}} // Tizen::Ui::Controls diff --git a/inc/FUiCtrlMessageBox.h b/inc/FUiCtrlMessageBox.h old mode 100644 new mode 100755 index a4aa470..8a726bd --- a/inc/FUiCtrlMessageBox.h +++ b/inc/FUiCtrlMessageBox.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlMessageBox.h - * @brief This is the header file for the %MessageBox class. - * - * This header file contains the declarations of the %MessageBox class. - */ +* @file FUiCtrlMessageBox.h +* @brief This is the header file for the %MessageBox class. +* +* This header file contains the declarations of the %MessageBox class. +*/ #ifndef _FUI_CTRL_MESSAGE_BOX_H_ #define _FUI_CTRL_MESSAGE_BOX_H_ @@ -75,20 +75,20 @@ enum MessageBoxModalResult /** - * @class MessageBox - * @brief This class implements a message box. - * - * @since 2.0 - * - * The %MessageBox class displays a confirmation message when the user is asked to confirm an action, or a warning message when the - * user wants to continue a potentially dangerous action. It can also display information, question, alarm, and lock messages, or - * the user selections. - * - * For more information on the class features, see Popup and MessageBox. - * - * The following example demonstrates how to use the %MessageBox class. - * - * @code +* @class MessageBox +* @brief This class implements a message box. +* +* @since 2.0 +* +* The %MessageBox class displays a confirmation message when the user is asked to confirm an action, or a warning message when the +* user wants to continue a potentially dangerous action. It can also display information, question, alarm, and lock messages, or +* the user selections. +* +* For more information on the class features, see Popup and MessageBox. +* +* The following example demonstrates how to use the %MessageBox class. +* +* @code // Sample code for MessageBoxSample.h #include @@ -178,8 +178,8 @@ MessageBoxSample::OnActionPerformed(const Control& source, int actionId) break; } } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ MessageBox : public Tizen::Ui::Window diff --git a/inc/FUiCtrlOptionMenu.h b/inc/FUiCtrlOptionMenu.h index 80ad9a4..15d091f 100644 --- a/inc/FUiCtrlOptionMenu.h +++ b/inc/FUiCtrlOptionMenu.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlOptionMenu.h * @brief This is the header file for the %OptionMenu class. diff --git a/inc/FUiCtrlOverlayPanel.h b/inc/FUiCtrlOverlayPanel.h old mode 100644 new mode 100755 index 316a0b2..c5d0455 --- a/inc/FUiCtrlOverlayPanel.h +++ b/inc/FUiCtrlOverlayPanel.h @@ -65,25 +65,24 @@ public: * Defines the various rotation options. * * @brief [Deprecated] - * @deprecated This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera - * preview. + * @deprecated This enumerator is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview. * @since 2.0 * @endif */ enum Rotation { - ROTATION_NONE, /**< @if OSPDEPREC No rotation @endif */ - ROTATION_90, /**< @if OSPDEPREC The 90 degree rotation @endif */ - ROTATION_180, /**< @if OSPDEPREC The 180 degree rotation @endif */ - ROTATION_270, /**< @if OSPDEPREC The 270 degree rotation @endif */ - ROTATION_NONE_LR, /**< @if OSPDEPREC The horizontal mirroring @endif */ - ROTATION_NONE_UD, /**< @if OSPDEPREC The vertical mirroring @endif */ - ROTATION_90_LR, /**< @if OSPDEPREC The 90 degree rotation with horizontal mirroring @endif */ - ROTATION_90_UD, /**< @if OSPDEPREC The 90 degree rotation with vertical mirroring @endif */ - ROTATION_180_LR, /**< @if OSPDEPREC The 180 degree rotation with horizontal mirroring @endif */ - ROTATION_180_UD, /**< @if OSPDEPREC The 180 degree rotation with vertical mirroring @endif */ - ROTATION_270_LR, /**< @if OSPDEPREC The 270 degree rotation with horizontal mirroring @endif */ - ROTATION_270_UD, /**< @if OSPDEPREC The 270 degree rotation with vertical mirroring @endif */ + ROTATION_NONE, /**< @if OSPDEPREC No rotation @endif */ + ROTATION_90, /**< @if OSPDEPREC The 90 degree rotation @endif */ + ROTATION_180, /**< @if OSPDEPREC The 180 degree rotation @endif */ + ROTATION_270, /**< @if OSPDEPREC The 270 degree rotation @endif */ + ROTATION_NONE_LR, /**< @if OSPDEPREC The horizontal mirroring @endif */ + ROTATION_NONE_UD, /**< @if OSPDEPREC The vertical mirroring @endif */ + ROTATION_90_LR, /**< @if OSPDEPREC The 90 degree rotation with horizontal mirroring @endif */ + ROTATION_90_UD, /**< @if OSPDEPREC The 90 degree rotation with vertical mirroring @endif */ + ROTATION_180_LR, /**< @if OSPDEPREC The 180 degree rotation with horizontal mirroring @endif */ + ROTATION_180_UD, /**< @if OSPDEPREC The 180 degree rotation with vertical mirroring @endif */ + ROTATION_270_LR, /**< @if OSPDEPREC The 270 degree rotation with horizontal mirroring @endif */ + ROTATION_270_UD, /**< @if OSPDEPREC The 270 degree rotation with vertical mirroring @endif */ ROTATION_MAX }; @@ -101,7 +100,7 @@ public: enum BufferPixelFormat { /** - * @if OSPDEPREC + * @if OSPDEPREC * The ARGB8888 pixel format * * @since 2.0 @@ -110,20 +109,20 @@ public: BUFFER_PIXEL_FORMAT_ARGB8888, /** - * @if OSPDEPREC + * @if OSPDEPREC * The RGB565 pixel format * * @since 2.0 - * @endif + * @endif */ BUFFER_PIXEL_FORMAT_RGB565, /** - * @if OSPDEPREC + * @if OSPDEPREC * The 8 bit Y plane followed by 8 bit 2 X 2 subsampled U and V planes * * @since 2.0 - * @endif + * @endif */ BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR }; @@ -159,20 +158,37 @@ public: * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview. * @since 2.0 * - * @return An error code - * @param[in] rect The location and size of the %OverlayPanel control @n - * The maximum size is 480 x 800 on a WVGA screen, or 240 x 400 on a WQVGA screen. @n - * The minimum size of this control is 32 x 32 on a WVGA screen. - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. - * @remarks Do not use %OverlayPanel in combination with %OverlayRegion. If used, %OverlayPanel may not work as expected. - * @see Tizen::Ui::Container + * @return An error code + * @param[in] rect The location and size of the %OverlayPanel control @n + * The maximum size is 480 x 800 on a WVGA screen, or 240 x 400 on a WQVGA screen. @n + * The minimum size of this control is 32 x 32 on a WVGA screen. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + * @remarks Do not use %OverlayPanel in combination with %OverlayRegion. If used, %OverlayPanel may not work as expected. + * @see Tizen::Ui::Container * @endif */ result Construct(const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %OverlayPanel at the specified rectangle. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %OverlayPanel control @n + * The maximum size is equal to screen size. for example 720 x 1280 on a HD screen, or 480 x 800 on a WVGA screen @n + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks Do not use %OverlayPanel in combination with %OverlayRegion. If used, %OverlayPanel may not work as expected. + * @see Tizen::Ui::Container + * @endif + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect); + /** * @if OSPDEPREC * Sets the rotation of the input buffer. @n @@ -196,12 +212,23 @@ public: * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview. * @since 2.0 * - * @param[in] dim The dimension of the window to draw + * @param[in] dim The dimension of the window to draw * * @endif */ void SetRendererSize(Tizen::Graphics::Dimension& dim); + /* + * Changes the size of the displayed renderer. + * + * @since 2.1 + * + * @param[in] dim The dimension of the window to draw + * + * @endif + */ + void SetRendererSize(Tizen::Graphics::FloatDimension& dim); + /** * @if OSPDEPREC * Sets the aspect ratio of the renderer. @@ -210,9 +237,9 @@ public: * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview. * @since 2.0 * - * @param[in] fix Set to @c true if the renderer will display the aspect ratio of the input buffer even if the renderer and input data have - * different aspect ratios, @n - * else @c false + * @param[in] fix Set to @c true if the renderer will display the aspect ratio of the input buffer even if the renderer and input data have + * different aspect ratios, @n + * else @c false * @endif */ void SetRendererAspectRatio(bool fix); @@ -225,14 +252,14 @@ public: * @deprecated This method is deprecated. Instead of using this class, use the %OverlayRegion class, that supports video playback and camera preview. * @since 2.0 * - * @param[in] destDim The dimension of the window to be drawn - * @param[in] srcBuffer The source buffer - * @param[in] srcDim The source dimension - * @param[in] srcFormat The pixel format of buffer data - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_SYSTEM A system error has occurred. - * @exception E_UNSUPPORTED_FORMAT The specified pixel format is not supported. + * @param[in] destDim The dimension of the window to be drawn + * @param[in] srcBuffer The source buffer + * @param[in] srcDim The source dimension + * @param[in] srcFormat The pixel format of buffer data + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @exception E_UNSUPPORTED_FORMAT The specified pixel format is not supported. * @remarks BUFFER_PIXEL_FORMAT_ARGB8888, and BUFFER_PIXEL_FORMAT_RGB565 are not supported. @n * Control::Invalidate() methods must be called to properly display the input buffer. * @@ -240,6 +267,25 @@ public: */ result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, BufferPixelFormat srcFormat); + /* + * Sets the input buffer. + * + * @since 2.1 + * + * @param[in] destDim The dimension of the window to be drawn + * @param[in] srcBuffer The source buffer + * @param[in] srcDim The source dimension + * @param[in] srcFormat The pixel format of buffer data + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @exception E_UNSUPPORTED_FORMAT The specified pixel format is not supported. + * @remarks Control::Invalidate() methods must be called to properly display the input buffer. + * + * @endif + */ + result SetInputBuffer(const Tizen::Graphics::FloatDimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, BufferPixelFormat srcFormat); + /** * @if OSPDEPREC * Gets the information of the background buffer. @@ -249,9 +295,9 @@ public: * @since 2.0 * * @return An error code - * @param[out] info The information of the background buffer - * @exception E_SUCCESS The method is successful. - * @exception E_OPERATION_FAILED The operation has failed. + * @param[out] info The information of the background buffer + * @exception E_SUCCESS The method is successful. + * @exception E_OPERATION_FAILED The operation has failed. * @remarks Currently, this function provides buffer information except the pointer of the RGB color buffer. @n * Therefore, info.pPixels is always assigned @c null. * @endif diff --git a/inc/FUiCtrlOverlayRegion.h b/inc/FUiCtrlOverlayRegion.h index ed8a9b5..0ffcbd3 100644 --- a/inc/FUiCtrlOverlayRegion.h +++ b/inc/FUiCtrlOverlayRegion.h @@ -38,6 +38,7 @@ namespace Tizen { namespace Graphics class Point; class Dimension; class Rectangle; +class FloatRectangle; class BufferInfo; }} // Tizen::Graphics @@ -291,6 +292,18 @@ public: */ Tizen::Graphics::Rectangle GetBounds(void) const; + /* + * Gets the position and size of the overlay region. + * + * @since 2.1 + * + * @return An instance of FloatRectangle that represents the position of the top-left corner, the width, and the height of the overlay region + * @remarks The shape of an overlay region is rectangular, which is defined by the top-left point, and the width or height. The position of the top-left + * point is relative to the top-left corner of the parent form. + * + */ + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; + /** * Gets the position and size of the overlay region. * @@ -306,6 +319,21 @@ public: */ void GetBounds(int& x, int& y, int& width, int& height) const; + /* + * Gets the position and size of the overlay region. + * + * @since 2.1 + * + * @param[out] x The x position of the top-left corner of the overlay region + * @param[out] y The y position of the top-left corner of the overlay region + * @param[out] width The width of the rectangular region + * @param[out] height The height of the rectangular region + * @remarks The shape of an overlay region is rectangular, which is defined by the top-left point, and the width or height. The position of the top-left + * point is relative to the top-left corner of the parent form. + * + */ + void GetBounds(float& x, float& y, float& width, float& height) const; + /** * Sets the input buffer. @n * Due to the hardware accelerated rendering, there are limitations for an input buffer. The input buffer has the same restriction regarding its size as @@ -338,8 +366,7 @@ public: * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. * @exception E_SYSTEM A system error has occurred. * @remarks This method provides the buffer information, except the pointer of a color buffer. Therefore, info.pPixels is always assigned as @c null. - */class Dimension; - + */ result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const; /** @@ -379,6 +406,31 @@ public: */ static bool EvaluateBounds(OverlayRegionEvaluationOption option, Tizen::Graphics::Rectangle& rect, bool& modified); + /* + * Evaluates and returns the valid position and size that are closest to the specified bounds. + * + * @since 2.1 + * + * @return @c true if the evaluation process does not meet an error, @n + * else @c false + * @param[in] option The option for evaluating the bounds of the overlay region + * @param[in, out] rect An instance of %FloatRectangle that represents the validated bounds of %OverlayRegion @n + * The width and height of the input rectangle must be greater than @c 0. + * @param[out] modified A boolean flag that indicates whether the specified @c rectangle is modified + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_UNSUPPORTED_OPTION A specified input parameter is not supported. + * @exception E_SYSTEM A system error has occurred. + * @remarks Due to the hardware accelerated rendering, there are limitations for an overlay region. @n + * The hardware capability for an overlay region is checked by using the GetWidthUnit(), GetHeightUnit() and GetMaxCount(). @n + * If the application runs on multi-screen resolutions, the specified bounds may not meet the hardware limitations of the overlay region. In + * such cases, GetOverlayRegionNF() will return E_INVALID_ARG. @n + * To prevent this kind of problem, the application must use the OverlayRegion::EvaluateBoundsF() method to get a validated bounds that can be + * used as the input bounds of the GetOverlayRegionNF() method. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + static bool EvaluateBounds(OverlayRegionEvaluationOption option, Tizen::Graphics::FloatRectangle& rect, bool& modified); + /** * Gets the value of the width. @n * Only a multiple of this value can be allowed as the width of an overlay region. @@ -431,7 +483,7 @@ public: * The return value and each item in the list must be deleted by the caller. @n * The format list can vary depending on the device. After checking the supported formats using this API, it's better to use a proper pixel format. @n */ - static Tizen::Base::Collection::IListT< Tizen::Ui::Controls::OverlayRegionBufferPixelFormat >* GetSupportedBufferPixelFormatListN(void); + static Tizen::Base::Collection::IListT< OverlayRegionBufferPixelFormat >* GetSupportedBufferPixelFormatListN(void); private: // diff --git a/inc/FUiCtrlPanel.h b/inc/FUiCtrlPanel.h index 81e0680..d6944a4 100644 --- a/inc/FUiCtrlPanel.h +++ b/inc/FUiCtrlPanel.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace Tizen {namespace Base { @@ -144,6 +144,21 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + /* + * Initializes this instance of %Panel with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %Panel control as an instance of FloatRectangle + * @param[in] groupStyle The group style of the %Panel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specified group style determines the border look of the %Panel control. + * @see Tizen::Ui::Container, Tizen::Ui::GroupStyle + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); /** * Initializes this instance of %Panel and child controls with the specified resource ID @n @@ -181,6 +196,24 @@ public: */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + /* + * Initializes this instance of %Panel with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape modes + * @param[in] rect The location and size of the %Panel control as an instance of FloatRectangle + * @param[in] groupStyle The table view style of the %Panel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified layout is already bound to another container. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specified group style determines the border look of the %Panel control. + * @see Tizen::Ui::Container, Tizen::Ui::GroupStyle + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + /** * Initializes this instance of %Panel with the specified layouts, rectangular region, and group style. * @@ -200,6 +233,25 @@ public: */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + /* + * Initializes this instance of %Panel with the specified layouts, rectangular region, and group style. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %Panel control as an instance of FloatRectangle + * @param[in] groupStyle The table view style of the %Panel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified layout is already bound to another container. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specified group style determines the border look of the %Panel control. + * @see Tizen::Ui::Container, Tizen::Ui::GroupStyle + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + /** * Gets the background color of the %Panel control. * diff --git a/inc/FUiCtrlPopup.h b/inc/FUiCtrlPopup.h old mode 100644 new mode 100755 index 2b7d7ca..aa737f6 --- a/inc/FUiCtrlPopup.h +++ b/inc/FUiCtrlPopup.h @@ -145,7 +145,7 @@ PopupSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the __pPopup - delete __pPopup; + __pPopup->Destroy(); return r; } @@ -169,8 +169,8 @@ PopupSample::OnActionPerformed(const Control& source, int actionId) break; } } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ Popup : public Tizen::Ui::Window @@ -205,6 +205,21 @@ public: */ result Construct(bool hasTitle, const Tizen::Graphics::Dimension& dim); + /* + * Initializes this instance of %Popup with the specified dimensions. + * + * @since 2.1 + * + * @return An error code + * @param[in] hasTitle Set to @c true if the %Popup control has a title, @n + * else @c false + * @param[in] dim The size of the %Popup control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(bool hasTitle, const Tizen::Graphics::FloatDimension& dim); + /** * Initializes this instance of %Popup and child controls with the specified resource ID @n * @@ -240,6 +255,23 @@ public: */ result Construct(const Tizen::Ui::Layout& layout, bool hasTitle, const Tizen::Graphics::Dimension& dim); + /* + * Initializes this instance of %Popup with the specified layout and dimensions. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] hasTitle Set to @c true if the %Popup control should have a title, @n + * else @c false + * @param[in] dim The size of the %Popup control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or + * the specified layout is already bound to another container. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Ui::Layout& layout, bool hasTitle, const Tizen::Graphics::FloatDimension& dim); + /** * Initializes this instance of %Popup with the specified layouts and dimensions. * @@ -258,13 +290,31 @@ public: */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, bool hasTitle, const Tizen::Graphics::Dimension& dim); + /* + * Initializes this instance of %Popup with the specified layouts and dimensions. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] hasTitle Set to @c true if this %Popup control should have a title, @n + * else @c false + * @param[in] dim The size of the %Popup control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or + * the specified layout is already bound to another container. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, bool hasTitle, const Tizen::Graphics::FloatDimension& dim); + /** * Shows the modal window. @n * * @since 2.0 * @return An error code * @param[out] modalResult The %Popup's notification. @n - * This value is the 'modalResult' parameter of the EndModal() method + * This value is the 'modalResult' parameter of the EndModal() method * @exception E_SUCCESS The method is successful. * @exception E_INVALID_STATE The %Popup is not visible. The visible state of the %Popup should be set @c true. * @remarks Do not call this method from Tizen::App::App::OnAppInitializing(). @n @@ -315,6 +365,15 @@ public: */ Tizen::Graphics::Rectangle GetClientAreaBounds(void) const; + /* + * Gets the bounds of the client area. + * + * @since 2.1 + * + * @return The bounds of the client area in a FloatRectangle instance + */ + Tizen::Graphics::FloatRectangle GetClientAreaBoundsF(void) const; + /** * Creates and returns a graphics canvas whose bounds (position and size) are equal to the bounds of the client area of the %Popup control. * @@ -327,7 +386,7 @@ public: * @remarks The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the client area of the %Popup control. @n * It is the responsibility of the developers to deallocate the canvas after use. * @remarks The canvas is valid only if the properties of the parent control of the canvas remain unchanged. @n - * Therefore, delete the previously allocated canvas and create a new canvas using the GetCanvasN() method if the size or position of the + * Therefore, delete the previously allocated canvas and create a new canvas using the GetClientAreaCanvasN() method if the size or position of the * control is changed. * @remarks The specific error code can be accessed using the GetLastResult() method. */ @@ -345,6 +404,18 @@ public: */ Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + /* + * Translates the specified position to the client coordinates. + * + * @since 2.1 + * + * @return The position in relative to the top-left corner of the client-area, @n + * else @c (-1.0f,-1.0f) if the instance is invalid + * @param[in] position The position relative to the top-left corner of the %Popup control + * @see TranslateFromClientAreaPositionF() + */ + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; + /** * Translates the specified client position to the control coordinate. * @@ -357,6 +428,18 @@ public: */ Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; + /* + * Translates the specified client position to the control coordinate. + * + * @since 2.1 + * + * @return The position in relative to the top-left corner of the %Popup control, @n + * else @c (-1.0f,-1.0f) if the instance is invalid + * @param[in] clientPosition The position relative to the top-left corner of the client area + * @see TranslateToClientAreaPositionF() + */ + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; + /** * Gets the color of the %Popup control. * @@ -420,10 +503,10 @@ public: protected: friend class _PopupImpl; - // - // The following methods are reserved and may change its name at any time without - // prior notice. - // + /** + * The following methods are reserved and may change its name at any time without + * prior notice. + */ virtual void Popup_Reserved1(void) { } virtual void Popup_Reserved2(void) { } virtual void Popup_Reserved3(void) { } diff --git a/inc/FUiCtrlProgress.h b/inc/FUiCtrlProgress.h index 9ae9a0e..9009b14 100644 --- a/inc/FUiCtrlProgress.h +++ b/inc/FUiCtrlProgress.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlProgress.h * @brief This is the header file for the %Progress class. @@ -176,6 +177,27 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, int minValue, int maxValue); + /* + * Initializes this instance of %Progress with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * its width and height. + * @param[in] minValue The minimum value of the current instance of %Progress + * @param[in] maxValue The maximum value of the current instance of %Progress + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The value of an argument is outside the valid range defined by the method. @n + * The specified values should be positive and @c minValue should be less than @c maxValue. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container, therefore some methods may fail if used earlier. @n + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, int minValue, int maxValue); + public: /** * Sets the current value of the %Progress control. @n @@ -264,6 +286,31 @@ public: */ Tizen::Graphics::Color GetBarColor(void) const; + + /** + * Sets the background color of the bar. + * + * @since 2.1 + * + * @param[in] color The color to be set + * @remarks The method ignores the alpha value of the @c color parameter and sets the alpha value to @c 255. + * @see GetBarBackgroundColor() + */ + void SetBarBackgroundColor(const Tizen::Graphics::Color& barBackgroundColor); + + /** + * Gets the background color of the bar. + * + * @since 2.1 + * + * @return The background color of the bar, @n + * else RGBA(0, 0, 0, 0) if an error occurs + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetBarBackgroundColor() + */ + Tizen::Graphics::Color GetBarBackgroundColor(void) const; + + private: // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. diff --git a/inc/FUiCtrlProgressPopup.h b/inc/FUiCtrlProgressPopup.h index 43dbe07..d42d558 100644 --- a/inc/FUiCtrlProgressPopup.h +++ b/inc/FUiCtrlProgressPopup.h @@ -16,17 +16,19 @@ // /** - * @file FUiCtrlProgressPopup.h - * @brief This is the header file for the %ProgressPopup class. - * - * This header file contains the declarations of the %ProgressPopup class. - */ +* @file FUiCtrlProgressPopup.h +* @brief This is the header file for the %ProgressPopup class. +* +* This header file contains the declarations of the %ProgressPopup class. +*/ #ifndef _FUI_CTRL_PROGRESS_POPUP_H_ #define _FUI_CTRL_PROGRESS_POPUP_H_ + #include + namespace Tizen { namespace Ui { class IProgressPopupEventListener; @@ -35,16 +37,17 @@ class IProgressPopupEventListener; namespace Tizen { namespace Ui { namespace Controls { - /** * @class ProgressPopup * @brief This class defines the common behavior of a %ProgressPopup control. * - * @since 2.0 + * @since 2.0 * * The %ProgressPopup class displays processing animation to show processing status. * It can contain a title, body text and cancel button. * + * For more information on the class features, see ProgressPopup. + * * @see Tizen::Ui::Window * * The following example demonstrates how to use the %ProgressPopup class. @@ -72,7 +75,6 @@ public: private: static const int ID_BUTTON_PROGRESSPOPUP = 501; - static const int ID_BUTTON_CLOSE_PROGRESSPOPUP = 502; Tizen::Ui::Controls::ProgressPopup* __pProgressPopup; }; @@ -114,7 +116,7 @@ ProgressPopupSample::OnInitializing(void) __pProgressPopup->SetText(L"Hello World!!"); __pProgressPopup->AddProgressPopupEventListener(*this); - // Creates an instance of Button to open the ProgressPopup + // Creates an instance of Button to open the ProgressPopup. Button* pButtonProgressPopup = new Button(); pButtonProgressPopup->Construct(Rectangle(10, 10, 250, 60), L"Open ProgressPopup"); pButtonProgressPopup->SetActionId(ID_BUTTON_PROGRESSPOPUP); @@ -188,18 +190,20 @@ public: * @return An error code * @param[in] cancelButton Set to @c true if the %ProgressPopup window has a cancel button, @n * else @c false - * @param[in] translucent Set to @c true if the %ProgressPopup window is translucent, @n + * @param[in] transparent Set to @c true if the %ProgressPopup window is transparent, @n * else @c false * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. @n - * This error occurs when the internal resource is not loaded. + This error occurs when the internal resource is not loaded. * @remarks To show a %ProgressPopup window, call Show() or DoModal() after calling the Construct() method. @n * By default, the title area and the body text are not shown. @n * Use SetTitleText() and SetText() to show the title area and the body text. - * @remarks If cancelButton is set to true and ProgressPopup is closed by pressing a Cancel Button, + * @remarks If @c transparent is set to true, a progress icon is only shown and a cancel button is not shown. @n + * Also, the texts set by SetTitleText() and SetText() are not shown. + * @remarks If @c cancelButton is set to true and ProgressPopup is closed by pressing a Cancel Button, * out parameter of DoModal(), modalResult, is -1. */ - result Construct(bool cancelButton, bool translucent); + result Construct(bool cancelButton, bool transparent); /** * Sets the text of the %ProgressPopup window. @@ -209,17 +213,18 @@ public: * @param[in] text The text to be set * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks If the %ProgressPopup window is constructed as transparent, the text is not shown. */ result SetText(const Tizen::Base::String& text); /** - * Gets the text of the %ProgressPopup window. - * - * @since 2.0 - * - * @return The text of the %ProgressPopup window, @n - * else an empty string if an error occurs - */ + * Gets the text of the %ProgressPopup window. + * + * @since 2.0 + * + * @return The text of the %ProgressPopup window, @n + * else an empty string if an error occurs + */ Tizen::Base::String GetText(void) const; /** diff --git a/inc/FUiCtrlRadioGroup.h b/inc/FUiCtrlRadioGroup.h index bbc3254..5dada93 100644 --- a/inc/FUiCtrlRadioGroup.h +++ b/inc/FUiCtrlRadioGroup.h @@ -162,9 +162,9 @@ RadioGroupSample::OnActionPerformed(const Control& source, int actionId) break; } } - * @endcode - * - */ + * @endcode + * + */ class _OSP_EXPORT_ RadioGroup : public Tizen::Ui::Control { @@ -177,10 +177,10 @@ public: RadioGroup(void); /** - * This is the destructor for this class. - * - * @since 2.0 - */ + * This is the destructor for this class. + * + * @since 2.0 + */ virtual ~RadioGroup(void); @@ -199,6 +199,8 @@ public: /** * Adds the check button to the radio group. * + * @brief [Deprecated] + * @deprecated This API is deprecated. * @since 2.0 * * @return An error code @@ -211,8 +213,25 @@ public: result Add(const CheckButton& checkButton); /** + * Adds the check button to the radio group. + * + * @since 2.1 + * + * @return An error code + * @param[in] pCheckButton The %CheckButton instance to be added + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c pCheckButton is @c null. + * @exception E_SYSTEM A system error has occurred. + * @remarks Only CheckButtons whose style is CHECK_BUTTON_STYLE_RADIO or CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER can be added to %RadioGroup. + */ + result Add(CheckButton* pCheckButton); + + /** * Removes the check button from the radio group. * + * @brief [Deprecated] + * @deprecated This API is deprecated. * @since 2.0 * * @return An error code @@ -224,6 +243,20 @@ public: */ result Remove(const CheckButton& checkButton); + /** + * Removes the check button from the radio group. + * + * @since 2.1 + * + * @return An error code + * @param[in] pCheckButton The %CheckButton instance to be removed + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The object is not found. + * @exception E_SYSTEM A system error has occurred. + * @remarks Before removing %CheckButton from its parent container, it must be removed from %RadioGroup. + */ + result Remove(CheckButton* pCheckButton); + public: /** * Gets the number of check buttons in the radio group. @@ -237,6 +270,8 @@ public: /** * Selects the specified check button in the radio group. * + * @brief [Deprecated] + * @deprecated This API is deprecated. * @since 2.0 * * @param[in] checkButton The check button to be selected @@ -244,6 +279,16 @@ public: void SetSelectedItem(const CheckButton& checkButton); /** + * Selects the specified check button in the radio group. + * + * @since 2.1 + * + * @param[in] pCheckButton The check button to be selected + * @exception E_INVALID_ARG The specified @c pCheckButton is @c null. + */ + void SetSelectedItem(CheckButton* pCheckButton); + + /** * Gets the selected check button in the radio group. * * @since 2.0 @@ -254,57 +299,39 @@ public: */ const CheckButton* GetSelectedItem(void) const; +private: // // This method is for internal use only. // Using this method can cause behavioral, security-related, and consistency-related issues in the application. // - // This method is prohibited. If this method is used - // in an application, the application can get rejected during the certification - // process. - // - // (Blocked) Draws the control. - // - // @since 2.0 + // This method is reserved and may change its name at any time without + // prior notice. // - // @return An error code - // @exception E_UNSUPPORTED_OPERATION This operation is not supported. + // @since 2.1 // - virtual result Draw(void); + virtual void RadioGroup_Reserved1(void){} // // This method is for internal use only. // Using this method can cause behavioral, security-related, and consistency-related issues in the application. // - // This method is prohibited. If this method is used - // in an application, the application can get rejected during the certification - // process. + // This method is reserved and may change its name at any time without + // prior notice. // - // (Blocked) Shows this control. + // @since 2.1 // - // @since 2.0 - // - // @return An error code - // @exception E_UNSUPPORTED_OPERATION This operation is not supported. - // - virtual result Show(void); + virtual void RadioGroup_Reserved2(void){} // // This method is for internal use only. // Using this method can cause behavioral, security-related, and consistency-related issues in the application. // - // This method is prohibited. If this method is used - // in an application, the application can get rejected during the certification - // process. - // - // (Blocked) Gives the input focus to the control. @n - // One must call this method if the control needs to listen to the user input events such as key pressed. - // - // @since 2.0 + // This method is reserved and may change its name at any time without + // prior notice. // - // @return An error code - // @exception E_UNSUPPORTED_OPERATION This operation is not supported. + // @since 2.1 // - virtual result SetFocus(void); + virtual void RadioGroup_Reserved3(void){} protected: friend class _RadioGroupImpl; diff --git a/inc/FUiCtrlScrollEventTypes.h b/inc/FUiCtrlScrollEventTypes.h index eb73d54..e1b7e1b 100644 --- a/inc/FUiCtrlScrollEventTypes.h +++ b/inc/FUiCtrlScrollEventTypes.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlScrollEventTypes.h * @brief This is the header file for the List enumerations. @@ -22,6 +23,7 @@ * * This header file contains the declarations of the scroll event enumerations. */ + #ifndef _FUI_CTRL_SCROLL_EVENT_ENUM_H_ #define _FUI_CTRL_SCROLL_EVENT_ENUM_H_ @@ -43,8 +45,6 @@ enum ScrollEndEvent SCROLL_END_EVENT_END_RIGHT /**< The scroll reaches right end */ }; -}; -}; -}; // Tizen::Ui::Controls +}}} // Tizen::Ui::Controls #endif diff --git a/inc/FUiCtrlScrollPanel.h b/inc/FUiCtrlScrollPanel.h index 4ed96cc..33adf29 100644 --- a/inc/FUiCtrlScrollPanel.h +++ b/inc/FUiCtrlScrollPanel.h @@ -31,8 +31,8 @@ #include #include #include +#include #include -#include namespace Tizen { namespace Ui { namespace Controls { @@ -153,6 +153,22 @@ public: result Construct(const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %ScrollPanel with the specified rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %ScrollPanel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given width or height is less than 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the scroll direction is vertical and the scroll area is resized automatically. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect); + + /** * Initializes this instance of %ScrollPanel and child controls with the specified resource ID @n * @@ -171,6 +187,7 @@ public: */ result Construct(const Tizen::Base::String& resourceId); + /** * Initializes this instance of %ScrollPanel with the specified rectangular region. * @@ -187,6 +204,22 @@ public: result Construct(const Tizen::Graphics::Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + /* + * Initializes this instance of %ScrollPanel with the specified rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %ScrollPanel control + * @param[in] scrollDirection The scroll direction of %ScrollPanel + * @param[in] autoResizingEnable Whether to resize the client area automatically + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The given width or height is less than 0. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + + /** * Initializes this instance of %ScrollPanel with the specified layout and rectangular region. * @@ -204,6 +237,23 @@ public: result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %ScrollPanel with the specified layout and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] rect The location and size of the %ScrollPanel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c layout is already bound to another container, or the given width or the height is less than 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the scroll direction is vertical and the scroll area is resized automatically. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect); + + /** * Initializes this instance of %ScrollPanel with the specified layout and rectangular region. * @@ -221,6 +271,23 @@ public: result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + /* + * Initializes this instance of %ScrollPanel with the specified layout and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] rect The location and size of the %ScrollPanel control + * @param[in] scrollDirection The scroll direction of %ScrollPanel + * @param[in] autoResizingEnable Whether to resize the client area automatically + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c layout is already bound to another container, or the given width or height is less than 0. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + + /** * Initializes this instance of %ScrollPanel with the specified layouts and rectangular region. * @@ -239,6 +306,24 @@ public: result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect); + /* + * Initializes this instance of %ScrollPanel with the specified layouts and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %ScrollPanel control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c portraitLayout or @c landscapeLayout is already bound to another container, or the given width or height is less than 0. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the scroll direction is vertical and the scroll area is resized automatically. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect); + + /** * Initializes this instance of %ScrollPanel with the specified layouts and rectangular region. * @@ -257,21 +342,54 @@ public: result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + /* + * Initializes this instance of %ScrollPanel with the specified layouts and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %ScrollPanel control + * @param[in] scrollDirection The scroll direction of %ScrollPanel + * @param[in] autoResizingEnable Whether to resize the client area automatically + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c portraitLayout or @c landscapeLayout is already bound to another container, or the given width or height is less than 0. + * @see Tizen::Ui::Container + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable); + + /** * Adds a listener instance that listens to the state changes of a scroll event. @n * The added listener can listen to the events on the given event dispatcher's context when they are fired. * - * @since 2.0 + * @since 2.0 * * @param[in] listener The listener to add * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @see IScrollEventListener::OnScrollEndReached() + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @see Tizen::Ui::Controls::IScrollEventListener * @see RemoveScrollEventListener() */ void AddScrollEventListener(IScrollEventListener& listener); + /* + * Adds a listener instance that listens to the state changes of a scroll event. @n + * The added listener can listen to the events on the given event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @param[in] listener The listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @see Tizen::Ui::Controls::IScrollEventListenerF + * @see RemoveScrollEventListener() + */ + void AddScrollEventListener(IScrollEventListenerF& listener); + + /** * Removes a listener instance that listens to the state changes of a scroll event. @n * The removed listener cannot listen to the events when they are fired. @@ -279,12 +397,25 @@ public: * @since 2.0 * * @param[in] listener The listener to remove - * @see IScrollEventListener::OnScrollEndReached() + * @see Tizen::Ui::Controls::IScrollEventListener * @see AddScrollEventListener() */ void RemoveScrollEventListener(IScrollEventListener& listener); + /* + * Removes a listener instance that listens to the state changes of a scroll event. @n + * The removed listener cannot listen to the events when they are fired. + * + * @since 2.1 + * + * @param[in] listener The listener to remove + * @see Tizen::Ui::Controls::IScrollEventListenerF + * @see AddScrollEventListener() + */ + void RemoveScrollEventListener(IScrollEventListenerF& listener); + + /** * Gets the scroll position. * @@ -295,6 +426,16 @@ public: int GetScrollPosition(void) const; + /* + * Gets the scroll position. + * + * @since 2.1 + * + * @return The scroll position + */ + float GetScrollPositionF(void) const; + + /** * @if OSPDEPREC * Sets the scroll position. @@ -308,6 +449,21 @@ public: */ void SetScrollPosition(int position); + + /* + * @if OSPDEPREC + * Sets the scroll position. + * + * @brief [Deprecated] + * @deprecated This method is deprecated. Instead of using this method, use the SetScrollPosition(int, bool), which supports animated scroll. + * @since 2.1 + * + * @param[in] position The scroll position + * @endif + */ + void SetScrollPosition(float position); + + /** * Sets the scroll position. * @@ -320,6 +476,20 @@ public: */ void SetScrollPosition(int position, bool withAnimation); + + /* + * Sets the scroll position. + * + * @since 2.1 + * + * @param[in] position The scroll position in pixel + * @param[in] withAnimation @c true to scroll the %ScrollPanel smoothly. @n + * else @c false. + * + */ + void SetScrollPosition(float position, bool withAnimation); + + /** * Scrolls to the bottom of %ScrollPanel. * @@ -358,6 +528,17 @@ public: Tizen::Graphics::Rectangle GetClientAreaBounds(void) const; + /* + * Gets the bounds of the client area. + * + * @since 2.1 + * + * @return The bounds of the client area + * + */ + Tizen::Graphics::FloatRectangle GetClientAreaBoundsF(void) const; + + /** * Sets the width of the client area. * @@ -373,6 +554,21 @@ public: result SetClientAreaWidth(int width); + /* + * Sets the width of the client area. + * + * @since 2.1 + * + * @return An error code + * @param[in] width The width of the client area to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c width is less than the width of %ScrollPanel + * @exception E_INVALID_OPERATION The width of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is vertical. + * + */ + result SetClientAreaWidth(float width); + + /** * Sets the height of the client area. * @@ -388,6 +584,21 @@ public: result SetClientAreaHeight(int height); + /* + * Sets the height of the client area. + * + * @since 2.1 + * + * @return An error code + * @param[in] height The height of the client area to set + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG @c height is less than the height of %ScrollPanel + * @exception E_INVALID_OPERATION The height of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is horizontal. + * + */ + result SetClientAreaHeight(float height); + + /** * Gets the scroll direction of the %ScrollPanel. * diff --git a/inc/FUiCtrlScrollPanelTypes.h b/inc/FUiCtrlScrollPanelTypes.h index 114013a..b4c250f 100644 --- a/inc/FUiCtrlScrollPanelTypes.h +++ b/inc/FUiCtrlScrollPanelTypes.h @@ -40,6 +40,19 @@ enum ScrollPanelScrollDirection SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL /**< Horizontal scroll mode */ }; +/** +* @enum ScrollInputMode +* +* Defines the scroll interaction mode +* +* @since 2.0 +*/ +enum ScrollInputMode +{ + SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION = 0, /**< Scroll interaction is available to any direction. */ + SCROLL_INPUT_MODE_RESTRICT_TO_INITIAL_DIRECTION /**< Scroll interaction is restricted to first direction. */ +}; + }}} // Tizen::Ui::Controls #endif // _FUI_CTRL_SCROLL_PANEL_TYPES_H_ diff --git a/inc/FUiCtrlSearchBar.h b/inc/FUiCtrlSearchBar.h old mode 100644 new mode 100755 index 2a94567..7bfaf7b --- a/inc/FUiCtrlSearchBar.h +++ b/inc/FUiCtrlSearchBar.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -376,6 +377,28 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, bool searchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH); + /* + * Initializes this instance of the %SearchBar control with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the control. + * @param[in] searchBarButton Set to @c true to display the search bar button, @n + * else @c false + * @param[in] keypadAction The keypad action + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or @n + * the action ID of the specified item must be a positive integer. + * @exception E_SYSTEM A system error has occurred. + * @remarks It is recommended that %SearchBar should be placed at the top-left corner of Form's client area. + * @remarks By default, a "Cancel" button is displayed if @c searchBarButton is set to @c true. When the user presses the cancel button, + * the %SearchBar control returns to SEARCH_BAR_MODE_NORMAL automatically. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool searchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH); + /** * Gets the content of Control. * @@ -433,7 +456,7 @@ public: * @since 2.0 * * @return An error code - * @param[in] show Set to @c true to perform show on the content area, @n + * @param[in] invalidate Set to @c true to perform invalidate on the content area, @n * else @c false * @exception E_SUCCESS The method is successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n @@ -484,6 +507,21 @@ public: */ result SetContentAreaSize(const Tizen::Graphics::Dimension& size); + /* + * Sets the size of the content area of the %SearchBar control. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The size of the content area + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The width and height of @c size must be greater than or equal to @c 0. + * @remarks The content area must be resized when the orientation of the form is changed once the size of the content area is changed. + * @see GetContentAreaSizeF() + */ + result SetContentAreaSize(const Tizen::Graphics::FloatDimension& size); + /** * Gets the size of the content area of the %SearchBar control. * @@ -497,6 +535,19 @@ public: */ Tizen::Graphics::Dimension GetContentAreaSize(void) const; + /* + * Gets the size of the content area of the %SearchBar control. + * + * @since 2.1 + * + * @return The size of the content area + * @remarks The content area is the area where the 'content' of the %SearchBar control is displayed. The size of the content areas can + * be changed at runtime. + * @see AddSearchBarEventListener() + * @see ISearchBarEventListener + */ + Tizen::Graphics::FloatDimension GetContentAreaSizeF(void) const; + // Modes /** * Gets the search bar mode. @@ -891,6 +942,20 @@ public: int GetSearchFieldTextSize(void) const; /** + * Gets the text size of the search field. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetSearchFieldTextSize() + */ + float GetSearchFieldTextSizeF(void) const; + + /** * Sets the text size of the text field of the %SearchBar control. * * @since 2.0 @@ -906,6 +971,21 @@ public: result SetSearchFieldTextSize(int size); /** + * Sets the text size of the text field of the %SearchBar control. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid, or @n + * the specified @c size cannot be a negative value. + * @exception E_SYSTEM A system error has occurred. + * @see GetSearchFieldTextSizeF() + */ + result SetSearchFieldTextSize(float size); + + /** * Gets the start and the end index of the currently selected text block. * * @since 2.0 @@ -1199,30 +1279,30 @@ public: result SetEllipsisPosition(EllipsisPosition position); /** - * Sets the input language. - * - * @since 2.0 - * - * @return An error code - * @param[in] languageCode The language to set - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks The application can set the language of the current keypad that is associated with the current %SearchBar. @n - * This method only works if the language to set is supported by the current preloaded keypad. - */ + * Sets the input language. + * + * @since 2.0 + * + * @return An error code + * @param[in] languageCode The language to set + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The application can set the language of the current keypad that is associated with the current %SearchBar. @n + * This method only works if the language to set is supported by the current preloaded keypad. + */ result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode); /** - * Gets the current input language. - * - * @since 2.0 - * - * @return An error code - * @param[out] language The current input language - * @exception E_SUCCESS The method is successful. - * @remarks The application can get the current language of the keypad that is associated with the current %SearchBar. - */ + * Gets the current input language. + * + * @since 2.0 + * + * @return An error code + * @param[out] language The current input language + * @exception E_SUCCESS The method is successful. + * @remarks The application can get the current language of the keypad that is associated with the current %SearchBar. + */ result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; @@ -1239,27 +1319,27 @@ public: KeypadAction GetKeypadAction(void) const; /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @see SetTextPredictionEnabled() - */ + * Checks whether the text prediction is enabled. + * + * @since 2.0 + * @return @c true if the text prediction is enabled, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @see SetTextPredictionEnabled() + */ bool IsTextPredictionEnabled(void) const; /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_UNSUPPORTED_OPERATION This operation is not supported. - * @see IsTextPredictionEnabled() - */ + * Enables or disables the text prediction. + * + * @since 2.0 + * @param[in] enable Set to @c true to enable the text prediction, @n + * else @c false + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_UNSUPPORTED_OPERATION This operation is not supported. + * @see IsTextPredictionEnabled() + */ result SetTextPredictionEnabled(bool enable); /** @@ -1381,30 +1461,50 @@ public: void RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener); /** - * Adds a listener instance for language events. @n - * The added listener is notified when the input language is changed. - * - * @since 2.0 - * - * @param[in] listener The listener to add - * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener. - * @see RemoveLanguageEventListener() - */ + * Adds a listener instance for language events. @n + * The added listener is notified when the input language is changed. + * + * @since 2.0 + * + * @param[in] listener The listener to add + * @remarks The application can recognize when the language is changed from the keypad by adding Tizen::Ui::ILanguageEventListener. + * @see RemoveLanguageEventListener() + */ void AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); /** - * Removes the specified listener instance. @n - * The removed listener cannot listen to events when they are fired. + * Removes the specified listener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddLanguageEventListener() + */ + + void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); + + /** + * Sets the text filter. * - * @since 2.0 + * @since 2.1 * - * @param[in] listener The listener to remove - * @see AddLanguageEventListener() + * @param[in] pFilter The filter + * @remarks The %SearchBar control checks with the registered filter to decide whether the user-entered text should be replaced. */ + void SetEditTextFilter(IEditTextFilter* pFilter); - void RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); - + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); protected: friend class _SearchBarImpl; diff --git a/inc/FUiCtrlSectionTableView.h b/inc/FUiCtrlSectionTableView.h index 4357851..b7202ce 100644 --- a/inc/FUiCtrlSectionTableView.h +++ b/inc/FUiCtrlSectionTableView.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlSectionTableView.h - * @brief This is the header file for the %SectionTableView class. - * - * This header file contains the declarations of the %SectionTableView class and its helper classes. - */ +* @file FUiCtrlSectionTableView.h +* @brief This is the header file for the %SectionTableView class. +* +* This header file contains the declarations of the %SectionTableView class and its helper classes. +*/ #ifndef _FUI_CTRL_SECTION_TABLE_VIEW_H_ #define _FUI_CTRL_SECTION_TABLE_VIEW_H_ @@ -29,13 +29,16 @@ #include #include #include +#include namespace Tizen { namespace Ui { namespace Controls { class ISectionTableViewItemProvider; +class ISectionTableViewItemProviderF; class ISectionTableViewItemEventListener; class IFastScrollListener; class IScrollEventListener; +class IScrollEventListenerF; /** * @class SectionTableView @@ -194,7 +197,7 @@ SectionTableViewSample::CreateItem(int sectionIndex, int itemIndex, int itemWidt TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL; TableViewItem* pItem = new TableViewItem(); - switch (itemIndex % 5) + switch (itemIndex % 6) { case 0: style = TABLE_VIEW_ANNEX_STYLE_NORMAL; @@ -211,6 +214,9 @@ SectionTableViewSample::CreateItem(int sectionIndex, int itemIndex, int itemWidt case 4: style = TABLE_VIEW_ANNEX_STYLE_RADIO; break; + case 5: + style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER; + break; default: break; } @@ -245,451 +251,563 @@ SectionTableViewSample::UpdateItem(int sectionIndex, int itemIndex, TableViewIte * @endcode * */ - class _OSP_EXPORT_ SectionTableView : public Tizen::Ui::Container { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ SectionTableView(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~SectionTableView(void); /** - * Initializes this instance of %SectionTableView with the specified parameters. - * - * @since 2.0 - * - * @return An error code - * @param[in] rect An instance of the Graphics::Rectangle class - * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height. - * @param[in] itemDivider Set to @c true to display an item divider, @n - * else @c false - * @param[in] scrollStyle The style of %SectionTableView scroll bar style - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. - * - */ + * Initializes this instance of %SectionTableView with the specified parameters. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect An instance of the Graphics::Rectangle class + * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %SectionTableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); - /** - * Sets the item provider that creates and deletes items for the section style table view. - * - * @since 2.0 - * - * @param[in] pProvider The item provider to create and delete items - * @remarks If an item provider is not set for the table view, the table view does not work. - * The specified provider should be allocated in heap memory. - */ + /* + * Initializes this instance of %SectionTableView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class + * This instance represents the x and y coordinates of the left top corner of the created %SectionTableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %SectionTableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); + + /** + * Sets the item provider that creates and deletes items for the section style table view. + * + * @since 2.0 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. + * The specified provider should be allocated in heap memory. + */ void SetItemProvider(ISectionTableViewItemProvider* pProvider); - /** - * Sets the color of a section. - * - * @since 2.0 - * - * @param[in] color The section color - * @remarks This method works only when the style of the %SectionTableView control is TABLE_VIEW_STYLE_SECTION. - */ + /* + * Sets the item provider that creates and deletes items for the section style table view. + * + * @since 2.1 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. + * The specified provider should be allocated in heap memory. + */ + void SetItemProviderF(ISectionTableViewItemProviderF* pProvider); + + /** + * Sets the color of a section. + * + * @since 2.0 + * + * @param[in] color The section color + * @remarks This method works only when the style of the %SectionTableView control is TABLE_VIEW_STYLE_SECTION. + */ void SetSectionColor(const Tizen::Graphics::Color& color); /** - * Gets the color of a section. - * - * @since 2.0 - * - * @return The section color - */ + * Gets the color of a section. + * + * @since 2.0 + * + * @return The section color + */ Tizen::Graphics::Color GetSectionColor(void) const; /** - * Sets the grouped look is enabled. - * - * @since 2.0 - * - * @param[in] enable The enabled/disabled status - */ + * Sets the grouped look is enabled. + * + * @since 2.0 + * + * @param[in] enable The enabled/disabled status + */ void SetGroupedLookEnabled(bool enable); /** - * Returns whether the grouped look is enabled or not. - * - * @since 2.0 - * - * @return @c true if the grouped look is enabled, else @c false - */ + * Returns whether the grouped look is enabled or not. + * + * @since 2.0 + * + * @return @c true if the grouped look is enabled, else @c false + */ bool IsGroupedLookEnabled(void) const; /** - * Adds a listener instance that listens to state changes of table view items. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of table view items. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener); /** - * Removes a listener instance that listens to state changes of table view items. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of table view items. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener); /** - * Adds a listener instance that listens to state changes of a fast scroll. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a fast scroll. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddFastScrollListener(IFastScrollListener& listener); /** - * Removes a listener instance that listens to state changes of a fast scroll. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a fast scroll. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveFastScrollListener(IFastScrollListener& listener); /** - * Adds a listener instance that listens to state changes of a scroll event. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @see IScrollEventListener::OnScrollEndReached() - * @see RemoveScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListener::OnScrollEndReached() + * @see RemoveScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddScrollEventListener(IScrollEventListener& listener); /** - * Removes a listener instance that listens to state changes of a scroll event. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @see IScrollEventListener::OnScrollEndReached() - * @see AddScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListener::OnScrollEndReached() + * @see AddScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveScrollEventListener(IScrollEventListener& listener); - /** - * Sets the text index of the fast scroll. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text of the index - * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - */ + /* + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListenerF::OnScrollEndReached() + * @see RemoveScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ + result AddScrollEventListener(IScrollEventListenerF& listener); + + /* + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListenerF::OnScrollEndReached() + * @see AddScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ + result RemoveScrollEventListener(IScrollEventListenerF& listener); + + /** + * Sets the text index of the fast scroll. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text of the index + * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon); /** - * Gets the section and item indexes of the top item. - * - * @since 2.0 - * - * @return An error code - * @param[out] sectionIndex The section index - * @param[out] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Top drawn item is not found. - */ + * Gets the section and item indexes of the top item. + * + * @since 2.0 + * + * @return An error code + * @param[out] sectionIndex The section index + * @param[out] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Top drawn item is not found. + */ result GetTopDrawnItemIndex(int& sectionIndex, int& itemIndex) const; /** - * Gets the section and item indexes of the bottom item. - * - * @since 2.0 - * - * @return An error code - * @param[out] sectionIndex The section index - * @param[out] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. - */ + * Gets the section and item indexes of the bottom item. + * + * @since 2.0 + * + * @return An error code + * @param[out] sectionIndex The section index + * @param[out] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. + */ result GetBottomDrawnItemIndex(int& sectionIndex, int& itemIndex) const; /** - * Scrolls to the item at the specified index. - * The specified item is drawn at the position specified by the item alignment. - * - * @since 2.0 - * - * @return An error code - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] itemAlignment The item alignment - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Scrolls to the item at the specified index. + * The specified item is drawn at the position specified by the item alignment. + * + * @since 2.0 + * + * @return An error code + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] itemAlignment The item alignment + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result ScrollToItem(int sectionIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP); /** - * Checks or unchecks the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] check Set to @c true to select the item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @exception E_INVALID_OPERATION The item is disabled. - * @remarks This method works only when the annex style of the item allows selection. - */ + * Checks or unchecks the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] check Set to @c true to select the item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The item is disabled. + * @remarks This method works only when the annex style of the item allows selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemChecked(int sectionIndex, int itemIndex, bool check); /** - * Returns whether the item at the specified index is selected or not. - * - * @since 2.0 - * - * @return @c true if the item is selected, @n - * else @c false - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks This method returns @c false, if the annex style of the item does not allow selection. - */ + * Returns whether the item at the specified index is selected or not. + * + * @since 2.0 + * + * @return @c true if the item is selected, @n + * else @c false + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method returns @c false, if the annex style of the item does not allow selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsItemChecked(int sectionIndex, int itemIndex) const; /** - * Enables or disables the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] enable Set to @c true to enable the specified item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Enables or disables the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] enable Set to @c true to enable the specified item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemEnabled(int sectionIndex, int itemIndex, bool enable); /** - * Returns whether the item at the specified index is enabled or disabled. - * - * @since 2.0 - * - * @return @c true if the item is enabled, @n - * else @c false - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Returns whether the item at the specified index is enabled or disabled. + * + * @since 2.0 + * + * @return @c true if the item is enabled, @n + * else @c false + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsItemEnabled(int sectionIndex, int itemIndex) const; /** - * Counts the total number of sections. - * - * @since 2.0 - * - * @return The total number of sections - */ + * Counts the total number of sections. + * + * @since 2.0 + * + * @return The total number of sections + */ int GetSectionCount(void) const; /** - * Counts all the items of the specified section. - * - * @since 2.0 - * - * @return The total number of items in the specified section - * @param[in] sectionIndex The section index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Counts all the items of the specified section. + * + * @since 2.0 + * + * @return The total number of items in the specified section + * @param[in] sectionIndex The section index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + */ int GetItemCountAt(int sectionIndex) const; /** - * Updates the specified item. @n - * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the - * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. - * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. - * - * @since 2.0 - * - * @return An error code - * @param[in] sectionIndex The section index - * @param[in] itemIndex The item index - * @param[in] type The item to be added, removed, or modified - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks If the specified item. itemIndex is -1, then the method is applied to the section item with the given index. - * Note that if TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a section item, all the items in the section (including the section item itself) are - * removed from the table view. - */ + * Updates the specified item. @n + * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the + * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. + * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. + * + * @since 2.0 + * + * @return An error code + * @param[in] sectionIndex The section index + * @param[in] itemIndex The item index + * @param[in] type The item to be added, removed, or modified + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks If the specified item. itemIndex is -1, then the method is applied to the section item with the given index. + * Note that if TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE option is used to a section item, all the items in the section (including the section item itself) are + * removed from the table view. + */ result RefreshItem(int sectionIndex, int itemIndex, TableViewRefreshType type); /** - * Updates all the items of a table view. - * - * @since 2.0 - * - * @return An error code - * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. - */ + * Updates all items of the table view. @n + * Note that calling this method invokes its item provider's UpdateItem() for all loaded items. + * + * @since 2.1 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The %SectionTableView item provider is processing the other request. + */ + result RefreshAllItems(void); + + /** + * Updates all the items of a table view. + * + * @since 2.0 + * + * @return An error code + * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. + */ void UpdateTableView(void); /** - * Gets the index of the item at the specified position. - * - * @since 2.0 - * - * @param[in] position The position of the item - * @param[out] sectionIndex The section index of the item on specified position - * @param[out] itemIndex The item index of the item on specified position - * @remarks This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position. - */ + * Gets the index of the item at the specified position. + * + * @since 2.0 + * + * @param[in] position The position of the item + * @param[out] sectionIndex The section index of the item on specified position + * @param[out] itemIndex The item index of the item on specified position + * @remarks This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& sectionIndex, int& itemIndex) const; - /** - * Sets the color of a division line between items. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The division line color - */ + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @param[in] position The position of the item + * @param[out] sectionIndex The section index of the item on specified position + * @param[out] itemIndex The item index of the item on specified position + * @remarks This method sets both of sectionIndex and itemIndex to -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& sectionIndex, int& itemIndex) const; + + /** + * Sets the color of a division line between items. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The division line color + */ void SetItemDividerColor(const Tizen::Graphics::Color& color); /** - * Gets the color of a division line between items. - * - * @since 2.0 - * - * @return The color of a division line - */ + * Gets the color of a division line between items. + * + * @since 2.0 + * + * @return The color of a division line + */ Tizen::Graphics::Color GetItemDividerColor(void) const; /** - * Sets the background color of this control. - * - * @since 2.0 - * - * @param[in] color The background color - * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, - * only the bitmap image is displayed. - */ + * Sets the background color of this control. + * + * @since 2.0 + * + * @param[in] color The background color + * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, + * only the bitmap image is displayed. + */ void SetBackgroundColor(const Tizen::Graphics::Color& color); /** - * Gets the background color of this control. - * - * @since 2.0 - * - * @return The background color - */ + * Gets the background color of this control. + * + * @since 2.0 + * + * @return The background color + */ Tizen::Graphics::Color GetBackgroundColor(void) const; /** - * Sets the scroll input handling mode. - * - * @since 2.0 - * - * @param[in] mode The scroll input handling mode - * @see GetScrollInputMode() - */ + * Sets the scroll input handling mode. + * + * @since 2.0 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ void SetScrollInputMode(ScrollInputMode mode); /** - * Gets the scroll input handling mode. - * - * @since 2.0 - * - * @return The scroll input handling mode - * @see SetScrollInputMode() - */ + * Gets the scroll input handling mode. + * + * @since 2.0 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ ScrollInputMode GetScrollInputMode(void) const; /* - * Scrolls the list contents with the amount of pixels. - * - * @since 2.0 - * - * @return An error code - * @param[in] pixel The amount of pixels to scroll - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. - * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. - * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. - */ + * Scrolls the list contents with the amount of pixels. + * + * @since 2.0 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ result ScrollByPixel(int pixel); /* - * Gets the current scroll position - * - * @since 2.0 - */ + * Scrolls the list contents with the amount of pixels. + * + * @since 2.1 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ + result ScrollByPixel(float pixel); + + /* + * Gets the current scroll position + * + * @since 2.0 + */ int GetCurrentScrollPosition(void) const; /* - * Enables or disables the scroll of SectionTableView items. - * - * @since 2.0 - */ + * Gets the current scroll position + * + * @since 2.1 + */ + float GetCurrentScrollPositionF(void) const; + + /* + * Enables or disables the scroll of SectionTableView items. + * + * @since 2.0 + */ void SetScrollEnabled(bool enable); /* - * Checks whether the scroll is enabled or disabled. - * - * @since 2.0 - */ + * Checks whether the scroll is enabled or disabled. + * + * @since 2.0 + */ bool IsScrollEnabled(void) const; private: diff --git a/inc/FUiCtrlSimpleItem.h b/inc/FUiCtrlSimpleItem.h index 00bf28b..1be5a7e 100644 --- a/inc/FUiCtrlSimpleItem.h +++ b/inc/FUiCtrlSimpleItem.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,19 @@ public: */ result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + /* + * Initializes this instance of %SimpleItem with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); + /** * Sets the text string and bitmap image for %SimpleItem. * diff --git a/inc/FUiCtrlSlider.h b/inc/FUiCtrlSlider.h index bc01d84..20aaae9 100644 --- a/inc/FUiCtrlSlider.h +++ b/inc/FUiCtrlSlider.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlSlider.h * @brief This is the header file for the %Slider class. @@ -34,7 +35,6 @@ #include #include #include -#include #include #include @@ -164,6 +164,33 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, BackgroundStyle backgroundStyle = BACKGROUND_STYLE_DEFAULT, bool showTitle = false, int minValue = 0, int maxValue = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); + /* + * Initializes this instance of %Slider with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the control. + * @param[in] backgroundStyle The background style set of the slider + * @param[in] showTitle Set to @c true to enable the show title, @n + * else @c false + * @param[in] minValue The minimum slider value + * @param[in] maxValue The maximum slider value + * @param[in] groupStyle The table view style of the slider + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n + * The background style of BACKGROUND_STYLE_NONE does not work with group styles except GROUP_STYLE_NONE. + * @exception E_OUT_OF_RANGE The specified values are less than @c -99 or greater than @c 999. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully usable only after it has been added to a container. Therefore, some methods may fail if used earlier. @n + * If the given size is less than the minimum, it returns E_INVALID_ARG. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, BackgroundStyle backgroundStyle = BACKGROUND_STYLE_DEFAULT, bool showTitle = false, int minValue = 0, int maxValue = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); + /** * Adds a IAdjustmentEventListener instance. @n * The added listener listens to events on the context of the specified event dispatcher when they are fired. @@ -243,15 +270,15 @@ public: void SetIcon(IconPosition position, const Tizen::Graphics::Bitmap& icon); /** - * Sets the title of the slider. - * - * @since 2.0 - * - * @return An error code - * @param[in] title The title to be set - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ + * Sets the title of the slider. + * + * @since 2.0 + * + * @return An error code + * @param[in] title The title to be set + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ result SetTitleText(const Tizen::Base::String& title); /** @@ -259,8 +286,9 @@ public: * * @since 2.0 * - * @return The title text of the entered string, @n - * else an empty string if the %Slider instance is not constructed + * @return The title text of the entered string + * + * @remarks By default returns an empty string. */ Tizen::Base::String GetTitleText(void) const; @@ -307,6 +335,31 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, unsigned long sliderStyle, int minValue = 0, int maxValue = 100); + /* + * Initializes this instance of %Slider with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * its width and height. + * @param[in] sliderStyle The style of the slider @n + * Multiple link types can be combined using bitwise OR operator. See Tizen::Ui::Controls::SliderStyle. + * @param[in] minValue The minimum slider value + * @param[in] maxValue The maximum slider value + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified minimum and maximum values are less than @c -99, or greater than @c 999. + * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified @c minValue is greater than @c maxVaue. + * @exception E_SYSTEM A system error has occurred. + * @remarks A control is fully functional only after it has been added to a container. Therefore, some methods may fail if they are used before + * adding the control to the container. @n + * If the specified size is less than the minimum size, the %Slider control is constructed with the minimum size. + * @remarks The width and the height of the control must be greater than @c 0. + * @remarks The size of the control must be within the range defined by the minimum size and the maximum size. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, unsigned long sliderStyle, int minValue = 0, int maxValue = 100); + /** * Adds a ISliderEventListener instance. @n * The added listener can listen to the slider-related events. @@ -353,6 +406,29 @@ public: Tizen::Graphics::Color GetBarColor(void) const; /** + * Sets the background color of the bar. + * + * @since 2.1 + * + * @param[in] color The color to be set + * @remarks The method ignores the alpha value of the @c color parameter and sets the alpha value to @c 255. + * @see GetBarBackgroundColor() + */ + void SetBarBackgroundColor(const Tizen::Graphics::Color& barBackgroundColor); + + /** + * Gets the background color of the bar. + * + * @since 2.1 + * + * @return The background color of the bar, @n + * else RGBA(0, 0, 0, 0) if an error occurs + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetBarBackgroundColor() + */ + Tizen::Graphics::Color GetBarBackgroundColor(void) const; + + /** * Sets the color of the slider. * * @since 2.0 diff --git a/inc/FUiCtrlSliderTypes.h b/inc/FUiCtrlSliderTypes.h index c22f1a9..e781a3b 100644 --- a/inc/FUiCtrlSliderTypes.h +++ b/inc/FUiCtrlSliderTypes.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlSliderTypes.h * @brief This is the header file for the SliderStyle enumerations. @@ -42,12 +43,12 @@ enum SliderStyle }; /** - * @enum SliderThumbStatus - * - * Defines the possible states of the slider thumb. - * - * @since 2.0 - */ +* @enum SliderThumbStatus +* +* Defines the possible states of the slider thumb. +* +* @since 2.0 +*/ enum SliderThumbStatus { diff --git a/inc/FUiCtrlSplitPanel.h b/inc/FUiCtrlSplitPanel.h old mode 100644 new mode 100755 index 8d7b5c1..eab92ad --- a/inc/FUiCtrlSplitPanel.h +++ b/inc/FUiCtrlSplitPanel.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlSplitPanel.h - * @brief This is the header file for the %SplitPanel class. - * - * This header file contains the declarations of the %SplitPanel class. - */ +* @file FUiCtrlSplitPanel.h +* @brief This is the header file for the %SplitPanel class. +* +* This header file contains the declarations of the %SplitPanel class. +*/ #ifndef _FUI_CTRL_SPLIT_PANEL_H_ #define _FUI_CTRL_SPLIT_PANEL_H_ @@ -34,6 +34,7 @@ namespace Tizen { namespace Ui { namespace Controls { class ISplitPanelEventListener; +class ISplitPanelEventListenerF; /** * @class SplitPanel @@ -132,6 +133,22 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); + /* + * Initializes this instance of %SplitPanel with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The location and size of the %SplitPanel control as a FloatRectangle instance. + * @param[in] splitPanelDividerStyle The divider style of the %SplitPanel control + * @param[in] splitPanelDividerDirection The divider direction of the %SplitPanel control @n + * The specified divider direction determines the divider is vertical or horizontal. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); + + /** * Adds a ISplitPanelEventListener instance. @n * The added listener listens to events on the context of the specified event dispatcher when they are fired. @@ -144,6 +161,18 @@ public: */ result AddSplitPanelEventListener(ISplitPanelEventListener& listener); + /* + * Adds a ISplitPanelEventListenerF instance. @n + * The added listener listens to events on the context of the specified event dispatcher when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be added + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The event listener already exists. + */ + result AddSplitPanelEventListener(ISplitPanelEventListenerF& listener); + /** * Removes a ISplitPanelEventListener instance. @n * The removed listener cannot listen to events when they are fired. @@ -156,6 +185,18 @@ public: */ result RemoveSplitPanelEventListener(ISplitPanelEventListener& listener); + /* + * Removes a ISplitPanelEventListenerF instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @param[in] listener The event listener to be removed + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The event listener is not found. + */ + result RemoveSplitPanelEventListener(ISplitPanelEventListenerF& listener); + /** * Sets the pane to the %SplitPanel control. * @@ -196,11 +237,32 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @see GetDividerPosition() - * @see SetMaximumDividerPosition(), GetMaximumDividerPosition() - * @see SetMinimumDividerPosition(), GetMinimumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + * @remarks This Api sets the value to current orientation. The divider position must be reset when the orientation of the form is changed. */ result SetDividerPosition(int position); + /* + * Sets the divider position of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of divider + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @see GetDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + * @remarks This Api sets the value to current orientation. The divider position must be reset when the orientation of the form is changed. + */ + result SetDividerPosition(float position); + /** * Gets the current divider position of the control. * @@ -209,11 +271,28 @@ public: * @return The current divider position * @remarks The specific error code can be accessed using the GetLastResult() method. * @see SetDividerPosition() - * @see SetMaximumDividerPosition(), GetMaximumDividerPosition() - * @see SetMinimumDividerPosition(), GetMinimumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() */ int GetDividerPosition(void) const; + /* + * Gets the current divider position of the control. + * + * @since 2.1 + * + * @return The current divider position + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + */ + float GetDividerPositionF(void) const; + /** * Sets the divider maximum position of the control. * @@ -224,10 +303,28 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @see GetMaximumDividerPosition() - * @see SetMinimumDividerPosition(), GetMinimumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + * @remarks This Api sets the value to current orientation. The maximum divider position must be reset when the orientation of the form is changed. */ result SetMaximumDividerPosition(int position); + /* + * Sets the divider maximum position of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of divider. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @see GetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + * @remarks This Api sets the value to current orientation. The maximum divider position must be reset when the orientation of the form is changed. + */ + result SetMaximumDividerPosition(float position); + /** * Gets the maximum divider position. * @@ -235,10 +332,23 @@ public: * * @return The maximum divider position of the control. * @see SetMaximumDividerPosition() - * @see SetMinimumDividerPosition(), GetMinimumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() */ int GetMaximumDividerPosition(void) const; + /* + * Gets the maximum divider position. + * + * @since 2.1 + * + * @return The maximum divider position of the control. + * @see SetMaximumDividerPosition() + * @see SetMinimumDividerPosition() + * @see GetMinimumDividerPosition() + */ + float GetMaximumDividerPositionF(void) const; + /** * Sets the divider minimum position of the control. * @@ -249,10 +359,28 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_RANGE A specified input parameter is invalid. * @see GetMinimumDividerPosition() - * @see SetMaximumDividerPosition(), GetMaximumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @remarks This Api sets the value to current orientation. The minimum divider position must be reset when the orientation of the form is changed. */ result SetMinimumDividerPosition(int position); + /* + * Sets the divider minimum position of the control. + * + * @since 2.1 + * + * @return An error code + * @param[in] position The position of divider. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @see GetMinimumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + * @remarks This Api sets the value to current orientation. The minimum divider position must be reset when the orientation of the form is changed. + */ + result SetMinimumDividerPosition(float position); + /** * Gets the minimum divider position. * @@ -260,10 +388,23 @@ public: * * @return The minimum divider position of the control. * @see SetMinimumDividerPosition() - * @see SetMaximumDividerPosition(), GetMaximumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() */ int GetMinimumDividerPosition(void) const; + /* + * Gets the minimum divider position. + * + * @since 2.1 + * + * @return The minimum divider position of the control. + * @see SetMinimumDividerPosition() + * @see SetMaximumDividerPosition() + * @see GetMaximumDividerPosition() + */ + float GetMinimumDividerPositionF(void) const; + /** * Maximizes the specified pane. * diff --git a/inc/FUiCtrlTab.h b/inc/FUiCtrlTab.h index 8b1b508..b34494d 100644 --- a/inc/FUiCtrlTab.h +++ b/inc/FUiCtrlTab.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlTab.h * @brief This is the header file for the %Tab class. diff --git a/inc/FUiCtrlTabBar.h b/inc/FUiCtrlTabBar.h index 05e59c8..1d834b2 100644 --- a/inc/FUiCtrlTabBar.h +++ b/inc/FUiCtrlTabBar.h @@ -193,6 +193,22 @@ public: */ result Construct(int x, int y, int width); + /* + * Initializes this instance of %TabBar with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] x The X position of the top left corner + * @param[in] y The Y position of the top left corner + * @param[in] width The width + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(float x, float y, float width); + // Operation public: @@ -435,6 +451,20 @@ public: */ result SetWidth(int width); + /* + * Sets the width of the tab bar. + * + * @since 2.1 + * + * @return An error code + * @param[in] width The width + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @exception E_SYSTEM A system error has occurred. + */ + result SetWidth(float width); + //Listeners public: diff --git a/inc/FUiCtrlTableView.h b/inc/FUiCtrlTableView.h index ad142df..0da36ba 100644 --- a/inc/FUiCtrlTableView.h +++ b/inc/FUiCtrlTableView.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableView.h - * @brief This is the header file for the %TableView class. - * - * This header file contains the declarations of the %TableView class and its helper classes. - */ +* @file FUiCtrlTableView.h +* @brief This is the header file for the %TableView class. +* +* This header file contains the declarations of the %TableView class and its helper classes. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_H_ #define _FUI_CTRL_TABLE_VIEW_H_ @@ -29,13 +29,16 @@ #include #include #include +#include namespace Tizen { namespace Ui { namespace Controls { class ITableViewItemProvider; +class ITableViewItemProviderF; class ITableViewItemEventListener; class IFastScrollListener; class IScrollEventListener; +class IScrollEventListenerF; /** * @class TableView @@ -180,7 +183,7 @@ TableViewSample::CreateItem(int itemIndex, int itemWidth) TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL; TableViewItem* pItem = new TableViewItem(); - switch (itemIndex % 5) + switch (itemIndex % 6) { case 0: style = TABLE_VIEW_ANNEX_STYLE_NORMAL; @@ -197,6 +200,9 @@ TableViewSample::CreateItem(int itemIndex, int itemWidth) case 4: style = TABLE_VIEW_ANNEX_STYLE_RADIO; break; + case 5: + style = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER; + break; default: break; } @@ -237,412 +243,524 @@ class _OSP_EXPORT_ TableView { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ TableView(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~TableView(void); /** - * Initializes this instance of %TableView with the specified parameters. - * - * @since 2.0 - * - * @return An error code - * @param[in] rect An instance of the Graphics::Rectangle class - * This instance represents the x and y coordinates of the left top corner of the created %TableView along with the width and height. - * @param[in] itemDivider Set to @c true to display an item divider, @n - * else @c false - * @param[in] scrollStyle The style of %TableView scroll bar style - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. - * - */ + * Initializes this instance of %TableView with the specified parameters. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect An instance of the Graphics::Rectangle class + * This instance represents the x and y coordinates of the left top corner of the created %TableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %TableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ result Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); + /* + * Initializes this instance of %TableView with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class + * This instance represents the x and y coordinates of the left top corner of the created %TableView along with the width and height. + * @param[in] itemDivider Set to @c true to display an item divider, @n + * else @c false + * @param[in] scrollStyle The style of %TableView scroll bar style + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid, or either the rect.width or rect.height parameter has a negative value. + * + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle); + /** - * Sets the item provider that creates and deletes items for the simple style table view. - * - * @since 2.0 - * - * @param[in] pProvider The item provider to create and delete items - * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. - * To reset the item provider, pass @c null to @c pProvider. - */ + * Sets the item provider that creates and deletes items for the simple style table view. + * + * @since 2.0 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. + * To reset the item provider, pass @c null to @c pProvider. + */ void SetItemProvider(ITableViewItemProvider* pProvider); + /* + * Sets the item provider that creates and deletes items for the simple style table view. + * + * @since 2.1 + * + * @param[in] pProvider The item provider to create and delete items + * @remarks If an item provider is not set for the table view, the table view does not work. The specified provider should be allocated in heap memory. + * To reset the item provider, pass @c null to @c pProvider. + */ + void SetItemProviderF(ITableViewItemProviderF* pProvider); + /** - * Begins the reordering mode. - * - * @since 2.0 - * - * @see ITableViewViewItemEventListener::OnTableViewItemReordered() - */ + * Begins the reordering mode. + * + * @since 2.0 + * + * @see ITableViewViewItemEventListener::OnTableViewItemReordered() + */ void BeginReorderingMode(void); /** - * Ends the reordering mode. - * - * @since 2.0 - * - * @see ITableViewViewItemEventListener::OnTableViewItemReordered() - */ + * Ends the reordering mode. + * + * @since 2.0 + * + * @see ITableViewViewItemEventListener::OnTableViewItemReordered() + */ void EndReorderingMode(void); /** - * Returns whether the %TableView control is in reordering mode or not. - * - * @since 2.0 - * - * @return @c true if the %TableView is in reordering mode, @n - * else @c false - */ + * Returns whether the %TableView control is in reordering mode or not. + * + * @since 2.0 + * + * @return @c true if the %TableView is in reordering mode, @n + * else @c false + */ bool IsInReorderingMode(void) const; /** - * Adds a listener instance that listens to state changes of table view items. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of table view items. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddTableViewItemEventListener(ITableViewItemEventListener& listener); /** - * Removes a listener instance that listens to state changes of table view items. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of table view items. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveTableViewItemEventListener(ITableViewItemEventListener& listener); /** - * Adds a listener instance that listens to state changes of a fast scroll. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a fast scroll. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddFastScrollListener(IFastScrollListener& listener); /** - * Removes a listener instance that listens to state changes of a fast scroll. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a fast scroll. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveFastScrollListener(IFastScrollListener& listener); /** - * Adds a listener instance that listens to state changes of a scroll event. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @see IScrollEventListener::OnScrollEndReached() - * @see RemoveScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @remarks The specified listener should be allocated in heap memory. - */ + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListener::OnScrollEndReached() + * @see RemoveScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ result AddScrollEventListener(IScrollEventListener& listener); /** - * Removes a listener instance that listens to state changes of a scroll event. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to remove - * @see IScrollEventListener::OnScrollEndReached() - * @see AddScrollEventListener() - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_OBJ_NOT_FOUND The listener is not found. - */ + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListener::OnScrollEndReached() + * @see AddScrollEventListener() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ result RemoveScrollEventListener(IScrollEventListener& listener); + /* + * Adds a listener instance that listens to state changes of a scroll event. @n + * The added listener can listen to events on the specified event dispatcher's context when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to add + * @see IScrollEventListenerF::OnScrollEndReached() + * @see RemoveScrollEventListenerF() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @remarks The specified listener should be allocated in heap memory. + */ + result AddScrollEventListener(IScrollEventListenerF& listener); + + /* + * Removes a listener instance that listens to state changes of a scroll event. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.1 + * + * @return An error code + * @param[in] listener The event listener to remove + * @see IScrollEventListenerF::OnScrollEndReached() + * @see AddScrollEventListenerF() + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + * @exception E_OBJ_NOT_FOUND The listener is not found. + */ + result RemoveScrollEventListener(IScrollEventListenerF& listener); + /** - * Sets the index table view of the scroll by texts. - * - * @since 2.0 - * - * @return An error code - * @param[in] text The text of the index - * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - */ + * Sets the index table view of the scroll by texts. + * + * @since 2.0 + * + * @return An error code + * @param[in] text The text of the index + * @param[in] useSearchIcon Set to @c true to show the magnifying icon, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. + */ result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon); /** - * Gets the group and item indexes of the top item. - * - * @since 2.0 - * - * @return The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Top drawn item is not found. - */ + * Gets the group and item indexes of the top item. + * + * @since 2.0 + * + * @return The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Top drawn item is not found. + */ int GetTopDrawnItemIndex(void) const; /** - * Gets the group and item indexes of the bottom item. - * - * @since 2.0 - * - * @return The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. - */ + * Gets the group and item indexes of the bottom item. + * + * @since 2.0 + * + * @return The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND Bottom drawn item is not found. + */ int GetBottomDrawnItemIndex(void) const; /** - * Scrolls to the item at the specified index. - * The specified item is drawn at the position specified by the item alignment. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemIndex The targeted item index - * @param[in] itemAlignment The item alignment - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Scrolls to the item at the specified index. + * The specified item is drawn at the position specified by the item alignment. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemIndex The targeted item index + * @param[in] itemAlignment The item alignment + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result ScrollToItem(int itemIndex, TableViewScrollItemAlignment itemAlignment = TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP); /** - * Checks or unchecks the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemIndex The item index to be checked - * @param[in] check Set to @c true to select the item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @exception E_INVALID_OPERATION The item is disabled. - * @remarks This method works only when the annex style of the item allows selection. - */ + * Checks or unchecks the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemIndex The item index to be checked + * @param[in] check Set to @c true to select the item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @exception E_INVALID_OPERATION The item is disabled. + * @remarks This method works only when the annex style of the item allows selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemChecked(int itemIndex, bool check); /** - * Returns whether the item at the specified index is selected or not. - * - * @since 2.0 - * - * @return @c true if the item is selected, @n - * else @c false - * @param[in] itemIndex The item itemIndex - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks This method returns @c false, if the annex style of the item does not allow selection. - */ + * Returns whether the item at the specified index is selected or not. + * + * @since 2.0 + * + * @return @c true if the item is selected, @n + * else @c false + * @param[in] itemIndex The item itemIndex + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method returns @c false, if the annex style of the item does not allow selection. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsItemChecked(int itemIndex) const; /** - * Enables or disables the item at the specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemIndex The item index - * @param[in] enable Set to @c true to enable the specified item, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Enables or disables the item at the specified index. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemIndex The item index + * @param[in] enable Set to @c true to enable the specified item, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ result SetItemEnabled(int itemIndex, bool enable); /** - * Returns whether the item at the specified index is enabled or disabled. - * - * @since 2.0 - * - * @return @c true if the item is enabled, @n - * else @c false - * @param[in] itemIndex The item index - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - */ + * Returns whether the item at the specified index is enabled or disabled. + * + * @since 2.0 + * + * @return @c true if the item is enabled, @n + * else @c false + * @param[in] itemIndex The item index + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ bool IsItemEnabled(int itemIndex) const; /** - * Counts all the items of the specified group. - * - * @since 2.0 - * - * @return The total number of items - */ + * Counts all the items of the specified group. + * + * @since 2.0 + * + * @return The total number of items + */ int GetItemCount(void) const; /** - * Updates the specified item. @n - * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the - * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. - * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemIndex The item index - * @param[in] type The item to be added, removed, or modified - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE A specified input parameter is invalid. - * @remarks If the specified itemIndex. - */ + * Updates the specified item. @n + * For instance, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD is used when a new item needs to be added and TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE is used when an item is deleted from the + * table view. Moreover, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY is used when the content of an existing item has changed and it needs to be updated. + * Note that calling this method with TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY invokes item provider's UpdateItem() for the given index in sequence. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemIndex The item index + * @param[in] type The item to be added, removed, or modified + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE A specified input parameter is invalid. + * @remarks If the specified itemIndex. + */ result RefreshItem(int itemIndex, TableViewRefreshType type); /** - * Updates all the items of a table view. - * - * @since 2.0 - * - * @return An error code - * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. - */ + * Updates all items of the table view. @n + * Note that calling this method invokes its item provider's UpdateItem() for all loaded items. + * + * @since 2.1 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The %TableView item provider is processing the other request. + */ + result RefreshAllItems(void); + + /** + * Updates all the items of a table view. + * + * @since 2.0 + * + * @return An error code + * @remarks This method clears all the items in the table view and invokes the methods of the item provider again to update the table view. + */ void UpdateTableView(void); /** - * Gets the index of the item at the specified position. - * - * @since 2.0 - * - * @return The item index of the item on specified position - * @param[in] position The position of the item - * @remarks This method returns -1 if no item is found at the given position. - */ + * Gets the index of the item at the specified position. + * + * @since 2.0 + * + * @return The item index of the item on specified position + * @param[in] position The position of the item + * @remarks This method returns -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + /* + * Gets the index of the item at the specified position. + * + * @since 2.1 + * + * @return The item index of the item on specified position + * @param[in] position The position of the item + * @remarks This method returns -1 if no item is found at the given position. + * @remarks This method should be called only after TableView items are created. If this method needs to be called early in the lifecycle of the TableView, then UpdateTableView() method should be called explicitly (e.g. during Tizen::Ui::Control::OnInitializing()). + */ + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; + /** - * Sets the color of a division line between items. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The division line color - */ + * Sets the color of a division line between items. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The division line color + */ void SetItemDividerColor(const Tizen::Graphics::Color& color); /** - * Gets the color of a division line between items. - * - * @since 2.0 - * - * @return The color of a division line - */ + * Gets the color of a division line between items. + * + * @since 2.0 + * + * @return The color of a division line + */ Tizen::Graphics::Color GetItemDividerColor(void) const; /** - * Sets the background color of this control. - * - * @since 2.0 - * - * @param[in] color The background color - * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, - * only the bitmap image is displayed. - */ + * Sets the background color of this control. + * + * @since 2.0 + * + * @param[in] color The background color + * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, + * only the bitmap image is displayed. + */ void SetBackgroundColor(const Tizen::Graphics::Color& color); /** - * Gets the background color of this control. - * - * @since 2.0 - * - * @return The background color - */ + * Gets the background color of this control. + * + * @since 2.0 + * + * @return The background color + */ Tizen::Graphics::Color GetBackgroundColor(void) const; /** - * Sets the scroll input handling mode. - * - * @since 2.0 - * - * @param[in] mode The scroll input handling mode - * @see GetScrollInputMode() - */ + * Sets the scroll input handling mode. + * + * @since 2.0 + * + * @param[in] mode The scroll input handling mode + * @see GetScrollInputMode() + */ void SetScrollInputMode(ScrollInputMode mode); /** - * Gets the scroll input handling mode. - * - * @since 2.0 - * - * @return The scroll input handling mode - * @see SetScrollInputMode() - */ + * Gets the scroll input handling mode. + * + * @since 2.0 + * + * @return The scroll input handling mode + * @see SetScrollInputMode() + */ ScrollInputMode GetScrollInputMode(void) const; /* - * Scrolls the list contents with the amount of pixels. - * - * @since 2.0 - * - * @return An error code - * @param[in] pixel The amount of pixels to scroll - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. - * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. - * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. - */ + * Scrolls the list contents with the amount of pixels. + * + * @since 2.0 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ result ScrollByPixel(int pixel); /* - * Gets the current scroll position - * - * @since 2.0 - */ - int GetCurrentScrollPosition(void) const; + * Scrolls the list contents with the amount of pixels. + * + * @since 2.1 + * + * @return An error code + * @param[in] pixel The amount of pixels to scroll + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_RANGE The specified @c pixel is out of range. + * @remarks If you call ScrollByPixel() with negative @c pixel when position of scroll is already top of contents then it will return E_OUT_OF_RANGE. + * Likewise, in case of positive @c pixel on the bottom position of scroll it will also return E_OUT_OF_RANGE. + */ + result ScrollByPixel(float pixel); + + /* + * Gets the current scroll position + * + * @since 2.0 + */ + int GetCurrentScrollPosition(void) const; + + /* + * Gets the current scroll position + * + * @since 2.1 + */ + float GetCurrentScrollPositionF(void) const; /* - * Enables or disables the scroll of TableView items. - * - * @since 2.0 - */ + * Enables or disables the scroll of TableView items. + * + * @since 2.0 + */ void SetScrollEnabled(bool enable); /* - * Checks whether the scroll is enabled or disabled. - * - * @since 2.0 - */ + * Checks whether the scroll is enabled or disabled. + * + * @since 2.0 + */ bool IsScrollEnabled(void) const; private: diff --git a/inc/FUiCtrlTableViewContextItem.h b/inc/FUiCtrlTableViewContextItem.h index a33ad5e..32ddc13 100644 --- a/inc/FUiCtrlTableViewContextItem.h +++ b/inc/FUiCtrlTableViewContextItem.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableViewContextItem.h - * @brief This is the header file for the %TableViewContextItem class. - * - * This header file contains the declarations of the %TableViewContextItem class and its helper classes. - */ +* @file FUiCtrlTableViewContextItem.h +* @brief This is the header file for the %TableViewContextItem class. +* +* This header file contains the declarations of the %TableViewContextItem class and its helper classes. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_CONTEXT_ITEM_H_ #define _FUI_CTRL_TABLE_VIEW_CONTEXT_ITEM_H_ @@ -30,46 +30,58 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class TableViewContextItem - * @brief This class defines common behavior for a %TableViewContextItem. - * - * @since 2.0 - * - * The %TableViewContextItem class is a class which represents a context item for TableView. - * A context item is shown when a table view item is swept, if %TableViewContextItem is set to the table view item. - * - */ +* @class TableViewContextItem +* @brief This class defines common behavior for a %TableViewContextItem. +* +* @since 2.0 +* +* The %TableViewContextItem class is a class which represents a context item for TableView. +* A context item is shown when a table view item is swept, if %TableViewContextItem is set to the table view item. +* +*/ class _OSP_EXPORT_ TableViewContextItem : public TableViewItemBase { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ TableViewContextItem(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~TableViewContextItem(void); /** - * Initializes this instance of %TableViewContextItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemSize The size of the item - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - */ + * Initializes this instance of %TableViewContextItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + */ result Construct(const Tizen::Graphics::Dimension& itemSize); + /* + * Initializes this instance of %TableViewContextItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize); + private: friend class _TableViewItemImpl; diff --git a/inc/FUiCtrlTableViewGroupItem.h b/inc/FUiCtrlTableViewGroupItem.h index 4e8f42e..73f11a7 100644 --- a/inc/FUiCtrlTableViewGroupItem.h +++ b/inc/FUiCtrlTableViewGroupItem.h @@ -30,71 +30,110 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class TableViewGroupItem - * @brief This class defines common behavior of %TableViewGroupItem. - * - * @since 2.0 - * - * The %TableViewGroupItem class displays a table view group item. The %TableViewGroupItem can have any layout of Controls or Containers as children. - */ +* @class TableViewGroupItem +* @brief This class defines common behavior of %TableViewGroupItem. +* +* @since 2.0 +* +* The %TableViewGroupItem class displays a table view group item. The %TableViewGroupItem can have any layout of Controls or Containers as children. +*/ class _OSP_EXPORT_ TableViewGroupItem : public TableViewItemBase { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ TableViewGroupItem(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~TableViewGroupItem(void); /** - * Initializes this instance of %TableViewGroupItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemSize The size of the item - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Graphics::Dimension& itemSize); /** - * Initializes this instance of %TableViewGroupItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] layout The layout for both of the portrait and landscape modes - * @param[in] itemSize The size of the item - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize); /** - * Initializes this instance of %TableViewGroupItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] portraitLayout The layout for portrait mode - * @param[in] landscapeLayout The layout for landscape mode - * @param[in] itemSize The size of the item - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] portraitLayout The layout for portrait mode + * @param[in] landscapeLayout The layout for landscape mode + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize); + /* + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize); + + /* + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize); + + /* + * Initializes this instance of %TableViewGroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for portrait mode + * @param[in] landscapeLayout The layout for landscape mode + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize); + private: friend class _TableViewItemImpl; diff --git a/inc/FUiCtrlTableViewItem.h b/inc/FUiCtrlTableViewItem.h index d309246..7f30a36 100644 --- a/inc/FUiCtrlTableViewItem.h +++ b/inc/FUiCtrlTableViewItem.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableViewItem.h - * @brief This is the header file for the %TableViewItem class. - * - * This header file contains the declarations of the %TableViewItem class and its helper classes. - */ +* @file FUiCtrlTableViewItem.h +* @brief This is the header file for the %TableViewItem class. +* +* This header file contains the declarations of the %TableViewItem class and its helper classes. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_ITEM_H_ #define _FUI_CTRL_TABLE_VIEW_ITEM_H_ @@ -32,98 +32,151 @@ namespace Tizen { namespace Ui { namespace Controls class TableViewContextItem; /** - * @class TableViewItem - * @brief This class defines common behavior for a %TableViewItem. - * - * @since 2.0 - * - * The %TableViewItem class is a base class which represents a table view item which is the unit of handling of TableView. - * - */ +* @class TableViewItem +* @brief This class defines common behavior for a %TableViewItem. +* +* @since 2.0 +* +* The %TableViewItem class is a base class which represents a table view item which is the unit of handling of TableView. +* +*/ class _OSP_EXPORT_ TableViewItem : public TableViewItemBase { public: /** - * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. - * - * @since 2.0 - */ + * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor. + * + * @since 2.0 + */ TableViewItem(void); /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ virtual ~TableViewItem(void); /** - * Initializes this instance of %TableViewItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] itemSize The size of the item - * @param[in] style The style of Annex - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); /** - * Initializes this instance of %TableViewItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] layout The layout for both of the portrait and landscape modes - * @param[in] itemSize The size of the item - * @param[in] style The style of Annex - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); /** - * Initializes this instance of %TableViewItem with the specified parameter. - * - * @since 2.0 - * - * @return An error code - * @param[in] portraitLayout The layout for portrait mode - * @param[in] landscapeLayout The layout for landscape mode - * @param[in] itemSize The size of the item - * @param[in] style The style of Annex - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.0 + * + * @return An error code + * @param[in] portraitLayout The layout for portrait mode + * @param[in] landscapeLayout The layout for landscape mode + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + /* + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + + /* + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + + /* + * Initializes this instance of %TableViewItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for portrait mode + * @param[in] landscapeLayout The layout for landscape mode + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + /** - * Sets context item that is displayed when an item is swept. - * - * @since 2.0 - * - * @return An error code - * @param[in] pItem The object of TableViewContextItem - * @remarks If context item is not set, TableView() does not display context item and an item sweep event is generated when an item is swept. - * pItem must be deleted by applications when it is no longer used. - */ + * Sets context item that is displayed when an item is swept. + * + * @since 2.0 + * + * @return An error code + * @param[in] pItem The object of TableViewContextItem + * @remarks If context item is not set, TableView() does not display context item and an item sweep event is generated when an item is swept. + * pItem must be deleted by applications when it is no longer used. + */ void SetContextItem(const TableViewContextItem* pItem); /** - * Get the width of the annex area. - * - * @since 2.0 - * - * @return The width of the annex - * @param[in] style The style of the annex - * @remarks The width of the annex area is different among annex styles. - */ + * Get the width of the annex area. + * + * @since 2.0 + * + * @return The width of the annex + * @param[in] style The style of the annex + * @remarks The width of the annex area is different among annex styles. + */ static int GetAnnexWidth(TableViewAnnexStyle style); + /* + * Get the width of the annex area. + * + * @since 2.1 + * + * @return The width of the annex + * @param[in] style The style of the annex + * @remarks The width of the annex area is different among annex styles. + */ + static float GetAnnexWidthF(TableViewAnnexStyle style); + private: friend class _TableViewItemImpl; diff --git a/inc/FUiCtrlTableViewItemBase.h b/inc/FUiCtrlTableViewItemBase.h index 2729b0a..5a3842c 100644 --- a/inc/FUiCtrlTableViewItemBase.h +++ b/inc/FUiCtrlTableViewItemBase.h @@ -33,95 +33,95 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class TableViewItemBase - * @brief This class defines common behavior for a %TableViewItemBase. - * - * @since 2.0 - * - * The %TableViewItemBase class is a base class which represents a table view item which is the unit of handling of TableView. - * - */ +* @class TableViewItemBase +* @brief This class defines common behavior for a %TableViewItemBase. +* +* @since 2.0 +* +* The %TableViewItemBase class is a base class which represents a table view item which is the unit of handling of TableView. +* +*/ class _OSP_EXPORT_ TableViewItemBase : public Tizen::Ui::Container { public: /** - * Sets the background image of the item which is displayed when the item is in specified state. - * - * @since 2.0 - * - * @return An error code - * @param[in] pBitmap The background bitmap image - * @param[in] status The item drawing state - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only the bitmap is displayed. - */ + * Sets the background image of the item which is displayed when the item is in specified state. + * + * @since 2.0 + * + * @return An error code + * @param[in] pBitmap The background bitmap image + * @param[in] status The item drawing state + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only the bitmap is displayed. + */ result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL); /** - * Sets the background color of the item which is displayed when the item is in specified state. - * - * @since 2.0 - * - * @return An error code - * @param[in] color The background color - * @param[in] status The item drawing state - */ + * Sets the background color of the item which is displayed when the item is in specified state. + * + * @since 2.0 + * + * @return An error code + * @param[in] color The background color + * @param[in] status The item drawing state + */ void SetBackgroundColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL); /** - * Gets the background color of the item which is displayed when the item is in the specified state. - * - * @since 2.0 - * - * @return The background color of the item - * @param[in] status The item drawing state - * - * @remarks If an error occurs, this method returns RGBA(0, 0, 0, 0). - * @see SetBackgroundColor() - */ + * Gets the background color of the item which is displayed when the item is in the specified state. + * + * @since 2.0 + * + * @return The background color of the item + * @param[in] status The item drawing state + * + * @remarks If an error occurs, this method returns RGBA(0, 0, 0, 0). + * @see SetBackgroundColor() + */ Tizen::Graphics::Color GetBackgroundColor(TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) const; /** - * Enables or disables the individual selection of a control. - * - * @since 2.0 - * - * @return An error code - * @param[in] pControl The child control to be selected individually. - * @param[in] enable Set to @c true to enable the individual selection of a control, else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Enables or disables the individual selection of a control. + * + * @since 2.0 + * + * @return An error code + * @param[in] pControl The child control to be selected individually. + * @param[in] enable Set to @c true to enable the individual selection of a control, else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ result SetIndividualSelectionEnabled(const Tizen::Ui::Control* pControl, bool enable); /** - * Returns whether the individual selection of a control is enabled or not. - * - * @since 2.0 - * - * @return @c true if the individual selection of a control is enabled, else @c false - * @param[in] pControl The target control. - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ + * Returns whether the individual selection of a control is enabled or not. + * + * @since 2.0 + * + * @return @c true if the individual selection of a control is enabled, else @c false + * @param[in] pControl The target control. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ bool IsIndividualSelectionEnabled(const Tizen::Ui::Control* pControl); protected: - // - // This class is constructible only as a subobject of a derived class. - // - // @since 2.0 - // + /** + * This class is constructible only as a subobject of a derived class. + * + * @since 2.0 + */ TableViewItemBase(void); - // - // This class is destructible only as a subobject of a derived class. - // - // @since 2.0 - // + /** + * This class is destructible only as a subobject of a derived class. + * + * @since 2.0 + */ virtual ~TableViewItemBase(void); // diff --git a/inc/FUiCtrlTableViewSimpleGroupItem.h b/inc/FUiCtrlTableViewSimpleGroupItem.h index a7864e0..06d1aa9 100644 --- a/inc/FUiCtrlTableViewSimpleGroupItem.h +++ b/inc/FUiCtrlTableViewSimpleGroupItem.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableViewSimpleGroupItem.h - * @brief This is the header file for the %TableViewSimpleGroupItem class. - * - * This header file contains the declarations of the %TableViewSimpleGroupItem class and its helper classes. - */ +* @file FUiCtrlTableViewSimpleGroupItem.h +* @brief This is the header file for the %TableViewSimpleGroupItem class. +* +* This header file contains the declarations of the %TableViewSimpleGroupItem class and its helper classes. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_SIMPLE_GROUP_ITEM_H_ #define _FUI_CTRL_TABLE_VIEW_SIMPLE_GROUP_ITEM_H_ @@ -30,13 +30,13 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class TableViewSimpleGroupItem - * @brief This class defines common behavior of %TableViewSimpleGroupItem. - * - * @since 2.0 - * - * The %TableViewSimpleGroupItem class displays a table view group item. The basic layout of the %TableViewSimpleGroupItem instance is text and a bitmap arranged horizontally in one line. The bitmap can be omitted while text must be given. - */ +* @class TableViewSimpleGroupItem +* @brief This class defines common behavior of %TableViewSimpleGroupItem. +* +* @since 2.0 +* +* The %TableViewSimpleGroupItem class displays a table view group item. The basic layout of the %TableViewSimpleGroupItem instance is text and a bitmap arranged horizontally in one line. The bitmap can be omitted while text must be given. +*/ class _OSP_EXPORT_ TableViewSimpleGroupItem : public TableViewGroupItem @@ -81,6 +81,31 @@ public: */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize); + /* + * Initializes this instance of %TableViewSimpleGroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize); + + /* + * Initializes this instance of %TableViewSimpleGroupItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize); + /** * Sets the text string and bitmap image for %TableViewSimpleGroupItem. * diff --git a/inc/FUiCtrlTableViewSimpleItem.h b/inc/FUiCtrlTableViewSimpleItem.h index 2c0bc5e..33119be 100644 --- a/inc/FUiCtrlTableViewSimpleItem.h +++ b/inc/FUiCtrlTableViewSimpleItem.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableViewSimpleItem.h - * @brief This is the header file for the %TableViewSimpleItem class. - * - * This header file contains the declarations of the %TableViewSimpleItem class and its helper classes. - */ +* @file FUiCtrlTableViewSimpleItem.h +* @brief This is the header file for the %TableViewSimpleItem class. +* +* This header file contains the declarations of the %TableViewSimpleItem class and its helper classes. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_ #define _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_ @@ -84,6 +84,33 @@ public: */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + /* + * Initializes this instance of %TableViewSimpleItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + + /* + * Initializes this instance of TableViewItem with the specified parameter. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both of the portrait and landscape modes + * @param[in] itemSize The size of the item + * @param[in] style The style of Annex + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL); + /** * Sets the text string and bitmap image for %TableViewSimpleItem. * diff --git a/inc/FUiCtrlTableViewTypes.h b/inc/FUiCtrlTableViewTypes.h index 9681717..58afaa8 100644 --- a/inc/FUiCtrlTableViewTypes.h +++ b/inc/FUiCtrlTableViewTypes.h @@ -16,11 +16,11 @@ // /** - * @file FUiCtrlTableViewTypes.h - * @brief This is the header file for the TableView enumerations. - * - * This header file contains the declarations of the TableView enumerations. - */ +* @file FUiCtrlTableViewTypes.h +* @brief This is the header file for the TableView enumerations. +* +* This header file contains the declarations of the TableView enumerations. +*/ #ifndef _FUI_CTRL_TABLE_VIEW_TYPES_H_ #define _FUI_CTRL_TABLE_VIEW_TYPES_H_ @@ -28,28 +28,29 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @enum TableViewAnnexStyle - * - * Defines the style of annex in the items. - * - * @since 2.0 - */ +* @enum TableViewAnnexStyle +* +* Defines the style of annex in the items. +* +* @since 2.0 +*/ enum TableViewAnnexStyle { - TABLE_VIEW_ANNEX_STYLE_NORMAL = 0, /**< No annex */ - TABLE_VIEW_ANNEX_STYLE_MARK, /**< Mark style check for multiple selection */ - TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING, /**< On/Off slider style */ - TABLE_VIEW_ANNEX_STYLE_DETAILED, /**< Detailed style for further interaction */ - TABLE_VIEW_ANNEX_STYLE_RADIO /**< Radio style check for simple look */ + TABLE_VIEW_ANNEX_STYLE_NORMAL = 0, /**< No annex */ + TABLE_VIEW_ANNEX_STYLE_MARK, /**< Mark style check for multiple selection */ + TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING, /**< On/Off slider style */ + TABLE_VIEW_ANNEX_STYLE_DETAILED, /**< Detailed style for further interaction */ + TABLE_VIEW_ANNEX_STYLE_RADIO, /**< Radio style check for simple look */ + TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER /**< The slider style On/Off with divider @b Since: @b 2.1 */ }; /** - * @enum TableViewItemDrawingStatus - * - * Defines the drawing state of the items. - * - * @since 2.0 - */ +* @enum TableViewItemDrawingStatus +* +* Defines the drawing state of the items. +* +* @since 2.0 +*/ enum TableViewItemDrawingStatus { TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL = 0, /**< The normal drawing state */ @@ -58,12 +59,12 @@ enum TableViewItemDrawingStatus }; /** - * @enum TableViewRefreshType - * - * Defines the update type of the TableView item. - * - * @since 2.0 - */ +* @enum TableViewRefreshType +* +* Defines the update type of the TableView item. +* +* @since 2.0 +*/ enum TableViewRefreshType { TABLE_VIEW_REFRESH_TYPE_ITEM_ADD = 0, /**< Refresh request of adding an item */ @@ -72,12 +73,12 @@ enum TableViewRefreshType }; /** - * @enum TableViewItemStatus - * - * Defines the item state of the TableView. - * - * @since 2.0 - */ +* @enum TableViewItemStatus +* +* Defines the item state of the TableView. +* +* @since 2.0 +*/ enum TableViewItemStatus { TABLE_VIEW_ITEM_STATUS_SELECTED = 0, /**< The selected item state */ @@ -88,12 +89,12 @@ enum TableViewItemStatus }; /** - * @enum TableViewSweepDirection - * - * Defines the direction of the sweep interaction. - * - * @since 2.0 - */ +* @enum TableViewSweepDirection +* +* Defines the direction of the sweep interaction. +* +* @since 2.0 +*/ enum TableViewSweepDirection { TABLE_VIEW_SWEEP_DIRECTION_LEFT = 0, /**< The left direction */ @@ -101,12 +102,12 @@ enum TableViewSweepDirection }; /** - * @enum TableViewScrollItemAlignment - * - * Defines the alignment information for item scroll. - * - * @since 2.0 - */ +* @enum TableViewScrollItemAlignment +* +* Defines the alignment information for item scroll. +* +* @since 2.0 +*/ enum TableViewScrollItemAlignment { TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP = 0, /**< The item is aligned at the top of the TableView at item scroll*/ @@ -114,12 +115,12 @@ enum TableViewScrollItemAlignment }; /** - * @enum TableViewScrollBarStyle - * - * Defines the scroll bar style of the list. - * - * @since 2.0 - */ +* @enum TableViewScrollBarStyle +* +* Defines the scroll bar style of the list. +* +* @since 2.0 +*/ enum TableViewScrollBarStyle { TABLE_VIEW_SCROLL_BAR_STYLE_NONE = 0, /**< No scroll bar */ @@ -131,19 +132,6 @@ enum TableViewScrollBarStyle }; -/** - * @enum ScrollInputMode - * - * Defines the scroll interaction mode - * - * @since 2.0 - */ -enum ScrollInputMode -{ - SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION = 0, /** < Scroll interaction is available to any direction. */ - SCROLL_INPUT_MODE_RESTRICT_TO_INITIAL_DIRECTION /** < Scroll interaction is restricted to first direction. */ -}; - }}} // Tizen::Ui::Controls diff --git a/inc/FUiCtrlTextBox.h b/inc/FUiCtrlTextBox.h old mode 100644 new mode 100755 index 4d50354..d7d0e73 --- a/inc/FUiCtrlTextBox.h +++ b/inc/FUiCtrlTextBox.h @@ -167,8 +167,8 @@ TextBoxSample::OnInitializing(void) return r; } - * @endcode - */ +* @endcode +*/ class _OSP_EXPORT_ TextBox : public Tizen::Ui::Control { @@ -204,6 +204,21 @@ public: */ result Construct(const Tizen::Graphics::Rectangle& rect, TextBoxBorder border = TEXT_BOX_BORDER_ROUNDED); + /** + * Initializes this instance of %TextBox with the specified parameters. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect An instance of the Graphics::FloatRectangle class @n + * This instance represents the x and y coordinates of the top-left corner of the created window along with + * the width and height of the control. + * @param[in] border The border style + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, TextBoxBorder border = TEXT_BOX_BORDER_ROUNDED); + // Operation public: /** @@ -417,6 +432,19 @@ public: int GetLineSpacing(void) const; /** + * Gets the line spacing. + * + * @since 2.1 + * + * @return The line spacing, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetLineSpacing() + */ + float GetLineSpacingF(void) const; + + /** * Sets the line spacing. @n * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. @n * @@ -437,6 +465,27 @@ public: */ result SetLineSpacing(int multiplier, int extra); + /** + * Sets the line spacing. @n + * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. @n + * + * @code + * The line spacing = (default line spacing) * multiplier + extra + * @endcode + * + * @since 2.1 + * + * @return An error code + * @param[in] multiplier The line spacing multiplier + * @param[in] extra The extra line spacing + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified line spacing value cannot be supported. + * @exception E_SYSTEM A system error has occurred. + * @see GetLineSpacingF() + */ + result SetLineSpacing(int multiplier, float extra); + // Text Alignment /** * Gets the horizontal text alignment. @@ -480,6 +529,20 @@ public: int GetTextSize(void) const; /** + * Gets the text size of the %TextBox control. + * + * @since 2.1 + * + * @return The size of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + + /** * Sets the text size. * * @since 2.0 @@ -494,6 +557,21 @@ public: */ result SetTextSize(int size); + /** + * Sets the text size. + * + * @since 2.1 + * + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c size cannot be a negative integer. + * @exception E_SYSTEM A system error has occurred. + * @see GetTextSizeF() + */ + result SetTextSize(float size); + // Text Font /** * @if OSPDEPREC @@ -517,14 +595,14 @@ public: result GetFontType(Tizen::Base::String& typefaceName, unsigned long& style) const; /** - * Gets the text style mask of the %TextBox control. - * - * @since 2.0 - * - * @return A bitwise combination of Tizen::Ui::Controls::TextBoxTextStyle - * @see SetTextStyle() - * @see TextBoxTextStyle - */ + * Gets the text style mask of the %TextBox control. + * + * @since 2.0 + * + * @return A bitwise combination of Tizen::Ui::Controls::TextBoxTextStyle + * @see SetTextStyle() + * @see TextBoxTextStyle + */ unsigned long GetTextStyle(void) const; /** @@ -553,18 +631,18 @@ public: result SetFontType(const Tizen::Base::String& typefaceName, unsigned long style); /** - * Sets the text style mask of the %TextBox control. - * - * @since 2.0 - * - * @return An error code - * @param[in] style The text style @n - * Multiple styles can be combined using the bitwise OR operator (see Tizen::Ui::Controls::TextBoxTextStyle). - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @see GetTextStyle() - * @see TextBoxTextStyle - */ + * Sets the text style mask of the %TextBox control. + * + * @since 2.0 + * + * @return An error code + * @param[in] style The text style @n + * Multiple styles can be combined using the bitwise OR operator (see Tizen::Ui::Controls::TextBoxTextStyle). + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @see GetTextStyle() + * @see TextBoxTextStyle + */ result SetTextStyle(unsigned long style); using Control::SetFont; diff --git a/inc/FUiCtrlTimePicker.h b/inc/FUiCtrlTimePicker.h old mode 100644 new mode 100755 index 646b49a..7b30e21 --- a/inc/FUiCtrlTimePicker.h +++ b/inc/FUiCtrlTimePicker.h @@ -14,12 +14,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** - * @file FUiCtrlTimePicker.h - * @brief This is the header file for the %TimePicker class. - * - * This header file contains the declarations of the %TimePicker class. - */ +* @file FUiCtrlTimePicker.h +* @brief This is the header file for the %TimePicker class. +* +* This header file contains the declarations of the %TimePicker class. +*/ #ifndef _FUI_CTRL_TIME_PICKER_H_ #define _FUI_CTRL_TIME_PICKER_H_ @@ -30,18 +31,18 @@ namespace Tizen { namespace Ui { namespace Controls { /** - * @class TimePicker - * @brief This class displays a %TimePicker control on top of the screen. - * - * @since 2.0 - * - * The %TimePicker class displays a full screen window-based selector that allows the user to select a certain time. - * - * For more information on the class features, see DatePicker, TimePicker, and DateTimeimePicker. - * - * The following example demonstrates how to use the %TimePicker class. - * - * @code +* @class TimePicker +* @brief This class displays a %TimePicker control on top of the screen. +* +* @since 2.0 +* +* The %TimePicker class displays a full screen window-based selector that allows the user to select a certain time. +* +* For more information on the class features, see DatePicker, TimePicker, and DateTimeimePicker. +* +* The following example demonstrates how to use the %TimePicker class. +* +* @code // Sample Code for TimePickerSample.h #include @@ -139,7 +140,7 @@ TimePickerSample::OnTerminating(void) result r = E_SUCCESS; // Deallocates the time picker - delete __pTimePicker; + __pTimePicker->Destroy(); return r; } @@ -172,8 +173,8 @@ TimePickerSample::OnTimeChangeCanceled(const Control& source) { // Todo: } - * @endcode - */ +* @endcode +**/ class _OSP_EXPORT_ TimePicker : public Tizen::Ui::Window { diff --git a/inc/FUiCustomControlBase.h b/inc/FUiCustomControlBase.h old mode 100644 new mode 100755 index 3be3449..e90d999 --- a/inc/FUiCustomControlBase.h +++ b/inc/FUiCustomControlBase.h @@ -51,18 +51,18 @@ class _OSP_EXPORT_ CustomControlBase // Lifecycle public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This destructor overrides Tizen::Base::Object::~Object(). * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use the Container class. * @since 2.0 - * @endif + * @endif */ virtual ~CustomControlBase(void); /** - * @if OSPDEPREC + * @if OSPDEPREC * Notifies that the bounds of the control is about to change. * * @brief [Deprecated] @@ -77,12 +77,12 @@ public: * Provide control specific exceptions. * @see Tizen::Ui::Control::SetBounds() * @see Tizen::Ui::Control::SetSize() - * @endif + * @endif */ virtual result PrepareBoundsChange(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect); /** - * @if OSPDEPREC + * @if OSPDEPREC * Overrides this method to indicate that the specified @c width and @c height * can be supported or a new @c width and @c height must be applied instead * of the specified values. @@ -95,24 +95,24 @@ public: * and @ height are supported * @param[in, out] width The width that needs to evaluate * @param[in, out] height The height that needs to evaluate - * @endif + * @endif */ virtual bool EvaluateSize(int& width, int& height); protected: /** - * @if OSPDEPREC + * @if OSPDEPREC * The object is not fully constructed after this constructor is called. For full construction, one of the %Construct() method must be called right after calling this constructor. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use the Container class. * @since 2.0 - * @endif + * @endif */ CustomControlBase(void); /** - * @if OSPDEPREC + * @if OSPDEPREC * Initializes this instance of %CustomControlBase. * * @brief [Deprecated] @@ -131,12 +131,12 @@ protected: * @remarks This method must be called from the derived classes's construct methods. * @remarks If the @c resizable is @c false, IsResizable() returns @c false. * @see IsResizable() - * @endif + * @endif */ result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); /** - * @if OSPDEPREC + * @if OSPDEPREC * Initializes this instance of %CustomControlBase with the specified layout and rectangular region. * * @brief [Deprecated] @@ -158,12 +158,12 @@ protected: * @see IsResizable() * @see Tizen::Ui::Layout * @see Tizen::Ui::Container::GetLayoutN() - * @endif + * @endif */ result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); /** - * @if OSPDEPREC + * @if OSPDEPREC * Initializes this instance of %CustomControlBase with the specified layouts and rectangular region. * * @brief [Deprecated] @@ -187,30 +187,30 @@ protected: * @see Tizen::Ui::Container::GetLayoutN() * @see Tizen::Ui::Container::GetPortraitLayoutN() * @see Tizen::Ui::Container::GetLandscapeLayoutN() - * @endif + * @endif */ result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); private: /** - * @if OSPDEPREC + * @if OSPDEPREC * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use the Container class. * @since 2.0 - * @endif + * @endif */ CustomControlBase(const CustomControlBase& rhs); /** - * @if OSPDEPREC + * @if OSPDEPREC * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use the Container class. * @since 2.0 - * @endif + * @endif */ CustomControlBase& operator =(const CustomControlBase& rhs); @@ -245,4 +245,3 @@ protected: }} // Tizen::Ui #endif // _FUI_CUSTOM_CONTROL_BASE_H_ - diff --git a/inc/FUiDataBindingContext.h b/inc/FUiDataBindingContext.h index 4f2f253..dc578ba 100644 --- a/inc/FUiDataBindingContext.h +++ b/inc/FUiDataBindingContext.h @@ -60,7 +60,7 @@ class _DataBindingContextImpl; class DataBindingSample : public Tizen::Ui::Controls::Form - , public Osp::Ui::IActionEventListener + , public Tizen::Ui::IActionEventListener { public: DataBindingSample(void); @@ -68,18 +68,18 @@ public: virtual bool Initialize(void); virtual result OnInitializing(void); - virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId); + virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); private : static const int ID_BUTTON_UNBIND = 402; static const int ID_BUTTON_UPDATE_BINDING = 403; static const int ID_BUTTON_BIND = 404; - Osp::Base::Integer __bindIntegerToButtonText; - Osp::Ui::Controls::Button* __pUnbindButton; - Osp::Ui::Controls::Button* __pUpdateBindingButton; - Osp::Ui::Controls::Button* __pTargetButton; - Osp::Ui::Controls::Button* __pBindButton; + Tizen::Base::Integer __bindIntegerToButtonText; + Tizen::Ui::Controls::Button* __pUnbindButton; + Tizen::Ui::Controls::Button* __pUpdateBindingButton; + Tizen::Ui::Controls::Button* __pTargetButton; + Tizen::Ui::Controls::Button* __pBindButton; }; * @endcode @@ -183,125 +183,125 @@ class _OSP_EXPORT_ DataBindingContext { public: /** - * This is the destructor for this class. - * - * @since 2.0 - */ + * This is the destructor for this class. + * + * @since 2.0 + */ virtual ~DataBindingContext(void); public: /** - * Gets the owner of this data binding context. - * - * @since 2.0 - * - * @return The context owner - */ + * Gets the owner of this data binding context. + * + * @since 2.0 + * + * @return The context owner + */ Control* GetContextOwner(void) const; /** - * Binds the specified control's property and data source. - * - * @since 2.0 - * - * @return An error code - * @param[in] bindingId The binding ID - * @param[in] controlName The name of target property owner - * @param[in] propertyName The target property name - * @param[in] dataSource The data binding source - * @param[in] sourceType The data type of the @c dataSource - * @param[in] flow The data flow type - * @param[in] trigger The data binding trigger type - * @param[in] pListener The data binding listener - * @param[in] pValidator The data validator - * @param[in] pTransformer The data transformer - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_INVALID_ARG 1. sourceType is not of a supported type. - * 2. flow is not of a supported type. - * 3. trigger is not of a supported type. - * @exception E_OBJ_NOT_FOUND 1. The control named controlName does not exist. - * 2. The parameter "propertyName" is not found in control properties. - * @exception E_UNSUPPORTED_FORMAT The given transformer does not supported changing source type to target type. - * @exception E_UNSUPPORTED_OPERATION In this system, binding with the given trigger and flow is not supported. - * @remarks The propertyName parameter is defined in "UI Builder Guide". @n - * There is no duplication check for each binding ID. @n - * Please use a unique binding ID for each binding setting. - */ + * Binds the specified control's property and data source. + * + * @since 2.0 + * + * @return An error code + * @param[in] bindingId The binding ID + * @param[in] controlName The name of target property owner + * @param[in] propertyName The target property name + * @param[in] dataSource The data binding source + * @param[in] sourceType The data type of the @c dataSource + * @param[in] flow The data flow type + * @param[in] trigger The data binding trigger type + * @param[in] pListener The data binding listener + * @param[in] pValidator The data validator + * @param[in] pTransformer The data transformer + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_ARG 1. sourceType is not of a supported type. + 2. flow is not of a supported type. + 3. trigger is not of a supported type. + * @exception E_OBJ_NOT_FOUND 1. The control named controlName does not exist. + 2. The parameter "propertyName" is not found in control properties. + * @exception E_UNSUPPORTED_FORMAT The given transformer does not supported changing source type to target type. + * @exception E_UNSUPPORTED_OPERATION In this system, binding with the given trigger and flow is not supported. + * @remarks The propertyName parameter is defined in "UI Builder Guide". @n + * There is no duplication check for each binding ID. @n + * Please use a unique binding ID for each binding setting. + */ result Bind(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Base::Object& dataSource, DataBindingDataType sourceType, DataBindingFlow flow, DataBindingTrigger trigger, const IDataBindingListener* pListener, const IDataBindingDataValidator* pValidator, const IDataBindingDataTransformer* pTransformer = null); /** - * Sets the binding listener for the specified data binding. - * - * @since 2.0 - * - * @return An error code - * @param[in] bindingId The binding ID - * @param[in] pListener The data binding listener - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. - * @exception E_INVALID_ARG The given listener is not valid. - * @remarks If you give pListener parameter as 'null', the existing dataBindingEventListener will be removed. - */ + * Sets the binding listener for the specified data binding. + * + * @since 2.0 + * + * @return An error code + * @param[in] bindingId The binding ID + * @param[in] pListener The data binding listener + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. + * @exception E_INVALID_ARG The given listener is not valid. + * @remarks If you give pListener parameter as 'null', the existing dataBindingEventListener will be removed. + */ result SetDataBindingEventListener(const Tizen::Base::String& bindingId, IDataBindingListener* pListener); /** - * Unbinds all bindings that exist in this context. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ + * Unbinds all bindings that exist in this context. + * + * @since 2.0 + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + */ result UnbindAll(void); /** - * Unbinds a binding that exists in this context. - * - * @since 2.0 - * - * @return An error code - * @param[in] bindingId The binding ID - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. - */ + * Unbinds a binding that exists in this context. + * + * @since 2.0 + * + * @return An error code + * @param[in] bindingId The binding ID + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. + */ result Unbind(const Tizen::Base::String& bindingId); /** - * Updates all 'explicit' data bindings. - * - * @since 2.0 - * - * @return An error code - * @param[in] destType The destination type - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_INVALID_ARG The specified @c destType is not of a supported type. - * @remarks If you have set a data binding listener, @n - * this function is returned after that listener is called. - * @see IDataBindingListener - */ + * Updates all 'explicit' data bindings. + * + * @since 2.0 + * + * @return An error code + * @param[in] destType The destination type + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_INVALID_ARG The specified @c destType is not of a supported type. + * @remarks If you have set a data binding listener, @n + this function is returned after that listener is called. + * @see IDataBindingListener + */ result UpdateAllBindings(DataBindingDestinationType destType); /** - * Updates the specified data binding. - * - * @since 2.0 - * - * @param[in] bindingId The binding ID - * @param[in] destType The destination type - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. - * @exception E_INVALID_OPERATION The given binding's trigger is not 'explicit' type. - * @exception E_INVALID_ARG The specified @c destType is not supported in binding ID. - * @remarks If you have set a data binding listener, @n - * this function is returned after that listener is called. - * @see IDataBindingListener - */ + * Updates the specified data binding. + + * @since 2.0 + * + * @param[in] bindingId The binding ID + * @param[in] destType The destination type + * @exception E_SUCCESS The method is successful. + * @exception E_SYSTEM A system error has occurred. + * @exception E_OBJ_NOT_FOUND The given binding ID is not registered. + * @exception E_INVALID_OPERATION The given binding's trigger is not 'explicit' type. + * @exception E_INVALID_ARG The specified @c destType is not supported in binding ID. + * @remarks If you have set a data binding listener, @n + this function is returned after that listener is called. + * @see IDataBindingListener + */ result UpdateBinding(const Tizen::Base::String& bindingId, DataBindingDestinationType destType); private: diff --git a/inc/FUiDataBindingTypes.h b/inc/FUiDataBindingTypes.h index 2fb3bcb..3dc69d3 100644 --- a/inc/FUiDataBindingTypes.h +++ b/inc/FUiDataBindingTypes.h @@ -28,12 +28,12 @@ namespace Tizen { namespace Ui { /** - * @enum DataBindingFlow - * - * Defines the possible data flow types. - * - * @since 2.0 - */ +* @enum DataBindingFlow +* +* Defines the possible data flow types. +* +* @since 2.0 +*/ enum DataBindingFlow { DATA_BINDING_FLOW_ONE_WAY = 0, /**< The data flow is one way from source to target */ @@ -42,12 +42,12 @@ enum DataBindingFlow }; /** - * @enum DataBindingTrigger - * - * Defines the possible data binding trigger types. - * - * @since 2.0 - */ +* @enum DataBindingTrigger +* +* Defines the possible data binding trigger types. +* +* @since 2.0 +*/ enum DataBindingTrigger { DATA_BINDING_TRIGGER_IMMEDIATE = 0, /**< Immediate trigger */ @@ -55,12 +55,12 @@ enum DataBindingTrigger }; /** - * @enum DataBindingDataType - * - * Defines the possible data types for data binding source. - * - * @since 2.0 - */ +* @enum DataBindingDataType +* +* Defines the possible data types for data binding source. +* +* @since 2.0 +*/ enum DataBindingDataType { DATA_BINDING_DATA_TYPE_BOOLEAN = 0, /**< Boolean type */ @@ -76,12 +76,12 @@ enum DataBindingDataType }; /** - * @enum DataBindingDestinationType - * - * Defines the possible destination types for explicit data bindings. - * - * @since 2.0 - */ +* @enum DataBindingDestinationType +* +* Defines the possible destination types for explicit data bindings. +* +* @since 2.0 +*/ enum DataBindingDestinationType { DATA_BINDING_DESTINATION_TYPE_SOURCE = 0, /**< Update source with latest data of associated target */ diff --git a/inc/FUiEffects.h b/inc/FUiEffects.h index 345b69d..e83b9f5 100644 --- a/inc/FUiEffects.h +++ b/inc/FUiEffects.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiEffectsEffect.h b/inc/FUiEffectsEffect.h index 322cc2d..3c1fffe 100644 --- a/inc/FUiEffectsEffect.h +++ b/inc/FUiEffectsEffect.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiEffectsEffectManager.h b/inc/FUiEffectsEffectManager.h index 9565c2d..9e290ac 100644 --- a/inc/FUiEffectsEffectManager.h +++ b/inc/FUiEffectsEffectManager.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiEffectsIEffectEventListener.h b/inc/FUiEffectsIEffectEventListener.h index e55c1c1..2da0f4b 100644 --- a/inc/FUiEffectsIEffectEventListener.h +++ b/inc/FUiEffectsIEffectEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiEffectsIEffectResourceProvider.h b/inc/FUiEffectsIEffectResourceProvider.h index cc57332..94201d1 100644 --- a/inc/FUiEffectsIEffectResourceProvider.h +++ b/inc/FUiEffectsIEffectResourceProvider.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiEffectsTypes.h b/inc/FUiEffectsTypes.h index a12a62f..897de58 100644 --- a/inc/FUiEffectsTypes.h +++ b/inc/FUiEffectsTypes.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/inc/FUiFocusManager.h b/inc/FUiFocusManager.h index 1a9fa2a..b992bb5 100644 --- a/inc/FUiFocusManager.h +++ b/inc/FUiFocusManager.h @@ -47,7 +47,7 @@ class _OSP_EXPORT_ FocusManager { public: /** - * Gets the pointer to the current focus manager. + * Gets the pointer to the current focus manager. * * @since 2.0 * @@ -66,12 +66,12 @@ public: Control* GetCurrentFocusOwner(void) const; /** - * Gets the current focused Window. - * - * @since 2.0 - * + * Gets the current focused Window. + * + * @since 2.0 + * * @return The current focused Window - * @remarks The method returns the application's current focus owner's ancestor Window or the %Window that is currently focused. + * @remarks The method returns the application's current focus owner's ancestor Window or the %Window that is currently focused. */ Window* GetCurrentFocusedWindow(void) const; diff --git a/inc/FUiGridLayout.h b/inc/FUiGridLayout.h index c6ee3ff..dcd5616 100755 --- a/inc/FUiGridLayout.h +++ b/inc/FUiGridLayout.h @@ -290,6 +290,23 @@ public: */ result SetColumnSpacing(int columnIndex, int space); + /* + * Sets the space before the specified column index. + * + * @since 2.1 + * + * @return An error code + * @param[in] columnIndex The column index + * @param[in] space An @c int representing the space + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The specified index is out of range. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method does not perform any operation if the value of @c columnIndex is 0. + * @remarks The column spacing cannot be applied to the first column. + */ + result SetColumnSpacing(int columnIndex, float space); + /** * Sets the stretching ability of the specified row. * @@ -378,6 +395,23 @@ public: */ result SetRowSpacing(int rowIndex, int space); + /* + * Sets the space before the specified column index. + * + * @since 2.1 + * + * @return An error code + * @param[in] rowIndex The row index + * @param[in] space An @c int representing the space + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. + * @exception E_OUT_OF_RANGE The specified index is out of range. + * @exception E_SYSTEM A system error has occurred. + * @remarks This method does not perform any operation if the value of @c rowIndex is @c 0. + * @remarks The row spacing cannot be applied to the first column. + */ + result SetRowSpacing(int rowIndex, float space); + /** * Sets the position and span of the control. @n * Adds the control at the specified position. @@ -443,6 +477,24 @@ public: */ result SetMargin(Control& childControl, int left, int right, int top, int bottom); + /* + * Sets the margins of the specified control. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the margins are set + * @param[in] left The left margin + * @param[in] right The right margin + * @param[in] top The top margin + * @param[in] bottom The bottom margin + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. @n + * The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the margins are set to @c 0. + */ + result SetMargin(Control& childControl, float left, float right, float top, float bottom); private: // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. diff --git a/inc/FUiHorizontalBoxLayout.h b/inc/FUiHorizontalBoxLayout.h index 275b2c1..e3b7035 100755 --- a/inc/FUiHorizontalBoxLayout.h +++ b/inc/FUiHorizontalBoxLayout.h @@ -256,6 +256,21 @@ public: */ result SetSpacing(Control& childControl, int space); + /* + * Sets the space between the specified control and its predecessor. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the space is set + * @param[in] space The space + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the spacing is set to @c 0. + */ + result SetSpacing(Control& childControl, float space); + /** * Sets the vertical margins of the specified control. * @@ -272,6 +287,22 @@ public: */ result SetVerticalMargin(Control& childControl, int top, int bottom); + /* + * Sets the vertical margins of the specified control. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the margins are set + * @param[in] top The top margin + * @param[in] bottom The bottom margin + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the margins are set to @c 0. + */ + result SetVerticalMargin(Control& childControl, float top, float bottom); + /** * Sets the width of the specified control with the fixed length. * @@ -286,6 +317,20 @@ public: */ result SetWidth(Control& childControl, int width); + /* + * Sets the width of the specified control with the fixed length. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the width is set + * @param[in] width The value of the width + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetWidth(Control& childControl, float width); + /** * Sets the width of the specified control with the fitting policy. * @@ -315,6 +360,20 @@ public: */ result SetHeight(Control& childControl, int height); + /* + * Sets the height of the specified control with a fixed length. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the height is set + * @param[in] height The value of the height + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetHeight(Control& childControl, float height); + /** * Sets the height of the specified control with the fitting policy. * diff --git a/inc/FUiIAccessibilityListener.h b/inc/FUiIAccessibilityListener.h index 5103004..30d3bd8 100644 --- a/inc/FUiIAccessibilityListener.h +++ b/inc/FUiIAccessibilityListener.h @@ -35,60 +35,59 @@ class AccessibilityElement; class Control; /** - * @interface IAccessibilityListener - * @brief This interface is the listener interface for accessibility screen reader - * - * @since 2.0 - * - * This %IAccessibilityListener defines methods for accessibility screen reader - * - */ +* @interface IAccessibilityListener +* @brief This interface is the listener interface for accessibility screen reader +* +* @since 2.0 +* +* This %IAccessibilityListener defines methods for accessibility screen reader +* +*/ class _OSP_EXPORT_ IAccessibilityListener : virtual public Tizen::Base::Runtime::IEventListener { public: /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.0 + */ virtual ~IAccessibilityListener(void) {} /** - * Notifies when the accessibility element gets a focus. - * - * @since 2.0 - * @param[in] control The control that has a accessibility element. - * @param[in] element The element. - */ + * Notifies when the accessibility element gets a focus. + * + * @since 2.0 + * @param[in] control The control that has a accessibility element. + * @param[in] element The element. + */ virtual void OnAccessibilityFocusIn(const Control& control, const AccessibilityElement& element) = 0; /** - * Notifies when the accessibility element losts a focus. - * - * @since 2.0 - * @param[in] control The control that has a accessibility element. - * @param[in] element The element. - */ - virtual void OnAccessibilityFocusOut(const Control& control, const AccessibilityElement& element) = 0; - + * Notifies when the accessibility element losts a focus. + * + * @since 2.0 + * @param[in] control The control that has a accessibility element. + * @param[in] element The element. + */ + virtual void OnAccessibilityFocusOut(const Control& control, const AccessibilityElement& element) = 0; /** - * Notifies when the accessibility element is operated. - * - * @since 2.0 - * @param[in] control The control that has a accessibility element. - * @param[in] element The element. - */ + * Notifies when the accessibility element is operated. + * + * @since 2.0 + * @param[in] control The control that has a accessibility element. + * @param[in] element The element. + */ virtual void OnAccessibilityActionPerformed(const Control& control, const AccessibilityElement& element) = 0; /** - * Notifies when the accessibility screen status is changed. - * - * @since 2.0 - * @param[in] control The control that has a accessibility element. - * @param[in] element The focused element. - * @param[in] status The changed status. - */ + * Notifies when the accessibility screen status is changed. + * + * @since 2.0 + * @param[in] control The control that has a accessibility element. + * @param[in] element The focused element. + * @param[in] status The changed status. + */ virtual void OnAccessibilityScreenReaderStatusChanged(const Control& control, const AccessibilityElement& element, AccessibilityScreenReaderStatus status) = 0; protected: @@ -139,4 +138,4 @@ protected: }; // IAccessibilityListener }} // Tizen::Ui -#endif // _FUI_IACCESSIBILITY_LISTENER_H_ +#endif // _FUI_IACCESSIBILITY_LISTENER_H_ \ No newline at end of file diff --git a/inc/FUiIAdjustmentEventListener.h b/inc/FUiIAdjustmentEventListener.h index 49771e0..3e74e5f 100644 --- a/inc/FUiIAdjustmentEventListener.h +++ b/inc/FUiIAdjustmentEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiIAdjustmentEventListener.h * @brief This is the header file for the %IAdjustmentEventListener interface. diff --git a/inc/FUiIAnimationEventListener.h b/inc/FUiIAnimationEventListener.h index 4151466..fb3602b 100644 --- a/inc/FUiIAnimationEventListener.h +++ b/inc/FUiIAnimationEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiIAnimationEventListener.h * @brief This is the header file for the %IAnimationEventListener interface. diff --git a/inc/FUiIColorChangeEventListener.h b/inc/FUiIColorChangeEventListener.h index 06634f3..a06e287 100644 --- a/inc/FUiIColorChangeEventListener.h +++ b/inc/FUiIColorChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiIColorChangeEventListener.h * @brief This is the header file for the %IColorChangeEventListener interface. diff --git a/inc/FUiICustomItemEventListener.h b/inc/FUiICustomItemEventListener.h old mode 100644 new mode 100755 index 46bb675..486b54e --- a/inc/FUiICustomItemEventListener.h +++ b/inc/FUiICustomItemEventListener.h @@ -39,7 +39,7 @@ namespace Tizen {namespace Ui { /** - * @if OSPDEPREC + * @if OSPDEPREC * @interface ICustomItemEventListener * @brief [Deprecated] This interface implements the listener for the item event. * @@ -57,18 +57,18 @@ class _OSP_EXPORT_ ICustomItemEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use IListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ virtual ~ICustomItemEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the state of CustomListItem is changed. * * @brief [Deprecated] @@ -81,13 +81,13 @@ public: * @param[in] status The state of the item * @remarks Implement this method in a class which derives %ICustomItemEventListener to handle the user interaction at the CustomListItem. * @remarks If CustomList is constructed with CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER, this method is called when the radio button is selected. - * @endif + * @endif */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, Tizen::Ui::ItemStatus status) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the state of an element in the CustomListItem is changed. * * @brief [Deprecated] @@ -103,7 +103,7 @@ public: * CustomListItem. * @remarks If CustomList is constructed with CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER, this method is not called when the radio button is selected. * Instead, OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, Tizen::Ui::ItemStatus status) is called. - * @endif + * @endif */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, int elementId, Tizen::Ui::ItemStatus status) = 0; diff --git a/inc/FUiIDataBindingDataTransformer.h b/inc/FUiIDataBindingDataTransformer.h index 1c13f4a..b2ae8fe 100644 --- a/inc/FUiIDataBindingDataTransformer.h +++ b/inc/FUiIDataBindingDataTransformer.h @@ -37,13 +37,13 @@ namespace Tizen { namespace Ui { /** - * @interface IDataBindingDataTransformer - * @brief This interface defines methods for transforming the value of the data that will be updated to the binding target or source. - * - * @since 2.0 - * - * The %IDataBindingDataTransformer interface defines methods for transforming the value of source type to the value of destination type. - */ +* @interface IDataBindingDataTransformer +* @brief This interface defines methods for transforming the value of the data that will be updated to the binding target or source. +* +* @since 2.0 +* +* The %IDataBindingDataTransformer interface defines methods for transforming the value of source type to the value of destination type. +*/ class _OSP_EXPORT_ IDataBindingDataTransformer { public: @@ -55,53 +55,53 @@ public: virtual ~IDataBindingDataTransformer(void) {}; /** - * Transforms the value of the data of source type to value of target type. - * @since 2.0 - * @return @c true if it is successful to convert source to target @n - * else @c false - * @param[in] bindingId the specified binding id - * @param[in] sourceType The source data type - * @param[in] sourceData The data source - * @param[in] targetType The target data type - * @param[out] targetData The data target - */ + * Transforms the value of the data of source type to value of target type. + * @since 2.0 + * @return @c true if it is successful to convert source to target @n + * else @c false + * @param[in] bindingId the specified binding id + * @param[in] sourceType The source data type + * @param[in] sourceData The data source + * @param[in] targetType The target data type + * @param[out] targetData The data target + */ virtual bool TransformSourceToTarget(const Tizen::Base::String& bindingId, DataBindingDataType sourceType, const Tizen::Base::Object& sourceData, DataBindingDataType targetType, Tizen::Base::Object& targetData) = 0; /** - * Transforms the value of the data of target type to value of source type. - * @since 2.0 - * @return @c true if it is successful to convert target to source @n - * else @c false - * @param[in] bindingId the specified binding id - * @param[in] targetType The target data type - * @param[in] targetData The data target - * @param[in] sourceType The source data type - * @param[out] sourceData The data source - */ + * Transforms the value of the data of target type to value of source type. + * @since 2.0 + * @return @c true if it is successful to convert target to source @n + * else @c false + * @param[in] bindingId the specified binding id + * @param[in] targetType The target data type + * @param[in] targetData The data target + * @param[in] sourceType The source data type + * @param[out] sourceData The data source + */ virtual bool TransformTargetToSource(const Tizen::Base::String& bindingId, DataBindingDataType targetType, const Tizen::Base::Object& targetData, DataBindingDataType sourceType, Tizen::Base::Object& sourceData) = 0; /** - * Checks whether the this transformer can convert the source type to target type - * - * @since 2.0 - * @return @c true It is possible to transform source type to target type, @n - * else @c It's not possible - * @param[in] bindingId the specified binding id - * @param[in] sourceType The source data type - * @param[in] targetType The taret data type - */ + * Checks whether the this transformer can convert the source type to target type + * + * @since 2.0 + * @return @c true It is possible to transform source type to target type, @n + * else @c It's not possible + * @param[in] bindingId the specified binding id + * @param[in] sourceType The source data type + * @param[in] targetType The taret data type + */ virtual bool IsSourceToTargetTransformable(const Tizen::Base::String& bindingId, DataBindingDataType sourceType, DataBindingDataType targetType) = 0; /** - * Checks whether the this transformer can convert the target type to source type - * - * @since 2.0 - * @return @c true It is possible to transform target type to source type, @n - * else @c It's not possible - * @param[in] bindingId the specified binding id - * @param[in] targetType The taret data type - * @param[in] sourceType The source data type - */ + * Checks whether the this transformer can convert the target type to source type + * + * @since 2.0 + * @return @c true It is possible to transform target type to source type, @n + * else @c It's not possible + * @param[in] bindingId the specified binding id + * @param[in] targetType The taret data type + * @param[in] sourceType The source data type + */ virtual bool IsTargetToSourceTransformable(const Tizen::Base::String& bindingId, DataBindingDataType targetType, DataBindingDataType sourceType) = 0; protected: diff --git a/inc/FUiIDataBindingDataValidator.h b/inc/FUiIDataBindingDataValidator.h index 375d431..017973d 100644 --- a/inc/FUiIDataBindingDataValidator.h +++ b/inc/FUiIDataBindingDataValidator.h @@ -37,14 +37,14 @@ namespace Tizen { namespace Ui { /** - * @interface IDataBindingDataValidator - * @brief This interface defines methods for validating the value of transformed data that will be updated to the binding - * target or source. - * - * @since 2.0 - * - * The %IDataBindingDataValidator interface defines methods for validating the value of transformed data that will be updated to the binding. - */ +* @interface IDataBindingDataValidator +* @brief This interface defines methods for validating the value of transformed data that will be updated to the binding +* target or source. +* +* @since 2.0 +* +* The %IDataBindingDataValidator interface defines methods for validating the value of transformed data that will be updated to the binding. +*/ class _OSP_EXPORT_ IDataBindingDataValidator { public: @@ -56,25 +56,25 @@ public: virtual ~IDataBindingDataValidator(void) {}; /** - * Validates the value of the transformed data that will be updated to the binding target. - * - * @since 2.0 - * @return @c true if the specified value is valid, @n - * else @c false - * @param[in] bindingId The binding Id to validate - * @param[in] data The data to validate - */ + * Validates the value of the transformed data that will be updated to the binding target. + * + * @since 2.0 + * @return @c true if the specified value is valid, @n + * else @c false + * @param[in] bindingId The binding Id to validate + * @param[in] data The data to validate + */ virtual bool ValidateDataToTarget(const Tizen::Base::String& bindingId, const Tizen::Base::Object& data) = 0; /** - * Validates the value of the transformed data that will be updated to the binding source. - * - * @since 2.0 - * @return @c true if the specified value is valid, @n - * else @c false - * @param[in] bindingId The binding Id to validate - * @param[in] data The data to validate - */ + * Validates the value of the transformed data that will be updated to the binding source. + * + * @since 2.0 + * @return @c true if the specified value is valid, @n + * else @c false + * @param[in] bindingId The binding Id to validate + * @param[in] data The data to validate + */ virtual bool ValidateDataToSource( const Tizen::Base::String& bindingId, const Tizen::Base::Object& data) = 0; protected: diff --git a/inc/FUiIDataBindingListener.h b/inc/FUiIDataBindingListener.h index c64fd75..9443532 100644 --- a/inc/FUiIDataBindingListener.h +++ b/inc/FUiIDataBindingListener.h @@ -32,13 +32,13 @@ namespace Tizen { namespace Ui { /** - * @interface IDataBindingListener - * @brief This interface is the listener interface for receiving data binding-related events. - * - * @since 2.0 - * - * The %IDataBindingListener interface defines methods for receiving data binding-related events. - */ +* @interface IDataBindingListener +* @brief This interface is the listener interface for receiving data binding-related events. +* +* @since 2.0 +* +* The %IDataBindingListener interface defines methods for receiving data binding-related events. +*/ class _OSP_EXPORT_ IDataBindingListener : public Tizen::Base::Runtime::IEventListener { @@ -51,38 +51,42 @@ public: virtual ~IDataBindingListener(void) {}; /** - * Called when the data transfer for source is completed by the data binding. - * - * @since 2.0 - * - * @param[in] bindingId The binding ID - * @param[in] controlName The name of binding target control - * @param[in] propertyName The name of binding target property - */ - virtual void OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName) = 0; + * Called when the data transfer for source is completed by the data binding. + * + * @since 2.0 + * + * @param[in] bindingId The binding ID + * @param[in] controlName The name of binding target control + * @param[in] propertyName The name of binding target property + */ + virtual void OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName + , const Tizen::Base::String& propertyName) = 0; /** - * Called when the data transfer for target is completed by the data binding. - * - * @since 2.0 - * - * @param[in] bindingId The binding ID - * @param[in] controlName The name of binding target control - * @param[in] propertyName The name of binding target property - */ - virtual void OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName) = 0; + * Called when the data transfer for target is completed by the data binding. + * + * @since 2.0 + * + * @param[in] bindingId The binding ID + * @param[in] controlName The name of binding target control + * @param[in] propertyName The name of binding target property + */ + virtual void OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName + , const Tizen::Base::String& propertyName) = 0; + /** - * Called when a validation has failed during data transfer. - * - * @since 2.0 - * - * @param[in] bindingId The binding ID - * @param[in] controlName The name of binding target control - * @param[in] propertyName The name of binding target property - * @param[in] destType The data binding destination type - */ - virtual void OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, DataBindingDestinationType destType) = 0; + * Called when a validation has failed during data transfer. + * + * @since 2.0 + * + * @param[in] bindingId The binding ID + * @param[in] controlName The name of binding target control + * @param[in] propertyName The name of binding target property + * @param[in] destType The data binding destination type + */ + virtual void OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName + , const Tizen::Base::String& propertyName, DataBindingDestinationType destType) = 0; protected: // diff --git a/inc/FUiIDateChangeEventListener.h b/inc/FUiIDateChangeEventListener.h index dc3df7e..53df8a8 100644 --- a/inc/FUiIDateChangeEventListener.h +++ b/inc/FUiIDateChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiIDateChangeEventListener.h * @brief This is the header file for the %IDateChangeEventListener interface. diff --git a/inc/FUiIDateTimeChangeEventListener.h b/inc/FUiIDateTimeChangeEventListener.h index 3f92c6c..51470d6 100644 --- a/inc/FUiIDateTimeChangeEventListener.h +++ b/inc/FUiIDateTimeChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiIDateTimeChangeEventListener.h * @brief This is the header file for the %IDateTimeChangeEventListener interface. diff --git a/inc/FUiIDragDropEventListenerF.h b/inc/FUiIDragDropEventListenerF.h new file mode 100755 index 0000000..e54d7c3 --- /dev/null +++ b/inc/FUiIDragDropEventListenerF.h @@ -0,0 +1,110 @@ + +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/* +* @file FUiIDragDropEventListenerF.h +* @brief This is the header file for the %IDragDropEventListenerF interface. +* +* This header file contains the declarations of the %IDragDropEventListenerF interface. +*/ +#ifndef _FUI_IDRAG_DROP_EVENT_LISTENERF_H_ +#define _FUI_IDRAG_DROP_EVENT_LISTENERF_H_ + +#include +#include +#include + +namespace Tizen { namespace Ui +{ + +class Control; + +/* + * @interface IDragDropEventListenerF + * @brief This interface implements the listener for a drag and drop event. + * + * @since 2.1 + * + * The %IDragDropEventListenerF interface is the listener interface for receiving drag and drop events. + * The class that processes a drag and drop event implements this interface, and the instance created with that class is + * registered with a UI control, using the control's AddDragDropEventListenerF() method. When the drag and drop event occurs, a + * method of that instance is invoked. + * @n + * For more information on the class features, see Event Listeners. + */ +class _OSP_EXPORT_ IDragDropEventListenerF + : virtual public Tizen::Base::Runtime::IEventListener +{ +// Operation +public: + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This is the destructor for this class. + // + // @since 2.1 + // + virtual ~IDragDropEventListenerF(void) {} + + /* + * Called when an entity is dragged. + * + * @since 2.1 + * + * @param[in] source The source of the event + * @param[in] startPosition The start position + * @param[in] currentPosition The current position + */ + virtual void OnTouchDraggedF(const Tizen::Ui::Control& source, + const Tizen::Graphics::FloatPoint& startPosition, const Tizen::Graphics::FloatPoint& currentPosition) = 0; + + /* + * Called when an entity is dropped. + * + * @since 2.1 + * + * @param[in] source The source of the event + * @param[in] startPosition The start position + * @param[in] currentPosition The current position + */ + virtual void OnTouchDroppedF(const Tizen::Ui::Control& source, + const Tizen::Graphics::FloatPoint& startPosition, const Tizen::Graphics::FloatPoint& currentPosition) = 0; + +protected: + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IDragDropEventListenerF_Reserved1(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IDragDropEventListenerF_Reserved2(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IDragDropEventListenerF_Reserved3(void) {} +}; // IDragDropEventListenerF + +} } // Tizen::Ui + +#endif // _FUI_IDRAG_DROP_EVENT_LISTENERF_H_ diff --git a/inc/FUiIExpandableItemEventListener.h b/inc/FUiIExpandableItemEventListener.h old mode 100644 new mode 100755 index e20b8f6..37dea68 --- a/inc/FUiIExpandableItemEventListener.h +++ b/inc/FUiIExpandableItemEventListener.h @@ -57,19 +57,19 @@ class _OSP_EXPORT_ IExpandableItemEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] * @deprecated This listener is deprecated. This listener is deprecated. Instead of using this class, use - * IGroupedTableViewEventListener. + * IGroupedTableViewEventListener. * @since 2.0 - * @endif + * @endif */ virtual ~IExpandableItemEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the state of CustomListItem in the ExpandableList is changed. @n * If a main item is selected, the index of the sub-item is @c -1. * @@ -84,29 +84,29 @@ public: * @param[in] status The state of the item * @remarks Implement this method in a class that derives %IExpandableItemEventListener to handle the user interaction at the CustomListItem of the * ExpandableList. - * @endif + * @endif */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int mainIndex, int subIndex, int itemId, Tizen::Ui::ItemStatus status) = 0; /** - * @if OSPDEPREC - * Called when the state of an element in CustomListItem in ExpandableList is changed. @n - * If a main item is selected, the index of the sub-item is @c -1. - * @brief [Deprecated] - * @deprecated This listener is deprecated. Instead of using this class, use IGroupedTableViewEventListener. - * @since 2.0 - * - * @param[in] source The source control from which the event is fired - * @param[in] mainIndex The main index of the item - * @param[in] subIndex The sub index of the item - * @param[in] itemId The item ID - * @param[in] elementId The element ID - * @param[in] status The state of the element - * @remarks Implement this method in a class that derives %IExpandableItemEventListener to handle the user interaction at the element in - * CustomListItem of ExpandableList. - * @endif - */ + * @if OSPDEPREC + * Called when the state of an element in CustomListItem in ExpandableList is changed. @n + * If a main item is selected, the index of the sub-item is @c -1. + * @brief [Deprecated] + * @deprecated This listener is deprecated. Instead of using this class, use IGroupedTableViewEventListener. + * @since 2.0 + * + * @param[in] source The source control from which the event is fired + * @param[in] mainIndex The main index of the item + * @param[in] subIndex The sub index of the item + * @param[in] itemId The item ID + * @param[in] elementId The element ID + * @param[in] status The state of the element + * @remarks Implement this method in a class that derives %IExpandableItemEventListener to handle the user interaction at the element in + * CustomListItem of ExpandableList. + * @endif + */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int mainIndex, int subIndex, int itemId, int elementId, Tizen::Ui::ItemStatus status) = 0; }; //IExpandableItemEventListener diff --git a/inc/FUiIFastScrollEventListener.h b/inc/FUiIFastScrollEventListener.h old mode 100644 new mode 100755 index a933728..442dad1 --- a/inc/FUiIFastScrollEventListener.h +++ b/inc/FUiIFastScrollEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -58,18 +58,18 @@ class _OSP_EXPORT_ IFastScrollEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use the IFastScrollListener class. * @since 2.0 - * @endif + * @endif */ virtual ~IFastScrollEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when a main index is selected. * * @brief [Deprecated] @@ -78,12 +78,12 @@ public: * * @param[in] source The source of the event * @param[in] mainIndex The main index - * @endif + * @endif */ virtual void OnMainIndexChanged(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when a sub index is selected. * * @brief [Deprecated] @@ -98,7 +98,7 @@ public: virtual void OnSubIndexChanged(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex, Tizen::Base::Character& subIndex) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when a main index is expanded. * * @brief [Deprecated] @@ -112,7 +112,7 @@ public: virtual void OnMainIndexSelected(const Tizen::Ui::Control& source, Tizen::Base::Character& mainIndex) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when a sub index is expanded. * * @brief [Deprecated] diff --git a/inc/FUiIFocusEventListener.h b/inc/FUiIFocusEventListener.h index 2b9cfbd..c7352fb 100644 --- a/inc/FUiIFocusEventListener.h +++ b/inc/FUiIFocusEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -32,14 +32,11 @@ namespace Tizen { namespace Ui class Control; -/** - * @enum FocusStatus - * - * Defines constants used to identify focus status. - * - * @since 2.0 - * - */ +// +//@enum FocusStatus +//Defines constants used to identify focus status. +//@since 2.0 +// enum FocusStatus { diff --git a/inc/FUiIGroupedItemEventListener.h b/inc/FUiIGroupedItemEventListener.h old mode 100644 new mode 100755 index 5111668..cb0354e --- a/inc/FUiIGroupedItemEventListener.h +++ b/inc/FUiIGroupedItemEventListener.h @@ -54,29 +54,29 @@ class _OSP_EXPORT_ IGroupedItemEventListener { public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the default constructor for this class. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use IGroupedListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ IGroupedItemEventListener(void) {}; /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use IGroupedListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ virtual ~IGroupedItemEventListener(void) {}; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the state of an element in the CustomListItem instance in the GroupedList instance is changed. @n * For example, this method is called when an element of %CustomListItem in %GroupedList is checked, unchecked, or selected. * @@ -93,12 +93,12 @@ public: * @remarks If GroupedList or SlidableGroupedList is constructed with CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER, this method is not called when the * radio button is selected. Instead, OnItemStateChanged(const Tizen::Ui::Control &source, int groupIndex, int itemIndex, int itemId, * Tizen::Ui::ItemStatus status) is called. - * @endif - */ + * @endif + */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int groupIndex, int itemIndex, int itemId, int elementId, Tizen::Ui::ItemStatus status) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the state of an item in the grouped list is changed. @n * For example, this method is called when an item of the GroupedList control is checked, unchecked, or selected. * @@ -113,7 +113,7 @@ public: * @param[in] status The state of the item * @remarks If GroupedList or SlidableGroupedList is constructed with CUSTOM_LIST_STYLE_RADIO_WITH_DIVIDER, this method is called when the radio * button is selected. - * @endif + * @endif */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int groupIndex, int itemIndex, int itemId, Tizen::Ui::ItemStatus status) = 0; }; //IGroupedItemEventListener diff --git a/inc/FUiIInputConnectionEventListener.h b/inc/FUiIInputConnectionEventListener.h old mode 100644 new mode 100755 index 8fbc4da..bc5fd74 --- a/inc/FUiIInputConnectionEventListener.h +++ b/inc/FUiIInputConnectionEventListener.h @@ -32,11 +32,11 @@ #include namespace Tizen { namespace Base { -class String; + class String; }} // Tizen::Base namespace Tizen { namespace Graphics { -class Rectangle; + class Rectangle; }} // Tizen::Graphics diff --git a/inc/FUiIInputConnectionEventListenerF.h b/inc/FUiIInputConnectionEventListenerF.h new file mode 100644 index 0000000..4d490f6 --- /dev/null +++ b/inc/FUiIInputConnectionEventListenerF.h @@ -0,0 +1,180 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiIInputConnectionEventListenerF.h + * @brief This is the header file for the %IInputConnectionEventListenerF class. + * + * This header file contains the declarations of the %IInputConnectionEventListenerF class. + * + * + */ + +#ifndef _FUI_IINPUT_CONNECTION_EVENT_LISTENER_F_H_ +#define _FUI_IINPUT_CONNECTION_EVENT_LISTENER_F_H_ + +#include +#include +#include + +namespace Tizen { namespace Base { + class String; +}} // Tizen::Base + +namespace Tizen { namespace Graphics { + class FloatRectangle; +}} // Tizen::Graphics + + +namespace Tizen { namespace Ui { + +class InputConnection; + +/** + * @class IInputConnectionEventListenerF + * @brief This is the header file for the %IInputConnectionEventListenerF class. + * This header file contains the declarations of the %IInputConnectionEventListenerF class. + * It's possible to not work the callback depending on the current InputMethod. + * @since 2.1 + * + * The %IInputConnectionEventListener interface defines methods for processing between the InputConnection and the input method. + */ +class _OSP_EXPORT_ IInputConnectionEventListenerF + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IInputConnectionEventListenerF(void) {} + + /** + * Notifies when the show state of the InputPanel is changed. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] showState The state + */ + virtual void OnInputConnectionPanelShowStateChanged(Tizen::Ui::InputConnection& source, Tizen::Ui::InputPanelShowState showState) = 0; + + /** + * Notifies when the language of the InputPanel is changed. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] language The language code + */ + virtual void OnInputConnectionPanelLanguageChanged(Tizen::Ui::InputConnection& source, Tizen::Locales::LanguageCode language) = 0; + + /** + * Notifies when the size of the InputPanel is changed. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] bounds The size + */ + virtual void OnInputConnectionPanelBoundsChanged(Tizen::Ui::InputConnection& source, const Tizen::Graphics::FloatRectangle& bounds) = 0; + + /** + * Notifies when the show state of the Text-Prediction is changed. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] isShown The state + */ + virtual void OnInputConnectionTextPredictionShowStateChanged(Tizen::Ui::InputConnection& source, bool isShown) = 0; + + /** + * Notifies when the size of the Text-Prediction is changed. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] bounds The size + */ + virtual void OnInputConnectionTextPredictionBoundsChanged(Tizen::Ui::InputConnection& source, const Tizen::Graphics::FloatRectangle& bounds) = 0; + + /** + * Notifies when the key of the InputPanel is selected. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] committedText The committed text. + */ + virtual void OnInputConnectionTextCommitted(Tizen::Ui::InputConnection& source, const Tizen::Base::String& committedText) = 0; + + /** + * Notifies when the key of the InputPanel is selected during the composing. + * + * @since 2.1 + * @param[in] source The source of the event + * @param[in] composingText The composing text. + * @param[in] cursorPosition the current cursor position. + */ + virtual void OnInputConnectionComposingTextChanged(Tizen::Ui::InputConnection& source, const Tizen::Base::String& composingText, int cursorPosition) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IInputConnectionEventListenerF_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IInputConnectionEventListenerF_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IInputConnectionEventListenerF_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IInputConnectionEventListenerF_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void IInputConnectionEventListenerF_Reserved5(void) {} +}; // IInputConnectionEventListenerF + +}} // Tizen::Ui +#endif // _FUI_IINPUT_CONNECTION_EVENT_LISTENER_F_H_ + diff --git a/inc/FUiIInputConnectionProvider.h b/inc/FUiIInputConnectionProvider.h old mode 100644 new mode 100755 index 7c9e2db..7cbe8b5 --- a/inc/FUiIInputConnectionProvider.h +++ b/inc/FUiIInputConnectionProvider.h @@ -30,7 +30,7 @@ #include namespace Tizen { namespace Base { -class String; + class String; }} // Tizen::Base namespace Tizen { namespace Ui { diff --git a/inc/FUiIItemEventListener.h b/inc/FUiIItemEventListener.h old mode 100644 new mode 100755 index 9d5b81a..59d4f9b --- a/inc/FUiIItemEventListener.h +++ b/inc/FUiIItemEventListener.h @@ -52,7 +52,7 @@ enum ItemStatus ITEM_CHECKED = 0, /**< @if OSPDEPREC The item has been checked (toggle of the check area) @endif */ ITEM_UNCHECKED, /**< @if OSPDEPREC The item has been unchecked (toggle of the check area) @endif */ ITEM_SELECTED, /**< @if OSPDEPREC The item has been selected (non-check area of the item) @endif */ - ITEM_HIGHLIGHTED /**< @if OSPDEPREC The item has been highlighted (non-check area of the item) @endif */ + ITEM_HIGHLIGHTED /**< @if OSPDEPREC The item has been highlighted (non-check area of the item) @b Since: @b 1.1 @endif */ }; /** @@ -73,18 +73,18 @@ class _OSP_EXPORT_ IItemEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] * @deprecated This class is deprecated. Instead of using this class, use IListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ virtual ~IItemEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when an item event occurs. * * @brief [Deprecated] @@ -95,7 +95,7 @@ public: * @param[in] index The index of the item * @param[in] itemId The item ID * @param[in] status The item status - * @endif + * @endif */ virtual void OnItemStateChanged(const Tizen::Ui::Control& source, int index, int itemId, Tizen::Ui::ItemStatus status) = 0; }; //IItemEventListener diff --git a/inc/FUiIKeyEventListener.h b/inc/FUiIKeyEventListener.h index ec1917f..0b3a211 100644 --- a/inc/FUiIKeyEventListener.h +++ b/inc/FUiIKeyEventListener.h @@ -14,7 +14,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // - /** * @file FUiIKeyEventListener.h * @brief This is the header file for the %IKeyEventListener interface. @@ -23,467 +22,16 @@ * If a key event is generated, a method of this interface is called. @n * If an application performs tasks related to the key event, use the methods of this interface. */ - #ifndef _FUI_IKEY_EVENT_LISTENER_H_ #define _FUI_IKEY_EVENT_LISTENER_H_ #include #include +#include namespace Tizen {namespace Ui { class Control; -/** - * @enum KeyCode - * - * Defines the list of keys supported by the system. @n - * Note that certain keys may not be available on all devices. @n - * Please use the Tizen::Ui::KeyboardMap class to query the availability of a specific key on the target device. - * - * @since 2.0 - */ -enum KeyCode -{ - /** - * The invalid key - */ - KEY_INVALID = 0x0000, - - /** - * The up side key - */ - KEY_SIDE_UP, - - /** - * The down side key - */ - KEY_SIDE_DOWN, - - /** - * The Ok key - */ - KEY_OK, - - /** - * The clear key - */ - KEY_CLEAR, - - /** - * The camera key - */ - KEY_CAMERA, - - /** - * The task switcher key - */ - KEY_SWITCH, - - /** - * The 0 key - */ - KEY_0, - - /** - * The 1 key - */ - KEY_1, - - /** - * The 2 key - */ - KEY_2, - - /** - * The 3 key - */ - KEY_3, - - /** - * The 4 key - */ - KEY_4, - - /** - * The 5 key - */ - KEY_5, - - /** - * The 6 key - */ - KEY_6, - - /** - * The 7 key - */ - KEY_7, - - /** - * The 8 key - */ - KEY_8, - - /** - * The 9 key - */ - KEY_9, - - /** - * The asterisk key - */ - KEY_ASTERISK, - - /** - * The sharp key - */ - KEY_SHARP, - - /** - * The left directional key - */ - KEY_LEFT, - - /** - * The up directional key - */ - KEY_UP, - - /** - * The down directional key - */ - KEY_DOWN, - - /** - * The right directional key - */ - KEY_RIGHT, - - /* - * The Placeholder - */ - KEY_MAX, - - /** - * The A key - */ - KEY_A, - - /** - * The B key - */ - KEY_B, - - /** - * The C key - */ - KEY_C, - - /** - * The D key - */ - KEY_D, - - /** - * The E key - */ - KEY_E, - - /** - * The F key - */ - KEY_F, - - /** - * The G key - */ - KEY_G, - - /** - * The H key - */ - KEY_H, - - /** - * The I key - */ - KEY_I, - - /** - * The J key - */ - KEY_J, - - /** - * The K key - */ - KEY_K, - - /** - * The L key - */ - KEY_L, - - /** - * The M key - */ - KEY_M, - - /** - * The N key - */ - KEY_N, - - /** - * The O key - */ - KEY_O, - - /** - * The P key - */ - KEY_P, - - /** - * The Q key - */ - KEY_Q, - - /** - * The R key - */ - KEY_R, - - /** - * The S key - */ - KEY_S, - - /** - * The T key - */ - KEY_T, - - /** - * The U key - */ - KEY_U, - - /** - * The V key - */ - KEY_V, - - /** - * The W key - */ - KEY_W, - - /** - * The Y key - */ - KEY_Y, - - /** - * The X key - */ - KEY_X, - - /** - * The Z key - */ - KEY_Z, - - /** - * The backspace key - */ - KEY_BACKSPACE, - - /** - * The comma key - */ - KEY_COMMA, - - /** - * The enter key - */ - KEY_ENTER, - - /** - * The Caps Lock key - */ - KEY_CAPSLOCK, - - /** - * The Question key - */ - KEY_QUESTION, - - /** - * The Alt key - */ - KEY_ALT, - - /** - * The Language Symbol key - */ - KEY_SYM, - - /** - * The Language Setting key - */ - KEY_SETTING, - - /** - * The Space key - */ - KEY_SPACE, - - /** - * The Dot key - */ - KEY_DOT, - - /** - * The Function key - */ - KEY_FN, - - /** - * The camera half shutter key - */ - KEY_CAMERA_HALF_SHUTTER, - - /** - * The Character symbol 1 key - */ - KEY_CHAR_SYM_1, - - /** - * The Character symbol 2 key - */ - KEY_CHAR_SYM_2, - - /** - * The Character symbol 3 key - */ - KEY_CHAR_SYM_3, - - /** - * The Character symbol 4 key - */ - KEY_CHAR_SYM_4, - - /** - * The Character symbol 5 key - */ - KEY_CHAR_SYM_5, - - /** - * The Character symbol 6 key - */ - KEY_CHAR_SYM_6, - - /** - * The Character symbol 7 key - */ - KEY_CHAR_SYM_7, - - /** - * The Character symbol 8 key - */ - KEY_CHAR_SYM_8, - - /** - * The Character symbol 9 key - */ - KEY_CHAR_SYM_9, - - /** - * The Character symbol A key - */ - KEY_CHAR_SYM_A, - - /** - * The Character symbol B key - */ - KEY_CHAR_SYM_B, - - /** - * The Character symbol C key - */ - KEY_CHAR_SYM_C, - - /** - * The Character symbol D key - */ - KEY_CHAR_SYM_D, - - /** - * The Character symbol E key - */ - KEY_CHAR_SYM_E, - - /** - * The Character symbol F key - */ - KEY_CHAR_SYM_F, - - /** - * The Special function 1 key - */ - KEY_FN_1, - - /** - * The Special function 2 key - */ - KEY_FN_2, - - /** - * The Special function 3 key - */ - KEY_FN_3, - - /** - * The Special function 4 key - */ - KEY_FN_4, - - /** - * The Special function 5 key - */ - KEY_FN_5, - - /** - * The power key - */ - KEY_POWER_HOLD, - - /** - * The delete key - */ - KEY_DELETE, - - /* - * placeholder key - */ - KEY_HARDWARE_MAX -}; - - -/** - * @enum KeyState - * - * Defines the state of the key. - * - * @since 2.0 - */ -enum KeyState -{ - KEY_PRESSED = 0x0001, /**< The key is pressed */ - KEY_RELEASED = 0x0002, /**< The key is released */ - KEY_LONGPRESSED = 0x0003 /**< The key pressed and held down over a predefined duration */ -}; /** * @interface IKeyEventListener @@ -505,15 +53,19 @@ enum KeyState class _OSP_EXPORT_ IKeyEventListener : virtual public Tizen::Base::Runtime::IEventListener { +// Operation public: - /** - * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - * - */ + // + // This method is for internal use only. + // Using this method can cause behavioral, security-related, and consistency-related issues in the application. + // + // This is the destructor for this class. + // + // @since 2.0 + // virtual ~IKeyEventListener(void) {} + /** * Called when a key is pressed. * @@ -524,6 +76,7 @@ public: */ virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0; + /** * Called when a key is released. * @@ -534,6 +87,7 @@ public: */ virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0; + /** * Called when a key is pressed and held down for some time. * @@ -546,35 +100,26 @@ public: virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0; protected: + // Reserved virtual methods for later extension // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without - // prior notice. + // The following methods are reserved and may change its name at any time without prior notice. // virtual void IKeyEventListener_Reserved1(void) {} + // Reserved virtual methods for later extension // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without - // prior notice. + // The following methods are reserved and may change its name at any time without prior notice. // virtual void IKeyEventListener_Reserved2(void) {} + // Reserved virtual methods for later extension // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without - // prior notice. + // The following methods are reserved and may change its name at any time without prior notice. // virtual void IKeyEventListener_Reserved3(void) {} }; // IKeyEventListener -}} // Tizen::Ui +} } // Tizen::Ui #endif //_FUI_IKEY_EVENT_LISTENER_H_ diff --git a/inc/FUiILanguageEventListener.h b/inc/FUiILanguageEventListener.h old mode 100644 new mode 100755 diff --git a/inc/FUiIPropagatedKeyEventListener.h b/inc/FUiIPropagatedKeyEventListener.h new file mode 100644 index 0000000..13374e4 --- /dev/null +++ b/inc/FUiIPropagatedKeyEventListener.h @@ -0,0 +1,153 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUiIPropagatedKeyEventListener.h + * @brief This is the header file for the %IPropagatedKeyEventListener interface. + * + * This header file contains the declarations of the %IPropagatedKeyEventListener interface. + */ + +#ifndef _FUI_IPROPAGATED_KEY_EVENT_LISTENER_H_ +#define _FUI_IPROPAGATED_KEY_EVENT_LISTENER_H_ + +namespace Tizen { namespace Ui +{ + +class Control; +class KeyEventInfo; + +/** + * @interface IPropagatedKeyEventListener + * @brief This interface is used as the argument to the propagated key event listener. + * + * @since 2.1 + * + * The %IPropagatedKeyEventListener interface is the listener interface for receiving propagated key events. + * The class that processes a propagated key event implements this interface, and the instance created with that class is registered with a + * UI control, using the control's SetPropagatedKeyEventListener() method. When the key event occurs, a method of that instance which is derived from %IPropagatedKeyEventListener is + * invoked. + * Propagated key event listeners work according to the event previewing and bubbling concept. @n + * When a key event occurs, as a previewing notification it is routed from the top-most Window, which is usually a Frame, + * to a control which is the parent of the control where the event occurs. Then, as a bubbling notification it is routed from + * the control to the top-most Window. + * In both previewing and bubbling paths, event routing can be controlled by the value returned by the listener. Returning @c true, which means + * the event is processed in the listener of the notified control, stops further routing. Returning @c false allows the next event receiver + * to listen the event. + * @n + * For more information on the class features, see Event Listeners. + */ +class _OSP_EXPORT_ IPropagatedKeyEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IPropagatedKeyEventListener(void){} + + /** + * Called during the bubbling step when a key is pressed. + * + * @since 2.1 + * + * @return Whether the key event is processed by the listener or not. + * @param[in] source The source of the event + * @param[in] keyEventInfo The key event information + */ + virtual bool OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo) = 0; + + /** + * Called during the bubbling step when a key is released. + * + * @since 2.1 + * + * @return Whether the key event is processed by the listener or not. + * @param[in] source The source of the event + * @param[in] keyEventInfo The key event information + */ + virtual bool OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo) = 0; + + /** + * Called during the previewing step when a key is pressed. + * + * @since 2.1 + * @return Whether the key event is processed by the listener or not + + * @param[in] source The source of the event + * @param[in] keyEventInfo The key event information + */ + virtual bool OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo) = 0; + + /** + * Called during the previewing step when a key is released. + * + * @since 2.1 + * @return Whether the key event is processed by the listener or not + + * @param[in] source The source of the event + * @param[in] keyEventInfo The key event information + */ + virtual bool OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo) = 0; + + /** + * Called before OnPreviewKeyPressed() or OnPreviewKeyReleased() listener is called, allowing the application to modify the keyEventInfo instance. + * Before previewing and bubbling paths, this method is called once. + * + * @since 2.1 + * + * @return Whether the KeyEventInfo instance is modified or not. + * @param[in] source The source of the event + * @param[in,out] keyEventInfo The key event information which can be converted by this method + */ + virtual bool TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo) { return false; } + +protected: + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedKeyEventListener_Reserved1(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedKeyEventListener_Reserved2(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedKeyEventListener_Reserved3(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedKeyEventListener_Reserved4(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedKeyEventListener_Reserved5(void) {} +}; //IPropagatedKeyEventListener + +}} // Tizen::Ui +#endif // _FUI_IPROPAGATED_KEY_EVENT_LISTENER_H_ \ No newline at end of file diff --git a/inc/FUiIPropagatedTouchEventListener.h b/inc/FUiIPropagatedTouchEventListener.h new file mode 100644 index 0000000..21ef75d --- /dev/null +++ b/inc/FUiIPropagatedTouchEventListener.h @@ -0,0 +1,174 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUiIPropagatedTouchEventListener.h + * @brief This is the header file for the %IPropagatedTouchEventListener interface. + * + * This header file contains the declarations of the %IPropagatedTouchEventListener interface. + */ + +#ifndef _FUI_IPROPAGATED_TOUCH_EVENT_LISTENER_H_ +#define _FUI_IPROPAGATED_TOUCH_EVENT_LISTENER_H_ + +namespace Tizen { namespace Ui { + +class Control; +class TouchEventInfo; + +/** + * @interface IPropagatedTouchEventListener + * @brief This interface is used as the argument to the propagated touch event listener. + * + * @since 2.1 + * + * The %IPropagatedTouchEventListener interface is the listener interface for receiving propagated touch events. + * The class that processes a propagated touch event implements this interface, and the instance created with that class is registered with a + * UI control, using the control's SetPropagatedTouchEventListener() method. When the touch event occurs, a method of that instance which is derived from %IPropagatedTouchEventListener is + * invoked. + * Propagated touch event listeners work according to the event previewing and bubbling concept. @n + * When a touch event occurs, as a previewing notification it is routed from the top-most Window, which is usually a Frame, + * to a control which is the parent of the control where the event occurs. Then, as a bubbling notification it is routed from + * the control to the top-most Window. + * In both previewing and bubbling paths, event routing can be controlled by the value returned by the listener. Returning @c true, which means + * the event is processed in the listener of the notified control, stops further routing. Returning @c false allows the next event receiver + * to listen the event. + * @n + * For more information on the class features, see Event Listeners. + */ +class _OSP_EXPORT_ IPropagatedTouchEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~IPropagatedTouchEventListener(void){} + + /** + * Called during the bubbling step when a touch pressed. + * + * @since 2.1 + * + * @return Whether the touch event is processed by the listener or not + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnTouchPressed(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + /** + * Called during the bubbling step when a touch released. + * + * @since 2.1 + * + * @return Whether the touch event is processed by the listener or not + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnTouchReleased(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + /** + * Called during the bubbling step when a touch moved. + * + * @since 2.1 + * + * @return Whether the touch event is processed by the listener or not + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnTouchMoved(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + /** + * Called during the bubbling step when a touch canceled. + * + * @since 2.1 + * + * @return Whether the touch event is processed by the listener or not + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnTouchCanceled(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + /** + * Called during the previewing step when a touch pressed. + * + * @since 2.1 + * @return Whether the touch event is processed by the listener or not + + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnPreviewTouchPressed(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + + /** + * Called during the previewing step when a touch released. + * + * @since 2.1 + * @return Whether the touch event is processed by the listener or not + + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnPreviewTouchReleased(Control& source, const TouchEventInfo& touchEventInfo) = 0; + + /** + * Called during the previewing step when a touch moved. + * + * @since 2.1 + * @return Whether the touch event is processed by the listener or not + + * @param[in] source The source of the event + * @param[in] touchInfo The touch event information + */ + virtual bool OnPreviewTouchMoved(Control& source, const TouchEventInfo& touchEventInfo) = 0; + +protected: + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedTouchEventListener_Reserved1(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedTouchEventListener_Reserved2(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedTouchEventListener_Reserved3(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedTouchEventListener_Reserved4(void) {} + + // Reserved virtual methods for later extension + // + // The following methods are reserved and may change its name at any time without prior notice. + // + virtual void IPropagatedTouchEventListener_Reserved5(void) {} +}; // IPropagatedTouchEventListener + +}} // Tizen::Ui +#endif // _FUI_IPROPAGATED_TOUCH_EVENT_LISTENER_H_ \ No newline at end of file diff --git a/inc/FUiIScrollPanelEventListener.h b/inc/FUiIScrollPanelEventListener.h index ab0291f..431e790 100644 --- a/inc/FUiIScrollPanelEventListener.h +++ b/inc/FUiIScrollPanelEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -61,7 +61,7 @@ public: /** * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. * - * @since 2.0 + * @since 2.0 */ virtual ~IScrollPanelEventListener(void) {} diff --git a/inc/FUiISlidableGroupedListEventListener.h b/inc/FUiISlidableGroupedListEventListener.h old mode 100644 new mode 100755 index 9c22671..ac673f5 --- a/inc/FUiISlidableGroupedListEventListener.h +++ b/inc/FUiISlidableGroupedListEventListener.h @@ -38,7 +38,7 @@ namespace Tizen {namespace Ui { /** - * @if OSPDEPREC +* @if OSPDEPREC * @interface ISlidableGroupedListEventListener * @brief [Deprecated] This interface implements the listener for events on SlidableGroupedList. * @deprecated This class is deprecated. Instead of using this class, use IGroupedListViewItemEventListener class. @@ -55,18 +55,18 @@ class _OSP_EXPORT_ ISlidableGroupedListEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] This interface implements the listener for events on SlidableGroupedList. * @deprecated This class is deprecated. Instead of using this class, use IGroupedListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ virtual ~ISlidableGroupedListEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the %SlidableGroupedList is about to be drawn and requests the listener to set the properties of the list such as the total height and the * number of items in each group. * @@ -74,12 +74,12 @@ public: * @deprecated This class is deprecated. Instead of using this class, use IGroupedListViewItemEventListener class. * @since 2.0 * @param[in] source The source of the event - * @endif + * @endif */ virtual void OnListPropertyRequested(const Tizen::Ui::Control& source) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the items need to be loaded to the top. * * @brief [Deprecated] This interface implements the listener for events on SlidableGroupedList. @@ -89,12 +89,12 @@ public: * @param[in] groupIndex The index of the list group * @param[in] itemIndex The index of the list item in the specified group * @param[in] numItems The number of items - * @endif + * @endif */ virtual void OnLoadToTopRequested(const Tizen::Ui::Control& source, int groupIndex, int itemIndex, int numItems) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the items need to be loaded to the bottom. * * @brief [Deprecated] This interface implements the listener for events on SlidableGroupedList. @@ -104,12 +104,12 @@ public: * @param[in] groupIndex The index of the list group * @param[in] itemIndex The index of the list item in the specified group * @param[in] numItems The number of items - * @endif + * @endif */ virtual void OnLoadToBottomRequested(const Tizen::Ui::Control& source, int groupIndex, int itemIndex, int numItems) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when an item is about to be unloaded from memory. @n * The user-allocated resources associated with the item to be unloaded need to be freed when OnUnloadItemRequested() is called. * @@ -120,7 +120,7 @@ public: * @param[in] source The source of the event * @param[in] groupIndex The index of the list group * @param[in] itemIndex The index of the list item in the specified group - * @endif + * @endif */ virtual void OnUnloadItemRequested(const Tizen::Ui::Control& source, int groupIndex, int itemIndex) = 0; diff --git a/inc/FUiISlidableListEventListener.h b/inc/FUiISlidableListEventListener.h old mode 100644 new mode 100755 index 3674979..402d007 --- a/inc/FUiISlidableListEventListener.h +++ b/inc/FUiISlidableListEventListener.h @@ -56,18 +56,18 @@ class _OSP_EXPORT_ ISlidableListEventListener // Operation public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the destructor for this class. * * @brief [Deprecated] This interface implements the listener for events on %SlidableList. * @deprecated This class is deprecated. Instead of using this class, use IListViewItemEventListener class. * @since 2.0 - * @endif + * @endif */ virtual ~ISlidableListEventListener(void) {} /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the slidable list is about to be drawn and requests to set the properties of the list such as the total height. * * @brief [Deprecated] This interface implements the listener for events on %SlidableList. @@ -75,12 +75,12 @@ public: * @since 2.0 * * @param[in] source The source of the event - * @endif + * @endif */ virtual void OnListPropertyRequested(const Tizen::Ui::Control& source) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the items need to be loaded to the top. * * @brief [Deprecated] This interface implements the listener for events on %SlidableList. @@ -90,12 +90,12 @@ public: * @param[in] source The source of the event * @param[in] index The index of the item * @param[in] numItems The number of items - * @endif + * @endif */ virtual void OnLoadToTopRequested(const Tizen::Ui::Control& source, int index, int numItems) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when the items need to be loaded to the bottom. * * @brief [Deprecated] This interface implements the listener for events on %SlidableList. @@ -105,12 +105,12 @@ public: * @param[in] source The source of the event * @param[in] index The index of the item * @param[in] numItems The number of items - * @endif + * @endif */ virtual void OnLoadToBottomRequested(const Tizen::Ui::Control& source, int index, int numItems) = 0; /** - * @if OSPDEPREC + * @if OSPDEPREC * Called when an item is about to be unloaded from memory. @n * The user-allocated resources associated with the item must be freed before unloading, when OnUnloadItemRequested() is called. * @@ -120,7 +120,7 @@ public: * * @param[in] source The source of the event * @param[in] index The index of the item - * @endif + * @endif */ virtual void OnUnloadItemRequested(const Tizen::Ui::Control& source, int index) = 0; diff --git a/inc/FUiITextBlockEventListener.h b/inc/FUiITextBlockEventListener.h old mode 100644 new mode 100755 diff --git a/inc/FUiITextEventListener.h b/inc/FUiITextEventListener.h old mode 100644 new mode 100755 index 3b2130c..a103480 --- a/inc/FUiITextEventListener.h +++ b/inc/FUiITextEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiITextEventListener.h * @brief This is the header file for the %ITextEventListener interface. diff --git a/inc/FUiITimeChangeEventListener.h b/inc/FUiITimeChangeEventListener.h index 4051676..a9bc295 100644 --- a/inc/FUiITimeChangeEventListener.h +++ b/inc/FUiITimeChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiITimeChangeEventListener.h * @brief This is the header file for the %ITimeChangeEventListener interface. diff --git a/inc/FUiITouchCustomGestureEventListener.h b/inc/FUiITouchCustomGestureEventListener.h index 0309340..7699485 100644 --- a/inc/FUiITouchCustomGestureEventListener.h +++ b/inc/FUiITouchCustomGestureEventListener.h @@ -47,45 +47,45 @@ class _OSP_EXPORT_ ITouchCustomGestureEventListener public: /** * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * + * @since 2.0 + */ virtual ~ITouchCustomGestureEventListener(void) {} /** - * Called when a custom gesture detection is started. - * - * @since 2.0 - * - * @param[in] gestureDetector The custom gesture detector instance - */ + * Called when a custom gesture detection is started. + * + * @since 2.0 + * + * @param[in] gestureDetector The custom gesture detector instance + */ virtual void OnCustomGestureStarted(Tizen::Ui::TouchGestureDetector& gestureDetector) = 0; /** - * Called when a custom gesture is detected and is in progress. - * - * @since 2.0 - * - * @param[in] gestureDetector The custom gesture detector instance - */ + * Called when a custom gesture is detected and is in progress. + * + * @since 2.0 + * + * @param[in] gestureDetector The custom gesture detector instance + */ virtual void OnCustomGestureChanged(Tizen::Ui::TouchGestureDetector& gestureDetector) = 0; /** - * Called when a custom gesture detection is finished. - * - * @since 2.0 - * - * @param[in] gestureDetector The custom gesture detector instance - */ + * Called when a custom gesture detection is finished. + * + * @since 2.0 + * + * @param[in] gestureDetector The custom gesture detector instance + */ virtual void OnCustomGestureFinished(Tizen::Ui::TouchGestureDetector& gestureDetector) = 0; /** - * Called when a custom gesture detection is canceled. - * - * @since 2.0 - * - * @param[in] gestureDetector The custom gesture detector instance - */ + * Called when a custom gesture detection is canceled. + * + * @since 2.0 + * + * @param[in] gestureDetector The custom gesture detector instance + */ virtual void OnCustomGestureCanceled(Tizen::Ui::TouchGestureDetector& gestureDetector) = 0; protected: diff --git a/inc/FUiITouchModeChangedEventListener.h b/inc/FUiITouchModeChangedEventListener.h index 2b0b995..a17ccd6 100644 --- a/inc/FUiITouchModeChangedEventListener.h +++ b/inc/FUiITouchModeChangedEventListener.h @@ -96,6 +96,6 @@ protected: }; // ITouchModeChangedEventListener -}} // Tizen::Ui +} } // Tizen::Ui #endif // _FUI_ITOUCH_MODE_CHANGED_EVENT_LISTENER_H_ diff --git a/inc/FUiITouchPanningGestureEventListener.h b/inc/FUiITouchPanningGestureEventListener.h index bf6c2f0..781f7dd 100644 --- a/inc/FUiITouchPanningGestureEventListener.h +++ b/inc/FUiITouchPanningGestureEventListener.h @@ -16,11 +16,11 @@ // /** - * @file FUiITouchPanningGestureEventListener.h - * @brief This is the header file for the %ITouchPanningGestureEventListener interface. - * - * This header file contains the declarations of the %ITouchPanningGestureEventListener interface. - */ +* @file FUiITouchPanningGestureEventListener.h +* @brief This is the header file for the %ITouchPanningGestureEventListener interface. +* +* This header file contains the declarations of the %ITouchPanningGestureEventListener interface. +*/ #ifndef _FUI_ITOUCH_PANNING_GESTURE_EVENT_LISTENER_H_ #define _FUI_ITOUCH_PANNING_GESTURE_EVENT_LISTENER_H_ @@ -50,44 +50,44 @@ public: * This polymorphic destructor should be overridden if required. * This way, the destructors of the derived classes are called when the destructor of this interface is called. * - * @since 2.0 + * @since 2.0 */ virtual ~ITouchPanningGestureEventListener(void) {} /** - * Called when a panning gesture detection is started. - * - * @since 2.0 - * - * @param[in] gestureDetector The panning gesture detector instance - */ + * Called when a panning gesture detection is started. + * + * @since 2.0 + * + * @param[in] gestureDetector The panning gesture detector instance + */ virtual void OnPanningGestureStarted(Tizen::Ui::TouchPanningGestureDetector& gestureDetector) = 0; /** - * Called when a panning gesture is detected and is in progress. - * - * @since 2.0 - * - * @param[in] gestureDetector The panning gesture detector instance - */ + * Called when a panning gesture is detected and is in progress. + * + * @since 2.0 + * + * @param[in] gestureDetector The panning gesture detector instance + */ virtual void OnPanningGestureChanged(Tizen::Ui::TouchPanningGestureDetector& gestureDetector) = 0; /** - * Called when a panning gesture detection is finished. - * - * @since 2.0 - * - * @param[in] gestureDetector The panning gesture detector instance - */ + * Called when a panning gesture detection is finished. + * + * @since 2.0 + * + * @param[in] gestureDetector The panning gesture detector instance + */ virtual void OnPanningGestureFinished(Tizen::Ui::TouchPanningGestureDetector& gestureDetector) = 0; /** - * Called when a panning gesture detection is canceled. - * - * @since 2.0 - * - * @param[in] gestureDetector The panning gesture detector instance - */ + * Called when a panning gesture detection is canceled. + * + * @since 2.0 + * + * @param[in] gestureDetector The panning gesture detector instance + */ virtual void OnPanningGestureCanceled(Tizen::Ui::TouchPanningGestureDetector& gestureDetector) = 0; protected: diff --git a/inc/FUiITouchPinchGestureEventListener.h b/inc/FUiITouchPinchGestureEventListener.h index aea1cc8..ff31803 100644 --- a/inc/FUiITouchPinchGestureEventListener.h +++ b/inc/FUiITouchPinchGestureEventListener.h @@ -16,11 +16,11 @@ // /** - * @file FUiITouchPinchGestureEventListener.h - * @brief This is the header file for the %ITouchPinchGestureEventListener interface. - * - * This header file contains the declarations of the %ITouchPinchGestureEventListener interface. - */ +* @file FUiITouchPinchGestureEventListener.h +* @brief This is the header file for the %ITouchPinchGestureEventListener interface. +* +* This header file contains the declarations of the %ITouchPinchGestureEventListener interface. +*/ #ifndef _FUI_ITOUCH_PINCH_GESTURE_EVENT_LISTENER_H_ #define _FUI_ITOUCH_PINCH_GESTURE_EVENT_LISTENER_H_ @@ -50,45 +50,45 @@ class _OSP_EXPORT_ ITouchPinchGestureEventListener public: /** * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * + * @since 2.0 + */ virtual ~ITouchPinchGestureEventListener(void) {} /** - * Called when a pinch gesture detection is started. - * - * @since 2.0 - * - * @param[in] gestureDetector The pinch gesture detector instance - */ + * Called when a pinch gesture detection is started. + * + * @since 2.0 + * + * @param[in] gestureDetector The pinch gesture detector instance + */ virtual void OnPinchGestureStarted(Tizen::Ui::TouchPinchGestureDetector& gestureDetector) = 0; /** - * Called when a pinch gesture is detected and is in progress. - * - * @since 2.0 - * - * @param[in] gestureDetector The pinch gesture detector instance - */ + * Called when a pinch gesture is detected and is in progress. + * + * @since 2.0 + * + * @param[in] gestureDetector The pinch gesture detector instance + */ virtual void OnPinchGestureChanged(Tizen::Ui::TouchPinchGestureDetector& gestureDetector) = 0; /** - * Called when a pinch gesture detection is finished. - * - * @since 2.0 - * - * @param[in] gestureDetector The pinch gesture detector instance - */ + * Called when a pinch gesture detection is finished. + * + * @since 2.0 + * + * @param[in] gestureDetector The pinch gesture detector instance + */ virtual void OnPinchGestureFinished(Tizen::Ui::TouchPinchGestureDetector& gestureDetector) = 0; /** - * Called when a pinch gesture detection is canceled. - * - * @since 2.0 - * - * @param[in] gestureDetector The pinch gesture detector instance - */ + * Called when a pinch gesture detection is canceled. + * + * @since 2.0 + * + * @param[in] gestureDetector The pinch gesture detector instance + */ virtual void OnPinchGestureCanceled(Tizen::Ui::TouchPinchGestureDetector& gestureDetector) = 0; protected: diff --git a/inc/FUiITouchRotationGestureEventListener.h b/inc/FUiITouchRotationGestureEventListener.h index 6a53c7c..16dfb1b 100644 --- a/inc/FUiITouchRotationGestureEventListener.h +++ b/inc/FUiITouchRotationGestureEventListener.h @@ -16,11 +16,11 @@ // /** - * @file FUiITouchRotationGestureEventListener.h - * @brief This is the header file for the %ITouchRotationGestureEventListener interface. - * - * This header file contains the declarations of the %ITouchRotationGestureEventListener interface. - */ +* @file FUiITouchRotationGestureEventListener.h +* @brief This is the header file for the %ITouchRotationGestureEventListener interface. +* +* This header file contains the declarations of the %ITouchRotationGestureEventListener interface. +*/ #ifndef _FUI_ITOUCH_ROTATION_GESTURE_EVENT_LISTENER_H_ #define _FUI_ITOUCH_ROTATION_GESTURE_EVENT_LISTENER_H_ @@ -50,44 +50,44 @@ public: * This polymorphic destructor should be overridden if required. * This way, the destructors of the derived classes are called when the destructor of this interface is called. * - * @since 2.0 + * @since 2.0 */ virtual ~ITouchRotationGestureEventListener(void) {} /** - * Called when a rotation gesture detection is started. - * - * @since 2.0 - * - * @param[in] gestureDetector The rotation gesture detector instance - */ + * Called when a rotation gesture detection is started. + * + * @since 2.0 + * + * @param[in] gestureDetector The rotation gesture detector instance + */ virtual void OnRotationGestureStarted(Tizen::Ui::TouchRotationGestureDetector& gestureDetector) = 0; /** - * Called when a rotation gesture is detected and is in progress. - * - * @since 2.0 - * - * @param[in] gestureDetector The rotation gesture detector instance - */ + * Called when a rotation gesture is detected and is in progress. + * + * @since 2.0 + * + * @param[in] gestureDetector The rotation gesture detector instance + */ virtual void OnRotationGestureChanged(Tizen::Ui::TouchRotationGestureDetector& gestureDetector) = 0; /** - * Called when a rotation gesture detection is finished. - * - * @since 2.0 - * - * @param[in] gestureDetector The rotation gesture detector instance - */ + * Called when a rotation gesture detection is finished. + * + * @since 2.0 + * + * @param[in] gestureDetector The rotation gesture detector instance + */ virtual void OnRotationGestureFinished(Tizen::Ui::TouchRotationGestureDetector& gestureDetector) = 0; /** - * Called when a rotation gesture detection is canceled. - * - * @since 2.0 - * - * @param[in] gestureDetector The rotation gesture detector instance - */ + * Called when a rotation gesture detection is canceled. + * + * @since 2.0 + * + * @param[in] gestureDetector The rotation gesture detector instance + */ virtual void OnRotationGestureCanceled(Tizen::Ui::TouchRotationGestureDetector& gestureDetector) = 0; protected: diff --git a/inc/FUiITouchTapGestureEventListener.h b/inc/FUiITouchTapGestureEventListener.h index 154304b..2d95c9d 100644 --- a/inc/FUiITouchTapGestureEventListener.h +++ b/inc/FUiITouchTapGestureEventListener.h @@ -16,11 +16,11 @@ // /** - * @file FUiITouchTapGestureEventListener.h - * @brief This is the header file for the %ITouchTapGestureEventListener interface. - * - * This header file contains the declarations of the %ITouchTapGestureEventListener interface. - */ +* @file FUiITouchTapGestureEventListener.h +* @brief This is the header file for the %ITouchTapGestureEventListener interface. +* +* This header file contains the declarations of the %ITouchTapGestureEventListener interface. +*/ #ifndef _FUI_ITOUCH_TAP_GESTURE_EVENT_LISTENER_H_ #define _FUI_ITOUCH_TAP_GESTURE_EVENT_LISTENER_H_ @@ -44,32 +44,32 @@ namespace Tizen { namespace Ui * */ class _OSP_EXPORT_ ITouchTapGestureEventListener - : virtual public ITouchGestureEventListener + : virtual public ITouchGestureEventListener { public: /** * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. - * - * @since 2.0 - */ + * + * @since 2.0 + */ virtual ~ITouchTapGestureEventListener(void) {} /** - * Called when a tap gesture is detected. - * - * @since 2.0 - * - * @param[in] gestureDetector The tap gesture detector instance - */ + * Called when a tap gesture is detected. + * + * @since 2.0 + * + * @param[in] gestureDetector The tap gesture detector instance + */ virtual void OnTapGestureDetected(Tizen::Ui::TouchTapGestureDetector& gestureDetector) = 0; /** - * Called when a tap gesture detection is canceled. - * - * @since 2.0 - * - * @param[in] gestureDetector The tap gesture detector instance - */ + * Called when a tap gesture detection is canceled. + * + * @since 2.0 + * + * @param[in] gestureDetector The tap gesture detector instance + */ virtual void OnTapGestureCanceled(Tizen::Ui::TouchTapGestureDetector& gestureDetector) = 0; protected: diff --git a/inc/FUiIUiLinkEventListener.h b/inc/FUiIUiLinkEventListener.h old mode 100644 new mode 100755 diff --git a/inc/FUiIWindowEventListener.h b/inc/FUiIWindowEventListener.h old mode 100644 new mode 100755 index db8a608..392558c --- a/inc/FUiIWindowEventListener.h +++ b/inc/FUiIWindowEventListener.h @@ -108,6 +108,6 @@ protected: virtual void IWindowEventListener_Reserved3(void) {} }; -}}; // Tizen::Ui +} }; // Tizen::Ui #endif // _FUI_IWINDOW_EVENT_LISTENER_H_ diff --git a/inc/FUiInputConnection.h b/inc/FUiInputConnection.h old mode 100644 new mode 100755 index facaadb..8a78f9e --- a/inc/FUiInputConnection.h +++ b/inc/FUiInputConnection.h @@ -25,8 +25,10 @@ #ifndef _FUI_INPUT_CONNECTION_H_ #define _FUI_INPUT_CONNECTION_H_ +#include #include #include +#include #include #include @@ -212,6 +214,20 @@ public: result Construct(const Control* pControl, IInputConnectionEventListener& listener, IInputConnectionProvider& provider); /** + * Initializes this instance of the %InputConnection with the specified parameter. + * + * @since 2.1 + * @return An error code + * @param[in] pControl The source object for connecting the Input Method. + * @param[in] listener An instance of the %IInputConnectionEventListenerF for processing the event + * @param[in] provider The %InputConnection provider + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_SYSTEM The method cannot proceed due to a severe system error. + */ + result Construct(const Control* pControl, IInputConnectionEventListenerF& listener, IInputConnectionProvider& provider); + + /** * Binds the %InputConnection to the current active Input Method * * @since 2.0 @@ -302,14 +318,14 @@ public: void SetInputPanelActionEnabled(bool enable); /** - * Sets the language of the current active Input Panel. - * - * @since 2.0 - * @param[in] languageCode The language to set - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks This method may not work, depending on the current active Input Method. - */ + * Sets the language of the current active Input Panel. + * + * @since 2.0 + * @param[in] languageCode The language to set + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks This method may not work, depending on the current active Input Method. + */ result SetInputPanelLanguage(Tizen::Locales::LanguageCode languageCode); /** @@ -336,6 +352,18 @@ public: */ result SetCursorBounds(const Tizen::Graphics::Rectangle& rect); + /* + * Sets the bounds of the cursor + * + * @since 2.1 + * @param[in] rect the rectangle to be set + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @exception E_INVALID_STATE This exception is thrown when BindInputMethod is not called before calling this method. + */ + result SetCursorBounds(const Tizen::Graphics::FloatRectangle& rect); + /** * Gets the bounds of the current active Input Panel. * @@ -348,6 +376,18 @@ public: */ Tizen::Graphics::Rectangle GetInputPanelBounds(void) const; + /* + * Gets the bounds of the current active Input Panel. + * + * @since 2.1 + * @return An instance of the rectangle that represents the position of the top-left corner, + * the width, and the height of the Input Panel. + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_STATE This exception is thrown when BindInputMethod is not called before calling this method. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + Tizen::Graphics::FloatRectangle GetInputPanelBoundsF(void) const; + /** * Enables or disables text prediction. * @@ -358,6 +398,17 @@ public: */ void SetTextPredictionEnabled(bool enable); + /** + * Sends opaque command to the input method. + * + * @since 2.1 + * + * @param[in] command The opaque command + * @remarks This method can be used to provide domain-specific features that are only known between certain input methods and their clients. + * This method may not work, depending on the active Input Method. + */ + void SendOpaqueCommand (const Tizen::Base::String& command); + private: // // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. diff --git a/inc/FUiInputConnectionTypes.h b/inc/FUiInputConnectionTypes.h old mode 100644 new mode 100755 diff --git a/inc/FUiKeyEventInfo.h b/inc/FUiKeyEventInfo.h new file mode 100644 index 0000000..cb71139 --- /dev/null +++ b/inc/FUiKeyEventInfo.h @@ -0,0 +1,146 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiKeyEventInfo.h + * @brief This is the header file for the %KeyEventInfo class. + * + * This header file contains the declarations of the %KeyEventInfo class. + * + */ + +#ifndef _FUI_KEY_EVENT_INFO_H_ +#define _FUI_KEY_EVENT_INFO_H_ + +#include +#include + +namespace Tizen { namespace Ui +{ + +class Control; +class _KeyEventInfoImpl; + +/** + * @class KeyEventInfo + * @brief This class stores the information of each key events. + * + * @since 2.1 + * + * The %KeyEventInfo class provides the key event information: key code and key modifiers. + * @see IPropagatedKeyEventListener::OnKeyPressed() + * @see IPropagatedKeyEventListener::OnKeyReleased() + * @see IPropagatedKeyEventListener::TranslateKeyEventInfo() + * + */ +class _OSP_EXPORT_ KeyEventInfo + : public Tizen::Base::Object +{ +public: + /** + * Initializes this instance of %KeyEventInfo. + * + * @since 2.1 + * + * @param[in] keyCode The key code which represents the key of interest + * @param[in] keyModifier The key modifier which modifies the normal action of the key + * @see Tizen::Ui::KeyCode + * @see Tizen::Ui::KeyModifier + */ + KeyEventInfo(KeyCode keyCode, int keyModifiers); + + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.1 + */ + virtual ~KeyEventInfo(void); + + /** + * Sets the key code + * + * @since 2.1 + * + * @param[in] keyCode The key code + * @see GetKeyCode() + * + */ + void SetKeyCode(KeyCode keyCode); + + /** + * Gets the key code. + * + * @since 2.1 + * + * @return The key code + * @see SetKeyCode() + */ + KeyCode GetKeyCode(void) const; + + /** + * Sets bitwise ored key modifiers of the keyboard such as Control, Shift, Numeric lock, and so on. + * + * @since 2.1 + * + * @param[in] keyModifiers The key modifiers which can be combined using the bitwise OR operator + * @see GetKeyModifier() + * @see Tizen::Ui::KeyModifier + * + */ + void SetKeyModifier(int keyModifiers); + + /** + * Gets the key modifiers of the keyboard such as Control, Shift, Numeric lock, and so on. + * + * @since 2.1 + * + * @return The bitwise oring key modifiers + * @see SetKeyModifier() + * @see Tizen::Ui::KeyModifier + */ + int GetKeyModifier(void) const; + +private: + /* + * This is the default constructor for this class. + * + * @since 2.1 + */ + KeyEventInfo(void); + + /* + * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.1 + */ + KeyEventInfo(const KeyEventInfo& rhs); + + /* + * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + * + * @since 2.1 + */ + KeyEventInfo& operator =(const KeyEventInfo& rhs); + +private: + _KeyEventInfoImpl* __pKeyEventInfoImpl; + +}; // KeyEventInfo + +} } // Tizen::Ui + +#endif // _FUI_KEY_EVENT_INFO_H_ diff --git a/inc/FUiKeyEventManager.h b/inc/FUiKeyEventManager.h index a08bed1..b5d3429 100644 --- a/inc/FUiKeyEventManager.h +++ b/inc/FUiKeyEventManager.h @@ -33,7 +33,7 @@ namespace Tizen { namespace Base { namespace Runtime { class _IEvent; class IEventArg; -}}} +} } } namespace Tizen {namespace Ui { @@ -56,7 +56,7 @@ class _OSP_EXPORT_ KeyEventManager { public: /** - * This destructor overrides Osp::Base::Object::~Object(). + * This destructor overrides Tizen::Base::Object::~Object(). * * @since 2.0 */ @@ -85,7 +85,7 @@ public: */ void AddKeyEventListener(IKeyEventListener& listener); - /** + /** * Removes the %IKeyEventListener instance. @n * The removed listener is not notified even when the key events are fired. * @@ -130,6 +130,6 @@ private: }; // KeyEventManager -}} // Tizen::Ui +} } // Tizen::Ui #endif // _FUI_KEY_EVENT_MANAGER_H_ diff --git a/inc/FUiKeyTypes.h b/inc/FUiKeyTypes.h new file mode 100644 index 0000000..cf5ab3b --- /dev/null +++ b/inc/FUiKeyTypes.h @@ -0,0 +1,237 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** +* @file FUiKeyTypes.h +* @brief This is the header file for the Key enumeration. +* +* This header file contains the declarations of the Key enumeration. +*/ +#ifndef _FUI_KEY_TYPES_H_ +#define _FUI_KEY_TYPES_H_ + +namespace Tizen { namespace Ui +{ + +/** + * @enum KeyCode + * + * Defines the list of keys supported by the system. @n + * Note that certain keys may not be available on all devices. @n + * Please use the Tizen::Ui::KeyboardMap class to query the availability of a specific key on the target device. + * + * @since 2.0 + */ +enum KeyCode +{ + KEY_INVALID = 0x0000, /**< The invalid key */ + KEY_SIDE_UP, /**< The up side key */ + KEY_SIDE_DOWN, /**< The down side key */ + KEY_OK, /**< The ok key */ + KEY_CLEAR, /**< The clear key */ + KEY_CAMERA, /**< The camera key */ + KEY_SWITCH, /**< The task switcher key */ + KEY_0, /**< The 0 key */ + KEY_1, /**< The 1 key */ + KEY_2, /**< The 2 key */ + KEY_3, /**< The 3 key */ + KEY_4, /**< The 4 key */ + KEY_5, /**< The 5 key */ + KEY_6, /**< The 6 key */ + KEY_7, /**< The 7 key */ + KEY_8, /**< The 8 key */ + KEY_9, /**< The 9 key */ + KEY_ASTERISK, /**< The asterisk key */ + KEY_SHARP, /**< The sharp key */ + KEY_LEFT, /**< The left directional key */ + KEY_UP, /**< The up directional key */ + KEY_DOWN, /**< The down directional key */ + KEY_RIGHT, /**< The right directional key */ + KEY_MAX, /**< The Placeholder */ + KEY_A, /**< The A key */ + KEY_B, /**< The B key */ + KEY_C, /**< The C key */ + KEY_D, /**< The D key */ + KEY_E, /**< The E key */ + KEY_F, /**< The F key */ + KEY_G, /**< The G key */ + KEY_H, /**< The H key */ + KEY_I, /**< The I key */ + KEY_J, /**< The J key */ + KEY_K, /**< The K key */ + KEY_L, /**< The L key */ + KEY_M, /**< The M key */ + KEY_N, /**< The N key */ + KEY_O, /**< The O key */ + KEY_P, /**< The P key */ + KEY_Q, /**< The Q key */ + KEY_R, /**< The R key */ + KEY_S, /**< The S key */ + KEY_T, /**< The T key */ + KEY_U, /**< The U key */ + KEY_V, /**< The V key */ + KEY_W, /**< The W key */ + KEY_X, /**< The X key */ + KEY_Y, /**< The Y key */ + KEY_Z, /**< The Z key */ + KEY_BACKSPACE, /**< The backspace key */ + KEY_COMMA, /**< The comma key */ + KEY_ENTER, /**< The enter key */ + KEY_CAPSLOCK, /**< The Caps Lock key */ + KEY_QUESTION, /**< The Question key */ + KEY_ALT, /**< The Alt key */ + KEY_SYM, /**< The Language Symbolkey */ + KEY_SETTING, /**< The Language Setting key */ + KEY_SPACE, /**< The Space key */ + KEY_DOT, /**< The Dot key */ + KEY_FN, /**< The Function key */ + KEY_CAMERA_HALF_SHUTTER, /**< The camera half shutter key */ + KEY_CHAR_SYM_1, /**< The Character symbol 1 key */ + KEY_CHAR_SYM_2, /**< The Character symbol 2 key */ + KEY_CHAR_SYM_3, /**< The Character symbol 3 key */ + KEY_CHAR_SYM_4, /**< The Character symbol 4 key */ + KEY_CHAR_SYM_5, /**< The Character symbol 5 key */ + KEY_CHAR_SYM_6, /**< The Character symbol 6 key */ + KEY_CHAR_SYM_7, /**< The Character symbol 7 key */ + KEY_CHAR_SYM_8, /**< The Character symbol 8 key */ + KEY_CHAR_SYM_9, /**< The Character symbol 9 key */ + KEY_CHAR_SYM_A, /**< The Character symbol A key */ + KEY_CHAR_SYM_B, /**< The Character symbol B key */ + KEY_CHAR_SYM_C, /**< The Character symbol C key */ + KEY_CHAR_SYM_D, /**< The Character symbol D key */ + KEY_CHAR_SYM_E, /**< The Character symbol E key */ + KEY_CHAR_SYM_F, /**< The Character symbol F key */ + KEY_FN_1, /**< The function 1 key */ + KEY_FN_2, /**< The function 2 key */ + KEY_FN_3, /**< The function 3 key */ + KEY_FN_4, /**< The function 4 key */ + KEY_FN_5, /**< The function 5 key */ + KEY_POWER_HOLD, /**< The power key */ + KEY_DELETE, /**< The delete key */ + + KEY_APOSTROPHE, /**< The apostrophe key */ + KEY_BACKSLASH, /**< The backslash key */ + KEY_CONTEXT_MENU, /**< The menu key */ + KEY_EQUAL, /**< The equal key */ + KEY_ESC, /**< The esc key */ + KEY_FN_6, /**< The function 6 key */ + KEY_FN_7, /**< The function 7 key */ + KEY_FN_8, /**< The function 8 key */ + KEY_FN_9, /**< The function 9 key */ + KEY_FN_10, /**< The function 10 key */ + KEY_FN_11, /**< The function 11 key */ + KEY_FN_12, /**< The function 12 key */ + KEY_GRAVE, /**< The grave key */ + KEY_INSERT, /**< The insert key */ + KEY_LANGUAGE_SWITCH, /**< The language switch key */ + KEY_LEFT_ALT, /**< The left alt key */ + KEY_LEFT_BRACKET, /**< The left bracket key */ + KEY_LEFT_CTRL, /**< The left control key */ + KEY_LEFT_SHIFT, /**< The left shift key */ + KEY_LEFT_WIN, /**< The left window key */ + KEY_MINUS, /**< The minus key */ + KEY_MOVE_END, /**< The end key */ + KEY_MOVE_HOME, /**< The home key */ + KEY_NUM_LOCK, /**< The number lock key */ + KEY_NUMPAD_0, /**< The Numpad 0 key */ + KEY_NUMPAD_1, /**< The Numpad 1 key */ + KEY_NUMPAD_2, /**< The Numpad 2 key */ + KEY_NUMPAD_3, /**< The Numpad 3 key */ + KEY_NUMPAD_4, /**< The Numpad 4 key */ + KEY_NUMPAD_5, /**< The Numpad 5 key */ + KEY_NUMPAD_6, /**< The Numpad 6 key */ + KEY_NUMPAD_7, /**< The Numpad 7 key */ + KEY_NUMPAD_8, /**< The Numpad 8 key */ + KEY_NUMPAD_9, /**< The Numpad 9 key */ + KEY_NUMPAD_ADD, /**< The Numpad add key */ + KEY_NUMPAD_DIVIDE, /**< The Numpad divide key */ + KEY_NUMPAD_DOT, /**< The Numpad dot key */ + KEY_NUMPAD_ENTER, /**< The Numpad enter key */ + KEY_NUMPAD_MULTIPLY, /**< The Numpad multiply key */ + KEY_NUMPAD_SUBTRACT, /**< The Numpad subtract key */ + KEY_PAGE_DOWN, /**< The page down key */ + KEY_PAGE_UP, /**< The page up key */ + KEY_PAUSE_BREAK, /**< The pause key */ + KEY_PRINT, /**< The print key */ + KEY_RIGHT_ALT, /**< The right alt key */ + KEY_RIGHT_BRACKET, /**< The right bracket key */ + KEY_RIGHT_CTRL, /**< The right control key */ + KEY_RIGHT_SHIFT, /**< The right shift key */ + KEY_RIGHT_WIN, /**< The right window key */ + KEY_SCROLL_LOCK, /**< The scroll lock key */ + KEY_SEMICOLON, /**< The semicolon key */ + KEY_SLASH, /**< The slash key */ + KEY_TAB, /**< The tab key */ + KEY_OEM_1, /**< The OEM 1 key */ + KEY_OEM_2, /**< The OEM 2 key */ + KEY_OEM_3, /**< The OEM 3 key */ + KEY_OEM_4, /**< The OEM 4 key */ + KEY_OEM_5, /**< The OEM 5 key */ + KEY_OEM_6, /**< The OEM 6 key */ + KEY_OEM_7, /**< The OEM 7 key */ + KEY_OEM_8, /**< The OEM 8 key */ + KEY_OEM_9, /**< The OEM 9 key */ + KEY_OEM_10, /**< The OEM 10 key */ + KEY_OEM_11, /**< The OEM 11 key */ + KEY_OEM_12, /**< The OEM 12 key */ + KEY_OEM_13, /**< The OEM 13 key */ + KEY_OEM_14, /**< The OEM 14 key */ + KEY_OEM_15, /**< The OEM 15 key */ + KEY_OEM_16, /**< The OEM 16 key */ + KEY_OEM_17, /**< The OEM 17 key */ + KEY_OEM_18, /**< The OEM 18 key */ + KEY_OEM_19, /**< The OEM 19 key */ + KEY_OEM_20, /**< The OEM 20 key */ + KEY_HARDWARE_MAX /**< placeholder key */ +}; + +/** + * @enum KeyState + * + * Defines the state of the key. + * + * @since 2.0 + */ +enum KeyState +{ + KEY_PRESSED = 0x0001, /**< The key is pressed */ + KEY_RELEASED = 0x0002, /**< The key is released */ + KEY_LONGPRESSED = 0x0003 /**< The key pressed and held down over a predefined duration */ +}; + +/** + * @enum KeyModifier + * + * Defines constants used to identify key modifiers. + * + * @since 2.1 + */ +enum KeyModifier +{ + KEY_MODIFIER_NONE = 0, /**< No active modifiers */ + KEY_MODIFIER_SHIFT = 1 << 0, /**< "Shift" is pressed */ + KEY_MODIFIER_CTRL = 1 << 1, /**< "Control" is pressed */ + KEY_MODIFIER_ALT = 1 << 2, /**< "Alt" is pressed */ + KEY_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */ + KEY_MODIFIER_SCROLL_LOCK = 1 << 4, /**< "Scroll" is locked */ + KEY_MODIFIER_NUM_LOCK = 1 << 5, /**< "Number" is locked */ + KEY_MODIFIER_CAPS_LOCK = 1 << 6, /**< "Caps" is locked */ +}; + +}} // Tizen::Ui + +#endif // _FUI_KEY_TYPES_H_ + diff --git a/inc/FUiKeyboardMap.h b/inc/FUiKeyboardMap.h old mode 100644 new mode 100755 index 4742cf4..cb50a9d --- a/inc/FUiKeyboardMap.h +++ b/inc/FUiKeyboardMap.h @@ -50,35 +50,35 @@ enum KeyboardKeyLabelType /** * @if OSPDEPREC * The first label to be displayed - * @endif + * @endif */ KEYBOARD_KEY_LABEL_1 = 0x0000, /** * @if OSPDEPREC * The second label to be displayed after KEY_CAPSLOCK or KEY_FN is pressed - * @endif + * @endif */ KEYBOARD_KEY_LABEL_2, /** * @if OSPDEPREC * The third label to be displayed when the key is toggled twice (without pressing KEY_CAPSLOCK or KEY_FN) - * @endif + * @endif */ KEYBOARD_KEY_LABEL_3, /** * @if OSPDEPREC * The fourth label to be displayed when the key is toggled the third time (without pressing KEY_CAPSLOCK or KEY_FN) - * @endif + * @endif */ KEYBOARD_KEY_LABEL_4, /* * @if OSPDEPREC * The max value - * @endif + * @endif */ KEYBOARD_KEY_LABEL_MAX = 255 }; @@ -122,18 +122,18 @@ class _OSP_EXPORT_ KeyboardMap { public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This destructor overrides Tizen::Base::Object::~Object(). * * @brief [Deprecated] * @deprecated This class is deprecated because it is not supported by platform. * @since 2.0 - * @endif + * @endif */ virtual ~KeyboardMap(void); /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the pointer to the %KeyboardMap instance. * * @brief [Deprecated] @@ -141,13 +141,13 @@ public: * @since 2.0 * * @return The current %KeyboardMap instance - * @endif + * @endif */ static KeyboardMap* GetInstance(void); public: /** - * @if OSPDEPREC + * @if OSPDEPREC * Checks whether the specified key is a printing key (the key has one or more labels printed on the corresponding key). * * @brief [Deprecated] @@ -157,12 +157,12 @@ public: * @return @c true if the specified key is a printing key, @n * else @c false * @param[in] keyCode The key - * @endif + * @endif */ bool IsPrintingKey(KeyCode keyCode) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Checks whether the specified key is available on the current keyboard. * * @brief [Deprecated] @@ -172,12 +172,12 @@ public: * @return @c true if the specified key is available on the current keyboard, @n * else @c false * @param[in] keyCode The key - * @endif + * @endif */ bool IsKeyAvailable(KeyCode keyCode) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the name of the keyboard type. * * @brief [Deprecated] @@ -218,12 +218,12 @@ public: * QWERTY_11x4_KOREA Korean, English * QWERTY_11x4_NORTH-AMERICA English * - * @endif - */ + * @endif + */ Tizen::Base::String GetKeyboardType(void) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the label of the specified key. * * @brief [Deprecated] @@ -234,7 +234,7 @@ public: * else an empty string if the specified key is not a printing key or the secondary/tertiary character label is not defined * @param[in] keyCode The key * @param[in] type The keyboard key label type - * @endif + * @endif */ Tizen::Base::String GetDisplayableLabel(KeyCode keyCode, KeyboardKeyLabelType type = KEYBOARD_KEY_LABEL_1) const; diff --git a/inc/FUiLayout.h b/inc/FUiLayout.h old mode 100644 new mode 100755 diff --git a/inc/FUiRelativeLayout.h b/inc/FUiRelativeLayout.h index 48c4e70..62b0d46 100755 --- a/inc/FUiRelativeLayout.h +++ b/inc/FUiRelativeLayout.h @@ -246,6 +246,23 @@ public: */ result SetRelation(Control& childControl, const Control& targetControl, RectangleEdgeRelation edgeRelation); + /* + * Sets the relation of the specified child control for the edge with other control. + * + * @since 2.0 + * + * @return An error code + * @param[in] childControl The control for which the relation is set + * @param[in] pTargetControl The target control @n + * It must be a parent or sibling. + * @param[in] edgeRelation The edge of the specified control to be aligned with the edge of the target control + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * Either the specified @c childControl or the specified @c targetControl is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetRelation(Control& childControl, Control *pTargetControl, RectangleEdgeRelation edgeRelation); + /** * Resets the relation of the specified control for the vertical edge. * @@ -311,6 +328,25 @@ public: */ result SetMargin(Control& childControl, int left, int right, int top, int bottom); + /* + * Sets the margins of the specified control. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the margins are set + * @param[in] left The left margin + * @param[in] right The right margin + * @param[in] top The top margin + * @param[in] bottom The bottom margin + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the margins are set to @c 0. + */ + result SetMargin(Control& childControl, float left, float right, float top, float bottom); + /** * Sets the width of the specified control to the fixed size. * @@ -326,6 +362,21 @@ public: */ result SetWidth(Control& childControl, int width); + /* + * Sets the width of the specified control to the fixed size. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the width is set + * @param[in] width The value of the width + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetWidth(Control& childControl, float width); + /** * Sets the width of the specified control as per the fitting policy. * @@ -356,6 +407,21 @@ public: */ result SetHeight(Control& childControl, int height); + /* + * Sets the height of the specified control to the fixed size. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the height is set + * @param[in] height The value of the height + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified input parameter is invalid. @n + * The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetHeight(Control& childControl, float height); + /** * Sets the height of the specified control as per the fitting policy. * diff --git a/inc/FUiSystemUtil.h b/inc/FUiSystemUtil.h old mode 100755 new mode 100644 index edec3aa..1895ccd --- a/inc/FUiSystemUtil.h +++ b/inc/FUiSystemUtil.h @@ -16,12 +16,12 @@ // /** - * @file FUiSystemUtil.h - * @brief This is the header file for the SystemUtil - * - * This header file contains the declarations of the SystemUtil class. - * - */ +* @file FUiSystemUtil.h +* @brief This is the header file for the SystemUtil +* +* This header file contains the declarations of the SystemUtil class. +* +*/ #ifndef _FUI_SYSTEM_UTIL_H_ #define _FUI_SYSTEM_UTIL_H_ @@ -32,133 +32,146 @@ namespace Tizen { namespace Graphics { class Bitmap; class Point; +class FloatPoint; }} namespace Tizen { namespace Ui { /** - * @enum KeyEventType - * - * Defines key event types. - * - * @since 2.0 - */ +* @enum KeyEventType +* +* Defines key event types. +* +* @since 2.0 +*/ enum KeyEventType { - KEY_EVENT_TYPE_PRESSED, /**< Key pressed event type */ - KEY_EVENT_TYPE_RELEASED, /**< Key released event type */ + KEY_EVENT_TYPE_PRESSED, /**< Key pressed event type */ + KEY_EVENT_TYPE_RELEASED, /**< Key released event type */ }; /** - * @enum TouchEventType - * - * Defines touch event types. - * - * @since 2.0 - */ +* @enum TouchEventType +* +* Defines touch event types. +* +* @since 2.0 +*/ enum TouchEventType { - TOUCH_EVENT_TYPE_PRESSED, /**< Touch pressed event type */ - TOUCH_EVENT_TYPE_RELEASED, /**< Touch released event type */ - TOUCH_EVENT_TYPE_MOVED /**< Touch moved event type */ + TOUCH_EVENT_TYPE_PRESSED, /**< Touch pressed event type */ + TOUCH_EVENT_TYPE_RELEASED, /**< Touch released event type */ + TOUCH_EVENT_TYPE_MOVED /**< Touch moved event type */ }; /** - * @if VISPARTNER-MANUFACTURER - * @class SystemUtil - * @brief This is a class for system utililty such as touch, key, and capturing screen. It provides - * functionalities to simulate user inputs. - * @since 2.0 - * @final This class is not intended for extension. - * @visibility partner-manufacturer - * - * This class provides methods to generate user's input events such as - * touch and key events for helping test application and to capture current screen. - * @endif - */ +* @class SystemUtil +* @brief This is a class for system utililty such as touch, key, and capturing screen. It provides +* functionalities to simulate user inputs. +* @since 2.0 +* @final This class is not intended for extension. +* +* This class provides methods to generate user's input events such as +* touch and key events for helping test application and to capture current screen. +*/ class _OSP_EXPORT_ SystemUtil { public: - /** - * @if VISPARTNER-MANUFACTURER - * Generates a key event - * - * @since 2.0 - * @visibility partner-manufacturer - * @privilege %http://tizen.org/privilege/inputmanager - * - * @return An error code - * @param[in] keyEvent The event type of the key to be generated - * @param[in] keyCode The code of the key - * @exception E_SUCCESS The method was successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_OPERATION_FAILED An error occurred in the underlying system. - * @exception E_INVALID_ARG The specified @c keyEvent or @c keyCode is not supported. - * @endif - */ - static result GenerateKeyEvent(KeyEventType keyEvent, KeyCode keyCode); - - /** - * @if VISPARTNER-MANUFACTURER - * Generates a touch event - * - * @since 2.0 - * @visibility partner-manufacturer - * @privilege %http://tizen.org/privilege/inputmanager - * - * @return An error code - * @param[in] touchEvent The event type of the touch to be generated - * @param[in] point The point on which the touch occurs - * @exception E_SUCCESS The method was successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_OPERATION_FAILED An error occurred in the underlying system. - * @exception E_INVALID_ARG The specified @c touchEvent is not supported. - * @endif - */ - static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point); - - /** - * @if VISPARTNER-MANUFACTURER - * Captures a screen - * - * @since 2.0 - * @visibility partner-manufacturer - * @privilege %http://tizen.org/privilege/inputmanager - * - * @return A pointer to the captured screen bitmap, @n - * else @c null if it fails to capture screen - * @exception E_SUCCESS The method was successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @exception E_OPERATION_FAILED An error occurred in the underlying system. - * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. - * @remarks The specific error code can be accessed using the GetLastResult() method. @n - * The returned bitmap should be deleted by the application after use. - * @endif - */ - static Tizen::Graphics::Bitmap* CaptureScreenN(void); + /** + * Generates a key event + * + * @since 2.0 + * + * @privlevel platform + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] keyEvent The event type of the key to be generated + * @param[in] keyCode The code of the key + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c keyEvent or @c keyCode is not supported. + */ + static result GenerateKeyEvent(KeyEventType keyEvent, KeyCode keyCode); + + /** + * Generates a touch event + * + * @since 2.0 + * + * @privlevel platform + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] touchEvent The event type of the touch to be generated + * @param[in] point The point on which the touch occurs + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c touchEvent is not supported. + */ + static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point); + + /** + * Generates a touch event + * + * @since 2.0 + * + * @privlevel platform + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] touchEvent The event type of the touch to be generated + * @param[in] point The point on which the touch occurs + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c touchEvent is not supported. + */ + static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::FloatPoint& point); + + /** + * Captures a screen + * + * @since 2.0 + * + * @privlevel platform + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return A pointer to the captured screen bitmap, @n + * else @c null if it fails to capture screen + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * The returned bitmap should be deleted by the application after use. + */ + static Tizen::Graphics::Bitmap* CaptureScreenN(void); private: - // + // // This default constructor is intentionally declared as private because this class cannot be constructed. - // - SystemUtil(void); + // + SystemUtil(void); - // + // // This destructor is intentionally declared as private because this class cannot be constructed. - // - SystemUtil(const SystemUtil& rhs); - - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // - SystemUtil& operator =(const SystemUtil& rhs); - - // - // This is a destructor for this class. - // This destructor is intentionally declared as private because this class cannot be constructed. - // - ~SystemUtil(void); + // + SystemUtil(const SystemUtil& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + SystemUtil& operator =(const SystemUtil& rhs); + + // + // This is a destructor for this class. + // This destructor is intentionally declared as private because this class cannot be constructed. + // + ~SystemUtil(void); }; //SystemUtil diff --git a/inc/FUiTouch.h b/inc/FUiTouch.h index 2f00f60..d6f99eb 100644 --- a/inc/FUiTouch.h +++ b/inc/FUiTouch.h @@ -177,30 +177,30 @@ class _OSP_EXPORT_ Touch { public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the default constructor for this class. * * @brief [Deprecated] * @deprecated This method is deprecated because the %Touch class is not supported any more. Instead, use the Tizen::Ui::TouchEventManager class. * @since 2.0 - * @endif + * @endif */ Touch(void); /** - * @if OSPDEPREC - * This destructor overrides Osp::Base::Object::~Object(). + * @if OSPDEPREC + * This destructor overrides Tizen::Base::Object::~Object(). * * @brief [Deprecated] * @deprecated This method is deprecated because the %Touch class is not supported any more. Instead, use the Tizen::Ui::TouchEventManager class. * @since 2.0 - * @endif + * @endif */ virtual ~Touch(void); public: /** - * @if OSPDEPREC + * @if OSPDEPREC * Enables or disables the multi-point touch of the Control. * * @brief [Deprecated] @@ -213,12 +213,12 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_SYSTEM A system error has occurred. * @see IsMultipointEnabled() - * @endif + * @endif */ result SetMultipointEnabled(const Tizen::Ui::Control& control, bool enable); /** - * @if OSPDEPREC + * @if OSPDEPREC * Checks whether the multi-point touch is enabled. * * @brief [Deprecated] @@ -228,13 +228,13 @@ public: * @return @c true if the multi-point touch is enabled, @n * else @c false * @see IsMultipointEnabled() - * @endif + * @endif */ bool IsMultipointEnabled(const Tizen::Ui::Control& control) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the touch position. * If there is only a single touch, that is returned. If there are multi-point touches, then the position of the last touch is returned. * @@ -245,12 +245,12 @@ public: * * @return The coordinates of the touch * @remarks If an error occurs, this method returns Point(-1, -1). - * @endif + * @endif */ Tizen::Graphics::Point GetPosition(void) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the touch position by ID. * * @brief [Deprecated] @@ -261,12 +261,12 @@ public: * @return The coordinates of the touch * @param[in] id The ID of the touch * @remarks If an error occurs, this method returns Point(-1, -1). - * @endif + * @endif */ Tizen::Graphics::Point GetPosition(unsigned long id) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the touch position relative to the specified control. * * @brief [Deprecated] @@ -277,12 +277,12 @@ public: * @return The coordinates of the touch * @param[in] control The source control * @remarks If an error occurs, this method returns Point(-1, -1). - * @endif + * @endif */ Tizen::Graphics::Point GetPosition(const Tizen::Ui::Control& control) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the touch position relative to the specified control by ID. * * @brief [Deprecated] @@ -294,27 +294,27 @@ public: * @param[in] control The source control * @param[in] id The ID of the touch * @remarks If an error occurs, this method returns Point(-1, -1). - * @endif + * @endif */ Tizen::Graphics::Point GetPosition(const Tizen::Ui::Control& control, unsigned long id) const; /** - * @if OSPDEPREC - * Gets the status of the touch by ID. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because the %Touch class is not supported any more. - * Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() and use the Tizen::Ui::TouchEventInfo::GetTouchStatus() method. - * @since 2.0 - * - * @param[in] id The ID of the touch - * @return The touch status - * @endif - */ + * @if OSPDEPREC + * Gets the status of the touch by ID. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %Touch class is not supported any more. + * Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() and use the Tizen::Ui::TouchEventInfo::GetTouchStatus() method. + * @since 2.0 + * + * @param[in] id The ID of the touch + * @return The touch status + * @endif + */ TouchStatus GetTouchStatus(unsigned long id) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the list of the multi-point touches, each represented by TouchInfo. * * @brief [Deprecated] @@ -323,12 +323,12 @@ public: * * @return List of the TouchInfo * @see Tizen::Ui::TouchInfo - * @endif + * @endif */ Tizen::Base::Collection::IList* GetTouchInfoListN(void) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the list of the multi-point touch positions relative to the specified control, each represented by TouchInfo. * * @brief [Deprecated] @@ -338,25 +338,25 @@ public: * @return A list of the TouchInfo instances * @param[in] control The source object for calculating the coordinates * @see Tizen::Ui::TouchInfo - * @endif + * @endif */ Tizen::Base::Collection::IList* GetTouchInfoListN(const Tizen::Ui::Control& control) const; /** - * @if OSPDEPREC - * Gets the count of the multi-point touches. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because the %Touch class is not supported any more. Instead, get the count of Tizen::Ui::TouchEventManager::GetTouchInfoListN() method. - * @since 2.0 - * - * @return The number of the multi-point touches - * @endif - */ + * @if OSPDEPREC + * Gets the count of the multi-point touches. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %Touch class is not supported any more. Instead, get the count of Tizen::Ui::TouchEventManager::GetTouchInfoListN() method. + * @since 2.0 + * + * @return The number of the multi-point touches + * @endif + */ int GetPointCount(void) const; /** - * @if OSPDEPREC + * @if OSPDEPREC * Gets the point ID at the given index. * * @brief [Deprecated] @@ -366,7 +366,7 @@ public: * * @return The touch point ID * @param[in] index The index of the touch - * @endif + * @endif */ unsigned long GetPointId(int index) const; @@ -382,6 +382,6 @@ private: Touch& operator =(const Touch&); }; // Touch -}} // Tizen::Ui +} } // Tizen::Ui #endif // _FUI_TOUCH_H_ diff --git a/inc/FUiTouchEventInfo.h b/inc/FUiTouchEventInfo.h index 3c5d0d9..f9bafb3 100644 --- a/inc/FUiTouchEventInfo.h +++ b/inc/FUiTouchEventInfo.h @@ -28,11 +28,12 @@ #include #include +#include namespace Tizen { namespace Base { namespace Runtime { class IEventArg; -}}} +} } } namespace Tizen { namespace Ui { @@ -67,7 +68,15 @@ enum TouchStatus * @final This class is not intended for extension. * * The %TouchEventInfo class provides the touch event information: touch position, status, ID, and so on. - * @see ITouchEventListener, ITouchEventListener::OnTouchPressed(), @if OSPDEREC ITouchEventListener::OnTouchLongPressed(), @endif ITouchEventListener::OnTouchReleased(), ITouchEventListener::OnTouchMoved(), @if OSPDEPREC ITouchEventListener::OnTouchDoublePressed(), @endif ITouchEventListener::OnTouchFocusIn(), ITouchEventListener::OnTouchFocusOut() + * @see ITouchEventListener::OnTouchPressed() + * @see ITouchEventListener::OnTouchReleased() + * @see ITouchEventListener::OnTouchMoved() + * @see ITouchEventListener::OnTouchFocusIn() + * @see ITouchEventListener::OnTouchFocusOut() + * @if OSPDEPREC + * @see ITouchEventListener::OnTouchLongPressed() + * @see ITouchEventListener::OnTouchDoublePressed() + * @endif * */ class _OSP_EXPORT_ TouchEventInfo @@ -118,6 +127,15 @@ public: */ Tizen::Graphics::Point GetStartPosition(void) const; + /* + * Gets the start position of the touch event. + * + * @since 2.1 + * + * @return The start position of the touch event + */ + Tizen::Graphics::FloatPoint GetStartPositionF(void) const; + /** * Gets the current position of the touch event. * @@ -127,6 +145,15 @@ public: */ Tizen::Graphics::Point GetCurrentPosition(void) const; + /* + * Gets the current position of the touch event. + * + * @since 2.1 + * + * @return The current position of the touch event + */ + Tizen::Graphics::FloatPoint GetCurrentPositionF(void) const; + /** * Gets the touch status. * @@ -161,6 +188,6 @@ private: _TouchEventInfoImpl* __pTouchEventInfoImpl; }; // TouchEventInfo -}} //Tizen::Ui +} } //Tizen::Ui #endif // _FUI_TOUCH_EVENT_INFO_H_ diff --git a/inc/FUiTouchEventManager.h b/inc/FUiTouchEventManager.h index 3fa286a..d03b619 100644 --- a/inc/FUiTouchEventManager.h +++ b/inc/FUiTouchEventManager.h @@ -52,15 +52,15 @@ class _OSP_EXPORT_ TouchEventManager { public: /** - * Gets the instance of the %TouchEventManager. - * - * @since 2.0 - * @return A instance of the %TouchEventManager - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks This method provides a global point of access to the TouchEventManager. And the specific error code can be accessed using the - * GetLastResult() method. - */ + * Gets the instance of the %TouchEventManager. + * + * @since 2.0 + * @return A instance of the %TouchEventManager + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks This method provides a global point of access to the TouchEventManager. And the specific error code can be accessed using the + * GetLastResult() method. + */ static TouchEventManager* GetInstance(void); /** @@ -98,6 +98,6 @@ private: _TouchEventManagerImpl* __pTouchEventManagerImpl; }; // TouchEventManager -}} //Tizen::Ui +} } //Tizen::Ui #endif // _FUI_TOUCH_EVENT_MANAGER_H_ diff --git a/inc/FUiTouchFlickGestureDetector.h b/inc/FUiTouchFlickGestureDetector.h index e05256b..89e9f67 100644 --- a/inc/FUiTouchFlickGestureDetector.h +++ b/inc/FUiTouchFlickGestureDetector.h @@ -71,7 +71,7 @@ public: TouchFlickGestureDetector(void); /** - * This destructor overrides Osp::Base::Object::~Object(). + * This destructor overrides Tizen::Base::Object::~Object(). * * @since 2.0 */ @@ -88,36 +88,49 @@ public: result Construct(void); /** - * Adds the ITouchFlickGestureEventListener instance to the flick gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveFlickGestureEventListener() - */ + * Adds the ITouchFlickGestureEventListener instance to the flick gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveFlickGestureEventListener() + */ result AddFlickGestureEventListener(Tizen::Ui::ITouchFlickGestureEventListener& listener); /** - * Removes the IFlickGestureEventListener instance from the flick gesture detector instance. + * Removes the IFlickGestureEventListener instance from the flick gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddFlickGestureEventListener() + */ + result RemoveFlickGestureEventListener(Tizen::Ui::ITouchFlickGestureEventListener& listener); + + /** + * Gets the distance of flick. * * @since 2.0 * * @return An error code - * @param[in] listener The listener to remove + * @param[out] xDistance The distance in x direction + * @param[out] yDistance The distance in y direction * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddFlickGestureEventListener() + * @remarks If an error occurs, this method returns the x distance of -1 and the y distance of -1. */ - result RemoveFlickGestureEventListener(Tizen::Ui::ITouchFlickGestureEventListener& listener); + result GetDistance(int& xDistance, int& yDistance) const; - /** + /* * Gets the distance of flick. * - * @since 2.0 + * @since 2.1 * * @return An error code * @param[out] xDistance The distance in x direction @@ -125,7 +138,7 @@ public: * @exception E_SUCCESS The method is successful. * @remarks If an error occurs, this method returns the x distance of -1 and the y distance of -1. */ - result GetDistance(int& xDistance, int& yDistance) const; + result GetDistance(float& xDistance, float& yDistance) const; /** * Gets the duration of flick. @@ -165,4 +178,4 @@ private: }} // Tizen::Ui -#endif //_FUI_TOUCH_FLICK_GESTURE_DETECTOR_H_ +#endif //_FUI_TOUCH_FLICK_GESTURE_DETECTOR_H_ \ No newline at end of file diff --git a/inc/FUiTouchGestureDetector.h b/inc/FUiTouchGestureDetector.h index 9033d49..68fede5 100644 --- a/inc/FUiTouchGestureDetector.h +++ b/inc/FUiTouchGestureDetector.h @@ -72,7 +72,7 @@ public: TouchGestureDetector(void); /** - * This destructor overrides Osp::Base::Object::~Object(). + * This destructor overrides Tizen::Base::Object::~Object(). * * @since 2.0 */ @@ -173,6 +173,22 @@ public: */ result StartOnFailureOf(const TouchGestureDetector& gestureDetector); + /* + * Sets priority between gesture detectors. + * + * @since 2.1 + * + * @return An error code + * @param[in] pGestureDetector Pointer of gesture detector + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The @c pGestureDetector is null. + * @remarks If you want to set relationship between gesture detectors, call this method. + * If @c gestureDetector fails in recognizing a gesture, the gesture detector which waits for it starts the processing of recognizing. + * If @c gestureDetector succeeds in recognizing a gesture, + * the state of the gesture detector which waits for it changes to GESTURE_DETECTOR_STATE_FAIL. + */ + result StartOnFailureOf(TouchGestureDetector* pGestureDetector); + /** * Called when touch is pressed in the Control which the gesture detector is attached to. * @@ -289,4 +305,4 @@ protected: }} // Tizen::Ui -#endif //_FUI_TOUCH_GESTURE_DETECTOR_H_ \ No newline at end of file +#endif //_FUI_TOUCH_GESTURE_DETECTOR_H_ diff --git a/inc/FUiTouchInfo.h b/inc/FUiTouchInfo.h index 03bc75b..d267a32 100644 --- a/inc/FUiTouchInfo.h +++ b/inc/FUiTouchInfo.h @@ -52,7 +52,7 @@ class _OSP_EXPORT_ TouchInfo { public: /** - * @if OSPDEPREC + * @if OSPDEPREC * This is the default constructor for this class. * * @brief [Deprecated] @@ -68,42 +68,42 @@ public: } /** - * @if OSPDEPREC - * The ID of the Touch instance. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() - * and use the Tizen::Ui::TouchEventInfo::GetPointId() method. - * @since 2.0 - * @endif - */ + * @if OSPDEPREC + * The ID of the Touch instance. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() + * and use the Tizen::Ui::TouchEventInfo::GetPointId() method. + * @since 2.0 + * @endif + */ unsigned long id; /** - * @if OSPDEPREC - * The position of the Touch instance. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() - * and use the Tizen::Ui::TouchEventInfo::GetCurrentPosition() method. - * @since 2.0 - * @endif - */ + * @if OSPDEPREC + * The position of the Touch instance. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() + * and use the Tizen::Ui::TouchEventInfo::GetCurrentPosition() method. + * @since 2.0 + * @endif + */ Tizen::Graphics::Point position; /** - * @if OSPDEPREC - * The status of the Touch instance, using only the @c TOUCH_PRESSED and @c TOUCH_RELEASED states. - * - * @brief [Deprecated] - * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() - * and use the Tizen::Ui::TouchEventInfo::GetTouchStatus() method. - * @since 2.0 - * @endif - */ + * @if OSPDEPREC + * The status of the Touch instance, using only the @c TOUCH_PRESSED and @c TOUCH_RELEASED states. + * + * @brief [Deprecated] + * @deprecated This method is deprecated because the %TouchInfo class is not supported any more. Instead, get the Tizen::Ui::TouchEventManager::GetTouchInfoListN() + * and use the Tizen::Ui::TouchEventInfo::GetTouchStatus() method. + * @since 2.0 + * @endif + */ TouchStatus status; }; // TouchInfo -}} // Tizen::Ui +} } // Tizen::Ui #endif // _FUI_TOUCH_INFO_H_ diff --git a/inc/FUiTouchLongPressGestureDetector.h b/inc/FUiTouchLongPressGestureDetector.h index 9074119..037d50e 100644 --- a/inc/FUiTouchLongPressGestureDetector.h +++ b/inc/FUiTouchLongPressGestureDetector.h @@ -72,44 +72,44 @@ public: result Construct(void); /** - * Adds the ITouchLongPressGestureEventListener instance to the long press gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveLongPressGestureEventListener() - */ + * Adds the ITouchLongPressGestureEventListener instance to the long press gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveLongPressGestureEventListener() + */ result AddLongPressGestureEventListener(Tizen::Ui::ITouchLongPressGestureEventListener& listener); /** - * Removes the ITouchLongPressGestureEventListener instance from the long press gesture detector instance. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddLongPressGestureEventListener() - */ + * Removes the ITouchLongPressGestureEventListener instance from the long press gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddLongPressGestureEventListener() + */ result RemoveLongPressGestureEventListener(Tizen::Ui::ITouchLongPressGestureEventListener& listener); /** - * Sets the duration needed for the recognition of long press gesture. - * - * @since 2.0 - * - * @param[in] duration The time duration - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c duration is less than @c 0. - * @remarks The default value is @c 500 milliseconds. - * @see GetDuration() - * - */ + * Sets the duration needed for the recognition of long press gesture. + * + * @since 2.0 + * + * @param[in] duration The time duration + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c duration is less than @c 0. + * @remarks The default value is @c 500 milliseconds. + * @see GetDuration() + * + */ result SetDuration(int duration); /** @@ -125,60 +125,88 @@ public: int GetDuration(void) const; /** - * Sets the allowed displacement of touch move for the recognition of long press gesture. - * - * @since 2.0 - * - * @param[in] allowance The allowed move displacement - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. - * @remarks The long press gesture is recognized when touch is pressed and moved within the given allowed displacement from the first touch point for the given duration. - * The default allowance is @c 10. - * @see GetMoveAllowance() - * - */ + * Sets the allowed displacement of touch move for the recognition of long press gesture. + * + * @since 2.0 + * + * @param[in] allowance The allowed move displacement + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. + * @remarks The long press gesture is recognized when touch is pressed and moved within the given allowed displacement from the first touch point for the given duration. + * The default allowance is @c 10. + * @see GetMoveAllowance() + * + */ result SetMoveAllowance(int allowance); + /* + * Sets the allowed displacement of touch move for the recognition of long press gesture. + * + * @since 2.1 + * + * @param[in] allowance The allowed move displacement + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. + * @remarks The long press gesture is recognized when touch is pressed and moved within the given allowed displacement from the first touch point for the given duration. + * The default allowance is @c 10. + * @see GetMoveAllowance() + * + */ + result SetMoveAllowance(float allowance); + /** - * Gets the allowed move bounds. - * - * @since 2.0 - * - * @return The allowed move bounds - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns -1. - * @see SetMoveAllowance() - * - */ + * Gets the allowed move bounds. + * + * @since 2.0 + * + * @return The allowed move bounds + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + * @see SetMoveAllowance() + * + */ int GetMoveAllowance(void) const; + /* + * Gets the allowed move bounds. + * + * @since 2.1 + * + * @return The allowed move bounds + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + * @see SetMoveAllowance() + * + */ + float GetMoveAllowanceF(void) const; + /** - * Sets the finger count for the recognition of long press gesture at the same time. - * - * @since 2.0 - * - * @param[in] count The finger count for long press gesture - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c count is less than @c 0. - * @remarks The default value is @c 1. - * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. - * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. - * @see GetTouchCount() - * - */ + * Sets the finger count for the recognition of long press gesture at the same time. + * + * @since 2.0 + * + * @param[in] count The finger count for long press gesture + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c count is less than @c 0. + * @remarks The default value is @c 1. + * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. + * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. + * @see GetTouchCount() + * + */ result SetTouchCount(int count); /** - * Gets the finger count for the recognition of long press gesture at the same time. - * - * @since 2.0 - * - * @return The finger count for long press gesture - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns -1. - * @see GetTouchCount() - * - */ + * Gets the finger count for the recognition of long press gesture at the same time. + * + * @since 2.0 + * + * @return The finger count for long press gesture + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + * @see GetTouchCount() + * + */ int GetTouchCount(void) const; private: diff --git a/inc/FUiTouchPanningGestureDetector.h b/inc/FUiTouchPanningGestureDetector.h index 92abf7f..024da95 100644 --- a/inc/FUiTouchPanningGestureDetector.h +++ b/inc/FUiTouchPanningGestureDetector.h @@ -72,71 +72,71 @@ public: result Construct(void); /** - * Adds the ITouchPanningGestureEventListener instance to the panning gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveRotationGestureEventListener() - */ + * Adds the ITouchPanningGestureEventListener instance to the panning gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveRotationGestureEventListener() + */ result AddPanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener); /** - * Removes the ITouchPanningGestureEventListener instance from the panning gesture detector instance. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddRotationGestureEventListener() - */ + * Removes the ITouchPanningGestureEventListener instance from the panning gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddRotationGestureEventListener() + */ result RemovePanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener); /** - * Gets the list of the touched points represented by TouchInfo. - * - * @since 2.0 - * - * @return A list of the TouchInfo - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns @c null. - * @see Tizen::Ui::TouchInfo - */ + * Gets the list of the touched points represented by TouchInfo. + * + * @since 2.0 + * + * @return A list of the TouchInfo + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns @c null. + * @see Tizen::Ui::TouchInfo + */ Tizen::Base::Collection::IList* GetTouchInfoListN(void) const; /** - * Sets the finger count for the recognition of panning gesture at the same time. - * - * @since 2.0 - * - * @param[in] count The finger count for panning gesture - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c count is less than @c 0. - * @remarks The default value is @c 1. - * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. - * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. - * @see GetTouchCount() - * - */ + * Sets the finger count for the recognition of panning gesture at the same time. + * + * @since 2.0 + * + * @param[in] count The finger count for panning gesture + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c count is less than @c 0. + * @remarks The default value is @c 1. + * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. + * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. + * @see GetTouchCount() + * + */ result SetTouchCount(int count); /** - * Gets the finger count for the recognition of panning gesture at the same time. - * - * @since 2.0 - * - * @return The finger count for panning gesture - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns -1. - * @see SetTouchCount() - * - */ + * Gets the finger count for the recognition of panning gesture at the same time. + * + * @since 2.0 + * + * @return The finger count for panning gesture + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + * @see SetTouchCount() + * + */ int GetTouchCount(void) const; private: @@ -154,6 +154,6 @@ protected: friend class _TouchPanningGestureDetectorImpl; }; // TouchPanningGestureDetector -}} // Tizen::Ui +} } // Tizen::Ui #endif //_FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_ diff --git a/inc/FUiTouchPinchGestureDetector.h b/inc/FUiTouchPinchGestureDetector.h index b59d09b..8aa4158 100644 --- a/inc/FUiTouchPinchGestureDetector.h +++ b/inc/FUiTouchPinchGestureDetector.h @@ -28,6 +28,7 @@ #include #include +#include namespace Tizen { namespace Ui { @@ -73,42 +74,53 @@ public: result Construct(void); /** - * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveRotationGestureEventListener() - */ + * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveRotationGestureEventListener() + */ result AddPinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener); /** - * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance. + * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddRotationGestureEventListener() + */ + result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener); + + /** + * Gets the center position of two touch points. * * @since 2.0 * - * @return An error code - * @param[in] listener The listener to remove + * @return The center point * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddRotationGestureEventListener() + * @remarks If an error occurs, this method returns Point(-1, -1). */ - result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener); + Tizen::Graphics::Point GetCenterPoint(void) const; - /** + /* * Gets the center position of two touch points. * - * @since 2.0 + * @since 2.1 * * @return The center point * @exception E_SUCCESS The method is successful. * @remarks If an error occurs, this method returns Point(-1, -1). */ - Tizen::Graphics::Point GetCenterPoint(void) const; + Tizen::Graphics::FloatPoint GetCenterPointF(void) const; /** * Gets the scale factor among touched point @@ -120,6 +132,16 @@ public: */ int GetScale(void) const; + /* + * Gets the scale factor among touched point + * + * @since 2.1 + * + * @return The scale factor among touched points + * @remarks Get scale factor for a pinch gesture in progress + */ + float GetScaleF(void) const; + private: // // This is the copy constructor for this class. diff --git a/inc/FUiTouchRotationGestureDetector.h b/inc/FUiTouchRotationGestureDetector.h index 6ef0bc5..d58c09f 100644 --- a/inc/FUiTouchRotationGestureDetector.h +++ b/inc/FUiTouchRotationGestureDetector.h @@ -72,54 +72,65 @@ public: result Construct(void); /** - * Adds the ITouchRotationGestureEventListener instance to the rotation gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveRotationGestureEventListener() - */ + * Adds the ITouchRotationGestureEventListener instance to the rotation gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveRotationGestureEventListener() + */ result AddRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener); /** - * Removes the ITouchRotationGestureEventListener instance from the rotation gesture detector instance. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddRotationGestureEventListener() - */ + * Removes the ITouchRotationGestureEventListener instance from the rotation gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddRotationGestureEventListener() + */ result RemoveRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener); /** - * Gets the angle between the previous touch points and the current touch points. - * - * @since 2.0 - * - * @return The angle between two touch points - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns -1. - */ + * Gets the angle between the previous touch points and the current touch points. + * + * @since 2.0 + * + * @return The angle between two touch points + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + */ float GetAngle(void) const; /** - * Gets the distance between two touch points. - * - * @since 2.0 - * - * @return The distance between two touch points - * @exception E_SUCCESS The method is successful. - * @remarks If an error occurs, this method returns -1. - */ + * Gets the distance between two touch points. + * + * @since 2.0 + * + * @return The distance between two touch points + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + */ int GetDistance(void) const; + /* + * Gets the distance between two touch points. + * + * @since 2.1 + * + * @return The distance between two touch points + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns -1. + */ + float GetDistanceF(void) const; + private: // // This is the copy constructor for this class. @@ -135,6 +146,6 @@ protected: friend class _TouchRotationGestureDetectorImpl; }; // TouchRotationGestureDetector -}} // Tizen::Ui +} } // Tizen::Ui -#endif //_FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_ +#endif //_FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_ \ No newline at end of file diff --git a/inc/FUiTouchTapGestureDetector.h b/inc/FUiTouchTapGestureDetector.h index 8eb92f2..457c1c6 100644 --- a/inc/FUiTouchTapGestureDetector.h +++ b/inc/FUiTouchTapGestureDetector.h @@ -72,44 +72,44 @@ public: result Construct(void); /** - * Adds the ITouchTapGestureEventListener instance to the tap gesture detector instance. @n - * The added listener gets notified when a gesture is recognized. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The event listener to add - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The listener is already added. - * @see RemoveTapGestureEventListener() - */ + * Adds the ITouchTapGestureEventListener instance to the tap gesture detector instance. @n + * The added listener gets notified when a gesture is recognized. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The event listener to add + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_ALREADY_EXIST The listener is already added. + * @see RemoveTapGestureEventListener() + */ result AddTapGestureEventListener(Tizen::Ui::ITouchTapGestureEventListener& listener); /** - * Removes the ITouchTapGestureEventListener instance from the tap gesture detector instance. - * - * @since 2.0 - * - * @return An error code - * @param[in] listener The listener to remove - * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. - * @see AddTapGestureEventListener() - */ + * Removes the ITouchTapGestureEventListener instance from the tap gesture detector instance. + * + * @since 2.0 + * + * @return An error code + * @param[in] listener The listener to remove + * @exception E_SUCCESS The method is successful. + * @exception E_OBJ_NOT_FOUND The specified @c listener is not found. + * @see AddTapGestureEventListener() + */ result RemoveTapGestureEventListener(Tizen::Ui::ITouchTapGestureEventListener& listener); /** - * Sets the tap count required for the recognition of tap gesture. - * - * @since 2.0 - * - * @param[in] count The tap count - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c tap count is less than @c 0. - * @remarks The default value is @c 2. - * @see GetTapCount() - * - */ + * Sets the tap count required for the recognition of tap gesture. + * + * @since 2.0 + * + * @param[in] count The tap count + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c tap count is less than @c 0. + * @remarks The default value is @c 2. + * @see GetTapCount() + * + */ result SetTapCount(int count); /** @@ -126,17 +126,17 @@ public: int GetTapCount(void) const; /** - * Sets the time interval between taps. - * - * @since 2.0 - * - * @param[in] interval The time interval between taps - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c interval is less than @c 0. - * @remarks If the interval between touches is longer than @c interval, the sequence of touch actions is not recognized as a tap gesture. The default value is @c 330. - * @see GetTapInterval() - * - */ + * Sets the time interval between taps. + * + * @since 2.0 + * + * @param[in] interval The time interval between taps + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c interval is less than @c 0. + * @remarks If the interval between touches is longer than @c interval, the sequence of touch actions is not recognized as a tap gesture. The default value is @c 330. + * @see GetTapInterval() + * + */ result SetTapInterval(int interval); /** @@ -153,51 +153,67 @@ public: int GetTapInterval(void) const; /** - * Sets the finger count for the recognition of tap gesture at the same time. - * - * @since 2.0 - * - * @param[in] count The finger count for long press gesture - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c count is less than @c 0. - * @remarks If the touch count at the same time is less than @c count, the sequence of touch actions is not recognized as a tap gesture. The default value is @c 1. @n - * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. - * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. - * @see GetTouchCount() - * - */ + * Sets the finger count for the recognition of tap gesture at the same time. + * + * @since 2.0 + * + * @param[in] count The finger count for long press gesture + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c count is less than @c 0. + * @remarks If the touch count at the same time is less than @c count, the sequence of touch actions is not recognized as a tap gesture. The default value is @c 1. @n + * It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector. + * You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected. + * @see GetTouchCount() + * + */ result SetTouchCount(int count); /** - * Gets the finger count for the recognition of tap gesture at the same time. - * - * @since 2.0 - * - * @return The finger count for tap gesture - * @exception E_SUCCESS The method is successful. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @remarks If an error occurs, this method returns @c -1. - * @see GetTouchCount() - * - */ + * Gets the finger count for the recognition of tap gesture at the same time. + * + * @since 2.0 + * + * @return The finger count for tap gesture + * @exception E_SUCCESS The method is successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @remarks If an error occurs, this method returns @c -1. + * @see GetTouchCount() + * + */ int GetTouchCount(void) const; /** - * Sets the allowed displacement between touches for the recognition of tap gesture. - * - * @since 2.0 - * - * @param[in] allowance The allowed displacement between touches - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. - * @exception E_INVALID_CONDITION %Touch count is more than @c 2. - * @remarks The tap gesture is recognized when touches are pressed within the given allowed displacement from the first touch point. The default allowance is @c 10. @n - * MoveAllowance is effective only when touch count is @c 1. If touch count is more than 1, MoveAllowance is ignored. - * @see GetMoveAllowance() - * - */ + * Sets the allowed displacement between touches for the recognition of tap gesture. + * + * @since 2.0 + * + * @param[in] allowance The allowed displacement between touches + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. + * @exception E_INVALID_CONDITION %Touch count is more than @c 2. + * @remarks The tap gesture is recognized when touches are pressed within the given allowed displacement from the first touch point. The default allowance is @c 10. @n + * MoveAllowance is effective only when touch count is @c 1. If touch count is more than 1, MoveAllowance is ignored. + * @see GetMoveAllowance() + * + */ result SetMoveAllowance(int allowance); + /* + * Sets the allowed displacement between touches for the recognition of tap gesture. + * + * @since 2.1 + * + * @param[in] allowance The allowed displacement between touches + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c allowance is less than @c 0. + * @exception E_INVALID_CONDITION %Touch count is more than @c 2. + * @remarks The tap gesture is recognized when touches are pressed within the given allowed displacement from the first touch point. The default allowance is @c 10. @n + * MoveAllowance is effective only when touch count is @c 1. If touch count is more than 1, MoveAllowance is ignored. + * @see GetMoveAllowance() + * + */ + result SetMoveAllowance(float allowance); + /** * Gets ths allowed displacement between touches for the recognition of tap gesture. * @@ -209,6 +225,18 @@ public: * @see SetMoveAllowance() */ int GetMoveAllowance(void) const; + + /* + * Gets ths allowed displacement between touches for the recognition of tap gesture. + * + * @since 2.1 + * + * @return The allowed displacement between touches + * @exception E_SUCCESS The method is successful. + * @remarks If an error occurs, this method returns @c -1. + * @see SetMoveAllowance() + */ + float GetMoveAllowanceF(void) const; private: // // This is the copy constructor for this class. @@ -226,4 +254,4 @@ protected: }} // Tizen::Ui -#endif //_FUI_TOUCH_TAP_GESTURE_DETECTOR_H_ +#endif //_FUI_TOUCH_TAP_GESTURE_DETECTOR_H_ \ No newline at end of file diff --git a/inc/FUiUiConfiguration.h b/inc/FUiUiConfiguration.h index 4ca8538..b80add3 100644 --- a/inc/FUiUiConfiguration.h +++ b/inc/FUiUiConfiguration.h @@ -40,40 +40,65 @@ public: * @since 2.0 * * @return An error code - * @param[in] fontName The app font name or system font name @n - * The app font name is retrieved using Tizen::Graphics::GetFaceName(Tizen::Base::String& filepath). - * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN(). - * Sets an empty string if you want to reset - * @exception E_SUCCESS The method is successful. + * @param[in] fontName The app font name or system font name @n + * The app font name is retrieved using Tizen::Graphics::GetFaceName(Tizen::Base::String& filepath). + * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN(). + * Sets an empty string if you want to reset + * @exception E_SUCCESS The method is successful. * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. - * @remarks At First, the value of fontName is considered app font name if it matches one of the face names of the font files which is located in '/res/font'. - * If not, the value of fontName is considered system font name if it matches one of the retrieved values using GetSystemFontListN(). - * @remarks The control first attempt to find the control font. If it fails, then it searches for the application default font and the system font, in sequence. - * @see GetDefaultFont() - */ + * @remarks At First, the value of fontName is considered app font name if it matches one of the face names of the font files which is located in '/res/font'. + * If not, the value of fontName is considered system font name if it matches one of the retrieved values using GetSystemFontListN(). + * @remarks The control first attempt to find the control font. If it fails, then it searches for the application default font and the system font, in sequence. + * @see GetDefaultFont() + */ static result SetDefaultFont(const Tizen::Base::String& fontName); /** - * Gets the default font for all the Controls. + * Gets the default font for all the Controls. + * + * @since 2.0 + * + * @return The app font name or system font name @n + * else an empty string if the default font is not set + * @see SetDefaultFont() + */ + static Tizen::Base::String GetDefaultFont(void); + + /** + * Sets the font of the control with the specified file name. * - * @since 2.0 + * @since 2.1 * - * @return The app font name or system font name @n - * else an empty string if the default font is not set - * @see SetDefaultFont() - */ - static Tizen::Base::String GetDefaultFont(void); + * @return An error code + * @param[in] file name The file name of a font-resource which are located in '/res/font'. + * Sets an empty string to reset. + * @exception E_SUCCESS The method is successful. + * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed. + * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported. + * @see GetDefaultFontFile() + */ + static result SetDefaultFontFromFile(const Tizen::Base::String& fileName); + /** + * Gets a font file name of the control. + * + * @since 2.1 + * + * @return The font name set in the control @n + * else an empty string if the font is not set + * @see SetDefaultFontFromFile() + */ + static Tizen::Base::String GetDefaultFontFile(void); private: // // This default constructor is intentionally declared as private because this class cannot be constructed. - // + // UiConfiguration(void); // // This destructor is intentionally declared as private because this class cannot be constructed. - // + // ~UiConfiguration(void); // diff --git a/inc/FUiVariant.h b/inc/FUiVariant.h old mode 100644 new mode 100755 index b73bcc8..7497550 --- a/inc/FUiVariant.h +++ b/inc/FUiVariant.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -42,6 +42,8 @@ namespace Tizen { namespace Graphics class FloatRectangle; class FloatDimension; class FloatMatrix4; + class FloatPoint3; + class FloatVector4; } } namespace Tizen { namespace Ui @@ -77,7 +79,9 @@ enum VariantType VARIANT_TYPE_FLOAT_RECTANGLE, /**< The FloatRectangle type */ VARIANT_TYPE_DIMENSION, /**< The Dimension type */ VARIANT_TYPE_FLOAT_DIMENSION, /**< The FloatDimension type */ - VARIANT_TYPE_FLOAT_MATRIX4 /**< The FloatMatrix4 type */ + VARIANT_TYPE_FLOAT_MATRIX4, /**< The FloatMatrix4 type */ + VARIANT_TYPE_FLOAT_POINT3, /**< The FloatPoint3 type @b Since: @b 2.1 */ + VARIANT_TYPE_FLOAT_VECTOR4 /**< The FloatPoint3 type @b Since: @b 2.1 */ }; /** @@ -94,765 +98,828 @@ class _OSP_EXPORT_ Variant { public: /** - * This is the default constructor for this class. - * - * @since 2.0 - */ + * This is the default constructor for this class. + * + * @since 2.0 + */ Variant(void); /** - * This is the copy constructor for the %Variant class. - * - * @since 2.0 - * - * @param[in] value A reference to the %Variant instance to copy - */ + * This is the copy constructor for the %Variant class. + * + * @since 2.0 + * + * @param[in] value A reference to the %Variant instance to copy + */ Variant(const Variant& value); /** - * Initializes this instance of %Variant with the specified @c int value. - * - * @since 2.0 - * - * @param[in] value An @c int value - */ + * Initializes this instance of %Variant with the specified @c int value. + * + * @since 2.0 + * + * @param[in] value An @c int value + */ Variant(int value); /** - * Initializes this instance of %Variant with the specified unsigned @c int value. - * - * @since 2.0 - * - * @param[in] value An unsigned @c int value - */ + * Initializes this instance of %Variant with the specified unsigned @c int value. + * + * @since 2.0 + * + * @param[in] value An unsigned @c int value + */ Variant(unsigned int value); /** - * Initializes this instance of %Variant with the specified bool value. - * - * @since 2.0 - * - * @param[in] value A bool value - */ + * Initializes this instance of %Variant with the specified bool value. + * + * @since 2.0 + * + * @param[in] value A bool value + */ Variant(bool value); /** - * Initializes this instance of %Variant with the specified @c float value. - * - * @since 2.0 - * - * @param[in] value A @c float value - */ + * Initializes this instance of %Variant with the specified @c float value. + * + * @since 2.0 + * + * @param[in] value A @c float value + */ Variant(float value); /** - * Initializes this instance of %Variant with the specified @c double value. - * - * @since 2.0 - * - * @param[in] value A @c double value - */ + * Initializes this instance of %Variant with the specified @c double value. + * + * @since 2.0 + * + * @param[in] value A @c double value + */ Variant(double value); /** - * Initializes this instance of %Variant with the specified @c long value. - * - * @since 2.0 - * - * @param[in] value A @c long value - */ + * Initializes this instance of %Variant with the specified @c long value. + * + * @since 2.0 + * + * @param[in] value A @c long value + */ Variant(long value); /** - * Initializes this instance of %Variant with the specified unsigned @c long value. - * - * @since 2.0 - * - * @param[in] value An unsigned @c long value - */ + * Initializes this instance of %Variant with the specified unsigned @c long value. + * + * @since 2.0 + * + * @param[in] value An unsigned @c long value + */ Variant(unsigned long value); /** - * Initializes this instance of %Variant with the specified @c long @c long value. - * - * @since 2.0 - * - * @param[in] value A @c long @c long value - */ + * Initializes this instance of %Variant with the specified @c long @c long value. + * + * @since 2.0 + * + * @param[in] value A @c long @c long value + */ Variant(long long value); /** - * Initializes this instance of %Variant with the specified unsigned @c long @c long value. - * - * @since 2.0 - * - * @param[in] value An unsigned @c long @c long value - */ + * Initializes this instance of %Variant with the specified unsigned @c long @c long value. + * + * @since 2.0 + * + * @param[in] value An unsigned @c long @c long value + */ Variant(unsigned long long value); /** - * Initializes this instance of %Variant with the specified array of characters. - * - * @since 2.0 - * - * @param[in] pValue An array of characters value - */ + * Initializes this instance of %Variant with the specified array of characters. + * + * @since 2.0 + * + * @param[in] pValue An array of characters value + */ Variant(const char* pValue); /** - * Initializes this instance of %Variant with the specified array of Unicode characters. - * - * @since 2.0 - * - * @param[in] pValue An array of Unicode characters value - */ + * Initializes this instance of %Variant with the specified array of Unicode characters. + * + * @since 2.0 + * + * @param[in] pValue An array of Unicode characters value + */ Variant(const wchar_t* pValue); /** - * Initializes this instance of %Variant with the specified unsigned string value. - * - * @since 2.0 - * - * @param[in] value An unsigned string value - */ + * Initializes this instance of %Variant with the specified Tizen::Base::String value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Base::String value + */ Variant(const Tizen::Base::String& value); /** - * Initializes this instance of %Variant with the specified unsigned datetime value. - * - * @since 2.0 - * - * @param[in] value An unsigned datetime value - */ + * Initializes this instance of %Variant with the specified Tizen::Base::DateTime value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Base::DateTime value + */ Variant(const Tizen::Base::DateTime& value); /** - * Initializes this instance of %Variant with the specified unsigned color value. - * - * @since 2.0 - * - * @param[in] value An unsigned color value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::Color value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::Color value + */ Variant(const Tizen::Graphics::Color& value); /** - * Initializes this instance of %Variant with the specified unsigned point value. - * - * @since 2.0 - * - * @param[in] value An unsigned point value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::Point value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::Point value + */ Variant(const Tizen::Graphics::Point& value); /** - * Initializes this instance of %Variant with the specified floatpoint value. - * - * @since 2.0 - * - * @param[in] value A floatpoint value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatPoint value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::FloatPoint value + */ Variant(const Tizen::Graphics::FloatPoint& value); /** - * Initializes this instance of %Variant with the specified rectangle value. - * - * @since 2.0 - * - * @param[in] value A rectangle value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::Rectangle value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::Rectangle value + */ Variant(const Tizen::Graphics::Rectangle& value); /** - * Initializes this instance of %Variant with the specified float-rectangle value. - * - * @since 2.0 - * - * @param[in] value A float-rectangle value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatRectangle value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::FloatRectangle value + */ Variant(const Tizen::Graphics::FloatRectangle& value); /** - * Initializes this instance of %Variant with the specified dimension value. - * - * @since 2.0 - * - * @param[in] value A dimension value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::Dimension value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::Dimension value + */ Variant(const Tizen::Graphics::Dimension& value); /** - * Initializes this instance of %Variant with the specified float-dimension value. - * - * @since 2.0 - * - * @param[in] value A float-dimension value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatDimension value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::FloatDimension value + */ Variant(const Tizen::Graphics::FloatDimension& value); /** - * Initializes this instance of %Variant with the specified float-matrix4 value. - * - * @since 2.0 - * - * @param[in] value A float-matrix4 value - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatMatrix4 value. + * + * @since 2.0 + * + * @param[in] value A Tizen::Graphics::FloatMatrix4 value + */ Variant(const Tizen::Graphics::FloatMatrix4& value); /** - * This is the destructor for this class. - * - * @since 2.0 - */ + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatPoint3 value. + * + * @since 2.1 + * + * @param[in] value A Tizen::Graphics::FloatPoint3 value + */ + Variant(const Tizen::Graphics::FloatPoint3& value); + + /** + * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatVector4 value. + * + * @since 2.1 + * + * @param[in] value A Tizen::Graphics::FloatVector4 value + */ + Variant(const Tizen::Graphics::FloatVector4& value); + + /** + * This is the destructor for this class. + * + * @since 2.0 + */ virtual ~Variant(void); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An instance of %Variant to copy - */ + * Assigns the value of the specified instance to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An instance of %Variant to copy + */ Variant& operator =(const Variant& rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An @c int value - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An @c int value + */ Variant& operator =(int rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An unsigned @c int value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An unsigned @c int value + * + */ Variant& operator =(unsigned int rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs A @c bool value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs A @c bool value + * + */ Variant& operator =(bool rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs A @c float value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs A @c float value + * + */ Variant& operator =(float rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs A @c double value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs A @c double value + * + */ Variant& operator =(double rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs A @c long value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs A @c long value + * + */ Variant& operator =(long rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An unsigned @c long value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An unsigned @c long value + * + */ Variant& operator =(unsigned long rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs A @c long @c long value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs A @c long @c long value + * + */ Variant& operator =(long long rhs); /** - * Assigns the value of the specified instance to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An unsigned @c long @c long value - * - */ + * Assigns the value to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An unsigned @c long @c long value + * + */ Variant& operator =(unsigned long long rhs); /** - * Assigns the value of the pointer to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] pRhs A pointer to an array of characters - * - */ + * Assigns the value of the pointer to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] pRhs A pointer to an array of characters + * + */ Variant& operator =(const char* pRhs); /** - * Assigns the value of the pointer to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] pRhs A pointer to an array of Unicode characters - * - */ + * Assigns the value of the pointer to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] pRhs A pointer to an array of Unicode characters + * + */ Variant& operator =(const wchar_t* pRhs); /** - * Assigns the value of the specified instance of Tizen::Base::String to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Base::String - */ + * Assigns the value of the specified instance of Tizen::Base::String to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Base::String + */ Variant& operator =(const Tizen::Base::String& rhs); /** - * Assigns the value of the specified instance of Tizen::Base::DateTime to the current instance of %Variant. - * - * @since 2.0 - * - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Base::DateTime - */ + * Assigns the value of the specified instance of Tizen::Base::DateTime to the current instance of %Variant. + * + * @since 2.0 + * + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Base::DateTime + */ Variant& operator =(const Tizen::Base::DateTime& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::Color to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::Color - */ + * Assigns the value of the specified instance of Tizen::Graphics::Color to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::Color + */ Variant& operator =(const Tizen::Graphics::Color& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::Point to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::Point - */ + * Assigns the value of the specified instance of Tizen::Graphics::Point to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::Point + */ Variant& operator =(const Tizen::Graphics::Point& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::FloatPoint to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::FloatPoint - */ + * Assigns the value of the specified instance of Tizen::Graphics::FloatPoint to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatPoint + */ Variant& operator =(const Tizen::Graphics::FloatPoint& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::Rectangle to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::Rectangle - */ + * Assigns the value of the specified instance of Tizen::Graphics::Rectangle to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::Rectangle + */ Variant& operator =(const Tizen::Graphics::Rectangle& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::FloatRectangle to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::FloatRectangle - */ + * Assigns the value of the specified instance of Tizen::Graphics::FloatRectangle to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatRectangle + */ Variant& operator =(const Tizen::Graphics::FloatRectangle& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::Dimension to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::Dimension - */ + * Assigns the value of the specified instance of Tizen::Graphics::Dimension to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::Dimension + */ Variant& operator =(const Tizen::Graphics::Dimension& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::FloatDimension to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::FloatDimension - */ + * Assigns the value of the specified instance of Tizen::Graphics::FloatDimension to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatDimension + */ Variant& operator =(const Tizen::Graphics::FloatDimension& rhs); /** - * Assigns the value of the specified instance of Tizen::Graphics::FloatMatrix4 to the current instance of %Variant. - * - * @since 2.0 - * @return A reference to the %Variant instance - * @param[in] rhs An instance of Tizen::Graphics::FloatMatrix4 - */ + * Assigns the value of the specified instance of Tizen::Graphics::FloatMatrix4 to the current instance of %Variant. + * + * @since 2.0 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatMatrix4 + */ Variant& operator =(const Tizen::Graphics::FloatMatrix4& rhs); /** - * Checks whether the specified instance and current instance of %Variant have equal values. - * - * @since 2.0 - * @return @c true if the two instances of %Variant are equal, @n - * else @c false - * @param[in] lhs An instance of %Variant - * @param[in] rhs An instance of %Variant - */ + * Assigns the value of the specified instance of Tizen::Graphics::FloatPoint3 to the current instance of %Variant. + * + * @since 2.1 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatPoint3 + */ + Variant& operator =(const Tizen::Graphics::FloatPoint3& rhs); + + /** + * Assigns the value of the specified instance of Tizen::Graphics::FloatVecto4 to the current instance of %Variant. + * + * @since 2.1 + * @return A reference to the %Variant instance + * @param[in] rhs An instance of Tizen::Graphics::FloatVector4 + */ + Variant& operator =(const Tizen::Graphics::FloatVector4& rhs); + + /** + * Checks whether the specified instance and current instance of %Variant have equal values. + * + * @since 2.0 + * @return @c true if the two instances of %Variant are equal, @n + * else @c false + * @param[in] lhs An instance of %Variant + * @param[in] rhs An instance of %Variant + */ _OSP_EXPORT_ friend bool operator ==(const Variant& lhs, const Variant& rhs); /** - * Checks whether the specified instance and current instance of %Variant have different values. - * @since 2.0 - * - * @return @c true if the values of the two instances of %Variant are not equal, @n - * else @c false - * @param[in] lhs An instance of %Variant - * @param[in] rhs An instance of %Variant - * - */ + * Checks whether the specified instance and current instance of %Variant have different values. + * @since 2.0 + * + * @return @c true if the values of the two instances of %Variant are not equal, @n + * else @c false + * @param[in] lhs An instance of %Variant + * @param[in] rhs An instance of %Variant + * + */ _OSP_EXPORT_ friend bool operator !=(const Variant& lhs, const Variant& rhs); /** - * Gets the signed @c int equivalent of the current instance. - * - * @since 2.0 - * - * @return Signed @c int equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_INT. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_INT. - * - */ + * Gets the signed @c int equivalent of the current instance. + * + * @since 2.0 + * + * @return Signed @c int equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_INT. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_INT. + * + */ int ToInt(void) const; /** - * Gets the unsigned @c int equivalent of the current instance. - * - * @since 2.0 - * - * @return Unsigned @c int equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_UINT. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_UINT. - * - */ + * Gets the unsigned @c int equivalent of the current instance. + * + * @since 2.0 + * + * @return Unsigned @c int equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_UINT. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_UINT. + * + */ unsigned int ToUInt(void) const; /** - * Gets the @c bool equivalent of the current instance. - * - * @since 2.0 - * - * @return @c bool equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_BOOL. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c false and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_BOOL. - * - */ + * Gets the @c bool equivalent of the current instance. + * + * @since 2.0 + * + * @return @c bool equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_BOOL. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c false and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_BOOL. + * + */ bool ToBool(void) const; /** - * Gets the @c float equivalent of the current instance. - * - * @since 2.0 - * - * @return @c float equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT. - * - */ + * Gets the @c float equivalent of the current instance. + * + * @since 2.0 + * + * @return @c float equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT. + * + */ float ToFloat(void) const; /** - * Gets the @c double equivalent of the current instance. - * - * @since 2.0 - * - * @return @c double equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DOUBLE. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DOUBLE. - * - */ + * Gets the @c double equivalent of the current instance. + * + * @since 2.0 + * + * @return @c double equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DOUBLE. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DOUBLE. + * + */ double ToDouble(void) const; /** - * Gets the signed @c long equivalent of the current instance. - * - * @since 2.0 - * - * @return Signed @c long equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_LONG. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONG. - * - */ + * Gets the signed @c long equivalent of the current instance. + * + * @since 2.0 + * + * @return Signed @c long equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_LONG. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONG. + * + */ long ToLong(void) const; /** - * Gets the unsigned @c int equivalent of the current instance. - * - * @since 2.0 - * - * @return Unsigned @c long equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_ULONG. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONG. - * - */ + * Gets the unsigned @c int equivalent of the current instance. + * + * @since 2.0 + * + * @return Unsigned @c long equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_ULONG. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONG. + * + */ unsigned long ToULong(void) const; /** - * Gets the signed @c long @c long equivalent of the current instance. - * - * @since 2.0 - * - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_LONGLONG. - * - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONGLONG. - * - */ + * Gets the signed @c long @c long equivalent of the current instance. + * + * @since 2.0 + * + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_LONGLONG. + * + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONGLONG. + * + */ long long ToLongLong(void) const; /** - * Gets the unsigned @c long @c long equivalent of the current instance. - * - * @since 2.0 - * - * @return Unsigned @c long @c long equivalent of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_ULONGLONG. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONGLONG. - * - */ + * Gets the unsigned @c long @c long equivalent of the current instance. + * + * @since 2.0 + * + * @return Unsigned @c long @c long equivalent of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_ULONGLONG. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONGLONG. + * + */ unsigned long long ToULongLong(void) const; /** - * Gets the Tizen::Base::String representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Base::String representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_STRING. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns String("") and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_STRING. - * - */ + * Gets the Tizen::Base::String representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Base::String representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_STRING. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns String("") and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_STRING. + * + */ Tizen::Base::String ToString(void) const; /** - * Gets the Tizen::Base::DateTime representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Base::DateTime representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DATETIME. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns DateTime and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DATETIME. - * - */ + * Gets the Tizen::Base::DateTime representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Base::DateTime representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DATETIME. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns DateTime and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DATETIME. + * + */ Tizen::Base::DateTime ToDateTime(void) const; /** - * Gets the Tizen::Graphics::Color representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::Color representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_COLOR. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns Color and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_COLOR. - * - */ + * Gets the Tizen::Graphics::Color representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::Color representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_COLOR. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns Color and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_COLOR. + * + */ Tizen::Graphics::Color ToColor(void) const; /** - * Gets the Tizen::Graphics::Point representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::Point representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_POINT. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns Point and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_POINT. - * - */ + * Gets the Tizen::Graphics::Point representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::Point representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_POINT. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns Point and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_POINT. + * + */ Tizen::Graphics::Point ToPoint(void) const; /** - * Gets the Tizen::Graphics::FloatPoint representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::FloatPoint representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOATPOINT. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns FloatPoint and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOATPOINT. - * - */ + * Gets the Tizen::Graphics::FloatPoint representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::FloatPoint representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_POINT. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatPoint and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_POINT. + * + */ Tizen::Graphics::FloatPoint ToFloatPoint(void) const; /** - * Gets the Tizen::Graphics::Rectangle representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::Rectangle representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_RECTANGLE. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns Rectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_RECTANGLE. - * - */ + * Gets the Tizen::Graphics::Rectangle representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::Rectangle representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_RECTANGLE. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns Rectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_RECTANGLE. + * + */ Tizen::Graphics::Rectangle ToRectangle(void) const; /** - * Gets the Tizen::Graphics::FloatRectangle representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::FloatRectangle representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOATRECTANGLE. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns FloatRectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOATRECTANGLE. - * - */ + * Gets the Tizen::Graphics::FloatRectangle representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::FloatRectangle representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_RECTANGLE. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatRectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_RECTANGLE. + * + */ Tizen::Graphics::FloatRectangle ToFloatRectangle(void) const; /** - * Gets the Tizen::Graphics::Dimension representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::Dimension representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DIMENSION. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns Dimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DIMENSION. - * - */ + * Gets the Tizen::Graphics::Dimension representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::Dimension representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_DIMENSION. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns Dimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DIMENSION. + * + */ Tizen::Graphics::Dimension ToDimension(void) const; /** - * Gets the Tizen::Graphics::FloatDimension representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::FloatDimension representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOATDIMENSION. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns FloatDimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOATDIMENSION. - * - */ + * Gets the Tizen::Graphics::FloatDimension representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::FloatDimension representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_DIMENSION. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatDimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_DIMENSION. + * + */ Tizen::Graphics::FloatDimension ToFloatDimension(void) const; /** - * Gets the Tizen::Graphics::FloatMatrix4 representation of the value of the current instance. - * - * @since 2.0 - * - * @return A Tizen::Graphics::FloatMatrix4 representing the value of the current instance - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOATMATRIX4. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * The method returns FloatMatrix4 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOATMATRIX4. - * - */ + * Gets the Tizen::Graphics::FloatMatrix4 representation of the value of the current instance. + * + * @since 2.0 + * + * @return A Tizen::Graphics::FloatMatrix4 representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_MATRIX4. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatMatrix4() and generates E_INVALID_OPERATION exception if the current variant type is not VARIANT_TYPE_FLOAT_MATRIX4. + * + */ Tizen::Graphics::FloatMatrix4 ToFloatMatrix4(void) const; /** - * Checks whether the variant is empty. - * - * @since 2.0 - * - * @return @c true if the current instance is @c NULL_VARIANT, @n - * else @c false - */ + * Gets the Tizen::Graphics::FloatPoint3 representation of the value of the current instance. + * + * @since 2.1 + * + * @return A Tizen::Graphics::FloatPoint3 representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_POINT3. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatPoint3 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_POINT3. + * + */ + Tizen::Graphics::FloatPoint3 ToFloatPoint3(void) const; + + /** + * Gets the Tizen::Graphics::FloatVector4 representation of the value of the current instance. + * @since 2.1 + * + * @return A Tizen::Graphics::FloatVector4 representing the value of the current instance + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current variant type is not @c VARIANT_TYPE_FLOAT_VECTOR4. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * The method returns FloatVector4() and generates E_INVALID_OPERATION exception if the current variant type is not VARIANT_TYPE_FLOAT_VECTOR4. + * + */ + Tizen::Graphics::FloatVector4 ToFloatVector4(void) const; + + /** + * Checks whether the variant is empty. + * + * @since 2.0 + * + * @return @c true if the current instance is NULL_VARIANT, @n + * else @c false + */ bool IsEmpty(void) const; /** - * Gets the type of the variant. - * - * @since 2.0 - * - * @return The variant type - */ + * Gets the type of the variant. + * + * @since 2.0 + * + * @return The variant type + */ VariantType GetType(void) const; /** - * Checks whether the current instance of %Variant equals the specified instance of %Variant. - * - * @since 2.0 - * - * @return @c true if the values of the current instance is equal to the value of the specified instance, @n - * else @c false - * @param[in] obj An instance of %Variant - * @remarks This method overrides Tizen::Base::Object::Equals(). This method uses the values of the %Variant to compare the two instances. - */ + * Checks whether the current instance of %Variant equals the specified instance of %Variant. + * + * @since 2.0 + * + * @return @c true if the values of the current instance is equal to the value of the specified instance, @n + * else @c false + * @param[in] obj An instance of %Variant + * @remarks This method overrides Tizen::Base::Object::Equals(). This method uses the values of the %Variant to compare the two instances. + */ virtual bool Equals(const Object& obj) const; /** - * Gets the hash value of the current instance. - * - * @since 2.0 - * - * @return The hash value of the current instance - * @remarks Two equal instances must return the same hash value. For better performance, the used hash function must generate a random distribution for all inputs. - */ + * Gets the hash value of the current instance. + * + * @since 2.0 + * + * @return The hash value of the current instance + * @remarks Two equal instances must return the same hash value. For better performance, the used hash function must generate a random distribution for all inputs. + */ virtual int GetHashCode(void) const; public: diff --git a/inc/FUiVerticalBoxLayout.h b/inc/FUiVerticalBoxLayout.h old mode 100644 new mode 100755 index 3330f48..041b7c0 --- a/inc/FUiVerticalBoxLayout.h +++ b/inc/FUiVerticalBoxLayout.h @@ -251,6 +251,21 @@ public: */ result SetSpacing(Control& childControl, int space); + /* + * Sets the space between the specified control and its predecessor. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the space is set + * @param[in] space The space + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the spacing is set to @c 0. + */ + result SetSpacing(Control& childControl, float space); + /** * Sets the horizontal margins of the specified control. * @@ -267,6 +282,22 @@ public: */ result SetHorizontalMargin(Control& childControl, int left, int right); + /* + * Sets the horizontal margins of the specified control. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the margins are set + * @param[in] left The left margin + * @param[in] right The right margin + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + * @remarks By default, the margins are set to @c 0. + */ + result SetHorizontalMargin(Control& childControl, float left, float right); + /** * Sets the width of the specified control with the fixed length. * @@ -281,6 +312,20 @@ public: */ result SetWidth(Control& childControl, int width); + /* + * Sets the width of the specified control with the fixed length. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the width is set + * @param[in] width The value of the width + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetWidth(Control& childControl, float width); + /** * Sets the width of the specified control with the fitting policy. * @@ -309,6 +354,20 @@ public: */ result SetHeight(Control& childControl, int height); + /* + * Sets the height of the specified control with a fixed length. + * + * @since 2.1 + * + * @return An error code + * @param[in] childControl The control for which the height is set + * @param[in] height The value of the height + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG The specified @c childControl parameter is not a child of the container that owns the layout. + * @exception E_SYSTEM A system error has occurred. + */ + result SetHeight(Control& childControl, float height); + /** * Sets the height of the specified control with the fitting policy. * diff --git a/inc/FUiWindow.h b/inc/FUiWindow.h old mode 100755 new mode 100644 index 3762ff1..2ecc4f8 --- a/inc/FUiWindow.h +++ b/inc/FUiWindow.h @@ -1,306 +1,382 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUiWindow.h - * @brief This is the header file for the %Window class. - * - * This header file contains the declarations of the %Window class. - */ - -#ifndef _FUI_WINDOW_H_ -#define _FUI_WINDOW_H_ - -#include -#include -#include - -namespace Tizen { namespace Ui { namespace Animations { -class DisplayContext; -}}} - -namespace Tizen { namespace Ui -{ - -class _WindowImpl; - -/** - * @enum WindowState - * - * Defines the state of %Window. - * - * @since 2.0 - */ -enum WindowState -{ - WINDOW_STATE_INITIALIZED = 0x0000, /**< The initial state of the window */ - WINDOW_STATE_ACTIVATED = 0x0001, /**< The state indicates that the window is the topmost window */ - WINDOW_STATE_DEACTIVATED = 0x0002, /**< The state indicates that the window is not the topmost window */ -}; - -/** - * @enum WindowZOrderGroup - * - * Defines the Z order group of %Window. - * - * @since 2.0 - */ -enum WindowZOrderGroup -{ - WINDOW_Z_ORDER_GROUP_HIGHEST, /** The highest group for windows such as the call screen */ - WINDOW_Z_ORDER_GROUP_HIGH, /** The high qroup for windows such as the lock screen */ - WINDOW_Z_ORDER_GROUP_NORMAL, /** The default group of apps */ -}; - -/** - * @class Window - * @brief This class provides abstract top-level 'window' objects. - * - * @since 2.0 - * - * The %Window is a top-level window such as Controls::Frame, Controls::MessageBox, and Controls::Popup. - * The descendants of a %Window can exist outside of their applications's bounds. - * The %Window class is an abstract base class. - * - */ -class _OSP_EXPORT_ Window - : public Container -{ - -public: - /** - * This destructor overrides Tizen::Base::Object::~Object(). - * - * @since 2.0 - */ - virtual ~Window(void) = 0; - - /** - * Adds the listener instance. @n - * The added listener can listen to events on when they are fired. - * - * @since 2.0 - * - * @param[in] listener The event listener to add - * @see RemoveWindowEventListener() - */ - void AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener); - - /** - * Removes a listener instance. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * - * @param[in] listener The listener to remove - * @see AddWindowEventListener() - */ - void RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener); - - /** - * Shows the %Window. - * - * @since 2.0 - * - * @final Although this method is virtual, it should not be overridden. - * If overridden, it may not work as expected. - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * this control is not 'displayable'. - * @exception E_SYSTEM A system error has occurred. - */ - virtual result Show(void); - - /** - * Sets the owner of the window. - * - * @since 2.0 - * - * @param[in] pControl The control - * @remarks The ownership of @c pControl is not transferred to this instance. It is the developer's responsibility to deallocate @c pControl even after calling this method. - */ - void SetOwner(Tizen::Ui::Control *pControl); - - /** - * @if VISPARTNER-OPERATOR - * Sets the Z order group of %Window. - * - * @since 2.0 - * - * @visibility partner-operator - * @privilege %http://tizen.org/privilege/uimanager - * - * @return An error code - * @param[in] windowZOrderGroup The Z order group of %Window - * @exception E_SUCCESS The method is successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. - * @remarks If this method is not explicitly called, the Z order group of %Window is set to #WINDOW_Z_ORDER_GROUP_NORMAL. - * @endif - */ - result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup); - - /** - * Gets the current state of the window. - * - * @since 2.0 - * - * @return The current state of the window - */ - WindowState GetWindowState(void) const; - - /** - * Gets the display context of the window. - * - * @since 2.0 - * - * @return A pointer to the DisplayContext instance - */ - Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const; - -protected: - /** - * Initializes this instance of %Window. - * - * @since 2.0 - * - * @return An error code - * @param[in] rect The rectangle bounds to set - * @param[in] resizable Set to @c true to make the window resizable, @n - * else @c false - * @param[in] movable Set to @c true to make the window movable, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @remarks This method must be called from the derived classes's construct methods. - * @remarks If the @c resizable is @c false, IsResizable() returns @c false. - * @see IsResizable() - */ - result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); - - /** - * Initializes this instance of %Window with the specified layout and rectangular region. - * - * @since 2.0 - * - * @return An error code - * @param[in] layout The layout for both the portrait and landscape mode - * @param[in] rect The location and size of the %window - * @param[in] resizable Set to @c true to make the window resizable, @n - * else @c false - * @param[in] movable Set to @c true to make the window movable, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @remarks This method must be called from the derived classes's construct methods. - * @remarks If the @c resizable is @c false, IsResizable() returns @c false. - * @see IsResizable() - * @see Tizen::Ui::Layout - * @see Tizen::Ui::Container::GetLayoutN() - */ - result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); - - /** - * Initializes this instance of %Window with the specified layouts and rectangular region. - * - * @since 2.0 - * - * @return An error code - * @param[in] portraitLayout The layout for the portrait mode - * @param[in] landscapeLayout The layout for the landscape mode - * @param[in] rect The location and size of the %Window - * @param[in] resizable Set to @c true to make the window resizable, @n - * else @c false - * @param[in] movable Set to @c true to make the window movable, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @remarks If the @c resizable is @c false, IsResizable() returns @c false. - * @see IsResizable() - * @see Tizen::Ui::Layout - * @see Tizen::Ui::Container::GetLayoutN() - * @see Tizen::Ui::Container::GetPortraitLayoutN() - * @see Tizen::Ui::Container::GetLandscapeLayoutN() - */ - result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); - - /** - * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. - * - * @since 2.0 - */ - Window(void); - -private: - // - // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. - // - Window(const Window& rhs); - - // - // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. - // - Window& operator =(const Window& rhs); - -protected: - friend class _WindowImpl; - - // - // This method is for internal use only. Using this method can cause behavioral, - // security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Window_Reserved1(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, - // security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Window_Reserved2(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, - // security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Window_Reserved3(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, - // security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Window_Reserved4(void) {} - - // - // This method is for internal use only. Using this method can cause behavioral, - // security-related, and consistency-related issues in the application. - // - // This method is reserved and may change its name at any time without prior notice. - // - virtual void Window_Reserved5(void) {} -}; // Window - -}} // Tizen::Ui - -#endif //_FUI_WINDOW_H_ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiWindow.h + * @brief This is the header file for the %Window class. + * + * This header file contains the declarations of the %Window class. + */ + +#ifndef _FUI_WINDOW_H_ +#define _FUI_WINDOW_H_ + +#include +#include +#include + +namespace Tizen { namespace Ui { namespace Animations { +class DisplayContext; +}}} + +namespace Tizen { namespace Ui +{ + +class _WindowImpl; + +/** + * @enum WindowState + * + * Defines the state of %Window. + * + * @since 2.0 + */ +enum WindowState +{ + WINDOW_STATE_INITIALIZED = 0x0000, /**< The initial state of the window */ + WINDOW_STATE_ACTIVATED = 0x0001, /**< The state indicates that the window is the topmost window */ + WINDOW_STATE_DEACTIVATED = 0x0002, /**< The state indicates that the window is not the topmost window */ +}; + +/** + * @enum WindowZOrderGroup + * + * Defines the Z order group of %Window. + * + * @since 2.0 + */ +enum WindowZOrderGroup +{ + WINDOW_Z_ORDER_GROUP_HIGHEST, /**< The highest group for windows such as the call screen */ + WINDOW_Z_ORDER_GROUP_HIGH, /**< The high qroup for windows such as the lock screen */ + WINDOW_Z_ORDER_GROUP_NORMAL, /**< The default group of apps */ +}; + +/** + * @class Window + * @brief This class provides abstract top-level 'window' objects. + * + * @since 2.0 + * + * The %Window is a top-level window such as Controls::Frame, Controls::MessageBox, and Controls::Popup. + * The descendants of a %Window can exist outside of their applications's bounds. + * The %Window class is an abstract base class. + * + */ +class _OSP_EXPORT_ Window + : public Container +{ + +public: + /** + * This destructor overrides Tizen::Base::Object::~Object(). + * + * @since 2.0 + */ + virtual ~Window(void) = 0; + +public: + /** + * Adds the listener instance. @n + * The added listener can listen to events on when they are fired. + * + * @since 2.0 + * + * @param[in] listener The event listener to add + * @see RemoveWindowEventListener() + */ + void AddWindowEventListener(Tizen::Ui::IWindowEventListener& listener); + + /** + * Removes a listener instance. @n + * The removed listener cannot listen to events when they are fired. + * + * @since 2.0 + * + * @param[in] listener The listener to remove + * @see AddWindowEventListener() + */ + void RemoveWindowEventListener(Tizen::Ui::IWindowEventListener& listener); + + /** + * Shows the %Window. + * + * @since 2.0 + * + * @final Although this method is virtual, it should not be overridden. + * If overridden, it may not work as expected. + * + * @return An error code + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or + * this control is not 'displayable'. + * @exception E_SYSTEM A system error has occurred. + */ + virtual result Show(void); + + /** + * Sets the owner of the window. + * + * @since 2.0 + * + * @param[in] pControl The control + * @remarks The ownership of @c pControl is not transferred to this instance. It is the developer's responsibility to deallocate @c pControl even after calling this method. + */ + void SetOwner(Tizen::Ui::Control *pControl); + + /** + * Gets the owner of the window. + * + * @since 2.1 + * + * @return The owner of the window + * @see SetOwner() + */ + Tizen::Ui::Control* GetOwner(void) const; + + /** + * Sets the Z order group of %Window. + * + * @since 2.0 + * + * @privlevel platform + * @privilege http://tizen.org/privilege/uimanager + * + * @return An error code + * @param[in] windowZOrderGroup The Z order group of %Window + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @remarks If this method is not explicitly called, the Z order group of %Window is set to #WINDOW_Z_ORDER_GROUP_NORMAL. + */ + result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup); + + /** + * Gets the current state of the window. + * + * @since 2.0 + * + * @return The current state of the window + */ + WindowState GetWindowState(void) const; + + /** + * Gets the display context of the window. + * + * @since 2.0 + * + * @return A pointer to the DisplayContext instance + */ + Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const; + +protected: + /** + * Initializes this instance of %Window. + * + * @since 2.0 + * + * @return An error code + * @param[in] rect The rectangle bounds to set + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + */ + result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + + /* + * Initializes this instance of %Window. + * + * @since 2.1 + * + * @return An error code + * @param[in] rect The rectangle bounds to set + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + */ + result Construct(const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + + /** + * Initializes this instance of %Window with the specified layout and rectangular region. + * + * @since 2.0 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] rect The location and size of the %window + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + + /* + * Initializes this instance of %Window with the specified layout and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] layout The layout for both the portrait and landscape mode + * @param[in] rect The location and size of the %window + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks This method must be called from the derived classes's construct methods. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + */ + result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + + /** + * Initializes this instance of %Window with the specified layouts and rectangular region. + * + * @since 2.0 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %Window + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + * @see Tizen::Ui::Container::GetPortraitLayoutN() + * @see Tizen::Ui::Container::GetLandscapeLayoutN() + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true); + + /* + * Initializes this instance of %Window with the specified layouts and rectangular region. + * + * @since 2.1 + * + * @return An error code + * @param[in] portraitLayout The layout for the portrait mode + * @param[in] landscapeLayout The layout for the landscape mode + * @param[in] rect The location and size of the %Window + * @param[in] resizable Set to @c true to make the window resizable, @n + * else @c false + * @param[in] movable Set to @c true to make the window movable, @n + * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG A specified input parameter is invalid. + * @remarks If the @c resizable is @c false, IsResizable() returns @c false. + * @see IsResizable() + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Layout + * @see Tizen::Ui::Container::GetLayoutN() + * @see Tizen::Ui::Container::GetPortraitLayoutN() + * @see Tizen::Ui::Container::GetLandscapeLayoutN() + */ + result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, bool resizable = true, bool movable = true); + + /** + * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. + * + * @since 2.0 + */ + Window(void); + +private: + // + // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. + // + Window(const Window& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + Window& operator =(const Window& rhs); + +protected: + friend class _WindowImpl; + + // + // This method is for internal use only. Using this method can cause behavioral, + // security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Window_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, + // security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Window_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, + // security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Window_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, + // security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Window_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, + // security-related, and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void Window_Reserved5(void) {} +}; // Window + +}} // Tizen::Ui + +#endif //_FUI_WINDOW_H_ diff --git a/packaging/osp-uifw.spec b/packaging/osp-uifw.spec index c96e58a..caad97e 100755 --- a/packaging/osp-uifw.spec +++ b/packaging/osp-uifw.spec @@ -3,8 +3,8 @@ Name: osp-uifw Summary: The UI Framework library of OSP -Version: 1.2.0.0 -Release: 44 +Version: 1.2.1.0 +Release: 59 Group: TO_BE/FILLED_IN License: TO BE FILLED IN Source0: %{name}-%{version}.tar.gz @@ -26,11 +26,7 @@ BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ethumb) BuildRequires: pkgconfig(ewebkit2) BuildRequires: pkgconfig(xdamage) -%ifarch %{ix86} -BuildRequires: pkgconfig(egl) -%else BuildRequires: pkgconfig(gles20) -%endif BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(glib-2.0) @@ -38,7 +34,7 @@ BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(libdri2) BuildRequires: pkgconfig(libdrm) -BuildRequires: pkgconfig(libdrm_slp) +BuildRequires: pkgconfig(libtbm) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libwbxml2) BuildRequires: pkgconfig(osp-appfw) @@ -58,6 +54,7 @@ BuildRequires: libexif-devel BuildRequires: liblua-devel BuildRequires: libtiff-devel BuildRequires: tolua++-devel +BuildRequires: pkgconfig(feedback) # runtime requires Requires: capi-appfw-application diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn.9.png deleted file mode 100755 index 637904c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn_press.9.png deleted file mode 100755 index 72c6284..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_Title_btn_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_bg.9.png deleted file mode 100755 index 27b873b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_ef.9.png deleted file mode 100755 index 8219317..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_arrow_button_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.#.png new file mode 100755 index 0000000..449cf8d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.9.png deleted file mode 100644 index c1bf333..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.#.png new file mode 100755 index 0000000..2ac679e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.9.png deleted file mode 100644 index 776d7f5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_badge_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg.png deleted file mode 100755 index 8d0d598..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_ef.png deleted file mode 100755 index 5cbf3fe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_p_ef.png deleted file mode 100755 index 30b56ba..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_btn_circle_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01.#.png new file mode 100755 index 0000000..095e550 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_button_01.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01.9.png deleted file mode 100644 index eb0fd8b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg.9.png deleted file mode 100755 index 6e59b4a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg_p_ef.9.png deleted file mode 100755 index 9dff71e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.#.png new file mode 100755 index 0000000..0dd5acf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.9.png deleted file mode 100644 index ec4b775..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.#.png new file mode 100755 index 0000000..934658a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.9.png deleted file mode 100644 index 0e5238a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_dim.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.#.png new file mode 100755 index 0000000..ba91ca2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.9.png deleted file mode 100644 index 2285b3e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_01_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_02.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_02.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_button_02.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_button_02.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef_press.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_03.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_03.9.png deleted file mode 100644 index 71756ae..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_03_dim_ef.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_button_03_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_button_03_dim_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_dim_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_03_dim_ef.9.png deleted file mode 100644 index 4749b1f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_dim_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef.9.png deleted file mode 100644 index 4749b1f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef_press.9.png deleted file mode 100644 index 1d97aec..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_03_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_dim.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_06_dim.9.png deleted file mode 100755 index 450ed67..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_dim.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_normal.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_06_normal.9.png deleted file mode 100755 index 355f50d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_06_press.9.png deleted file mode 100755 index 2bae489..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_06_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_call.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_call.png deleted file mode 100644 index 3664975..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_call.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_call_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_call_ef.png deleted file mode 100644 index f82b727..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_call_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_cancel.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_cancel.png deleted file mode 100755 index cc6f5e2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_cancel.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel.png deleted file mode 100644 index 14141a1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel_ef.png deleted file mode 100644 index 4450f61..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_cancel_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_closed.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_closed.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus.png deleted file mode 100644 index 76582f3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus_ef.png deleted file mode 100644 index 549f0e2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_minus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_opened.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_opened.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send.png deleted file mode 100644 index 23838c2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send_ef.png deleted file mode 100644 index 38548e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_expand_send_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_info.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_info.png deleted file mode 100644 index 1e4e013..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_info.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_info_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_info_ef.png deleted file mode 100644 index 49ce801..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_info_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_left.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_left_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_left_ef.png deleted file mode 100644 index e805dd4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_left_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_minus.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_minus.png deleted file mode 100755 index 622616c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_minus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_normal.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_bg.9.png deleted file mode 100755 index 325b542..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_effect_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_effect_01.9.png deleted file mode 100755 index 87f9a6c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_normal_effect_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_off.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_off.png old mode 100644 new mode 100755 index 34e311f..b296d37 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_off.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_off.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_off_01.png deleted file mode 100755 index 8527721..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim.png old mode 100644 new mode 100755 index 5a023d4..76c0035 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim_temp.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim_temp.png deleted file mode 100644 index 5a023d4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_dim_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_temp.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_off_temp.png deleted file mode 100644 index c3d3155..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_off_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on.png old mode 100644 new mode 100755 index 4ce2e84..063d899 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_on.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_01.png deleted file mode 100755 index bfdc233..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim.png old mode 100644 new mode 100755 index 8ebea42..e661fb6 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim_temp.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim_temp.png deleted file mode 100644 index 8ebea42..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_dim_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler.png old mode 100644 new mode 100755 index 645e3b0..b6575ed Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler_dim.png new file mode 100755 index 0000000..d008646 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_off_handler_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_temp.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_on_temp.png deleted file mode 100644 index a4baf3b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_on_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_plus.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_plus.png deleted file mode 100644 index 6ba5a3b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_plus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_plus_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_plus_ef.png deleted file mode 100644 index 613b8cb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_plus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio.png old mode 100644 new mode 100755 index 64a8f27..520937c Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_dim.png old mode 100644 new mode 100755 index 7f732b2..eb7967d Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press.png old mode 100644 new mode 100755 index 789d761..756d230 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press1.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press1.png deleted file mode 100755 index ebc3620..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press1.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press2.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press2.png deleted file mode 100755 index 41e99b4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_press2.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select.png old mode 100644 new mode 100755 index d2b8556..81cdd16 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select_dim.png old mode 100644 new mode 100755 index bd87ae2..4bc8bad Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_radio_select_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_rename.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_rename.png deleted file mode 100644 index 39a9e71..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_rename.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_rename_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_rename_ef.png deleted file mode 100644 index 129dace..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_rename_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_reveal.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_reveal.png index a870d74..cbc8521 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_reveal.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_reveal.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_right.png old mode 100644 new mode 100755 index 3657da2..cbc8521 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_right.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_right_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_right_ef.png old mode 100644 new mode 100755 index adabc3d..1e62d77 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_right_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_button_right_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_01.9.png deleted file mode 100755 index 935687c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_02.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_02.9.png deleted file mode 100755 index 46e03a1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_03.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_03.9.png deleted file mode 100755 index e98ea71..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index 7335e58..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index ab83fdb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index 7666f17..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_send.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_send.png deleted file mode 100755 index 5ff5764..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_send.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_warning.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_warning.png deleted file mode 100755 index 63324dc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_warning.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_warring.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_warring.png deleted file mode 100644 index 7e63d67..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_warring.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_warring_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_warring_ef.png deleted file mode 100644 index 358c8af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_warring_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_web.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_web.9.png deleted file mode 100644 index 04eeaca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_web.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_web_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_button_web_press.9.png deleted file mode 100644 index 99b3abb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_button_web_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_bg.9.png deleted file mode 100755 index 200a7e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_button.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_button.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_category_button.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_category_button.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_button_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_button_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_category_button_focus.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_category_button_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button.png deleted file mode 100755 index 7b7a58d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button_arrow.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button_arrow.png deleted file mode 100755 index 970ca8b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_button_arrow.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_gd.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_left_gd.png deleted file mode 100755 index 7b7a58d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_left_gd.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_tab_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg.9.png deleted file mode 100755 index 27b873b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg_ef.9.png deleted file mode 100755 index 7780e93..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_panel_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button.png deleted file mode 100755 index f4b75b6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button_arrow.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button_arrow.png deleted file mode 100755 index 8d37079..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_button_arrow.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_gd.png b/res/common/usr/share/osp/bitmaps/480x800/00_category_right_gd.png deleted file mode 100755 index f4b75b6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_category_right_gd.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check.png b/res/common/usr/share/osp/bitmaps/480x800/00_check.png deleted file mode 100755 index c4b61da..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_angle.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_angle.png deleted file mode 100755 index ed0efb8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_angle.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg.png old mode 100644 new mode 100755 index bda4edf..8f64030 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_dim.png old mode 100644 new mode 100755 index 9e3331a..22fcaf4 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_press.png old mode 100644 new mode 100755 index 7f7548f..43a3e16 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_check_bg_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_checking.png old mode 100644 new mode 100755 index 79e33b4..70c9630 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking.png and b/res/common/usr/share/osp/bitmaps/480x800/00_check_checking.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_bg.png deleted file mode 100755 index 9bcb1a5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_dim.png old mode 100644 new mode 100755 index 1413cb6..bd5a9ed Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_check_checking_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_check_index_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_check_index_bg.png deleted file mode 100755 index 525e04b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_check_index_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg.png old mode 100644 new mode 100755 index ec0f376..f0b1ca4 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef.png old mode 100644 new mode 100755 index e4deabd..f8980c0 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_dim.png old mode 100644 new mode 100755 index e4deabd..052b6b4 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_press.png old mode 100644 new mode 100755 index c5751a8..ae6ee4a Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_circle_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_brightness.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_brightness.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_brightness_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_brightness_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_bg.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_left.png deleted file mode 100755 index e470403..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_right.png deleted file mode 100755 index ed6ade9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_btn_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_color.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_color.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_color_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_color_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_custom_color.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_custom_color.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_custom_color_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_custom_color_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_focus.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_focus.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_saturation.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_saturation.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_saturation_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_color_picker_saturation_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.#.png new file mode 100644 index 0000000..1765a08 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.9.png deleted file mode 100644 index 67e5718..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png new file mode 100644 index 0000000..41b3a65 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png new file mode 100644 index 0000000..6c2c34e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg.9.png deleted file mode 100755 index 99c1ed0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_01.9.png deleted file mode 100755 index dfbe205..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_effect.9.png deleted file mode 100755 index d2ace05..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom.png deleted file mode 100755 index beb51c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_01.png deleted file mode 100755 index 2b68d00..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_effect.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_effect.png deleted file mode 100755 index b965135..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_bottom_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left.png deleted file mode 100755 index 4dacb1d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_01.png deleted file mode 100755 index 7332a6e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_effect.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_effect.png deleted file mode 100755 index e930c87..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_left_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right.png deleted file mode 100755 index e6fdf99..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_01.png deleted file mode 100755 index 70f5f02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_effect.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_effect.png deleted file mode 100755 index c839d8e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_right_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top.png deleted file mode 100755 index c898ab2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_01.png deleted file mode 100755 index 3bfb34f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_effect.png b/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_effect.png deleted file mode 100755 index ee9ae22..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_context_popup_tail_top_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg.9.png deleted file mode 100755 index 62e21ca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_effect.9.png deleted file mode 100755 index 77137a2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_press_effect.9.png deleted file mode 100755 index a1cb877..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_center_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg.9.png deleted file mode 100755 index f011531..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_effect.9.png deleted file mode 100755 index 4c8f57a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_press_effect.9.png deleted file mode 100755 index 7ae5980..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_left_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg.9.png deleted file mode 100755 index de4154d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_effect.9.png deleted file mode 100755 index 966793a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_press_effect.9.png deleted file mode 100755 index a175af3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_date_picker_right_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button#5.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button#5.png deleted file mode 100755 index cdfaefa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button.png deleted file mode 100755 index cdfaefa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01.png deleted file mode 100755 index a4d932f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_dim.png deleted file mode 100755 index 725440f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_press.png deleted file mode 100755 index d7b6491..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_01_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim#1.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim#1.png deleted file mode 100755 index 9f4d74e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim#1.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim.png deleted file mode 100755 index 9f4d74e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press#3.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press#3.png deleted file mode 100755 index 17f41d6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press#3.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press.png deleted file mode 100755 index 17f41d6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_detail_button_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg.9.png deleted file mode 100755 index 4761eac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg_bar.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg_bar.9.png deleted file mode 100755 index 4dc704d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_dialogue_group_bg_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_divider_line.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_divider_line.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_divider_line.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_divider_line.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_divider_line.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_divider_line.9.png deleted file mode 100644 index 307a39f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_divider_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_divider_line_translucent.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_divider_line_translucent.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_divider_line_translucent.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_divider_line_translucent.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_bg.9.png deleted file mode 100755 index a5fba96..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_clear.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_clear.png index bf28a34..3fc6354 100644 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_clear.png and b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_clear.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_round_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_round_bg_01.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_round_bg_01.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_round_bg_01.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_squre_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_squre_bg_01.9.png deleted file mode 100644 index 9bdef0e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_squre_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_round_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_round_bg.9.png deleted file mode 100644 index a7ddf3a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_round_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_square_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_square_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_square_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_square_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_round_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_round_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg_ef.9.png deleted file mode 100755 index 30c1556..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_left.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_left_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_left_h.png new file mode 100755 index 0000000..3713091 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_left_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_right.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_right_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_right_h.png new file mode 100755 index 0000000..05301f6 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_tab_bounce_right_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_left.png new file mode 100755 index 0000000..889e352 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_right.png new file mode 100755 index 0000000..3ab0ee3 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_title_tab_bounce_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left.png new file mode 100755 index 0000000..a2e0161 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left_h.png new file mode 100755 index 0000000..a5f423f Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_left_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right.png new file mode 100755 index 0000000..04086cd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right_h.png new file mode 100755 index 0000000..7de9f46 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_effect_toolbar_tab_bounce_right_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler.#.png new file mode 100755 index 0000000..78022d5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler_h.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler_h.#.png new file mode 100755 index 0000000..5b16a18 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_handler_h.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.#.png new file mode 100755 index 0000000..2640614 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.9.png deleted file mode 100755 index d80d3fc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.#.png new file mode 100755 index 0000000..40f2e87 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.9.png deleted file mode 100755 index f06c275..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg.#.png new file mode 100755 index 0000000..97ae24d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.#.png new file mode 100755 index 0000000..97ae24d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.9.png deleted file mode 100755 index 39697b4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.#.png new file mode 100755 index 0000000..95d97b7 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.9.png deleted file mode 100755 index 8631bc1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg_line_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg.9.png deleted file mode 100755 index c2284e9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg_01.9.png deleted file mode 100755 index ab9dc9e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close.png deleted file mode 100755 index 1601390..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close_press.png deleted file mode 100755 index 8d0f692..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_close_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more.png deleted file mode 100755 index 1437796..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more_press.png deleted file mode 100755 index 2925aec..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_footer_icon_more_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check.png b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check.png index 2e90860..5115bba 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check.png and b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg.png index b7b6fc1..c04d36e 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg_press.png index ea085aa..4e5507e 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_grid_select_check_bg_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg.9.png deleted file mode 100755 index ce44719..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.#.png new file mode 100755 index 0000000..3902a48 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.9.png deleted file mode 100644 index 94dc214..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_p.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_p.9.png deleted file mode 100755 index 134d87b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_p.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg.9.png deleted file mode 100755 index a2cef7e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.#.png new file mode 100755 index 0000000..a12b5c6 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.9.png deleted file mode 100644 index 3d18daf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_bottom_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg.9.png deleted file mode 100755 index 7ecd1a1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.#.png new file mode 100755 index 0000000..c08c6cf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.9.png deleted file mode 100644 index 8123812..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_center_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_h_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_h_bg.9.png deleted file mode 100755 index 4715bbe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_h_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_input_outline_h.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_input_outline_h.9.png deleted file mode 100755 index a144a0f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_input_outline_h.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_normal_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_normal_bg.9.png deleted file mode 100755 index a65fdaf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_normal_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg.9.png deleted file mode 100755 index d6b52df..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.#.png new file mode 100755 index 0000000..8967883 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.9.png deleted file mode 100644 index 35cdd97..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_groupedlist_top_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_bg.9.png deleted file mode 100755 index dc7d9c3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_01.9.png deleted file mode 100755 index 283360a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_effect.9.png deleted file mode 100755 index 95caa23..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg.9.png deleted file mode 100755 index c1b0ae9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_effect.9.png deleted file mode 100755 index 841020e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_focus.9.png deleted file mode 100755 index 5a4f9ee..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_press_effect.9.png deleted file mode 100755 index 700c2d0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_button_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_header_title_handler.png b/res/common/usr/share/osp/bitmaps/480x800/00_header_title_handler.png deleted file mode 100755 index 082f3ca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_header_title_handler.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back.png old mode 100644 new mode 100755 index 75880ae..7e6851d Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef.png old mode 100644 new mode 100755 index da92534..f78d47d Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef_02.png old mode 100644 new mode 100755 index c2cc7f9..50ab2c0 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef_02.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_ef_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_trans_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_trans_ef.png old mode 100644 new mode 100755 index adba7cf..e30f090 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_trans_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Back_trans_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide.png new file mode 100644 index 0000000..baba885 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef.png new file mode 100644 index 0000000..a0fecb4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef_02.png new file mode 100644 index 0000000..8aba36c Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_ef_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_trans_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_trans_ef.png new file mode 100644 index 0000000..464a17d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_Hide_trans_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_back.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_back.png deleted file mode 100755 index 970619b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_back.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit.png deleted file mode 100644 index 8005ca1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit_ef.png deleted file mode 100644 index 80bc218..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_edit_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump.png index 4a9a404..518aa05 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_ef.png index 2ea1f9a..2a49304 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left.png index b7ec314..83f603f 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left_ef.png index 9d984ca..1adc04b 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_icon_jump_left_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_more.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_more.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_more_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_more_ef.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus.png deleted file mode 100644 index 1b10333..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus_ef.png deleted file mode 100644 index b910f02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_icon_plus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_iconlist_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_iconlist_bg.9.png deleted file mode 100755 index 30726b2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_iconlist_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_label_01_normal.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_label_01_normal.9.png deleted file mode 100755 index 355f50d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_label_01_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.#.png new file mode 100755 index 0000000..1b07445 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.9.png deleted file mode 100644 index 351f138..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.#.png new file mode 100755 index 0000000..7e6f6a1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.9.png deleted file mode 100644 index 90d73b9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.#.png new file mode 100755 index 0000000..9851e6d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.9.png deleted file mode 100644 index fbd5ccf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_bottom_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.#.png new file mode 100755 index 0000000..02ee1d1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.9.png deleted file mode 100644 index 23c6cf2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.#.png new file mode 100755 index 0000000..21f8d83 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.9.png deleted file mode 100644 index 4c7079f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_center_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.#.png new file mode 100755 index 0000000..8357a30 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.9.png deleted file mode 100644 index 2ae976d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.#.png new file mode 100755 index 0000000..0c93117 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.9.png deleted file mode 100644 index 44d946a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.#.png new file mode 100755 index 0000000..6e0b01f Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.9.png deleted file mode 100644 index 744ebb0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_group_bg_top_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_01.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_02.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_03.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_03.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_04.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_04.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_05.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_05.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_06.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_06.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_07.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_07.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_08.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_08.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_09.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_09.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_10.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_10.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_11.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_11.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_12.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_12.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_13.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_13.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_14.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_14.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_15.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_15.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_16.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_16.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_17.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_17.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_18.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_18.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_19.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_19.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_20.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_20.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_21.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_21.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_22.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_22.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_23.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_23.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_24.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_24.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_25.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_25.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_26.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_26.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_27.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_27.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_28.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_28.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_29.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_29.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_process_30.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_process_30.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bar.9.png deleted file mode 100755 index 191e333..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bg.9.png deleted file mode 100755 index 80d12bf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect.9.png deleted file mode 100755 index 87f9a6c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect_01.9.png deleted file mode 100755 index d0fb0dd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_list_slider_icon_bg_effect_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_on_button_controller#5.png b/res/common/usr/share/osp/bitmaps/480x800/00_on_button_controller#5.png deleted file mode 100755 index bb85e93..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_on_button_controller#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_contextual_popup_arrow.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_contextual_popup_arrow.png index 5367c6b..acc9514 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_contextual_popup_arrow.png and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_contextual_popup_arrow.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg.png old mode 100644 new mode 100755 index 6dc0020..b3302ac Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef.png old mode 100644 new mode 100755 index 35bea63..d66d67c Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef_press.png old mode 100644 new mode 100755 index 638e68d..7497d12 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p.png deleted file mode 100755 index 6c729bf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p_ef.png deleted file mode 100755 index 95ed934..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_press.png old mode 100644 new mode 100755 index dedb347..2fa1f46 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_bg_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more.png new file mode 100755 index 0000000..31b21eb Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more_press.png new file mode 100755 index 0000000..8ed5087 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_option_panel_handle_more_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_option_tray_tail_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_option_tray_tail_bg.png deleted file mode 100755 index 3d16da3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_option_tray_tail_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.#.png new file mode 100755 index 0000000..adc1cbe Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.9.png deleted file mode 100644 index 3be0788..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.#.png new file mode 100755 index 0000000..ef35de2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.9.png deleted file mode 100644 index 860463f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.#.png new file mode 100755 index 0000000..73532ed Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.9.png deleted file mode 100644 index b187aaa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.#.png new file mode 100755 index 0000000..3e608cb Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.9.png deleted file mode 100644 index 45f86a7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_panel_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_bg.9.png deleted file mode 100755 index 65a79dd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_arrow.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_arrow.png index d7f216c..1facf10 100755 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_arrow.png and b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_arrow.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.#.png new file mode 100755 index 0000000..61c9c93 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.9.png deleted file mode 100644 index 673c044..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.#.png new file mode 100755 index 0000000..a84c61b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.9.png deleted file mode 100644 index 24bf5b0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.#.png new file mode 100755 index 0000000..79195aa Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.9.png deleted file mode 100644 index b8a38ea..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_p_ef.9.png deleted file mode 100755 index 2d699a2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_panel_handle_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_panel_list_press_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.#.png new file mode 100644 index 0000000..68bae2e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.9.png deleted file mode 100755 index 4b49813..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.#.png new file mode 100644 index 0000000..7a393e1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.9.png deleted file mode 100755 index 534bf1b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_effect.9.png deleted file mode 100755 index 206b062..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bottom_bg.9.png deleted file mode 100755 index b941575..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_bottom_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_bottom_bg.png deleted file mode 100755 index 733c790..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_bottom_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_left_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_left_bg.png deleted file mode 100755 index 8dee9d8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_left_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_right_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_right_bg.png deleted file mode 100755 index 061c270..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_right_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_top_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_top_bg.png deleted file mode 100755 index ed639af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_tail_top_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_popup_title_bg.9.png deleted file mode 100755 index b4be8c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_popup_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_00.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_00.png deleted file mode 100755 index 0297d91..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_00.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_01.png deleted file mode 100755 index 3118e40..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_02.png deleted file mode 100755 index 3152a59..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_03.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_03.png deleted file mode 100755 index 7d6e2bd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_03.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_04.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_04.png deleted file mode 100755 index b7fe4c3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_04.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_05.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_05.png deleted file mode 100755 index b20cf11..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_05.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_06.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_06.png deleted file mode 100755 index 08a44fe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_06.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_07.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_07.png deleted file mode 100755 index d526460..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_07.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_08.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_08.png deleted file mode 100755 index 3d8fe4e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_08.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_09.png b/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_09.png deleted file mode 100755 index 40987ba..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_processing_ani_52x52_09.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress.9.png deleted file mode 100755 index d2062a9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_progress.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar.9.png deleted file mode 100644 index 7f8a38c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.#.png new file mode 100755 index 0000000..ab84f18 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.9.png deleted file mode 100644 index ed7f99e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bar_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.#.png new file mode 100755 index 0000000..e44943e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.9.png deleted file mode 100644 index b9550c8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_progress_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_progress_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.#.png new file mode 100755 index 0000000..d7be1ef Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.9.png deleted file mode 100644 index 8431c08..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_progress_ef_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_reorder_group_list_bg.9.png deleted file mode 100755 index a464f33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar.9.png deleted file mode 100644 index 7afa4f3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_ef.9.png deleted file mode 100644 index 6ae4958..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h.#.png new file mode 100755 index 0000000..de18575 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h_ef.#.png new file mode 100755 index 0000000..baad743 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_h_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg.9.png deleted file mode 100755 index 1a3304f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg_ef.9.png deleted file mode 100755 index 28f027d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_h.png deleted file mode 100755 index a909f20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_h.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_v.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_v.png deleted file mode 100755 index 03f3566..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_handler_v.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v.#.png new file mode 100755 index 0000000..08f12eb Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v_ef.#.png new file mode 100755 index 0000000..a7d58f1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_bar_v_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump.png deleted file mode 100755 index 2c97bc4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump_left.png b/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump_left.png deleted file mode 100755 index bb738d6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_scroll_icon_jump_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_normal.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_normal.png deleted file mode 100755 index 3bafd02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_normal.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_press.png deleted file mode 100755 index 6ae38e7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_clear_icon_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.#.png new file mode 100644 index 0000000..5dc8486 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.9.png deleted file mode 100644 index 4f20436a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.#.png new file mode 100644 index 0000000..95020f5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.9.png deleted file mode 100644 index f7de001..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_icon.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_icon.png index 6e65d5b..827470d 100644 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_icon.png and b/res/common/usr/share/osp/bitmaps/480x800/00_search_icon.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_search_icon_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_search_icon_ef.png index d8d6f54..63a9100 100644 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_search_icon_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_search_icon_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_seg_line.png b/res/common/usr/share/osp/bitmaps/480x800/00_seg_line.png deleted file mode 100755 index 316081f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_seg_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_seg_line_tr.png b/res/common/usr/share/osp/bitmaps/480x800/00_seg_line_tr.png deleted file mode 100755 index 0724911..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_seg_line_tr.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg.9.png deleted file mode 100755 index ed8a75b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg_effect.9.png deleted file mode 100755 index d064c76..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.9.png deleted file mode 100755 index 8b6592f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.png old mode 100644 new mode 100755 index 7c8f2db..bed9374 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_dim.png deleted file mode 100755 index 6ae009d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef.png old mode 100644 new mode 100755 index 0294853..d902fe5 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_dim.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_dim.png old mode 100644 new mode 100755 index 29b644a..8285673 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_dim.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_press.png old mode 100644 new mode 100755 index 7f40f25..1956e61 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_press.png deleted file mode 100755 index c9b8ed9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg.png old mode 100644 new mode 100755 index 6b43d18..d540acd Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg_ef.png old mode 100644 new mode 100755 index fa00c2c..bc34a80 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bottom_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bottom_bg.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bottom_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_popup_bottom_bg_ef.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_add.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_add.png old mode 100644 new mode 100755 index 4dc5c60..7a696ee Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_add.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_add.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_zoom.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_zoom.png old mode 100644 new mode 100755 index 3e7f540..529b6a7 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_zoom.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_icon_zoom.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg.png old mode 100644 new mode 100755 index 21fda21..62f92ae Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef.png old mode 100644 new mode 100755 index 047f5c7..15b67e3 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef_press.png old mode 100644 new mode 100755 index bbee11d..2ddddaa Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_p_ef.png deleted file mode 100755 index 8fe83a2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg.png old mode 100644 new mode 100755 index 6c81312..b12af81 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef.png old mode 100644 new mode 100755 index 192c8c2..573c8ad Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef_press.png old mode 100644 new mode 100755 index 97c21dc..c56df75 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_p_ef.png deleted file mode 100755 index eff4c33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_left_text_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg.png old mode 100644 new mode 100755 index 6551e3b..d18d35a Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef.png old mode 100644 new mode 100755 index 8f64858..73e2f23 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef_press.png old mode 100644 new mode 100755 index 4d3df0b..3f1bb50 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_p_ef.png deleted file mode 100755 index c61e577..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg.png old mode 100644 new mode 100755 index 0a03b37..bdaf914 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef.png old mode 100644 new mode 100755 index 30a9401..1c125df Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef_press.png old mode 100644 new mode 100755 index b871be6..2552186 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_p_ef.png deleted file mode 100755 index 84ea5b9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_softkey_right_text_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_h.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_h.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_h.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_h.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_v.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_v.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_v.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_v.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_h.png b/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_v.png b/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_v.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_system_control_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_system_control_bg.#.png new file mode 100644 index 0000000..c8d2714 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_system_control_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_button_press_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_arrow_button_press_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_tab_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.#.png new file mode 100755 index 0000000..25a8827 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.9.png deleted file mode 100644 index 68b47e8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_01.png deleted file mode 100755 index ceefaab..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_02.png deleted file mode 100755 index 90f6707..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_icon_more_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg.9.png deleted file mode 100755 index 20ec28f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg_ef.9.png deleted file mode 100755 index 35249f7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_move_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.#.png new file mode 100755 index 0000000..0398c09 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.9.png deleted file mode 100644 index 2635b75..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tab_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_bg_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_thumbs_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_line_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_line_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_line_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_thumbs_line_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_loading_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_loading_bg.9.png deleted file mode 100755 index cffac37..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_loading_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tick_box_normal.png b/res/common/usr/share/osp/bitmaps/480x800/00_tick_box_normal.png deleted file mode 100755 index cc03432..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_tick_box_normal.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn.9.png deleted file mode 100755 index c1b0ae9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_effect.9.png deleted file mode 100755 index 841020e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_press_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_press_effect.9.png deleted file mode 100755 index 700c2d0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_btn_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_time_picker_keypad_button_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_timepicker_number_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_number_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_timepicker_number_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_timepicker_number_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_tail.png b/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_tail.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_tail_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_tail_01.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_title_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_title_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_bg_ef.9.png deleted file mode 100755 index 662181f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg.9.png deleted file mode 100755 index 3660e91..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg_press.9.png deleted file mode 100755 index 940d14c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_btn_bg_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_button_bg_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_button_bg_press.9.png deleted file mode 100755 index 089c760..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_button_bg_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_icon_more.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_icon_more.png deleted file mode 100755 index f395cb2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_icon_more.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_title_line.png b/res/common/usr/share/osp/bitmaps/480x800/00_title_line.png deleted file mode 100755 index 30c837e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_title_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_toolbar_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_toolbar_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg.9.png deleted file mode 100755 index cf7a6be..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_ef.9.png deleted file mode 100755 index 34d0605..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_p_ef.9.png deleted file mode 100755 index 6fb1c28..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_btn_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.#.png new file mode 100755 index 0000000..36563c8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.9.png deleted file mode 100644 index 7584459..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.#.png new file mode 100755 index 0000000..012b069 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.9.png deleted file mode 100644 index fef7449..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_center.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_center.9.png deleted file mode 100644 index 2a14dc7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_left.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_left.9.png deleted file mode 100644 index 65fe1d2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_right.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_right.9.png deleted file mode 100644 index a12b54c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_bg_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_ef.9.png deleted file mode 100644 index 558a2fa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_press_ef.9.png deleted file mode 100644 index f59c8d8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_center_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.#.png new file mode 100755 index 0000000..f588027 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.9.png deleted file mode 100644 index 198294e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.#.png new file mode 100755 index 0000000..1c72730 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.9.png deleted file mode 100644 index 5f57f47..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef.9.png deleted file mode 100644 index 422b034..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef_press.9.png deleted file mode 100644 index de8934b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_left_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.#.png new file mode 100755 index 0000000..44b5c56 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.9.png deleted file mode 100644 index 34de8d2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_ef.9.png deleted file mode 100644 index 4d66dac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_press_ef.9.png deleted file mode 100644 index 5ea7c49..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_button_right_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line.png deleted file mode 100755 index 72edead..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line_01.png deleted file mode 100644 index 241ac95..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_line_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_toolbar_press.9.png rename to res/common/usr/share/osp/bitmaps/480x800/00_toolbar_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center.9.png deleted file mode 100644 index ef6633f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center_press.9.png deleted file mode 100644 index dfa75c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_center_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left.9.png deleted file mode 100644 index 8fb5561..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left_press.9.png deleted file mode 100644 index f324dca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_left_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right.9.png deleted file mode 100644 index 363f3c2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right_press.9.png deleted file mode 100644 index d524ed0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_toolbar_trans_button_right_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_transparent_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_transparent_bg.9.png deleted file mode 100755 index 1606d60..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_transparent_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar.9.png deleted file mode 100755 index 5e24eb0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar_effect.9.png deleted file mode 100755 index 678ad16..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bar_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg.9.png deleted file mode 100755 index b0b6059..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg_effect.9.png deleted file mode 100755 index 35a8b56..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_value_progress_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_normal.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_normal.9.png deleted file mode 100755 index 2197826..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_press.9.png deleted file mode 100755 index 29fa717..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_Back_btn_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_badge.9.png deleted file mode 100755 index 15d51bb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_tabbar_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_tabbar_bg.9.png deleted file mode 100755 index abccffc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_tabbar_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_toolbar_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_toolbar_bg.9.png deleted file mode 100755 index a65a4b2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_control_toolbar_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_divider_line.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_divider_line.9.png deleted file mode 100755 index 58b1438..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_divider_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01.png deleted file mode 100755 index ca83022..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01_32x32.png deleted file mode 100755 index 556fd00..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_01_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02.png deleted file mode 100755 index 39f1815..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02_32x32.png deleted file mode 100755 index e3f6661..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_02_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03.png deleted file mode 100755 index fe26b18..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03_32x32.png deleted file mode 100755 index aabd74d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_03_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04.png deleted file mode 100755 index c486331..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04_32x32.png deleted file mode 100755 index 6752381..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_04_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05.png deleted file mode 100755 index 194bf24..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05_32x32.png deleted file mode 100755 index 026bf39..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_05_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06.png deleted file mode 100755 index b9501fe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06_32x32.png deleted file mode 100755 index 76ad804..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_06_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07.png deleted file mode 100755 index 2ae3041..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07_32x32.png deleted file mode 100755 index 3ff8e86..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_07_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08.png deleted file mode 100755 index 0c0d8f4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08_32x32.png deleted file mode 100755 index 35964af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_08_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09.png deleted file mode 100755 index 767f140..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09_32x32.png deleted file mode 100755 index acc0e33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_09_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10.png deleted file mode 100755 index ebe9fee..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10_32x32.png deleted file mode 100755 index 732ab34..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_10_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11.png deleted file mode 100755 index 905a9d0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11_32x32.png deleted file mode 100755 index 5bb451a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_11_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12.png deleted file mode 100755 index 6c3dcac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12_32x32.png deleted file mode 100755 index d411a19..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_12_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13.png deleted file mode 100755 index 7712265..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13_32x32.png deleted file mode 100755 index 4df5086..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_13_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14.png deleted file mode 100755 index 459293f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14_32x32.png deleted file mode 100755 index eda2bb4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_14_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15.png deleted file mode 100755 index 1e5ed6f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15_32x32.png deleted file mode 100755 index 5a1225e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_15_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16.png deleted file mode 100755 index 3d28ca7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16_32x32.png deleted file mode 100755 index 3fb7f2b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_16_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17.png deleted file mode 100755 index 137d3ea..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17_32x32.png deleted file mode 100755 index d40c3a4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_17_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18.png deleted file mode 100755 index bb22bbc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18_32x32.png deleted file mode 100755 index b6f87c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_18_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19.png deleted file mode 100755 index de0ea44..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19_32x32.png deleted file mode 100755 index e06e91c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_19_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20.png deleted file mode 100755 index 02542e6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20_32x32.png deleted file mode 100755 index b7fea9c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_20_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21.png deleted file mode 100755 index baa770b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21_32x32.png deleted file mode 100755 index 9b953a6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_21_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22.png deleted file mode 100755 index 01f36aa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22_32x32.png deleted file mode 100755 index e4da281..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_22_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23.png deleted file mode 100755 index cb677e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23_32x32.png deleted file mode 100755 index a63c879..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_23_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24.png deleted file mode 100755 index 2a3b94e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24_32x32.png deleted file mode 100755 index d3c8964..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_24_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25.png deleted file mode 100755 index 1e875c4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25_32x32.png deleted file mode 100755 index 480b0b4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_25_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26.png deleted file mode 100755 index afd7abd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26_32x32.png deleted file mode 100755 index 73a1a83..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_26_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27.png deleted file mode 100755 index 940229a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27_32x32.png deleted file mode 100755 index c06818a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_27_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28.png deleted file mode 100755 index ce23b0d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28_32x32.png deleted file mode 100755 index 015dda9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_28_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29.png deleted file mode 100755 index b5d29fc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29_32x32.png deleted file mode 100755 index 01d8f98..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_29_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30.png deleted file mode 100755 index 762a1fe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30_32x32.png deleted file mode 100755 index 8633efe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_list_process_30_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_thumbs_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_thumbs_bg.9.png deleted file mode 100755 index 463401a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_thumbs_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_winset_title_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/00_winset_title_bg.9.png deleted file mode 100755 index 0e5ea48..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_winset_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button.9.png b/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button.9.png deleted file mode 100755 index 521b9c5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_01.9.png deleted file mode 100755 index de496ad..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_press.9.png deleted file mode 100755 index 82f66a7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/04_textinput_qwerty_button_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/Off_Background#5.png b/res/common/usr/share/osp/bitmaps/480x800/Off_Background#5.png deleted file mode 100755 index 09c9745..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/Off_Background#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/On_Background#5.png b/res/common/usr/share/osp/bitmaps/480x800/On_Background#5.png deleted file mode 100755 index 2d23ccb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/On_Background#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.9.png b/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.9.png rename to res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/TTS_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/TTS_popup_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/TTS_popup_bg.9.png rename to res/common/usr/share/osp/bitmaps/480x800/TTS_popup_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_btn_circle_bg_ef.png deleted file mode 100755 index e81ddc4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_01_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_01_bg_ef.9.png deleted file mode 100755 index 2d26162..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_01_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_edit_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_edit_bg_ef.9.png deleted file mode 100755 index 3973542..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_edit_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_bg_ef.9.png deleted file mode 100755 index e8332b1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index d115036..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index 5189da4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index 6c4dc61..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_color_picker_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_color_picker_bg.9.png deleted file mode 100755 index 9dfd622..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_color_picker_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_dialogue_group_bg_line.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_dialogue_group_bg_line.9.png deleted file mode 100755 index 18f2710..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_dialogue_group_bg_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_edit_field_bg_ef.9.png deleted file mode 100755 index 6355279..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bg_01.9.png deleted file mode 100755 index f4f94aa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bottom_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bottom_bg_01.9.png deleted file mode 100755 index 01a9880..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_bottom_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_center_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_center_bg_01.9.png deleted file mode 100755 index d03c12d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_center_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_top_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_top_bg_01.9.png deleted file mode 100755 index 35b53e4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_groupedlist_top_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_01.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_01.png new file mode 100755 index 0000000..4be8d5b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_01.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_02.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_02.png new file mode 100755 index 0000000..05cd562 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_03.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_03.png new file mode 100755 index 0000000..a82e84e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_03.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_04.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_04.png new file mode 100755 index 0000000..85f4c71 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_04.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_05.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_05.png new file mode 100755 index 0000000..819e0db Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_05.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_06.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_06.png new file mode 100755 index 0000000..5b5c549 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_06.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_07.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_07.png new file mode 100755 index 0000000..eedf863 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_07.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_08.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_08.png new file mode 100755 index 0000000..6e31104 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_08.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_09.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_09.png new file mode 100755 index 0000000..47ec1e0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_09.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_10.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_10.png new file mode 100755 index 0000000..cf10244 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_10.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_11.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_11.png new file mode 100755 index 0000000..6c5bfe4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_11.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_12.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_12.png new file mode 100755 index 0000000..b2d2884 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_12.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_13.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_13.png new file mode 100755 index 0000000..c4bee90 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_13.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_14.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_14.png new file mode 100755 index 0000000..10928e1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_14.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_15.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_15.png new file mode 100755 index 0000000..6c5f2e3 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_15.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_16.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_16.png new file mode 100755 index 0000000..9770265 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_16.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_17.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_17.png new file mode 100755 index 0000000..3dfc39c Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_17.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_18.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_18.png new file mode 100755 index 0000000..c9e31ad Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_18.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_19.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_19.png new file mode 100755 index 0000000..04cca49 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_19.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_20.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_20.png new file mode 100755 index 0000000..0eecffd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_20.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_21.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_21.png new file mode 100755 index 0000000..5f0abff Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_21.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_22.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_22.png new file mode 100755 index 0000000..019d01a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_22.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_23.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_23.png new file mode 100755 index 0000000..e881650 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_23.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_24.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_24.png new file mode 100755 index 0000000..94f3b32 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_24.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_25.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_25.png new file mode 100755 index 0000000..7845535 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_25.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_26.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_26.png new file mode 100755 index 0000000..aae8a8b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_26.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_27.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_27.png new file mode 100755 index 0000000..7545b5a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_27.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_28.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_28.png new file mode 100755 index 0000000..5730de1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_28.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_29.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_29.png new file mode 100755 index 0000000..93441db Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_29.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_30.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_30.png new file mode 100755 index 0000000..8e05398 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_header_process_30.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_icon_line.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_icon_line.png deleted file mode 100755 index 7205482..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_indexlist_icon_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_01_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_01_32x32.png deleted file mode 100644 index 556fd00..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_01_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_02_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_02_32x32.png deleted file mode 100644 index e3f6661..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_02_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_03_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_03_32x32.png deleted file mode 100644 index aabd74d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_03_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_04_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_04_32x32.png deleted file mode 100644 index 6752381..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_04_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_05_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_05_32x32.png deleted file mode 100644 index 026bf39..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_05_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_06_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_06_32x32.png deleted file mode 100644 index 76ad804..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_06_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_07_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_07_32x32.png deleted file mode 100644 index 3ff8e86..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_07_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_08_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_08_32x32.png deleted file mode 100644 index 35964af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_08_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_09_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_09_32x32.png deleted file mode 100644 index acc0e33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_09_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_10_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_10_32x32.png deleted file mode 100644 index 732ab34..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_10_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_11_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_11_32x32.png deleted file mode 100644 index 5bb451a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_11_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_12_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_12_32x32.png deleted file mode 100644 index d411a19..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_12_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_13_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_13_32x32.png deleted file mode 100644 index 4df5086..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_13_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_14_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_14_32x32.png deleted file mode 100644 index eda2bb4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_14_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_15_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_15_32x32.png deleted file mode 100644 index 5a1225e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_15_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_16_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_16_32x32.png deleted file mode 100644 index 3fb7f2b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_16_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_17_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_17_32x32.png deleted file mode 100644 index d40c3a4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_17_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_18_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_18_32x32.png deleted file mode 100644 index b6f87c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_18_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_19_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_19_32x32.png deleted file mode 100644 index e06e91c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_19_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_20_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_20_32x32.png deleted file mode 100644 index b7fea9c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_20_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_21_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_21_32x32.png deleted file mode 100644 index 9b953a6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_21_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_22_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_22_32x32.png deleted file mode 100644 index e4da281..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_22_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_23_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_23_32x32.png deleted file mode 100644 index a63c879..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_23_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_24_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_24_32x32.png deleted file mode 100644 index d3c8964..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_24_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_25_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_25_32x32.png deleted file mode 100644 index 480b0b4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_25_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_26_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_26_32x32.png deleted file mode 100644 index 73a1a83..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_26_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_27_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_27_32x32.png deleted file mode 100644 index c06818a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_27_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_28_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_28_32x32.png deleted file mode 100644 index 015dda9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_28_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_29_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_29_32x32.png deleted file mode 100644 index 01d8f98..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_29_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_30_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_30_32x32.png deleted file mode 100644 index 8633efe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_list_process_30_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bottom_bg.9.png deleted file mode 100755 index 31b9ea4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/black/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_button_bg_ef.9.png deleted file mode 100755 index 2d26162..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_button_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg.9.png deleted file mode 100755 index e8f397f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg_ef.9.png deleted file mode 100755 index 729a6b9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_popup_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_reorder_group_list_bg.9.png deleted file mode 100755 index 9f92081..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_slider_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_slider_handle_bg_ef.9.png deleted file mode 100755 index fb9e4d9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_slider_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_ef.9.png deleted file mode 100755 index 13dcf9d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_focus_ef.9.png deleted file mode 100755 index a311322..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_focus_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_line_ef.9.png deleted file mode 100755 index c3bb641..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_tab_bg_line_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_title_bg_ef.9.png deleted file mode 100755 index 9673508..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_title_btn_bg_ef.9.png deleted file mode 100755 index d115036..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_button_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_title_button_bg_ef_press.9.png deleted file mode 100755 index f7d7e75..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_button_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_option_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_title_option_btn_bg_ef.9.png deleted file mode 100755 index 9858d2d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_title_option_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_ef_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_press_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_ef_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_ef_press.9.png deleted file mode 100755 index bcd01e5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_ef.9.png deleted file mode 100755 index 054e85e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_focus_ef.9.png deleted file mode 100755 index 2031712..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_focus_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_line_ef.9.png deleted file mode 100755 index e5eb4b9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_toolbar_tab_bg_line_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_winset_badge.9.png deleted file mode 100755 index 6d21d4e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/black/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left.png deleted file mode 100755 index 863c1f6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left_press.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left_press.png deleted file mode 100755 index 7e94e5f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_left_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right.png deleted file mode 100755 index 8e6673c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right_press.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right_press.png deleted file mode 100755 index ab6b886..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Icon02_right_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_icon_search.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_icon_search.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_btn_circle_bg_ef.png deleted file mode 100755 index 51c78e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_01_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_01_bg_ef.9.png deleted file mode 100755 index 2ab934f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_01_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_edit_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_edit_bg_ef.9.png deleted file mode 100755 index 2294c60..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_edit_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_bg_ef.9.png deleted file mode 100755 index 144f0db..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index 9856e1e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index 49c6f1b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index 9b8d022..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_color_picker_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_color_picker_bg.9.png deleted file mode 100755 index 3ae794d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_color_picker_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_dialogue_group_bg_line.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_dialogue_group_bg_line.9.png deleted file mode 100755 index 107016f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_dialogue_group_bg_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_edit_field_bg_ef.9.png deleted file mode 100755 index 96a0065..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bg_01.9.png deleted file mode 100755 index 91d1279..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bottom_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bottom_bg_01.9.png deleted file mode 100755 index 7719a80..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_bottom_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_center_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_center_bg_01.9.png deleted file mode 100755 index d8a481f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_center_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_top_bg_01.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_top_bg_01.9.png deleted file mode 100755 index 046bf3a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_groupedlist_top_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_01.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_01.png new file mode 100755 index 0000000..03de112 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_01.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_02.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_02.png new file mode 100755 index 0000000..fddbed4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_03.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_03.png new file mode 100755 index 0000000..495a619 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_03.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_04.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_04.png new file mode 100755 index 0000000..6ad3e16 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_04.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_05.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_05.png new file mode 100755 index 0000000..eb7df36 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_05.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_06.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_06.png new file mode 100755 index 0000000..45e73e3 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_06.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_07.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_07.png new file mode 100755 index 0000000..a01f5b2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_07.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_08.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_08.png new file mode 100755 index 0000000..caf593c Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_08.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_09.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_09.png new file mode 100755 index 0000000..3e36e52 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_09.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_10.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_10.png new file mode 100755 index 0000000..9276c31 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_10.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_11.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_11.png new file mode 100755 index 0000000..1483421 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_11.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_12.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_12.png new file mode 100755 index 0000000..4d693af Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_12.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_13.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_13.png new file mode 100755 index 0000000..eae69b5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_13.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_14.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_14.png new file mode 100755 index 0000000..81ce61d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_14.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_15.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_15.png new file mode 100755 index 0000000..6e1eab1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_15.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_16.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_16.png new file mode 100755 index 0000000..db58fae Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_16.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_17.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_17.png new file mode 100755 index 0000000..d481932 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_17.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_18.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_18.png new file mode 100755 index 0000000..ac43b87 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_18.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_19.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_19.png new file mode 100755 index 0000000..7fc59d6 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_19.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_20.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_20.png new file mode 100755 index 0000000..20879c7 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_20.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_21.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_21.png new file mode 100755 index 0000000..535114d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_21.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_22.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_22.png new file mode 100755 index 0000000..661216f Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_22.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_23.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_23.png new file mode 100755 index 0000000..1f44014 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_23.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_24.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_24.png new file mode 100755 index 0000000..913dfce Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_24.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_25.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_25.png new file mode 100755 index 0000000..ecffbaf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_25.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_26.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_26.png new file mode 100755 index 0000000..a732c3d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_26.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_27.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_27.png new file mode 100755 index 0000000..424d8a2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_27.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_28.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_28.png new file mode 100755 index 0000000..c238d27 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_28.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_29.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_29.png new file mode 100755 index 0000000..5fa9f86 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_29.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_30.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_30.png new file mode 100755 index 0000000..4e28564 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_header_process_30.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_icon_line.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_icon_line.png deleted file mode 100755 index ac6eb1f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_indexlist_icon_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_01_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_01_32x32.png deleted file mode 100644 index 92d3686..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_01_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_02_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_02_32x32.png deleted file mode 100644 index 3cba306..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_02_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_03_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_03_32x32.png deleted file mode 100644 index 9babc31..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_03_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_04_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_04_32x32.png deleted file mode 100644 index 3c72df5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_04_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_05_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_05_32x32.png deleted file mode 100644 index bbb14cd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_05_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_06_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_06_32x32.png deleted file mode 100644 index 3719b53..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_06_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_07_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_07_32x32.png deleted file mode 100644 index 009b81f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_07_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_08_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_08_32x32.png deleted file mode 100644 index 4a32e15..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_08_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_09_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_09_32x32.png deleted file mode 100644 index aed8bf2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_09_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_10_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_10_32x32.png deleted file mode 100644 index f6f3194..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_10_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_11_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_11_32x32.png deleted file mode 100644 index 54db6c9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_11_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_12_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_12_32x32.png deleted file mode 100644 index 284b090..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_12_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_13_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_13_32x32.png deleted file mode 100644 index 09c9aa9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_13_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_14_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_14_32x32.png deleted file mode 100644 index cd075b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_14_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_15_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_15_32x32.png deleted file mode 100644 index 885030c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_15_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_16_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_16_32x32.png deleted file mode 100644 index 26a877a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_16_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_17_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_17_32x32.png deleted file mode 100644 index ff746b7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_17_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_18_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_18_32x32.png deleted file mode 100644 index 07aeffd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_18_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_19_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_19_32x32.png deleted file mode 100644 index 16a9e1b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_19_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_20_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_20_32x32.png deleted file mode 100644 index b409b03..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_20_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_21_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_21_32x32.png deleted file mode 100644 index d5de1fb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_21_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_22_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_22_32x32.png deleted file mode 100644 index fae4ddd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_22_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_23_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_23_32x32.png deleted file mode 100644 index 02d9314..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_23_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_24_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_24_32x32.png deleted file mode 100644 index ff35805..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_24_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_25_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_25_32x32.png deleted file mode 100644 index e027879..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_25_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_26_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_26_32x32.png deleted file mode 100644 index bb86e11..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_26_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_27_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_27_32x32.png deleted file mode 100644 index f2c2e5b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_27_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_28_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_28_32x32.png deleted file mode 100644 index 759af64..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_28_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_29_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_29_32x32.png deleted file mode 100644 index 42d4c29..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_29_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_30_32x32.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_30_32x32.png deleted file mode 100644 index e78bff4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_list_process_30_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.#.png new file mode 100644 index 0000000..7a393e1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.9.png deleted file mode 100755 index 68a2b9f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bottom_bg.9.png deleted file mode 100755 index 549e5ed..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_button_bg_ef.9.png deleted file mode 100755 index 2ab934f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_button_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg.9.png deleted file mode 100755 index f08f763..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg_ef.9.png deleted file mode 100755 index de65213..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_popup_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_reorder_group_list_bg.9.png deleted file mode 100755 index 8598ba7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_slider_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_slider_handle_bg_ef.9.png deleted file mode 100755 index 6cd956c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_slider_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_title_bg_ef.9.png deleted file mode 100755 index 662181f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_title_btn_bg_ef.9.png deleted file mode 100755 index fc5196f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_button_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_title_button_bg_ef_press.9.png deleted file mode 100755 index 63a0203..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_button_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_option_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_title_option_btn_bg_ef.9.png deleted file mode 100755 index 144f0db..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_title_option_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_bg_ef.9.png deleted file mode 100755 index 062aa34..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_ef_press.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_ef_press.9.png deleted file mode 100755 index 30ab16e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_press_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_press_ef.9.png deleted file mode 100755 index 30ab16e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_focus_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_focus_ef.9.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_focus_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_line_ef.9.png deleted file mode 100755 index 8ac0c42..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_toolbar_tab_bg_line_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_winset_badge.9.png deleted file mode 100755 index 5f11f65..0000000 Binary files a/res/common/usr/share/osp/bitmaps/480x800/white/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn.9.png deleted file mode 100755 index 637904c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn_press.9.png deleted file mode 100755 index 72c6284..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_Title_btn_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_button_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_button_press_ef.9.png deleted file mode 100755 index 8219317..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_button_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_left.png index 698bce9..6bdb164 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_left.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_right.png index a176c42..163a723 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_right.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_arrow_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.#.png new file mode 100755 index 0000000..8685383 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.9.png deleted file mode 100644 index 8bf6192..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.#.png new file mode 100755 index 0000000..4a425ee Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.9.png deleted file mode 100644 index 5ebfbee..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_badge_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg.png deleted file mode 100755 index 1693f7d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_ef.png deleted file mode 100755 index d249135..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_p_ef.png deleted file mode 100755 index 9d16b9c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_btn_circle_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.#.png new file mode 100755 index 0000000..48564e5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.9.png deleted file mode 100644 index eb0fd8b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg.9.png deleted file mode 100755 index 8ffbf20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg_p_ef.9.png deleted file mode 100755 index 46f901d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.#.png new file mode 100755 index 0000000..3b81648 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.9.png deleted file mode 100644 index ec4b775..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.#.png new file mode 100755 index 0000000..8304078 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.9.png deleted file mode 100644 index 0e5238a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_dim.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.#.png new file mode 100755 index 0000000..b4d1f4b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.9.png deleted file mode 100644 index 2285b3e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_01_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_02.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_02.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_button_02.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_button_02.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_button_02_ef_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_button_02_ef_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_03.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_button_03.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_button_03.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_dim_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_dim_ef.9.png deleted file mode 100644 index 4749b1f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_dim_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_ef_press.9.png deleted file mode 100644 index 1d97aec..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_03_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_dim.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_dim.9.png deleted file mode 100755 index 450ed67..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_dim.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_normal.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_normal.9.png deleted file mode 100755 index 355f50d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_press.9.png deleted file mode 100755 index 2bae489..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_06_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_call.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_call.png deleted file mode 100644 index 3664975..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_call.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_call_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_call_ef.png deleted file mode 100644 index f82b727..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_call_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_cancel.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_cancel.png deleted file mode 100755 index 4f48af4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_cancel.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel.png deleted file mode 100644 index 14141a1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel_ef.png deleted file mode 100644 index 4450f61..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_cancel_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_closed.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_closed.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus.png deleted file mode 100644 index 76582f3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus_ef.png deleted file mode 100644 index 549f0e2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_minus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_opened.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_opened.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send.png deleted file mode 100644 index 23838c2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send_ef.png deleted file mode 100644 index 38548e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_expand_send_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_info.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_info.png deleted file mode 100644 index 1e4e013..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_info.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_info_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_info_ef.png deleted file mode 100644 index 49ce801..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_info_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_left.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_left_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_left_ef.png deleted file mode 100644 index e805dd4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_left_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_minus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_minus.png deleted file mode 100755 index da42b24..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_minus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_bg.9.png deleted file mode 100755 index 325b542..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_effect_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_effect_01.9.png deleted file mode 100755 index 87f9a6c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_normal_effect_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off.png old mode 100644 new mode 100755 index da82063..065ecf1 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_01.png deleted file mode 100755 index ffa057d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim.png old mode 100644 new mode 100755 index 207fb76..48828ee Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim_temp.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim_temp.png deleted file mode 100644 index 207fb76..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_dim_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_temp.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_temp.png deleted file mode 100644 index 74cce92..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_off_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on.png old mode 100644 new mode 100755 index 7ad2614..48c4298 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_01.png deleted file mode 100755 index 35cdc63..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim.png old mode 100644 new mode 100755 index 2c0be37..3e4ccef Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim_temp.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim_temp.png deleted file mode 100644 index 2c0be37..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_dim_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler.png old mode 100644 new mode 100755 index d17f283..fe5c3e3 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler_dim.png new file mode 100755 index 0000000..ddd8955 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_off_handler_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_temp.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_temp.png deleted file mode 100644 index 88d5618..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_on_temp.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_plus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_plus.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_plus_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_plus_ef.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio.png old mode 100644 new mode 100755 index 5ab6c09..3ae8001 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_dim.png old mode 100644 new mode 100755 index a3ca80d..4e5c72f Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal1.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal1.png deleted file mode 100755 index 5295687..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal1.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal2.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal2.png deleted file mode 100755 index e80b3a8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_normal2.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_press.png deleted file mode 100644 index 8384ac0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select.png old mode 100644 new mode 100755 index 4fd17d0..304d61b Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select_dim.png deleted file mode 100644 index 1a37a82..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_radio_select_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename.png deleted file mode 100644 index 39a9e71..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename_ef.png deleted file mode 100644 index 129dace..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_rename_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_reveal.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_reveal.png index 600bc9d..fc5dbcf 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_reveal.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_reveal.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_right.png old mode 100644 new mode 100755 index 13c3c06..fc5dbcf Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_right.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_right_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_right_ef.png old mode 100644 new mode 100755 index adabc3d..d880257 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_right_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_button_right_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_01.9.png deleted file mode 100755 index 935687c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_02.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_02.9.png deleted file mode 100755 index 46e03a1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_03.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_03.9.png deleted file mode 100755 index e98ea71..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index 7335e58..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index ab83fdb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index 7666f17..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_send.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_send.png deleted file mode 100755 index 74e07e4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_send.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warning.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_warning.png deleted file mode 100755 index ac50dae..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warning.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring.png deleted file mode 100644 index 7e63d67..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring_ef.png deleted file mode 100644 index 358c8af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_warring_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_web.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_web.9.png deleted file mode 100644 index 04eeaca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_web.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_button_web_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_button_web_press.9.png deleted file mode 100644 index 99b3abb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_button_web_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_bg.9.png deleted file mode 100755 index 200a7e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.#.png new file mode 100644 index 0000000..e0bd3ec Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.9.png deleted file mode 100644 index afba73c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.#.png new file mode 100644 index 0000000..85db6ed Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.9.png deleted file mode 100644 index 29b077d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_button_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button.png deleted file mode 100755 index 7b7a58d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button_arrow.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button_arrow.png deleted file mode 100755 index 970ca8b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_button_arrow.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gd.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gd.png deleted file mode 100755 index 7b7a58d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gd.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gradation.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gradation.png index e4345f5..d496f39 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gradation.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_left_gradation.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.#.png new file mode 100644 index 0000000..b625d06 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.9.png deleted file mode 100644 index f9a37b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.#.png new file mode 100644 index 0000000..d08343a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.9.png deleted file mode 100644 index 162e8e6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_panel_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button.png deleted file mode 100755 index f4b75b6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button_arrow.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button_arrow.png deleted file mode 100755 index 8d37079..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_button_arrow.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gd.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gd.png deleted file mode 100755 index f4b75b6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gd.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gradation.png b/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gradation.png index d36d07c..bee349d 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gradation.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_category_right_gradation.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check.png deleted file mode 100755 index c4b61da..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_angle.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_angle.png deleted file mode 100755 index ed0efb8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_angle.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg.png old mode 100644 new mode 100755 index df4de40..80398ed Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_dim.png old mode 100644 new mode 100755 index edc25fe..72ced60 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_press.png old mode 100644 new mode 100755 index 693abcf..834918e Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_check_bg_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking.png old mode 100644 new mode 100755 index 92c9b4d..eae81d5 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_bg.png deleted file mode 100755 index 9bcb1a5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_dim.png old mode 100644 new mode 100755 index f04b739..4d5c284 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_check_checking_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_check_index_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_check_index_bg.png deleted file mode 100755 index 2aff1e9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_check_index_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg.png old mode 100644 new mode 100755 index 629b7d9..5aca6e1 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef.png old mode 100644 new mode 100755 index 8d81e9d..5312a28 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_dim.png old mode 100644 new mode 100755 index aeac2c2..5312a28 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_press.png old mode 100644 new mode 100755 index 53155ce..bce7779 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_circle_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_brightness.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_brightness.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_brightness_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_brightness_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_bg.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_left.png deleted file mode 100755 index b675fbd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_right.png deleted file mode 100755 index e856553..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_btn_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_color.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_color.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_color_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_color_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_custom_color.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_custom_color.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_custom_color_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_custom_color_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_focus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_focus.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_saturation.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_saturation.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_saturation_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_color_picker_saturation_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.#.png new file mode 100644 index 0000000..8d4e327 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.9.png deleted file mode 100644 index 1d49d6e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png new file mode 100644 index 0000000..622f16d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png new file mode 100644 index 0000000..a0e05a6 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg.9.png deleted file mode 100755 index 99c1ed0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_01.9.png deleted file mode 100755 index dfbe205..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_effect.9.png deleted file mode 100755 index d2ace05..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom.png deleted file mode 100755 index beb51c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_01.png deleted file mode 100755 index 2b68d00..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_effect.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_effect.png deleted file mode 100755 index b965135..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_bottom_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left.png deleted file mode 100755 index 4dacb1d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_01.png deleted file mode 100755 index 7332a6e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_effect.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_effect.png deleted file mode 100755 index e930c87..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_left_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right.png deleted file mode 100755 index e6fdf99..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_01.png deleted file mode 100755 index 70f5f02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_effect.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_effect.png deleted file mode 100755 index c839d8e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_right_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top.png deleted file mode 100755 index c898ab2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_01.png deleted file mode 100755 index 3bfb34f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_effect.png b/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_effect.png deleted file mode 100755 index ee9ae22..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_context_popup_tail_top_effect.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg.9.png deleted file mode 100755 index 62e21ca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_effect.9.png deleted file mode 100755 index 77137a2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_press_effect.9.png deleted file mode 100755 index a1cb877..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_center_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg.9.png deleted file mode 100755 index f011531..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_effect.9.png deleted file mode 100755 index 4c8f57a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_press_effect.9.png deleted file mode 100755 index 7ae5980..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_left_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg.9.png deleted file mode 100755 index de4154d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_effect.9.png deleted file mode 100755 index 966793a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_press_effect.9.png deleted file mode 100755 index a175af3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_date_picker_right_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button#5.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button#5.png deleted file mode 100755 index cdfaefa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button.png deleted file mode 100755 index cdfaefa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01.png deleted file mode 100755 index a4d932f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_dim.png deleted file mode 100755 index 725440f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_press.png deleted file mode 100755 index d7b6491..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_01_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim#1.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim#1.png deleted file mode 100755 index 9f4d74e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim#1.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim.png deleted file mode 100755 index 9f4d74e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press#3.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press#3.png deleted file mode 100755 index 17f41d6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press#3.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press.png deleted file mode 100755 index 17f41d6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_detail_button_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg.9.png deleted file mode 100755 index f9a37b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg_bar.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg_bar.9.png deleted file mode 100755 index 2ef6743..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_dialogue_group_bg_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_divider_line.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_divider_line.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_divider_line.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_divider_line.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_divider_line_translucent.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_divider_line_translucent.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_divider_line_translucent.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_divider_line_translucent.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_bg.9.png deleted file mode 100755 index a84453e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_clear.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_clear.png index e9fa197..3e1bc2a 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_clear.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_clear.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_round_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_round_bg_01.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_edit_field_line_round_bg_01.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_round_bg_01.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_squre_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_squre_bg_01.9.png deleted file mode 100644 index 9bdef0e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_line_squre_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_round_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_round_bg.9.png deleted file mode 100644 index a7ddf3a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_round_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_square_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_square_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_edit_field_no_line_square_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_no_line_square_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_round_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_edit_field_round_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_edit_field_round_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_left.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_left_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_left_h.png new file mode 100755 index 0000000..f8a0fea Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_left_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_right.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_right_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_right_h.png new file mode 100755 index 0000000..a34588e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_tab_bounce_right_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_left.png new file mode 100755 index 0000000..a737958 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_right.png new file mode 100755 index 0000000..e2161de Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_title_tab_bounce_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left.png new file mode 100755 index 0000000..638a25d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left_h.png new file mode 100755 index 0000000..07b32ea Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_left_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right.png new file mode 100755 index 0000000..501d0cc Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right_h.png new file mode 100755 index 0000000..6657de8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_effect_toolbar_tab_bounce_right_h.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler.#.png new file mode 100755 index 0000000..c8248b3 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler_h.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler_h.#.png new file mode 100755 index 0000000..7c1f6bf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_handler_h.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.#.png new file mode 100755 index 0000000..d124431 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.9.png deleted file mode 100755 index 7f44a47..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.#.png new file mode 100755 index 0000000..6d503d5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.9.png deleted file mode 100755 index 0c3bf92..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_fast_scroll_rollover_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_line_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_line_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_line_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_fast_scroll_rollover_bg_line_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg.9.png deleted file mode 100755 index c2284e9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg_01.9.png deleted file mode 100755 index ab9dc9e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_bg.9.png deleted file mode 100755 index 1513967..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef.9.png deleted file mode 100755 index b0ee9a4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef_press.9.png deleted file mode 100755 index 0767f68..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_button_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back.png deleted file mode 100755 index 8ca78b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef.png deleted file mode 100755 index 692c8ee..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef_02.png deleted file mode 100755 index 2a693f1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_Back_ef_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close.png deleted file mode 100755 index 1601390..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close_press.png deleted file mode 100755 index 8d0f692..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_close_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more.png deleted file mode 100755 index 1437796..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2.png deleted file mode 100755 index c607fdc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2_ef.png deleted file mode 100755 index 74eb55a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more2_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more_press.png deleted file mode 100755 index 2925aec..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_footer_icon_more_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg.9.png deleted file mode 100755 index 708e8e0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_01.9.png deleted file mode 100755 index 7ceaf54..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_focus.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_p.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_p.9.png deleted file mode 100755 index 134d87b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_p.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg.9.png deleted file mode 100755 index 6400ab7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_01.9.png deleted file mode 100755 index 70d64eb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_focus.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_bottom_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg.9.png deleted file mode 100755 index c1b07ed..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_01.9.png deleted file mode 100755 index 3dccf23..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_focus.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_center_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_h_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_h_bg.9.png deleted file mode 100755 index 4715bbe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_h_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_input_outline_h.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_input_outline_h.9.png deleted file mode 100755 index a144a0f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_input_outline_h.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_normal_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_normal_bg.9.png deleted file mode 100755 index a65fdaf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_normal_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg.9.png deleted file mode 100755 index 5bfed6f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_01.9.png deleted file mode 100755 index 052c224..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_focus.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_groupedlist_top_bg_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg.9.png deleted file mode 100755 index c00a6f8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg_ef.9.png deleted file mode 100755 index f5b3d4c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_badge_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg.9.png deleted file mode 100755 index dc7d9c3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_01.9.png deleted file mode 100755 index 283360a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_effect.9.png deleted file mode 100755 index 95caa23..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg.9.png deleted file mode 100755 index c1b0ae9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_effect.9.png deleted file mode 100755 index 841020e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_focus.9.png deleted file mode 100755 index 5a4f9ee..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_press_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_press_effect.9.png deleted file mode 100755 index 700c2d0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_bg_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web.9.png deleted file mode 100755 index 04eeaca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web_press.9.png deleted file mode 100755 index 99b3abb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_button_web_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit.png deleted file mode 100755 index 5b1003b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit_ef.png deleted file mode 100755 index 0abf443..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_edit_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus.png deleted file mode 100755 index 86206a6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus_ef.png deleted file mode 100755 index 312417b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_icon_plus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_tab_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_tab_press_ef.9.png deleted file mode 100755 index 6f960fd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_tab_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_header_title_handler.png b/res/common/usr/share/osp/bitmaps/720x1280/00_header_title_handler.png deleted file mode 100755 index 082f3ca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_header_title_handler.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back.png old mode 100644 new mode 100755 index 78a10cb..e43c557 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef.png old mode 100644 new mode 100755 index 4e5c784..f112661 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef_02.png old mode 100644 new mode 100755 index 17ccfa3..e9a6c7c Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef_02.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_ef_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_trans_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_trans_ef.png old mode 100644 new mode 100755 index b663c19..bdc869e Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_trans_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Back_trans_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide.png new file mode 100644 index 0000000..eccc9d2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef.png new file mode 100644 index 0000000..de75bd5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef_02.png new file mode 100644 index 0000000..b855c89 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_ef_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_trans_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_trans_ef.png new file mode 100644 index 0000000..42e8eb4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_Hide_trans_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_add.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_add.png deleted file mode 100755 index aedfb70..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_add.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_back.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_back.png deleted file mode 100755 index 49b3ba1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_back.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit.png deleted file mode 100644 index 8005ca1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit_ef.png deleted file mode 100644 index 80bc218..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_edit_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump.png index 79b8eef..fe9b4b0 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_ef.png index 222bbea..588fcef 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left.png index 57eece7..13d4593 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left_ef.png index 3b23a4f..a04e01f 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_jump_left_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_more.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_more.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_more_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_more_ef.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus.png deleted file mode 100644 index 1b10333..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus_ef.png deleted file mode 100644 index b910f02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_icon_plus_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_iconlist_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_iconlist_bg.9.png deleted file mode 100755 index 30726b2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_iconlist_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_label_01_normal.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_label_01_normal.9.png deleted file mode 100755 index 355f50d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_label_01_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.#.png new file mode 100755 index 0000000..38eaec5 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.9.png deleted file mode 100644 index 351f138..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.#.png new file mode 100755 index 0000000..17bdb80 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.9.png deleted file mode 100644 index 90d73b9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.#.png new file mode 100755 index 0000000..21c8016 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.9.png deleted file mode 100644 index fbd5ccf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_bottom_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.#.png new file mode 100755 index 0000000..6d84934 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.9.png deleted file mode 100644 index 23c6cf2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.#.png new file mode 100755 index 0000000..8318951 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.9.png deleted file mode 100644 index 4c7079f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_center_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.#.png new file mode 100755 index 0000000..6929e03 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.9.png deleted file mode 100644 index 2ae976d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.#.png new file mode 100755 index 0000000..39741d1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.9.png deleted file mode 100644 index 44d946a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.#.png new file mode 100755 index 0000000..dafa6a2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.9.png deleted file mode 100644 index 744ebb0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_bg_top_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg.#.png new file mode 100755 index 0000000..aa02025 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_bottom.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_bottom.#.png new file mode 100755 index 0000000..d2e4f9c Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_center.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_center.#.png new file mode 100755 index 0000000..f20a6f7 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_center.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_top.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_top.#.png new file mode 100755 index 0000000..f682e48 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_list_group_press_bg_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_01.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_02.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_03.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_03.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_04.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_04.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_05.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_05.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_06.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_06.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_07.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_07.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_08.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_08.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_09.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_09.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_10.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_10.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_11.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_11.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_12.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_12.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_13.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_13.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_14.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_14.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_15.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_15.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_16.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_16.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_17.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_17.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_18.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_18.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_19.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_19.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_20.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_20.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_21.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_21.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_22.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_22.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_23.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_23.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_24.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_24.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_25.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_25.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_26.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_26.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_27.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_27.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_28.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_28.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_29.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_29.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_30.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_process_30.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bar.9.png deleted file mode 100755 index 191e333..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bg.9.png deleted file mode 100755 index 80d12bf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg.9.png deleted file mode 100755 index d64969f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect.9.png deleted file mode 100755 index 87f9a6c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect_01.9.png deleted file mode 100755 index d0fb0dd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_list_slider_icon_bg_effect_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_on_button_controller#5.png b/res/common/usr/share/osp/bitmaps/720x1280/00_on_button_controller#5.png deleted file mode 100755 index bb85e93..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_on_button_controller#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_contextual_popup_arrow.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_contextual_popup_arrow.png old mode 100644 new mode 100755 index c61954e..3d375f8 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_contextual_popup_arrow.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_contextual_popup_arrow.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg.png old mode 100644 new mode 100755 index bc62f6a..a1f4216 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef.png old mode 100644 new mode 100755 index 376e9ec..26652a7 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef_press.png old mode 100644 new mode 100755 index 94b62db..2847c86 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p.png deleted file mode 100755 index 42e5229..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p_ef.png deleted file mode 100755 index e8bbaac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_press.png old mode 100644 new mode 100755 index a6ff057..fc8dc67 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_bg_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more.png new file mode 100755 index 0000000..02f79d0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more_press.png new file mode 100755 index 0000000..add43f8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_option_panel_handle_more_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg.9.png deleted file mode 100755 index f9a37b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg_ef.9.png deleted file mode 100755 index 0fb614f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_bg.png deleted file mode 100755 index a378107..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_ef.png deleted file mode 100755 index 7b1fda9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_option_tray_tail_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.#.png new file mode 100755 index 0000000..653f085 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.9.png deleted file mode 100755 index 3be0788..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.#.png new file mode 100755 index 0000000..b194c2d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.9.png deleted file mode 100755 index 860463f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.#.png new file mode 100755 index 0000000..95dc741 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.9.png deleted file mode 100755 index b187aaa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.#.png new file mode 100755 index 0000000..fa91485 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.9.png deleted file mode 100755 index 45f86a7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.#.png new file mode 100755 index 0000000..b625d06 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.9.png deleted file mode 100644 index f9a37b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_arrow.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_arrow.png old mode 100644 new mode 100755 index 06b9bce..53f8bd6 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_arrow.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_arrow.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.#.png new file mode 100755 index 0000000..b284ca0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.9.png deleted file mode 100644 index 673c044..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.#.png new file mode 100755 index 0000000..64b6d23 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.9.png deleted file mode 100644 index 24bf5b0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.#.png new file mode 100755 index 0000000..577d62a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.9.png deleted file mode 100644 index b8a38ea..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_p_ef.9.png deleted file mode 100755 index b8a38ea..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_handle_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_panel_list_press_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.#.png new file mode 100755 index 0000000..c22ea2a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.9.png deleted file mode 100755 index e63e014..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.#.png new file mode 100755 index 0000000..0d19b92 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.9.png deleted file mode 100755 index 210dbac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bottom_bg.9.png deleted file mode 100755 index b941575..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom.png new file mode 100755 index 0000000..8a651d1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_bg.png deleted file mode 100755 index 733c790..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_ef.png index 2abbadc..5c4b196 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_bottom_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left.png new file mode 100755 index 0000000..b8e5013 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_bg.png deleted file mode 100755 index 8dee9d8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_ef.png index e22a1b3..767ff1b 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_left_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right.png new file mode 100755 index 0000000..43728a9 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_bg.png deleted file mode 100755 index 061c270..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_ef.png index 0e70530..6c65724 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_right_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top.png new file mode 100755 index 0000000..e45ddbc Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_bg.png deleted file mode 100755 index ed639af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_bg.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_ef.png index fea3a6f..44a0e2a 100755 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_bubble_tail_top_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_popup_title_bg.9.png deleted file mode 100755 index b4be8c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_popup_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_00.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_00.png deleted file mode 100755 index 0297d91..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_00.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_01.png deleted file mode 100755 index 3118e40..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_02.png deleted file mode 100755 index 3152a59..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_03.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_03.png deleted file mode 100755 index 7d6e2bd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_03.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_04.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_04.png deleted file mode 100755 index b7fe4c3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_04.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_05.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_05.png deleted file mode 100755 index b20cf11..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_05.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_06.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_06.png deleted file mode 100755 index 08a44fe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_06.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_07.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_07.png deleted file mode 100755 index d526460..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_07.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_08.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_08.png deleted file mode 100755 index 3d8fe4e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_08.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_09.png b/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_09.png deleted file mode 100755 index 40987ba..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_processing_ani_52x52_09.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress.9.png deleted file mode 100755 index 4cf7aa0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.#.png new file mode 100755 index 0000000..cf14368 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.9.png deleted file mode 100644 index 2b1530d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.#.png new file mode 100755 index 0000000..2065254 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.9.png deleted file mode 100644 index 6903f94..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef_m.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef_m.9.png deleted file mode 100644 index 9914645..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_ef_m.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_m.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_m.9.png deleted file mode 100644 index 0909cdf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bar_m.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.#.png new file mode 100755 index 0000000..f8fb80c Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.9.png deleted file mode 100644 index e3d0912..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef.9.png deleted file mode 100755 index 86e2805..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.#.png new file mode 100755 index 0000000..c90f2dd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.9.png deleted file mode 100644 index 527529a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_progress_ef_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_reorder_group_list_bg.9.png deleted file mode 100755 index a464f33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar.9.png deleted file mode 100755 index 7afa4f3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_ef.9.png deleted file mode 100755 index 6ae4958..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h.#.png new file mode 100755 index 0000000..f91aa29 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h_ef.#.png new file mode 100755 index 0000000..2a15e4d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_h_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg.9.png deleted file mode 100755 index fe1e470..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg_ef.9.png deleted file mode 100755 index a72bcaa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_h.png deleted file mode 100755 index c1d9feb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_h.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_v.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_v.png deleted file mode 100755 index 4172a3d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_handler_v.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v.#.png new file mode 100755 index 0000000..a5e9875 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v_ef.#.png new file mode 100755 index 0000000..0516119 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_scroll_bar_v_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_normal.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_normal.png deleted file mode 100755 index 3bafd02..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_normal.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_press.png deleted file mode 100755 index 6ae38e7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_clear_icon_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.#.png new file mode 100644 index 0000000..4f816ee Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.9.png deleted file mode 100644 index 4f20436a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.#.png new file mode 100644 index 0000000..7e35dbf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.9.png deleted file mode 100644 index f7de001..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon.png index b70a9df..5f74b0a 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon_ef.png index 3de0d79..42161c3 100644 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_search_icon_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line.png b/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line.png deleted file mode 100755 index f90232c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line_tr.png b/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line_tr.png deleted file mode 100755 index f7404f0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_seg_line_tr.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg.9.png deleted file mode 100755 index ed8a75b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg_effect.9.png deleted file mode 100755 index d064c76..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.9.png deleted file mode 100755 index 2c6e44c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.png old mode 100644 new mode 100755 index dbecdc4..6eb4e40 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_dim.png deleted file mode 100755 index 6ae009d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_dim.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef.png old mode 100644 new mode 100755 index 1e0b804..ba5e346 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_dim.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_dim.png old mode 100644 new mode 100755 index a20c86a..4d56140 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_dim.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_dim.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_press.png old mode 100644 new mode 100755 index aa7428d..6c27fe5 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_press.png deleted file mode 100755 index c9b8ed9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_handle_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg.png old mode 100644 new mode 100755 index 4d2bfa4..4251cfe Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg_ef.png old mode 100644 new mode 100755 index ce9d94e..6db6a8b Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bottom_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bottom_bg.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bottom_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_slider_popup_bottom_bg_ef.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_add.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_add.png old mode 100644 new mode 100755 index 853af6e..40f1320 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_add.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_add.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_zoom.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_zoom.png old mode 100644 new mode 100755 index 30f593e..6296ddf Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_zoom.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_icon_zoom.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg.png old mode 100644 new mode 100755 index 08c5de1..91c8024 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef.png old mode 100644 new mode 100755 index af14e87..0e5ff98 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef_press.png old mode 100644 new mode 100755 index 6dd7068..a06eb9b Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_p_ef.png deleted file mode 100755 index 6dd7068..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg.png old mode 100644 new mode 100755 index 5312b2d..51f6eec Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef.png old mode 100644 new mode 100755 index 66f0ec5..b6c01cf Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef_press.png old mode 100644 new mode 100755 index e357173..f1966a8 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_p_ef.png deleted file mode 100755 index e357173..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_left_text_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg.png old mode 100644 new mode 100755 index 9583cee..f6ea923 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef.png old mode 100644 new mode 100755 index 8960768..b201ebf Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef_press.png old mode 100644 new mode 100755 index aa6ae7c..d166063 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_p_ef.png deleted file mode 100755 index aa6ae7c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg.png old mode 100644 new mode 100755 index 4ac1b7b..c8a3a2b Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef.png old mode 100644 new mode 100755 index 00e084c..e3fc84a Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef_press.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef_press.png old mode 100644 new mode 100755 index f8fdce7..4f8620f Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef_press.png and b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_ef_press.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_p_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_p_ef.png deleted file mode 100755 index f8fdce7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_softkey_right_text_bg_p_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_h.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_h.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_h.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_h.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_v.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_v.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_splite_handler_bg_ef_v.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_bg_ef_v.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_h.png b/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_h.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_v.png b/res/common/usr/share/osp/bitmaps/720x1280/00_splite_handler_v.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_system_control_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_system_control_bg.#.png new file mode 100644 index 0000000..c8d2714 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_system_control_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_tab_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_bg.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_tab_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_tab_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_focus.#.png old mode 100644 new mode 100755 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_tab_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_tab_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_01.png deleted file mode 100755 index a2c40da..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_02.png deleted file mode 100755 index 815969e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_icon_more_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg.9.png deleted file mode 100755 index 2cac380..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg_ef.9.png deleted file mode 100755 index f5ec79b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_move_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.#.png new file mode 100755 index 0000000..d475caf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.9.png deleted file mode 100644 index 2635b75..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tab_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_bg_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_bg_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_thumbs_bg_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_bg_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_thumbs_line_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_line_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_thumbs_line_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_line_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_loading_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_loading_bg.9.png deleted file mode 100755 index cffac37..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_thumbs_loading_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_tick_box_normal.png b/res/common/usr/share/osp/bitmaps/720x1280/00_tick_box_normal.png deleted file mode 100755 index cc03432..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_tick_box_normal.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn.9.png deleted file mode 100755 index c1b0ae9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_effect.9.png deleted file mode 100755 index 841020e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_press_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_press_effect.9.png deleted file mode 100755 index 700c2d0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_btn_press_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_time_picker_keypad_button_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_timepicker_number_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_timepicker_number_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_timepicker_number_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_timepicker_number_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_title_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_bg_ef.9.png deleted file mode 100755 index 0598ee4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg.9.png deleted file mode 100755 index 01d4943..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg_press.9.png deleted file mode 100755 index a711fca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_btn_bg_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_button_bg_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_button_bg_press.9.png deleted file mode 100755 index 036bf20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_button_bg_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_more.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_more.png deleted file mode 100755 index 3f02443..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_more.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_search.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_search.png deleted file mode 100755 index 1f09962..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_icon_search.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_line.png b/res/common/usr/share/osp/bitmaps/720x1280/00_title_line.png deleted file mode 100755 index 846d623..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_title_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_title_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_title_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg.9.png deleted file mode 100755 index 8ffbf20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef.9.png deleted file mode 100755 index 3d718cf..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef_01.9.png deleted file mode 100755 index 224c1ad..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_p_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_p_ef.9.png deleted file mode 100755 index 84edc43..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_bg_p_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_focus.9.png deleted file mode 100755 index 46f901d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_btn_focus.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.#.png new file mode 100755 index 0000000..0a1a5aa Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.9.png deleted file mode 100644 index e0a35bd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.#.png new file mode 100755 index 0000000..127df60 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.9.png deleted file mode 100644 index 30a8e1c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_center.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_center.9.png deleted file mode 100644 index 2a14dc7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_left.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_left.9.png deleted file mode 100644 index 65fe1d2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_right.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_right.9.png deleted file mode 100644 index a12b54c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_bg_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_ef.9.png deleted file mode 100644 index 558a2fa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_press_ef.9.png deleted file mode 100644 index f59c8d8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_center_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.#.png new file mode 100755 index 0000000..db0b44a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.9.png deleted file mode 100644 index 5770957..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.#.png new file mode 100755 index 0000000..dc328c4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.9.png deleted file mode 100644 index acfa1f6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef.9.png deleted file mode 100644 index 422b034..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef_press.9.png deleted file mode 100644 index de8934b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_left_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.#.png new file mode 100755 index 0000000..c0537e9 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.9.png deleted file mode 100644 index d162fd8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_ef.9.png deleted file mode 100644 index 4d66dac..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_press_ef.9.png deleted file mode 100644 index 5ea7c49..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_button_right_press_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line.png deleted file mode 100755 index 846d623..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line_01.png deleted file mode 100644 index 241ac95..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_line_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_press.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center.9.png deleted file mode 100644 index ef6633f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center_press.9.png deleted file mode 100644 index dfa75c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_center_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left.9.png deleted file mode 100644 index 8fb5561..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left_press.9.png deleted file mode 100644 index f324dca..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_left_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right.9.png deleted file mode 100644 index 363f3c2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right_press.9.png deleted file mode 100644 index d524ed0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_toolbar_trans_button_right_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_transparent_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_transparent_bg.9.png deleted file mode 100755 index 1606d60..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_transparent_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar.9.png deleted file mode 100755 index 5e24eb0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar_effect.9.png deleted file mode 100755 index 678ad16..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bar_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg.9.png deleted file mode 100755 index b0b6059..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg_effect.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg_effect.9.png deleted file mode 100755 index 35a8b56..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_value_progress_bg_effect.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_normal.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_normal.9.png deleted file mode 100755 index 2197826..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_normal.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_press.9.png deleted file mode 100755 index 29fa717..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_Back_btn_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_badge.9.png deleted file mode 100755 index e6917c7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_tabbar_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_tabbar_bg.9.png deleted file mode 100755 index abccffc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_tabbar_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_toolbar_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_toolbar_bg.9.png deleted file mode 100755 index a65a4b2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_control_toolbar_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_divider_line.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_divider_line.9.png deleted file mode 100755 index 58b1438..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_divider_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_01.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_01.png deleted file mode 100755 index 8124a7b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_01.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_02.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_02.png deleted file mode 100755 index c4428f7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_02.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_03.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_03.png deleted file mode 100755 index 33458d5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_03.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_04.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_04.png deleted file mode 100755 index b3f8ef6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_04.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_05.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_05.png deleted file mode 100755 index cb53465..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_05.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_06.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_06.png deleted file mode 100755 index 1fc9501..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_06.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_07.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_07.png deleted file mode 100755 index 1174beb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_07.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_08.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_08.png deleted file mode 100755 index 9386d3a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_08.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_09.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_09.png deleted file mode 100755 index 19c608c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_09.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_10.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_10.png deleted file mode 100755 index 72334f2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_10.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_11.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_11.png deleted file mode 100755 index 77ac2f2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_11.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_12.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_12.png deleted file mode 100755 index 466c052..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_12.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_13.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_13.png deleted file mode 100755 index d6047fc..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_13.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_14.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_14.png deleted file mode 100755 index ee0cee5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_14.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_15.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_15.png deleted file mode 100755 index 9733288..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_15.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_16.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_16.png deleted file mode 100755 index fb6b7c6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_16.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_17.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_17.png deleted file mode 100755 index 4ff8db8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_17.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_18.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_18.png deleted file mode 100755 index d1fde2d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_18.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_19.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_19.png deleted file mode 100755 index c2bb19b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_19.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_20.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_20.png deleted file mode 100755 index 50d9e81..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_20.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_21.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_21.png deleted file mode 100755 index c65fe5c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_21.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_22.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_22.png deleted file mode 100755 index b7b4443..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_22.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_23.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_23.png deleted file mode 100755 index f102b8b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_23.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_24.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_24.png deleted file mode 100755 index a47ff9b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_24.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_25.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_25.png deleted file mode 100755 index b306a07..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_25.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_26.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_26.png deleted file mode 100755 index 21af3ff..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_26.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_27.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_27.png deleted file mode 100755 index 398d438..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_27.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_28.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_28.png deleted file mode 100755 index e0721fa..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_28.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_29.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_29.png deleted file mode 100755 index 4fcda20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_29.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_30.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_30.png deleted file mode 100755 index 1c5064b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_list_process_30.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_thumbs_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_thumbs_bg.9.png deleted file mode 100755 index 463401a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_thumbs_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_title_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/00_winset_title_bg.9.png deleted file mode 100755 index 0e5ea48..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_winset_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button.9.png b/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button.9.png deleted file mode 100755 index 521b9c5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_01.9.png deleted file mode 100755 index de496ad..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_press.9.png deleted file mode 100755 index 82f66a7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/04_textinput_qwerty_button_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/Off_Background#5.png b/res/common/usr/share/osp/bitmaps/720x1280/Off_Background#5.png deleted file mode 100755 index 09c9745..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/Off_Background#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/On_Background#5.png b/res/common/usr/share/osp/bitmaps/720x1280/On_Background#5.png deleted file mode 100755 index 2d23ccb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/On_Background#5.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.9.png b/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/TTS_focus.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/TTS_popup_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/TTS_popup_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/TTS_popup_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/TTS_popup_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_btn_circle_bg_ef.png deleted file mode 100755 index 17b3c56..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_01_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_01_bg_ef.9.png deleted file mode 100755 index 271032a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_01_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_edit_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_edit_bg_ef.9.png deleted file mode 100755 index be4a1d2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_edit_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_bg_ef.9.png deleted file mode 100755 index 07685ed..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index c582427..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index 4445380..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index 3872e2c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_color_picker_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_color_picker_bg.9.png deleted file mode 100755 index 4b47c20..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_color_picker_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_dialogue_group_bg_line.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_dialogue_group_bg_line.9.png deleted file mode 100755 index e9af669..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_dialogue_group_bg_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_edit_field_bg_ef.9.png deleted file mode 100755 index 2eb59e6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bg_01.9.png deleted file mode 100755 index 61cc955..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bottom_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bottom_bg_01.9.png deleted file mode 100755 index cb8146b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_bottom_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_center_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_center_bg_01.9.png deleted file mode 100755 index ed96713..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_center_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_top_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_top_bg_01.9.png deleted file mode 100755 index 1c91af8..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_groupedlist_top_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_01.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_01.png new file mode 100755 index 0000000..bc8b3f2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_01.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_02.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_02.png new file mode 100755 index 0000000..e731ac8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_03.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_03.png new file mode 100755 index 0000000..c3cb222 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_03.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_04.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_04.png new file mode 100755 index 0000000..e538b76 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_04.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_05.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_05.png new file mode 100755 index 0000000..842d3f1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_05.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_06.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_06.png new file mode 100755 index 0000000..6901ecd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_06.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_07.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_07.png new file mode 100755 index 0000000..1fba688 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_07.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_08.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_08.png new file mode 100755 index 0000000..1f80947 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_08.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_09.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_09.png new file mode 100755 index 0000000..a70c086 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_09.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_10.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_10.png new file mode 100755 index 0000000..cc30871 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_10.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_11.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_11.png new file mode 100755 index 0000000..80b4141 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_11.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_12.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_12.png new file mode 100755 index 0000000..672ef09 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_12.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_13.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_13.png new file mode 100755 index 0000000..5a6d578 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_13.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_14.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_14.png new file mode 100755 index 0000000..77bb1a8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_14.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_15.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_15.png new file mode 100755 index 0000000..263347a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_15.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_16.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_16.png new file mode 100755 index 0000000..013d4d8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_16.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_17.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_17.png new file mode 100755 index 0000000..7710af6 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_17.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_18.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_18.png new file mode 100755 index 0000000..e526557 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_18.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_19.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_19.png new file mode 100755 index 0000000..5b13b14 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_19.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_20.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_20.png new file mode 100755 index 0000000..5092107 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_20.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_21.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_21.png new file mode 100755 index 0000000..056de67 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_21.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_22.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_22.png new file mode 100755 index 0000000..538e1cf Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_22.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_23.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_23.png new file mode 100755 index 0000000..e5ba271 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_23.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_24.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_24.png new file mode 100755 index 0000000..933f97b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_24.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_25.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_25.png new file mode 100755 index 0000000..761d563 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_25.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_26.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_26.png new file mode 100755 index 0000000..406e69e Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_26.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_27.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_27.png new file mode 100755 index 0000000..edfb337 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_27.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_28.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_28.png new file mode 100755 index 0000000..2878a56 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_28.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_29.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_29.png new file mode 100755 index 0000000..51e2744 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_29.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_30.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_30.png new file mode 100755 index 0000000..f1f81cd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_header_process_30.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_icon_line.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_icon_line.png deleted file mode 100755 index b818731..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_indexlist_icon_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_01_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_01_32x32.png deleted file mode 100644 index 556fd00..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_01_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_02_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_02_32x32.png deleted file mode 100644 index e3f6661..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_02_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_03_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_03_32x32.png deleted file mode 100644 index aabd74d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_03_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_04_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_04_32x32.png deleted file mode 100644 index 6752381..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_04_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_05_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_05_32x32.png deleted file mode 100644 index 026bf39..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_05_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_06_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_06_32x32.png deleted file mode 100644 index 76ad804..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_06_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_07_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_07_32x32.png deleted file mode 100644 index 3ff8e86..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_07_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_08_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_08_32x32.png deleted file mode 100644 index 35964af..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_08_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_09_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_09_32x32.png deleted file mode 100644 index acc0e33..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_09_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_10_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_10_32x32.png deleted file mode 100644 index 732ab34..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_10_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_11_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_11_32x32.png deleted file mode 100644 index 5bb451a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_11_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_12_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_12_32x32.png deleted file mode 100644 index d411a19..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_12_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_13_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_13_32x32.png deleted file mode 100644 index 4df5086..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_13_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_14_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_14_32x32.png deleted file mode 100644 index eda2bb4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_14_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_15_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_15_32x32.png deleted file mode 100644 index 5a1225e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_15_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_16_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_16_32x32.png deleted file mode 100644 index 3fb7f2b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_16_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_17_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_17_32x32.png deleted file mode 100644 index d40c3a4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_17_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_18_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_18_32x32.png deleted file mode 100644 index b6f87c0..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_18_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_19_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_19_32x32.png deleted file mode 100644 index e06e91c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_19_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_20_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_20_32x32.png deleted file mode 100644 index b7fea9c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_20_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_21_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_21_32x32.png deleted file mode 100644 index 9b953a6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_21_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_22_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_22_32x32.png deleted file mode 100644 index e4da281..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_22_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_23_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_23_32x32.png deleted file mode 100644 index a63c879..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_23_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_24_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_24_32x32.png deleted file mode 100644 index d3c8964..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_24_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_25_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_25_32x32.png deleted file mode 100644 index 480b0b4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_25_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_26_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_26_32x32.png deleted file mode 100644 index 73a1a83..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_26_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_27_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_27_32x32.png deleted file mode 100644 index c06818a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_27_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_28_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_28_32x32.png deleted file mode 100644 index 015dda9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_28_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_29_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_29_32x32.png deleted file mode 100644 index 01d8f98..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_29_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_30_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_30_32x32.png deleted file mode 100644 index 8633efe..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_list_process_30_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bottom_bg.9.png deleted file mode 100755 index eada0e7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_button_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_button_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_button_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_popup_title_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_reorder_group_list_bg.9.png deleted file mode 100755 index 9a78401..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_slider_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_slider_handle_bg_ef.9.png deleted file mode 100755 index 3cb951d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_slider_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_ef.9.png deleted file mode 100755 index cff4650..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_focus_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_focus_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_focus_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_line_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_line_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_tab_bg_line_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_title_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_title_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_btn_bg_ef.9.png deleted file mode 100755 index c582427..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_button_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_button_bg_ef_press.9.png deleted file mode 100755 index f5a9958..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_button_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_option_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_option_btn_bg_ef.9.png deleted file mode 100755 index a53b8a3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_title_option_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_ef_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_press_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_ef_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_ef_press.9.png deleted file mode 100755 index 7a01d37..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_ef.9.png deleted file mode 100755 index 2a00506..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_focus_ef.9.png deleted file mode 100755 index 239d83f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_focus_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_line_ef.9.png deleted file mode 100755 index 6eb92e1..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_toolbar_tab_bg_line_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_winset_badge.9.png deleted file mode 100755 index ac9ba3c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/black/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg.#.png new file mode 100755 index 0000000..ce52881 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_down.png b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_down.png new file mode 100755 index 0000000..73a50e1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_down.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_up.png b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_up.png new file mode 100755 index 0000000..8ff8fee Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/pd_btn_bg_arrow_up.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left.png deleted file mode 100755 index 863c1f6..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left_press.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left_press.png deleted file mode 100755 index 7e94e5f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_left_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right.png deleted file mode 100755 index 8e6673c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right_press.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right_press.png deleted file mode 100755 index ab6b886..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Icon02_right_press.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_icon_search.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_icon_search.png old mode 100644 new mode 100755 diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_left.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_left.png new file mode 100644 index 0000000..6bdb164 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_left.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_right.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_right.png new file mode 100644 index 0000000..163a723 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_arrow_right.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_btn_circle_bg_ef.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_btn_circle_bg_ef.png deleted file mode 100755 index 2514e2e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_btn_circle_bg_ef.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_01_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_01_bg_ef.9.png deleted file mode 100755 index bff4668..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_01_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_edit_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_edit_bg_ef.9.png deleted file mode 100755 index 4f5df27..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_edit_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_bg_ef.9.png deleted file mode 100755 index c845459..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_01.9.png deleted file mode 100755 index e8e25bb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_02.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_02.9.png deleted file mode 100755 index 09d9ff9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_02.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_03.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_03.9.png deleted file mode 100755 index c3758cd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_button_seg_f_bg_ef_03.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button.#.png new file mode 100644 index 0000000..e0bd3ec Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button_focus.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button_focus.#.png new file mode 100644 index 0000000..85db6ed Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_button_focus.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_left_gradation.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_left_gradation.png new file mode 100644 index 0000000..d496f39 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_left_gradation.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg.#.png new file mode 100644 index 0000000..b625d06 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg_ef.#.png new file mode 100644 index 0000000..d08343a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_panel_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_right_gradation.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_right_gradation.png new file mode 100644 index 0000000..bee349d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_category_right_gradation.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_color_picker_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_color_picker_bg.9.png deleted file mode 100755 index 4a33a07..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_color_picker_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_dialogue_group_bg_line.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_dialogue_group_bg_line.9.png deleted file mode 100755 index 7cfcb88..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_dialogue_group_bg_line.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_bg_ef.9.png deleted file mode 100755 index 22710ba..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_round_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_round_bg_ef.9.png deleted file mode 100755 index 30c1556..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_edit_field_round_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bg_01.9.png deleted file mode 100755 index f20e24c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bottom_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bottom_bg_01.9.png deleted file mode 100755 index 65c4668..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_bottom_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_center_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_center_bg_01.9.png deleted file mode 100755 index 3dccf23..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_center_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_top_bg_01.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_top_bg_01.9.png deleted file mode 100755 index 850352c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_groupedlist_top_bg_01.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_01.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_01.png new file mode 100755 index 0000000..e708d15 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_01.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_02.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_02.png new file mode 100755 index 0000000..1664288 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_02.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_03.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_03.png new file mode 100755 index 0000000..8a48448 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_03.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_04.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_04.png new file mode 100755 index 0000000..1e93c72 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_04.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_05.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_05.png new file mode 100755 index 0000000..b95b2b0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_05.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_06.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_06.png new file mode 100755 index 0000000..dfe7152 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_06.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_07.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_07.png new file mode 100755 index 0000000..a8bba7d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_07.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_08.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_08.png new file mode 100755 index 0000000..f72bc98 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_08.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_09.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_09.png new file mode 100755 index 0000000..f835fd4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_09.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_10.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_10.png new file mode 100755 index 0000000..16b8c3f Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_10.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_11.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_11.png new file mode 100755 index 0000000..e65b8d2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_11.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_12.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_12.png new file mode 100755 index 0000000..f731487 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_12.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_13.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_13.png new file mode 100755 index 0000000..2a6bd90 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_13.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_14.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_14.png new file mode 100755 index 0000000..89fc0b3 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_14.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_15.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_15.png new file mode 100755 index 0000000..be2ee3a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_15.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_16.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_16.png new file mode 100755 index 0000000..b5a2bf0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_16.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_17.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_17.png new file mode 100755 index 0000000..5cc2229 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_17.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_18.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_18.png new file mode 100755 index 0000000..b3dc51b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_18.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_19.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_19.png new file mode 100755 index 0000000..643af2b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_19.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_20.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_20.png new file mode 100755 index 0000000..e081091 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_20.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_21.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_21.png new file mode 100755 index 0000000..56223f0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_21.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_22.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_22.png new file mode 100755 index 0000000..1916c4a Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_22.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_23.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_23.png new file mode 100755 index 0000000..51f1fa7 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_23.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_24.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_24.png new file mode 100755 index 0000000..5149c40 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_24.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_25.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_25.png new file mode 100755 index 0000000..1261fef Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_25.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_26.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_26.png new file mode 100755 index 0000000..37d3eae Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_26.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_27.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_27.png new file mode 100755 index 0000000..16915f4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_27.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_28.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_28.png new file mode 100755 index 0000000..0a60fa0 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_28.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_29.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_29.png new file mode 100755 index 0000000..f20d4f1 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_29.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_30.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_30.png new file mode 100755 index 0000000..0598b24 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_header_process_30.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_icon_line.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_icon_line.png deleted file mode 100755 index aa04e16..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_indexlist_icon_line.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_01_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_01_32x32.png deleted file mode 100644 index 92d3686..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_01_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_02_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_02_32x32.png deleted file mode 100644 index 3cba306..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_02_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_03_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_03_32x32.png deleted file mode 100644 index 9babc31..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_03_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_04_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_04_32x32.png deleted file mode 100644 index 3c72df5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_04_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_05_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_05_32x32.png deleted file mode 100644 index bbb14cd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_05_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_06_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_06_32x32.png deleted file mode 100644 index 3719b53..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_06_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_07_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_07_32x32.png deleted file mode 100644 index 009b81f..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_07_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_08_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_08_32x32.png deleted file mode 100644 index 4a32e15..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_08_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_09_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_09_32x32.png deleted file mode 100644 index aed8bf2..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_09_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_10_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_10_32x32.png deleted file mode 100644 index f6f3194..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_10_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_11_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_11_32x32.png deleted file mode 100644 index 54db6c9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_11_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_12_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_12_32x32.png deleted file mode 100644 index 284b090..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_12_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_13_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_13_32x32.png deleted file mode 100644 index 09c9aa9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_13_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_14_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_14_32x32.png deleted file mode 100644 index cd075b3..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_14_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_15_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_15_32x32.png deleted file mode 100644 index 885030c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_15_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_16_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_16_32x32.png deleted file mode 100644 index 26a877a..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_16_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_17_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_17_32x32.png deleted file mode 100644 index ff746b7..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_17_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_18_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_18_32x32.png deleted file mode 100644 index 07aeffd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_18_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_19_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_19_32x32.png deleted file mode 100644 index 16a9e1b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_19_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_20_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_20_32x32.png deleted file mode 100644 index b409b03..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_20_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_21_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_21_32x32.png deleted file mode 100644 index d5de1fb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_21_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_22_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_22_32x32.png deleted file mode 100644 index fae4ddd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_22_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_23_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_23_32x32.png deleted file mode 100644 index 02d9314..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_23_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_24_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_24_32x32.png deleted file mode 100644 index ff35805..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_24_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_25_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_25_32x32.png deleted file mode 100644 index e027879..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_25_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_26_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_26_32x32.png deleted file mode 100644 index bb86e11..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_26_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_27_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_27_32x32.png deleted file mode 100644 index f2c2e5b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_27_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_28_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_28_32x32.png deleted file mode 100644 index 759af64..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_28_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_29_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_29_32x32.png deleted file mode 100644 index 42d4c29..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_29_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_30_32x32.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_30_32x32.png deleted file mode 100644 index e78bff4..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_list_process_30_32x32.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.#.png new file mode 100755 index 0000000..0d19b92 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.9.png deleted file mode 100755 index f19a0ab..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bottom_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bottom_bg.9.png deleted file mode 100755 index 51db12d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bottom_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bubble_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bubble_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bubble_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_bubble_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_button_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_button_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_button_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_button_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg.9.png deleted file mode 100755 index f5039fd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg_ef.9.png deleted file mode 100755 index 975da3e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_popup_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_reorder_group_list_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_reorder_group_list_bg.9.png deleted file mode 100755 index 1ad937d..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_reorder_group_list_bg.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_bg.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_bg.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_bg.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_bg.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle.9.png deleted file mode 100755 index c9f4b87..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_bg_ef.9.png deleted file mode 100755 index a9129ed..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_dim.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_dim.9.png deleted file mode 100755 index 58e701b..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_dim.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_press.9.png deleted file mode 100755 index f855145..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_slider_handle_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_bg_ef.9.png deleted file mode 100755 index d58bce5..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_btn_bg_ef.9.png deleted file mode 100755 index 1cb56fb..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_button_bg_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_button_bg_ef_press.9.png deleted file mode 100755 index 38445bd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_button_bg_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_option_btn_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_option_btn_bg_ef.9.png deleted file mode 100755 index a058b6e..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_title_option_btn_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_bg_ef.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_bg_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_bg_ef.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_press_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_ef_press.#.png similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_press_ef.9.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_ef_press.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_ef_press.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_ef_press.9.png deleted file mode 100755 index b28acd9..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_ef_press.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_ef.9.png deleted file mode 100755 index 174f94c..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_focus_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_focus_ef.9.png deleted file mode 100755 index 3c2eecd..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_focus_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_line_ef.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_line_ef.9.png deleted file mode 100755 index 4fcbcae..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_toolbar_tab_bg_line_ef.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_winset_badge.9.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_winset_badge.9.png deleted file mode 100755 index 2bdff30..0000000 Binary files a/res/common/usr/share/osp/bitmaps/720x1280/white/00_winset_badge.9.png and /dev/null differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg.#.png new file mode 100755 index 0000000..e028aaa Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_down.png b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_down.png new file mode 100755 index 0000000..da64f34 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_down.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_up.png b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_up.png new file mode 100755 index 0000000..f0d9c66 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/pd_btn_bg_arrow_up.png differ diff --git a/res/common/usr/share/osp/themes/black.xml b/res/common/usr/share/osp/themes/black.xml index 394e1ac..6631292 100755 --- a/res/common/usr/share/osp/themes/black.xml +++ b/res/common/usr/share/osp/themes/black.xml @@ -1,63 +1,69 @@ - - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -65,180 +71,211 @@ - - - - - - + + + + + + - - + + - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + diff --git a/res/common/usr/share/osp/themes/white.xml b/res/common/usr/share/osp/themes/white.xml index c66a404..0ba46e6 100755 --- a/res/common/usr/share/osp/themes/white.xml +++ b/res/common/usr/share/osp/themes/white.xml @@ -1,35 +1,41 @@ - - + + - + + + - + - + - - + + + + + + - + - + @@ -41,37 +47,37 @@ - + - + - + - + - + - + @@ -91,15 +97,19 @@ - + + + - - + + + + @@ -108,12 +118,29 @@ + + + + + + + + + + + + + + + + + - - - + + + @@ -124,7 +151,7 @@ - + @@ -135,7 +162,7 @@ - + @@ -150,39 +177,43 @@ + - + - - + + - + - - - + + + - + - + - + - + + + + - - + + @@ -201,13 +232,18 @@ + + + + - + + @@ -239,5 +275,7 @@ + + - + diff --git a/src/app/FApp_AppResourceBitmap.cpp b/src/app/FApp_AppResourceBitmap.cpp index de145f1..6e340eb 100644 --- a/src/app/FApp_AppResourceBitmap.cpp +++ b/src/app/FApp_AppResourceBitmap.cpp @@ -19,19 +19,16 @@ * @file FApp_AppResourceBitmap.cpp * @brief This is the implementation for the _AppResourceBitmap class. */ -#include #include #include #include #include -#include #include #include "FApp_AppResourceBitmap.h" #include "FApp_AppResourceBitmapUtil.h" -using namespace std; using namespace Tizen::Base; using namespace Tizen::Graphics; using namespace Tizen::Media; @@ -41,8 +38,6 @@ static const int BITMAP_PIXEL_FORMAT_INVALID = BITMAP_PIXEL_FORMAT_MIN; namespace Tizen { namespace App { -_AppResourceBitmap* _AppResourceBitmap::__pTheInstance = null; - _AppResourceBitmap::_AppResourceBitmap(void) : __pAppResourceBitmapUtil(null) { @@ -52,90 +47,27 @@ _AppResourceBitmap::~_AppResourceBitmap(void) { } -void -_AppResourceBitmap::InitAppResourceBitmap(void) -{ - if (__pTheInstance != null) - { - return; - } - - static _AppResourceBitmap instance; - result r = instance.Construct(); - SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, E_FAILURE, "[E_FAILURE] Failed to construct an _AppResourceBitmapImpl instance."); - - __pTheInstance = &instance; -} - _AppResourceBitmap* -_AppResourceBitmap::GetInstance(void) +_AppResourceBitmap::Get_AppResourceBitmapN(int type, const String& value) { - static pthread_once_t once_block = PTHREAD_ONCE_INIT; - - if (__pTheInstance == null) - { - pthread_once(&once_block, InitAppResourceBitmap); - } - return __pTheInstance; -} -_AppResourceBitmap* -_AppResourceBitmap::GetInstanceByAppId(const String& appId) -{ - _AppResourceBitmap* pAppResourceBitmap = null; + std::unique_ptr< _AppResourceBitmapUtil > pAppResourceBitmapUtil(_AppResourceBitmapUtil::GetInstanceN(type, value)); + SysTryReturn(NID_APP, pAppResourceBitmapUtil != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - pAppResourceBitmap = new (std::nothrow) _AppResourceBitmap(); - SysTryReturn(NID_APP, pAppResourceBitmap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + _AppResourceBitmap* pAppResourceBitmap = new (std::nothrow) _AppResourceBitmap(); + SysTryReturn(NID_APP, pAppResourceBitmap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - result r = pAppResourceBitmap->Construct(appId); - SysTryCatch(NID_APP, r == E_SUCCESS, , E_FAILURE, "[E_FAILURE] Failed to construct an _AppResourceBitmapImpl instance."); + pAppResourceBitmap->__pAppResourceBitmapUtil = std::move(pAppResourceBitmapUtil); return pAppResourceBitmap; - -CATCH: - delete pAppResourceBitmap; - return null; } -result -_AppResourceBitmap::Construct(void) -{ - SysAssertf(!__pAppResourceBitmapUtil, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); - - unique_ptr<_AppResourceBitmapUtil> pNewAppResourceBitmapUtil(new (std::nothrow) _AppResourceBitmapUtil()); - SysTryReturnResult(NID_APP, pNewAppResourceBitmapUtil != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - result r = pNewAppResourceBitmapUtil->Construct(); - SysTryReturnResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to construct an _AppResourceBitmapUtil instance."); - - __pAppResourceBitmapUtil = move(pNewAppResourceBitmapUtil); - - return r; -} - -result -_AppResourceBitmap::Construct(const String& appId) -{ - SysAssertf(!__pAppResourceBitmapUtil, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); - - unique_ptr<_AppResourceBitmapUtil> pNewAppResourceBitmapUtil(new (std::nothrow) _AppResourceBitmapUtil()); - SysTryReturnResult(NID_APP, pNewAppResourceBitmapUtil != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - result r = pNewAppResourceBitmapUtil->Construct(appId); - SysTryReturnResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to construct an _AppResourceBitmapUtil instance."); - - __pAppResourceBitmapUtil = move(pNewAppResourceBitmapUtil); - - return r; -} - - Bitmap* _AppResourceBitmap::GetBitmapN(const String& imageFileName, BitmapPixelFormat pixelFormat) const { ClearLastResult(); - SysTryReturn(NID_APP, imageFileName.IsEmpty() == false, null, E_INVALID_ARG, "[%s] Invalid argument is used. (imageFileName = null)", imageFileName.GetPointer()); + SysTryReturn(NID_APP, imageFileName.IsEmpty() == false, null, E_INVALID_ARG, "[%s] The specified input parameter is invalid.", imageFileName.GetPointer()); SysTryReturn(NID_APP, (pixelFormat >= BITMAP_PIXEL_FORMAT_MIN && pixelFormat < BITMAP_PIXEL_FORMAT_MAX), null, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] The image file format or specified pixel format(%d) is not supported.", pixelFormat); @@ -146,7 +78,7 @@ _AppResourceBitmap::GetBitmapN(const String& imageFileName, BitmapPixelFormat pi result r = __pAppResourceBitmapUtil->GetResourcePath(imageFileName, resourcePath, resourceDensity, imageScaling); SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - SysTryReturn(NID_APP, resourcePath.IsEmpty() == false, null, r = E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] The specified file does not exist."); + SysTryReturn(NID_APP, resourcePath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] The specified file does not exist."); // GetBitmapN @@ -171,7 +103,6 @@ _AppResourceBitmap::GetBitmapN(const String& imageFileName, BitmapPixelFormat pi SysLog(NID_APP, "The current value of bitmap path is %S(%S) and pixel format is %d", resourcePath.GetPointer(), imageScaling?L"scaled":L"not scaled", pixelFormat); - r = GetLastResult(); SysTryReturn(NID_APP, pBitmap != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -184,17 +115,13 @@ _AppResourceBitmap::GetBitmapN(const String& imageFileName, BitmapPixelFormat pi extern "C" { #endif -_OSP_EXPORT_ Tizen::App::_IAppResourceBitmap* -_Create_IAppResourceBitmapInstanceN(void) -{ - return Tizen::App::_AppResourceBitmap::GetInstance(); -} _OSP_EXPORT_ Tizen::App::_IAppResourceBitmap* -_Create_IAppResourceBitmapInstanceByAppIdN(const String& appId) +_Create_IAppResourceBitmapInstanceN(int type = Tizen::App::_AppResourceBitmapUtil::APP_RESOURCE_DEFAULT, const String& value = L"") { - return Tizen::App::_AppResourceBitmap::GetInstanceByAppId(appId); + return Tizen::App::_AppResourceBitmap::Get_AppResourceBitmapN(type, value); } + #ifdef __cplusplus } #endif diff --git a/src/app/FApp_AppResourceBitmap.h b/src/app/FApp_AppResourceBitmap.h index 80b494c..2f1547a 100644 --- a/src/app/FApp_AppResourceBitmap.h +++ b/src/app/FApp_AppResourceBitmap.h @@ -32,6 +32,7 @@ namespace Tizen { namespace App { + class _AppResourceBitmapUtil; class _AppResourceBitmap @@ -66,9 +67,7 @@ public: */ virtual Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& imagePath, Tizen::Graphics::BitmapPixelFormat pixelFormat) const; - static _AppResourceBitmap* GetInstance(void); - - static _AppResourceBitmap* GetInstanceByAppId(const Tizen::Base::String& appId); + static _AppResourceBitmap* Get_AppResourceBitmapN(int type, const Tizen::Base::String& value); private: /** @@ -87,24 +86,13 @@ private: virtual ~_AppResourceBitmap(void); /** - * Initializes this instance of _AppResourceBitmap. - */ - result Construct(void); - - result Construct(const Tizen::Base::String& appId); - - /** * This is the assignment operator for this class. */ _AppResourceBitmap& operator =(const _AppResourceBitmap& rhs); - static void InitAppResourceBitmap(void); - private: std::unique_ptr<_AppResourceBitmapUtil> __pAppResourceBitmapUtil; - static _AppResourceBitmap* __pTheInstance; - }; // _AppResourceBitmap }} // Tizen::App diff --git a/src/app/FApp_AppResourceBitmapUtil.cpp b/src/app/FApp_AppResourceBitmapUtil.cpp index 0c2fb17..0d385b5 100644 --- a/src/app/FApp_AppResourceBitmapUtil.cpp +++ b/src/app/FApp_AppResourceBitmapUtil.cpp @@ -22,7 +22,6 @@ #include -#include #include #include #include @@ -30,11 +29,12 @@ #include #include #include -#include "FAppPkg_PackageInfoImpl.h" +#include + #include "FApp_AppInfo.h" +#include "FAppPkg_PackageInfoImpl.h" #include "FApp_AppResourceBitmapUtil.h" -using namespace std; using namespace Tizen::App::Package; using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -92,84 +92,57 @@ _AppResourceBitmapUtil::~_AppResourceBitmapUtil(void) { } -result -_AppResourceBitmapUtil::Construct(void) +_AppResourceBitmapUtil* +_AppResourceBitmapUtil::GetInstanceN(int type, const String& value) { - int deviceDPI = 0; - result r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.dpi", deviceDPI); - SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Failed to get Screen DPI", GetErrorMessage(r)); - - // 1. Get directory path matched device's resolution (e.g.720x1280) - if (GetDirectoryPath(DENSITY_NONE, __resolutionDirectories) == false) - { - __resolutionDirectories = L""; - SysLog(NID_APP, "Failed to get a Device Resolution Directory path"); - } - - // 2. Get screen density & directory path matched device's DPI (e.g.screen-density-xhigh) - if (deviceDPI >= DPI_FOR_XHIGH) - { - __sortedDensity[0] = DENSITY_XHIGH; - } - else if (deviceDPI >= DPI_FOR_HIGH) - { - __sortedDensity[0] = DENSITY_HIGH; - } - else if (deviceDPI >= DPI_FOR_MIDDLE) - { - __sortedDensity[0] = DENSITY_MIDDLE; - } - else if (deviceDPI < DPI_FOR_MIDDLE && deviceDPI >= DPI_FOR_LOW) - { - __sortedDensity[0] = DENSITY_LOW; - } - else - { - __sortedDensity[0] = DENSITY_XHIGH; - SysLog(NID_APP, "Failed to get a Device Density (DPI = %d)", deviceDPI); - } + String resourceFolder(L""); - if (GetDirectoryPath(__sortedDensity[0], __sortedDensityDirectories[0]) == false) + switch(type) { - __sortedDensityDirectories[0] = L""; - SysLog(NID_APP, "Failed to get a Device Density Directory path"); - } - - // 3. Get screen density & directory path with fall back system (XHIGH-HIGH-MIDDLE-LOW) - int densityIndex = 1; - - for (int currentDensity = DENSITY_XHIGH; currentDensity >= DENSITY_LOW; currentDensity--) - { - SysAssert(densityIndex > DENSITY_NONE && densityIndex < DENSITY_MAX); - - if (static_cast(__sortedDensity[0]) == currentDensity) + case _AppResourceBitmapUtil::APP_RESOURCE_DEFAULT: + //fall through + case _AppResourceBitmapUtil::APP_RESOURCE_BY_LIBRARY_NAME: + //fall through + default: + resourceFolder = _AppInfo::GetAppRootPath(); + resourceFolder.Append(L"res/"); + if (!value.IsEmpty()) { - continue; + resourceFolder.Append(value); + resourceFolder.Append(L'/'); } + break; - __sortedDensity[densityIndex] = static_cast<_Density>(currentDensity); + case _AppResourceBitmapUtil::APP_RESOURCE_BY_APP_ID: + std::unique_ptr< PackageInfo> pPkgInfo(_PackageManagerImpl::GetInstance()->GetPackageInfoN(value)); + SysTryReturn(NID_APP, pPkgInfo != null, null, E_APP_NOT_INSTALLED, "[E_APP_NOT_INSTALLED] Failed to get the package info."); - if (GetDirectoryPath(__sortedDensity[densityIndex], __sortedDensityDirectories[densityIndex]) == false) - { - __sortedDensityDirectories[densityIndex] = L""; - SysLog(NID_APP, "Failed to get a %dth Fall-Back Directory path", densityIndex); - } + _PackageInfoImpl* pPkgInfoImpl = _PackageInfoImpl::GetInstance(pPkgInfo.get()); + SysTryReturn(NID_APP, pPkgInfoImpl != null, null, E_APP_NOT_INSTALLED, "[E_APP_NOT_INSTALLED] Failed to get the package info impl."); - densityIndex++; + resourceFolder = pPkgInfoImpl->GetAppRootPath(); + resourceFolder.Append(L"/res/"); + break; } - return r; + std::unique_ptr< _AppResourceBitmapUtil > pAppResourceBitmapUtil(new (std::nothrow) _AppResourceBitmapUtil()); + SysTryReturn(NID_APP, pAppResourceBitmapUtil != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient." ); + + result r = pAppResourceBitmapUtil->Construct(resourceFolder); + SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] Failed to construct _AppResourceBitmapUtil.", GetErrorMessage(r)); + + return pAppResourceBitmapUtil.release(); } result -_AppResourceBitmapUtil::Construct(const String& appId) +_AppResourceBitmapUtil::Construct(const String& resourceFolder) { int deviceDPI = 0; result r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.dpi", deviceDPI); SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Failed to get Screen DPI", GetErrorMessage(r)); // 1. Get directory path matched device's resolution (e.g.720x1280) - if (GetDirectoryPath(DENSITY_NONE, __resolutionDirectories, appId) == false) + if (GetDirectoryPath(resourceFolder, DENSITY_NONE, __resolutionDirectories) == false) { __resolutionDirectories = L""; SysLog(NID_APP, "Failed to get a Device Resolution Directory path"); @@ -198,7 +171,7 @@ _AppResourceBitmapUtil::Construct(const String& appId) SysLog(NID_APP, "Failed to get a Device Density (DPI = %d)", deviceDPI); } - if (GetDirectoryPath(__sortedDensity[0], __sortedDensityDirectories[0], appId) == false) + if (GetDirectoryPath(resourceFolder, __sortedDensity[0], __sortedDensityDirectories[0]) == false) { __sortedDensityDirectories[0] = L""; SysLog(NID_APP, "Failed to get a Device Density Directory path"); @@ -218,7 +191,7 @@ _AppResourceBitmapUtil::Construct(const String& appId) __sortedDensity[densityIndex] = static_cast<_Density>(currentDensity); - if (GetDirectoryPath(__sortedDensity[densityIndex], __sortedDensityDirectories[densityIndex], appId) == false) + if (GetDirectoryPath(resourceFolder, __sortedDensity[densityIndex], __sortedDensityDirectories[densityIndex]) == false) { __sortedDensityDirectories[densityIndex] = L""; SysLog(NID_APP, "Failed to get a %dth Fall-Back Directory path", densityIndex); @@ -232,80 +205,8 @@ _AppResourceBitmapUtil::Construct(const String& appId) // Get Resource DirectoryPath bool -_AppResourceBitmapUtil::GetDirectoryPath(const _Density resourceDirectory, String& dirPath) const +_AppResourceBitmapUtil::GetDirectoryPath(const String& homePath, const _Density resourceDirectory, String& dirPath) const { - const String& homePath(_AppInfo::GetAppRootPath() + L"res/"); - - switch (resourceDirectory) - { - case DENSITY_NONE: - switch (__physicalResolutionDim.width) - { - case 720: - dirPath = L"720x1280"; - break; - - case 480: - dirPath = L"480x800"; - break; - - case 240: - dirPath = L"240x400"; - break; - - case 320: - dirPath = L"320x480"; - break; - - default: - break; - } - break; - - case DENSITY_XHIGH: - dirPath = L"screen-density-xhigh"; - break; - - case DENSITY_HIGH: - dirPath = L"screen-density-high"; - break; - - case DENSITY_MIDDLE: - dirPath = L"screen-density-middle"; - break; - - case DENSITY_LOW: - dirPath = L"screen-density-low"; - break; - - default: - dirPath = L'\0'; - return false; - } - - result r = dirPath.Insert(homePath, 0); - SysTryReturn(NID_APP, r == E_SUCCESS, false, r, "[%s] Failed to insert string.", GetErrorMessage(r)); - - if ( File::IsFileExist(dirPath) == false ) - { - dirPath = L'\0'; - return false; - } - return true; -} - -bool -_AppResourceBitmapUtil::GetDirectoryPath(const _Density resourceDirectory, String& dirPath, const String& appId) const -{ - PackageInfo* pPkgInfo = null; - pPkgInfo = _PackageManagerImpl::GetInstance()->GetPackageInfoN(appId); - _PackageInfoImpl* pPkgInfoImpl = _PackageInfoImpl::GetInstance(pPkgInfo); - SysTryReturn(NID_APP, pPkgInfoImpl != null, false, E_APP_NOT_INSTALLED, "[E_APP_NOT_INSTALLED] Failed to create the package info instance"); - - const String& homePath(pPkgInfoImpl->GetAppRootPath() + L"/res/"); - - delete pPkgInfo; - switch (resourceDirectory) { case DENSITY_NONE: @@ -368,9 +269,9 @@ _AppResourceBitmapUtil::GetDirectoryPath(const _Density resourceDirectory, Strin bool _AppResourceBitmapUtil::GetFilePath(const String& directoryPath, const String& fileName, String& filePath) const { - if (directoryPath == null) + if (directoryPath == L"") { - filePath = null; + filePath = L""; return false; } @@ -378,7 +279,6 @@ _AppResourceBitmapUtil::GetFilePath(const String& directoryPath, const String& f SysAssert(normalizedPseudoPath.StartsWith(L"/", 0)); filePath = directoryPath + normalizedPseudoPath; - return true; } @@ -405,6 +305,15 @@ _AppResourceBitmapUtil::GetResourcePath(const String& fileName, String& resource { result r = E_SUCCESS; + // 0. Try to check nine patch image + bool isNinePatchImage = false; + + if (_BitmapImpl::HasNinePatchedBitmapTag(fileName)) + { + isNinePatchImage = true; + SysLog(NID_APP, "%S is nine patch image", fileName.GetPointer()); + } + // 1. Try to search resolution Folder String resourcePathForResolution(L""); @@ -432,7 +341,7 @@ _AppResourceBitmapUtil::GetResourcePath(const String& fileName, String& resource { resourcePath = resourcePathForDensity; resourceDensity = __sortedDensity[0]; - imageScaling = _CoordinateSystem::GetInstance()->IsTransformEnabled(); + imageScaling = isNinePatchImage ? false : _CoordinateSystem::GetInstance()->IsTransformEnabled(); r = E_SUCCESS; return r; @@ -452,7 +361,7 @@ _AppResourceBitmapUtil::GetResourcePath(const String& fileName, String& resource { resourcePath = alternativeResourcePath; resourceDensity = __sortedDensity[fallbackIndex]; - imageScaling = true; + imageScaling = !isNinePatchImage; r = E_SUCCESS; return r; @@ -462,13 +371,14 @@ _AppResourceBitmapUtil::GetResourcePath(const String& fileName, String& resource } SysTryReturn(NID_APP, r == E_SUCCESS, E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] The specified file cannot be found."); + return r; } // GetBitmapN Bitmap* _AppResourceBitmapUtil::GetBitmapN(const String& resourcePath, const _Density resourceDensity, - BitmapPixelFormat pixelFormat, bool imageScaling, const Color* pChromaKeyColor) const + BitmapPixelFormat pixelFormat, bool imageScaling, const Color* pChromaKeyColor) const { ClearLastResult(); SysTryReturn(NID_APP, (pixelFormat > BITMAP_PIXEL_FORMAT_MIN && pixelFormat < BITMAP_PIXEL_FORMAT_MAX), null, @@ -476,7 +386,7 @@ _AppResourceBitmapUtil::GetBitmapN(const String& resourcePath, const _Density re result r = E_SUCCESS; - unique_ptr pBitmap; + std::unique_ptr pBitmap; if (!pChromaKeyColor && imageScaling == false) // NonScaling { @@ -537,11 +447,12 @@ _AppResourceBitmapUtil::GetBitmapN(const String& resourcePath, const _Density re SysTryReturn(NID_APP, pXformer != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - Dimension baseImageSize = pXformer->Transform(Dimension(imageWidth, imageHeight)); + FloatDimension physicalImageDim = _CoordinateSystemUtils::ConvertToFloat(Dimension(imageWidth, imageHeight)); + FloatDimension logicalImageSize = pXformer->Transform(physicalImageDim); r = GetLastResult(); SysTryReturn(NID_APP, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); - r = pBitmap->Scale(baseImageSize); + r = pBitmap->Scale(logicalImageSize); SysTryReturn(NID_APP, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); } diff --git a/src/app/FApp_AppResourceBitmapUtil.h b/src/app/FApp_AppResourceBitmapUtil.h index c540274..f8181f6 100644 --- a/src/app/FApp_AppResourceBitmapUtil.h +++ b/src/app/FApp_AppResourceBitmapUtil.h @@ -58,24 +58,24 @@ public: DENSITY_MAX = 4 }; - // + enum AppResourceBy + { + APP_RESOURCE_DEFAULT, + APP_RESOURCE_BY_APP_ID, + APP_RESOURCE_BY_LIBRARY_NAME + }; + // This is the default constructor for this class. - // _AppResourceBitmapUtil(void); - /** - * This is the destructor for this class. - */ + // This is the destructor for this class. virtual ~_AppResourceBitmapUtil(void); - result Construct(void); - - result Construct(const Tizen::Base::String& appId); + //Get device's DPI, application's logical resolution and set fall back system + result Construct(const Tizen::Base::String& resourceFolder); // Generates the directory path from the specified resolution. - bool GetDirectoryPath(_Density resourceDirectory, Tizen::Base::String& dirPath) const; - - bool GetDirectoryPath(_Density resourceDirectory, Tizen::Base::String& dirPath, const Tizen::Base::String& appId) const; + bool GetDirectoryPath(const Tizen::Base::String& homePath, _Density resourceDirectory, Tizen::Base::String& dirPath) const; // Generates the real path using a pseudo-path and the specified resolution. bool GetFilePath(const Tizen::Base::String& directoryPath, const Tizen::Base::String& fileName, Tizen::Base::String& filePath) const; @@ -91,6 +91,15 @@ public: Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& resourcePath, _Density resourceDensity, Tizen::Graphics::BitmapPixelFormat pixelFormat, bool imageScaling, const Tizen::Graphics::Color* pChromaKeyColor = null) const; + static _AppResourceBitmapUtil* GetInstanceN(int type = APP_RESOURCE_DEFAULT, const Tizen::Base::String& value = L""); + +private: + // This is the copy constructor for this class. + _AppResourceBitmapUtil(const _AppResourceBitmapUtil& rhs); + + // This is the assignment operator for this class. + _AppResourceBitmapUtil& operator =(const _AppResourceBitmapUtil& rhs); + private: static const int DPI_FOR_XHIGH = 290; static const int DPI_FOR_HIGH = 200; diff --git a/src/app/FApp_UiAppImpl.cpp b/src/app/FApp_UiAppImpl.cpp old mode 100644 new mode 100755 index ddbe488..7d72d70 --- a/src/app/FApp_UiAppImpl.cpp +++ b/src/app/FApp_UiAppImpl.cpp @@ -109,9 +109,28 @@ void _UiAppImpl::OnService(service_s* service, bool initial) { Frame* pFrame = dynamic_cast(__pFrameList->GetAt(0)); + _EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + + // make OnForeground event + if (pFrame != null) + { + // handle submode + if (pEvas && _AppInfo::IsSubMode()) + { + _FrameImpl* pFrameImpl = _FrameImpl::GetInstance(*pFrame); + if (pFrameImpl != null) + { + unsigned int curHandle = pFrameImpl->GetNativeHandle(); + + bundle* pBundle = _AppArg::GetBundleFromSvc(service); + int ret = appsvc_request_transient_app(pBundle, curHandle, TransientResponseCb, NULL); + + SysLog(NID_APP, "Transient sets for (0x%x) with result (%d).", curHandle, ret); + } + } + } // [INFO] to confirm that the window is not foreground - _EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas(); if (pEvas) { int pid = pEvas->GetProcessId(pEvas->GetActiveWindow()); @@ -127,34 +146,14 @@ _UiAppImpl::OnService(service_s* service, bool initial) // [FIXME] Multi window handling if (pFrameImpl != null) { + // N_SE-24616, N_SE-24383 for OnForground() and visibility issue + OnResume(); pEvas->ActivateWindow(pFrameImpl->GetCore()); } } } } } - - // make OnForeground event - if (pFrame != null) - { - // handle submode - if (pEvas && _AppInfo::IsSubMode()) - { - _FrameImpl* pFrameImpl = _FrameImpl::GetInstance(*pFrame); - if (pFrameImpl != null) - { - unsigned int curHandle = pFrameImpl->GetNativeHandle(); - - bundle* pBundle = _AppArg::GetBundleFromSvc(service); - int ret = appsvc_request_transient_app(pBundle, curHandle, TransientResponseCb, NULL); - - SysLog(NID_APP, "Transient sets for (0x%x) with result (%d).", curHandle, ret); - } - } - - OnResume(); - //pFrame->Show(); - } } @@ -163,6 +162,11 @@ _UiAppImpl::OnTerminate(void) { SysLog(NID_APP, "Termination event 0x%x state", _AppInfo::GetAppState()); + if (__pUiApp->GetAppUiState() == APP_UI_STATE_FOREGROUND) + { + OnPause(); + } + if (OnUiAppImplTerminating() != true) { SysLog(NID_APP, "[E_SYSTEM] The Termination of application failed."); @@ -283,12 +287,14 @@ _UiAppImpl::RemoveFrame(const Frame& frame) result r = E_SUCCESS; SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed."); - r = __pFrameList->Remove(frame); - if (!IsFailed(r)) + Frame& tmpFrame = const_cast (frame); + _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(tmpFrame); + if (pFrameImpl) { - delete &frame; + pFrameImpl->Destroy(); } + r = __pFrameList->Remove(frame, false); return r; } @@ -298,10 +304,24 @@ _UiAppImpl::RemoveAllFrames(void) { result r = E_SUCCESS; SysTryReturnResult(NID_APP, __pFrameList != null, E_INVALID_STATE, "Getting FrameList failed."); + + int frameCount = __pFrameList->GetCount(); + for (int i = 0; i < frameCount; i++) + { + Frame* pFrame = dynamic_cast (__pFrameList->GetAt(i)); + if (pFrame) + { + _WindowImpl* pFrameImpl = _WindowImpl::GetInstance(*pFrame); + if (pFrameImpl) + { + pFrameImpl->Destroy(); + } + } + } if (__pFrameList->GetCount() > 0) { - __pFrameList->RemoveAll(true); + __pFrameList->RemoveAll(false); } delete __pFrameList; @@ -354,9 +374,6 @@ _UiAppImpl::GetFrameAt(int index) return pFrame; } -// For header inclusion dependency, elementary-1/elm_config.h is not included -extern "C" const char* elm_config_preferred_engine_set(const char*); - bool _UiAppImpl::OnAppInitializing(void) { @@ -375,13 +392,13 @@ _UiAppImpl::OnAppInitializing(void) } // API versioning for initial frame creation - if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) + if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) { // if API version is less than 3.0, create initial frame Frame* pDefaultFrame = new (std::nothrow) Frame(); SysTryReturn(NID_APP, pDefaultFrame != null, false, r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Frame creation failed."); pDefaultFrame->Construct(); AddFrame(*pDefaultFrame); - SysLog(NID_APP, "Default frame is added for API version %d.", _AppInfo::GetApiVersion()); + SysLog(NID_APP, "Default frame is added for API version %d Compatibility.", _AppInfo::GetApiVersion()); } SysTryReturn(NID_APP, __pUiApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting UiApp instance failed."); @@ -399,7 +416,20 @@ _UiAppImpl::OnAppInitialized(void) { SysTryReturn(NID_APP, __pUiApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting UiApp instance failed."); - if (__pUiApp->OnAppInitialized()) + const bool b = __pUiApp->OnAppInitialized(); + + Frame* pFrame = dynamic_cast(__pFrameList->GetAt(0)); + if (pFrame) + { + int type = _AppInfo::GetAppType(); + if (type & _APP_TYPE_IME_APP) + { + SysLog(NID_APP, "Defering frame update for IME app."); + pFrame->SetShowState(false); + } + } + + if (b) { if (__pFrameList->GetCount() > 0) { @@ -424,7 +454,7 @@ _UiAppImpl::OnUiAppImplTerminating(void) if (_AppInfo::GetAppState() != TERMINATED) { - result = __pUiApp->OnAppTerminating(*(AppRegistry::GetInstance()), false); + result = __pUiApp->OnAppTerminating(*(AppRegistry::GetInstance()), __pAppImpl->IsForcedTermination()); _AppInfo::SetAppState(TERMINATED); } diff --git a/src/app/inc/FApp_AppFrame.h b/src/app/inc/FApp_AppFrame.h index 047b2c7..18a5a35 100644 --- a/src/app/inc/FApp_AppFrame.h +++ b/src/app/inc/FApp_AppFrame.h @@ -39,7 +39,7 @@ namespace Tizen { namespace App // // @class _AppFrame // @brief This is implementation of the application frame. -// @since 1.0 +// @since 2.0 // class _AppFrame : public Tizen::Base::Object diff --git a/src/app/inc/FApp_UiAppImpl.h b/src/app/inc/FApp_UiAppImpl.h index f1c8162..28b71d8 100644 --- a/src/app/inc/FApp_UiAppImpl.h +++ b/src/app/inc/FApp_UiAppImpl.h @@ -45,7 +45,7 @@ class _AppFrame; /** * @class _UiAppImpl * @brief This class is the Impl class of a UiApp class. - * @since 2.0 + * @since 2.1 * * This class is the Impl class of a UiApp class. */ @@ -60,7 +60,7 @@ public: /** * Returns the _UiAppImpl's instance pointer. * - * @since 2.0 + * @since 2.1 * @return A pointer to the %_UiAppImpl instance, @n * else @c null if it fails */ @@ -69,7 +69,7 @@ public: /** * Returns the UiApp's instance pointer. * - * @since 2.0 + * @since 2.1 * @return A pointer to the %UiApp instance, @n * else @c null if it fails */ @@ -78,7 +78,7 @@ public: /** * Called when the application is started * - * @since 2.0 + * @since 2.1 * @return @c true if the method is successful, @n * else @c false * @param[in] user_data The user data passed from the callback registration function @@ -89,7 +89,7 @@ public: /** * Called when other application send the launch request to the application * - * @since 2.0 + * @since 2.1 * @param[in] service The handle to the service * @param[in] user_data The user data passed from the callback registration function * @remarks This is a system dependent callback function @@ -99,7 +99,7 @@ public: /** * Called when the application is completely obscured by another application and becomes invisible * - * @since 2.0 + * @since 2.1 * @param[in] user_data The user data passed from the callback registration function * @remarks This is a system dependent callback function */ @@ -108,7 +108,7 @@ public: /** * Called when the application becomes visible * - * @since 2.0 + * @since 2.1 * @param[in] user_data The user data passed from the callback registration function * @remarks This is a system dependent callback function */ @@ -117,7 +117,7 @@ public: /** * Called once after the main loop of application exits * - * @since 2.0 + * @since 2.1 * @param[in] user_data The user data passed from the callback registration function * @remarks This is a system dependent callback function */ @@ -126,7 +126,7 @@ public: /** * Called when an orintation event occurs. * - * @since 2.0 + * @since 2.1 * @param[in] orientation The information about the orientation event */ virtual void OnDeviceOrientationChanged(app_device_orientation_e orientation); @@ -134,7 +134,7 @@ public: /** * Called when the application's state changes to Tizen::App::AppState::INITIALIZING. @n * - * @since 2.0 + * @since 2.1 * @return @c true if the method is successful, @n * else @c false */ @@ -143,7 +143,7 @@ public: /** * Called when the application's INITIALIZING state is finished * - * @since 2.0 + * @since 2.1 * @return @c true if the method is successful, @n * else @c false */ @@ -153,14 +153,14 @@ public: /** * Called when the internal window handle is required. * - * @since 2.0 + * @since 2.1 */ virtual long OnWindowHandleRequest(void); /** * Called when the application's state change to Tizen::App::AppState::TERMINATING. @n * - * @since 2.0 + * @since 2.1 * @param[in] forcedTermination @c true if the application terminate by system or other application, else @c false. * @return @c true if the method is successful, @n * else @c false @@ -170,7 +170,7 @@ public: /** * Gets the first frame in the frame list of the UI application. @n * - * @since 2.0 + * @since 2.1 * * @return A pointer to the IAppFrame interface of the frame, @n * else @c null if it fails @@ -180,7 +180,7 @@ public: /** * Notifies when a key is pressed. * - * @since 2.0 + * @since 2.1 * @param[in] source The source of the event * @param[in] keyCode The key code */ @@ -189,7 +189,7 @@ public: /** * Notifies when a key is released. * - * @since 2.0 + * @since 2.1 * @param[in] source The source of the event * @param[in] keyCode The key code */ @@ -199,14 +199,14 @@ private: /** * This is the default constructor for this class. * - * @since 2.0 + * @since 2.1 */ _UiAppImpl(void); /** * This is the constructor for this class. * - * @since 2.0 + * @since 2.1 */ _UiAppImpl(UiApp* pUiApp); @@ -223,14 +223,14 @@ private: /** * This is the destructor for this class. * - * @since 2.0 + * @since 2.1 */ virtual ~_UiAppImpl(void); /** * Delete all frames of Ui application. @n * - * @since 2.0 + * @since 2.1 * * @return An error code */ @@ -239,7 +239,7 @@ private: /** * Adds the frame at the end of the list maintained by the UI application. @n * - * @since 2.0 + * @since 2.1 * * @return An error code * @param[in] frame The frame to be added to the UI application @@ -256,7 +256,7 @@ private: /** * Removes the specified frame from the UI application. @n * - * @since 2.0 + * @since 2.1 * * @return An error code * @param[in] frame The frame to be removed @@ -270,7 +270,7 @@ private: /** * Gets the list of the frames of the UI application. @n * - * @since 2.0 + * @since 2.1 * * @return A pointer to IList that contains the registered frames @n * else @c null if it fails @@ -283,7 +283,7 @@ private: /** * Gets the frame with the specified name. @n * - * @since 2.0 + * @since 2.1 * * @return A pointer to the frame having the specified name@n * else @c null if it fails @@ -299,7 +299,7 @@ private: /** * Gets the UI state of the UI application. * - * @since 2.0 + * @since 2.1 * @return The UI state of the UI application */ AppUiState GetAppUiState(void) const; diff --git a/src/graphics/CMakeLists.txt b/src/graphics/CMakeLists.txt old mode 100755 new mode 100644 index 8c9f14a..f4fb409 --- a/src/graphics/CMakeLists.txt +++ b/src/graphics/CMakeLists.txt @@ -50,14 +50,16 @@ SET (${this_target}_SOURCE_FILES FGrp_CanvasGpLine.cpp FGrp_CanvasGpRoundRect.cpp FGrp_CanvasGpTriangle.cpp + FGrp_CanvasTool.cpp FGrp_NonScale.cpp FGrp_FontImpl.cpp FGrp_BufferInfoImpl.cpp FGrp_CoordinateSystem.cpp FGrp_CoordinateSystemImpl.cpp FGrp_CoordinateSystemDeviceSpec.cpp + FGrp_CoordinateSystemUtils.cpp FGrp_Font.cpp - FGrp_FontBidiManager.cpp + FGrp_FontBidiUtil.cpp FGrp_FontRsrcManager.cpp FGrp_FontFt2.cpp FGrp_FontCache.cpp diff --git a/src/graphics/FGrpBitmap.cpp b/src/graphics/FGrpBitmap.cpp old mode 100644 new mode 100755 index 6d0a302..bc2bfba --- a/src/graphics/FGrpBitmap.cpp +++ b/src/graphics/FGrpBitmap.cpp @@ -178,6 +178,60 @@ Bitmap::Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& rq_dim } result +Bitmap::Construct(const FloatRectangle& vc_rect) +{ + CHECK_NOT_CONSTRUCTED; + + result r = this->__pImpl->Construct(vc_rect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +Bitmap::Construct(const FloatDimension& vc_dim, BitmapPixelFormat pixelFormat) +{ + CHECK_NOT_CONSTRUCTED; + + result r = this->__pImpl->Construct(vc_dim, pixelFormat); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +Bitmap::Construct(const Canvas& canvas, const FloatRectangle& vc_rect) +{ + CHECK_NOT_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n"); + + result r = this->__pImpl->Construct(*_CanvasImpl::GetInstance(canvas), vc_rect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +Bitmap::Construct(const Bitmap& bitmap, const FloatRectangle& vc_rect) +{ + CHECK_NOT_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->Construct(impl, vc_rect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Bitmap::Scale(const Dimension& vc_dim) { CHECK_CONSTRUCTED; @@ -190,6 +244,18 @@ Bitmap::Scale(const Dimension& vc_dim) } result +Bitmap::Scale(const FloatDimension& vc_dim) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->Scale(vc_dim); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Bitmap::Merge(const Point& vc_dest, const Bitmap& src, const Rectangle& vc_srcRect) { CHECK_CONSTRUCTED; @@ -205,6 +271,22 @@ Bitmap::Merge(const Point& vc_dest, const Bitmap& src, const Rectangle& vc_srcRe return E_SUCCESS; } +result +Bitmap::Merge(const FloatPoint& vc_dest, const Bitmap& src, const FloatRectangle& vc_srcRect) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&src), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *src.__pImpl; + + result r = this->__pImpl->Merge(vc_dest, impl, vc_srcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + int Bitmap::GetHeight() const { @@ -213,6 +295,22 @@ Bitmap::GetHeight() const return this->__pImpl->GetHeight(); } +float +Bitmap::GetHeightF() const +{ + CHECK_CONSTRUCTED_EX(-1); + + return this->__pImpl->GetHeightF(); +} + +float +Bitmap::GetActualHeight() const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return this->__pImpl->GetActualHeight(); +} + int Bitmap::GetWidth() const { @@ -221,6 +319,22 @@ Bitmap::GetWidth() const return this->__pImpl->GetWidth(); } +float +Bitmap::GetWidthF() const +{ + CHECK_CONSTRUCTED_EX(-1); + + return this->__pImpl->GetWidthF(); +} + +float +Bitmap::GetActualWidth() const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return this->__pImpl->GetActualWidth(); +} + int Bitmap::GetBitsPerPixel() const { diff --git a/src/graphics/FGrpCanvas.cpp b/src/graphics/FGrpCanvas.cpp index 8a0365c..3baff87 100644 --- a/src/graphics/FGrpCanvas.cpp +++ b/src/graphics/FGrpCanvas.cpp @@ -102,6 +102,18 @@ Canvas::Construct(const Rectangle& vcRect) } result +Canvas::Construct(const FloatRectangle& vcRect) +{ + CHECK_NOT_CONSTRUCTED; + + result r = this->__pImpl->Construct(vcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::Construct(const BufferInfo& bufferInfo) { CHECK_NOT_CONSTRUCTED; @@ -138,6 +150,18 @@ Canvas::Clear(const Rectangle& vcRect) } result +Canvas::Clear(const FloatRectangle& vcRect) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->Clear(vcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::Copy(const Point& vcDestPoint, const Canvas& canvas, const Rectangle& vcSrcRect) { CHECK_CONSTRUCTED; @@ -154,6 +178,22 @@ Canvas::Copy(const Point& vcDestPoint, const Canvas& canvas, const Rectangle& vc } result +Canvas::Copy(const FloatPoint& vcDestPoint, const Canvas& canvas, const FloatRectangle& vcSrcRect) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n"); + + const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl; + + result r = this->__pImpl->Copy(vcDestPoint, impl, vcSrcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::Copy(const Rectangle& vcDestRect, const Canvas& canvas, const Rectangle& vcSrcRect) { CHECK_CONSTRUCTED; @@ -170,6 +210,22 @@ Canvas::Copy(const Rectangle& vcDestRect, const Canvas& canvas, const Rectangle& } result +Canvas::Copy(const FloatRectangle& vcDestRect, const Canvas& canvas, const FloatRectangle& vcSrcRect) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n"); + + const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl; + + result r = this->__pImpl->Copy(vcDestRect, impl, vcSrcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawArc(const Rectangle& vcBounds, int startAngle, int endAngle, ArcStyle arcStyle) { CHECK_CONSTRUCTED; @@ -182,6 +238,18 @@ Canvas::DrawArc(const Rectangle& vcBounds, int startAngle, int endAngle, ArcStyl } result +Canvas::DrawArc(const FloatRectangle& vcBounds, float startAngle, float endAngle, ArcStyle arcStyle) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawArc(vcBounds, startAngle, endAngle, arcStyle); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawBitmap(const Rectangle& vcRect, const Bitmap& bitmap) { CHECK_CONSTRUCTED; @@ -198,6 +266,22 @@ Canvas::DrawBitmap(const Rectangle& vcRect, const Bitmap& bitmap) } result +Canvas::DrawBitmap(const FloatRectangle& vcRect, const Bitmap& bitmap) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->DrawBitmap(vcRect, impl); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap) { CHECK_CONSTRUCTED; @@ -214,6 +298,22 @@ Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap) } result +Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->DrawBitmap(vcPoint, impl); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawBitmap(const Rectangle& vcDestRect, const Bitmap& srcBitmap, const Rectangle& vcSrcRect) { CHECK_CONSTRUCTED; @@ -230,6 +330,22 @@ Canvas::DrawBitmap(const Rectangle& vcDestRect, const Bitmap& srcBitmap, const R } result +Canvas::DrawBitmap(const FloatRectangle& vcDestRect, const Bitmap& srcBitmap, const FloatRectangle& vcSrcRect) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&srcBitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *srcBitmap.__pImpl; + + result r = this->__pImpl->DrawBitmap(vcDestRect, impl, vcSrcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, FlipDirection dir) { CHECK_CONSTRUCTED; @@ -246,6 +362,22 @@ Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, FlipDirection dir } result +Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap, FlipDirection dir) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->DrawBitmap(vcPoint, impl, dir); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, const Point& vcPivot, int degree) { CHECK_CONSTRUCTED; @@ -262,6 +394,22 @@ Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, const Point& vcPi } result +Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap, const FloatPoint& vcPivot, float degree) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->DrawBitmap(vcPoint, impl, vcPivot, degree); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawNinePatchedBitmap(const Rectangle& vcRect, const Bitmap& bitmap) { CHECK_CONSTRUCTED; @@ -278,6 +426,22 @@ Canvas::DrawNinePatchedBitmap(const Rectangle& vcRect, const Bitmap& bitmap) } result +Canvas::DrawNinePatchedBitmap(const FloatRectangle& vcRect, const Bitmap& bitmap) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl; + + result r = this->__pImpl->DrawNinePatchedBitmap(vcRect, impl); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawEllipse(const Rectangle& vcBounds) { CHECK_CONSTRUCTED; @@ -290,6 +454,18 @@ Canvas::DrawEllipse(const Rectangle& vcBounds) } result +Canvas::DrawEllipse(const FloatRectangle& vcBounds) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawEllipse(vcBounds); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawLine(const Point& vcPoint1, const Point& vcPoint2) { CHECK_CONSTRUCTED; @@ -302,6 +478,18 @@ Canvas::DrawLine(const Point& vcPoint1, const Point& vcPoint2) } result +Canvas::DrawLine(const FloatPoint& vcPoint1, const FloatPoint& vcPoint2) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawLine(vcPoint1, vcPoint2); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawPolygon(const Tizen::Base::Collection::IList& vcPoints) { CHECK_CONSTRUCTED; @@ -338,6 +526,18 @@ Canvas::DrawRectangle(const Rectangle& vcRect) } result +Canvas::DrawRectangle(const FloatRectangle& vcRect) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawRectangle(vcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawRoundRectangle(const Rectangle& vcRect, const Dimension& vcArcDim) { CHECK_CONSTRUCTED; @@ -350,6 +550,18 @@ Canvas::DrawRoundRectangle(const Rectangle& vcRect, const Dimension& vcArcDim) } result +Canvas::DrawRoundRectangle(const FloatRectangle& vcRect, const FloatDimension& vcArcDim) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawRoundRectangle(vcRect, vcArcDim); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawTriangle(const Point& vcPoint1, const Point& vcPoint2, const Point& vcPoint3) { CHECK_CONSTRUCTED; @@ -362,6 +574,18 @@ Canvas::DrawTriangle(const Point& vcPoint1, const Point& vcPoint2, const Point& } result +Canvas::DrawTriangle(const FloatPoint& vcPoint1, const FloatPoint& vcPoint2, const FloatPoint& vcPoint3) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawTriangle(vcPoint1, vcPoint2, vcPoint3); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::FillEllipse(const Color& color, const Rectangle& vcBounds) { CHECK_CONSTRUCTED; @@ -374,6 +598,18 @@ Canvas::FillEllipse(const Color& color, const Rectangle& vcBounds) } result +Canvas::FillEllipse(const Color& color, const FloatRectangle& vcBounds) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->FillEllipse(color, vcBounds); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::FillPolygon(const Color& color, const Tizen::Base::Collection::IList& vcPoints) { CHECK_CONSTRUCTED; @@ -398,6 +634,18 @@ Canvas::FillRectangle(const Color& color, const Rectangle& vcRect) } result +Canvas::FillRectangle(const Color& color, const FloatRectangle& vcRect) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->FillRectangle(color, vcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::FillRoundRectangle(const Color& color, const Rectangle& vcRect, const Dimension& vcArcDim) { CHECK_CONSTRUCTED; @@ -410,6 +658,18 @@ Canvas::FillRoundRectangle(const Color& color, const Rectangle& vcRect, const Di } result +Canvas::FillRoundRectangle(const Color& color, const FloatRectangle& vcRect, const FloatDimension& vcArcDim) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->FillRoundRectangle(color, vcRect, vcArcDim); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::FillTriangle(const Color& color, const Point& vcPoint1, const Point& vcPoint2, const Point& vcPoint3) { CHECK_CONSTRUCTED; @@ -422,6 +682,18 @@ Canvas::FillTriangle(const Color& color, const Point& vcPoint1, const Point& vcP } result +Canvas::FillTriangle(const Color& color, const FloatPoint& vcPoint1, const FloatPoint& vcPoint2, const FloatPoint& vcPoint3) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->FillTriangle(color, vcPoint1, vcPoint2, vcPoint3); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text) { CHECK_CONSTRUCTED; @@ -434,6 +706,18 @@ Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text) } result +Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawText(vcPoint, text); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int length) { CHECK_CONSTRUCTED; @@ -446,6 +730,18 @@ Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int leng } result +Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, int length) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawText(vcPoint, text, 0, length); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, const Color& outlineColor) { CHECK_CONSTRUCTED; @@ -458,6 +754,18 @@ Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, const Co } result +Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, const Color& outlineColor) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawText(vcPoint, text, 0, outlineColor); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int length, const Color& outlineColor) { CHECK_CONSTRUCTED; @@ -470,6 +778,18 @@ Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int leng } result +Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, int length, const Color& outlineColor) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->DrawText(vcPoint, text, 0, length, outlineColor); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::DrawText(const Point& vcPoint, const EnrichedText& etext) { CHECK_CONSTRUCTED; @@ -483,6 +803,20 @@ Canvas::DrawText(const Point& vcPoint, const EnrichedText& etext) return E_SUCCESS; } +result +Canvas::DrawText(const FloatPoint& vcPoint, const EnrichedText& etext) +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, _Util::CheckValidity(&etext), E_INVALID_ARG, "The source enriched text is invalid.\n"); + + result r = this->__pImpl->DrawText(vcPoint, etext); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + Rectangle Canvas::GetBounds(void) const { @@ -491,6 +825,22 @@ Canvas::GetBounds(void) const return this->__pImpl->GetBounds(); } +FloatRectangle +Canvas::GetBoundsF(void) const +{ + CHECK_CONSTRUCTED_EX(FloatRectangle()); + + return this->__pImpl->GetBoundsF(); +} + +FloatRectangle +Canvas::GetActualBounds(void) const +{ + CHECK_CONSTRUCTED_EX(FloatRectangle()); + + return this->__pImpl->GetActualBounds(); +} + LineStyle Canvas::GetLineStyle() const { @@ -507,6 +857,14 @@ Canvas::GetLineWidth() const return this->__pImpl->GetLineWidth(); } +float +Canvas::GetLineWidthF() const +{ + CHECK_CONSTRUCTED_EX(-1); + + return this->__pImpl->GetLineWidthF(); +} + result Canvas::SetLineStyle(LineStyle style) { @@ -532,6 +890,18 @@ Canvas::SetLineWidth(int vcWidth) } result +Canvas::SetLineWidth(float vcWidth) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetLineWidth(vcWidth); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::GetDashPattern(Tizen::Base::Collection::IListT& pattern, int& offset) const { CHECK_CONSTRUCTED; @@ -544,6 +914,18 @@ Canvas::GetDashPattern(Tizen::Base::Collection::IListT& pattern, int& offse } result +Canvas::GetDashPattern(Tizen::Base::Collection::IListT& pattern, float& offset) const +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->GetDashPattern(pattern, offset); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, int offset) { CHECK_CONSTRUCTED; @@ -555,6 +937,58 @@ Canvas::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, int return E_SUCCESS; } +result +Canvas::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, float offset) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetDashPattern(pattern, offset); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +LineCapStyle +Canvas::GetLineCapStyle(void) const +{ + CHECK_CONSTRUCTED_EX(LINE_CAP_STYLE_ROUND); + + return this->__pImpl->GetLineCapStyle(); +} + +result +Canvas::SetLineCapStyle(LineCapStyle lineCapStyle) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetLineCapStyle(lineCapStyle); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +LineJoinStyle +Canvas::GetLineJoinStyle(void) const +{ + CHECK_CONSTRUCTED_EX(LINE_JOIN_STYLE_ROUND); + + return this->__pImpl->GetLineJoinStyle(); +} + +result +Canvas::SetLineJoinStyle(LineJoinStyle lineJoinStyle) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetLineJoinStyle(lineJoinStyle); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + #if 0 // Not public feature yet result @@ -592,6 +1026,18 @@ Canvas::GetPixel(const Point& vcPoint, Color& color) const } result +Canvas::GetPixel(const FloatPoint& vcPoint, Color& color) const +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->GetPixel(vcPoint, color); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::SetPixel(const Point& vcPoint) { CHECK_CONSTRUCTED; @@ -604,6 +1050,18 @@ Canvas::SetPixel(const Point& vcPoint) } result +Canvas::SetPixel(const FloatPoint& vcPoint) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetPixel(vcPoint); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Canvas::Show() { CHECK_CONSTRUCTED; @@ -672,6 +1130,18 @@ Canvas::SetClipBounds(const Rectangle& vcRect) return E_SUCCESS; } +result +Canvas::SetClipBounds(const FloatRectangle& vcRect) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetClipBounds(vcRect); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + Rectangle Canvas::GetClipBounds(void) const { @@ -680,6 +1150,14 @@ Canvas::GetClipBounds(void) const return this->__pImpl->GetClipBounds(); } +FloatRectangle +Canvas::GetClipBoundsF(void) const +{ + CHECK_CONSTRUCTED_EX(FloatRectangle()); + + return this->__pImpl->GetClipBoundsF(); +} + result Canvas::Lock(BufferInfo& info, long timeout) { @@ -760,4 +1238,24 @@ Canvas::SetPosition(int vcX, int vcY) return E_SUCCESS; } +result +Canvas::SetCompositeMode(CompositeMode compositeMode) +{ + CHECK_CONSTRUCTED; + + result r = this->__pImpl->SetCompositeMode(compositeMode); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +CompositeMode +Canvas::GetCompositeMode(void) const +{ + CHECK_CONSTRUCTED_EX(COMPOSITE_MODE_SRC_OVER); + + return this->__pImpl->GetCompositeMode(); +} + }} // Tizen::Graphics diff --git a/src/graphics/FGrpCoordinateSystem.cpp b/src/graphics/FGrpCoordinateSystem.cpp index 51aaf74..973219d 100644 --- a/src/graphics/FGrpCoordinateSystem.cpp +++ b/src/graphics/FGrpCoordinateSystem.cpp @@ -93,6 +93,14 @@ CoordinateSystem::ConvertToLogicalX(int physicalX) return (pTransformer) ? pTransformer->TransformHorizontal(physicalX) : physicalX; } +float +CoordinateSystem::ConvertToLogicalX(float physicalX) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetInverseTransformer(); + + return (pTransformer) ? pTransformer->TransformHorizontal(physicalX) : physicalX; +} + int CoordinateSystem::ConvertToLogicalY(int physicalY) { @@ -101,6 +109,14 @@ CoordinateSystem::ConvertToLogicalY(int physicalY) return (pTransformer) ? pTransformer->TransformVertical(physicalY) : physicalY; } +float +CoordinateSystem::ConvertToLogicalY(float physicalY) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetInverseTransformer(); + + return (pTransformer) ? pTransformer->TransformVertical(physicalY) : physicalY; +} + int CoordinateSystem::ConvertToPhysicalX(int logicalX) { @@ -109,6 +125,14 @@ CoordinateSystem::ConvertToPhysicalX(int logicalX) return (pTransformer) ? pTransformer->TransformHorizontal(logicalX) : logicalX; } +float +CoordinateSystem::ConvertToPhysicalX(float logicalX) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + return (pTransformer) ? pTransformer->TransformHorizontal(logicalX) : logicalX; +} + int CoordinateSystem::ConvertToPhysicalY(int logicalY) { @@ -117,4 +141,79 @@ CoordinateSystem::ConvertToPhysicalY(int logicalY) return (pTransformer) ? pTransformer->TransformVertical(logicalY) : logicalY; } +float +CoordinateSystem::ConvertToPhysicalY(float logicalY) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + return (pTransformer) ? pTransformer->TransformVertical(logicalY) : logicalY; +} + +FloatPoint +CoordinateSystem::AlignToDevice(const FloatPoint& point) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer != null) + { + FloatPoint output; + + float convertedX = pTransformer->TransformHorizontalFloatToInt(point.x); + float convertedY = pTransformer->TransformVerticalFloatToInt(point.y); + + output.x = CoordinateSystem::ConvertToLogicalX(convertedX); + output.y = CoordinateSystem::ConvertToLogicalY(convertedY); + + return output; + } + + return point; +} + +FloatDimension +CoordinateSystem::AlignToDevice(const FloatDimension& dimension) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer != null) + { + FloatDimension output; + + float convertedW = pTransformer->TransformHorizontalFloatToInt(dimension.width); + float convertedH = pTransformer->TransformVerticalFloatToInt(dimension.height); + + output.width = CoordinateSystem::ConvertToLogicalX(convertedW); + output.height = CoordinateSystem::ConvertToLogicalY(convertedH); + + return output; + } + + return dimension; +} + +FloatRectangle +CoordinateSystem::AlignToDevice(const FloatRectangle& rectangle) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer != null) + { + FloatRectangle output; + + float convertedX = pTransformer->TransformHorizontalFloatToInt(rectangle.x); + float convertedY = pTransformer->TransformVerticalFloatToInt(rectangle.y); + float convertedW = pTransformer->TransformHorizontalFloatToInt(rectangle.width); + float convertedH = pTransformer->TransformVerticalFloatToInt(rectangle.height); + + output.x = CoordinateSystem::ConvertToLogicalX(convertedX); + output.y = CoordinateSystem::ConvertToLogicalY(convertedY); + output.width = CoordinateSystem::ConvertToLogicalX(convertedW); + output.height = CoordinateSystem::ConvertToLogicalY(convertedH); + + return output; + } + + return rectangle; +} + }} // Tizen::Graphics diff --git a/src/graphics/FGrpEnrichedText.cpp b/src/graphics/FGrpEnrichedText.cpp index 86bafb3..d01ac14 100644 --- a/src/graphics/FGrpEnrichedText.cpp +++ b/src/graphics/FGrpEnrichedText.cpp @@ -31,6 +31,7 @@ #include "FGrp_EnrichedTextImpl.h" #include "FGrp_ResUtil.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -86,6 +87,17 @@ EnrichedText::Construct(const Tizen::Graphics::Dimension& dim) } result +EnrichedText::Construct(const Tizen::Graphics::FloatDimension& dim) +{ + CHECK_NOT_CONSTRUCTED; + + result r = __pImpl->Construct(dim); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result EnrichedText::InsertAt(int elementIndex, Tizen::Graphics::TextElement& element) { CHECK_CONSTRUCTED; @@ -158,6 +170,14 @@ EnrichedText::SetSize(const Tizen::Graphics::Dimension& size) } result +EnrichedText::SetSize(const Tizen::Graphics::FloatDimension& size) +{ + CHECK_CONSTRUCTED; + + return __pImpl->SetSize(size); +} + +result EnrichedText::SetSize(int width, int height) { CHECK_CONSTRUCTED; @@ -165,6 +185,14 @@ EnrichedText::SetSize(int width, int height) return __pImpl->SetSize(width, height); } +result +EnrichedText::SetSize(float width, float height) +{ + CHECK_CONSTRUCTED; + + return __pImpl->SetSize(width, height); +} + Tizen::Graphics::Dimension EnrichedText::GetSize(void) const { @@ -173,6 +201,14 @@ EnrichedText::GetSize(void) const return __pImpl->GetSize(); } +Tizen::Graphics::FloatDimension +EnrichedText::GetSizeF(void) const +{ + CHECK_CONSTRUCTED_EX(FloatDimension(0.0f, 0.0f)); + + return __pImpl->GetSizeF(); +} + void EnrichedText::GetSize(int& width, int& height) const { @@ -181,6 +217,14 @@ EnrichedText::GetSize(int& width, int& height) const return __pImpl->GetSize(width, height); } +void +EnrichedText::GetSize(float& width, float& height) const +{ + CHECK_CONSTRUCTED_VOID; + + return __pImpl->GetSize(width, height); +} + int EnrichedText::GetWidth(void) const { @@ -189,6 +233,14 @@ EnrichedText::GetWidth(void) const return __pImpl->GetWidth(); } +float +EnrichedText::GetWidthF(void) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetWidthF(); +} + int EnrichedText::GetHeight(void) const { @@ -197,6 +249,14 @@ EnrichedText::GetHeight(void) const return __pImpl->GetHeight(); } +float +EnrichedText::GetHeightF(void) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetHeightF(); +} + result EnrichedText::SetVerticalAlignment(TextVerticalAlignment alignment) { @@ -269,6 +329,14 @@ EnrichedText::SetLineSpace(int lineSpace) return __pImpl->SetLineSpace(lineSpace); } +result +EnrichedText::SetLineSpace(float lineSpace) +{ + CHECK_CONSTRUCTED; + + return __pImpl->SetLineSpace(lineSpace); +} + int EnrichedText::GetLineSpace(void) const { @@ -277,6 +345,14 @@ EnrichedText::GetLineSpace(void) const return __pImpl->GetLineSpace(); } +float +EnrichedText::GetLineSpaceF(void) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetLineSpaceF(); +} + void EnrichedText::Refresh(void) { @@ -301,6 +377,14 @@ EnrichedText::GetTotalLineHeight(void) const return __pImpl->GetTotalLineHeight(); } +float +EnrichedText::GetTotalLineHeightF(void) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetTotalLineHeight(); +} + int EnrichedText::GetDisplayLineCount(void) const { @@ -341,6 +425,14 @@ EnrichedText::GetLineHeight(int lineIndex) const return __pImpl->GetLineHeight(lineIndex); } +float +EnrichedText::GetLineHeightF(int lineIndex) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetLineHeightF(lineIndex); +} + int EnrichedText::GetTextLength(void) const { @@ -358,6 +450,14 @@ EnrichedText::GetTextExtent(int startTextIndex, int textLength, int& width, int& } result +EnrichedText::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetTextExtent(startTextIndex, textLength, width, height, actualLength); +} + +result EnrichedText::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int& actualLength) const { CHECK_CONSTRUCTED; @@ -365,6 +465,14 @@ EnrichedText::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics: return __pImpl->GetTextExtent(startTextIndex, textLength, size, actualLength); } +result +EnrichedText::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int& actualLength) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetTextExtent(startTextIndex, textLength, size, actualLength); +} + Tizen::Graphics::Dimension EnrichedText::GetTextExtent(void) const { @@ -373,6 +481,14 @@ EnrichedText::GetTextExtent(void) const return __pImpl->GetTextExtent(); } +Tizen::Graphics::FloatDimension +EnrichedText::GetTextExtentF(void) const +{ + CHECK_CONSTRUCTED_EX(FloatDimension(-1.0f, -1.0f)); + + return __pImpl->GetTextExtentF(); +} + result EnrichedText::Add(const Tizen::Graphics::Bitmap& bitmap) { @@ -398,6 +514,14 @@ EnrichedText::GetLinkInfoFromPosition(const Point& point, Tizen::Base::Utility:: } result +EnrichedText::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetLinkInfoFromPosition(point, linkInfo); +} + +result EnrichedText::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const { CHECK_CONSTRUCTED; @@ -405,6 +529,14 @@ EnrichedText::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkIn return __pImpl->GetLinkInfoFromPosition(x, y, linkInfo); } +result +EnrichedText::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetLinkInfoFromPosition(x, y, linkInfo); +} + TextVerticalAlignment EnrichedText::GetElementVerticalAlignment(void) const { diff --git a/src/graphics/FGrpFont.cpp b/src/graphics/FGrpFont.cpp index c7842dc..1e5a7b1 100644 --- a/src/graphics/FGrpFont.cpp +++ b/src/graphics/FGrpFont.cpp @@ -128,6 +128,61 @@ Font::Construct(const Tizen::Base::ByteBuffer& fontData, int style, int vc_size) return E_SUCCESS; } +result +Font::Construct(int style, float vc_size) +{ + CHECK_NOT_CONSTRUCTED; + + // check input param. + SysTryReturnResult(NID_GRP, vc_size > 0.0f, E_INVALID_ARG, "Font size should be greater than 0"); + SysTryReturnResult(NID_GRP, FONT_STYLE_MIN < style && style <= (FONT_STYLE_PLAIN | FONT_STYLE_BOLD | FONT_STYLE_ITALIC), E_INVALID_ARG, + "Style(%d) is invalid", style); + + result r = __pImpl->Construct(style, vc_size); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +Font::Construct(const Tizen::Base::String& fontNameOrPath, int style, float vc_size) +{ + CHECK_NOT_CONSTRUCTED; + + // check input param. + SysTryReturnResult(NID_GRP, vc_size > 0.0f, E_INVALID_ARG, "Font size should be greater than 0"); + SysTryReturnResult(NID_GRP, FONT_STYLE_MIN < style && style <= (FONT_STYLE_PLAIN | FONT_STYLE_BOLD | FONT_STYLE_ITALIC), E_INVALID_ARG, + "Style(%d) is invalid.\n", style); + SysTryReturnResult(NID_GRP, fontNameOrPath.GetLength() > 0.0f, E_FILE_NOT_FOUND, "The specified font could not be found or accessed"); + SysTryReturnResult(NID_GRP, !fontNameOrPath.EndsWith(L"/") && !fontNameOrPath.EndsWith(L"\\"), E_FILE_NOT_FOUND, + "The specified font could not be found or accessed.\n"); + + result r = __pImpl->Construct(fontNameOrPath, style, vc_size); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +Font::Construct(const Tizen::Base::ByteBuffer& fontData, int style, float vc_size) +{ + CHECK_NOT_CONSTRUCTED; + + // check input param. + SysTryReturnResult(NID_GRP, fontData.GetLimit() > 0, E_INVALID_ARG, "Buffer size should be greater than 0"); + SysTryReturnResult(NID_GRP, vc_size > 0.0f, E_INVALID_ARG, "FontEx size should be greater than 0"); + SysTryReturnResult(NID_GRP, style > FONT_STYLE_MIN && style <= (FONT_STYLE_PLAIN | FONT_STYLE_BOLD | FONT_STYLE_ITALIC), E_INVALID_ARG, + "Style(%d) is invalid", style); + + result r = __pImpl->Construct(fontData, style, vc_size); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + int Font::GetMaxHeight(void) const { @@ -136,6 +191,14 @@ Font::GetMaxHeight(void) const return __pImpl->GetMaxHeight(); } +float +Font::GetMaxHeightF(void) const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return __pImpl->GetMaxHeightF(); +} + int Font::GetMaxWidth(void) const { @@ -144,6 +207,14 @@ Font::GetMaxWidth(void) const return __pImpl->GetMaxWidth(); } +float +Font::GetMaxWidthF(void) const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return __pImpl->GetMaxWidthF(); +} + int Font::GetAscender(void) const { @@ -152,6 +223,14 @@ Font::GetAscender(void) const return __pImpl->GetAscender(); } +float +Font::GetAscenderF(void) const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return __pImpl->GetAscenderF(); +} + int Font::GetDescender(void) const { @@ -160,6 +239,14 @@ Font::GetDescender(void) const return __pImpl->GetDescender(); } +float +Font::GetDescenderF(void) const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return __pImpl->GetDescenderF(); +} + result Font::GetLeftBear(wchar_t character, int& vc_leftBear) const { @@ -169,6 +256,14 @@ Font::GetLeftBear(wchar_t character, int& vc_leftBear) const } result +Font::GetLeftBear(wchar_t character, float& vc_leftBear) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetLeftBear(character, vc_leftBear); +} + +result Font::GetRightBear(wchar_t character, int& vc_rightBear) const { CHECK_CONSTRUCTED; @@ -177,6 +272,14 @@ Font::GetRightBear(wchar_t character, int& vc_rightBear) const } result +Font::GetRightBear(wchar_t character, float& vc_rightBear) const +{ + CHECK_CONSTRUCTED; + + return __pImpl->GetRightBear(character, vc_rightBear); +} + +result Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& vc_dim) const { CHECK_CONSTRUCTED; @@ -201,6 +304,31 @@ Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& vc_d return E_SUCCESS; } +result +Font::GetTextExtent(const Tizen::Base::String& text, int length, FloatDimension& vc_dim) const +{ + CHECK_CONSTRUCTED; + + SysTryReturnResult(NID_GRP, length >= 0 && length <= text.GetLength(), E_OUT_OF_RANGE, + "The length(%d) of the given text is out of range", length); + + if (length == 0 || text.GetLength() == 0) + { + return E_SUCCESS; + } + + result r = __pImpl->GetTextExtent(text, length, vc_dim); + + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!Tizen::App::_AppInfo::IsOspCompat()) + { + vc_dim.height = GetMaxHeightF(); + } + + return E_SUCCESS; +} + bool Font::IsBold(void) const { @@ -249,12 +377,22 @@ Font::GetSize(void) const return __pImpl->GetSize(); } +float +Font::GetSizeF(void) const +{ + CHECK_CONSTRUCTED_EX(-1.0f); + + return __pImpl->GetSizeF(); +} + void Font::SetStrikeOut(bool strikeout) { CHECK_CONSTRUCTED_VOID; - return __pImpl->SetStrikeOut(strikeout); + __pImpl->SetStrikeOut(strikeout); + + return; } void @@ -262,7 +400,9 @@ Font::SetUnderline(bool underline) { CHECK_CONSTRUCTED_VOID; - return __pImpl->SetUnderline(underline); + __pImpl->SetUnderline(underline); + + return; } void @@ -270,7 +410,19 @@ Font::SetCharSpace(int vc_space) { CHECK_CONSTRUCTED_VOID; - return __pImpl->SetCharSpace(vc_space); + __pImpl->SetCharSpace(vc_space); + + return; +} + +void +Font::SetCharSpace(float vc_space) +{ + CHECK_CONSTRUCTED_VOID; + + __pImpl->SetCharSpace(vc_space); + + return; } int @@ -281,6 +433,14 @@ Font::GetCharSpace(void) const return __pImpl->GetCharSpace(); } +float +Font::GetCharSpaceF(void) const +{ + CHECK_CONSTRUCTED_EX(0.0f); + + return __pImpl->GetCharSpaceF(); +} + Tizen::Base::String Font::GetFaceName(void) const { diff --git a/src/graphics/FGrp_Bitmap.cpp b/src/graphics/FGrp_Bitmap.cpp old mode 100644 new mode 100755 index 0b0dcd0..0be9991 --- a/src/graphics/FGrp_Bitmap.cpp +++ b/src/graphics/FGrp_Bitmap.cpp @@ -860,7 +860,7 @@ _Bitmap::GetScalingQuality(void) const } bool -_Bitmap::IsNinePatchedBitmap(void) const +_Bitmap::IsNinePatchedBitmap(bool checkStrictly) const { SysTryReturn(NID_GRP, this->IsValid(), false, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n"); @@ -870,7 +870,8 @@ _Bitmap::IsNinePatchedBitmap(void) const if (const_cast<_Bitmap*>(this)->Lock(dstBufferInfo) == E_SUCCESS) { const Tizen::Graphics::_Util::Pixmap dstImage(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch); - ret = Tizen::Graphics::_Effect::IsNinePatchedBitmap(dstImage); + + ret = Tizen::Graphics::_Effect::IsNinePatchedBitmap(dstImage, checkStrictly); const_cast<_Bitmap*>(this)->Unlock(); } diff --git a/src/graphics/FGrp_Bitmap.h b/src/graphics/FGrp_Bitmap.h old mode 100644 new mode 100755 index 6cd9277..f78166d --- a/src/graphics/FGrp_Bitmap.h +++ b/src/graphics/FGrp_Bitmap.h @@ -74,7 +74,7 @@ public: void SetScalingQuality(BitmapScalingQuality quality); BitmapScalingQuality GetScalingQuality(void) const; - bool IsNinePatchedBitmap(void) const; + bool IsNinePatchedBitmap(bool checkStrictly = false) const; result Lock(BufferInfo& info, long timeout = INFINITE); result Unlock(void); diff --git a/src/graphics/FGrp_BitmapCoordHolder.h b/src/graphics/FGrp_BitmapCoordHolder.h old mode 100644 new mode 100755 index 5764862..eb71d72 --- a/src/graphics/FGrp_BitmapCoordHolder.h +++ b/src/graphics/FGrp_BitmapCoordHolder.h @@ -31,18 +31,109 @@ namespace Tizen { namespace Graphics { -struct _BitmapCoordHolder +struct _BitmapCoordinateHolder { - _ResUtil::CoordHolder <_ResUtil::Rect> bitmapSize; + _ResUtil::CoordinateHolder<_Util::Dimension, _Util::Dimension > size; - void Init(_ResUtil::Rect area) + _BitmapCoordinateHolder() + : __pcBaseScale(1.0f) + , __vcBaseScale(1.0f) { - bitmapSize = area; + _CoordinateSystem* pCoordinateSystem = _CoordinateSystem::GetInstance(); + + if (pCoordinateSystem) + { + __pcBaseScale = pCoordinateSystem->GetTargetBaseScaleFactor(); + __vcBaseScale = pCoordinateSystem->GetAppBaseScaleFactor(); + } + } + + void ResetFromVc(const _Util::Dimension& intVcSize) + { + _Util::Dimension floatVcSize = + { + static_cast(intVcSize.w), + static_cast(intVcSize.h) + }; + + this->ResetFromVc(floatVcSize); + + size.vcInt.w = intVcSize.w; + size.vcInt.h = intVcSize.h; + } + + void ResetFromVc(const _Util::Dimension& floatVcSize) + { + size.vcInt.w = _FloatToIntForSize(floatVcSize.w); + size.vcInt.h = _FloatToIntForSize(floatVcSize.h); + + size.vcFloat.w = floatVcSize.w; + size.vcFloat.h = floatVcSize.h; + + size.pcInt.w = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcSize.w))); + size.pcInt.h = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcSize.h))); + + size.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.w))); + size.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.h))); + } + + void ResetFromPc(const _Util::Dimension& intPcSize) + { + size.pcInt.w = intPcSize.w; + size.pcInt.h = intPcSize.h; + + size.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.w))); + size.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.h))); + + size.vcFloat.w = size.vcFloatActual.w; + size.vcFloat.h = size.vcFloatActual.h; + + size.vcInt.w = _FloatToIntForSize(size.vcFloat.w); + size.vcInt.h = _FloatToIntForSize(size.vcFloat.h); } - void Init(const Rectangle& rect) + + void ResetFromPc(const _Util::Dimension& intPcSize, const _Util::Dimension& intVcSize) + { + size.pcInt.w = intPcSize.w; + size.pcInt.h = intPcSize.h; + + size.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.w))); + size.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.h))); + + size.vcInt.w = intVcSize.w; + size.vcInt.h = intVcSize.h; + + size.vcFloat.w = static_cast(intVcSize.w); + size.vcFloat.h = static_cast(intVcSize.h); + } + + void ResetFromPc(const _Util::Dimension& intPcSize, const _Util::Dimension& intVcSize, const _Util::Dimension& floatVcSize) + { + size.pcInt.w = intPcSize.w; + size.pcInt.h = intPcSize.h; + + size.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.w))); + size.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(size.pcInt.h))); + + size.vcInt.w = intVcSize.w; + size.vcInt.h = intVcSize.h; + + size.vcFloat.w = floatVcSize.w; + size.vcFloat.h = floatVcSize.h; + } + +private: + double __pcBaseScale; + double __vcBaseScale; + + inline double __ConvertToPhyCoord(double val) + { + return val * __pcBaseScale / __vcBaseScale; + } + + inline double __ConvertToVirCoord(double val) { - _ResUtil::Rect area(rect.x, rect.y, rect.width, rect.height); - this->Init(area); + return val * __vcBaseScale / __pcBaseScale; } }; diff --git a/src/graphics/FGrp_BitmapImpl.cpp b/src/graphics/FGrp_BitmapImpl.cpp old mode 100644 new mode 100755 index 3ad683e..dca71e9 --- a/src/graphics/FGrp_BitmapImpl.cpp +++ b/src/graphics/FGrp_BitmapImpl.cpp @@ -45,7 +45,9 @@ using namespace Tizen::Base; -#define INSTANCE_IS_VALID (this && const_cast<_BitmapImpl*>(this)->__CheckValidity()) +#define INSTANCE_IS_VALID (this && const_cast<_BitmapImpl*>(this)->__CheckValidity(true)) +#define IS_INSTANCE_VALID (this && const_cast<_BitmapImpl*>(this)->__CheckValidity(false)) + #define BITMAPIMPL_IS_VALID(pBitmapImpl) (pBitmapImpl && const_cast<_BitmapImpl*>(pBitmapImpl)->__CheckValidity(true)) #define IS_BITMAPIMPL_VALID(pBitmapImpl) (pBitmapImpl && const_cast<_BitmapImpl*>(pBitmapImpl)->__CheckValidity(false)) @@ -82,6 +84,30 @@ _CheckValidity(const Tizen::Graphics::Rectangle& rtSrc, const Tizen::Graphics::R return true; } +bool +_CheckValidity(const Tizen::Graphics::FloatRectangle& rtSrc, const Tizen::Graphics::FloatRectangle& rtDest) +{ + // check 1. is width/height less or equal than 0? + if (rtSrc.width <= 0.0f || rtSrc.height <= 0.0f || rtDest.width <= 0.0f || rtDest.height <= 0.0f) + { + return false; // "[E_OUT_OF_RANGE] The argument is out of range. (src(w:%f,h:%f), dst(w:%f,h:%f))", rtSrc.width, rtSrc.height, rtDest.width, rtDest.height); + } + + // check 2. is src exiting outside of dest entirely? + if (rtSrc.x > rtDest.x + rtDest.width || rtSrc.x + rtSrc.width < rtDest.x) + { + return false; // "[E_OUT_OF_RANGE] The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f))", rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height); + } + + if (rtSrc.y > rtDest.y + rtDest.height || rtSrc.y + rtSrc.height < rtDest.y) + { + return false; // "[E_OUT_OF_RANGE] The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f))", rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height); + } + + return true; +} + + int _GetBytesPerPixel(Tizen::Graphics::BitmapPixelFormat pixelFormat) { @@ -225,7 +251,7 @@ namespace Tizen { namespace Graphics unsigned long _GetBitmapTimeStamp(const Tizen::Graphics::_BitmapImpl& bitmap) { - Tizen::Graphics::_Bitmap* _nativeBitmap = Tizen::Graphics::GetBitmapEx(bitmap); + Tizen::Graphics::_Bitmap* _nativeBitmap = Tizen::Graphics::_GetBitmapEx(bitmap); return (_nativeBitmap) ? _nativeBitmap->GetTimeStamp() : 0; } @@ -233,7 +259,7 @@ _GetBitmapTimeStamp(const Tizen::Graphics::_BitmapImpl& bitmap) unsigned long _UpdateBitmapTimeStamp(Tizen::Graphics::_BitmapImpl& bitmap) { - Tizen::Graphics::_Bitmap* _nativeBitmap = Tizen::Graphics::GetBitmapEx(bitmap); + Tizen::Graphics::_Bitmap* _nativeBitmap = Tizen::Graphics::_GetBitmapEx(bitmap); if (_nativeBitmap) { @@ -252,7 +278,7 @@ _BitmapImpl::_BitmapImpl(void) if (this->_sharedItem.get()) { this->_sharedItem->nativeBitmap.reset(new (std::nothrow) _Bitmap); - this->_sharedItem->coordHolder.reset(new (std::nothrow) _BitmapCoordHolder); + this->_sharedItem->coordHolder.reset(new (std::nothrow) _BitmapCoordinateHolder); this->_sharedItem->lazyScaling = 0; this->_sharedItem->scaledNativeBitmap.reset(null); this->_sharedItem->pDestroyCallbackFunc = null; @@ -308,28 +334,19 @@ _BitmapImpl::Construct(const Rectangle& vc_rect) SysTryReturnResult(NID_GRP, vc_rect.x >= 0 && vc_rect.y >= 0, E_OUT_OF_RANGE, "The argument is out of range. (rect(x:%d,y:%d,w:%d,h:%d)).", vc_rect.x, vc_rect.y, vc_rect.width, vc_rect.height); - if (_ResUtil::NeedToConvertCoord()) { - Rectangle pc_rect = _ResUtil::ConvertToPhyCoord(vc_rect); + _Util::Dimension vcDim = { vc_rect.width, vc_rect.height }; - // special case - pc_rect.width = (pc_rect.width > 0) ? pc_rect.width : 1; - pc_rect.height = (pc_rect.height > 0) ? pc_rect.height : 1; + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - result r = this->_sharedItem->nativeBitmap->Construct(pc_rect); + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - if (!IsFailed(r)) - { - this->_sharedItem->coordHolder->Init(vc_rect); - this->_sharedItem->coordHolder->bitmapSize.phyCoord.w = pc_rect.width; - this->_sharedItem->coordHolder->bitmapSize.phyCoord.h = pc_rect.height; - } + Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vc_rect); - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(vc_rect); + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; + + return this->_sharedItem->nativeBitmap->Construct(pcRect); } } @@ -343,46 +360,27 @@ _BitmapImpl::Construct(const Dimension& vc_dim, BitmapPixelFormat pixelFormat) // check arg. SysTryReturnResult(NID_GRP, vc_dim.width > 0 && vc_dim.height > 0, E_INVALID_ARG, "Both of width(%d) and height(%d) of 'dim' MUST be greater than 0.", vc_dim.width, vc_dim.height); - int size = vc_dim.width * vc_dim.height; - switch (pixelFormat) { case BITMAP_PIXEL_FORMAT_RGB565: - size *= sizeof(unsigned short); - break; case BITMAP_PIXEL_FORMAT_ARGB8888: case BITMAP_PIXEL_FORMAT_R8G8B8A8: - size *= sizeof(unsigned long); break; default: SysTryReturnResult(NID_GRP, 0, E_INVALID_ARG, "BitmapPixelFormat(%d) is invalid argument.", pixelFormat); break; } - if (_ResUtil::NeedToConvertCoord()) { - Dimension pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); - - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; + _Util::Dimension vcDim = { vc_dim.width, vc_dim.height }; - result r = this->_sharedItem->nativeBitmap->Construct(pc_dim, pixelFormat); + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - if (!IsFailed(r)) - { - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - this->_sharedItem->coordHolder->Init(vc_rect); - this->_sharedItem->coordHolder->bitmapSize.phyCoord.w = pc_dim.width; - this->_sharedItem->coordHolder->bitmapSize.phyCoord.h = pc_dim.height; - } + Dimension pcDim(this->_sharedItem->coordHolder->size.pcInt.w, this->_sharedItem->coordHolder->size.pcInt.h); - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(vc_dim, pixelFormat); + return this->_sharedItem->nativeBitmap->Construct(pcDim, pixelFormat); } } @@ -406,26 +404,19 @@ _BitmapImpl::Construct(const _CanvasImpl& canvas, const Rectangle& vc_rect) Tizen::Graphics::_Canvas* pCanvasEx = canvas._pNativeCanvas; - if (_ResUtil::NeedToConvertCoord()) { - Rectangle pc_rect = _ResUtil::ConvertToPhyCoord(vc_rect); + _Util::Dimension vcDim = { vc_rect.width, vc_rect.height }; - // special case (kiniirana) - pc_rect.width = (pc_rect.width > 0) ? pc_rect.width : 1; - pc_rect.height = (pc_rect.height > 0) ? pc_rect.height : 1; + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - result r = this->_sharedItem->nativeBitmap->Construct(*pCanvasEx, pc_rect); + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - if (!IsFailed(r)) - { - this->_sharedItem->coordHolder->Init(vc_rect); - } + Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vc_rect); - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(*pCanvasEx, vc_rect); + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; + + return this->_sharedItem->nativeBitmap->Construct(*pCanvasEx, pcRect); } } @@ -444,39 +435,34 @@ _BitmapImpl::Construct(const _BitmapImpl& bitmap, const Rectangle& vc_rect) SysTryReturnResult(NID_GRP, _CheckValidity(vc_rect, rtBitmap), E_OUT_OF_RANGE, "The argument is out of range. (rect(x:%d,y:%d,w:%d,h:%d)).", vc_rect.x, vc_rect.y, vc_rect.width, vc_rect.height); - _Bitmap* pSrcBitmapEx = Tizen::Graphics::GetBitmapEx(bitmap); + _Bitmap* pSrcBitmapEx = Tizen::Graphics::_GetBitmapEx(bitmap); - if (_ResUtil::NeedToConvertCoord()) { + _Util::Dimension vcDim = { vc_rect.width, vc_rect.height }; + + this->_sharedItem->coordHolder->ResetFromVc(vcDim); + + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); + result r = E_SUCCESS; - Rectangle pc_rect = _ResUtil::ConvertToPhyCoord(vc_rect); + Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vc_rect); - // special case - pc_rect.width = (pc_rect.width > 0) ? pc_rect.width : 1; - pc_rect.height = (pc_rect.height > 0) ? pc_rect.height : 1; + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; - if (Tizen::Graphics::IsLazyScalingBitmap(bitmap)) + if (Tizen::Graphics::_IsLazyScalingBitmap(bitmap)) { - _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::GetScaledBitmapEx(bitmap); + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(bitmap); - r = this->_sharedItem->nativeBitmap->Construct(*pSrcScaledBitmapEx, pc_rect); + r = this->_sharedItem->nativeBitmap->Construct(*pSrcScaledBitmapEx, pcRect); } else { - r = this->_sharedItem->nativeBitmap->Construct(*pSrcBitmapEx, pc_rect); - } - - if (!IsFailed(r)) - { - this->_sharedItem->coordHolder->Init(vc_rect); + r = this->_sharedItem->nativeBitmap->Construct(*pSrcBitmapEx, pcRect); } return r; } - else - { - return this->_sharedItem->nativeBitmap->Construct(*pSrcBitmapEx, vc_rect); - } } result @@ -716,48 +702,32 @@ _BitmapImpl::Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& r return r; } - if (_ResUtil::NeedToConvertCoord()) - { - result r = this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); + r = this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); - if (!IsFailed(r)) + if (!IsFailed(r)) + { + if (autoScaling) { - Dimension vc_dim; - Dimension pc_dim; - - if (autoScaling) - { - vc_dim = rq_dim; - pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); - - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; + _Util::Dimension vcDim = { rq_dim.width, rq_dim.height }; - const BitmapScalingQuality quality = BITMAP_SCALING_QUALITY_LOW; + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - this->_sharedItem->nativeBitmap->ScaleEx(pc_dim, quality); - } - else - { - pc_dim = rq_dim; - vc_dim = _ResUtil::ConvertToVirCoord(pc_dim); - } + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); + Dimension pcDim(this->_sharedItem->coordHolder->size.pcInt.w, this->_sharedItem->coordHolder->size.pcInt.h); + const BitmapScalingQuality quality = BITMAP_SCALING_QUALITY_LOW; - this->_sharedItem->coordHolder->bitmapSize.required = vc_rect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pc_rect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vc_rect; + this->_sharedItem->nativeBitmap->ScaleEx(pcDim, quality); } + else + { + _Util::Dimension pcDim = { rq_dim.width, rq_dim.height }; - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); + this->_sharedItem->coordHolder->ResetFromPc(pcDim); + } } + + return r; } result @@ -775,48 +745,32 @@ _BitmapImpl::Construct(const byte* pBuffer, int bufSize, const Dimension& rq_dim SysTryReturnResult(NID_GRP, (bufSize > 0) && (bufSize >= rq_dim.width * rq_dim.height * _GetBytesPerPixel(pixelFormat)), E_INVALID_ARG, "The specified buffer size is too small (buffer size = %d, dim(%d, %d))", bufSize, rq_dim.width, rq_dim.height); - if (_ResUtil::NeedToConvertCoord()) - { - result r = this->_sharedItem->nativeBitmap->Construct(pBuffer, bufSize, rq_dim, pixelFormat); - - if (!IsFailed(r)) - { - Dimension vc_dim; - Dimension pc_dim; - - if (autoScaling) - { - vc_dim = rq_dim; - pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); + _Util::Dimension vcDim = { rq_dim.width, rq_dim.height }; - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - const BitmapScalingQuality quality = BITMAP_SCALING_QUALITY_LOW; + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - this->_sharedItem->nativeBitmap->ScaleEx(pc_dim, quality); - } - else - { - pc_dim = rq_dim; - vc_dim = _ResUtil::ConvertToVirCoord(pc_dim); - } + result r = this->_sharedItem->nativeBitmap->Construct(pBuffer, bufSize, rq_dim, pixelFormat); - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); + if (!IsFailed(r) && _ResUtil::NeedToConvertCoord()) + { + if (autoScaling) + { + Dimension pcDim(this->_sharedItem->coordHolder->size.pcInt.w, this->_sharedItem->coordHolder->size.pcInt.h); + const BitmapScalingQuality quality = BITMAP_SCALING_QUALITY_LOW; - this->_sharedItem->coordHolder->bitmapSize.required = vc_rect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pc_rect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vc_rect; + this->_sharedItem->nativeBitmap->ScaleEx(pcDim, quality); } + else + { + _Util::Dimension pcDim = { rq_dim.width, rq_dim.height }; - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(pBuffer, bufSize, rq_dim, pixelFormat); + this->_sharedItem->coordHolder->ResetFromPc(pcDim); + } } + + return r; } result @@ -848,73 +802,60 @@ _BitmapImpl::Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& r break; } - if (_ResUtil::NeedToConvertCoord()) - { - result r = this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); + _Util::Dimension vcDim = { rq_dim.width, rq_dim.height }; - if (!IsFailed(r)) - { - Dimension vc_dim = rq_dim; - Dimension pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); + this->_sharedItem->coordHolder->ResetFromVc(vcDim); - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); - this->_sharedItem->lazyScaling = 1; + r = this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); + + if (!IsFailed(r) && _ResUtil::NeedToConvertCoord()) + { + this->_sharedItem->lazyScaling = 1; - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); + { + Dimension vc_dim = rq_dim; + Dimension pc_dim(this->_sharedItem->coordHolder->size.pcInt.w, this->_sharedItem->coordHolder->size.pcInt.h); - this->_sharedItem->coordHolder->bitmapSize.required = vc_rect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pc_rect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vc_rect; + bool isScaledBufferAvailable = false; + Tizen::Base::ByteBuffer scaledBuffer; { - bool isScaledBufferAvailable = false; + int scaledCapacity = _GetBytesPerPixel(pixelFormat) * (pc_dim.width * pc_dim.height); + SysAssert(scaledCapacity > 0); - Tizen::Base::ByteBuffer scaledBuffer; + // OOM ignored + isScaledBufferAvailable = (scaledBuffer.Construct(scaledCapacity) == E_SUCCESS); + } - { - int scaledCapacity = _GetBytesPerPixel(pixelFormat) * (pc_dim.width * pc_dim.height); - SysAssert(scaledCapacity > 0); + if (isScaledBufferAvailable) + { + _ScaleBuffer(scaledBuffer, pc_dim, buffer, vc_dim, pixelFormat); - // OOM ignored - isScaledBufferAvailable = (scaledBuffer.Construct(scaledCapacity) == E_SUCCESS); - } + this->_sharedItem->scaledNativeBitmap.reset(new (std::nothrow) _Bitmap); - if (isScaledBufferAvailable) + if (this->_sharedItem->scaledNativeBitmap.get()) { - _ScaleBuffer(scaledBuffer, pc_dim, buffer, vc_dim, pixelFormat); - - this->_sharedItem->scaledNativeBitmap.reset(new (std::nothrow) _Bitmap); - - if (this->_sharedItem->scaledNativeBitmap.get()) + if (this->_sharedItem->scaledNativeBitmap->Construct(scaledBuffer, pc_dim, pixelFormat) == E_SUCCESS) { - if (this->_sharedItem->scaledNativeBitmap->Construct(scaledBuffer, pc_dim, pixelFormat) == E_SUCCESS) - { - // Post-processing + // Post-processing - // BufferInfo bufferInfo; - // this->_scaledNativeBitmap->Lock(bufferInfo); - // this->_scaledNativeBitmap->Unlock(); - ; - } - else - { - this->_sharedItem->scaledNativeBitmap.reset(null); - } + // BufferInfo bufferInfo; + // this->_scaledNativeBitmap->Lock(bufferInfo); + // this->_scaledNativeBitmap->Unlock(); + ; + } + else + { + this->_sharedItem->scaledNativeBitmap.reset(null); } } } } - - return r; - } - else - { - return this->_sharedItem->nativeBitmap->Construct(buffer, rq_dim, pixelFormat); } + + return r; } result @@ -944,19 +885,148 @@ _BitmapImpl::Construct(const Tizen::Base::String& fileName, BitmapPixelFormat pi return E_SUCCESS; } -const Tizen::Base::String& -_BitmapImpl::GetFileName(void) const +result +_BitmapImpl::Construct(const FloatRectangle& vcRectF) { - if (this && this->_sharedItem.get()) + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, vcRectF.width > 0.0f && vcRectF.height > 0.0f, E_INVALID_ARG, "Both of width(%f) and height(%f) of a rectangle MUST be greater than 0.", vcRectF.width, vcRectF.height); + + SysTryReturnResult(NID_GRP, vcRectF.x >= 0.0f && vcRectF.y >= 0.0f, E_OUT_OF_RANGE, "The argument is out of range. (rect(x:%f,y:%f,w:%f,h:%f)).", vcRectF.x, vcRectF.y, vcRectF.width, vcRectF.height); + { - return this->_sharedItem->associated.fileName; + _Util::Dimension vcDimF = { vcRectF.width, vcRectF.height }; + + this->_sharedItem->coordHolder->ResetFromVc(vcDimF); + + // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0); + + FloatRectangle pcRectF = _ResUtil::ConvertToPhyCoord(vcRectF); + Rectangle pcRect; + + pcRect.x = _FloatToIntForPos(pcRectF.x); + pcRect.y = _FloatToIntForPos(pcRectF.y); + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; + + return this->_sharedItem->nativeBitmap->Construct(pcRect); } - else +} + +result +_BitmapImpl::Construct(const FloatDimension& vcDimF, BitmapPixelFormat pixelFormat) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, vcDimF.width > 0.0f && vcDimF.height > 0.0f, E_INVALID_ARG, "Both of width(%f) and height(%f) of a dimension MUST be greater than 0.", vcDimF.width, vcDimF.height); + + switch (pixelFormat) + { + case BITMAP_PIXEL_FORMAT_RGB565: + case BITMAP_PIXEL_FORMAT_ARGB8888: + case BITMAP_PIXEL_FORMAT_R8G8B8A8: + break; + default: + SysTryReturnResult(NID_GRP, 0, E_INVALID_ARG, "BitmapPixelFormat(%d) is invalid argument.", pixelFormat); + break; + } + + { + _Util::Dimension vcUtilDimF = { vcDimF.width, vcDimF.height }; + + this->_sharedItem->coordHolder->ResetFromVc(vcUtilDimF); + + Dimension pcDim(this->_sharedItem->coordHolder->size.pcInt.w, this->_sharedItem->coordHolder->size.pcInt.h); + + return this->_sharedItem->nativeBitmap->Construct(pcDim, pixelFormat); + } +} + +result +_BitmapImpl::Construct(const _CanvasImpl& canvas, const FloatRectangle& vcRectF) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, &canvas, E_INVALID_ARG, "A canvas is invalid."); + SysTryReturnResult(NID_GRP, canvas._pNativeCanvas && canvas._pNativeCanvas->IsValid(), E_INVALID_ARG, "A canvas is invalid."); + + FloatRectangle rtCanvas = canvas.GetBoundsF(); + + SysTryReturnResult(NID_GRP, !rtCanvas.IsEmpty(), E_INVALID_ARG, "A canvas is empty."); + + SysTryReturnResult(NID_GRP, vcRectF.width > 0.0f && vcRectF.height > 0.0f, E_INVALID_ARG, "Both of width(%f) and height(%f) of a rectangle MUST be greater than 0.", vcRectF.width, vcRectF.height); + + SysTryReturnResult(NID_GRP, _CheckValidity(vcRectF, rtCanvas), E_OUT_OF_RANGE, "The argument is out of range. (rect(x:%f,y:%f,w:%f,h:%f)).", vcRectF.x, vcRectF.y, vcRectF.width, vcRectF.height); + + Tizen::Graphics::_Canvas* pCanvasEx = canvas._pNativeCanvas; + + { + _Util::Dimension vcDimF = { vcRectF.width, vcRectF.height }; + + this->_sharedItem->coordHolder->ResetFromVc(vcDimF); + + FloatRectangle pcRectF = _ResUtil::ConvertToPhyCoord(vcRectF); + Rectangle pcRect; + + pcRect.x = _FloatToIntForPos(pcRectF.x); + pcRect.y = _FloatToIntForPos(pcRectF.y); + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; + + return this->_sharedItem->nativeBitmap->Construct(*pCanvasEx, pcRect); + } +} + +result +_BitmapImpl::Construct(const _BitmapImpl& bitmap, const FloatRectangle& vcRectF) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, BITMAPIMPL_IS_VALID(&bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, vcRectF.width > 0.0f && vcRectF.height > 0.0f, E_INVALID_ARG, "Both of width(%f) and height(%f) of a rectangle MUST be greater than 0.", vcRectF.width, vcRectF.height); + + FloatRectangle rtBitmap(0, 0, bitmap.GetWidthF(), bitmap.GetHeightF()); + + SysTryReturnResult(NID_GRP, _CheckValidity(vcRectF, rtBitmap), E_OUT_OF_RANGE, "The argument is out of range. (rect(x:%f,y:%f,w:%f,h:%f)).", vcRectF.x, vcRectF.y, vcRectF.width, vcRectF.height); + + _Bitmap* pSrcBitmapEx = Tizen::Graphics::_GetBitmapEx(bitmap); + { - static Tizen::Base::String emptyString; - emptyString.Clear(); + _Util::Dimension vcDimF = { vcRectF.width, vcRectF.height }; + + this->_sharedItem->coordHolder->ResetFromVc(vcDimF); + + FloatRectangle pcRectF = _ResUtil::ConvertToPhyCoord(vcRectF); + Rectangle pcRect; + + pcRect.x = _FloatToIntForPos(pcRectF.x); + pcRect.y = _FloatToIntForPos(pcRectF.y); + pcRect.width = this->_sharedItem->coordHolder->size.pcInt.w; + pcRect.height = this->_sharedItem->coordHolder->size.pcInt.h; + + result r = E_SUCCESS; + + if (Tizen::Graphics::_IsLazyScalingBitmap(bitmap)) + { + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(bitmap); - return emptyString; + r = this->_sharedItem->nativeBitmap->Construct(*pSrcScaledBitmapEx, pcRect); + } + else + { + r = this->_sharedItem->nativeBitmap->Construct(*pSrcBitmapEx, pcRect); + } + + return r; } } @@ -974,90 +1044,142 @@ _BitmapImpl::Scale(const Dimension& vc_dim) _UpdateBitmapTimeStamp(*this); + result r = E_SUCCESS; + + _Util::Dimension vcDim = { vc_dim.width, vc_dim.height }; + _BitmapCoordinateHolder tempCoordinateHolder; + + tempCoordinateHolder.ResetFromVc(vcDim); + + // SysAssert(tempCoordinateHolder.size.pcInt.w > 0 && tempCoordinateHolder.size.pcInt.h > 0); + if (_ResUtil::NeedToConvertCoord()) { if (this->_sharedItem->lazyScaling && this->_sharedItem->scaledNativeBitmap.get()) { - Dimension pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); - - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; - - result r = this->_sharedItem->nativeBitmap->Scale(vc_dim); + r = this->_sharedItem->nativeBitmap->Scale(vc_dim); if (!IsFailed(r)) { - Rectangle vc_rect(0, 0, vc_dim.width, vc_dim.height); + Dimension pcDim(tempCoordinateHolder.size.pcInt.w, tempCoordinateHolder.size.pcInt.h); - this->_sharedItem->coordHolder->Init(vc_rect); - this->_sharedItem->coordHolder->bitmapSize.phyCoord.w = pc_dim.width; - this->_sharedItem->coordHolder->bitmapSize.phyCoord.h = pc_dim.height; - - result r = this->_sharedItem->scaledNativeBitmap->Scale(pc_dim); + result r = this->_sharedItem->scaledNativeBitmap->Scale(pcDim); if (!IsFailed(r)) { _UpdateScaledBitmapEx(this->_sharedItem->nativeBitmap.get(), this->_sharedItem->scaledNativeBitmap.get()); } + // @ykahn If it fails, then how to undo its status. } - - return r; } else { - Dimension pc_dim = _ResUtil::ConvertToPhyCoord(vc_dim); - - // special case - pc_dim.width = (pc_dim.width > 0) ? pc_dim.width : 1; - pc_dim.height = (pc_dim.height > 0) ? pc_dim.height : 1; + Dimension pcDim(tempCoordinateHolder.size.pcInt.w, tempCoordinateHolder.size.pcInt.h); - result r = this->_sharedItem->nativeBitmap->Scale(pc_dim); - - if (!IsFailed(r)) - { - Rectangle vc_rect(0, 0, vc_dim.width, vc_dim.height); - - this->_sharedItem->coordHolder->Init(vc_rect); - this->_sharedItem->coordHolder->bitmapSize.phyCoord.w = pc_dim.width; - this->_sharedItem->coordHolder->bitmapSize.phyCoord.h = pc_dim.height; - } - - return r; + r = this->_sharedItem->nativeBitmap->Scale(pcDim); } } else { - return this->_sharedItem->nativeBitmap->Scale(vc_dim); + r = this->_sharedItem->nativeBitmap->Scale(vc_dim); + } + + if (r == E_SUCCESS) + { + memcpy(this->_sharedItem->coordHolder.get(), &tempCoordinateHolder, sizeof(tempCoordinateHolder)); } + + return r; } result -_BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle& vc_srcRect) +_BitmapImpl::Scale(const FloatDimension& vcDimF) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - SysTryReturnResult(NID_GRP, &src && src._sharedItem.get(), E_INVALID_ARG, "The source bitmap is invalid."); - - SysTryReturnResult(NID_GRP, src._sharedItem->nativeBitmap->IsValid(), E_INVALID_ARG, "The source bitmap is invalid."); - - SysTryReturnResult(NID_GRP, &vc_srcRect, E_INVALID_ARG, "The source rectangle is invalid."); - SysTryReturnResult(NID_GRP, &vc_dest, E_INVALID_ARG, "The destination position is invalid."); - SysTryReturnResult(NID_GRP, vc_dest.x >= 0 && vc_dest.y >= 0, E_OUT_OF_RANGE, "The argument is out of range. (dest(x:%d,y:%d)).", vc_dest.x, vc_dest.y); - - SysTryReturnResult(NID_GRP, (vc_srcRect.width >= 0) && (vc_srcRect.height >= 0), E_INVALID_ARG, "The given rectangle(width:%d,height:%d) is invalid.", vc_srcRect.width, vc_srcRect.height); + SysTryReturnResult(NID_GRP, vcDimF.width > 0.0f && vcDimF.height > 0.0f, E_OUT_OF_RANGE, "Both of width(%f) and height(%f) MUST be greater than 0.", vcDimF.width, vcDimF.height); - if ((vc_srcRect.width == 0) || (vc_srcRect.height == 0)) + if (vcDimF.width == this->GetWidthF() && vcDimF.height == this->GetHeightF()) { return E_SUCCESS; } _UpdateBitmapTimeStamp(*this); - Rectangle rtBitmap(0, 0, src.GetWidth(), src.GetHeight()); + result r = E_SUCCESS; + + _Util::Dimension vcUtilDimF = { vcDimF.width, vcDimF.height }; + _BitmapCoordinateHolder tempCoordinateHolder; + + tempCoordinateHolder.ResetFromVc(vcUtilDimF); + + Dimension vcDim(tempCoordinateHolder.size.vcInt.w, tempCoordinateHolder.size.vcInt.h); + + if (_ResUtil::NeedToConvertCoord()) + { + if (this->_sharedItem->lazyScaling && this->_sharedItem->scaledNativeBitmap.get()) + { + r = this->_sharedItem->nativeBitmap->Scale(vcDim); + + if (!IsFailed(r)) + { + Dimension pcDim(tempCoordinateHolder.size.pcInt.w, tempCoordinateHolder.size.pcInt.h); + + r = this->_sharedItem->scaledNativeBitmap->Scale(pcDim); + + if (!IsFailed(r)) + { + _UpdateScaledBitmapEx(this->_sharedItem->nativeBitmap.get(), this->_sharedItem->scaledNativeBitmap.get()); + } + } + } + else + { + Dimension pcDim(tempCoordinateHolder.size.pcInt.w, tempCoordinateHolder.size.pcInt.h); + + r = this->_sharedItem->nativeBitmap->Scale(pcDim); + } + } + else + { + r = this->_sharedItem->nativeBitmap->Scale(vcDim); + } + + if (r == E_SUCCESS) + { + memcpy(this->_sharedItem->coordHolder.get(), &tempCoordinateHolder, sizeof(tempCoordinateHolder)); + } + + return r; +} + + +result +_BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle& vc_srcRect) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, &src && src._sharedItem.get(), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, src._sharedItem->nativeBitmap->IsValid(), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, &vc_srcRect, E_INVALID_ARG, "The source rectangle is invalid."); + SysTryReturnResult(NID_GRP, &vc_dest, E_INVALID_ARG, "The destination position is invalid."); + SysTryReturnResult(NID_GRP, vc_dest.x >= 0 && vc_dest.y >= 0, E_OUT_OF_RANGE, "The argument is out of range. (dest(x:%d,y:%d)).", vc_dest.x, vc_dest.y); + + SysTryReturnResult(NID_GRP, (vc_srcRect.width >= 0) && (vc_srcRect.height >= 0), E_INVALID_ARG, "The given rectangle(width:%d,height:%d) is invalid.", vc_srcRect.width, vc_srcRect.height); + + if ((vc_srcRect.width == 0) || (vc_srcRect.height == 0)) + { + return E_SUCCESS; + } + + _UpdateBitmapTimeStamp(*this); + + Rectangle rtBitmap(0, 0, src.GetWidth(), src.GetHeight()); SysTryReturnResult(NID_GRP, _CheckValidity(vc_srcRect, rtBitmap), E_OUT_OF_RANGE, "The argument is out of range. (srcRect(x:%d,y:%d,w:%d,h:%d)).", vc_srcRect.x, vc_srcRect.y, vc_srcRect.width, vc_srcRect.height); - _Bitmap* pSrcBitmapEx = Tizen::Graphics::GetBitmapEx(src); + _Bitmap* pSrcBitmapEx = Tizen::Graphics::_GetBitmapEx(src); _Bitmap* pDstBitmapEx = this->_sharedItem->nativeBitmap.get(); if (_ResUtil::NeedToConvertCoord()) @@ -1077,8 +1199,8 @@ _BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle merge level 0 (using virtual coordinate) merge level 1 (using physical coordinate) */ - int caseNo = (Tizen::Graphics::IsLazyScalingBitmap(src)) ? 2 : 0; - caseNo += (Tizen::Graphics::IsLazyScalingBitmap(*this)) ? 1 : 0; + int caseNo = (Tizen::Graphics::_IsLazyScalingBitmap(src)) ? 2 : 0; + caseNo += (Tizen::Graphics::_IsLazyScalingBitmap(*this)) ? 1 : 0; switch (caseNo) { @@ -1094,9 +1216,14 @@ _BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle { _Bitmap srcResizedBitmap; { - Dimension srcVirDim(src._sharedItem->coordHolder->bitmapSize.virCoord.w, src._sharedItem->coordHolder->bitmapSize.virCoord.h); + Dimension srcVcDim; + + srcVcDim.width = static_cast(src._sharedItem->coordHolder->size.vcFloatActual.w); + srcVcDim.height = static_cast(src._sharedItem->coordHolder->size.vcFloatActual.h); + + // @ykahn Need to check + r = srcResizedBitmap.Construct(srcVcDim, pSrcBitmapEx->GetPixelColorFormat()); - r = srcResizedBitmap.Construct(srcVirDim, pSrcBitmapEx->GetPixelColorFormat()); SysTryReturnResult(NID_GRP, !IsFailed(r), E_OUT_OF_MEMORY, "Fails to allocate memory."); } @@ -1115,7 +1242,7 @@ _BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle } case 2: // destination: pre-scale --> merge from the level1 bitmap of source { - _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::GetScaledBitmapEx(src); + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(src); if (pSrcScaledBitmapEx) @@ -1133,7 +1260,7 @@ _BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle { result r = pDstBitmapEx->Merge(vc_dest, *pSrcBitmapEx, vc_srcRect); - _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::GetScaledBitmapEx(src); + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(src); if (this->_sharedItem->scaledNativeBitmap.get() && pSrcScaledBitmapEx) { @@ -1156,6 +1283,142 @@ _BitmapImpl::Merge(const Point& vc_dest, const _BitmapImpl& src, const Rectangle return E_OPERATION_FAILED; } +result +_BitmapImpl::Merge(const FloatPoint& destVcPosF, const _BitmapImpl& srcBitmap, const FloatRectangle& srcVcRectF) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, &srcBitmap && srcBitmap._sharedItem.get(), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, srcBitmap._sharedItem->nativeBitmap->IsValid(), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, &srcVcRectF, E_INVALID_ARG, "The source rectangle is invalid."); + SysTryReturnResult(NID_GRP, &destVcPosF, E_INVALID_ARG, "The destination position is invalid."); + SysTryReturnResult(NID_GRP, destVcPosF.x >= 0.0f && destVcPosF.y >= 0.0f, E_OUT_OF_RANGE, "The argument is out of range. (destPoint(x:%f,y:%f)).", destVcPosF.x, destVcPosF.y); + + SysTryReturnResult(NID_GRP, srcVcRectF.width >= 0.0f && srcVcRectF.height >= 0.0f, E_INVALID_ARG, "The given rectangle(width:%f,height:%f) is invalid.", srcVcRectF.width, srcVcRectF.height); + + if ((srcVcRectF.width == 0.0f) || (srcVcRectF.height == 0.0f)) + { + return E_SUCCESS; + } + + _UpdateBitmapTimeStamp(*this); + + FloatRectangle rtBitmap(0, 0, srcBitmap.GetActualWidth(), srcBitmap.GetActualHeight()); + SysTryReturnResult(NID_GRP, _CheckValidity(srcVcRectF, rtBitmap), E_OUT_OF_RANGE, "The argument is out of range. (srcRect(x:%f,y:%f,w:%f,h:%f)).", srcVcRectF.x, srcVcRectF.y, srcVcRectF.width, srcVcRectF.height); + + _Bitmap* pSrcBitmapEx = Tizen::Graphics::_GetBitmapEx(srcBitmap); + _Bitmap* pDstBitmapEx = this->_sharedItem->nativeBitmap.get(); + + Point destVcPos(_FloatToIntForPos(destVcPosF.x), _FloatToIntForPos(destVcPosF.y)); + Rectangle srcVcRect; + + srcVcRect.x = _FloatToIntForPos(srcVcRectF.x); + srcVcRect.y = _FloatToIntForPos(srcVcRectF.y); + srcVcRect.width = _FloatToIntForPos(srcVcRectF.GetBottomRight().x - srcVcRectF.GetTopLeft().x); + srcVcRect.height= _FloatToIntForPos(srcVcRectF.GetBottomRight().y - srcVcRectF.GetTopLeft().y); + + if (_ResUtil::NeedToConvertCoord()) + { + FloatPoint destPcPosF = _ResUtil::ConvertToPhyCoord(destVcPosF); + FloatRectangle srcPcRectF = _ResUtil::ConvertToPhyCoord(srcVcRectF); + + Point destPcPos(_FloatToIntForPos(destPcPosF.x), _FloatToIntForPos(destPcPosF.y)); + Rectangle srcPcRect; + + srcPcRect.x = _FloatToIntForPos(srcPcRectF.x); + srcPcRect.y = _FloatToIntForPos(srcPcRectF.y); + srcPcRect.width = _FloatToIntForPos(srcPcRectF.GetBottomRight().x - srcPcRectF.GetTopLeft().x); + srcPcRect.height= _FloatToIntForPos(srcPcRectF.GetBottomRight().y - srcPcRectF.GetTopLeft().y); + + /* + case 0: scaled bitmap -> scaled bitmap + merge level 0 + case 1: scaled bitmap -> lazy scaled bitmap + merge level 0 from the scaled source bitmap + merge level 0(src) and level 1(dst) + case 2: lazy scaled bitmap -> scaled bitmap + merge level 1(src) and level 0(dst) + case 3: lazy scaled bitmap -> lazy scaled bitmap + merge level 0 (using virtual coordinate) + merge level 1 (using physical coordinate) + */ + int caseNo = (Tizen::Graphics::_IsLazyScalingBitmap(srcBitmap)) ? 2 : 0; + caseNo += (Tizen::Graphics::_IsLazyScalingBitmap(*this)) ? 1 : 0; + + switch (caseNo) + { + case 0: // source: pre-scale, destination: pre-scale --> merge by using the physical coordinate + { + return pDstBitmapEx->Merge(destPcPos, *pSrcBitmapEx, srcPcRect); + } + case 1: // source: pre-scale --> level0 bitmap: merge after enlarging, level1 bitmap: merge from source directly + { + result r = E_SUCCESS; + + // step 1 + { + _Bitmap srcResizedBitmap; + { + Dimension srcVcDim; + + srcVcDim.width = static_cast(srcBitmap._sharedItem->coordHolder->size.vcFloatActual.w); + srcVcDim.height = static_cast(srcBitmap._sharedItem->coordHolder->size.vcFloatActual.h); + + r = srcResizedBitmap.Construct(srcVcDim, pSrcBitmapEx->GetPixelColorFormat()); + + SysTryReturnResult(NID_GRP, !IsFailed(r), E_OUT_OF_MEMORY, "Fails to allocate memory."); + } + + _UpdateScaledBitmapEx(pSrcBitmapEx, &srcResizedBitmap); + + r = pDstBitmapEx->Merge(destVcPos, srcResizedBitmap, srcVcRect); + } + + // step 2 + if (!IsFailed(r) && this->_sharedItem->scaledNativeBitmap.get()) + { + return this->_sharedItem->scaledNativeBitmap->Merge(destPcPos, *pSrcBitmapEx, srcPcRect); + } + + return r; + } + case 2: // destination: pre-scale --> merge from the level1 bitmap of source + { + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(srcBitmap); + + SysTryReturnResult(NID_GRP, pSrcScaledBitmapEx != null, E_INVALID_ARG, "The source bitmap is invalid."); + + return pDstBitmapEx->Merge(destPcPos, *pSrcScaledBitmapEx, srcPcRect); + } + case 3: // source: lazy-scale, destination: lazy-scale --> merge between level0, merge between level1 + { + result r = pDstBitmapEx->Merge(destVcPos, *pSrcBitmapEx, srcVcRect); + + _Bitmap* pSrcScaledBitmapEx = Tizen::Graphics::_GetScaledBitmapEx(srcBitmap); + + if (this->_sharedItem->scaledNativeBitmap.get() && pSrcScaledBitmapEx) + { + this->_sharedItem->scaledNativeBitmap->Merge(destPcPos, *pSrcScaledBitmapEx, srcPcRect); + } + + return r; + } + default: + SysAssert(0); + return E_INVALID_ARG; + } + } + else + { + return pDstBitmapEx->Merge(destVcPos, *pSrcBitmapEx, srcVcRect); + } + + // for removing compiler warnings + return E_OPERATION_FAILED; +} + int _BitmapImpl::GetHeight() const { @@ -1165,14 +1428,31 @@ _BitmapImpl::GetHeight() const return -1; } - if (_ResUtil::NeedToConvertCoord()) + return this->_sharedItem->coordHolder->size.vcInt.h; +} + +float +_BitmapImpl::GetHeightF(void) const +{ + if (!(INSTANCE_IS_VALID)) { - return this->_sharedItem->coordHolder->bitmapSize.required.h; + SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); + return -1.0f; } - else + + return this->_sharedItem->coordHolder->size.vcFloat.h; +} + +float +_BitmapImpl::GetActualHeight(void) const +{ + if (!(INSTANCE_IS_VALID)) { - return this->_sharedItem->nativeBitmap->GetHeight(); + SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); + return -1.0f; } + + return this->_sharedItem->coordHolder->size.vcFloatActual.h; } int @@ -1184,14 +1464,31 @@ _BitmapImpl::GetWidth() const return -1; } - if (_ResUtil::NeedToConvertCoord()) + return this->_sharedItem->coordHolder->size.vcInt.w; +} + +float +_BitmapImpl::GetWidthF(void) const +{ + if (!(INSTANCE_IS_VALID)) { - return this->_sharedItem->coordHolder->bitmapSize.required.w; + SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); + return -1.0f; } - else + + return this->_sharedItem->coordHolder->size.vcFloat.w; +} + +float +_BitmapImpl::GetActualWidth(void) const +{ + if (!(INSTANCE_IS_VALID)) { - return this->_sharedItem->nativeBitmap->GetWidth(); + SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); + return -1.0f; } + + return this->_sharedItem->coordHolder->size.vcFloatActual.w; } int @@ -1284,6 +1581,7 @@ _BitmapImpl::GetScalingQuality(void) const bool _BitmapImpl::IsNinePatchedBitmap(void) const { +#if 0 if (!(INSTANCE_IS_VALID)) { SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); @@ -1293,6 +1591,26 @@ _BitmapImpl::IsNinePatchedBitmap(void) const _Bitmap* pRefBitmap = (this->_sharedItem->lazyScaling && this->_sharedItem->scaledNativeBitmap.get()) ? this->_sharedItem->scaledNativeBitmap.get() : this->_sharedItem->nativeBitmap.get(); return pRefBitmap->IsNinePatchedBitmap(); +#else + if (!(IS_INSTANCE_VALID)) + { + SysLog(NID_GRP, "[E_OPERATION_FAILED] This instance is not constructed yet."); + return false; + } + + const Tizen::Base::String& associatedFileName = this->_sharedItem->associated.fileName; + + if (associatedFileName.IsEmpty()) + { + _Bitmap* pRefBitmap = (this->_sharedItem->lazyScaling && this->_sharedItem->scaledNativeBitmap.get()) ? this->_sharedItem->scaledNativeBitmap.get() : this->_sharedItem->nativeBitmap.get(); + + return pRefBitmap->IsNinePatchedBitmap(); + } + else + { + return HasNinePatchedBitmapTag(associatedFileName); + } +#endif } void @@ -1390,6 +1708,31 @@ _BitmapImpl::UnlockFast() } bool +_BitmapImpl::CheckNinePatchedBitmapStrictly(const Bitmap& bitmap) +{ + const _BitmapImpl* pThis = _BitmapImpl::GetInstance(bitmap); + + if (!(IS_BITMAPIMPL_VALID(pThis))) + { + SysLog(NID_GRP, "[E_OPERATION_FAILED] The given bitmap is not constructed yet."); + return false; + } + + const Tizen::Base::String& associatedFileName = pThis->_sharedItem->associated.fileName; + + if (associatedFileName.IsEmpty()) + { + _Bitmap* pRefBitmap = (pThis->_sharedItem->lazyScaling && pThis->_sharedItem->scaledNativeBitmap.get()) ? pThis->_sharedItem->scaledNativeBitmap.get() : pThis->_sharedItem->nativeBitmap.get(); + + return pRefBitmap->IsNinePatchedBitmap(true); + } + else + { + return HasNinePatchedBitmapTag(associatedFileName); + } +} + +bool _BitmapImpl::_SetCallback(void (* DestroyCallback)(void*), void* pDestroyCallbackParam, void (* LockCallback)(void*), void* pLockCallbackParam, void (* UnlockCallback)(void*), void* pUnlockCallbackParam) @@ -1425,6 +1768,109 @@ _BitmapImpl::_SetCallback(void (* DestroyCallback)(void*), void* pDestroyCallbac } Bitmap* +_BitmapImpl::GetExpandedBitmapFN(const Bitmap& ninePatchedBitmap, float width, float height) +{ + SysTryReturn(NID_GRP, width > 0.0f && height > 0.0f, null, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid (width = %f, height = %f)", width, height); + + SysTryReturn(NID_GRP, &ninePatchedBitmap, null, E_INVALID_ARG, "[E_INVALID_ARG] The given bitmap is invalid (null reference passed)"); + + const _BitmapImpl* pSrcBitmapImpl = _BitmapImpl::GetInstance(ninePatchedBitmap); + + SysTryReturn(NID_GRP, BITMAPIMPL_IS_VALID(pSrcBitmapImpl), null, E_INVALID_ARG, "[E_INVALID_ARG] The given bitmap is invalid"); + + SysTryReturn(NID_GRP, pSrcBitmapImpl->IsNinePatchedBitmap(), null, E_INVALID_ARG, "[E_INVALID_ARG] The given bitmap is not a nine-patched bitmap"); + + BitmapPixelFormat pixelFormat = pSrcBitmapImpl->GetPixelColorFormat(); + + switch (pixelFormat) + { + case BITMAP_PIXEL_FORMAT_RGB565: + case BITMAP_PIXEL_FORMAT_ARGB8888: + break; + default: + SysTryReturn(NID_GRP, false, null, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] Pixel format of the given bitmap is invalid (%d)", pixelFormat); + break; + } + + std::auto_ptr expandedBitmap(new (std::nothrow) Bitmap); + + SysTryReturn(NID_GRP, expandedBitmap.get(), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed (new Bitmap)"); + + result r = expandedBitmap->Construct(FloatDimension(width, height), pixelFormat); + + SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _BitmapImpl* pDstBitmapImpl = _BitmapImpl::GetInstance(*expandedBitmap.get()); + + SysAssert(pDstBitmapImpl != null); + + { + _Util::LockManager srcBitmap(*pSrcBitmapImpl); + _Util::LockManager dstBitmap(*pDstBitmapImpl); + + SysTryReturn(NID_GRP, srcBitmap.IsValid(), null, srcBitmap.GetResult(), "[%s] Buffer locking of the source bitmap failed", srcBitmap.GetResult()); + SysTryReturn(NID_GRP, dstBitmap.IsValid(), null, dstBitmap.GetResult(), "[%s] Buffer locking of the target bitmap failed", dstBitmap.GetResult()); + + if (dstBitmap.GetBufferInfo().width < srcBitmap.GetBufferInfo().width - 2 || + dstBitmap.GetBufferInfo().height < srcBitmap.GetBufferInfo().height - 2) + { + // down-scales from the source bitmap only + const BufferInfo& srcBufferInfo = srcBitmap.GetBufferInfo(); + const BufferInfo& dstBufferInfo = dstBitmap.GetBufferInfo(); + + memset(dstBufferInfo.pPixels, 0, dstBufferInfo.pitch * dstBufferInfo.height); + + _Util::Pixmap dstImage(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, (void*) dstBufferInfo.pPixels, dstBufferInfo.pitch); + + Rectangle sourRect(1, 1, srcBufferInfo.width - 2, srcBufferInfo.height - 2); + Rectangle destRect(0, 0, dstBufferInfo.width, dstBufferInfo.height); + + unsigned char* pSrcPixels = (unsigned char*) srcBufferInfo.pPixels + sourRect.y * srcBufferInfo.pitch + sourRect.x * (srcBufferInfo.bitsPerPixel / 8); + _Util::Pixmap srcImage(sourRect.width, sourRect.height, srcBufferInfo.bitsPerPixel, (void*) pSrcPixels, srcBufferInfo.pitch); + + Tizen::Graphics::_Effect::ScaleImage(dstImage, destRect.x, destRect.y, destRect.width, destRect.height, srcImage, Tizen::Graphics::_Effect::ROP_COPY); + } + else + { + const BufferInfo& srcBufferInfo = srcBitmap.GetBufferInfo(); + const BufferInfo& dstBufferInfo = dstBitmap.GetBufferInfo(); + + memset(dstBufferInfo.pPixels, 0, dstBufferInfo.pitch * dstBufferInfo.height); + + _Util::Pixmap dstImage(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, (void*) dstBufferInfo.pPixels, dstBufferInfo.pitch); + + _Util::AccumList<_Util::Pair<_Util::Rectangle, _Util::Rectangle > > boundsList; + + Rectangle destRect(0, 0, dstBufferInfo.width, dstBufferInfo.height); + + // assert(pSrcBitmapImpl->_nativeBitmap); + r = _Util::GetPatchList(boundsList, destRect, *pSrcBitmapImpl->_sharedItem->nativeBitmap.get()); + + SysTryReturn(NID_GRP, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] _Util::GetPatchList() failed (error = %#x)", r); + + _Util::AccumList<_Util::Pair<_Util::Rectangle, _Util::Rectangle > >::Iterator iter = boundsList.Begin(); + + while (iter != boundsList.End()) + { + Rectangle destRect(iter->first.x, iter->first.y, iter->first.w, iter->first.h); + Rectangle sourRect(iter->second.x, iter->second.y, iter->second.w, iter->second.h); + + { + unsigned char* pSrcPixels = (unsigned char*) srcBufferInfo.pPixels + sourRect.y * srcBufferInfo.pitch + sourRect.x * (srcBufferInfo.bitsPerPixel / 8); + _Util::Pixmap srcImage(sourRect.width, sourRect.height, srcBufferInfo.bitsPerPixel, (void*) pSrcPixels, srcBufferInfo.pitch); + + Tizen::Graphics::_Effect::ScaleImage(dstImage, destRect.x, destRect.y, destRect.width, destRect.height, srcImage, Tizen::Graphics::_Effect::ROP_COPY); + } + + ++iter; + } + } + } + + return expandedBitmap.release(); +} + +Bitmap* _BitmapImpl::GetExpandedBitmapN(const Bitmap& ninePatchedBitmap, int width, int height) { SysTryReturn(NID_GRP, width > 0 && height > 0, null, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid (width = %d, height = %d)", width, height); @@ -1724,6 +2170,71 @@ _BitmapImpl::GetNonScaledBitmapN(const Tizen::Base::ByteBuffer& buffer, const Di return Tizen::Graphics::_BitmapUtil::CreateBitmapN(pBitmapImpl); } +Bitmap* +_BitmapImpl::GetNonScaledBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, const FloatDimension& logicalSize) +{ + Bitmap* pBitmap = GetNonScaledBitmapN(buffer, dim, pixelFormat); + + if (pBitmap) + { + _BitmapImpl* pBitmapImpl = _BitmapImpl::GetInstance(*pBitmap); + + if (pBitmapImpl) + { + pBitmapImpl->_sharedItem->coordHolder->size.vcFloat.w = logicalSize.width; + pBitmapImpl->_sharedItem->coordHolder->size.vcFloat.h = logicalSize.height; + } + else + { + delete pBitmap; + pBitmap = null; + } + } + + return pBitmap; +} + +bool +_BitmapImpl::HasNinePatchedBitmapTag(Tizen::Base::String fileName) +{ + const wchar_t* NINE_PATCHED_TAG = L".#.png"; // it must consist of lower-case characters + const int NINE_PATCHED_TAG_LENGTH = 6; + + struct Temp + { + static wchar_t ToLower(wchar_t ch) + { + return (ch >= L'A' && ch <= L'Z') ? ch + 'a' - 'A' : ch; + } + }; + + _Util::String tempStr(fileName.GetPointer(), fileName.GetLength()); + + while (tempStr.length > 0 && tempStr.pStart[tempStr.length - 1] == L' ') + { + --tempStr.length; + } + + _Util::String testStr(tempStr.pStart, tempStr.length, tempStr.length - NINE_PATCHED_TAG_LENGTH, NINE_PATCHED_TAG_LENGTH); + + if (testStr.length == NINE_PATCHED_TAG_LENGTH) + { + for (int i = 0; i < NINE_PATCHED_TAG_LENGTH; i++) + { + if (Temp::ToLower(testStr.pStart[i]) == NINE_PATCHED_TAG[i]) + { + continue; + } + + return false; + } + + return true; + } + + return false; +} + _BitmapImpl*& _BitmapImpl::_GetBitmapImpl(Bitmap* pBitmap) { diff --git a/src/graphics/FGrp_BitmapUtil.cpp b/src/graphics/FGrp_BitmapUtil.cpp old mode 100644 new mode 100755 index 08d4ccc..f2eacf6 --- a/src/graphics/FGrp_BitmapUtil.cpp +++ b/src/graphics/FGrp_BitmapUtil.cpp @@ -40,7 +40,7 @@ namespace Tizen { namespace Graphics unsigned long _GetBitmapTimeStamp(const Tizen::Graphics::_BitmapImpl& bitmap); unsigned long _UpdateBitmapTimeStamp(Tizen::Graphics::_BitmapImpl& bitmap); -BitmapTemp::BitmapTemp(Canvas& canvas) +_BitmapTemp::_BitmapTemp(Canvas& canvas) : _BitmapImpl() , __isValid(false) { @@ -65,15 +65,11 @@ BitmapTemp::BitmapTemp(Canvas& canvas) this->_sharedItem->nativeBitmap->Construct((void*) canvasDesc.pPixels, canvasDesc.width, canvasDesc.height, canvasDesc.bitsPerPixel); - Dimension pc_dim(canvasDesc.width, canvasDesc.height); - Dimension vc_dim(canvas.GetBounds().width, canvas.GetBounds().height); + _Util::Dimension vcDimF = { canvas.GetBoundsF().width, canvas.GetBoundsF().height }; + _Util::Dimension vcDim = { canvas.GetBounds().width, canvas.GetBounds().height }; + _Util::Dimension pcDim = { canvasDesc.width, canvasDesc.height }; - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); - - this->_sharedItem->coordHolder->bitmapSize.required = vc_rect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pc_rect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vc_rect; + this->_sharedItem->coordHolder->ResetFromPc(pcDim, vcDim, vcDimF); canvas.Unlock(); @@ -81,7 +77,7 @@ BitmapTemp::BitmapTemp(Canvas& canvas) } } -BitmapTemp::BitmapTemp(void* pBuffer, int width, int height, int depth) +_BitmapTemp::_BitmapTemp(void* pBuffer, int width, int height, int depth) : _BitmapImpl() , __isValid(false) { @@ -97,20 +93,14 @@ BitmapTemp::BitmapTemp(void* pBuffer, int width, int height, int depth) return; } - Dimension pc_dim(width, height); - Dimension vc_dim = _ResUtil::ConvertToVirCoord(pc_dim); - - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); + _Util::Dimension pcDim = { width, height }; - this->_sharedItem->coordHolder->bitmapSize.required = vc_rect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pc_rect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vc_rect; + this->_sharedItem->coordHolder->ResetFromPc(pcDim); __isValid = true; } -BitmapTemp::BitmapTemp(Dimension physicalSize, int depth) +_BitmapTemp::_BitmapTemp(Dimension physicalSize, int depth) : _BitmapImpl() , __isValid(false) { @@ -126,25 +116,19 @@ BitmapTemp::BitmapTemp(Dimension physicalSize, int depth) return; } - Dimension pcDim(physicalSize.width, physicalSize.height); - Dimension vcDim = _ResUtil::ConvertToVirCoord(pcDim); - - _ResUtil::Rect vcRect(0, 0, vcDim.width, vcDim.height); - _ResUtil::Rect pcRect(0, 0, pcDim.width, pcDim.height); + _Util::Dimension pcDim = { physicalSize.width, physicalSize.height }; - this->_sharedItem->coordHolder->bitmapSize.required = vcRect; - this->_sharedItem->coordHolder->bitmapSize.phyCoord = pcRect; - this->_sharedItem->coordHolder->bitmapSize.virCoord = vcRect; + this->_sharedItem->coordHolder->ResetFromPc(pcDim); __isValid = true; } -BitmapTemp::~BitmapTemp() +_BitmapTemp::~_BitmapTemp() { } bool -BitmapTemp::IsValid(void) +_BitmapTemp::IsValid(void) { return __isValid; } @@ -214,7 +198,7 @@ Tizen::Graphics::_BitmapUtil::CreateBitmapN(_BitmapImpl* pBitmapImpl) Tizen::Graphics::Bitmap* Tizen::Graphics::_BitmapUtil::CreateBitmapN(void* pBuffer, int width, int height, int depth) { - std::auto_ptr bitmapTemp(new (std::nothrow) Tizen::Graphics::BitmapTemp(pBuffer, width, height, + std::auto_ptr bitmapTemp(new (std::nothrow) Tizen::Graphics::_BitmapTemp(pBuffer, width, height, depth)); SysTryReturn(NID_GRP, bitmapTemp.get() && bitmapTemp->IsValid(), 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -233,7 +217,7 @@ Tizen::Graphics::_BitmapUtil::CreateBitmapN(void* pBuffer, int width, int height Tizen::Graphics::Bitmap* Tizen::Graphics::_BitmapUtil::CreateBitmapN(Dimension physicalSize, int depth) { - std::auto_ptr bitmapTemp(new (std::nothrow) Tizen::Graphics::BitmapTemp(physicalSize, depth)); + std::auto_ptr bitmapTemp(new (std::nothrow) Tizen::Graphics::_BitmapTemp(physicalSize, depth)); SysTryReturn(NID_GRP, bitmapTemp.get() && bitmapTemp->IsValid(), 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -256,7 +240,7 @@ Tizen::Graphics::_BitmapUtil::ChangeBuffer(Tizen::Graphics::Bitmap& srcBitmap, v return E_SYSTEM; } - _Bitmap* pNativeBitmap = GetBitmapEx(srcBitmap); + _Bitmap* pNativeBitmap = _GetBitmapEx(srcBitmap); if (pNativeBitmap == null) { diff --git a/src/graphics/FGrp_BitmapUtil.h b/src/graphics/FGrp_BitmapUtil.h old mode 100644 new mode 100755 index 3ed8769..8a91f03 --- a/src/graphics/FGrp_BitmapUtil.h +++ b/src/graphics/FGrp_BitmapUtil.h @@ -65,22 +65,22 @@ void ResetCallback(Tizen::Graphics::Bitmap& bitmap); } // Tizen::Graphics::_BitmapUtil -class BitmapTemp +class _BitmapTemp : public _BitmapImpl { public: - BitmapTemp(Canvas& canvas); - BitmapTemp(void* pBuffer, int width, int height, int depth); - BitmapTemp(Dimension physicalSize, int depth); + _BitmapTemp(Canvas& canvas); + _BitmapTemp(void* pBuffer, int width, int height, int depth); + _BitmapTemp(Dimension physicalSize, int depth); - virtual ~BitmapTemp(); + virtual ~_BitmapTemp(); bool IsValid(void); private: bool __isValid; -}; // BitmapTemp +}; // _BitmapTemp }} // Tizen::Graphics @@ -114,10 +114,10 @@ public: return false; } - virSize.width = this->_sharedItem->coordHolder->bitmapSize.virCoord.w; - virSize.height = this->_sharedItem->coordHolder->bitmapSize.virCoord.h; - phySize.width = this->_sharedItem->coordHolder->bitmapSize.phyCoord.w; - phySize.height = this->_sharedItem->coordHolder->bitmapSize.phyCoord.h; + virSize.width = this->_sharedItem->coordHolder->size.vcInt.w; + virSize.height = this->_sharedItem->coordHolder->size.vcInt.h; + phySize.width = this->_sharedItem->coordHolder->size.pcInt.w; + phySize.height = this->_sharedItem->coordHolder->size.pcInt.h; return true; } @@ -152,7 +152,7 @@ public: }; // _BitmapImplHack inline _Bitmap* -GetBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) +_GetBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) { const _BitmapImplHack* pBitmapImplHack = static_cast (&bitmap); @@ -160,7 +160,7 @@ GetBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) } inline _Bitmap* -GetScaledBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) +_GetScaledBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) { const _BitmapImplHack* pBitmapImplHack = static_cast (&bitmap); @@ -168,7 +168,7 @@ GetScaledBitmapEx(const Tizen::Graphics::_BitmapImpl& bitmap) } inline bool -IsLazyScalingBitmap(const Tizen::Graphics::_BitmapImpl& bitmap) +_IsLazyScalingBitmap(const Tizen::Graphics::_BitmapImpl& bitmap) { const _BitmapImplHack* pBitmapImplHack = static_cast (&bitmap); @@ -176,7 +176,7 @@ IsLazyScalingBitmap(const Tizen::Graphics::_BitmapImpl& bitmap) } inline bool -IsLazyScalingBitmap(const Tizen::Graphics::_BitmapImpl& bitmap, Tizen::Graphics::Dimension& virSize, +_IsLazyScalingBitmap(const Tizen::Graphics::_BitmapImpl& bitmap, Tizen::Graphics::Dimension& virSize, Tizen::Graphics::Dimension& phySize) { const _BitmapImplHack* pBitmapImplHack = static_cast (&bitmap); @@ -190,27 +190,27 @@ namespace Tizen { namespace Graphics { inline _Bitmap* -GetBitmapEx(const Tizen::Graphics::Bitmap& bitmap) +_GetBitmapEx(const Tizen::Graphics::Bitmap& bitmap) { - return GetBitmapEx(*_BitmapImpl::GetInstance(bitmap)); + return _GetBitmapEx(*_BitmapImpl::GetInstance(bitmap)); } inline _Bitmap* -GetScaledBitmapEx(const Tizen::Graphics::Bitmap& bitmap) +_GetScaledBitmapEx(const Tizen::Graphics::Bitmap& bitmap) { - return GetScaledBitmapEx(*_BitmapImpl::GetInstance(bitmap)); + return _GetScaledBitmapEx(*_BitmapImpl::GetInstance(bitmap)); } inline bool -IsLazyScalingBitmap(const Tizen::Graphics::Bitmap& bitmap) +_IsLazyScalingBitmap(const Tizen::Graphics::Bitmap& bitmap) { - return IsLazyScalingBitmap(*_BitmapImpl::GetInstance(bitmap)); + return _IsLazyScalingBitmap(*_BitmapImpl::GetInstance(bitmap)); } inline bool -IsLazyScalingBitmap(const Tizen::Graphics::Bitmap& bitmap, Tizen::Graphics::Dimension& virSize, Tizen::Graphics::Dimension& phySize) +_IsLazyScalingBitmap(const Tizen::Graphics::Bitmap& bitmap, Tizen::Graphics::Dimension& virSize, Tizen::Graphics::Dimension& phySize) { - return IsLazyScalingBitmap(*_BitmapImpl::GetInstance(bitmap), virSize, phySize); + return _IsLazyScalingBitmap(*_BitmapImpl::GetInstance(bitmap), virSize, phySize); } }} // Tizen::Graphics diff --git a/src/graphics/FGrp_Canvas.cpp b/src/graphics/FGrp_Canvas.cpp old mode 100644 new mode 100755 index 8a734bc..66e7a01 --- a/src/graphics/FGrp_Canvas.cpp +++ b/src/graphics/FGrp_Canvas.cpp @@ -62,29 +62,40 @@ //////////////////////////////////////////////////////////////////////////////// -#define SET_CAIRO_DASH_STYLE \ - _Cairo::SetDash(pCairo->pCairo, this->__dashData.pattern.Begin(), int(this->__dashData.pattern.Size()), this->__dashData.offset) +#define SET_CAIRO_ALL_PROPERTIES \ + _Cairo::SetComposite(pCairo->pCairo, _ConvertParam(this->__compositeMode)); \ + _Cairo::SetDash(pCairo->pCairo, this->__dashData.pattern.Begin(), int(this->__dashData.pattern.Size()), this->__dashData.offset); \ + _Cairo::SetLineCap(pCairo->pCairo, _ConvertParam(this->__lineCapStyle)); \ + _Cairo::SetLineJoin(pCairo->pCairo, _ConvertParam(this->__lineJoinStyle)); \ + if (this->__isClipBoundsSet) \ + { \ + _Cairo::SetClip(pCairo->pCairo, this->__clipBounds.x, this->__clipBounds.y, this->__clipBounds.width, this->__clipBounds.height); \ + } -#define RESET_CAIRO_DASH_STYLE \ - _Cairo::ResetDash(pCairo->pCairo) +#define RESET_CAIRO_ALL_PROPERTIES \ + _Cairo::ResetComposite(pCairo->pCairo); \ + _Cairo::ResetDash(pCairo->pCairo); \ + _Cairo::ResetLineCap(pCairo->pCairo); \ + _Cairo::ResetLineJoin(pCairo->pCairo); \ + if (this->__isClipBoundsSet) \ + { \ + _Cairo::ResetClip(pCairo->pCairo); \ + } -#define SET_CAIRO_CLIPPING \ +#define SET_CAIRO_FILL_PROPERTIES \ + _Cairo::SetComposite(pCairo->pCairo, _ConvertParam(this->__compositeMode)); \ if (this->__isClipBoundsSet) \ { \ _Cairo::SetClip(pCairo->pCairo, this->__clipBounds.x, this->__clipBounds.y, this->__clipBounds.width, this->__clipBounds.height); \ } -#define RESET_CAIRO_CLIPPING \ +#define RESET_CAIRO_FILL_PROPERTIES \ + _Cairo::ResetComposite(pCairo->pCairo); \ if (this->__isClipBoundsSet) \ { \ _Cairo::ResetClip(pCairo->pCairo); \ } -#define SET_CAIRO_BLENDING \ - _Cairo::SetBlending(pCairo->pCairo, _ConvertParam(this->__blendingMode)); - -#define RESET_CAIRO_BLENDING \ - _Cairo::SetBlending(pCairo->pCairo, CAIRO_OPERATOR_OVER); //////////////////////////////////////////////////////////////////////////////// @@ -119,43 +130,87 @@ _ConvertParam(Tizen::Graphics::_Canvas::BlendOption blendOption) template<> cairo_operator_t -_ConvertParam(Tizen::Graphics::BlendingMode blendingMode) +_ConvertParam(Tizen::Graphics::CompositeMode compositeMode) { - switch (blendingMode) + switch (compositeMode) { - case Tizen::Graphics::BLENDING_MODE_CLEAR: + case Tizen::Graphics::COMPOSITE_MODE_CLEAR: return CAIRO_OPERATOR_CLEAR; - case Tizen::Graphics::BLENDING_MODE_SRC: + case Tizen::Graphics::COMPOSITE_MODE_SRC: return CAIRO_OPERATOR_SOURCE; - case Tizen::Graphics::BLENDING_MODE_DST: + case Tizen::Graphics::COMPOSITE_MODE_DST: return CAIRO_OPERATOR_DEST; - case Tizen::Graphics::BLENDING_MODE_SRC_OVER: + case Tizen::Graphics::COMPOSITE_MODE_SRC_OVER: return CAIRO_OPERATOR_OVER; - case Tizen::Graphics::BLENDING_MODE_DST_OVER: + case Tizen::Graphics::COMPOSITE_MODE_DST_OVER: return CAIRO_OPERATOR_DEST_OVER; - case Tizen::Graphics::BLENDING_MODE_SRC_IN: + case Tizen::Graphics::COMPOSITE_MODE_SRC_IN: return CAIRO_OPERATOR_IN; - case Tizen::Graphics::BLENDING_MODE_DST_IN: + case Tizen::Graphics::COMPOSITE_MODE_DST_IN: return CAIRO_OPERATOR_DEST_IN; - case Tizen::Graphics::BLENDING_MODE_SRC_OUT: + case Tizen::Graphics::COMPOSITE_MODE_SRC_OUT: return CAIRO_OPERATOR_OUT; - case Tizen::Graphics::BLENDING_MODE_DST_OUT: + case Tizen::Graphics::COMPOSITE_MODE_DST_OUT: return CAIRO_OPERATOR_DEST_OUT; - case Tizen::Graphics::BLENDING_MODE_SRC_ATOP: + case Tizen::Graphics::COMPOSITE_MODE_SRC_ATOP: return CAIRO_OPERATOR_ATOP; - case Tizen::Graphics::BLENDING_MODE_DST_ATOP: + case Tizen::Graphics::COMPOSITE_MODE_DST_ATOP: return CAIRO_OPERATOR_DEST_ATOP; - case Tizen::Graphics::BLENDING_MODE_DST_XOR: + case Tizen::Graphics::COMPOSITE_MODE_DST_XOR: return CAIRO_OPERATOR_XOR; - case Tizen::Graphics::BLENDING_MODE_ADD: + case Tizen::Graphics::COMPOSITE_MODE_ADD: return CAIRO_OPERATOR_ADD; - case Tizen::Graphics::BLENDING_MODE_SATURATE: + case Tizen::Graphics::COMPOSITE_MODE_SATURATE: return CAIRO_OPERATOR_SATURATE; + case Tizen::Graphics::COMPOSITE_MODE_MULTIPLY: + return CAIRO_OPERATOR_MULTIPLY; + case Tizen::Graphics::COMPOSITE_MODE_SCREEN: + return CAIRO_OPERATOR_SCREEN; + case Tizen::Graphics::COMPOSITE_MODE_OVERLAY: + return CAIRO_OPERATOR_OVERLAY; + case Tizen::Graphics::COMPOSITE_MODE_DARKEN: + return CAIRO_OPERATOR_DARKEN; + case Tizen::Graphics::COMPOSITE_MODE_LIGHTEN: + return CAIRO_OPERATOR_LIGHTEN; default: return CAIRO_OPERATOR_OVER; } } +template<> +cairo_line_cap_t +_ConvertParam(Tizen::Graphics::LineCapStyle lineCapStyle) +{ + switch(lineCapStyle) + { + case Tizen::Graphics::LINE_CAP_STYLE_BUTT: + return CAIRO_LINE_CAP_BUTT; + case Tizen::Graphics::LINE_CAP_STYLE_ROUND: + return CAIRO_LINE_CAP_ROUND; + case Tizen::Graphics::LINE_CAP_STYLE_SQUARE: + return CAIRO_LINE_CAP_SQUARE; + default: + return CAIRO_LINE_CAP_ROUND; + } +} + +template<> +cairo_line_join_t +_ConvertParam(Tizen::Graphics::LineJoinStyle lineJoinStyle) +{ + switch(lineJoinStyle) + { + case Tizen::Graphics::LINE_JOIN_STYLE_BEVEL: + return CAIRO_LINE_JOIN_BEVEL; + case Tizen::Graphics::LINE_JOIN_STYLE_ROUND: + return CAIRO_LINE_JOIN_ROUND; + case Tizen::Graphics::LINE_JOIN_STYLE_MITER: + return CAIRO_LINE_JOIN_MITER; + default: + return CAIRO_LINE_JOIN_ROUND; + } +} + inline unsigned short _ConvertRGB888ToRGB565(unsigned char red, unsigned char green, unsigned char blue) { @@ -553,11 +608,13 @@ _Canvas::_Canvas(void) , __bgOpacity(255) , __lineWidth(1) , __lineStyle(LINE_STYLE_SOLID) + , __lineCapStyle(LINE_CAP_STYLE_ROUND) + , __lineJoinStyle(LINE_JOIN_STYLE_ROUND) , __isClipBoundsSet(false) , __textOrigin(TEXT_ORIGIN_LEFT_TOP) , __applyEmoji(true) , __bitmapDrawingQuality(BITMAP_DRAWING_QUALITY_LOW) - , __blendingMode(BLENDING_MODE_SRC_OVER) + , __compositeMode(COMPOSITE_MODE_SRC_OVER) , __useStableRenderer(true) { __fgColorNative = Color(__fgColor); @@ -637,6 +694,12 @@ CATCH: } result +_Canvas::Construct(Handle windowHandle) +{ + return this->Construct(windowHandle, Rectangle(0, 0, _GetWindowWidth(windowHandle), _GetWindowHeight(windowHandle))); +} + +result _Canvas::Construct(Handle windowHandle, const Rectangle& rect) { SysTryReturnResult(NID_GRP, rect.width >= 0 && rect.height >= 0, E_OUT_OF_RANGE, "The given rectangle(width:%d,height:%d) is out of range.\n", rect.width, rect.height); @@ -678,10 +741,11 @@ _Canvas::Construct(Handle windowHandle, const Rectangle& rect) SysTryReturnResult(NID_GRP, pTemp, E_OUT_OF_MEMORY, "_GenericBufferFrameBuffer<> cannot be allocated."); + SysTryCatch(NID_GRP, !(pTemp->GetBufferAddr() == null && bufferWidth > 0 && bufferHeight > 0), delete pTemp; r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The associated Evas buffer is NULL."); + this->__pSurface = new (std::nothrow) _Util::GenericBuffer(pTemp); - SysTryCatch(NID_GRP, this->__pSurface, delete pTemp; - r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] _Util::GenericBuffer<> cannot be allocated."); + SysTryCatch(NID_GRP, this->__pSurface, delete pTemp; r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] _Util::GenericBuffer<> cannot be allocated."); this->__pBuffer = (unsigned long*) __pSurface->GetBufferAddr(); sourcePitch = __pSurface->GetPitch(); @@ -768,6 +832,12 @@ _Canvas::Construct(_Canvas* pSourceCanvas, const Rectangle& subRegion) SysTryReturnResult(NID_GRP, pTemp, E_OUT_OF_MEMORY, "_GenericBufferFrameBuffer<> cannot be allocated."); + if (pTemp->GetBufferAddr() == null && bufferWidth > 0 && bufferHeight > 0) + { + delete pTemp; + SysTryReturnResult(NID_GRP, false, E_SYSTEM, "The associated Evas buffer is NULL."); + } + this->__pSurface = new (std::nothrow) _Util::GenericBuffer(pTemp); if (this->__pSurface == null) @@ -1007,7 +1077,7 @@ _Canvas::Copy(const Rectangle& destRect, const _Canvas& canvas, const Rectangle& } result -_Canvas::Copy(const Point& destPoint, const _Canvas& canvas, const Rectangle& srcRect, BlendingMode blendingMode) +_Canvas::Copy(const Point& destPoint, const _Canvas& canvas, const Rectangle& srcRect, CompositeMode compositeMode) { _Util::LockManager srcLock(canvas); _Util::LockManager dstLock(*this); @@ -1025,7 +1095,7 @@ _Canvas::Copy(const Point& destPoint, const _Canvas& canvas, const Rectangle& sr _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch); _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(destPoint.x, destPoint.y, srcRect.width, srcRect.height); - _Pixman::CopyPixmap(dstImage, srcImage, GetDrawingQuality(), blendingMode); + _Pixman::CopyPixmap(dstImage, srcImage, GetDrawingQuality(), compositeMode); } return E_SUCCESS; @@ -1123,8 +1193,7 @@ _Canvas::DrawArc(const _Util::Rectangle& bounds, double startAngle, doub if (pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; double startDstAngle = (180.0 / M_PI) * atan2(sin(startAngle*M_PI / 180.0) * bounds.w / bounds.h, cos(startAngle * M_PI / 180.0)); double endDstAngle = (180.0 / M_PI) * atan2(sin(endAngle * M_PI / 180.0) * bounds.w / bounds.h, cos(endAngle * M_PI / 180.0)); @@ -1181,8 +1250,7 @@ _Canvas::DrawArc(const _Util::Rectangle& bounds, double startAngle, doub return E_SYSTEM; } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -1474,7 +1542,7 @@ _Canvas::DrawBitmap(const Point& point, const _Bitmap& bitmap) _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch); _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(outRect.x, outRect.y, outRect.w, outRect.h); - pass = _Pixman::CopyPixmap(dstImage, srcImage, GetDrawingQuality(), BLENDING_MODE_SRC_OVER); + pass = _Pixman::CopyPixmap(dstImage, srcImage, GetDrawingQuality(), COMPOSITE_MODE_SRC_OVER); } } @@ -1742,7 +1810,7 @@ _Canvas::DrawBitmapForNinePatchedBitmap(const Rectangle& destRect, const _Bitmap _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch); _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(outRect.x, outRect.y, outRect.w, outRect.h); - pass = _Pixman::ScalePixmap(dstImage, srcImage, GetDrawingQuality(), GetBlendingMode()); + pass = _Pixman::ScalePixmap(dstImage, srcImage, GetDrawingQuality(), GetCompositeMode()); } if (!pass) @@ -2043,7 +2111,7 @@ _Canvas::DrawNinePatchedBitmap(const Rectangle& rect, const _Bitmap& bitmap) SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); expandedCanvas.SetDrawingQuality(BITMAP_DRAWING_QUALITY_HIGH); - expandedCanvas.SetBlendingMode(BLENDING_MODE_SRC); + expandedCanvas.SetCompositeMode(COMPOSITE_MODE_SRC); _Util::Pixmap dstImage(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, (void*) dstBufferInfo.pPixels, dstBufferInfo.pitch); @@ -2108,6 +2176,95 @@ _Canvas::DrawNinePatchedBitmap(const Rectangle& rect, const _Bitmap& bitmap) } result +_Canvas::DrawNineTiledBitmap(const Rectangle& rect, const _Bitmap& bitmap) +{ + SysTryReturnResult(NID_GRP, &bitmap && bitmap.IsValid(), E_INVALID_ARG, "The source bitmap is invalid.\n"); + + // down-scales the source bitmap + if (rect.width < bitmap.GetWidth() - 2 || rect.height < bitmap.GetHeight() - 2) + { + return this->DrawNinePatchedBitmap(rect, bitmap); + } + + _Util::AccumList<_Util::Pair<_Util::Rectangle, _Util::Rectangle > > boundsList; + + result r = _Util::GetPatchList(boundsList, rect, bitmap); + + if (r == E_SUCCESS) + { + // This block is slow and not optimized. + _Util::AccumList<_Util::Pair<_Util::Rectangle, _Util::Rectangle > >::Iterator iter = boundsList.Begin(); + + while (iter != boundsList.End()) + { + Rectangle destRect(iter->first.x, iter->first.y, iter->first.w, iter->first.h); + Rectangle sourRect(iter->second.x, iter->second.y, iter->second.w, iter->second.h); + + if (iter->first.w == iter->second.w && iter->first.h == iter->second.h) + { + DrawBitmapForNinePatchedBitmap(destRect, bitmap, sourRect); + } + else + { + for (int y = iter->first.y; y < iter->first.y + iter->first.h; y += iter->second.h) + { + if (y + iter->second.h <= iter->first.y + iter->first.h) + { + for (int x = iter->first.x; x < iter->first.x + iter->first.w; x += iter->second.w) + { + if (x + iter->second.w <= iter->first.x + iter->first.w) + { + Rectangle destRect(x, y, iter->second.w, iter->second.h); + DrawBitmapForNinePatchedBitmap(destRect, bitmap, sourRect); + } + else + { + // right side clipping + int w = iter->first.x + iter->first.w - x; + + Rectangle destRect(x, y, w, iter->second.h); + Rectangle sourRect(iter->second.x, iter->second.y, w, iter->second.h); + + DrawBitmapForNinePatchedBitmap(destRect, bitmap, sourRect); + } + } + } + else + { + // bottom side clipping + int h = iter->first.y + iter->first.h - y; + + for (int x = iter->first.x; x < iter->first.x + iter->first.w; x += iter->second.w) + { + if (x + iter->second.w <= iter->first.x + iter->first.w) + { + Rectangle destRect(x, y, iter->second.w, h); + Rectangle sourRect(iter->second.x, iter->second.y, iter->second.w, h); + DrawBitmapForNinePatchedBitmap(destRect, bitmap, sourRect); + } + else + { + // right-bottom side clipping + int w = iter->first.x + iter->first.w - x; + + Rectangle destRect(x, y, w, h); + Rectangle sourRect(iter->second.x, iter->second.y, w, h); + + DrawBitmapForNinePatchedBitmap(destRect, bitmap, sourRect); + } + } + } + } + } + + ++iter; + } + } + + return r; +} + +result _Canvas::DrawEllipse(const _Util::Rectangle& bounds) { _Util::Rectangle doubleBounds = @@ -2135,25 +2292,31 @@ _Canvas::DrawEllipse(const _Util::Rectangle& bounds) _NativeGfxEngine* pCairo = static_cast<_NativeGfxEngine*>(_pNativeGfxEngine); - int x1 = this->GetBounds().x; - int y1 = this->GetBounds().y; - int x2 = x1 + this->GetBounds().width; - int y2 = y1 + this->GetBounds().height; + bool shouldWorkAround = !__IsInClipBounds(bounds) && (this->__dashData.pattern.Size() == 0); - if (this->__isClipBoundsSet) + if (!shouldWorkAround && pCairo && pCairo->pCairo) { - x1 = (this->__clipBounds.x > x1) ? this->__clipBounds.x : x1; - y1 = (this->__clipBounds.y > y1) ? this->__clipBounds.y : y1; - x2 = (this->__clipBounds.x + this->__clipBounds.width < x2) ? this->__clipBounds.x + this->__clipBounds.width : x2; - y2 = (this->__clipBounds.y + this->__clipBounds.height < y2) ? this->__clipBounds.y + this->__clipBounds.height : y2; - } + SET_CAIRO_ALL_PROPERTIES; + + if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) + { + _Cairo::DrawEllipse(pCairo->pCairo, this->__lineWidth.asDouble, composedColor, bounds); + } + else + { + _Cairo::DrawEllipse(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, bounds); + } - bool shouldWorkaround = ((bounds.x < x1) || (bounds.y < y1) || (bounds.x + bounds.w > x2) || (bounds.y + bounds.h > y2)) && (__dashData.pattern.Size() == 0); + RESET_CAIRO_ALL_PROPERTIES; - if (!shouldWorkaround && pCairo && pCairo->pCairo) + return E_SUCCESS; + } + else if (shouldWorkAround && pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; + + double pattern = (bounds.w + bounds.h) * 2.0; + _Cairo::SetDash(pCairo->pCairo, &pattern, 1, 0); if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) { @@ -2164,8 +2327,7 @@ _Canvas::DrawEllipse(const _Util::Rectangle& bounds) _Cairo::DrawEllipse(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, bounds); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2231,8 +2393,7 @@ _Canvas::DrawLine(const _Util::Point& point1, const _Util::Point { point2.x, point2.y } }; - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) { @@ -2243,8 +2404,7 @@ _Canvas::DrawLine(const _Util::Point& point1, const _Util::Point _Cairo::Drawline(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, point, 2); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2312,13 +2472,11 @@ _Canvas::DrawPolygon(const _Util::Point* pPoints, unsigned int pointCoun if (pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; _Cairo::DrawPolygon(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, pPoints, pointCount); - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2382,8 +2540,7 @@ _Canvas::DrawPolyline(const _Util::Point* pPoints, unsigned int pointCou if (pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) { @@ -2394,8 +2551,7 @@ _Canvas::DrawPolyline(const _Util::Point* pPoints, unsigned int pointCou _Cairo::DrawPolyline(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, pPoints, pointCount); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2475,8 +2631,7 @@ _Canvas::DrawRectangle(const _Util::Rectangle& rectangle) if (pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) { @@ -2487,8 +2642,7 @@ _Canvas::DrawRectangle(const _Util::Rectangle& rectangle) _Cairo::DrawRectangle(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, rectangle); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2635,8 +2789,7 @@ _Canvas::DrawRoundRectangle(const _Util::Rectangle& rect, const _Util::D if (pCairo && pCairo->pCairo) { - SET_CAIRO_DASH_STYLE; - SET_CAIRO_CLIPPING; + SET_CAIRO_ALL_PROPERTIES; if (__lineWidth.applied != _Util::ScalarHolder::AS_INTEGER) { @@ -2647,8 +2800,7 @@ _Canvas::DrawRoundRectangle(const _Util::Rectangle& rect, const _Util::D _Cairo::DrawRoundRectangle(pCairo->pCairo, this->__lineWidth.asInteger, composedColor, rect, revisedArcDim); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2697,8 +2849,7 @@ _Canvas::DrawTriangle(const _Util::Point& point1, const _Util::Point& point1, const _Util::PointpCairo, this->__lineWidth.asInteger, composedColor, point, 3); } - RESET_CAIRO_CLIPPING; - RESET_CAIRO_DASH_STYLE; + RESET_CAIRO_ALL_PROPERTIES; return E_SUCCESS; } @@ -2795,11 +2945,11 @@ _Canvas::__FillTriangle(unsigned long composedColor, const _Util::Point& { point3.x, point3.y } }; - SET_CAIRO_CLIPPING; + SET_CAIRO_FILL_PROPERTIES; _Cairo::FillPolygon(pCairo->pCairo, composedColor, point, 3); - RESET_CAIRO_CLIPPING; + RESET_CAIRO_FILL_PROPERTIES; return E_SUCCESS; } @@ -2844,11 +2994,11 @@ _Canvas::__FillEllipse(unsigned long composedColor, const _Util::RectanglepCairo) { - SET_CAIRO_CLIPPING; + SET_CAIRO_FILL_PROPERTIES; _Cairo::FillEllipse(pCairo->pCairo, composedColor, bounds); - RESET_CAIRO_CLIPPING; + RESET_CAIRO_FILL_PROPERTIES; return E_SUCCESS; } @@ -2978,11 +3128,11 @@ _Canvas::FillPolygon(const Color& color, const _Util::Point* pPoints, un if (pCairo && pCairo->pCairo) { - SET_CAIRO_CLIPPING; + SET_CAIRO_FILL_PROPERTIES; _Cairo::FillPolygon(pCairo->pCairo, composedColor, pPoints, pointCount); - RESET_CAIRO_CLIPPING; + RESET_CAIRO_FILL_PROPERTIES; return E_SUCCESS; } @@ -3042,11 +3192,11 @@ _Canvas::__FillRectangle(unsigned long composedColor, const _Util::RectanglepCairo) { - SET_CAIRO_CLIPPING; + SET_CAIRO_FILL_PROPERTIES; _Cairo::FillRectangle(pCairo->pCairo, composedColor, rectangle); - RESET_CAIRO_CLIPPING; + RESET_CAIRO_FILL_PROPERTIES; return E_SUCCESS; } @@ -3178,11 +3328,11 @@ _Canvas::__FillRoundRectangle(unsigned long composedColor, const _Util::Rectangl if (pCairo && pCairo->pCairo) { - SET_CAIRO_CLIPPING; + SET_CAIRO_FILL_PROPERTIES; _Cairo::FillRoundRectangle(pCairo->pCairo, composedColor, rect, revisedArcDim); - RESET_CAIRO_CLIPPING; + RESET_CAIRO_FILL_PROPERTIES; return E_SUCCESS; } @@ -3261,6 +3411,22 @@ _Canvas::GetLineWidth() const return this->__lineWidth.asInteger; } +LineCapStyle +_Canvas::GetLineCapStyle() const +{ + SysTryReturn(NID_GRP, this && this->__pSurface, LINE_CAP_STYLE_ROUND, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n"); + + return this->__lineCapStyle; +} + +LineJoinStyle +_Canvas::GetLineJoinStyle() const +{ + SysTryReturn(NID_GRP, this && this->__pSurface, LINE_JOIN_STYLE_ROUND, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n"); + + return this->__lineJoinStyle; +} + result _Canvas::SetLineStyle(LineStyle style) { @@ -3272,7 +3438,7 @@ _Canvas::SetLineStyle(LineStyle style) result _Canvas::SetLineWidth(int width, float widthAsFloat) { - SysTryReturnResult(NID_GRP, width > 0, E_OUT_OF_RANGE, "The given line width(%d) is out of range.\n", width); + SysTryReturnResult(NID_GRP, width > 0 || widthAsFloat >= 0.0f, E_OUT_OF_RANGE, "The given line width(%d) is out of range.\n", width); this->__lineWidth = width; this->__lineWidth.asDouble = double(widthAsFloat); @@ -3291,6 +3457,22 @@ _Canvas::SetLineWidth(float width) } result +_Canvas::SetLineCapStyle(LineCapStyle lineCapStyle) +{ + this->__lineCapStyle = lineCapStyle; + + return E_SUCCESS; +} + +result +_Canvas::SetLineJoinStyle(LineJoinStyle lineJoinStyle) +{ + this->__lineJoinStyle = lineJoinStyle; + + return E_SUCCESS; +} + +result _Canvas::SetDashPattern(const Tizen::Graphics::_Util::AccumList& dashValueList, double offset) { SysTryReturn(NID_GRP, this && this->__pSurface, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n"); @@ -3330,16 +3512,16 @@ _Canvas::GetDrawingQuality(void) const } void -_Canvas::SetBlendingMode(BlendingMode blendingMode) +_Canvas::SetCompositeMode(CompositeMode compositeMode) { // 'blendingMode' is verified in _CanvasImpl::SetBlendingMode() - this->__blendingMode = blendingMode; + this->__compositeMode = compositeMode; } -BlendingMode -_Canvas::GetBlendingMode(void) const +CompositeMode +_Canvas::GetCompositeMode(void) const { - return this->__blendingMode; + return this->__compositeMode; } result @@ -3421,6 +3603,21 @@ _Canvas::SetPixel(const _Util::Point& point) { unsigned long composedColor = _ComposeColor(this->__fgColor, this->__fgOpacity); + _NativeGfxEngine* pCairo = static_cast<_NativeGfxEngine*>(_pNativeGfxEngine); + + if (pCairo && pCairo->pCairo) + { + _Util::Rectangle rectangle = {double(point.x), double(point.y), 1.0, 1.0}; + + SET_CAIRO_FILL_PROPERTIES; + + _Cairo::FillRectangle(pCairo->pCairo, composedColor, rectangle); + + RESET_CAIRO_FILL_PROPERTIES; + + return E_SUCCESS; + } + if (!this->__isClipBoundsSet) { __pScratchPad->FillRect(point.x, point.y, 1, 1, composedColor); @@ -3449,6 +3646,19 @@ _Canvas::SetPixel(const _Util::Point& point) unsigned long composedColor = _ComposeColor(this->__fgColor, this->__fgOpacity); + _NativeGfxEngine* pCairo = static_cast<_NativeGfxEngine*>(_pNativeGfxEngine); + + if (pCairo && pCairo->pCairo) + { + SET_CAIRO_FILL_PROPERTIES; + + _Cairo::FillRectangle(pCairo->pCairo, composedColor, doubleRect); + + RESET_CAIRO_FILL_PROPERTIES; + + return E_SUCCESS; + } + this->__FillRectangle(composedColor, doubleRect); return E_SUCCESS; @@ -3928,5 +4138,24 @@ _Canvas::__Copy(const Rectangle& destRect, const _Canvas& srcCanvas, const Recta return E_SUCCESS; } +bool +_Canvas::__IsInClipBounds(const _Util::Rectangle& bounds) +{ + int x1 = 0; + int y1 = 0; + int x2 = x1 + this->GetBounds().width; + int y2 = y1 + this->GetBounds().height; + + if (this->__isClipBoundsSet) + { + x1 = (this->__clipBounds.x > x1) ? this->__clipBounds.x : x1; + y1 = (this->__clipBounds.y > y1) ? this->__clipBounds.y : y1; + x2 = (this->__clipBounds.x + this->__clipBounds.width < x2) ? this->__clipBounds.x + this->__clipBounds.width : x2; + y2 = (this->__clipBounds.y + this->__clipBounds.height < y2) ? this->__clipBounds.y + this->__clipBounds.height : y2; + } + + return ((bounds.x >= x1) && (bounds.y >= y1) && (bounds.x + bounds.w <= x2) && (bounds.y + bounds.h <= y2)); +} + }} // Tizen::Graphics diff --git a/src/graphics/FGrp_Canvas.h b/src/graphics/FGrp_Canvas.h old mode 100644 new mode 100755 index 214a1a2..7554c29 --- a/src/graphics/FGrp_Canvas.h +++ b/src/graphics/FGrp_Canvas.h @@ -75,6 +75,7 @@ public: result Construct(void); result Construct(const Rectangle& rect); + result Construct(Handle windowHandle); result Construct(Handle windowHandle, const Rectangle& rect); result Construct(_Canvas* pSourceCanvas, const Rectangle& subRegion); result Construct(const BufferInfo& bufferInfo); @@ -86,7 +87,7 @@ public: result Copy(const Point& destPoint, const _Canvas& srcCanvas, const Rectangle& srcRect); result Copy(const Rectangle& destRect, const _Canvas& srcCanvas, const Rectangle& srcRect); - result Copy(const Point& destPoint, const _Canvas& srcCanvas, const Rectangle& srcRect, BlendingMode blendingMode); + result Copy(const Point& destPoint, const _Canvas& srcCanvas, const Rectangle& srcRect, CompositeMode compositeMode); result CopyReverse(const Point& destPoint, const _Canvas& srcCanvas, const Rectangle& srcRect); result SetLineStyle(LineStyle style); @@ -96,13 +97,18 @@ public: result SetLineWidth(float width); // floating-point version int GetLineWidth(void) const; + result SetLineCapStyle(LineCapStyle lineCapStyle); + LineCapStyle GetLineCapStyle(void) const; + result SetLineJoinStyle(LineJoinStyle lineJoinStyle); + LineJoinStyle GetLineJoinStyle(void) const; + result SetDashPattern(const Tizen::Graphics::_Util::AccumList& dashValueList, double offset); void SetDrawingQuality(BitmapDrawingQuality quality); BitmapDrawingQuality GetDrawingQuality(void) const; - void SetBlendingMode(BlendingMode blendingMode); - BlendingMode GetBlendingMode(void) const; + void SetCompositeMode(CompositeMode compositeMode); + CompositeMode GetCompositeMode(void) const; result GetPixel(const Point& point, Color& color) const; @@ -153,6 +159,7 @@ public: result DrawBitmap(const Point& point, const _Bitmap& bitmap, FlipDirection dir); result DrawBitmap(const Point& point, const _Bitmap& bitmap, const Point& pivot, int degree); result DrawNinePatchedBitmap(const Rectangle& rect, const _Bitmap& bitmap); + result DrawNineTiledBitmap(const Rectangle& rect, const _Bitmap& bitmap); result Show(void); result Show(const Rectangle& rect); @@ -213,6 +220,8 @@ private: result __DrawText(const Point& point, const Tizen::Base::String& text, int startIndex, int length); result __DrawText(const Point& point, const Tizen::Base::String& text, int startIndex, int length, const Color& outlineColor); + bool __IsInClipBounds(const _Util::Rectangle& bounds); + protected: void* _pNativeGfxEngine; @@ -237,6 +246,8 @@ private: int __bgOpacity; _Util::ScalarHolder __lineWidth; LineStyle __lineStyle; + LineCapStyle __lineCapStyle; + LineJoinStyle __lineJoinStyle; bool __isClipBoundsSet; Rectangle __clipBounds; TextOrigin __textOrigin; @@ -249,7 +260,7 @@ private: } __dashData; BitmapDrawingQuality __bitmapDrawingQuality; - BlendingMode __blendingMode; + CompositeMode __compositeMode; // for performance test bool __useStableRenderer; diff --git a/src/graphics/FGrp_CanvasCairo.cpp b/src/graphics/FGrp_CanvasCairo.cpp index ba58f45..1ee3edc 100644 --- a/src/graphics/FGrp_CanvasCairo.cpp +++ b/src/graphics/FGrp_CanvasCairo.cpp @@ -114,6 +114,42 @@ ResetDash(cairo_t* pCairo) cairo_set_dash(pCairo, 0, 0, 0.0); } +void +SetComposite(cairo_t* pCairo, cairo_operator_t op) +{ + cairo_set_operator(pCairo, op); +} + +void +ResetComposite(cairo_t* pCairo) +{ + cairo_set_operator(pCairo, CAIRO_OPERATOR_OVER); +} + +void +SetLineCap(cairo_t* pCairo, cairo_line_cap_t cap) +{ + cairo_set_line_cap(pCairo, cap); +} + +void +ResetLineCap(cairo_t* pCairo) +{ + cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); +} + +void +SetLineJoin(cairo_t* pCairo, cairo_line_join_t join) +{ + cairo_set_line_join(pCairo, join); +} + +void +ResetLineJoin(cairo_t* pCairo) +{ + cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); +} + template <> void DrawRoundRectangle(cairo_t* pCairo, double lineWidth, unsigned long composedColor, const _Util::Rectangle& rect, const _Util::Dimension& arcDim) @@ -132,17 +168,18 @@ DrawRoundRectangle(cairo_t* pCairo, double lineWidth, unsigned long comp cairo_save(pCairo); cairo_scale(pCairo, radiusHorizontal / radius, radiusVertical / radius); cairo_new_sub_path(pCairo); - cairo_arc(pCairo, (x + width - radiusHorizontal) * scalingFactorHorizental, (y + radiusVertical) * scalingFactorVertical, radius, -90 * degrees, 0 * degrees); - cairo_arc(pCairo, (x + width - radiusHorizontal) * scalingFactorHorizental, (y + height - radiusVertical) * scalingFactorVertical, radius, 0 * degrees, 90 * degrees); - cairo_arc(pCairo, (x + radiusHorizontal) * scalingFactorHorizental, (y + height - radiusVertical) * scalingFactorVertical, radius, 90 * degrees, 180 * degrees); - cairo_arc(pCairo, (x + radiusHorizontal) * scalingFactorHorizental, (y + radiusVertical) * scalingFactorVertical, radius, 180 * degrees, 270 * degrees); + + cairo_arc_negative(pCairo, (x + width - radiusHorizontal) * scalingFactorHorizental, (y + radiusVertical) * scalingFactorVertical, radius, 0 * degrees, -90 * degrees); + cairo_arc_negative(pCairo, (x + radiusHorizontal) * scalingFactorHorizental, (y + radiusVertical) * scalingFactorVertical, radius, -90 * degrees, -180 * degrees); + cairo_arc_negative(pCairo, (x + radiusHorizontal) * scalingFactorHorizental, (y + height - radiusVertical) * scalingFactorVertical, radius, -180 * degrees, -270 * degrees); + cairo_arc_negative(pCairo, (x + width - radiusHorizontal) * scalingFactorHorizental, (y + height - radiusVertical) * scalingFactorVertical, radius, -270 * degrees, -360 * degrees); + cairo_close_path(pCairo); cairo_restore(pCairo); SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); cairo_stroke(pCairo); } @@ -214,8 +251,6 @@ Drawline(cairo_t* pCairo, double lineWidth, unsigned long composedColor, SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -244,8 +279,6 @@ Drawline(cairo_t* pCairo, int lineWidth, unsigned long composedColor, const SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -281,8 +314,6 @@ DrawRectangle(cairo_t* pCairo, double lineWidth, unsigned long composedC SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -320,8 +351,6 @@ DrawPolyline(cairo_t* pCairo, double lineWidth, unsigned long composedCo SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -350,8 +379,6 @@ DrawPolyline(cairo_t* pCairo, int lineWidth, unsigned long composedColor, c SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -380,8 +407,6 @@ DrawPolygon(cairo_t* pCairo, double lineWidth, unsigned long composedCol SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -412,8 +437,6 @@ DrawPolygon(cairo_t* pCairo, int lineWidth, unsigned long composedColor, co SetColor(pCairo, composedColor); cairo_set_line_width(pCairo, lineWidth); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } @@ -472,11 +495,10 @@ DrawEllipse(cairo_t* pCairo, double lineWidth, unsigned long composedCol cairo_scale(pCairo, widthHalf / radius, heightHalf / radius); - cairo_arc(pCairo, 0.0, 0.0, radius, 0.0, 2 * _DOUBLE_PI); + cairo_arc_negative(pCairo, 0.0, 0.0, radius, 0.0, -2 * _DOUBLE_PI); } cairo_restore(pCairo); - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); cairo_stroke(pCairo); } @@ -595,8 +617,6 @@ DrawArc(cairo_t* pCairo, double lineWidth, unsigned long composedColor, return; } - cairo_set_line_cap(pCairo, CAIRO_LINE_CAP_ROUND); - cairo_set_line_join(pCairo, CAIRO_LINE_JOIN_ROUND); cairo_stroke(pCairo); } diff --git a/src/graphics/FGrp_CanvasCairo.h b/src/graphics/FGrp_CanvasCairo.h index 1257cdb..7aea2c3 100644 --- a/src/graphics/FGrp_CanvasCairo.h +++ b/src/graphics/FGrp_CanvasCairo.h @@ -68,6 +68,18 @@ void SetDash(cairo_t* pCairo, double* pDashes, int dashCount, double offset); void ResetDash(cairo_t* pCairo); +void SetLineCap(cairo_t* pCairo, cairo_line_cap_t cap); + +void ResetLineCap(cairo_t* pCairo); + +void SetLineJoin(cairo_t* pCairo, cairo_line_join_t join); + +void ResetLineJoin(cairo_t* pCairo); + +void SetComposite(cairo_t* pCairo, cairo_operator_t op); + +void ResetComposite(cairo_t* pCairo); + template void DrawRoundRectangle(cairo_t* pCairo, T lineWidth, unsigned long composedColor, const _Util::Rectangle& rect, const _Util::Dimension& arcDim); diff --git a/src/graphics/FGrp_CanvasCoordHolder.h b/src/graphics/FGrp_CanvasCoordHolder.h old mode 100644 new mode 100755 index 4d2fffc..39eb429 --- a/src/graphics/FGrp_CanvasCoordHolder.h +++ b/src/graphics/FGrp_CanvasCoordHolder.h @@ -33,22 +33,212 @@ namespace Tizen { namespace Graphics struct _CanvasCoordHolder { - _ResUtil::CoordHolder <_ResUtil::Rect> canvasSize; + _ResUtil::CoordinateHolder<_Util::Dimension, _Util::Dimension > canvasSize; _ResUtil::CoordHolder <_ResUtil::Rect> clipBounds; - _ResUtil::CoordHolder lineWidth; - _ResUtil::CoordHolder <_ResUtil::Pos> canvasPos; + _ResUtil::CoordinateHolderSimple lineWidth; + _ResUtil::CoordinateHolder<_Util::Point, _Util::Point > canvasPos; - void Init(_ResUtil::Rect area) + _CanvasCoordHolder() + : __pcBaseScale(1.0f) + , __vcBaseScale(1.0f) { - canvasSize = area; - clipBounds = area; - lineWidth = 1; - canvasPos = _ResUtil::Pos(area.x, area.y); + _CoordinateSystem* pCoordinateSystem = _CoordinateSystem::GetInstance(); + + if (pCoordinateSystem) + { + __pcBaseScale = pCoordinateSystem->GetTargetBaseScaleFactor(); + __vcBaseScale = pCoordinateSystem->GetAppBaseScaleFactor(); + } + } + + void Init(_ResUtil::Rect vcRect) + { + { + _Util::Dimension floatVcSize = + { + static_cast(vcRect.w), + static_cast(vcRect.h) + }; + + canvasSize.vcInt.w = _FloatToIntForSize(floatVcSize.w); + canvasSize.vcInt.h = _FloatToIntForSize(floatVcSize.h); + + canvasSize.vcFloat.w = floatVcSize.w; + canvasSize.vcFloat.h = floatVcSize.h; + + canvasSize.pcInt.w = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcSize.w))); + canvasSize.pcInt.h = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcSize.h))); + + canvasSize.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.w))); + canvasSize.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.h))); + } + + clipBounds = vcRect; + + AssignLineWidthFromVc(1); + AssignCanvasPosFromVc(vcRect.x, vcRect.y); } + void Init(const Rectangle& rect) { - _ResUtil::Rect area(rect.x, rect.y, rect.width, rect.height); - this->Init(area); + _ResUtil::Rect vcRect(rect.x, rect.y, rect.width, rect.height); + this->Init(vcRect); + } + + void ResetFromVc(const _Util::Rectangle& intVcRect) + { + _Util::Rectangle floatVcRect = + { + static_cast(intVcRect.x), + static_cast(intVcRect.y), + static_cast(intVcRect.w), + static_cast(intVcRect.h) + }; + + this->ResetFromVc(floatVcRect); + + canvasSize.vcInt.w = intVcRect.w; + canvasSize.vcInt.h = intVcRect.h; + } + + void ResetFromVc(const _Util::Rectangle& floatVcRect) + { + canvasSize.vcInt.w = _FloatToIntForSize(floatVcRect.w); + canvasSize.vcInt.h = _FloatToIntForSize(floatVcRect.h); + + canvasSize.vcFloat.w = floatVcRect.w; + canvasSize.vcFloat.h = floatVcRect.h; + + canvasSize.pcInt.w = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcRect.w))); + canvasSize.pcInt.h = _FloatToIntForSize(static_cast(__ConvertToPhyCoord(floatVcRect.h))); + + canvasSize.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.w))); + canvasSize.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.h))); + + { + _ResUtil::Rect vcArea(_FloatToIntForPos(floatVcRect.x), _FloatToIntForPos(floatVcRect.y), canvasSize.vcInt.w, canvasSize.vcInt.h); + + clipBounds = vcArea; + + AssignLineWidthFromVc(1.0f); + AssignCanvasPosFromVc(floatVcRect.x, floatVcRect.y); + } + } + + void ResetFromPc(const _Util::Rectangle& intPcRect) + { + canvasSize.pcInt.w = intPcRect.w; + canvasSize.pcInt.h = intPcRect.h; + + canvasSize.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.w))); + canvasSize.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.h))); + + canvasSize.vcFloat.w = canvasSize.vcFloatActual.w; + canvasSize.vcFloat.h = canvasSize.vcFloatActual.h; + + canvasSize.vcInt.w = _FloatToIntForSize(canvasSize.vcFloat.w); + canvasSize.vcInt.h = _FloatToIntForSize(canvasSize.vcFloat.h); + + { + _ResUtil::Rect area + ( + _FloatToIntForPos(static_cast(__ConvertToVirCoord(static_cast(intPcRect.x)))), + _FloatToIntForPos(static_cast(__ConvertToVirCoord(static_cast(intPcRect.y)))), + canvasSize.vcInt.w, + canvasSize.vcInt.h + ); + + clipBounds = area; + + AssignLineWidthFromVc(1.0f); + AssignCanvasPosFromPc(intPcRect.x, intPcRect.y); + } + } + + void AssignCanvasSizeFromPcSize(const _Util::Dimension& intPcSize) + { + canvasSize.pcInt.w = intPcSize.w; + canvasSize.pcInt.h = intPcSize.h; + + canvasSize.vcFloatActual.w = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.w))); + canvasSize.vcFloatActual.h = static_cast(__ConvertToVirCoord(static_cast(canvasSize.pcInt.h))); + + canvasSize.vcFloat.w = canvasSize.vcFloatActual.w; + canvasSize.vcFloat.h = canvasSize.vcFloatActual.h; + + canvasSize.vcInt.w = _FloatToIntForSize(canvasSize.vcFloat.w); + canvasSize.vcInt.h = _FloatToIntForSize(canvasSize.vcFloat.h); + } + + void AssignLineWidthFromVc(int width) + { + lineWidth.vcInt = width; + lineWidth.vcFloat = static_cast(width); + } + + void AssignLineWidthFromVc(float widthF) + { + lineWidth.vcFloat = widthF; + lineWidth.vcInt = _FloatToIntForSize(widthF); + } + + void AssignCanvasPosFromVc(int vcX, int vcY) + { + canvasPos.vcInt.x = vcX; + canvasPos.vcInt.y = vcY; + + canvasPos.vcFloat.x = static_cast(vcX); + canvasPos.vcFloat.y = static_cast(vcY); + + canvasPos.pcInt.x = _FloatToIntForPos(static_cast(__ConvertToPhyCoord(static_cast(canvasPos.vcFloat.x)))); + canvasPos.pcInt.y = _FloatToIntForPos(static_cast(__ConvertToPhyCoord(static_cast(canvasPos.vcFloat.y)))); + + canvasPos.vcFloatActual.x = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.x))); + canvasPos.vcFloatActual.y = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.y))); + } + + void AssignCanvasPosFromVc(float vcXF, float vcYF) + { + canvasPos.vcFloat.x = vcXF; + canvasPos.vcFloat.y = vcYF; + + canvasPos.vcInt.x = _FloatToIntForPos(vcXF); + canvasPos.vcInt.y = _FloatToIntForPos(vcYF); + + canvasPos.pcInt.x = _FloatToIntForPos(static_cast(__ConvertToPhyCoord(static_cast(canvasPos.vcFloat.x)))); + canvasPos.pcInt.y = _FloatToIntForPos(static_cast(__ConvertToPhyCoord(static_cast(canvasPos.vcFloat.y)))); + + canvasPos.vcFloatActual.x = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.x))); + canvasPos.vcFloatActual.y = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.y))); + } + + void AssignCanvasPosFromPc(int pcX, int pcY) + { + canvasPos.pcInt.x = pcX; + canvasPos.pcInt.y = pcY; + + canvasPos.vcFloatActual.x = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.x))); + canvasPos.vcFloatActual.y = static_cast(__ConvertToVirCoord(static_cast(canvasPos.pcInt.y))); + + canvasPos.vcFloat.x = canvasPos.vcFloatActual.x; + canvasPos.vcFloat.y = canvasPos.vcFloatActual.y; + + canvasPos.vcInt.x = _FloatToIntForPos(canvasPos.vcFloat.x); + canvasPos.vcInt.y = _FloatToIntForPos(canvasPos.vcFloat.y); + } + +private: + double __pcBaseScale; + double __vcBaseScale; + + inline double __ConvertToPhyCoord(double val) + { + return val * __pcBaseScale / __vcBaseScale; + } + + inline double __ConvertToVirCoord(double val) + { + return val * __vcBaseScale / __pcBaseScale; } }; diff --git a/src/graphics/FGrp_CanvasImpl.cpp b/src/graphics/FGrp_CanvasImpl.cpp old mode 100644 new mode 100755 index 4570710..28839b4 --- a/src/graphics/FGrp_CanvasImpl.cpp +++ b/src/graphics/FGrp_CanvasImpl.cpp @@ -46,9 +46,9 @@ using namespace Tizen::Base::Collection; #define EXTRACT_CANVASEX(pVar, canvas) Tizen::Graphics::_Canvas * pVar = canvas._pNativeCanvas -#define EXTRACT_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::GetBitmapEx(bitmap) +#define EXTRACT_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::_GetBitmapEx(bitmap) #define EXTRACT_FONTEX(pVar, font) Tizen::Graphics::_Font * pVar = Tizen::Graphics::GetFontEx(font) -#define EXTRACT_SCALED_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::GetScaledBitmapEx(bitmap) +#define EXTRACT_SCALED_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::_GetScaledBitmapEx(bitmap) #define IsSucceeded(X) (!IsFailed(X)) @@ -72,6 +72,16 @@ _GetBoundsRel(const Tizen::Graphics::_CanvasImpl& canvas) return rect; } +Tizen::Graphics::FloatRectangle +_GetBoundsRelF(const Tizen::Graphics::_CanvasImpl& canvas) +{ + Tizen::Graphics::FloatRectangle rectF = canvas.GetBoundsF(); + rectF.x = 0.0f; + rectF.y = 0.0f; + + return rectF; +} + template void _ExpandClippingAreaForLineWidth(Tizen::Graphics::Rectangle& rtCanvas, T lineWidth) @@ -156,6 +166,8 @@ _CanvasImpl::_CanvasImpl(void) , _pFont(0) , _pPriorityFont(0) , _dashOffset(0) + , _pShowCallbackFunc(null) + , _pShowCallbackParam(null) { _pNativeCanvas = new (std::nothrow) _Canvas; _pCoordHolder = new (std::nothrow) _CanvasCoordHolder; @@ -189,62 +201,22 @@ _CanvasImpl::Construct(void) SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); - if (_ResUtil::NeedToConvertCoord()) - { - result r = this->_pNativeCanvas->Construct(); - - if (IsSucceeded(r)) - { - Rectangle pcRect = this->_pNativeCanvas->GetBounds(); - Rectangle vcRect = _ResUtil::ConvertToVirCoord(pcRect); - this->_pCoordHolder->Init(vcRect); - } - - return r; - } - else - { - return this->_pNativeCanvas->Construct(); - } -} - -result -_CanvasImpl::Construct(const Rectangle& vcRect) -{ - SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); - - SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); - - SysTryReturnResult(NID_GRP, vcRect.width > 0 && vcRect.height > 0, E_OUT_OF_RANGE, - "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, - vcRect.height); + result r = this->_pNativeCanvas->Construct(); - if (_ResUtil::NeedToConvertCoord()) + if (IsSucceeded(r)) { - Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vcRect); - - pcRect.width = (pcRect.width > 0) ? pcRect.width : 1; - pcRect.height = (pcRect.height > 0) ? pcRect.height : 1; - - result r = this->_pNativeCanvas->Construct(pcRect); + Rectangle pcRect = this->_pNativeCanvas->GetBounds(); - if (IsSucceeded(r)) - { - this->_pCoordHolder->Init(vcRect); - this->_pCoordHolder->canvasSize.phyCoord.w = pcRect.width; - this->_pCoordHolder->canvasSize.phyCoord.h = pcRect.height; - } + _Util::Rectangle pcUtilRect = { pcRect.x, pcRect.y, pcRect.width, pcRect.height }; - return r; - } - else - { - return this->_pNativeCanvas->Construct(vcRect); + this->_pCoordHolder->ResetFromPc(pcUtilRect); } + + return r; } result -_CanvasImpl::Construct(Handle windowHandle, const Rectangle& vcRect) +_CanvasImpl::Construct(const Rectangle& vcRect) { SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); @@ -254,28 +226,16 @@ _CanvasImpl::Construct(Handle windowHandle, const Rectangle& vcRect) "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); - if (_ResUtil::NeedToConvertCoord()) - { - Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vcRect); + _Util::Rectangle vcUtilRect = { vcRect.x, vcRect.y, vcRect.width, vcRect.height }; - pcRect.width = (pcRect.width > 0) ? pcRect.width : 1; - pcRect.height = (pcRect.height > 0) ? pcRect.height : 1; + this->_pCoordHolder->ResetFromVc(vcUtilRect); - result r = this->_pNativeCanvas->Construct(windowHandle, pcRect); + Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vcRect); - if (IsSucceeded(r)) - { - this->_pCoordHolder->Init(vcRect); - this->_pCoordHolder->canvasSize.phyCoord.w = pcRect.width; - this->_pCoordHolder->canvasSize.phyCoord.h = pcRect.height; - } + pcRect.width = this->_pCoordHolder->canvasSize.pcInt.w; + pcRect.height = this->_pCoordHolder->canvasSize.pcInt.h; - return r; - } - else - { - return this->_pNativeCanvas->Construct(windowHandle, vcRect); - } + return this->_pNativeCanvas->Construct(pcRect); } result @@ -320,11 +280,14 @@ _CanvasImpl::Construct(const BufferInfo& bufferInfo) if (handle != 0) // not INVALID_HANDLE { - result r = this->Construct(handle, Rectangle(0, 0, bufferInfo.width, bufferInfo.height)); + result r = this->Construct(handle); // OUT_OF_RANGE does not occur + SysTryReturn(NID_GRP, (r == E_SUCCESS) && this->IsConstructed(), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _Util::Rectangle pcUtilRect = { 0, 0, this->_pNativeCanvas->__pSurface->GetWidth(), this->_pNativeCanvas->__pSurface->GetHeight() }; - SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + this->_pCoordHolder->ResetFromPc(pcUtilRect); return E_SUCCESS; } @@ -340,18 +303,9 @@ _CanvasImpl::Construct(const BufferInfo& bufferInfo) SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - if (_ResUtil::NeedToConvertCoord()) - { - Rectangle pcRect(0, 0, bufferInfo.width, bufferInfo.height); - Rectangle vcRect = _ResUtil::ConvertToVirCoord(pcRect); + _Util::Rectangle pcUtilRect = { 0, 0, this->_pNativeCanvas->__pSurface->GetWidth(), this->_pNativeCanvas->__pSurface->GetHeight() }; - vcRect.width = (vcRect.width > 0) ? vcRect.width : 1; - vcRect.height = (vcRect.height > 0) ? vcRect.height : 1; - - this->_pCoordHolder->Init(vcRect); - this->_pCoordHolder->canvasSize.phyCoord.w = pcRect.width; - this->_pCoordHolder->canvasSize.phyCoord.h = pcRect.height; - } + this->_pCoordHolder->ResetFromPc(pcUtilRect); return E_SUCCESS; } @@ -359,6 +313,105 @@ _CanvasImpl::Construct(const BufferInfo& bufferInfo) return E_SYSTEM; } +result +_CanvasImpl::Construct(Handle windowHandle) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); + + return this->_pNativeCanvas->Construct(windowHandle); +} + +result +_CanvasImpl::Construct(Handle windowHandle, const Rectangle& vcRect) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, vcRect.width > 0 && vcRect.height > 0, E_OUT_OF_RANGE, + "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, + vcRect.height); + + _Util::Rectangle vcUtilRect = { vcRect.x, vcRect.y, vcRect.width, vcRect.height }; + + this->_pCoordHolder->ResetFromVc(vcUtilRect); + + Rectangle pcRect; + + pcRect.x = _ResUtil::ConvertToPhyCoord(vcRect.x); + pcRect.y = _ResUtil::ConvertToPhyCoord(vcRect.y); + pcRect.width = this->_pCoordHolder->canvasSize.pcInt.w; + pcRect.height = this->_pCoordHolder->canvasSize.pcInt.h; + + return this->_pNativeCanvas->Construct(windowHandle, pcRect); +} + +result +_CanvasImpl::Construct(const FloatRectangle& vcRectF) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, vcRectF.width > 0.0f && vcRectF.height > 0.0f, E_OUT_OF_RANGE, + "The given rectangle(width:%f,height:%f) is out of range.", vcRectF.width, + vcRectF.height); + + _Util::Rectangle vcUtilRectF = { vcRectF.x, vcRectF.y, vcRectF.width, vcRectF.height }; + + this->_pCoordHolder->ResetFromVc(vcUtilRectF); + + if (_ResUtil::NeedToConvertCoord()) + { + Rectangle pcRect; + + pcRect.x = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcRectF.x)); + pcRect.y = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcRectF.y)); + pcRect.width = this->_pCoordHolder->canvasSize.pcInt.w; + pcRect.height = this->_pCoordHolder->canvasSize.pcInt.h; + + return this->_pNativeCanvas->Construct(pcRect); + } + else + { + Rectangle vcRect; + + vcRect.x = this->_pCoordHolder->canvasPos.vcInt.x; + vcRect.y = this->_pCoordHolder->canvasPos.vcInt.y; + vcRect.width = this->_pCoordHolder->canvasSize.vcInt.w; + vcRect.height = this->_pCoordHolder->canvasSize.vcInt.h; + + return this->_pNativeCanvas->Construct(vcRect); + } +} + +result +_CanvasImpl::Construct(Handle windowHandle, const FloatRectangle& vcRectF) +{ + SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet."); + + SysTryReturnResult(NID_GRP, this->_pNativeCanvas, E_OUT_OF_MEMORY, "Fails to allocate memory."); + + SysTryReturnResult(NID_GRP, vcRectF.width > 0.0f && vcRectF.height > 0.0f, E_OUT_OF_RANGE, + "The given rectangle(width:%f,height:%f) is out of range.", vcRectF.width, + vcRectF.height); + + _Util::Rectangle vcUtilRectF = { vcRectF.x, vcRectF.y, vcRectF.width, vcRectF.height }; + + this->_pCoordHolder->ResetFromVc(vcUtilRectF); + + Rectangle pcRect; + + pcRect.x = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcRectF.x)); + pcRect.y = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcRectF.y)); + pcRect.width = this->_pCoordHolder->canvasSize.pcInt.w; + pcRect.height = this->_pCoordHolder->canvasSize.pcInt.h; + + return this->_pNativeCanvas->Construct(windowHandle, pcRect); +} + bool _CanvasImpl::IsConstructed(void) const { @@ -412,6 +465,15 @@ _CanvasImpl::Clear(const Rectangle& vcRect) } result +_CanvasImpl::Clear(const FloatRectangle& rect) +{ + // @hoonik.lee + Rectangle intRect(static_cast(rect.x), static_cast(rect.y), static_cast(rect.width), static_cast(rect.height)); + + return this->Clear(intRect); +} + +result _CanvasImpl::Copy(const Point& vcDestPoint, const _CanvasImpl& canvas, const Rectangle& vcSrcRect) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); @@ -459,6 +521,16 @@ _CanvasImpl::Copy(const Point& vcDestPoint, const _CanvasImpl& canvas, const Rec } result +_CanvasImpl::Copy(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect) +{ + // @hoonik.lee + Point intDestPoint(static_cast(destPoint.x), static_cast(destPoint.y)); + Rectangle intSrcRect(static_cast(srcRect.x), static_cast(srcRect.y), static_cast(srcRect.width), static_cast(srcRect.height)); + + return this->Copy(intDestPoint, srcCanvas, intSrcRect); +} + +result _CanvasImpl::Copy(const Rectangle& vcDestRect, const _CanvasImpl& canvas, const Rectangle& vcSrcRect) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); @@ -505,42 +577,46 @@ _CanvasImpl::Copy(const Rectangle& vcDestRect, const _CanvasImpl& canvas, const } result -_CanvasImpl::Copy(const Point& vcDestPoint, const _CanvasImpl& canvas, const Rectangle& vcSrcRect, BlendingMode blendingMode) +_CanvasImpl::Copy(const FloatRectangle& destRect, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect) +{ + // @hoonik.lee + Rectangle intDestRect(static_cast(destRect.x), static_cast(destRect.y), static_cast(destRect.width), static_cast(destRect.height)); + Rectangle intSrcRect(static_cast(srcRect.x), static_cast(srcRect.y), static_cast(srcRect.width), static_cast(srcRect.height)); + + return this->Copy(intDestRect, srcCanvas, intSrcRect); +} + +result +_CanvasImpl::Copy(const Point& vcDestPoint, const _CanvasImpl& canvas, const Rectangle& vcSrcRect, CompositeMode compositeMode) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, CANVAS_IS_VALID(canvas), E_INVALID_ARG, "The specified source canvas is invalid."); - switch (blendingMode) - { - case BLENDING_MODE_CLEAR: - case BLENDING_MODE_SRC: - case BLENDING_MODE_DST: - case BLENDING_MODE_SRC_OVER: - case BLENDING_MODE_DST_OVER: - case BLENDING_MODE_SRC_IN: - case BLENDING_MODE_DST_IN: - case BLENDING_MODE_SRC_OUT: - case BLENDING_MODE_DST_OUT: - case BLENDING_MODE_SRC_ATOP: - case BLENDING_MODE_DST_ATOP: - case BLENDING_MODE_DST_XOR: - case BLENDING_MODE_ADD: - case BLENDING_MODE_SATURATE: - case BLENDING_MODE_MULTIPLY: - case BLENDING_MODE_SCREEN: - case BLENDING_MODE_OVERLAY: - case BLENDING_MODE_DARKEN: - case BLENDING_MODE_LIGHTEN: - case BLENDING_MODE_COLOR_DODGE: - case BLENDING_MODE_COLOR_BURN: - case BLENDING_MODE_HARD_LIGHT: - case BLENDING_MODE_SOFT_LIGHT: - case BLENDING_MODE_DIFFERENCE: - case BLENDING_MODE_EXCLUSION: + switch (compositeMode) + { + case COMPOSITE_MODE_CLEAR: + case COMPOSITE_MODE_SRC: + case COMPOSITE_MODE_DST: + case COMPOSITE_MODE_SRC_OVER: + case COMPOSITE_MODE_DST_OVER: + case COMPOSITE_MODE_SRC_IN: + case COMPOSITE_MODE_DST_IN: + case COMPOSITE_MODE_SRC_OUT: + case COMPOSITE_MODE_DST_OUT: + case COMPOSITE_MODE_SRC_ATOP: + case COMPOSITE_MODE_DST_ATOP: + case COMPOSITE_MODE_DST_XOR: + case COMPOSITE_MODE_ADD: + case COMPOSITE_MODE_SATURATE: + case COMPOSITE_MODE_MULTIPLY: + case COMPOSITE_MODE_SCREEN: + case COMPOSITE_MODE_OVERLAY: + case COMPOSITE_MODE_DARKEN: + case COMPOSITE_MODE_LIGHTEN: break; default: - SysTryReturnResult(NID_GRP, false, E_INVALID_ARG, "The specified blending mode is invalid."); + SysTryReturnResult(NID_GRP, false, E_INVALID_ARG, "The specified composite mode is invalid."); } Rectangle srcRectCanvas = _GetBoundsRel(canvas); @@ -575,15 +651,25 @@ _CanvasImpl::Copy(const Point& vcDestPoint, const _CanvasImpl& canvas, const Rec Point pcDestPoint = _ResUtil::ConvertToPhyCoord(vcDestPoint); Rectangle pcSrcRect = _ResUtil::ConvertToPhyCoord(vcSrcRect); - return this->_pNativeCanvas->Copy(pcDestPoint, *_pNativeCanvas, pcSrcRect, blendingMode); + return this->_pNativeCanvas->Copy(pcDestPoint, *_pNativeCanvas, pcSrcRect, compositeMode); } else { - return this->_pNativeCanvas->Copy(vcDestPoint, *_pNativeCanvas, vcSrcRect, blendingMode); + return this->_pNativeCanvas->Copy(vcDestPoint, *_pNativeCanvas, vcSrcRect, compositeMode); } } result +_CanvasImpl::Copy(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect, CompositeMode compositeMode) +{ + // @hoonik.lee + Point intDestPoint(static_cast(destPoint.x), static_cast(destPoint.y)); + Rectangle intSrcRect(static_cast(srcRect.x), static_cast(srcRect.y), static_cast(srcRect.width), static_cast(srcRect.height)); + + return this->Copy(intDestPoint, srcCanvas, intSrcRect, compositeMode); +} + +result _CanvasImpl::CopyEx(const Point& vcDestPoint, const _CanvasImpl& srcCanvas, const Rectangle& vcSrcRect) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); @@ -664,13 +750,23 @@ _CanvasImpl::CopyEx(const Point& vcDestPoint, const _CanvasImpl& srcCanvas, cons } result +_CanvasImpl::CopyEx(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect) +{ + // @hoonik.lee + Point intDestPoint(static_cast(destPoint.x), static_cast(destPoint.y)); + Rectangle intSrcRect(static_cast(srcRect.x), static_cast(srcRect.y), static_cast(srcRect.width), static_cast(srcRect.height)); + + return this->CopyEx(intDestPoint, srcCanvas, intSrcRect); +} + +result _CanvasImpl::DrawArc(const FloatRectangle& vcBounds, float startAngle, float endAngle, ArcStyle arcStyle) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, ARC_STYLE_MIN < arcStyle && arcStyle < ARC_STYLE_MAX, E_INVALID_ARG, "The invalid arc type(%d) is given.", arcStyle); SysTryReturnResult(NID_GRP, &vcBounds, E_INVALID_ARG, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcBounds.width >= 0) && (vcBounds.height >= 0), E_OUT_OF_RANGE, - "The given rectangle(width:%d,height:%d) is out of range.", vcBounds.width, vcBounds.height); + SysTryReturnResult(NID_GRP, (vcBounds.width >= 0.0f) && (vcBounds.height >= 0.0f), E_OUT_OF_RANGE, + "The given rectangle(width:%f,height:%f) is out of range.", vcBounds.width, vcBounds.height); return _CanvasImplPrivate::DrawArc(this, _Util::Convert >(vcBounds), double(startAngle), double(endAngle), arcStyle); } @@ -727,11 +823,47 @@ _CanvasImpl::DrawBitmap(const Rectangle& vcRect, const _BitmapImpl& bitmap) } result -_CanvasImpl::DrawBitmap(const FloatRectangle& vcRect, const _BitmapImpl& bitmap) +_CanvasImpl::DrawBitmap(const FloatRectangle& vcRectF, const _BitmapImpl& bitmap) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - return this->DrawBitmap(_Util::Convert(vcRect), bitmap); + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + SysTryReturnResult(NID_GRP, &vcRectF, E_INVALID_ARG, "The source rectangle is invalid."); + + // @ykahn vcRectF.width in [bitmap.GetActualWidth()..bitmap.GetWidthF()] + if (vcRectF.width == bitmap.GetWidthF() && vcRectF.height == bitmap.GetHeightF()) + { + return this->DrawBitmap(FloatPoint(vcRectF.x, vcRectF.y), bitmap); + } + + // check if bimap can be drew in canvas area. + FloatRectangle rtCanvasF = _GetBoundsRelF(*this); + + if (rtCanvasF.IsEmpty()) + { + return E_SUCCESS; + } + + result r = _Util::Validate(vcRectF, rtCanvasF); + + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "Propagating."); + + EXTRACT_BITMAPEX(pBitmapEx, bitmap); + + if (_ResUtil::NeedToConvertCoord()) + { + FloatRectangle pcRectF = _ResUtil::ConvertToPhyCoord(vcRectF); + + Rectangle pcRect(_FloatToIntForPos(pcRectF.x), _FloatToIntForPos(pcRectF.y), _FloatToIntForSize(pcRectF.width), _FloatToIntForSize(pcRectF.height)); + + return this->_pNativeCanvas->DrawBitmap(pcRect, *pBitmapEx); + } + else + { + Rectangle vcRect(_FloatToIntForPos(vcRectF.x), _FloatToIntForPos(vcRectF.y), _FloatToIntForSize(vcRectF.width), _FloatToIntForSize(vcRectF.height)); + + return this->_pNativeCanvas->DrawBitmap(vcRect, *pBitmapEx); + } } result @@ -758,7 +890,7 @@ _CanvasImpl::DrawBitmap(const Point& vcPoint, const _BitmapImpl& bitmap) { Tizen::Graphics::Dimension virSize; Tizen::Graphics::Dimension phySize; - bool lazyScaling = Tizen::Graphics::IsLazyScalingBitmap(bitmap, virSize, phySize); + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint); @@ -816,11 +948,52 @@ _CanvasImpl::DrawBitmap(const Point& vcPoint, const _BitmapImpl& bitmap) } result -_CanvasImpl::DrawBitmap(const FloatPoint& vcPoint, const _BitmapImpl& bitmap) +_CanvasImpl::DrawBitmap(const FloatPoint& vcPointF, const _BitmapImpl& bitmap) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - return this->DrawBitmap(_Util::Convert(vcPoint), bitmap); + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + + FloatRectangle rtCanvasF = _GetBoundsRelF(*this); + + if (rtCanvasF.IsEmpty()) + { + return E_SUCCESS; + } + + result r = _Util::Validate(FloatRectangle(vcPointF.x, vcPointF.y, bitmap.GetWidthF(), bitmap.GetHeightF()), rtCanvasF); + + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "Propagating."); + + EXTRACT_BITMAPEX(pBitmapEx, bitmap); + + if (_ResUtil::NeedToConvertCoord()) + { + Tizen::Graphics::Dimension virSize; + Tizen::Graphics::Dimension phySize; + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); + + FloatPoint pcPointF = _ResUtil::ConvertToPhyCoord(vcPointF); + + Point pcPoint(_FloatToIntForPos(pcPointF.x), _FloatToIntForPos(pcPointF.y)); + + if (lazyScaling) + { + EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap); + + return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx); + } + else + { + return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx); + } + } + else + { + Point vcPoint(_FloatToIntForPos(vcPointF.x), _FloatToIntForPos(vcPointF.y)); + + return this->_pNativeCanvas->DrawBitmap(vcPoint, *pBitmapEx); + } } result @@ -873,7 +1046,7 @@ _CanvasImpl::DrawBitmap(const Rectangle& vcDestRect, const _BitmapImpl& srcBitma { Tizen::Graphics::Dimension virSize; Tizen::Graphics::Dimension phySize; - bool lazyScaling = Tizen::Graphics::IsLazyScalingBitmap(srcBitmap, virSize, phySize); + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(srcBitmap, virSize, phySize); Rectangle pcDestRect = _ResUtil::ConvertToPhyCoord(vcDestRect); @@ -895,50 +1068,122 @@ _CanvasImpl::DrawBitmap(const Rectangle& vcDestRect, const _BitmapImpl& srcBitma } result -_CanvasImpl::DrawBitmap(const FloatRectangle& vcDestRect, const _BitmapImpl& srcBitmap, const FloatRectangle& vcSrcRect) +_CanvasImpl::DrawBitmap(const FloatRectangle& vcDestRectF, const _BitmapImpl& srcBitmap, const FloatRectangle& vcSrcRectF) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - return this->DrawBitmap(_Util::Convert(vcDestRect), srcBitmap, _Util::Convert(vcSrcRect)); -} + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(srcBitmap), E_INVALID_ARG, "The source bitmap is invalid."); -result -_CanvasImpl::DrawBitmap(const Point& vcPoint, const _BitmapImpl& bitmap, FlipDirection dir) -{ - SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + SysTryReturnResult(NID_GRP, (&vcSrcRectF) && (&vcDestRectF), E_INVALID_ARG, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + SysTryReturnResult(NID_GRP, (vcSrcRectF.width >= 0.0f) && (vcSrcRectF.height >= 0.0f), E_OUT_OF_RANGE, "The given source rectangle(width:%f,height:%f) is out of range.", vcSrcRectF.width, vcSrcRectF.height); + SysTryReturnResult(NID_GRP, (vcDestRectF.width >= 0.0f) && (vcDestRectF.height >= 0.0f), E_OUT_OF_RANGE, "The given destination rectangle(width:%f,height:%f) is out of range.", vcDestRectF.width, vcDestRectF.height); - switch (dir) + if (vcSrcRectF.width == 0.0f || vcSrcRectF.height == 0.0f) { - case FLIP_DIRECTION_HORIZONTAL: - case FLIP_DIRECTION_VERTICAL: - break; - default: - SysTryReturnResult(NID_GRP, 0, E_INVALID_ARG, "FlipStyle(%d) is invalid.", dir); - break; + return E_SUCCESS; } - EXTRACT_BITMAPEX(pBitmapEx, bitmap); + if (vcDestRectF.width == 0.0f || vcDestRectF.height == 0.0f) + { + return E_SUCCESS; + } + + if ((vcSrcRectF.x < 0.0f) || (vcSrcRectF.y < 0.0f) || (vcSrcRectF.x + vcSrcRectF.width > srcBitmap.GetActualWidth()) || (vcSrcRectF.y + vcSrcRectF.height > srcBitmap.GetActualHeight())) + { + SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The specified region of source bitmap is out of range."); + } + + // check if srcRect is in bitmap's area. + result r = _Util::Validate(vcSrcRectF, FloatRectangle(0, 0, srcBitmap.GetWidthF(), srcBitmap.GetHeightF())); + + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "Propagating."); + + // check if destRect is in this canvas. + FloatRectangle rtCanvas = _GetBoundsRelF(*this); + + if (rtCanvas.IsEmpty()) + { + return E_SUCCESS; + } + + r = _Util::Validate(vcDestRectF, rtCanvas); + + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "Propagating."); + + EXTRACT_BITMAPEX(pBitmapEx, srcBitmap); if (_ResUtil::NeedToConvertCoord()) { Tizen::Graphics::Dimension virSize; Tizen::Graphics::Dimension phySize; - bool lazyScaling = Tizen::Graphics::IsLazyScalingBitmap(bitmap, virSize, phySize); + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(srcBitmap, virSize, phySize); - Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint); + FloatRectangle pcDestRectF = _ResUtil::ConvertToPhyCoord(vcDestRectF); + + Rectangle pcDestRect(_FloatToIntForPos(pcDestRectF.x), _FloatToIntForPos(pcDestRectF.y), _FloatToIntForSize(vcDestRectF.width), _FloatToIntForSize(vcDestRectF.height)); if (lazyScaling) { - EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap); + Rectangle vcSrcRect(_FloatToIntForPos(vcSrcRectF.x), _FloatToIntForPos(vcSrcRectF.y), _FloatToIntForSize(vcSrcRectF.width), _FloatToIntForSize(vcSrcRectF.height)); - return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, dir); + return this->_pNativeCanvas->DrawBitmap(pcDestRect, *pBitmapEx, vcSrcRect); } else { - return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, dir); - } + FloatRectangle pcSrcRectF = _ResUtil::ConvertToPhyCoord(vcSrcRectF); + + Rectangle pcSrcRect(_FloatToIntForPos(pcSrcRectF.x), _FloatToIntForPos(pcSrcRectF.y), _FloatToIntForSize(pcSrcRectF.width), _FloatToIntForSize(pcSrcRectF.height)); + + return this->_pNativeCanvas->DrawBitmap(pcDestRect, *pBitmapEx, pcSrcRect); + } + } + else + { + Rectangle vcSrcRect(_FloatToIntForPos(vcSrcRectF.x), _FloatToIntForPos(vcSrcRectF.y), _FloatToIntForSize(vcSrcRectF.width), _FloatToIntForSize(vcSrcRectF.height)); + Rectangle vcDestRect(_FloatToIntForPos(vcDestRectF.x), _FloatToIntForPos(vcDestRectF.y), _FloatToIntForSize(vcDestRectF.width), _FloatToIntForSize(vcDestRectF.height)); + + return this->_pNativeCanvas->DrawBitmap(vcDestRect, *pBitmapEx, vcSrcRect); + } +} + +result +_CanvasImpl::DrawBitmap(const Point& vcPoint, const _BitmapImpl& bitmap, FlipDirection dir) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + + switch (dir) + { + case FLIP_DIRECTION_HORIZONTAL: + case FLIP_DIRECTION_VERTICAL: + break; + default: + SysTryReturnResult(NID_GRP, 0, E_INVALID_ARG, "FlipStyle(%d) is invalid.", dir); + break; + } + + EXTRACT_BITMAPEX(pBitmapEx, bitmap); + + if (_ResUtil::NeedToConvertCoord()) + { + Tizen::Graphics::Dimension virSize; + Tizen::Graphics::Dimension phySize; + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); + + Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint); + + if (lazyScaling) + { + EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap); + + return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, dir); + } + else + { + return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, dir); + } } else { @@ -967,7 +1212,7 @@ _CanvasImpl::DrawBitmap(const Point& vcPoint, const _BitmapImpl& bitmap, const P { Tizen::Graphics::Dimension virSize; Tizen::Graphics::Dimension phySize; - bool lazyScaling = Tizen::Graphics::IsLazyScalingBitmap(bitmap, virSize, phySize); + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint); Point pcPivot = _ResUtil::ConvertToPhyCoord(vcPivot); @@ -1027,7 +1272,7 @@ _CanvasImpl::DrawNinePatchedBitmap(const Rectangle& vcRect, const _BitmapImpl& b { Tizen::Graphics::Dimension virSize; Tizen::Graphics::Dimension phySize; - bool lazyScaling = Tizen::Graphics::IsLazyScalingBitmap(bitmap, virSize, phySize); + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vcRect); @@ -1049,11 +1294,109 @@ _CanvasImpl::DrawNinePatchedBitmap(const Rectangle& vcRect, const _BitmapImpl& b } result -_CanvasImpl::DrawNinePatchedBitmap(const FloatRectangle& vcRect, const _BitmapImpl& bitmap) +_CanvasImpl::DrawNinePatchedBitmap(const FloatRectangle& vcRectF, const _BitmapImpl& bitmap) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - return this->DrawNinePatchedBitmap(_Util::Convert(vcRect), bitmap); + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, bitmap.IsNinePatchedBitmap(), E_INVALID_ARG, "The source bitmap is not a nine patched bitmap."); + + // check if bimap can be drew in canvas area. + FloatRectangle rtCanvasF = _GetBoundsRelF(*this); + + if (rtCanvasF.IsEmpty()) + { + SysTryReturnResult(NID_GRP, 0, E_OPERATION_FAILED, "Cannot get the bounds of the canvas."); + } + + result r = _Util::Validate(vcRectF, rtCanvasF); + + if (IsFailed(r)) + { + return E_SUCCESS; + } + + EXTRACT_BITMAPEX(pBitmapEx, bitmap); + + if (_ResUtil::NeedToConvertCoord()) + { + Tizen::Graphics::Dimension virSize; + Tizen::Graphics::Dimension phySize; + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); + + FloatRectangle pcRectF = _ResUtil::ConvertToPhyCoord(vcRectF); + + Rectangle pcRect(_FloatToIntForPos(pcRectF.x), _FloatToIntForPos(pcRectF.y), _FloatToIntForSize(pcRectF.width), _FloatToIntForSize(pcRectF.height)); + + if (lazyScaling) + { + EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap); + + return this->_pNativeCanvas->DrawNinePatchedBitmap(pcRect, *pScaledBitmapEx); + } + else + { + return this->_pNativeCanvas->DrawNinePatchedBitmap(pcRect, *pBitmapEx); + } + } + else + { + Rectangle vcRect(_FloatToIntForPos(vcRectF.x), _FloatToIntForPos(vcRectF.y), _FloatToIntForSize(vcRectF.width), _FloatToIntForSize(vcRectF.height)); + + return this->_pNativeCanvas->DrawNinePatchedBitmap(vcRect, *pBitmapEx); + } +} + +result +_CanvasImpl::DrawNineTiledBitmap(const Rectangle& vcRect, const _BitmapImpl& bitmap) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid."); + + SysTryReturnResult(NID_GRP, bitmap.IsNinePatchedBitmap(), E_INVALID_ARG, "The source bitmap is not a nine tiled bitmap."); + + // check if bimap can be drew in canvas area. + Rectangle rtCanvas = _GetBoundsRel(*this); + + if (rtCanvas.IsEmpty()) + { + SysTryReturnResult(NID_GRP, 0, E_OPERATION_FAILED, "Cannot get the bounds of the canvas."); + } + + result r = _Util::Validate(vcRect, rtCanvas); + + if (IsFailed(r)) + { + return E_SUCCESS; + } + + EXTRACT_BITMAPEX(pBitmapEx, bitmap); + + if (_ResUtil::NeedToConvertCoord()) + { + Tizen::Graphics::Dimension virSize; + Tizen::Graphics::Dimension phySize; + bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize); + + Rectangle pcRect = _ResUtil::ConvertToPhyCoord(vcRect); + + if (lazyScaling) + { + EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap); + + return this->_pNativeCanvas->DrawNineTiledBitmap(pcRect, *pScaledBitmapEx); + } + else + { + return this->_pNativeCanvas->DrawNineTiledBitmap(pcRect, *pBitmapEx); + } + } + else + { + return this->_pNativeCanvas->DrawNineTiledBitmap(vcRect, *pBitmapEx); + } } result @@ -1072,8 +1415,8 @@ _CanvasImpl::DrawEllipse(const FloatRectangle& vcBounds) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, &vcBounds, E_OUT_OF_RANGE, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcBounds.width >= 0) && (vcBounds.height >= 0), E_OUT_OF_RANGE, - "The given rectangle(width:%d,height:%d) is out of range.", vcBounds.width, vcBounds.height); + SysTryReturnResult(NID_GRP, (vcBounds.width >= 0.0f) && (vcBounds.height >= 0.0f), E_OUT_OF_RANGE, + "The given rectangle(width:%f,height:%f) is out of range.", vcBounds.width, vcBounds.height); return _CanvasImplPrivate::DrawEllipse(this, _Util::Convert >(vcBounds)); } @@ -1191,7 +1534,7 @@ _CanvasImpl::DrawRectangle(const FloatRectangle& vcRect) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, &vcRect, E_OUT_OF_RANGE, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); + SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%f,height:%f) is out of range.", vcRect.width, vcRect.height); return _CanvasImplPrivate::DrawRectangle(this, _Util::Convert >(vcRect)); } @@ -1212,8 +1555,8 @@ _CanvasImpl::DrawRoundRectangle(const FloatRectangle& vcRect, const FloatDimensi { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, (&vcRect) && (&vcArcDim), E_OUT_OF_RANGE, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); - SysTryReturnResult(NID_GRP, (vcArcDim.width >= 0.0f) && (vcArcDim.height >= 0.0f), E_OUT_OF_RANGE, "The given arc size(width:%d,height:%d) is out of range.", vcArcDim.width, vcArcDim.height); + SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%f,height:%f) is out of range.", vcRect.width, vcRect.height); + SysTryReturnResult(NID_GRP, (vcArcDim.width >= 0.0f) && (vcArcDim.height >= 0.0f), E_OUT_OF_RANGE, "The given arc size(width:%f,height:%f) is out of range.", vcArcDim.width, vcArcDim.height); return _CanvasImplPrivate::DrawRoundRectangle(this, _Util::Convert >(vcRect), _Util::Convert >(vcArcDim)); } @@ -1257,7 +1600,7 @@ _CanvasImpl::FillEllipse(const Color& color, const FloatRectangle& vcBounds) SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, &vcBounds, E_OUT_OF_RANGE, "The given rectangle is invalid."); SysTryReturnResult(NID_GRP, (vcBounds.width >= 0.0f) && (vcBounds.height >= 0.0f), E_OUT_OF_RANGE, - "The given rectangle(width:%d,height:%d) is out of range.", vcBounds.width, vcBounds.height); + "The given rectangle(width:%f,height:%f) is out of range.", vcBounds.width, vcBounds.height); return _CanvasImplPrivate::FillEllipse(this, color, _Util::Convert >(vcBounds)); } @@ -1318,7 +1661,7 @@ _CanvasImpl::FillRectangle(const Color& color, const FloatRectangle& vcRect) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, &vcRect, E_OUT_OF_RANGE, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); + SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%f,height:%f) is out of range.", vcRect.width, vcRect.height); return _CanvasImplPrivate::FillRectangle(this, color, _Util::Convert >(vcRect)); } @@ -1339,8 +1682,8 @@ _CanvasImpl::FillRoundRectangle(const Color& color, const FloatRectangle& vcRect { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); SysTryReturnResult(NID_GRP, (&vcRect) && (&vcArcDim), E_OUT_OF_RANGE, "The given rectangle is invalid."); - SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); - SysTryReturnResult(NID_GRP, (vcArcDim.width >= 0.0f) && (vcArcDim.height >= 0.0f), E_OUT_OF_RANGE, "The given arc size(width:%d,height:%d) is out of range.", vcArcDim.width, vcArcDim.height); + SysTryReturnResult(NID_GRP, (vcRect.width >= 0.0f) && (vcRect.height >= 0.0f), E_OUT_OF_RANGE, "The given rectangle(width:%f,height:%f) is out of range.", vcRect.width, vcRect.height); + SysTryReturnResult(NID_GRP, (vcArcDim.width >= 0.0f) && (vcArcDim.height >= 0.0f), E_OUT_OF_RANGE, "The given arc size(width:%f,height:%f) is out of range.", vcArcDim.width, vcArcDim.height); return _CanvasImplPrivate::FillRoundRectangle(this, color, _Util::Convert >(vcRect), _Util::Convert >(vcArcDim)); } @@ -1479,6 +1822,145 @@ _CanvasImpl::DrawText(const Point& vcPoint, const EnrichedText& etext) return E_SUCCESS; } +result +_CanvasImpl::DrawText(const FloatPoint& vcPointF, const Tizen::Base::String& text) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, text.GetLength() >= 0, E_INVALID_ARG, "The text length (%d) is not valid.", text.GetLength()); + + if (_ResUtil::NeedToConvertCoord()) + { + Point pcPoint; + pcPoint.x = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.x)); + pcPoint.y = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.y)); + + return this->_pNativeCanvas->DrawText(pcPoint, text); + } + else + { + Point vcPoint; + vcPoint.x = _FloatToIntForPos(vcPointF.x); + vcPoint.y = _FloatToIntForPos(vcPointF.y); + + return this->_pNativeCanvas->DrawText(vcPoint, text); + } +} + +result +_CanvasImpl::DrawText(const FloatPoint& vcPointF, const Tizen::Base::String& text, int startIndex, int length) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + SysTryReturnResult(NID_GRP, text.GetLength() >= 0, E_INVALID_ARG, "The text length (%d) is not valid.", text.GetLength()); + SysTryReturnResult(NID_GRP, length >= 0 && startIndex >= 0 && startIndex < text.GetLength(), E_OUT_OF_RANGE, "The value of the length (%d), startIndex(%d) are outside the valid range defined by the method.", length, startIndex); + + if (text.GetLength() == 0) + { + return E_SUCCESS; + } + + if (_ResUtil::NeedToConvertCoord()) + { + Point pcPoint; + pcPoint.x = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.x)); + pcPoint.y = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.y)); + + return this->_pNativeCanvas->DrawText(pcPoint, text, startIndex, length); + } + else + { + Point vcPoint; + vcPoint.x = _FloatToIntForPos(vcPointF.x); + vcPoint.y = _FloatToIntForPos(vcPointF.y); + + return this->_pNativeCanvas->DrawText(vcPoint, text, startIndex, length); + } +} + +result +_CanvasImpl::DrawText(const FloatPoint& vcPointF, const Tizen::Base::String& text, int startIndex, const Color& outlineColor) +{ + const char* pNotConstructedYet = "[E_OPERATION_FAILED] This instance is not constructed yet."; + + SysTryReturn(NID_GRP, this, E_OPERATION_FAILED, E_OPERATION_FAILED, pNotConstructedYet); + SysTryReturn(NID_GRP, this->_pNativeCanvas, E_OPERATION_FAILED, E_OPERATION_FAILED, pNotConstructedYet); + SysTryReturn(NID_GRP, this->_pNativeCanvas->IsValid(), E_OPERATION_FAILED, E_OPERATION_FAILED, pNotConstructedYet); + + SysTryReturnResult(NID_GRP, text.GetLength() >= 0, E_INVALID_ARG, "The text length (%d) is not valid.", text.GetLength()); + + Point vcPoint; + vcPoint.x = _FloatToIntForPos(vcPointF.x); + vcPoint.y = _FloatToIntForPos(vcPointF.y); + + return this->DrawText(vcPoint, text, startIndex, text.GetLength(), outlineColor); +} + +result +_CanvasImpl::DrawText(const FloatPoint& vcPointF, const Tizen::Base::String& text, int startIndex, int length, const Color& outlineColor) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, text.GetLength() >= 0, E_INVALID_ARG, "The text length (%d) is not valid.", text.GetLength()); + + SysTryReturnResult(NID_GRP, length >= 0, E_OUT_OF_RANGE, + "The value of the length (%d) is outside the valid range defined by the method.", + length); + + if (text.GetLength() == 0) + { + return E_SUCCESS; + } + + if (_ResUtil::NeedToConvertCoord()) + { + Point pcPoint; + pcPoint.x = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.x)); + pcPoint.y = _FloatToIntForPos(_ResUtil::ConvertToPhyCoord(vcPointF.y)); + + return this->_pNativeCanvas->DrawText(pcPoint, text, startIndex, length, outlineColor); + } + else + { + Point vcPoint; + vcPoint.x = _FloatToIntForPos(vcPointF.x); + vcPoint.y = _FloatToIntForPos(vcPointF.y); + + return this->_pNativeCanvas->DrawText(vcPoint, text, startIndex, length, outlineColor); + } +} + +result +_CanvasImpl::DrawText(const FloatPoint& vcPointF, const EnrichedText& etext) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + const _EnrichedTextImpl* pImpl = _EnrichedTextImpl::GetInstance(etext); + + if (pImpl == null) + { + return E_OPERATION_FAILED; + } + + Tizen::Graphics::_Text::TextObject* pTextObject = const_cast <_EnrichedTextImpl*>(pImpl)->GetTextObject(); + + if (pTextObject == null) + { + return E_OPERATION_FAILED; + } + + Rectangle bounds = pImpl->GetBounds(); + + Point vcPoint; + vcPoint.x = _FloatToIntForPos(vcPointF.x); + vcPoint.y = _FloatToIntForPos(vcPointF.y); + + Rectangle rect(vcPoint.x, vcPoint.y, bounds.width, bounds.height); + pTextObject->SetBounds(rect); + pTextObject->Draw(*this); + + return E_SUCCESS; +} + Rectangle _CanvasImpl::GetBounds(void) const { @@ -1486,30 +1968,27 @@ _CanvasImpl::GetBounds(void) const if (_ResUtil::NeedToConvertCoord()) { - const _ResUtil::Pos& pos = this->_pCoordHolder->canvasPos.required; - const _ResUtil::Rect& bounds = this->_pCoordHolder->canvasSize.required; + const _Util::Point& pos = this->_pCoordHolder->canvasPos.vcInt; + const _Util::Dimension& vcSize = this->_pCoordHolder->canvasSize.vcInt; const Rectangle boundsFromPi = this->_pNativeCanvas->GetBounds(); - if ((bounds.w == 0 && boundsFromPi.width > 0) || (bounds.h == 0 && boundsFromPi.height > 0)) + if ((vcSize.w == 0 && boundsFromPi.width > 0) || (vcSize.h == 0 && boundsFromPi.height > 0)) { _CanvasImpl* pThis = const_cast<_CanvasImpl*>(this); - pThis->_pCoordHolder->canvasSize = _ResUtil::Rect(boundsFromPi.x, boundsFromPi.y, boundsFromPi.width, boundsFromPi.height); + _Util::Dimension intPcSize = { boundsFromPi.width, boundsFromPi.height }; - pThis->_pCoordHolder->canvasSize.phyCoord.x = boundsFromPi.x; - pThis->_pCoordHolder->canvasSize.phyCoord.y = boundsFromPi.y; - pThis->_pCoordHolder->canvasSize.phyCoord.w = boundsFromPi.width; - pThis->_pCoordHolder->canvasSize.phyCoord.h = boundsFromPi.height; + pThis->_pCoordHolder->AssignCanvasSizeFromPcSize(intPcSize); } // exception from the window canvas if (boundsFromPi.x == 0 && boundsFromPi.y == 0) { - return Rectangle(0, 0, bounds.w, bounds.h); + return Rectangle(0, 0, vcSize.w, vcSize.h); } else { - return Rectangle(pos.x, pos.y, bounds.w, bounds.h); + return Rectangle(pos.x, pos.y, vcSize.w, vcSize.h); } } else @@ -1518,6 +1997,63 @@ _CanvasImpl::GetBounds(void) const } } +FloatRectangle +_CanvasImpl::GetBoundsF(void) const +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, FloatRectangle(), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + const Rectangle boundsFromPi = this->_pNativeCanvas->GetBounds(); + + if (_ResUtil::NeedToConvertCoord()) + { + const _Util::Point& posF = this->_pCoordHolder->canvasPos.vcFloat; + const _Util::Dimension& vcSizeF = this->_pCoordHolder->canvasSize.vcFloat; + + // exception from the window canvas + if (boundsFromPi.x == 0 && boundsFromPi.y == 0) + { + return FloatRectangle(0.0f, 0.0f, vcSizeF.w, vcSizeF.h); + } + else + { + return FloatRectangle(posF.x, posF.y, vcSizeF.w, vcSizeF.h); + } + } + else + { + return FloatRectangle(static_cast(boundsFromPi.x), static_cast(boundsFromPi.x), static_cast(boundsFromPi.width), static_cast(boundsFromPi.height)); + } +} + + +FloatRectangle +_CanvasImpl::GetActualBounds(void) const +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, FloatRectangle(), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + const Rectangle boundsFromPi = this->_pNativeCanvas->GetBounds(); + + if (_ResUtil::NeedToConvertCoord()) + { + const _Util::Point& actualPosF = this->_pCoordHolder->canvasPos.vcFloatActual; + const _Util::Dimension& vcActualSizeF = this->_pCoordHolder->canvasSize.vcFloatActual; + + // exception from the window canvas + if (boundsFromPi.x == 0 && boundsFromPi.y == 0) + { + return FloatRectangle(0.0f, 0.0f, vcActualSizeF.w, vcActualSizeF.h); + } + else + { + return FloatRectangle(actualPosF.x, actualPosF.y, vcActualSizeF.w, vcActualSizeF.h); + } + } + else + { + return FloatRectangle(static_cast(boundsFromPi.x), static_cast(boundsFromPi.x), static_cast(boundsFromPi.width), static_cast(boundsFromPi.height)); + } +} + LineStyle _CanvasImpl::GetLineStyle() const { @@ -1531,14 +2067,31 @@ _CanvasImpl::GetLineWidth() const { SysTryReturn(NID_GRP, INSTANCE_IS_VALID, -1, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); - if (_ResUtil::NeedToConvertCoord()) - { - return this->_pCoordHolder->lineWidth.required; - } - else - { - return this->_pNativeCanvas->GetLineWidth(); - } + return this->_pCoordHolder->lineWidth.vcInt; +} + +float +_CanvasImpl::GetLineWidthF() const +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, -1.0f, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + return this->_pCoordHolder->lineWidth.vcFloat; +} + +LineCapStyle +_CanvasImpl::GetLineCapStyle() const +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, LINE_CAP_STYLE_ROUND, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + return this->_pNativeCanvas->GetLineCapStyle(); +} + +LineJoinStyle +_CanvasImpl::GetLineJoinStyle() const +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, LINE_JOIN_STYLE_ROUND, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + return this->_pNativeCanvas->GetLineJoinStyle(); } result @@ -1558,24 +2111,95 @@ _CanvasImpl::SetLineWidth(int vcWidth) SysTryReturnResult(NID_GRP, vcWidth > 0, E_OUT_OF_RANGE, "The given line width(%d) is out of range.", vcWidth); + result r = E_SUCCESS; + if (_ResUtil::NeedToConvertCoord()) { int pcWidth = _ResUtil::ConvertToPhyCoordSize(vcWidth); - float pcWidthFloat = _ResUtil::ConvertToPhyCoordSize(float(vcWidth)); - - result r = this->_pNativeCanvas->SetLineWidth(pcWidth, pcWidthFloat); + float pcWidthF = _ResUtil::ConvertToPhyCoordSize(float(vcWidth)); - if (IsSucceeded(r)) + if (vcWidth > 0 && pcWidth == 0) { - this->_pCoordHolder->lineWidth = vcWidth; + pcWidth = 1; } - return r; + r = this->_pNativeCanvas->SetLineWidth(pcWidth, pcWidthF); } else { - return this->_pNativeCanvas->SetLineWidth(vcWidth, float(vcWidth)); + r = this->_pNativeCanvas->SetLineWidth(vcWidth, float(vcWidth)); + } + + if (IsSucceeded(r)) + { + this->_pCoordHolder->AssignLineWidthFromVc(vcWidth); } + + return r; +} + +result +_CanvasImpl::SetLineWidth(float vcWidthF) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + SysTryReturnResult(NID_GRP, vcWidthF > 0.0f, E_OUT_OF_RANGE, "The given line width(%f) is out of range.", vcWidthF); + + result r = E_SUCCESS; + + if (_ResUtil::NeedToConvertCoord()) + { + float pcWidthF = _ResUtil::ConvertToPhyCoordSize(vcWidthF); + + r = this->_pNativeCanvas->SetLineWidth(pcWidthF); + } + else + { + r = this->_pNativeCanvas->SetLineWidth(vcWidthF); + } + + if (IsSucceeded(r)) + { + this->_pCoordHolder->AssignLineWidthFromVc(vcWidthF); + } + + return r; +} + +result +_CanvasImpl::SetLineCapStyle(LineCapStyle lineCapStyle) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + switch(lineCapStyle) + { + case LINE_CAP_STYLE_ROUND: + case LINE_CAP_STYLE_BUTT: + case LINE_CAP_STYLE_SQUARE: + break; + default: + SysTryReturn(NID_GRP, true, E_INVALID_ARG, E_INVALID_ARG, "The given line cap style is out of range."); + } + + return this->_pNativeCanvas->SetLineCapStyle(lineCapStyle); +} + +result +_CanvasImpl::SetLineJoinStyle(LineJoinStyle lineJoinStyle) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + switch(lineJoinStyle) + { + case LINE_JOIN_STYLE_ROUND: + case LINE_JOIN_STYLE_MITER: + case LINE_JOIN_STYLE_BEVEL: + break; + default: + SysTryReturn(NID_GRP, true, E_INVALID_ARG, E_INVALID_ARG, "The given line join style is out of range."); + } + + return this->_pNativeCanvas->SetLineJoinStyle(lineJoinStyle); } result @@ -1585,6 +2209,47 @@ _CanvasImpl::GetDashPattern(Tizen::Base::Collection::IListT& pattern, int& pattern.RemoveAll(); + result r = E_SUCCESS; + + float floatValue = 0.0f; + + for (int i = 0; i < this->_dashList.GetCount(); i++) + { + this->_dashList.GetAt(i, floatValue); + r = pattern.Add(floatValue); + if (r != E_SUCCESS) + { + break; + } + } + + if (IsFailed(r)) + { + switch (r) + { + case E_INVALID_ARG: + case E_OPERATION_FAILED: + case E_OUT_OF_MEMORY: + SysTryReturn(NID_GRP, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + break; + default: + SysTryReturn(NID_GRP, false, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Tizen::Base::Collection::ArrayListT::AddItems() failed"); + break; + } + } + + offset = int(this->_dashOffset); + + return r; +} + +result +_CanvasImpl::GetDashPattern(Tizen::Base::Collection::IListT& pattern, float& offset) +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + pattern.RemoveAll(); + result r = pattern.AddItems(this->_dashList); if (IsFailed(r)) @@ -1617,7 +2282,17 @@ _CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, // It is NOT the strong guarantee for an exception this->_dashList.RemoveAll(); - r = this->_dashList.AddItems(pattern); + int intValue = 0; + + for (int i = 0; i < pattern.GetCount(); i++) + { + pattern.GetAt(i, intValue); + r = this->_dashList.Add(float(intValue)); + if (r != E_SUCCESS) + { + break; + } + } if (IsFailed(r)) { @@ -1654,6 +2329,52 @@ _CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, } result +_CanvasImpl::SetDashPattern(const Tizen::Base::Collection::IListT& pattern, float offset) +{ + SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet."); + + result r = E_SUCCESS; + + // It is NOT the strong guarantee for an exception + this->_dashList.RemoveAll(); + + r = this->_dashList.AddItems(pattern); + + if (IsFailed(r)) + { + switch (r) + { + case E_INVALID_ARG: + case E_OPERATION_FAILED: + case E_OUT_OF_MEMORY: + SysTryReturn(NID_GRP, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + break; + default: + SysTryReturn(NID_GRP, false, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Tizen::Base::Collection::ArrayListT::AddItems() failed"); + break; + } + } + + { + float dashIntValue = 0.0f; + Tizen::Graphics::_Util::AccumList dashValueList; + + for (int i = 0; i < pattern.GetCount(); i++) + { + pattern.GetAt(i, dashIntValue); + dashValueList.Push(double(dashIntValue)); + } + + r = this->_pNativeCanvas->SetDashPattern(dashValueList, double(offset)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + this->_dashOffset = offset; + } + + return r; +} + +result _CanvasImpl::SetDrawingQuality(BitmapDrawingQuality quality) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); @@ -1681,52 +2402,46 @@ _CanvasImpl::GetDrawingQuality(void) const } result -_CanvasImpl::SetBlendingMode(BlendingMode blendingMode) -{ - SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - - switch (blendingMode) - { - case BLENDING_MODE_CLEAR: - case BLENDING_MODE_SRC: - case BLENDING_MODE_DST: - case BLENDING_MODE_SRC_OVER: - case BLENDING_MODE_DST_OVER: - case BLENDING_MODE_SRC_IN: - case BLENDING_MODE_DST_IN: - case BLENDING_MODE_SRC_OUT: - case BLENDING_MODE_DST_OUT: - case BLENDING_MODE_SRC_ATOP: - case BLENDING_MODE_DST_ATOP: - case BLENDING_MODE_DST_XOR: - case BLENDING_MODE_ADD: - case BLENDING_MODE_SATURATE: - case BLENDING_MODE_MULTIPLY: - case BLENDING_MODE_SCREEN: - case BLENDING_MODE_OVERLAY: - case BLENDING_MODE_DARKEN: - case BLENDING_MODE_LIGHTEN: - case BLENDING_MODE_COLOR_DODGE: - case BLENDING_MODE_COLOR_BURN: - case BLENDING_MODE_HARD_LIGHT: - case BLENDING_MODE_SOFT_LIGHT: - case BLENDING_MODE_DIFFERENCE: - case BLENDING_MODE_EXCLUSION: +_CanvasImpl::SetCompositeMode(CompositeMode compositeMode) +{ + SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + + switch (compositeMode) + { + case COMPOSITE_MODE_CLEAR: + case COMPOSITE_MODE_SRC: + case COMPOSITE_MODE_DST: + case COMPOSITE_MODE_SRC_OVER: + case COMPOSITE_MODE_DST_OVER: + case COMPOSITE_MODE_SRC_IN: + case COMPOSITE_MODE_DST_IN: + case COMPOSITE_MODE_SRC_OUT: + case COMPOSITE_MODE_DST_OUT: + case COMPOSITE_MODE_SRC_ATOP: + case COMPOSITE_MODE_DST_ATOP: + case COMPOSITE_MODE_DST_XOR: + case COMPOSITE_MODE_ADD: + case COMPOSITE_MODE_SATURATE: + case COMPOSITE_MODE_MULTIPLY: + case COMPOSITE_MODE_SCREEN: + case COMPOSITE_MODE_OVERLAY: + case COMPOSITE_MODE_DARKEN: + case COMPOSITE_MODE_LIGHTEN: break; default: - SysLogException(NID_GRP, E_INVALID_ARG, "The specified blending mode(%d) is invalid.", blendingMode); + SysLogException(NID_GRP, E_INVALID_ARG, "The specified composite mode(%d) is invalid.", compositeMode); return E_INVALID_ARG; } - this->_pNativeCanvas->SetBlendingMode(blendingMode); + this->_pNativeCanvas->SetCompositeMode(compositeMode); return E_SUCCESS; } -BlendingMode -_CanvasImpl::GetBlendingMode(void) const +CompositeMode +_CanvasImpl::GetCompositeMode(void) const { - return (INSTANCE_IS_VALID) ? this->_pNativeCanvas->GetBlendingMode() : BLENDING_MODE_SRC_OVER; + return (INSTANCE_IS_VALID) ? this->_pNativeCanvas->GetCompositeMode() : COMPOSITE_MODE_SRC_OVER; } result @@ -1755,6 +2470,15 @@ _CanvasImpl::GetPixel(const Point& vcPoint, Color& color) const } result +_CanvasImpl::GetPixel(const FloatPoint& point, Color& color) const +{ + // @hoonik.lee + Point intPoint(static_cast(point.x), static_cast(point.y)); + + return this->GetPixel(intPoint, color); +} + +result _CanvasImpl::SetPixel(const FloatPoint& vcPoint) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); @@ -1775,6 +2499,14 @@ _CanvasImpl::Show() { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); + if (this->_pShowCallbackFunc) + { + if (this->_pShowCallbackFunc(this->_pShowCallbackParam)) + { + return E_SUCCESS; + } + } + result r = E_SUCCESS; Rectangle rect = this->GetBounds(); @@ -1793,6 +2525,14 @@ _CanvasImpl::Show(const Rectangle& vcRect) "The given rectangle(width:%d,height:%d) is out of range.", vcRect.width, vcRect.height); + if (this->_pShowCallbackFunc) + { + if (this->_pShowCallbackFunc(this->_pShowCallbackParam)) + { + return E_SUCCESS; + } + } + result r = E_SUCCESS; Rectangle rect = this->GetBounds(); @@ -1963,6 +2703,15 @@ _CanvasImpl::SetClipBounds(const Rectangle& vcRect) } } +result +_CanvasImpl::SetClipBounds(const FloatRectangle& rect) +{ + // @hoonik.lee + Rectangle intRect(static_cast(rect.x), static_cast(rect.y), static_cast(rect.width), static_cast(rect.height)); + + return this->SetClipBounds(intRect); +} + Rectangle _CanvasImpl::GetClipBounds(void) const { @@ -1981,6 +2730,17 @@ _CanvasImpl::GetClipBounds(void) const } } +FloatRectangle +_CanvasImpl::GetClipBoundsF(void) const +{ + // @hoonik.lee + Rectangle intRect = this->GetClipBounds(); + + FloatRectangle floatRect(static_cast(intRect.x), static_cast(intRect.y), static_cast(intRect.width), static_cast(intRect.height)); + + return floatRect; +} + result _CanvasImpl::Lock(BufferInfo& info, long timeout) { @@ -2046,23 +2806,29 @@ _CanvasImpl::SetPosition(int vcX, int vcY) { SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet."); - if (_ResUtil::NeedToConvertCoord()) - { - Point pcPoint = _ResUtil::ConvertToPhyCoord(Point(vcX, vcY)); + _CanvasCoordHolder tempCoordHolder; + tempCoordHolder.AssignCanvasPosFromVc(vcX, vcY); - result r = this->_pNativeCanvas->SetPosition(pcPoint.x, pcPoint.y); + result r = E_SUCCESS; - if (IsSucceeded(r)) - { - this->_pCoordHolder->canvasPos = _ResUtil::Pos(vcX, vcY); - } + if (_ResUtil::NeedToConvertCoord()) + { + Point pcPoint(tempCoordHolder.canvasPos.pcInt.x, tempCoordHolder.canvasPos.pcInt.y); - return r; + r = this->_pNativeCanvas->SetPosition(pcPoint.x, pcPoint.y); } else { - return this->_pNativeCanvas->SetPosition(vcX, vcY); + r = this->_pNativeCanvas->SetPosition(vcX, vcY); } + + if (IsSucceeded(r)) + { + this->_pCoordHolder->canvasPos = tempCoordHolder.canvasPos; + } + + return r; + } Canvas* @@ -2094,8 +2860,8 @@ _CanvasImpl::GetSubCanvasN(const Rectangle& subRegion) const SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); pSubCanvasImpl->_pCoordHolder->Init(subRegion); - pSubCanvasImpl->_pCoordHolder->canvasSize.phyCoord.w = subRegionPC.width; - pSubCanvasImpl->_pCoordHolder->canvasSize.phyCoord.h = subRegionPC.height; + pSubCanvasImpl->_pCoordHolder->canvasSize.pcInt.w = subRegionPC.width; + pSubCanvasImpl->_pCoordHolder->canvasSize.pcInt.h = subRegionPC.height; } else { @@ -2117,6 +2883,15 @@ _CanvasImpl::GetSubCanvasN(const Rectangle& subRegion) const return subCanvas.release(); } +Canvas* +_CanvasImpl::GetSubCanvasFN(const FloatRectangle& subRegion) const +{ + // @hoonik.lee + Rectangle intSubRegion(static_cast(subRegion.x), static_cast(subRegion.y), static_cast(subRegion.width), static_cast(subRegion.height)); + + return this->GetSubCanvasN(intSubRegion); +} + result _CanvasImpl::SetPriorityFont(const Font& font) { diff --git a/src/graphics/FGrp_CanvasPixman.cpp b/src/graphics/FGrp_CanvasPixman.cpp index 0f9181e..25b9e25 100644 --- a/src/graphics/FGrp_CanvasPixman.cpp +++ b/src/graphics/FGrp_CanvasPixman.cpp @@ -47,60 +47,48 @@ AutoDeletor::~AutoDeletor(void) namespace _Pixman { -pixman_op_t GetRop(Tizen::Graphics::BlendingMode blendingMode) +pixman_op_t GetRop(Tizen::Graphics::CompositeMode compositeMode) { - switch (blendingMode) + switch (compositeMode) { - case BLENDING_MODE_CLEAR: + case COMPOSITE_MODE_CLEAR: return PIXMAN_OP_CLEAR; - case BLENDING_MODE_SRC: + case COMPOSITE_MODE_SRC: return PIXMAN_OP_SRC; - case BLENDING_MODE_DST: + case COMPOSITE_MODE_DST: return PIXMAN_OP_DST; - case BLENDING_MODE_SRC_OVER: + case COMPOSITE_MODE_SRC_OVER: return PIXMAN_OP_OVER; - case BLENDING_MODE_DST_OVER: + case COMPOSITE_MODE_DST_OVER: return PIXMAN_OP_OVER_REVERSE; - case BLENDING_MODE_SRC_IN: + case COMPOSITE_MODE_SRC_IN: return PIXMAN_OP_IN; - case BLENDING_MODE_DST_IN: + case COMPOSITE_MODE_DST_IN: return PIXMAN_OP_IN_REVERSE; - case BLENDING_MODE_SRC_OUT: + case COMPOSITE_MODE_SRC_OUT: return PIXMAN_OP_OUT; - case BLENDING_MODE_DST_OUT: + case COMPOSITE_MODE_DST_OUT: return PIXMAN_OP_OUT_REVERSE; - case BLENDING_MODE_SRC_ATOP: + case COMPOSITE_MODE_SRC_ATOP: return PIXMAN_OP_ATOP; - case BLENDING_MODE_DST_ATOP: + case COMPOSITE_MODE_DST_ATOP: return PIXMAN_OP_ATOP_REVERSE; - case BLENDING_MODE_DST_XOR: + case COMPOSITE_MODE_DST_XOR: return PIXMAN_OP_XOR; - case BLENDING_MODE_ADD: + case COMPOSITE_MODE_ADD: return PIXMAN_OP_ADD; - case BLENDING_MODE_SATURATE: + case COMPOSITE_MODE_SATURATE: return PIXMAN_OP_SATURATE; - case BLENDING_MODE_MULTIPLY: + case COMPOSITE_MODE_MULTIPLY: return PIXMAN_OP_MULTIPLY; - case BLENDING_MODE_SCREEN: + case COMPOSITE_MODE_SCREEN: return PIXMAN_OP_SCREEN; - case BLENDING_MODE_OVERLAY: + case COMPOSITE_MODE_OVERLAY: return PIXMAN_OP_OVERLAY; - case BLENDING_MODE_DARKEN: + case COMPOSITE_MODE_DARKEN: return PIXMAN_OP_DARKEN; - case BLENDING_MODE_LIGHTEN: + case COMPOSITE_MODE_LIGHTEN: return PIXMAN_OP_LIGHTEN; - case BLENDING_MODE_COLOR_DODGE: - return PIXMAN_OP_COLOR_DODGE; - case BLENDING_MODE_COLOR_BURN: - return PIXMAN_OP_COLOR_BURN; - case BLENDING_MODE_HARD_LIGHT: - return PIXMAN_OP_HARD_LIGHT; - case BLENDING_MODE_SOFT_LIGHT: - return PIXMAN_OP_SOFT_LIGHT; - case BLENDING_MODE_DIFFERENCE: - return PIXMAN_OP_DIFFERENCE; - case BLENDING_MODE_EXCLUSION: - return PIXMAN_OP_EXCLUSION; default: return PIXMAN_OP_SRC; } @@ -299,14 +287,14 @@ bool ResizePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphic return ResizePixmap(dstImage, srcImage, filter); } -bool CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::BlendingMode blendingMode) +bool CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode) { if (dstImage.width <= 0 || dstImage.height <= 0) { return true; } - pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(blendingMode); + pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode); pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality); @@ -316,14 +304,14 @@ bool CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics: return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NONE); } -bool ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::BlendingMode blendingMode) +bool ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode) { if (dstImage.width <= 0 || dstImage.height <= 0) { return true; } - pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(blendingMode); + pixman_op_t rop = Tizen::Graphics::_Pixman::GetRop(compositeMode); pixman_filter_t filter = Tizen::Graphics::_Pixman::GetFilter(drawingQuality); pixman_transform_t transform = Tizen::Graphics::_Pixman::GetTransform(srcImage.width, srcImage.height, dstImage.width, dstImage.height); diff --git a/src/graphics/FGrp_CanvasPixman.h b/src/graphics/FGrp_CanvasPixman.h index 9005acb..fa099ff 100644 --- a/src/graphics/FGrp_CanvasPixman.h +++ b/src/graphics/FGrp_CanvasPixman.h @@ -38,10 +38,10 @@ namespace _Pixman { bool -CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::BlendingMode blendingMode); +CopyPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode); bool -ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::BlendingMode blendingMode = BLENDING_MODE_SRC_OVER); +ScalePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode = COMPOSITE_MODE_SRC_OVER); bool ResizePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapScalingQuality scalingQuality); diff --git a/src/graphics/FGrp_CanvasTool.cpp b/src/graphics/FGrp_CanvasTool.cpp new file mode 100755 index 0000000..6be0575 --- /dev/null +++ b/src/graphics/FGrp_CanvasTool.cpp @@ -0,0 +1,83 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FGrp_CanvasTool.cpp + * @brief This is the cpp file for internal util class. + * + */ + +#include "FGrp_CanvasTool.h" +#include "FGrp_CanvasImpl.h" + + +namespace Tizen { namespace Graphics +{ + +class _CanvasImplHack + : public _CanvasImpl +{ +public: + bool SetCallback(bool (* ShowCallback)(void*), void* pCallbackParam) + { + if (this->IsConstructed()) + { + this->_pShowCallbackFunc = ShowCallback; + this->_pShowCallbackParam = pCallbackParam; + + return true; + } + + return false; + } + + void ResetCallback(void) + { + if (this->IsConstructed()) + { + this->_pShowCallbackFunc = null; + this->_pShowCallbackParam = null; + } + } + +}; // _CanvasImplHack + +bool +_CanvasTool::SetCallback(Tizen::Graphics::Canvas& canvas, + bool (* ShowCallback)(void*), void* pCallbackParam) +{ + Tizen::Graphics::_CanvasImpl* pCanvasImpl = _CanvasImpl::GetInstance(canvas); + + _CanvasImplHack* pCanvasImplHack = static_cast <_CanvasImplHack*>(pCanvasImpl); + + return (pCanvasImplHack) ? pCanvasImplHack->SetCallback(ShowCallback, pCallbackParam) : false; +} + +void +_CanvasTool::ResetCallback(Tizen::Graphics::Canvas& canvas) +{ + Tizen::Graphics::_CanvasImpl* pCanvasImpl = _CanvasImpl::GetInstance(canvas); + + _CanvasImplHack* pCanvasImplHack = static_cast <_CanvasImplHack*>(pCanvasImpl); + + if (pCanvasImplHack) + { + pCanvasImplHack->ResetCallback(); + } +} + +}} // Tizen::Graphics diff --git a/src/graphics/FGrp_CoordinateSystem.cpp b/src/graphics/FGrp_CoordinateSystem.cpp old mode 100644 new mode 100755 index d9043db..46fbd2a --- a/src/graphics/FGrp_CoordinateSystem.cpp +++ b/src/graphics/FGrp_CoordinateSystem.cpp @@ -226,6 +226,49 @@ _CoordinateSystem::GetTransformerN(_LogicalResolution logicalResolution, _BaseSc return pXformer; } +double +_CoordinateSystem::GetAppBaseScaleFactor() +{ + int baseScreenSizeFactor = 0; + + switch (GetLogicalBaseScreenSize()) + { + case BASE_SCREEN_SIZE_NORMAL: + baseScreenSizeFactor = 1; + break; + case BASE_SCREEN_SIZE_LARGE: + baseScreenSizeFactor = 2; + break; + default: + baseScreenSizeFactor = -1; + break; + } + + return GetLogicalResolutionInt() * baseScreenSizeFactor; +} + +double +_CoordinateSystem::GetTargetBaseScaleFactor() +{ + int baseScreenSizeFactor = 0; + + switch (GetLogicalBaseScreenSize()) + { + case BASE_SCREEN_SIZE_NORMAL: + baseScreenSizeFactor = 1; + break; + case BASE_SCREEN_SIZE_LARGE: + baseScreenSizeFactor = 2; + break; + default: + baseScreenSizeFactor = -1; + break; + } + + Dimension physicalDim = GetPhysicalResolutionDim(); + + return (physicalDim.width < physicalDim.height ? physicalDim.width : physicalDim.height) * baseScreenSizeFactor; +} _CoordinateSystem::_CoordinateSystem(void) : __pImpl(null) @@ -441,7 +484,7 @@ _CoordinateSystem::__Initialize(int srcResolution, _BaseScreenSize srcBaseScreen }} // Tizen::Graphics -// temporary test code for tizen 2.0 +// temporary test code for tizen 2.1 namespace Tizen { namespace Graphics { @@ -450,7 +493,7 @@ _SetLogicalRes480(void) { _CoordinateSystem* pInstance = _CoordinateSystem::GetInstance(); - pInstance->Reset(RESOLUTION_LOGICAL_480, BASE_SCREEN_SIZE_NORMAL); + pInstance->Reset(480, BASE_SCREEN_SIZE_NORMAL, Dimension(_Screen::GetWidth(), _Screen::GetHeight()), BASE_SCREEN_SIZE_NORMAL); } void @@ -458,7 +501,7 @@ _SetLogicalRes720(void) { _CoordinateSystem* pInstance = _CoordinateSystem::GetInstance(); - pInstance->Reset(RESOLUTION_LOGICAL_720, BASE_SCREEN_SIZE_NORMAL); + pInstance->Reset(720, BASE_SCREEN_SIZE_NORMAL, Dimension(_Screen::GetWidth(), _Screen::GetHeight()), BASE_SCREEN_SIZE_NORMAL); } }} // Tizen::Graphics diff --git a/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp b/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp index 13116e3..dc5e126 100644 --- a/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp +++ b/src/graphics/FGrp_CoordinateSystemDeviceSpec.cpp @@ -153,19 +153,39 @@ struct Transformer return Rectangle(x, y, w, h); } + virtual FloatPoint Transform(const FloatPoint& point) const + { + return FloatPoint(Transform(point.x), Transform(point.y)); + } + + virtual FloatDimension Transform(const FloatDimension& dim) const + { + return FloatDimension(TransformHorizontal(dim.width), TransformVertical(dim.height)); + } + + virtual FloatRectangle Transform(const FloatRectangle& rect) const + { + float x = Transform(rect.x); + float y = Transform(rect.y); + float w = TransformHorizontal(rect.width); + float h = TransformVertical(rect.height); + + return FloatRectangle(x, y, w, h); + } + virtual int TransformFloatToInt(float scalar) const { - return VScale::ScaleLength(static_cast(scalar)); + return static_cast(Transform(scalar)); } virtual int TransformHorizontalFloatToInt(float width) const { - return HScale::ScaleLength(static_cast(width)); + return static_cast(TransformHorizontal(width)); } virtual int TransformVerticalFloatToInt(float height) const { - return VScale::ScaleLength(static_cast(height)); + return static_cast(TransformVertical(height)); } virtual float GetHorizontalScaleFactor(void) const @@ -481,6 +501,7 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const _Scaler(int src_, int trg_) : src(src_) , trg(trg_) + , scaleFactor(trg_ * 1.0f / src_) { } @@ -503,8 +524,19 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const return ScaleDisplacement(srcVal); } + float ScaleDisplacement(float srcVal) const + { + return srcVal * scaleFactor; + } + + float ScaleLength(float srcVal) const + { + return ScaleDisplacement(srcVal); + } + int src; int trg; + float scaleFactor; }; class _Xformer @@ -569,19 +601,39 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const return Rectangle(x, y, w, h); } + virtual FloatPoint Transform(const FloatPoint& point) const + { + return FloatPoint(__scalerH.ScaleDisplacement(point.x), __scalerV.ScaleDisplacement(point.y)); + } + + virtual FloatDimension Transform(const FloatDimension& dim) const + { + return FloatDimension(__scalerH.ScaleLength(dim.width), __scalerV.ScaleLength(dim.height)); + } + + virtual FloatRectangle Transform(const FloatRectangle& rect) const + { + float x = __scalerH.ScaleDisplacement(rect.x); + float y = __scalerV.ScaleDisplacement(rect.y); + float w = __scalerH.ScaleLength(rect.width); + float h = __scalerV.ScaleLength(rect.height); + + return FloatRectangle(x, y, w, h); + } + virtual int TransformFloatToInt(float scalar) const { - return __scalerV.ScaleLength(static_cast(scalar)); + return static_cast(__scalerV.ScaleLength(scalar)); } virtual int TransformHorizontalFloatToInt(float width) const { - return __scalerH.ScaleLength(static_cast(width)); + return static_cast(__scalerH.ScaleLength(width)); } virtual int TransformVerticalFloatToInt(float height) const { - return __scalerV.ScaleLength(static_cast(height)); + return static_cast(__scalerV.ScaleLength(height)); } virtual float GetHorizontalScaleFactor(void) const @@ -607,7 +659,6 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, const return (pTransformer) ? E_SUCCESS : E_SYSTEM; } - }} // Tizen::Graphics @@ -701,13 +752,13 @@ struct PhyResTraits template<> struct ScrResTraits { - enum { WIDTH = 720 }; + enum { WIDTH = 1 }; }; template<> struct ScrResTraits { - enum { WIDTH = 1440 }; + enum { WIDTH = 2 }; }; @@ -830,9 +881,9 @@ _GetIntegerResolution(_BaseScreenSize res) switch (res) { case BASE_SCREEN_SIZE_NORMAL: - return 720; + return 1; case BASE_SCREEN_SIZE_LARGE: - return 1440; + return 2; default: return -1; } @@ -1238,11 +1289,11 @@ class TransformerNormalHvgaToNormal720 }; // TransformerNormalHvgaToNormal720 -class TransformerGeneral +class _TransformerGeneral : public _ICoordinateSystemTransformer { public: - TransformerGeneral(const int srcScalar, const int dstScalar) + _TransformerGeneral(const int srcScalar, const int dstScalar) : __srcScalar(srcScalar) , __dstScalar(dstScalar) , __scaleFactor(dstScalar * 1.0f / srcScalar) @@ -1299,19 +1350,39 @@ class TransformerGeneral return Rectangle(x, y, w, h); } + virtual FloatPoint Transform(const FloatPoint& point) const + { + return FloatPoint(ScaleDisplacement(point.x), ScaleDisplacement(point.y)); + } + + virtual FloatDimension Transform(const FloatDimension& dim) const + { + return FloatDimension(ScaleLength(dim.width), ScaleLength(dim.height)); + } + + virtual FloatRectangle Transform(const FloatRectangle& rect) const + { + float x = ScaleDisplacement(rect.x); + float y = ScaleDisplacement(rect.y); + float w = ScaleLength(rect.width); + float h = ScaleLength(rect.height); + + return FloatRectangle(x, y, w, h); + } + virtual int TransformFloatToInt(float scalar) const { - return ScaleLength(static_cast(scalar)); + return static_cast(ScaleLength(scalar)); } virtual int TransformHorizontalFloatToInt(float width) const { - return ScaleLength(static_cast(width)); + return static_cast(ScaleLength(width)); } virtual int TransformVerticalFloatToInt(float height) const { - return ScaleLength(static_cast(height)); + return static_cast(ScaleLength(height)); } virtual float GetHorizontalScaleFactor(void) const @@ -1359,7 +1430,7 @@ private: float __scaleFactor; -}; // TransformerGeneral +}; // _TransformerGeneral bool _WillNotTransform(_LogicalResolution logicalResolution, _BaseScreenSize logicalBaseScreenSize, _PhysicalResolution physicalResolution, _BaseScreenSize physicalBaseScreenSize) @@ -1461,13 +1532,13 @@ _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, _Logica else { //r = E_INVALID_ARG; - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(physicalResolution), _GetIntegerResolution(logicalResolution)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(physicalResolution), _GetIntegerResolution(logicalResolution)); } } else { //r = E_INVALID_ARG; - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize), _GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize), _GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize)); } } else @@ -1525,13 +1596,13 @@ _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, _Logica else { //r = E_INVALID_ARG; - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(logicalResolution), _GetIntegerResolution(physicalResolution)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(logicalResolution), _GetIntegerResolution(physicalResolution)); } } else { //r = E_INVALID_ARG; - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize), _GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize), _GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize)); } } @@ -1540,22 +1611,22 @@ _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, _Logica { if (logicalBaseScreenSize == physicalBaseScreenSize) { - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(physicalResolution), _GetIntegerResolution(logicalResolution)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(physicalResolution), _GetIntegerResolution(logicalResolution)); } else { - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize), _GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize), _GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize)); } } else { if (logicalBaseScreenSize == physicalBaseScreenSize) { - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(logicalResolution), _GetIntegerResolution(physicalResolution)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(logicalResolution), _GetIntegerResolution(physicalResolution)); } else { - pTransformer = new (std::nothrow) TransformerGeneral(_GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize), _GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize)); + pTransformer = new (std::nothrow) _TransformerGeneral(_GetIntegerResolution(logicalResolution) * _GetIntegerResolution(physicalBaseScreenSize), _GetIntegerResolution(physicalResolution) * _GetIntegerResolution(logicalBaseScreenSize)); } } #endif @@ -1604,7 +1675,7 @@ _CoordinateTransformerCore(_ICoordinateSystemTransformer*& pTransformer, int src return E_SUCCESS; } - pTransformer = new (std::nothrow) TransformerGeneral(srcResolution * _GetIntegerResolution(destBaseScreenSize), (destResolution.width < destResolution.height ? destResolution.width : destResolution.height) * _GetIntegerResolution(srcBaseScreenSize)); + pTransformer = new (std::nothrow) _TransformerGeneral(srcResolution * _GetIntegerResolution(destBaseScreenSize), (destResolution.width < destResolution.height ? destResolution.width : destResolution.height) * _GetIntegerResolution(srcBaseScreenSize)); if (pTransformer) { diff --git a/src/graphics/FGrp_CoordinateSystemImpl.cpp b/src/graphics/FGrp_CoordinateSystemImpl.cpp index cd240e7..c7942fc 100644 --- a/src/graphics/FGrp_CoordinateSystemImpl.cpp +++ b/src/graphics/FGrp_CoordinateSystemImpl.cpp @@ -109,6 +109,21 @@ public: return IsEnabled() ? __pXformer->Transform(point) : point; } + virtual FloatRectangle Transform(const FloatRectangle& rect) const + { + return IsEnabled() ? __pXformer->Transform(rect) : rect; + } + + virtual FloatDimension Transform(const FloatDimension& dim) const + { + return IsEnabled() ? __pXformer->Transform(dim) : dim; + } + + virtual FloatPoint Transform(const FloatPoint& point) const + { + return IsEnabled() ? __pXformer->Transform(point) : point; + } + virtual int Transform(int scalar) const { return IsEnabled() ? __pXformer->Transform(scalar) : scalar; @@ -141,17 +156,17 @@ public: virtual int TransformFloatToInt(float scalar) const { - return IsEnabled() ? __pXformer->Transform(static_cast(scalar)) : static_cast(scalar); + return IsEnabled() ? static_cast(__pXformer->Transform(scalar)) : static_cast(scalar); } virtual int TransformHorizontalFloatToInt(float scalar) const { - return IsEnabled() ? __pXformer->TransformHorizontal(static_cast(scalar)) : static_cast(scalar); + return IsEnabled() ? static_cast(__pXformer->TransformHorizontal(scalar)) : static_cast(scalar); } virtual int TransformVerticalFloatToInt(float scalar) const { - return IsEnabled() ? __pXformer->TransformVertical(static_cast(scalar)) : static_cast(scalar); + return IsEnabled() ? static_cast(__pXformer->TransformVertical(scalar)) : static_cast(scalar); } virtual float GetHorizontalScaleFactor(void) const @@ -576,6 +591,7 @@ _CoordinateSystem::_CoordinateSystemImpl::Initialize(int srcResolution, _BaseScr __physicalBaseScreenSize = destBaseScreenSize; +#if 0 if (srcResolution == 480 || srcResolution == 720) { _LogicalResolution logicalResolution = RESOLUTION_LOGICAL_NONE; @@ -617,7 +633,7 @@ _CoordinateSystem::_CoordinateSystemImpl::Initialize(int srcResolution, _BaseScr return r; } } - +#endif _ICoordinateSystemTransformer* pXformer = null; _ICoordinateSystemTransformer* pInvXFormer = null; diff --git a/src/graphics/FGrp_CoordinateSystemUtils.cpp b/src/graphics/FGrp_CoordinateSystemUtils.cpp new file mode 100755 index 0000000..e356e8f --- /dev/null +++ b/src/graphics/FGrp_CoordinateSystemUtils.cpp @@ -0,0 +1,274 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FGrp_CoordinateSystemUtils.cpp + * @brief This file contains implementation of _CoordinateSystemUtils class + * + * This file contains implementation _CoordinateSystemUtils class. + */ + +#include +#include "FGrp_CoordinateSystemUtils.h" + +using namespace Tizen::Graphics; + +namespace Tizen { namespace Graphics { + +const float _CoordinateSystemUtils::__floatIntegralEpsilon = 0.01f; +_CoordinateSystem* _CoordinateSystemUtils::__pCoordinateSystemInstance = null; + +_ICoordinateSystemTransformer* +_CoordinateSystemUtils::GetTransformer(void) +{ + if (__pCoordinateSystemInstance == null) + { + __pCoordinateSystemInstance = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_GRP, __pCoordinateSystemInstance, null, E_SYSTEM, "[E_SYSTEM] Coordinate system instance must not be null."); + } + + _ICoordinateSystemTransformer* pTransform = __pCoordinateSystemInstance->GetTransformer(); + SysTryReturn(NID_GRP, pTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate transformer does not exist."); + + return pTransform; +} + +_ICoordinateSystemTransformer* +_CoordinateSystemUtils::GetInverseTransformer(void) +{ + if (__pCoordinateSystemInstance == null) + { + __pCoordinateSystemInstance = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_GRP, __pCoordinateSystemInstance, null, E_SYSTEM, "[E_SYSTEM] Coordinate system instance must not be null."); + } + + _ICoordinateSystemTransformer* pInverseTransform= __pCoordinateSystemInstance->GetInverseTransformer(); + SysTryReturn(NID_GRP, pInverseTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate inverse transformer does not exist."); + + return pInverseTransform; +} + +// Convert To Float +FloatRectangle +_CoordinateSystemUtils::ConvertToFloat(const Rectangle& rect) +{ + return FloatRectangle(rect.x, rect.y, rect.width, rect.height); +} + +FloatRectangle +_CoordinateSystemUtils::ConvertToFloat(const Point& point, const Dimension& dim) +{ + return FloatRectangle(point.x, point.y, dim.width, dim.height); +} + +FloatDimension +_CoordinateSystemUtils::ConvertToFloat(const Dimension& dim) +{ + return FloatDimension(dim.width, dim.height); +} + +FloatPoint +_CoordinateSystemUtils::ConvertToFloat(const Point& point) +{ + return FloatPoint(point.x, point.y); +} + +float +_CoordinateSystemUtils::ConvertToFloat(int scalar) +{ + return scalar; +} + +// Convert To Integer +Rectangle +_CoordinateSystemUtils::ConvertToInteger(const FloatRectangle& rect) +{ + return Rectangle(floorf(rect.x + __floatIntegralEpsilon), floorf(rect.y + __floatIntegralEpsilon) + , floorf(rect.width + __floatIntegralEpsilon), floorf(rect.height + __floatIntegralEpsilon)); +} + +Rectangle +_CoordinateSystemUtils::ConvertToInteger(const FloatPoint& point, const FloatDimension& dim) +{ + return Rectangle(floorf(point.x + __floatIntegralEpsilon), floorf(point.y + __floatIntegralEpsilon) + , floorf(dim.width + __floatIntegralEpsilon), floorf(dim.height + __floatIntegralEpsilon)); +} + +Dimension +_CoordinateSystemUtils::ConvertToInteger(const FloatDimension& dim) +{ + return Dimension(floorf(dim.width + __floatIntegralEpsilon), floorf(dim.height + __floatIntegralEpsilon)); +} + +Point +_CoordinateSystemUtils::ConvertToInteger(const FloatPoint& point) +{ + return Point(floorf(point.x + __floatIntegralEpsilon), floorf(point.y + __floatIntegralEpsilon)); +} + +int +_CoordinateSystemUtils::ConvertToInteger(float scalar) +{ + return floorf(scalar + __floatIntegralEpsilon); +} + +// Transform Utilities +Rectangle +_CoordinateSystemUtils::Transform(const Rectangle& rect) +{ + return GetTransformer()->Transform(rect); +} + +FloatRectangle +_CoordinateSystemUtils::Transform(const FloatRectangle& rect) +{ + return GetTransformer()->Transform(rect); +} + +Rectangle +_CoordinateSystemUtils::Transform(const Point& point, const Dimension& dim) +{ + return GetTransformer()->Transform(Rectangle(point, dim)); +} + +FloatRectangle +_CoordinateSystemUtils::Transform(const FloatPoint& point, const FloatDimension& dim) +{ + return GetTransformer()->Transform(FloatRectangle(point, dim)); +} + +Dimension +_CoordinateSystemUtils::Transform(const Dimension& dim) +{ + return GetTransformer()->Transform(dim); +} + +FloatDimension +_CoordinateSystemUtils::Transform(const FloatDimension& dim) +{ + return GetTransformer()->Transform(dim); +} + +Point +_CoordinateSystemUtils::Transform(const Point& point) +{ + return GetTransformer()->Transform(point); +} + +FloatPoint +_CoordinateSystemUtils::Transform(const FloatPoint& point) +{ + return GetTransformer()->Transform(point); +} + +int +_CoordinateSystemUtils::HorizontalTransform(int scalar) +{ + return GetTransformer()->TransformHorizontal(scalar); +} + +float +_CoordinateSystemUtils::HorizontalTransform(float scalar) +{ + return GetTransformer()->TransformHorizontal(scalar); +} + +int +_CoordinateSystemUtils::VerticalTransform(int scalar) +{ + return GetTransformer()->TransformVertical(scalar); +} + +float +_CoordinateSystemUtils::VerticalTransform(float scalar) +{ + return GetTransformer()->TransformVertical(scalar); +} + +// InverseTransform Utilities +Rectangle +_CoordinateSystemUtils::InverseTransform(const Rectangle& rect) +{ + return GetInverseTransformer()->Transform(rect); +} + +FloatRectangle +_CoordinateSystemUtils::InverseTransform(const FloatRectangle& rect) +{ + return GetInverseTransformer()->Transform(rect); +} + +Rectangle +_CoordinateSystemUtils::InverseTransform(const Point& point, const Dimension& dim) +{ + return GetInverseTransformer()->Transform(Rectangle(point, dim)); +} + +FloatRectangle +_CoordinateSystemUtils::InverseTransform(const FloatPoint& point, const FloatDimension& dim) +{ + return GetInverseTransformer()->Transform(FloatRectangle(point, dim)); +} + +Dimension +_CoordinateSystemUtils::InverseTransform(const Dimension& dim) +{ + return GetInverseTransformer()->Transform(dim); +} + +FloatDimension +_CoordinateSystemUtils::InverseTransform(const FloatDimension& dim) +{ + return GetInverseTransformer()->Transform(dim); +} + +Point +_CoordinateSystemUtils::InverseTransform(const Point& point) +{ + return GetInverseTransformer()->Transform(point); +} + +FloatPoint +_CoordinateSystemUtils::InverseTransform(const FloatPoint& point) +{ + return GetInverseTransformer()->Transform(point); +} + +int +_CoordinateSystemUtils::InverseHorizontalTransform(int scalar) +{ + return GetInverseTransformer()->TransformHorizontal(scalar); +} + +float +_CoordinateSystemUtils::InverseHorizontalTransform(float scalar) +{ + return GetInverseTransformer()->TransformHorizontal(scalar); +} + +int +_CoordinateSystemUtils::InverseVerticalTransform(int scalar) +{ + return GetInverseTransformer()->TransformVertical(scalar); +} + +float +_CoordinateSystemUtils::InverseVerticalTransform(float scalar) +{ + return GetInverseTransformer()->TransformVertical(scalar); +} +}} // Tizen::Graphics diff --git a/src/graphics/FGrp_EnrichedTextImpl.cpp b/src/graphics/FGrp_EnrichedTextImpl.cpp index 59bdfd6..1adfc61 100644 --- a/src/graphics/FGrp_EnrichedTextImpl.cpp +++ b/src/graphics/FGrp_EnrichedTextImpl.cpp @@ -28,11 +28,13 @@ #include "FGrp_TextTextElement.h" #include "FGrp_TextTextObject.h" #include "util/FGrp_Util.h" +#include "FGrp_CoordinateSystemUtils.h" // Usings using namespace Tizen::Base; using namespace Tizen::Base::Utility; using namespace Tizen::Graphics::_Text; +using namespace Tizen::Graphics; namespace Tizen { namespace Graphics { @@ -128,6 +130,13 @@ CATCH: } result +_EnrichedTextImpl::Construct(const Tizen::Graphics::FloatDimension& dim) +{ + Dimension newDim = _CoordinateSystemUtils::ConvertToInteger(dim); + return Construct(newDim); +} + +result _EnrichedTextImpl::InsertAt(int elementIndex, Tizen::Graphics::TextElement& element) { SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED @@ -208,7 +217,7 @@ _EnrichedTextImpl::RemoveAt(int elementIndex, bool deallocate) pTextElement = dynamic_cast < TextElement* >(__pLinkedListTextElementList->GetAt(elementIndex)); if (pTextElement == null) //Bitmap?? { - __pTextObject->RemoveElementAt(elementIndex, deallocate); + __pTextObject->RemoveElementAt(elementIndex, true); __pLinkedListTextElementList->RemoveAt(elementIndex, true); if (__isCopiedEnrichedText == false) @@ -403,6 +412,13 @@ _EnrichedTextImpl::SetSize(const Tizen::Graphics::Dimension& size) } result +_EnrichedTextImpl::SetSize(const Tizen::Graphics::FloatDimension& size) +{ + Dimension newSize = _CoordinateSystemUtils::ConvertToInteger(size); + return SetSize(newSize); +} + +result _EnrichedTextImpl::SetSize(int width, int height) { SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED @@ -417,6 +433,12 @@ _EnrichedTextImpl::SetSize(int width, int height) return r; } +result +_EnrichedTextImpl::SetSize(float width, float height) +{ + return SetSize(_CoordinateSystemUtils::ConvertToInteger(width),_CoordinateSystemUtils::ConvertToInteger(height)); +} + Tizen::Graphics::Dimension _EnrichedTextImpl::GetSize(void) const { @@ -431,6 +453,20 @@ _EnrichedTextImpl::GetSize(void) const return dim; } +Tizen::Graphics::FloatDimension +_EnrichedTextImpl::GetSizeF(void) const +{ + SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(0.0f, 0.0f), E_OPERATION_FAILED + , "[E_OPERATION_FAILED] This instance is not constructed yet."); + + FloatDimension dim; + + dim.width = _CoordinateSystemUtils::ConvertToFloat(__width); + dim.height = _CoordinateSystemUtils::ConvertToFloat(__height); + + return dim; +} + void _EnrichedTextImpl::GetSize(int& width, int& height) const { @@ -441,6 +477,16 @@ _EnrichedTextImpl::GetSize(int& width, int& height) const height = __height; } +void +_EnrichedTextImpl::GetSize(float& width, float& height) const +{ + SysTryReturn(NID_GRP, __pTextObject != null, , E_OPERATION_FAILED + , "[E_OPERATION_FAILED] This instance is not constructed yet."); + + width = _CoordinateSystemUtils::ConvertToFloat(__width); + height = _CoordinateSystemUtils::ConvertToFloat(__height); +} + int _EnrichedTextImpl::GetWidth(void) const { @@ -450,6 +496,15 @@ _EnrichedTextImpl::GetWidth(void) const return __width; } +float +_EnrichedTextImpl::GetWidthF(void) const +{ + SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED + , "[E_OPERATION_FAILED] This instance is not constructed yet."); + + return _CoordinateSystemUtils::ConvertToFloat(__width); +} + int _EnrichedTextImpl::GetHeight(void) const { @@ -459,6 +514,15 @@ _EnrichedTextImpl::GetHeight(void) const return __height; } +float +_EnrichedTextImpl::GetHeightF(void) const +{ + SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED + , "[E_OPERATION_FAILED] This instance is not constructed yet."); + + return _CoordinateSystemUtils::ConvertToFloat(__height); +} + result _EnrichedTextImpl::SetVerticalAlignment(TextVerticalAlignment alignment) { @@ -599,12 +663,32 @@ _EnrichedTextImpl::SetLineSpace(int lineSpace) return E_SUCCESS; } +result +_EnrichedTextImpl::SetLineSpace(float lineSpace) +{ + SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED + , "[E_OPERATION_FAILED] This instance is not constructed yet."); + SysTryReturn(NID_GRP, lineSpace > 0, E_INVALID_ARG, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid."); + + __lineSpace = _CoordinateSystemUtils::ConvertToInteger(lineSpace); + __pTextObject->SetLineSpace(__lineSpace); + + return E_SUCCESS; +} + int _EnrichedTextImpl::GetLineSpace(void) const { return __lineSpace; } +float +_EnrichedTextImpl::GetLineSpaceF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__lineSpace); +} + void _EnrichedTextImpl::Refresh(void) { @@ -638,6 +722,12 @@ _EnrichedTextImpl::GetTotalLineHeight(void) const return height; } +float +_EnrichedTextImpl::GetTotalLineHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTotalLineHeight()); +} + int _EnrichedTextImpl::GetDisplayLineCount(void) const { @@ -773,6 +863,12 @@ _EnrichedTextImpl::GetLineHeight(int lineIndex) const return height; } +float +_EnrichedTextImpl::GetLineHeightF(int lineIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetLineHeight(lineIndex)); +} + int _EnrichedTextImpl::GetTextLength(void) const { @@ -836,6 +932,21 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width, } result +_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const +{ + int intWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int intHeight = _CoordinateSystemUtils::ConvertToInteger(height); + + result r = GetTextExtent(startTextIndex, textLength, intWidth, intHeight, actualLength); + + width = _CoordinateSystemUtils::ConvertToFloat(intWidth); + height = _CoordinateSystemUtils::ConvertToFloat(intHeight); + + return r; +} + + +result _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const { SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n"); @@ -876,6 +987,18 @@ _EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Grap return E_SUCCESS; } +result +_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const +{ + Dimension intSize = _CoordinateSystemUtils::ConvertToInteger(size); + + result r = GetTextExtent(startTextIndex, textLength, intSize, actualLength); + + size = _CoordinateSystemUtils::ConvertToFloat(intSize); + + return r; +} + Tizen::Graphics::Dimension _EnrichedTextImpl::GetTextExtent(void) const { @@ -906,6 +1029,12 @@ _EnrichedTextImpl::GetTextExtent(void) const } } +Tizen::Graphics::FloatDimension +_EnrichedTextImpl::GetTextExtentF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent()); +} + result _EnrichedTextImpl::Add(const Tizen::Graphics::Bitmap& bitmap) { @@ -1039,6 +1168,12 @@ _EnrichedTextImpl::GetLinkInfoFromPosition(const Point& point, Tizen::Base::Util } result +_EnrichedTextImpl::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const +{ + return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(point), linkInfo); +} + +result _EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const { SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED @@ -1070,6 +1205,12 @@ _EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::L return E_SUCCESS; } +result +_EnrichedTextImpl::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const +{ + return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), linkInfo); +} + TextVerticalAlignment _EnrichedTextImpl::GetElementVerticalAlignment(void) const { @@ -1109,6 +1250,16 @@ _EnrichedTextImpl::GetBounds() const return rect; } +Tizen::Graphics::FloatRectangle +_EnrichedTextImpl::GetBoundsF() const +{ + float newWidth = _CoordinateSystemUtils::ConvertToFloat(__width); + float newHeight = _CoordinateSystemUtils::ConvertToFloat(__height); + FloatRectangle rect(0.0f, 0.0f, newWidth, newHeight); + + return rect; +} + result _EnrichedTextImpl::IndexOfFromLinkedList(TextElement& textElement, int& index) { @@ -1164,6 +1315,13 @@ _EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::Point& point return -1; } +int +_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const +{ + Point intPoint = _CoordinateSystemUtils::ConvertToInteger(point); + return GetTextElementIndexFromPosition(intPoint); +} + TextObject* _EnrichedTextImpl::GetTextObject(void) const { @@ -1197,6 +1355,12 @@ _EnrichedTextImpl::GetIndexFromTouchPosition(int posX, int posY) const return __pTextObject->GetTextIndexFromPosition(posX, posY, true); } +int +_EnrichedTextImpl::GetIndexFromTouchPosition(float posX, float posY) const +{ + return GetIndexFromTouchPosition(_CoordinateSystemUtils::ConvertToInteger(posX), _CoordinateSystemUtils::ConvertToInteger(posY)); +} + result _EnrichedTextImpl::RemoveFromTextObject(_TextElementImpl* pTextElementImpl) { diff --git a/src/graphics/FGrp_Font.cpp b/src/graphics/FGrp_Font.cpp index 9767dd0..279d09c 100644 --- a/src/graphics/FGrp_Font.cpp +++ b/src/graphics/FGrp_Font.cpp @@ -24,9 +24,6 @@ #include "FGrp_Font.h" #include "FGrp_FontFt2.h" -#include -#include - #include #include @@ -46,30 +43,36 @@ #include #include +#include #include "FGrp_FontImpl.h" #include "FGrp_CanvasRasterOp.h" #include "FGrp_FontRsrcManager.h" -#include "FGrp_FontBidiManager.h" +#include "FGrp_FontBidiUtil.h" #include "FGrp_Canvas.h" #include "util/FGrp_UtilTemplate.h" +//#define USE_FONTCONFIG #define USE_EMOJI #define SYNCHRONIZATION_2_0 #define __pNativeFont __sharedFont.get() -#define CONVERT_INTEGER_TO_26_6_FIXED_POINT(value) (value * 64) -#define CONVERT_26_6_FIXED_POINT_TO_INTEGER(value) (value / 64) + #define IF_NOT_INITIALIZED(code) \ if (__pNativeFont == null) \ { \ code; \ } -#define GET_FONT_PROPERTY(prop, rtnValue) \ +#define GET_FONT_SIZE_PROPERTY(sizeProperty, rtnValue) \ + { \ + bool rtn = __pNativeFont->GetFontSizeProperty(sizeProperty); \ + SysTryReturn(NID_GRP, rtn, rtnValue, E_SYSTEM, "[E_SYSTEM] Failed to get font size property"); \ + } +#define GET_FONT_PROPERTY(property, rtnValue) \ { \ - bool rtn = __pNativeFont->GetFontProperty(prop); \ + bool rtn = __pNativeFont->GetFontProperty(property); \ SysTryReturn(NID_GRP, rtn, rtnValue, E_SYSTEM, "[E_SYSTEM] Failed to get font property"); \ } #define LOAD_GLYPH_DATA_CONST(character, pFontGlyphData, rtnValue) \ @@ -102,7 +105,7 @@ using namespace Tizen::System; namespace // unnamed { -const int _SYSTEM_DEFAULT_FONT_SIZE = CONVERT_INTEGER_TO_26_6_FIXED_POINT(16); +const int _SYSTEM_DEFAULT_FONT_SIZE = 16; template inline void @@ -132,6 +135,7 @@ _ExpandBounds(Type curX, Type curY, Type& x1, Type& y1, Type& x2, Type& y2) result _GetSystemFontList(Tizen::Base::Collection::IList& list) { +#ifdef USE_FONTCONFIG FcPattern* pPattern = null; FcFontSet* pSet = null; FcObjectSet* pObjectSet = null; @@ -240,6 +244,89 @@ CATCH: FcFini(); return GetLastResult(); + +#else + const String FONT_DIR_PATH[] = + { +// L"/usr/share/fallback_fonts", + L"/usr/share/fonts" + }; + + list.RemoveAll(true); + + const int FONT_DIR_PATH_COUNT = sizeof(FONT_DIR_PATH) / sizeof(FONT_DIR_PATH[0]); + + for (int i = 0; i < FONT_DIR_PATH_COUNT; i++) + { + Directory directory; + + result r = directory.Construct(FONT_DIR_PATH[i]); + + if (!IsFailed(r)) + { + std::auto_ptr dirEnumerator(directory.ReadN()); + + while (dirEnumerator->MoveNext() == E_SUCCESS) + { + DirEntry entry = dirEnumerator->GetCurrentDirEntry(); + + if (entry.IsDirectory() == false && entry.IsHidden() == false) + { + Tizen::Base::Utility::StringTokenizer formatTok(entry.GetName(), "."); + String token; + + while (formatTok.GetTokenCount()) + { + formatTok.GetNextToken(token); + } + + if (token.Equals("ttf",false) || token.Equals("ttc",false)) + { + String fullName; + fullName.Append(FONT_DIR_PATH[i]); + fullName.Append(L"/"); + fullName.Append(entry.GetName()); + + bool isNewFont = true; + + String* pFamilyName = new (std::nothrow) String(Tizen::Graphics::_Font::GetFaceName(fullName)); + SysTryCatch(NID_GRP, pFamilyName, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocated memory"); + + for (int idx = 0; idx < list.GetCount(); idx++) + { + String* pName = static_cast (list.GetAt(idx)); + + if (pName == null) + { + continue; + } + + if (*pName == *pFamilyName) + { + isNewFont = false; + break; + } + } + + if (isNewFont) + { + list.Add(*pFamilyName); + } + } + } + } + } + } + + return E_SUCCESS; + +CATCH: + + list.RemoveAll(true); + + return GetLastResult(); + +#endif } typedef Tizen::Graphics::_Font::SystemPixel _SystemPixel; @@ -387,19 +474,19 @@ GetPredefinedColor(const wchar_t unicode, unsigned long fgColor) // // Emoji Unicode List 176 + 76 // - static const unsigned long _EMOJI_BLACK = 0xFF000000; - static const unsigned long _EMOJI_BLUE = 0xFF0000FF; - static const unsigned long _EMOJI_GREEN = 0xFF00FF00; - static const unsigned long _EMOJI_RED = 0xFFFF0000; - static const unsigned long _EMOJI_ORANGE = 0xFFFF6600; - static const unsigned long _EMOJI_PURPLE = 0xFF9370DB; - static const unsigned long _EMOJI_DEEP_PURPLE = 0xFF800080; - static const unsigned long _EMOJI_DARK_BLUE = 0xFF00008B; - static const unsigned long _EMOJI_BROWN = 0xFFA52A2A; - static const unsigned long _NOT_EMOJI = 0; - - static const long _MAX_EMOJI_UNICODE = 0xE757; - static const long _MIN_EMOJI_UNICODE = 0xE63E; + static const unsigned long _EMOJI_BLACK = 0xFF000000; + static const unsigned long _EMOJI_BLUE = 0xFF0000FF; + static const unsigned long _EMOJI_GREEN = 0xFF00FF00; + static const unsigned long _EMOJI_RED = 0xFFFF0000; + static const unsigned long _EMOJI_ORANGE = 0xFFFF6600; + static const unsigned long _EMOJI_PURPLE = 0xFF9370DB; + static const unsigned long _EMOJI_DEEP_PURPLE = 0xFF800080; + static const unsigned long _EMOJI_DARK_BLUE = 0xFF00008B; + static const unsigned long _EMOJI_BROWN = 0xFFA52A2A; + static const unsigned long _NOT_EMOJI = 0; + + static const wchar_t _MAX_EMOJI_UNICODE = 0xE757; + static const wchar_t _MIN_EMOJI_UNICODE = 0xE63E; static const unsigned long _emojiTable[] = { @@ -446,6 +533,33 @@ GetPredefinedColor(const wchar_t unicode, unsigned long fgColor) return fgColor; } +struct _TextFragment +{ + _Util::String textFragment; + _IFont* pUsingFont; + + _TextFragment(const _Util::String& string, _IFont* pFont) + : textFragment(string) + , pUsingFont(pFont) + { + } +}; + +inline int _Abs(int value) +{ + return (value > 0) ? value : -value; +} + +inline bool _IsLTR(FriBidiCharType charType) +{ + return (((charType & FRIBIDI_MASK_RTL) == 0) && ((charType & FRIBIDI_MASK_STRONG) != 0) && ((charType & FRIBIDI_MASK_LETTER) != 0)); +} + +inline bool _IsRTL(FriBidiCharType charType) +{ + return ((charType & FRIBIDI_MASK_RTL) != 0); +} + } @@ -455,7 +569,6 @@ namespace Tizen { namespace Graphics _Font::_Font() { __fontAttrib.Init(); - //__fallbackFontMap.Construct(1, 0, _fontHashCodeProvider, _fontComparer); } _Font::_Font(const _Font& obj) @@ -471,7 +584,7 @@ _Font::~_Font(void) } result -_Font::Construct(int style, int pcSize) +_Font::Construct(int style, _Util::FixedPoint26_6 pcSize) { _FontRsrcManager& mgr = _FontRsrcManager::GetInstance(); @@ -488,21 +601,11 @@ _Font::Construct(int style, int pcSize) } result -_Font::Construct(const Tizen::Base::String& fontName, int style, int pcSize, bool isPathEnabled) +_Font::Construct(const Tizen::Base::String& fontName, int style, _Util::FixedPoint26_6 pcSize, bool isPathEnabled) { - result r = E_SUCCESS; - - if (fontName.Compare(fontName, "TizenSans") == 0) - { - r = Construct(style,pcSize); - - SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Failed to get system font", GetErrorMessage(r)); - - return E_SUCCESS; - } - bool systemFont = false; String appFontPath = L""; + result r = E_SUCCESS; _FontRsrcManager& mgr = _FontRsrcManager::GetInstance(); _FontRsrcManager::SharedFontResource out; @@ -565,7 +668,7 @@ _Font::Construct(const Tizen::Base::String& fontName, int style, int pcSize, boo } result -_Font::Construct(const Tizen::Base::ByteBuffer& fontData, int style, int pcSize) +_Font::Construct(const Tizen::Base::ByteBuffer& fontData, int style, _Util::FixedPoint26_6 pcSize) { _FontRsrcManager& mgr = _FontRsrcManager::GetInstance(); @@ -589,7 +692,7 @@ _Font::IsConstructed(void) const return (__sharedFont.get() != null); } -int +_Util::FixedPoint26_6 _Font::GetMaxHeight(void) const { IF_NOT_INITIALIZED(return -1); @@ -597,7 +700,7 @@ _Font::GetMaxHeight(void) const return __fontAttrib.maxHeight; } -int +_Util::FixedPoint26_6 _Font::GetMaxWidth(void) const { IF_NOT_INITIALIZED(return -1); @@ -605,7 +708,7 @@ _Font::GetMaxWidth(void) const return __fontAttrib.maxWidth; } -int +_Util::FixedPoint26_6 _Font::GetAscender(void) const { IF_NOT_INITIALIZED(return -1); @@ -613,7 +716,7 @@ _Font::GetAscender(void) const return __fontAttrib.ascender; } -int +_Util::FixedPoint26_6 _Font::GetDescender(void) const { IF_NOT_INITIALIZED(return -1); @@ -622,7 +725,7 @@ _Font::GetDescender(void) const } result -_Font::GetLeftBear(wchar_t character, int& leftBear) const +_Font::GetLeftBear(wchar_t character, _Util::FixedPoint22_10& leftBear) const { IF_NOT_INITIALIZED(return E_OPERATION_FAILED); @@ -640,7 +743,7 @@ _Font::GetLeftBear(wchar_t character, int& leftBear) const } result -_Font::GetRightBear(wchar_t character, int& rightBear) const +_Font::GetRightBear(wchar_t character, _Util::FixedPoint22_10& rightBear) const { IF_NOT_INITIALIZED(return E_OPERATION_FAILED); @@ -650,7 +753,11 @@ _Font::GetRightBear(wchar_t character, int& rightBear) const LOAD_GLYPH_DATA_CONST(character, pFontGlyphData, E_SYSTEM); // right bear is Glyph::xOffset + GlyphBitmap::width, set it - rightBear = pFontGlyphData->xOffset + pFontGlyphData->image.width; + + _Util::FixedPoint22_10 imageWidth; + imageWidth.SetConvertToFixedPoint(pFontGlyphData->image.width); + + rightBear = pFontGlyphData->xOffset + imageWidth; UNLOAD_GLYPH_DATA_CONST(pFontGlyphData); @@ -658,8 +765,40 @@ _Font::GetRightBear(wchar_t character, int& rightBear) const } result -_Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcDim) const +_Font::GetTextExtent(const _Util::String& text, Dimension& pcDim) const +{ + IF_NOT_INITIALIZED(return E_OPERATION_FAILED); + + if (text.pStart == null || text.length <= 0) + { + pcDim.SetSize(0, 0); + + return E_SUCCESS; + } + + _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length); + + if (bidiProperty.HasBidi()) + { + int dummyCount = 0 ; + + return this->GetTextExtent(INT_MAX, text, false, dummyCount, pcDim); + } + else + { + return this->__GetTextExtent(text, pcDim); + } +} + +result +_Font::__GetTextExtent(const _Util::String& text, Dimension& pcDim) const { + if (text.pStart == null) + { + pcDim.SetSize(0, 0); + SysTryReturn(NID_GRP, false, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The given string is invalid."); + } + int x1 = 0x7FFFFFFF; int y1 = 0x7FFFFFFF; int x2 = -0x7FFFFFFF; @@ -682,18 +821,15 @@ _Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcD _Font* pThis = const_cast <_Font*>(this); - const wchar_t* pText = text.GetPointer(); - SysTryCatch(NID_GRP, pText, pcDim.SetSize(0, 0), E_SYSTEM, "[E_SYSTEM] Failed to get string pointer"); - APPLY_ATTRIBUTE(E_SYSTEM); { - _IFont::Property prop; - GET_FONT_PROPERTY(prop, E_SYSTEM); + _IFont::SizeProperty sizeProperty; + GET_FONT_SIZE_PROPERTY(sizeProperty, E_SYSTEM); if (__fontAttrib.style & FONT_STYLE_ITALIC) { - italicSpace = (prop.ascender * 2) >> 4; + italicSpace = (sizeProperty.ascender.ToInt() * 2) >> 4; } } @@ -701,9 +837,12 @@ _Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcD { _IFont::Attrib attr; pThis->GetAttrib(attr); - boldSpace = (attr.boldWeight + 32) >> 6; + boldSpace = attr.boldWeight.ToFloat() + 0.5;//CONVERT_26_6_FIXED_POINT_TO_INTEGER(attr.boldWeight + 32); } + const wchar_t* pText = text.pStart; + int length = text.length; + while (*pText && --length >= 0) { _IFont* pFont = pThis->__GetFont(*pText); @@ -732,15 +871,15 @@ _Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcD if (pFont->LoadGlyph(*pText++, &pFontGlyphData)) { int glyphBoundX1 = curX; - int glyphBoundY1 = curY - (pFontGlyphData->yOffset >> 10); - int glyphBoundX2 = glyphBoundX1 + (pFontGlyphData->xOffset >> 10) + pFontGlyphData->image.width; + int glyphBoundY1 = curY - pFontGlyphData->yOffset.ToInt(); + int glyphBoundX2 = glyphBoundX1 + pFontGlyphData->xOffset.ToInt() + pFontGlyphData->image.width; int glyphBoundY2 = glyphBoundY1 + pFontGlyphData->image.height; #ifdef SYNCHRONIZATION_2_0 // adjusting x bounds for synchronizing this operation with 2.0 if (length == 0) { - glyphBoundX2 = glyphBoundX1 + (pFontGlyphData->xAdvance >> 10) + italicSpace + boldSpace; + glyphBoundX2 = glyphBoundX1 + pFontGlyphData->xAdvance.ToInt() + italicSpace + boldSpace; } #endif // 2_0_SYNCHROMIZATION @@ -750,11 +889,11 @@ _Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcD _ExpandBounds(glyphBoundX2, glyphBoundY2, x1, y1, x2, y2); #ifdef SYNCHRONIZATION_2_0 - curX += (pFontGlyphData->xAdvance >> 10) + __fontAttrib.charSpace + italicSpace + boldSpace; + curX += pFontGlyphData->xAdvance.ToInt() + __fontAttrib.charSpace + italicSpace + boldSpace; #else - curX += (pFontGlyphData->xAdvance >> 10) + __fontAttrib.charSpace + boldSpace; + curX += pFontGlyphData->xAdvance.ToInt() + __fontAttrib.charSpace + boldSpace; #endif - curY += (pFontGlyphData->yAdvance >> 10); + curY += pFontGlyphData->yAdvance.ToInt(); left++; leftChar = *(pText - 1); @@ -766,7 +905,7 @@ _Font::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& pcD pcDim.width = x2 - x1; #ifdef SYNCHRONIZATION_2_0 - pcDim.height = CONVERT_26_6_FIXED_POINT_TO_INTEGER(__fontAttrib.size); + pcDim.height = __fontAttrib.size.ToInt(); #else pcDim.height = y2 - y1; #endif // 2_0_SYNCHROMIZATION @@ -817,20 +956,12 @@ _Font::IsUnderlined(void) const return __fontAttrib.underline; } -bool -_Font::IsEmoji(void) const -{ - IF_NOT_INITIALIZED(return false); - - return (this->GetFaceName() == L"keitaiemoji"); -} - -int +_Util::FixedPoint26_6 _Font::GetSize(void) const { IF_NOT_INITIALIZED(return -1); - return CONVERT_26_6_FIXED_POINT_TO_INTEGER(__fontAttrib.size); + return __fontAttrib.size; } void @@ -878,10 +1009,10 @@ _Font::GetFaceName(void) const { IF_NOT_INITIALIZED(return String()); - _IFont::Property prop; - GET_FONT_PROPERTY(prop, String()); + _IFont::Property property; + GET_FONT_PROPERTY(property, String()); - return ((prop.pFamilyName) ? String(prop.pFamilyName) : String()); + return ((property.pFamilyName) ? String(property.pFamilyName) : String()); } Tizen::Base::Collection::IList* @@ -904,16 +1035,19 @@ _Font::GetFaceName(const Tizen::Base::String& filePath) _FontRsrcManager::SharedFontResource out; String faceName; - result r = mgr.GetTempFont(filePath, FONT_STYLE_PLAIN, _SYSTEM_DEFAULT_FONT_SIZE, out); + _Util::FixedPoint26_6 defaultSize; + defaultSize.SetConvertToFixedPoint(_SYSTEM_DEFAULT_FONT_SIZE); + + result r = mgr.GetTempFont(filePath, FONT_STYLE_PLAIN, defaultSize, out); SysTryReturn(NID_GRP, r == E_SUCCESS, faceName, r, "[%s] Failed to get font", GetErrorMessage(r)); if (r == E_SUCCESS) { _IFont* pTempFont = out.get(); - _IFont::Property prop; - pTempFont->GetFontProperty(prop); - faceName = String(prop.pFamilyName); + _IFont::Property property; + pTempFont->GetFontProperty(property); + faceName = String(property.pFamilyName); } return faceName; @@ -961,10 +1095,72 @@ _Font::ApplyAttribute() return true; } +result +_Font::GetTextExtent(int width, const _Util::String& text, bool outline, int& count, Dimension& pcDim) const +{ + IF_NOT_INITIALIZED(return E_OPERATION_FAILED); + + if (text.pStart == null || text.length <= 0) + { + pcDim.SetSize(0, 0); + count = 0; + return E_SUCCESS; + } + + _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length); + + if (bidiProperty.HasBidi()) + { + typedef _Util::AccumList<_Util::Pair > GapList; + + GapList gapList; + + result r = this->__GetTextExtentList(bidiProperty, gapList); + + if (r != E_SUCCESS) + { + //?? need log + return r; + } + + int left = 0; + int right = 0; + + for (GapList::Iterator i = gapList.Begin(); i != gapList.End(); ++i) + { + left = (i->first < left) ? i->first : left; + right = (i->second > right) ? i->second : right; + } + + if (right - left <= width) + { + pcDim.SetSize(right - left, __fontAttrib.size.ToInt()); + count = text.length; + } + else + { + return this->GetTextExtent(width, _Util::String(text.pStart, text.length - 1), outline, count, pcDim); + } + + return E_SUCCESS; + } + else + { + return this->__GetTextExtent(width, text, outline, count, pcDim); + } + + return E_SUCCESS; +} result -_Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, int length, bool outline, int& count, Dimension& pcDim) const +_Font::__GetTextExtent(int width, const _Util::String& text, bool outline, int& count, Dimension& pcDim) const { + if (text.pStart == null) + { + pcDim.SetSize(0, 0); + SysTryReturn(NID_GRP, false, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The given string is invalid."); + } + int preX1 = 0x7FFFFFFF; int preY1 = 0x7FFFFFFF; int preX2 = -0x7FFFFFFF; @@ -991,7 +1187,7 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, IF_NOT_INITIALIZED(return E_SYSTEM); - if (length == 0) + if (text.length == 0) { count = 0; pcDim.SetSize(0, 0); @@ -1000,18 +1196,15 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, _Font* pThis = const_cast <_Font*>(this); - const wchar_t* pText = text.GetPointer() + startIndex; - SysTryCatch(NID_GRP, pText, pcDim.SetSize(0, 0), E_SYSTEM, "[E_SYSTEM] Failed to get string pointer"); - APPLY_ATTRIBUTE(E_SYSTEM); { - _IFont::Property prop; - GET_FONT_PROPERTY(prop, E_SYSTEM); + _IFont::SizeProperty sizeProperty; + GET_FONT_SIZE_PROPERTY(sizeProperty, E_SYSTEM); if (__fontAttrib.style & FONT_STYLE_ITALIC) { - italicSpace = (prop.ascender * 2) >> 4; + italicSpace = (sizeProperty.ascender.ToInt() * 2) >> 4; } } @@ -1019,9 +1212,12 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, { _IFont::Attrib attr; pThis->GetAttrib(attr); - boldSpace = (attr.boldWeight + 32) >> 6; + boldSpace = attr.boldWeight.ToFloat() + 0.5;//CONVERT_26_6_FIXED_POINT_TO_INTEGER(attr.boldWeight + 32); } + const wchar_t* pText = text.pStart; + int length = text.length; + while (*pText && --length >= 0) { // getting proper _Font instance for the specified text @@ -1053,19 +1249,16 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, if (pFont->LoadGlyph(*pText++, &pFontGlyphData)) { int glyphBoundX1 = curX; - int glyphBoundY1 = curY - (pFontGlyphData->yOffset >> 10); + int glyphBoundY1 = curY - pFontGlyphData->yOffset.ToInt(); int glyphBoundX2 = glyphBoundX1 + - ((pFontGlyphData->image.width <= 0) ? (pFontGlyphData->xAdvance >> - 10) : ((pFontGlyphData->xOffset >> - 10) + pFontGlyphData->image.width)); + ((pFontGlyphData->image.width <= 0) ? pFontGlyphData->xAdvance.ToInt() + : (pFontGlyphData->xOffset.ToInt() + pFontGlyphData->image.width)); int glyphBoundY2 = glyphBoundY1 + pFontGlyphData->image.height; #ifdef SYNCHRONIZATION_2_0 // adjusting x2 bounds for synchronizing fuctionality with 2.0 - glyphBoundX2 = glyphBoundX1 + (pFontGlyphData->xAdvance >> 10) + italicSpace + boldSpace; + glyphBoundX2 = glyphBoundX1 + pFontGlyphData->xAdvance.ToInt() + italicSpace + boldSpace; #endif - - if (outline) { glyphBoundX1 -= 1; @@ -1080,11 +1273,11 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, _ExpandBounds(glyphBoundX2, glyphBoundY2, x1, y1, x2, y2); #ifdef SYNCHRONIZATION_2_0 - curX += (pFontGlyphData->xAdvance >> 10) + __fontAttrib.charSpace + italicSpace + boldSpace; + curX += pFontGlyphData->xAdvance.ToInt() + __fontAttrib.charSpace + italicSpace + boldSpace; #else - curX += (pFontGlyphData->xAdvance >> 10) + __fontAttrib.charSpace + boldSpace; + curX += pFontGlyphData->xAdvance.ToInt() + __fontAttrib.charSpace + boldSpace; #endif - curY += (pFontGlyphData->yAdvance >> 10); + curY += pFontGlyphData->yAdvance.ToInt(); pFont->UnloadGlyph(&pFontGlyphData); @@ -1117,7 +1310,7 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, count = characters; pcDim.width = preX2 - preX1; #ifdef SYNCHRONIZATION_2_0 - pcDim.height = CONVERT_26_6_FIXED_POINT_TO_INTEGER(__fontAttrib.size); + pcDim.height = __fontAttrib.size.ToInt(); #else pcDim.height = preY2 - preY1; #endif // SYNCHRONIZATION_2_0 @@ -1129,21 +1322,12 @@ CATCH: } result -_Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, int length, bool outline, const Tizen::Base::String& delimiter, int& count, Dimension& dim) const +_Font::GetTextExtent(int width, const _Util::String& text, bool outline, const Tizen::Base::String& delimiter, int& count, Dimension& dim) const { IF_NOT_INITIALIZED(return E_OPERATION_FAILED); - SysTryReturn(NID_GRP, startIndex >= 0 && length >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - const wchar_t* pBaseStringBegin = text.GetPointer(); - const wchar_t* pBaseStringEnd = pBaseStringBegin + text.GetLength(); - - const wchar_t* pTextBegin = pBaseStringBegin + startIndex; - const wchar_t* pTextEnd = pTextBegin + length; - - pTextEnd = (pTextEnd < pBaseStringEnd) ? pTextEnd : pBaseStringEnd; - - const wchar_t* pText = pTextBegin; + const wchar_t* pText = text.pStart; + const wchar_t* pTextEnd = pText + text.length; while (pText < pTextEnd) { @@ -1156,129 +1340,870 @@ _Font::GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, ++pText; } - return this->GetTextExtent(width, text, startIndex, pTextEnd - pTextBegin, outline, count, dim); -} - -result -_Font::SetSize(int pcSize) -{ - IF_NOT_INITIALIZED(return E_OPERATION_FAILED); - - __UpdateFontAttribute(__fontAttrib.style, pcSize); - - return E_SUCCESS; -} - -result -_Font::SetStyle(int style) -{ - IF_NOT_INITIALIZED(return E_OPERATION_FAILED); - - __fontAttrib.style = style; - - return E_SUCCESS; -} - -int -_Font::GetStyle(void) const -{ - IF_NOT_INITIALIZED(return FONT_STYLE_PLAIN); - - return __fontAttrib.style; -} - -int -_Font::GetLeading(void) const -{ - IF_NOT_INITIALIZED(return -1); - - return __fontAttrib.maxHeight; + return this->GetTextExtent(width, _Util::String(text.pStart, pTextEnd - text.pStart), outline, count, dim); } result -_Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String& text, int startIndex, int length) +_Font::__GetTextExtentList(const _Util::String& text, _Util::AccumList<_Util::Pair >& outList) const { - SysTryReturnResult(NID_GRP, canvas.__pScratchPad != null, E_INVALID_ARG, "A canvas is invalid"); + SysAssert(text.pStart != null && text.length > 0); - const wchar_t* pText = text.GetPointer() + startIndex; - - bool rtn = this->ApplyAttribute(); - SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fails to apply font attribute."); + outList.Clear(); - _Util::ScratchPad & scratchPad = *canvas.__pScratchPad; - scratchPad.RegisterFillRect(_RasterOp::FnFillRectFont32Bit); + _Font* pThis = const_cast <_Font*>(this); - Rectangle clipBounds; - canvas.__GetClipBounds(clipBounds); + APPLY_ATTRIBUTE(E_SYSTEM); - int xDest = point.x; - int yDest = point.y; - int startX = point.x; - int charHeight = 0; - int italicSpace = 0; - int boldSpace = 0; - int clipX1 = clipBounds.x; - int clipY1 = clipBounds.y; - int clipX2 = clipX1 + clipBounds.width; - int clipY2 = clipY1 + clipBounds.height; - long xVec = 0; - long yVec = 0; - int left = 0; - wchar_t leftChar = 0; - _IFont::Glyph* pFontGlyphData = 0; + int addingSpace = __fontAttrib.charSpace; - // need to revise y value, because _IFont is based on the baseline +#ifdef SYNCHRONIZATION_2_0 { - _IFont::Property prop; - bool rtn = this->GetFontProperty(prop); - SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get font property."); - - if (canvas.__textOrigin == TEXT_ORIGIN_LEFT_TOP) - { - yDest += prop.maxHeight + prop.descender; - } + _IFont::SizeProperty sizeProperty; - charHeight = prop.ascender - prop.descender; + GET_FONT_SIZE_PROPERTY(sizeProperty, E_SYSTEM); - if (this->GetStyle() & FONT_STYLE_ITALIC) + if (__fontAttrib.style & FONT_STYLE_ITALIC) { - italicSpace = (prop.ascender * 2) >> 4; + addingSpace += (sizeProperty.ascender.ToInt() * 2) >> 4; } } +#endif - if (this->GetStyle() & FONT_STYLE_BOLD) + if (__fontAttrib.style & FONT_STYLE_BOLD) { _IFont::Attrib attr; - this->GetAttrib(attr); - boldSpace = (attr.boldWeight + 32) >> 6; + + if (pThis->GetAttrib(attr)) + { + addingSpace += (attr.boldWeight.ToFloat() + 0.5);//CONVERT_26_6_FIXED_POINT_TO_INTEGER(attr.boldWeight + 32); + } } - unsigned long canvasFgColor = canvas.__fgColor; + int curX = 0; + int curY = 0; + wchar_t prevChar = 0; - GUnicodeScript script = g_unichar_get_script(*pText); - // need to check if (script < 0 || script >= _sampleLanguageCount) ? + const wchar_t* pText = text.pStart; + int length = text.length; - // Temporary code for testing Arabic - if (script == G_UNICODE_SCRIPT_ARABIC) - { - _FontBidiProps bidiProps(pText, length); + --pText; - _IFont* pFont = this->__GetFont(*pText); + while (*(++pText) && --length >= 0) + { + _IFont* pFont = pThis->__GetFont(*pText); - if (pFont == null) + if (pFont) { - return E_SYSTEM; - } + if (pFont != __pNativeFont) + { + _IFont::Attrib fontAttrib; - Tizen::Base::Collection::ArrayListT<_IFont::Glyph *> glyphList; + if (pFont->GetAttrib(fontAttrib)) + { + fontAttrib.size = __fontAttrib.size; + fontAttrib.style = _IFont::STYLE_NONE; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_BOLD) ? _IFont::STYLE_BOLD : 0; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_ITALIC) ? _IFont::STYLE_ITALIC : 0; + fontAttrib.style |= (__fontAttrib.underline) ? _IFont::STYLE_UNDERLINE : 0; + pFont->SetAttrib(fontAttrib); + } + } - pFont->GetGlyphList(_Util::String(text.GetPointer(), text.GetLength(), startIndex, length), glyphList, bidiProps.isRtl, script); + _IFont::Glyph* pFontGlyphData = 0; - int count = glyphList.GetCount(); + if (pFont->LoadGlyph(*pText, &pFontGlyphData)) + { + // ¿ø·¡ Äڵ忡¼­´Â ¿¬¼ÓÀ¸·Î LoadGlyphÀÌ ½ÇÆÐÇÒ ¶§ ÀÌÀü °á°úÀÇ prevChar·Î kerningÀ» üũÇÏ´Â ¹®Á¦°¡ ÀÖÀ½ + if (prevChar > 0) + { + long xVec = 0; + long yVec = 0; - for (int i = 0; i < count; i++) - { - typedef unsigned long TPixel; + if (pFont->GetKerning(prevChar, *pText, xVec, yVec)) + { + curX += xVec; + } + } + + int prevX = curX; + + curX += pFontGlyphData->xAdvance.ToInt() + addingSpace; + curY += pFontGlyphData->yAdvance.ToInt(); + + pFont->UnloadGlyph(&pFontGlyphData); + + prevChar = *pText; + outList.Push(_Util::MakePair(prevX, curX)); + + continue; + } + } + + // Cannot determine a glyph extent + prevChar = 0; + outList.Push(_Util::MakePair(curX, curX)); + } + + return E_SUCCESS; +} + +result +_Font::__GetTextExtentList(const _TextBidiPropertyWithReorder& bidiProperty, _Util::AccumList<_Util::Pair >& outList) const +{ + _Util::AccumList<_TextBidiProperty> textList; + +#if 0 // old version (buggy) + if (bidiProperty.pEmbeddingLevels) + { + _Util::String originalText(bidiProperty.pEventText, bidiProperty.length); + + const wchar_t* pBegin = originalText.pStart; + const wchar_t* pEnd = pBegin + originalText.length; + + const wchar_t* pText = pBegin; + const FriBidiLevel* pEmbedLevel = &bidiProperty.pEmbeddingLevels[0]; + + bool isRtl = ((*pEmbedLevel & 0x01) != 0); + + while (pText < pEnd) + { + if (isRtl == ((*pEmbedLevel & 0x01) != 0)) + { + ++pText; + ++pEmbedLevel; + } + else + { + textList.Push(_TextBidiProperty(bidiProperty, pBegin - originalText.pStart, pText - pBegin)); + + pBegin = pText; + isRtl = !isRtl; + } + } + + if (pBegin < pText) + { + textList.Push(_TextBidiProperty(bidiProperty, pBegin - originalText.pStart, pText - pBegin)); + } + } + else + { + _Util::String originalText(bidiProperty.pEventText, bidiProperty.length); + textList.Push(_TextBidiProperty(bidiProperty, 0, originalText.length)); + } +#else + if (bidiProperty.pBidiIndex) + { + _Util::String originalText(bidiProperty.pEventText, bidiProperty.length); + + if (originalText.length <= 0) + { + return E_SUCCESS; + } + + const wchar_t* pBegin = originalText.pStart; + const wchar_t* pEnd = pBegin + originalText.length; + + const wchar_t* pText = pBegin; + const FriBidiStrIndex* pStrIndexBegin = &bidiProperty.pBidiIndex[0]; + const FriBidiStrIndex* pStrIndex = pStrIndexBegin; + + const FriBidiCharType* pCharType = &bidiProperty.pCharType[0]; + + // (*pStrIndex) is always valid + bool isRtl = (*pStrIndex > 0) || ((*pCharType & FRIBIDI_MASK_RTL) != 0); + + while (pText < pEnd) + { + bool mustPush = (isRtl && _IsLTR(*pCharType)) || (!isRtl && _IsRTL(*pCharType)); + + int step = (pStrIndex > pStrIndexBegin) ? *pStrIndex - *(pStrIndex-1) : 0; + + if ((!mustPush) && (_Abs(step) <= 1)) + { + ++pText; + ++pStrIndex; + ++pCharType; + } + else + { + textList.Push(_TextBidiProperty(bidiProperty, pBegin - originalText.pStart, pText - pBegin)); + + pStrIndexBegin = pStrIndex; + pBegin = pText; + isRtl = !isRtl; + } + } + + if (pBegin < pText) + { + textList.Push(_TextBidiProperty(bidiProperty, pBegin - originalText.pStart, pText - pBegin)); + } + } + else + { + _Util::String originalText(bidiProperty.pEventText, bidiProperty.length); + textList.Push(_TextBidiProperty(bidiProperty, 0, originalText.length)); + } +#endif + + int xDest = 0; + int yDest = 0; + + bool isRtl = bidiProperty.isRtl; + + _Font* pThis = const_cast <_Font*>(this); + + pThis->ApplyAttribute(); + + _Util::AccumList<_Util::Pair > tempList; + + for (_Util::AccumList<_TextBidiProperty>::Iterator textSegment = textList.Begin(); textSegment != textList.End(); ++textSegment) + { + if (textSegment->pEventText == null || textSegment->length <= 0) + { + continue; + } + + const wchar_t* pTextFragmentBegin = textSegment->pEventText; + const wchar_t* pTextFragmentEnd = pTextFragmentBegin + textSegment->length; + + const wchar_t* pTextSegment = pTextFragmentBegin; + + _IFont* pBaseFont = pThis->__GetFont(*pTextSegment); + + _Util::AccumList<_TextFragment> textFragmentList; + + while (pTextSegment < pTextFragmentEnd) + { + if (pBaseFont->CheckGlyph(*pTextSegment) == 0) + { + _IFont* pFallbackFont = pThis->__GetFont(*pTextSegment); + + if (pBaseFont != pFallbackFont) + { + textFragmentList.Push(_TextFragment(_Util::String(pTextFragmentBegin, pTextSegment - pTextFragmentBegin), pBaseFont)); + + pTextFragmentBegin = pTextSegment; + pBaseFont = pFallbackFont; + } + } + + ++pTextSegment; + } + + textFragmentList.Push(_TextFragment(_Util::String(pTextFragmentBegin, pTextSegment - pTextFragmentBegin), pBaseFont)); + + /* + * - In case of LTR + * for (_Util::AccumList<_TextFragment>::Iterator textFragment = textFragmentList.Begin(); textFragment != textFragmentList.End(); ++textFragment) + * + * - In case of RTL + * for (_Util::AccumList<_TextFragment>::Iterator textFragment = textFragmentList.End(); textFragment != textFragmentList.Begin(); ) + * { + * --textFragment; + * + */ + + typedef _Util::AccumList<_TextFragment>::Iterator TextFragmentIter; + + TextFragmentIter textFragment = (textSegment->isRtl) ? textFragmentList.End() : textFragmentList.Begin() - 1; + TextFragmentIter endCondition = (textSegment->isRtl) ? textFragmentList.Begin() - 1 : textFragmentList.End(); + int increasing = (textSegment->isRtl) ? -1 : 1; + + while ((textFragment += increasing) != endCondition) + { + if (textFragment->pUsingFont == null || textFragment->textFragment.length <= 0) + { + continue; + } + + if (textFragment->pUsingFont != __pNativeFont) + { + _IFont::Attrib fontAttrib; + + if (textFragment->pUsingFont->GetAttrib(fontAttrib)) + { + fontAttrib.size = __fontAttrib.size; + fontAttrib.style = _IFont::STYLE_NONE; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_BOLD) ? _IFont::STYLE_BOLD : 0; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_ITALIC) ? _IFont::STYLE_ITALIC : 0; + fontAttrib.style |= (__fontAttrib.underline) ? _IFont::STYLE_UNDERLINE : 0; + + textFragment->pUsingFont->SetAttrib(fontAttrib); + } + } + + Tizen::Base::Collection::ArrayListT<_IFont::Glyph *> glyphList; + + GUnicodeScript script = g_unichar_get_script(textSegment->eventChar); + // need to check if (script < 0 || script >= _sampleLanguageCount) ? + + textFragment->pUsingFont->GetGlyphList(textFragment->textFragment, glyphList, isRtl, script); + + int count = glyphList.GetCount(); + + for (int i = 0; i < count; i++) + { + _IFont::Glyph *pGlyph = 0; + + glyphList.GetAt(i, pGlyph); + + int prevX = xDest; + + xDest += pGlyph->xAdvance.ToInt(); + yDest += pGlyph->yAdvance.ToInt(); + + tempList.Push(_Util::MakePair(prevX, xDest)); + outList.Push(_Util::MakePair(-1, -1)); + } + + IEnumeratorT<_IFont::Glyph*>* pEnum = glyphList.GetEnumeratorN(); + + if (pEnum) + { + while (pEnum->MoveNext() == E_SUCCESS) + { + _IFont::Glyph* pGlyph; + + pEnum->GetCurrent(pGlyph); + delete pGlyph; + } + + delete pEnum; + } + } + + isRtl = !isRtl; + } + + // reorder Bidi index +#if 1 + { + typedef _Util::Pair Gap; + typedef _Util::AccumList GapList; + + GapList::Iterator srcBegin = tempList.Begin(); + + int index = 0; + + for (GapList::Iterator dst = outList.Begin(); dst != outList.End() && index < bidiProperty.length; ++dst) + { + *dst = *(srcBegin + bidiProperty.pBidiIndex[index++]); + } + } +#else // under development + if (bidiProperty.length == tempList.Size()) + { + typedef _Util::Pair Gap; + typedef _Util::AccumList GapList; + + GapList::Iterator srcBegin = tempList.Begin(); + + int index = 0; + + for (GapList::Iterator dst = outList.Begin(); dst != outList.End(); ++dst) + { + *dst = *(srcBegin + bidiProperty.pBidiIndex[index++]); + } + } + else if (bidiProperty.length > tempList.Size()) + { + typedef _Util::Pair Gap; + typedef _Util::AccumList GapList; + + GapList revisedList; + + { + const wchar_t* pText = bidiProperty.pEventText; + const wchar_t* const pTextEnd = pText + bidiProperty.length; + + GapList::Iterator tempListIter = tempList.Begin(); + + while (pText < pTextEnd) + { + revisedList.Push(*tempListIter); + + if (*pText == 0x0644) + { + if (((pText+1) < pTextEnd) && *(pText+1) == 0x0627) + { + revisedList.Push(_Util::MakePair(tempListIter->first, tempListIter->first)); + ++pText; + } + } + + ++pText; + ++tempListIter; + } + } + + GapList::Iterator srcBegin = revisedList.Begin(); + + int index = 0; + + for (GapList::Iterator dst = outList.Begin(); dst != outList.End(); ++dst) + { + *dst = *(srcBegin + bidiProperty.pBidiIndex[index++]); + } + } + else + { + SysAssert(false); + } +#endif + + return E_SUCCESS; +} + +result +_Font::GetTextExtentList(const _Util::String& text, _Util::AccumList<_Util::Pair >& outList) const +{ + IF_NOT_INITIALIZED(return E_OPERATION_FAILED); + + if (text.pStart == null || text.length <= 0) + { + outList.Clear(); + return E_SUCCESS; + } + + _TextBidiPropertyWithReorder bidiProperty(text.pStart, text.length); + + if (bidiProperty.HasBidi()) + { + return this->__GetTextExtentList(bidiProperty, outList); + } + else + { + return this->__GetTextExtentList(text, outList); + } + + return E_SUCCESS; +} + +result +_Font::SetSize(_Util::FixedPoint26_6 pcSize) +{ + IF_NOT_INITIALIZED(return E_OPERATION_FAILED); + + __UpdateFontAttribute(__fontAttrib.style, pcSize); + + return E_SUCCESS; +} + +result +_Font::SetStyle(int style) +{ + IF_NOT_INITIALIZED(return E_OPERATION_FAILED); + + __fontAttrib.style = style; + + return E_SUCCESS; +} + +int +_Font::GetStyle(void) const +{ + IF_NOT_INITIALIZED(return FONT_STYLE_PLAIN); + + return __fontAttrib.style; +} + +_Util::FixedPoint26_6 +_Font::GetLeading(void) const +{ + IF_NOT_INITIALIZED(return -1); + + return __fontAttrib.maxHeight; +} + +result +_Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String& text, int startIndex, int length) +{ + SysTryReturnResult(NID_GRP, canvas.__pScratchPad != null, E_INVALID_ARG, "A canvas is invalid"); + + const wchar_t* pText = text.GetPointer() + startIndex; + + bool rtn = this->ApplyAttribute(); + SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fails to apply font attribute."); + + _Util::ScratchPad & scratchPad = *canvas.__pScratchPad; + scratchPad.RegisterFillRect(_RasterOp::FnFillRectFont32Bit); + + Rectangle clipBounds; + canvas.__GetClipBounds(clipBounds); + + int xDest = point.x; + int yDest = point.y; + int startX = point.x; + int charHeight = 0; + int italicSpace = 0; + int boldSpace = 0; + int clipX1 = clipBounds.x; + int clipY1 = clipBounds.y; + int clipX2 = clipX1 + clipBounds.width; + int clipY2 = clipY1 + clipBounds.height; + long xVec = 0; + long yVec = 0; + int left = 0; + wchar_t leftChar = 0; + _IFont::Glyph* pFontGlyphData = 0; + + // need to revise y value, because _IFont is based on the baseline + { + _IFont::SizeProperty sizeProperty; + bool rtn = this->GetFontSizeProperty(sizeProperty); + SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get font sizeProperty."); + + if (canvas.__textOrigin == TEXT_ORIGIN_LEFT_TOP) + { + yDest += sizeProperty.maxHeight.ToInt() + sizeProperty.descender.ToInt(); + } + + charHeight = sizeProperty.ascender.ToInt() - sizeProperty.descender.ToInt(); + + if (this->GetStyle() & FONT_STYLE_ITALIC) + { + italicSpace = (sizeProperty.ascender.ToInt() * 2) >> 4; + } + } + + if (this->GetStyle() & FONT_STYLE_BOLD) + { + _IFont::Attrib attr; + this->GetAttrib(attr); + boldSpace = attr.boldWeight.ToFloat() + 0.5;//CONVERT_26_6_FIXED_POINT_TO_INTEGER(attr.boldWeight + 32); + } + + unsigned long canvasFgColor = canvas.__fgColor; + +#if 1 + // Do not use _TextBidiProperty bidiProps(pText, length); + _TextBidiPropertyWithReorder bidiProps(pText, length); + + if (bidiProps.HasBidi()) + { + _Util::AccumList<_TextBidiProperty> textList; + +#if 0 // old version (buggy) + if (bidiProps.pEmbeddingLevels) + { + _Util::String originalText(text.GetPointer(), text.GetLength(), startIndex, length); + + const wchar_t* pBegin = originalText.pStart; + const wchar_t* pEnd = pBegin + originalText.length; + + const wchar_t* pText = pBegin; + const FriBidiLevel* pEmbedLevel = &bidiProps.pEmbeddingLevels[pText - text.GetPointer()]; + + bool isRtl = ((*pEmbedLevel & 0x01) != 0); + + while (pText < pEnd) + { + if (isRtl == ((*pEmbedLevel & 0x01) != 0)) + { + ++pText; + ++pEmbedLevel; + } + else + { + textList.Push(_TextBidiProperty(bidiProps, pBegin - originalText.pStart, pText - pBegin)); + + pBegin = pText; + isRtl = !isRtl; + } + } + + if (pBegin < pText) + { + textList.Push(_TextBidiProperty(bidiProps, pBegin - originalText.pStart, pText - pBegin)); + } + } + else + { + _Util::String originalText(text.GetPointer(), text.GetLength(), startIndex, length); + textList.Push(_TextBidiProperty(bidiProps, 0, originalText.length)); + } +#else + if (bidiProps.pBidiIndex) + { + _Util::String originalText(text.GetPointer(), text.GetLength(), startIndex, length); + + if (originalText.length <= 0) + { + return E_SUCCESS; + } + + const wchar_t* pBegin = originalText.pStart; + const wchar_t* pEnd = pBegin + originalText.length; + + const wchar_t* pText = pBegin; + const FriBidiStrIndex* pStrIndexBegin = &bidiProps.pBidiIndex[pText - text.GetPointer()]; + const FriBidiStrIndex* pStrIndex = pStrIndexBegin; + + const FriBidiCharType* pCharType = &bidiProps.pCharType[pText - text.GetPointer()]; + + // (*pStrIndex) is always valid + bool isRtl = (*pStrIndex > 0) || ((*pCharType & FRIBIDI_MASK_RTL) != 0); + + while (pText < pEnd) + { + bool mustPush = (isRtl && _IsLTR(*pCharType)) || (!isRtl && _IsRTL(*pCharType)); + + int step = (pStrIndex > pStrIndexBegin) ? *pStrIndex - *(pStrIndex-1) : 0; + + if ((!mustPush) && (_Abs(step) <= 1)) + { + ++pText; + ++pStrIndex; + ++pCharType; + } + else + { + textList.Push(_TextBidiProperty(bidiProps, pBegin - originalText.pStart, pText - pBegin)); + + pStrIndexBegin = pStrIndex; + pBegin = pText; + isRtl = !isRtl; + } + } + + if (pBegin < pText) + { + textList.Push(_TextBidiProperty(bidiProps, pBegin - originalText.pStart, pText - pBegin)); + } + } + else + { + _Util::String originalText(text.GetPointer(), text.GetLength(), startIndex, length); + textList.Push(_TextBidiProperty(bidiProps, 0, originalText.length)); + } +#endif + + for (_Util::AccumList<_TextBidiProperty>::Iterator textSegment = textList.Begin(); textSegment != textList.End(); ++textSegment) + { + if (textSegment->pEventText == null || textSegment->length <= 0) + { + continue; + } + + const wchar_t* pTextFragmentBegin = textSegment->pEventText; + const wchar_t* pTextFragmentEnd = pTextFragmentBegin + textSegment->length; + + const wchar_t* pTextSegment = pTextFragmentBegin; + + _IFont* pBaseFont = this->__GetFont(*pTextSegment); + + _Util::AccumList<_TextFragment> textFragmentList; + + while (pTextSegment < pTextFragmentEnd) + { + if (pBaseFont->CheckGlyph(*pTextSegment) == 0) + { + _IFont* pFallbackFont = this->__GetFont(*pTextSegment); + + if (pBaseFont != pFallbackFont) + { + textFragmentList.Push(_TextFragment(_Util::String(pTextFragmentBegin, pTextSegment - pTextFragmentBegin), pBaseFont)); + + pTextFragmentBegin = pTextSegment; + pBaseFont = pFallbackFont; + } + } + + ++pTextSegment; + } + + textFragmentList.Push(_TextFragment(_Util::String(pTextFragmentBegin, pTextSegment - pTextFragmentBegin), pBaseFont)); + + /* + * - In case of LTR + * for (_Util::AccumList<_TextFragment>::Iterator textFragment = textFragmentList.Begin(); textFragment != textFragmentList.End(); ++textFragment) + * + * - In case of RTL + * for (_Util::AccumList<_TextFragment>::Iterator textFragment = textFragmentList.End(); textFragment != textFragmentList.Begin(); ) + * { + * --textFragment; + * + */ + typedef _Util::AccumList<_TextFragment>::Iterator TextFragmentIter; + + TextFragmentIter textFragment = (textSegment->isRtl) ? textFragmentList.End() : textFragmentList.Begin() - 1; + TextFragmentIter endCondition = (textSegment->isRtl) ? textFragmentList.Begin() - 1 : textFragmentList.End(); + int increasing = (textSegment->isRtl) ? -1 : 1; + + while ((textFragment += increasing) != endCondition) + { + if (textFragment->pUsingFont == null || textFragment->textFragment.length <= 0) + { + continue; + } + + if (textFragment->pUsingFont != __pNativeFont) + { + _IFont::Attrib fontAttrib; + + if (textFragment->pUsingFont->GetAttrib(fontAttrib)) + { + fontAttrib.size = __fontAttrib.size; + fontAttrib.style = _IFont::STYLE_NONE; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_BOLD) ? _IFont::STYLE_BOLD : 0; + fontAttrib.style |= (__fontAttrib.style & FONT_STYLE_ITALIC) ? _IFont::STYLE_ITALIC : 0; + fontAttrib.style |= (__fontAttrib.underline) ? _IFont::STYLE_UNDERLINE : 0; + + textFragment->pUsingFont->SetAttrib(fontAttrib); + } + } + + Tizen::Base::Collection::ArrayListT<_IFont::Glyph *> glyphList; + + GUnicodeScript script = g_unichar_get_script(textSegment->eventChar); + // need to check if (script < 0 || script >= _sampleLanguageCount) ? + + textFragment->pUsingFont->GetGlyphList(textFragment->textFragment, glyphList, textSegment->isRtl, script); + + int count = glyphList.GetCount(); + + for (int i = 0; i < count; i++) + { + /* for debugging + static int s_index = 0; + const unsigned long COLOR[6] = + { + 0xFFFFFFFF, + 0xFF40FF40, + 0xFF40FFFF, + 0xFFFF4040, + 0xFFFF40FF, + 0xFFFFFF40 + }; + unsigned long canvasFgColor = COLOR[s_index++ % 6]; + */ + + typedef unsigned long TPixel; + _IFont::Glyph *pGlyph = 0; + + TPixel srcR, srcG, srcB, srcA; + TPixel dstR, dstG, dstB, dstA; + + srcA = (canvasFgColor >> 24) & 0xFF; + srcA += (srcA >> 7); + srcR = (canvasFgColor >> 16) & 0xFF; + srcG = (canvasFgColor >> 8) & 0xFF; + srcB = (canvasFgColor) & 0xFF; + + SystemPixel* pBufferStartAddr = null; + int bufferPitch; + + scratchPad.GetBuffer(pBufferStartAddr, bufferPitch); + + glyphList.GetAt(i, pGlyph); + + for (int h = 0; h < pGlyph->image.height; h++) + { + int y = yDest - pGlyph->yOffset.ToInt() + h; + + if (y < 0) + { + continue; + } + + if (y >= scratchPad.GetHeight()) + { + break; + } + + TPixel* pDest32 = pBufferStartAddr + y * bufferPitch + xDest + pGlyph->xOffset.ToInt(); + + for (int w = 0; w < pGlyph->image.width; w++) + { + int x = xDest + pGlyph->xOffset.ToInt() + w; + + if (x < 0) + { + ++pDest32; + continue; + } + + if (x >= scratchPad.GetWidth()) + { + break; + } + + unsigned long alpha = (unsigned long) (pGlyph->image.pBitmap[h * pGlyph->image.bytesPerLine + w]); + + if (alpha > 0) + { + // equivalent to scratchPad.FillRect(x, y, 1, 1, fgColor, alpha); + alpha = (alpha * srcA) >> 8; + alpha += (alpha >> 7); + + dstA = (*pDest32 >> 24) & 0xFF; + dstR = (*pDest32 >> 16) & 0xFF; + dstG = (*pDest32 >> 8) & 0xFF; + dstB = (*pDest32) & 0xFF; + + dstA = BLEND_ALPHA_COMPONEMT(alpha, dstA); + dstR = (dstR + (((srcR - dstR) * alpha) >> 8)) & 0xFF; + dstG = (dstG + (((srcG - dstG) * alpha) >> 8)) & 0xFF; + dstB = (dstB + (((srcB - dstB) * alpha) >> 8)) & 0xFF; + + *pDest32 = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + + } + ++pDest32; + } + } + + xDest += pGlyph->xAdvance.ToInt(); + yDest += pGlyph->yAdvance.ToInt(); + } + + scratchPad.RegisterFillRect(null); + + IEnumeratorT<_IFont::Glyph*>* pEnum = glyphList.GetEnumeratorN(); + + if (pEnum) + { + while (pEnum->MoveNext() == E_SUCCESS) + { + _IFont::Glyph* pGlyph; + + pEnum->GetCurrent(pGlyph); + delete pGlyph; + } + + delete pEnum; + } + } + + bidiProps.isRtl = !bidiProps.isRtl; + } +#else + GUnicodeScript script = g_unichar_get_script(*pText); + // need to check if (script < 0 || script >= _sampleLanguageCount) ? + + // Temporary code for testing Arabic + if (script == G_UNICODE_SCRIPT_ARABIC) + { + _TextBidiProperty bidiProps(pText, length); + + _IFont* pFont = this->__GetFont(*pText); + + if (pFont == null) + { + return E_SYSTEM; + } + + Tizen::Base::Collection::ArrayListT<_IFont::Glyph *> glyphList; + + pFont->GetGlyphList(_Util::String(text.GetPointer(), text.GetLength(), startIndex, length), glyphList, bidiProps.isRtl, script); + + int count = glyphList.GetCount(); + + for (int i = 0; i < count; i++) + { + typedef unsigned long TPixel; _IFont::Glyph *pGlyph = 0; TPixel srcR, srcG, srcB, srcA; @@ -1353,8 +2278,8 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String } } - xDest += (pGlyph->xAdvance >> 10); - yDest += (pGlyph->yAdvance >> 10); + xDest += pGlyph->xAdvance.ToInt(); + yDest += pGlyph->yAdvance.ToInt(); } scratchPad.RegisterFillRect(null); @@ -1373,6 +2298,7 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String delete pEnum; } +#endif } else { @@ -1401,10 +2327,10 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String //SysTryReturn(NID_GRP, rtn, false, E_SYSTEM, "[E_SYSTEM] Failed to set font attribute"); } - _IFont::Property prop; - pFont->GetFontProperty(prop); + _IFont::Property property; + pFont->GetFontProperty(property); - unsigned long fgColor = (canvas.__applyEmoji && (String(prop.pFamilyName) == L"keitaiemoji")) ? GetPredefinedColor(*pText, canvasFgColor) : canvasFgColor; + unsigned long fgColor = (canvas.__applyEmoji && pFont->IsEmoji()) ? GetPredefinedColor(*pText, canvasFgColor) : canvasFgColor; if (left > 0) { @@ -1437,7 +2363,7 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String for (int h = 0; h < pFontGlyphData->image.height; h++) { - int y = yDest - (pFontGlyphData->yOffset >> 10) + h; + int y = yDest - pFontGlyphData->yOffset.ToInt() + h; if (y < clipY1) { @@ -1449,11 +2375,11 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String break; } - TPixel* pDest32 = pBufferStartAddr + y * bufferPitch + xDest + (pFontGlyphData->xOffset >> 10); + TPixel* pDest32 = pBufferStartAddr + y * bufferPitch + xDest + pFontGlyphData->xOffset.ToInt(); for (int w = 0; w < pFontGlyphData->image.width; w++) { - int x = xDest + (pFontGlyphData->xOffset >> 10) + w; + int x = xDest + pFontGlyphData->xOffset.ToInt() + w; if (x < clipX1) { @@ -1491,8 +2417,8 @@ _Font::__DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String } } - xDest += (pFontGlyphData->xAdvance >> 10) + __fontAttrib.charSpace + italicSpace + boldSpace; - yDest += (pFontGlyphData->yAdvance >> 10); + xDest += pFontGlyphData->xAdvance.ToInt() + __fontAttrib.charSpace + italicSpace + boldSpace; + yDest += pFontGlyphData->yAdvance.ToInt(); left++; leftChar = *(pText - 1); @@ -1576,11 +2502,11 @@ _Font::GetKerning(unsigned long character1, unsigned long character2, long& xVec } bool -_Font::GetFontProperty(_IFont::Property& property) const +_Font::GetFontSizeProperty(_IFont::SizeProperty& sizeProperty) const { IF_NOT_INITIALIZED(return false); - return __pNativeFont->GetFontProperty(property); + return __pNativeFont->GetFontSizeProperty(sizeProperty); } bool @@ -1616,28 +2542,28 @@ _Font::CheckGlyph(unsigned long character) } void -_Font::__UpdateFontAttribute(int style, int pcSize) +_Font::__UpdateFontAttribute(int style, _Util::FixedPoint26_6 pcSize) { IF_NOT_INITIALIZED(return); __fontAttrib.style = style; __fontAttrib.size = pcSize; - __fontAttrib.lineThickness = ((CONVERT_26_6_FIXED_POINT_TO_INTEGER(pcSize) < 24) ? 1 : ((CONVERT_26_6_FIXED_POINT_TO_INTEGER(pcSize) < 48) ? 2 : 3)); + __fontAttrib.lineThickness = ((pcSize < 24) ? 1 : ((pcSize < 48) ? 2 : 3)); - _IFont::Property prop; + _IFont::SizeProperty sizeProperty; bool getProperty = false; if (this->ApplyAttribute()) { - getProperty = __pNativeFont->GetFontProperty(prop); + getProperty = __pNativeFont->GetFontSizeProperty(sizeProperty); } if (getProperty) { - __fontAttrib.maxWidth = prop.maxWidth; - __fontAttrib.maxHeight = prop.maxHeight; - __fontAttrib.ascender = prop.ascender; - __fontAttrib.descender = prop.descender; + __fontAttrib.maxWidth = sizeProperty.maxWidth; + __fontAttrib.maxHeight = sizeProperty.maxHeight; + __fontAttrib.ascender = sizeProperty.ascender; + __fontAttrib.descender = sizeProperty.descender; } else { @@ -1757,8 +2683,21 @@ _Font::__GetFont(wchar_t character) // //------------------------------------------------------ _FontRsrcManager& mgr = _FontRsrcManager::GetInstance(); - Tizen::Base::Collection::HashMapT* fallbackFontMap = __pNativeFont->GetFallbackMap(); - std::auto_ptr > enumerator(fallbackFontMap->GetMapEnumeratorN()); + _FontRsrcManager::FontMapT* fallbackFontMap = __pNativeFont->GetFallbackMap(); + +#ifdef USE_OTHER_CONTAINER + for (_FontRsrcManager::FontMapT::const_iterator fontIterator = fallbackFontMap->begin(); fontIterator != fallbackFontMap->end(); ++fontIterator) + { + if (fontIterator->second != null) + { + if (fontIterator->second->CheckGlyph(character) > 0) + { + return fontIterator->second.get(); + } + } + } +#else + std::auto_ptr > enumerator(fallbackFontMap->GetMapEnumeratorN()); while (enumerator->MoveNext() == E_SUCCESS) { @@ -1766,7 +2705,7 @@ _Font::__GetFont(wchar_t character) if (enumerator->GetValue(pTempFont) == E_SUCCESS) { - String key; + _Util::WString key(L""); result r = enumerator->GetKey(key); if (r == E_SUCCESS) @@ -1785,6 +2724,7 @@ _Font::__GetFont(wchar_t character) } } } +#endif //------------------------------------------------------ // @@ -1793,6 +2733,7 @@ _Font::__GetFont(wchar_t character) //------------------------------------------------------ Tizen::Base::Collection::ArrayListT fileList; bool rtn = __GetFallbackFontFileList(character, fileList); + if (!rtn) { // if failed find out fallback font, @@ -1830,11 +2771,16 @@ _Font::__GetFont(wchar_t character) if (idx > 0) { + _Util::WString fontNameTemp(fontName.GetPointer()); + // keep it - r = fallbackFontMap->Add(fontName, out); +#ifdef USE_OTHER_CONTAINER + fallbackFontMap->insert(_FontRsrcManager::FontMapT::value_type(fontNameTemp, out)); +#else + r = fallbackFontMap->Add(fontNameTemp, out); SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = mgr.AddFont(fontName, out); +#endif + r = mgr.AddFont(fontNameTemp, out); SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); pFallbackFont = out.get(); @@ -1860,11 +2806,11 @@ _Font::__GetFallbackFontFileList(wchar_t character, Tizen::Base::Collection::ILi return false; } - _IFont::Property prop; + _IFont::Property property; const char* pFamilyName = null; - GET_FONT_PROPERTY(prop, false); + GET_FONT_PROPERTY(property, false); - pFamilyName = prop.pFamilyName; + pFamilyName = property.pFamilyName; FcPattern* pPattern = null; FcFontSet* pSet = null; diff --git a/src/graphics/FGrp_Font.h b/src/graphics/FGrp_Font.h index d873551..2205fdd 100644 --- a/src/graphics/FGrp_Font.h +++ b/src/graphics/FGrp_Font.h @@ -33,6 +33,7 @@ #include #include "FGrp_IFont.h" +#include "FGrp_FontBidiUtil.h" #include "util/FGrp_UtilTemplate.h" #include "util/FGrp_UtilType.h" @@ -61,15 +62,15 @@ class _FontImpl; struct _FontAttribute { int style; - int size; - int maxWidth; - int maxHeight; + _Util::FixedPoint26_6 size; + _Util::FixedPoint26_6 maxWidth; + _Util::FixedPoint26_6 maxHeight; int charSpace; + _Util::FixedPoint26_6 ascender; + _Util::FixedPoint26_6 descender; + int lineThickness; bool strikeout; bool underline; - int lineThickness; - int ascender; - int descender; void Init() { @@ -78,11 +79,11 @@ struct _FontAttribute maxWidth = -1; maxHeight = -1; charSpace = 0; - strikeout = false; - underline = false; - lineThickness = -1; ascender = -1; descender = -1; + lineThickness = -1; + strikeout = false; + underline = false; } }; @@ -97,32 +98,36 @@ public: _Font(const _Font& obj); virtual ~_Font(void); - result Construct(int style, int size); - result Construct(const Tizen::Base::String& fontName, int style, int pcSize, bool isPathEnabled = true); - result Construct(const Tizen::Base::ByteBuffer& fontData, int style, int pcSize); + result Construct(int style, _Util::FixedPoint26_6 size); + result Construct(const Tizen::Base::String& fontName, int style, _Util::FixedPoint26_6 pcSize, bool isPathEnabled = true); + result Construct(const Tizen::Base::ByteBuffer& fontData, int style, _Util::FixedPoint26_6 pcSize); bool IsConstructed(void) const; - int GetMaxHeight(void) const; - int GetMaxWidth(void) const; - int GetAscender(void) const; - int GetDescender(void) const; + _Util::FixedPoint26_6 GetMaxHeight(void) const; + _Util::FixedPoint26_6 GetMaxWidth(void) const; + _Util::FixedPoint26_6 GetAscender(void) const; + _Util::FixedPoint26_6 GetDescender(void) const; + + result GetLeftBear(wchar_t character, _Util::FixedPoint22_10& leftBear) const; + result GetRightBear(wchar_t character, _Util::FixedPoint22_10& rightBear) const; - result GetLeftBear(wchar_t character, int& leftBear) const; - result GetRightBear(wchar_t character, int& rightBear) const; - result GetTextExtent(const Tizen::Base::String& text, int length, Dimension& dim) const; + result GetTextExtent(const _Util::String& text, Dimension& dim) const; bool IsBold(void) const; bool IsItalic(void) const; bool IsPlain(void) const; bool IsStrikeOut(void) const; bool IsUnderlined(void) const; - bool IsEmoji(void) const; - int GetSize(void) const; + + _Util::FixedPoint26_6 GetSize(void) const; + void SetStrikeOut(bool strikeOut); void SetUnderline(bool underline); + void SetCharSpace(int space); int GetCharSpace(void) const; + int GetLineThickness(void) const; Tizen::Base::String GetFaceName(void) const; static Tizen::Base::Collection::IList* GetSystemFontListN(void); @@ -132,19 +137,23 @@ public: _Font* CloneN(void); bool ApplyAttribute(void); - result GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, int length, bool outline, int& count, Dimension& dim) const; - result GetTextExtent(int width, const Tizen::Base::String& text, int startIndex, int length, bool outline, const Tizen::Base::String& delimiter, int& count, Dimension& dim) const; + result GetTextExtent(int width, const _Util::String& text, bool outline, int& count, Dimension& dim) const; + result GetTextExtent(int width, const _Util::String& text, bool outline, const Tizen::Base::String& delimiter, int& count, Dimension& dim) const; - result SetSize(int pcSize); + result GetTextExtentList(const _Util::String& text, _Util::AccumList<_Util::Pair >& outList) const; + + result SetSize(_Util::FixedPoint26_6 pcSize); result SetStyle(int style); int GetStyle(void) const; - int GetLeading(void) const; + + _Util::FixedPoint26_6 GetLeading(void) const; // native font interface bool SetAttrib(const _IFont::Attrib& fontAttrib); bool GetAttrib(_IFont::Attrib& fontAttrib) const; bool GetKerning(unsigned long character1, unsigned long character2, long& xVector, long& yVector) const; + bool GetFontSizeProperty(_IFont::SizeProperty& sizeProperty) const; bool GetFontProperty(_IFont::Property& property) const; bool LoadGlyph(unsigned long character, _IFont::Glyph** ppFontGlyphData); bool UnloadGlyph(_IFont::Glyph** ppFontGlyphData); @@ -160,7 +169,7 @@ public: private: _Font& operator =(const _Font& rhs); - void __UpdateFontAttribute(int style, int size); + void __UpdateFontAttribute(int style, _Util::FixedPoint26_6 size); result __DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String& text, int startIndex, int length); result __DrawText(_Canvas& canvas, const Point& point, const Tizen::Base::String& text, int startIndex, int length, const Color& outlineColor); @@ -172,6 +181,12 @@ private: _IFont* __GetFont(wchar_t character); bool __GetFallbackFontFileList(wchar_t character, Tizen::Base::Collection::IListT& out); + result __GetTextExtent(const _Util::String& text, Dimension& dim) const; + result __GetTextExtent(int width, const _Util::String& text, bool outline, int& count, Dimension& dim) const; + + result __GetTextExtentList(const _Util::String& text, _Util::AccumList<_Util::Pair >& outList) const; + result __GetTextExtentList(const _TextBidiPropertyWithReorder& bidiProperty, _Util::AccumList<_Util::Pair >& outList) const; + private: std::tr1::shared_ptr <_IFont> __sharedFont; _FontAttribute __fontAttrib; diff --git a/src/graphics/FGrp_FontBidiManager.cpp b/src/graphics/FGrp_FontBidiManager.cpp deleted file mode 100644 index 957153b..0000000 --- a/src/graphics/FGrp_FontBidiManager.cpp +++ /dev/null @@ -1,393 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/* - * @file FGrp_FontBidiManager.cpp - * @brief This is the cpp file for _FontMemoryManager class. - * - */ - -#include -#include - -#include -#include - -#include "FGrp_FontBidiManager.h" - -namespace -{ -typedef wchar_t Eina_Unicode; - -typedef FriBidiCharType EvasBiDiCharType; -typedef FriBidiLevel EvasBiDiLevel; -typedef FriBidiParType EvasBiDiParType; - -#define EVAS_BIDI_PARAGRAPH_NEUTRAL FRIBIDI_PAR_ON -#define EVAS_BIDI_PARAGRAPH_LTR FRIBIDI_PAR_LTR -#define EVAS_BIDI_PARAGRAPH_RTL FRIBIDI_PAR_RTL -#define EVAS_BIDI_PARAGRAPH_WLTR FRIBIDI_PAR_WLTR -#define EVAS_BIDI_PARAGRAPH_WRTL FRIBIDI_PAR_WRTL - -#define EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(x) \ - (((x) && \ - ((x->direction == EVAS_BIDI_PARAGRAPH_RTL) || \ - (x->direction == EVAS_BIDI_PARAGRAPH_WRTL))) ? \ - EINA_TRUE : EINA_FALSE) - -typedef struct _Evas_BiDi_Paragraph_Props { - EvasBiDiCharType *char_types; /* BiDi char types */ - EvasBiDiLevel *embedding_levels; /* BiDi embedding levels */ - int refcount; /* The number of references to this object */ - EvasBiDiParType direction; -} Evas_BiDi_Paragraph_Props; - -//////////////////////////////////////////////////////////////////////////////// - -typedef int Eina_Bool; - -#define EINA_TRUE 1 -#define EINA_FALSE 0 - -#define BIDILOCK() -#define BIDIUNLOCK() - -#define _SAFE_FREE(x) \ - do { \ - if (x) \ - { \ - free(x); \ - x = NULL; \ - } \ - } while(0) - -Eina_Bool -evas_bidi_is_rtl_str(const Eina_Unicode *str) -{ - EvasBiDiCharType type; - - if (!str) - return EINA_FALSE; - - for ( ; *str ; str++) - { - type = fribidi_get_bidi_type((FriBidiChar) *str); - if (FRIBIDI_IS_LETTER(type) && FRIBIDI_IS_RTL(type)) - { - return EINA_TRUE; - } - } - return EINA_FALSE; -} - -int -eina_unicode_strlen(const Eina_Unicode *str) -{ - if (str) - { - const Eina_Unicode* pEnd = str; - - while (*pEnd++) - ; - - return (pEnd - str - 1); - } - else - { - return 0; - } -} - -void -evas_bidi_paragraph_props_clean(Evas_BiDi_Paragraph_Props *bidi_props) -{ - _SAFE_FREE(bidi_props->embedding_levels); - _SAFE_FREE(bidi_props->char_types); -} - -Evas_BiDi_Paragraph_Props * -evas_bidi_paragraph_props_new(void) -{ - Evas_BiDi_Paragraph_Props *ret; - ret = (Evas_BiDi_Paragraph_Props *)calloc(1, sizeof(Evas_BiDi_Paragraph_Props)); - ret->direction = EVAS_BIDI_PARAGRAPH_NEUTRAL; - ret->refcount = 1; - - return ret; -} - -void -evas_bidi_paragraph_props_unref(Evas_BiDi_Paragraph_Props *bidi_props) -{ - if (!bidi_props) return; - BIDILOCK(); - - if (--bidi_props->refcount == 0) - { - evas_bidi_paragraph_props_clean(bidi_props); - free(bidi_props); - } - BIDIUNLOCK(); -} - -//////////////// - -Evas_BiDi_Paragraph_Props * -evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, int *segment_idxs) -{ - Evas_BiDi_Paragraph_Props *bidi_props = NULL; - EvasBiDiCharType *char_types = NULL; - EvasBiDiLevel *embedding_levels = NULL; - const FriBidiChar *ustr; - FriBidiChar *base_ustr = NULL; - - if (!eina_ustr) - return NULL; - - - if (!evas_bidi_is_rtl_str(eina_ustr)) /* No need to handle bidi */ - { - len = -1; - goto cleanup; - } - - len = eina_unicode_strlen(eina_ustr); - /* The size of fribidichar s different than eina_unicode, convert */ -#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL - base_ustr = calloc(len + 1, sizeof(FriBidiChar)); - base_ustr = _evas_bidi_unicode_to_fribidichar(base_ustr, eina_ustr); - ustr = base_ustr; -#else - ustr = (const FriBidiChar *) eina_ustr; -#endif - - bidi_props = evas_bidi_paragraph_props_new(); - - /* Prep work for reordering */ - char_types = (EvasBiDiCharType *) malloc(sizeof(EvasBiDiCharType) * len); - if (!char_types) - { - len = -2; - goto cleanup; - } - fribidi_get_bidi_types(ustr, len, char_types); - - embedding_levels = (EvasBiDiLevel *)malloc(sizeof(EvasBiDiLevel) * len); - if (!embedding_levels) - { - len = -2; - goto cleanup; - } - - if (segment_idxs) - { - size_t pos = 0; - int *itr; - EvasBiDiLevel base_level = 0; - EvasBiDiParType direction; - - for (itr = segment_idxs ; *itr > 0 ; itr++) - { - direction = EVAS_BIDI_PARAGRAPH_NEUTRAL; - if (!fribidi_get_par_embedding_levels(char_types + pos, - *itr - pos, - &direction, - embedding_levels + pos)) - { - len = -2; - goto cleanup; - } - - /* Only on the first run */ - if (itr == segment_idxs) - { - bidi_props->direction = direction; - /* adjust base_level to be 1 for rtl paragraphs, and 0 for - * ltr paragraphs. */ - base_level = - EVAS_BIDI_PARAGRAPH_DIRECTION_IS_RTL(bidi_props) ? 1 : 0; - } - - /* We want those chars at the override points to be on the base - * level and we also remove -2 cause we later increment them, - * just for simpler code paths */ - embedding_levels[*itr] = base_level - 2; - pos = *itr + 1; - } - - direction = EVAS_BIDI_PARAGRAPH_NEUTRAL; - if (!fribidi_get_par_embedding_levels(char_types + pos, - len - pos, - &direction, - embedding_levels + pos)) - { - len = -2; - goto cleanup; - } - - /* Increment all levels by 2 to emulate embedding. */ - { - EvasBiDiLevel *bitr = embedding_levels, *end; - end = bitr + len; - for ( ; bitr < end ; bitr++) - { - *bitr += 2; - } - } - } - else - { - if (!fribidi_get_par_embedding_levels(char_types, len, - &bidi_props->direction, embedding_levels)) - { - len = -2; - goto cleanup; - } - } - - - /* clean up */ - if (bidi_props->embedding_levels) - { - free(bidi_props->embedding_levels); - } - bidi_props->embedding_levels = embedding_levels; - - /* clean up */ - - if (bidi_props->char_types) - { - free(bidi_props->char_types); - } - bidi_props->char_types = char_types; - - if (base_ustr) free(base_ustr); - - - return bidi_props; - -/* Cleanup */ -cleanup: - if (char_types) free(char_types); - if (embedding_levels) free(embedding_levels); - if (base_ustr) free(base_ustr); - if (bidi_props) evas_bidi_paragraph_props_unref(bidi_props); /* Clean up the bidi props */ - return NULL; -} - -} // namespace - -namespace -{ - -//?? arbitrary -typedef int EvasBiDiStrIndex; - -Eina_Bool -evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len, const Evas_BiDi_Paragraph_Props *props, EvasBiDiStrIndex **_v_to_l) -{ - EvasBiDiStrIndex *v_to_l = NULL; - FriBidiChar *ustr = NULL, *base_ustr = NULL; - - if (!props) - return EINA_FALSE; - - if (eina_ustr) - { - /* The size of fribidichar is different than eina_unicode, convert */ -#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL - base_ustr = ustr = calloc(len + 1, sizeof(FriBidiChar)); - ustr = _evas_bidi_unicode_to_fribidichar(ustr, eina_ustr); -#else - ustr = (FriBidiChar *) eina_ustr; -#endif - } - - - if (_v_to_l) { - size_t i; - v_to_l = *_v_to_l = (EvasBiDiStrIndex *) calloc(len, sizeof(EvasBiDiStrIndex)); - if (!v_to_l) - { - goto error; - } - /* init the array for fribidi */ - for (i = 0 ; i < len ; i++) - { - v_to_l[i] = i; - } - } - - { - EvasBiDiLevel *emb_lvl; - emb_lvl = (EvasBiDiLevel *) malloc((start + len) * sizeof(EvasBiDiLevel)); - memcpy(emb_lvl, props->embedding_levels, - (start + len) * sizeof(EvasBiDiLevel)); - /* We pass v_to_l - start, because fribidi assumes start is the offset - * from the start of v_to_l as well, not just the props. */ - if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT, props->char_types, - len, start, props->direction, emb_lvl, ustr, v_to_l - start)) - { - free(emb_lvl); - goto error; - } - free(emb_lvl); - } - - - /* The size of fribidichar is different than eina_unicode, convert */ -#ifdef EVAS_FRIBIDI_EINA_UNICODE_UNEQUAL - _evas_bidi_fribidichar_to_unicode(eina_ustr, base_ustr); - free(base_ustr); -#endif - return EINA_FALSE; -/* ERROR HANDLING */ -error: - if (base_ustr) free(base_ustr); - _SAFE_FREE(v_to_l); - return EINA_TRUE; -} - -} - -//////////////////////////////////////////////////////////////////////////////// - -namespace Tizen { namespace Graphics -{ - -_FontBidiProps::_FontBidiProps(const wchar_t* pText, int length) - : pEventText(0) - , pCharType(0) - , pEmbeddingLevels(0) - , baseDirection(FRIBIDI_PAR_ON) - , isRtl(false) -{ - Evas_BiDi_Paragraph_Props* pEvasBidiProps = evas_bidi_paragraph_props_get(pText, length, 0); - - if (pEvasBidiProps) - { - this->pEventText = (FriBidiChar *)pText; - this->pCharType = pEvasBidiProps->char_types; - this->pEmbeddingLevels = pEvasBidiProps->embedding_levels; - this->baseDirection = pEvasBidiProps->direction; - this->isRtl = true; - - evas_bidi_paragraph_props_unref(pEvasBidiProps); - } -} - -}} // Tizen::Graphics diff --git a/src/graphics/FGrp_FontBidiManager.h b/src/graphics/FGrp_FontBidiManager.h deleted file mode 100644 index 2cf4efc..0000000 --- a/src/graphics/FGrp_FontBidiManager.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/* - * @file FGrp_FontBidiManager.h - * @brief This is the header file for _FontBidiManager class. - * - */ -#ifndef _FGRP_INTERNAL_FONT_BIDI_MANAGER_H_ -#define _FGRP_INTERNAL_FONT_BIDI_MANAGER_H_ - -#include - -namespace Tizen { namespace Graphics -{ - -struct _FontBidiProps -{ - FriBidiChar* pEventText; - FriBidiCharType* pCharType; - FriBidiLevel* pEmbeddingLevels; - //FriBidiStrIndex* cmap; - FriBidiParType baseDirection; - bool isRtl; - - _FontBidiProps(const wchar_t* pText, int length); -}; - -}} // Tizen::Graphics - -#endif // _FGRP_INTERNAL_FONT_BIDI_MANAGER_H_ diff --git a/src/graphics/FGrp_FontBidiUtil.cpp b/src/graphics/FGrp_FontBidiUtil.cpp new file mode 100755 index 0000000..e205e50 --- /dev/null +++ b/src/graphics/FGrp_FontBidiUtil.cpp @@ -0,0 +1,569 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FGrp_FontBidiUtil.cpp + * @brief This is the cpp file for the bidi utilities. + * + */ + +#include +#include +#include + +#include "FGrp_FontBidiUtil.h" + + +namespace +{ + +struct BidiParagraph +{ + wchar_t* pString; + FriBidiCharType* pCharTypes; + FriBidiLevel* pEmbeddingLevels; + FriBidiParType direction; + size_t bufferLength; + + BidiParagraph(size_t length) + : pString(new (std::nothrow) wchar_t[length + 1]) + , pCharTypes(new (std::nothrow) FriBidiCharType[length]) + , pEmbeddingLevels(new (std::nothrow) FriBidiLevel[length]) + , direction(FRIBIDI_PAR_LTR)//FRIBIDI_PAR_ON) + , bufferLength(length) + { + if (pString == NULL || pCharTypes == NULL || pEmbeddingLevels == NULL) + { + delete[] pString; + delete[] pEmbeddingLevels; + delete[] pCharTypes; + + pString = NULL; + pEmbeddingLevels = NULL; + pCharTypes = NULL; + bufferLength = 0; + } + } + + ~BidiParagraph(void) + { + delete[] pCharTypes; + delete[] pEmbeddingLevels; + delete[] pString; + } + + bool IsValid(void) + { + return (pString != NULL && pCharTypes != NULL && pEmbeddingLevels != NULL); + } +}; + +#define IS_DIRECTION_RTL(x) (((x->direction == FRIBIDI_PAR_RTL) || (x->direction == FRIBIDI_PAR_WRTL)) ? true : false) + +//////////////////////////////////////////////////////////////////////////////// + +bool +_IsRtl(const wchar_t* pString, int length) +{ + if (pString) + { + for ( ; *pString && length-- > 0 ; ++pString) + { + FriBidiCharType type = fribidi_get_bidi_type((FriBidiChar) *pString); + + if (FRIBIDI_IS_LETTER(type) && FRIBIDI_IS_RTL(type)) + { + return true; + } + } + } + + return false; +} + +size_t +_GetStringLength(const wchar_t* pString) +{ + if (pString) + { + const wchar_t* pEnd = pString; + + while (*pEnd++) + ; + + return (pEnd - pString - 1); + } + else + { + return 0; + } +} + +template +void +_ConvertCharacterCode(DstCode* pDst, const SrcCode* pSrc, int length) +{ + if (pDst && pSrc) + { + while (*pSrc && length-- > 0) + { + *pDst++ = *pSrc++; + } + + *pDst = 0; + } +} + +//////////////// + +BidiParagraph* +_GetBidiParagraphProperty(const wchar_t* pText, size_t len, int* pSegmentIndex) +{ + #define CHECK_IF(cond) if (!(cond)) return NULL + + // precondition check + { + CHECK_IF((pText) && _IsRtl(pText, len)); + + size_t textLength = _GetStringLength(pText); + len = (len < textLength) ? len : textLength; + } + + const FriBidiChar* pTestString = NULL; + std::unique_ptr AutoDeleteString; + std::unique_ptr bidiProperty(new (std::nothrow) BidiParagraph(len)); + + // out of memory + CHECK_IF(bidiProperty.get() && bidiProperty->IsValid()); + + // in case of different size of each wide character + if (sizeof(wchar_t) == sizeof(FriBidiChar)) + { + pTestString = (const FriBidiChar *) pText; + } + else + { + AutoDeleteString.reset(new (std::nothrow) FriBidiChar[len + 1]); + + CHECK_IF(AutoDeleteString.get()); + + _ConvertCharacterCode(AutoDeleteString.get(), pText, len); + + pTestString = AutoDeleteString.get(); + } + + /* + * 0x110 FRIBIDI_TYPE_LTR; + * 0x111 FRIBIDI_TYPE_RTL; + * 0x113 FRIBIDI_TYPE_AL; + * 0x220 FRIBIDI_TYPE_EN; + */ + + fribidi_get_bidi_types(pTestString, len, bidiProperty->pCharTypes); + + if (pSegmentIndex) + { + size_t pos = 0; + FriBidiLevel baseLevel = 0; + + for (int* itr = pSegmentIndex ; *itr > 0 ; itr++) + { + FriBidiParType direction = FRIBIDI_PAR_ON; + CHECK_IF(fribidi_get_par_embedding_levels(bidiProperty->pCharTypes + pos, *itr - pos, &direction, bidiProperty->pEmbeddingLevels + pos)); + + // Only on the first run + if (itr == pSegmentIndex) + { + bidiProperty->direction = direction; + // adjust baseLevel to be 1 for rtl paragraphs, and 0 for ltr paragraphs. + baseLevel = IS_DIRECTION_RTL(bidiProperty) ? 1 : 0; + } + + // We want those chars at the override points to be on the base + // level and we also remove -2 cause we later increment them, + // just for simpler code paths + bidiProperty->pEmbeddingLevels[*itr] = baseLevel - 2; + pos = *itr + 1; + } + + { + FriBidiParType direction = FRIBIDI_PAR_ON; + CHECK_IF(fribidi_get_par_embedding_levels(bidiProperty->pCharTypes + pos, len - pos, &direction, bidiProperty->pEmbeddingLevels + pos)); + } + + // Increment all levels by 2 to emulate embedding. + { + FriBidiLevel* pEmbeddingLevel = bidiProperty->pEmbeddingLevels; + FriBidiLevel* pEmbeddingLevelEnd = pEmbeddingLevel + len; + + for ( ; pEmbeddingLevel < pEmbeddingLevelEnd ; ++pEmbeddingLevel) + { + *pEmbeddingLevel += 2; + } + } + } + else + { + CHECK_IF(fribidi_get_par_embedding_levels(bidiProperty->pCharTypes, len, &bidiProperty->direction, bidiProperty->pEmbeddingLevels)); + } + + return bidiProperty.release(); + + #undef CHECK_IF +} + +} // namespace + +namespace +{ + +/* + * Reorders ustr according to the bidi props. + * + * @param pText the string to reorder. - Null is ok, will just populate the map. + * @param start the start of the line + * @param len the length of the line + * @param bidiProperty the paragraph props to reorder according to + * @param pOutVToL The visual to logical map to populate - if NULL it won't populate it. + */ +bool +_ReorderBidiLine(wchar_t* pText, size_t start, size_t len, const BidiParagraph& bidiProperty, FriBidiStrIndex** pOutVToL) +{ + #define CHECK_IF(cond) if (!(cond)) return false + + FriBidiChar* pTestString = NULL; + std::unique_ptr AutoDeleteString; + std::unique_ptr vToL; + + const size_t textLength = len; + + if (pText) + { + if (sizeof(wchar_t) == sizeof(FriBidiChar)) + { + pTestString = (FriBidiChar *) pText; + } + else + { + AutoDeleteString.reset(new (std::nothrow) FriBidiChar[textLength + 1]); + + CHECK_IF(AutoDeleteString.get()); + + _ConvertCharacterCode(AutoDeleteString.get(), pText, textLength); + + pTestString = AutoDeleteString.get(); + } + } + + if (pOutVToL) + { + vToL.reset(new (std::nothrow) FriBidiStrIndex[textLength]); + + CHECK_IF(vToL.get()); + + // init the array for fribidi + { + FriBidiStrIndex* pRefIndex = vToL.get(); + + for (size_t i = 0 ; i < textLength ; i++) + { + *pRefIndex++ = i; + } + } + } + + { + std::unique_ptr embeddingLevel(new (std::nothrow) FriBidiLevel[start + textLength]); + FriBidiLevel* pRefEmbeddingLevel = embeddingLevel.get(); + + CHECK_IF(pRefEmbeddingLevel); + + memcpy(pRefEmbeddingLevel, bidiProperty.pEmbeddingLevels, (start + textLength) * sizeof(FriBidiLevel)); + + if (vToL.get()) + { + // We pass vToL.get() - start, because fribidi assumes start is the offset from the start of vToL.get() as well, not just the props. + CHECK_IF(fribidi_reorder_line(FRIBIDI_FLAGS_DEFAULT, bidiProperty.pCharTypes, textLength, start, bidiProperty.direction, pRefEmbeddingLevel, pTestString, vToL.get() - start)); + } + else + { + CHECK_IF(fribidi_reorder_line(FRIBIDI_FLAGS_DEFAULT, bidiProperty.pCharTypes, textLength, start, bidiProperty.direction, pRefEmbeddingLevel, pTestString, NULL)); + } + } + + if (pText) + { + if (sizeof(wchar_t) != sizeof(FriBidiChar)) + { + _ConvertCharacterCode(pText, AutoDeleteString.get(), textLength); + } + } + + if (pOutVToL) + { + *pOutVToL = vToL.release(); + } + + return true; + + #undef CHECK_IF +} + +} + +//////////////////////////////////////////////////////////////////////////////// + +namespace Tizen { namespace Graphics +{ + +_TextBidiProperty::_TextBidiProperty(const wchar_t* pText, int length) + : pEventText(0) + , pCharType(0) + , pEmbeddingLevels(0) + , eventChar(0) + , baseDirection(FRIBIDI_PAR_ON) + , isRtl(false) + , length(0) + , pReserved(0) +{ + BidiParagraph* pBidiProperty = _GetBidiParagraphProperty(pText, length, NULL); + + if (pBidiProperty) + { +#if 0 + this->pEventText = NULL; +#else + memcpy(pBidiProperty->pString, pText, length * sizeof(wchar_t)); + pBidiProperty->pString[length] = 0; + + this->pEventText = pBidiProperty->pString; +#endif + this->pCharType = pBidiProperty->pCharTypes; + this->pEmbeddingLevels = pBidiProperty->pEmbeddingLevels; + this->eventChar = (this->pEventText) ? *this->pEventText : 0; + this->baseDirection = pBidiProperty->direction; + this->isRtl = (this->pCharType) ? ((*this->pCharType & FRIBIDI_MASK_RTL) != 0) : false; + this->length = length; + + this->pReserved = static_cast(pBidiProperty); + } + else + { + this->pEventText = pText; + this->eventChar = (this->pEventText) ? *this->pEventText : 0; + this->length = length; + } +} + +_TextBidiProperty::_TextBidiProperty(const _TextBidiProperty& refBidiProperty, int offset, int length) + : pEventText(0) + , pCharType(0) + , pEmbeddingLevels(0) + , eventChar(0) + , baseDirection(FRIBIDI_PAR_ON) + , isRtl(false) + , length(0) + , pReserved(0) +{ + const wchar_t* pBegin = refBidiProperty.pEventText + offset; + const wchar_t* pEnd = pBegin + length; + + pBegin = (pBegin > refBidiProperty.pEventText) ? pBegin : refBidiProperty.pEventText; + pEnd = (refBidiProperty.pEventText + refBidiProperty.length < pEnd) ? refBidiProperty.pEventText + refBidiProperty.length : pEnd; + + if (pBegin <= pEnd) + { + offset = pBegin - refBidiProperty.pEventText; + length = pEnd - pBegin; + + this->pEventText = refBidiProperty.pEventText + offset; + this->pCharType = refBidiProperty.pCharType + offset; + this->pEmbeddingLevels = refBidiProperty.pEmbeddingLevels + offset; + this->eventChar = (this->pEventText) ? *this->pEventText : 0; + this->baseDirection = refBidiProperty.baseDirection; + this->isRtl = (this->pEmbeddingLevels) ? ((*this->pEmbeddingLevels & 0x01) != 0) : false; + this->length = length; + + // temporary + if (this->pCharType) + { + const FriBidiCharType* pBegin = this->pCharType; + const FriBidiCharType* pEnd = pBegin + length; + + while (pBegin < pEnd) + { + if (*pBegin & FRIBIDI_MASK_LETTER) + { + this->eventChar = *(this->pEventText + (pBegin - this->pCharType)); + break; + } + + ++pBegin; + } + } + } +} + +_TextBidiProperty::~_TextBidiProperty(void) +{ + if (pReserved) + { + delete static_cast(pReserved); + } +} + +_TextBidiPropertyWithReorder::_TextBidiPropertyWithReorder(const wchar_t* pText, int length) + : _TextBidiProperty(pText, length) + , pBidiIndex(0) +{ + BidiParagraph* pBidiProperty = static_cast(this->pReserved); + + if (pBidiProperty) + { + FriBidiStrIndex* pTempIndex = 0; + + if (_ReorderBidiLine(NULL, 0, length, *pBidiProperty, &pTempIndex)) + { + pBidiIndex = pTempIndex; + } + } +} + +_TextBidiPropertyWithReorder::_TextBidiPropertyWithReorder(const _TextBidiProperty& refBidiProperty, int offset, int length) + : _TextBidiProperty(refBidiProperty, offset, length) + , pBidiIndex(0) +{ +} + +_TextBidiPropertyWithReorder::~_TextBidiPropertyWithReorder(void) +{ + delete pBidiIndex; +} + +}} // Tizen::Graphics + + +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +namespace Tizen { namespace Graphics +{ + +_FontGlyphList::_FontGlyphList(const _Util::String& text, void* pFace, int script, bool isRtl) +{ + FT_Face face = FT_Face(pFace); + + hb_font_t* hSubFont = NULL; + hb_buffer_t* hBuffer = NULL; + + { + hb_font_t *hFont = hb_ft_font_create(face, NULL); + hSubFont = hb_font_create_sub_font(hFont); + hb_font_destroy (hFont); + } + + hBuffer = hb_buffer_create(); + hb_buffer_set_unicode_funcs(hBuffer, hb_unicode_funcs_get_default()); + + hb_buffer_set_script(hBuffer, hb_glib_script_to_script(GUnicodeScript(script))); + hb_buffer_set_direction(hBuffer, (isRtl) ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); + + if (sizeof(wchar_t) == sizeof(uint32_t)) + { + hb_buffer_add_utf32(hBuffer, (const uint32_t*)text.pStart, text.length, 0, text.length); + } + else + { + uint32_t* pDst = new (std::nothrow) uint32_t[text.length + 1]; + + if (pDst) + { + { + const wchar_t* pSrc = text.pStart; + + uint32_t* pDstBegin = pDst; + uint32_t* pDstEnd = pDstBegin + text.length; + + while (pDstBegin < pDstEnd) + { + *pDstBegin++ = *pSrc++; + } + + *pDstBegin = 0; + } + + hb_buffer_add_utf32(hBuffer, pDst, text.length, 0, text.length); + + delete[] pDst; + } + } + + hb_shape(hSubFont, hBuffer, NULL, 0); + + this->__glyphCount = hb_buffer_get_length(hBuffer); + this->__pGlyphAuxInfo = new (std::nothrow) GlyphAuxInfo[this->__glyphCount]; + + if (this->__pGlyphAuxInfo) + { + hb_glyph_position_t* pPosition = hb_buffer_get_glyph_positions(hBuffer, NULL); + hb_glyph_info_t* pInfo = hb_buffer_get_glyph_infos(hBuffer, NULL); + + GlyphAuxInfo* pAuxInfo = &this->__pGlyphAuxInfo[0]; + GlyphAuxInfo* pAuxInfoEnd = pAuxInfo + this->__glyphCount; + + while (pAuxInfo < pAuxInfoEnd) + { + pAuxInfo->glyphIndex = pInfo->codepoint; + pAuxInfo->xOffset = pPosition->x_offset; + pAuxInfo->yOffset = pPosition->y_offset; + pAuxInfo->xAdvance = pPosition->x_advance; + pAuxInfo->yAdvance = pPosition->y_advance; + + ++pInfo; + ++pPosition; + ++pAuxInfo; + } + } + + hb_buffer_destroy(hBuffer); + hb_font_destroy(hSubFont); +} + +_FontGlyphList::~_FontGlyphList(void) +{ + delete[] __pGlyphAuxInfo; +} + +unsigned int _FontGlyphList::GetCount(void) const +{ + return __glyphCount; +} + +const _FontGlyphList::GlyphAuxInfo& _FontGlyphList::GetGlyphAuxInfo(unsigned int index) const +{ + static const GlyphAuxInfo nullInfo = + { + 0, 0, 0, 0, 0 + }; + + return (index < __glyphCount) ? __pGlyphAuxInfo[index] : nullInfo; +} + +}} // Tizen::Graphics diff --git a/src/graphics/FGrp_FontBidiUtil.h b/src/graphics/FGrp_FontBidiUtil.h new file mode 100644 index 0000000..d7b174c --- /dev/null +++ b/src/graphics/FGrp_FontBidiUtil.h @@ -0,0 +1,99 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FGrp_FontBidiUtil.h + * @brief This is the header file for the bidi utilities. + * + */ + +#ifndef _FGRP_INTERNAL_FONT_BIDI_UTIL_H_ +#define _FGRP_INTERNAL_FONT_BIDI_UTIL_H_ + +#include + + +namespace Tizen { namespace Graphics +{ + +struct _TextBidiProperty +{ + const wchar_t* pEventText; + const FriBidiCharType* pCharType; + const FriBidiLevel* pEmbeddingLevels; + wchar_t eventChar; + FriBidiParType baseDirection; + bool isRtl; + int length; + void* pReserved; + + _TextBidiProperty(const wchar_t* pText, int length); + _TextBidiProperty(const _TextBidiProperty& refBidiProperty, int offset, int length); + virtual ~_TextBidiProperty(void); + + inline bool HasBidi(void) const + { + return (pReserved != 0); + } +}; + +struct _TextBidiPropertyWithReorder + : public _TextBidiProperty +{ + const FriBidiStrIndex* pBidiIndex; + + _TextBidiPropertyWithReorder(const wchar_t* pText, int length); + _TextBidiPropertyWithReorder(const _TextBidiProperty& refBidiProperty, int offset, int length); + virtual ~_TextBidiPropertyWithReorder(void); +}; + +}} // Tizen::Graphics + +//////////////////////////////////////////////////////////////////////////////// + +#include "util/FGrp_UtilType.h" + +namespace Tizen { namespace Graphics +{ + +class _FontGlyphList +{ +public: + struct GlyphAuxInfo + { + unsigned int glyphIndex; + _Util::FixedPoint26_6 xOffset; + _Util::FixedPoint26_6 yOffset; + _Util::FixedPoint26_6 xAdvance; + _Util::FixedPoint26_6 yAdvance; + }; + +public: + _FontGlyphList(const _Util::String& text, void* pFace, int script, bool isRtl); + ~_FontGlyphList(void); + + unsigned int GetCount(void) const; + const GlyphAuxInfo& GetGlyphAuxInfo(unsigned int index) const; + +private: + unsigned int __glyphCount; + GlyphAuxInfo* __pGlyphAuxInfo; +}; + +}} // Tizen::Graphics + +#endif // _FGRP_INTERNAL_FONT_BIDI_UTIL_H_ diff --git a/src/graphics/FGrp_FontCache.cpp b/src/graphics/FGrp_FontCache.cpp index bd05b6a..3e37520 100644 --- a/src/graphics/FGrp_FontCache.cpp +++ b/src/graphics/FGrp_FontCache.cpp @@ -30,20 +30,16 @@ #include "FGrp_FontCache.h" #include "FGrp_FontRsrcManager.h" +#include "util/FGrp_UtilType.h" - -#define CONVERT_INTEGER_TO_26_6_FIXED_POINT(value) (value * 64) #define __pBspCache ((_BspTree*)__pCache) namespace // unnamed { -const unsigned long _CACHE_MEMORY_SIZE = 3 * 1024 * 1024; -const unsigned long _MAX_CACHABLE_ITEM_SIZE = _CACHE_MEMORY_SIZE / 10; - inline bool -_MakeId(unsigned long character, int size, int style, unsigned long& out) +_MakeId(unsigned long character, Tizen::Graphics::_Util::FixedPoint26_6 size, int style, unsigned long& out) { int fixedSize = size >> 5; @@ -281,7 +277,7 @@ _FontCache::IsValid(void) const } bool -_FontCache::Find(unsigned long character, int size, int style, _IFont::Glyph** pOut) +_FontCache::Find(unsigned long character, _Util::FixedPoint26_6 size, int style, _IFont::Glyph** pOut) { unsigned long id = 0; bool rtn = _MakeId(character, size, style, id); @@ -305,7 +301,7 @@ _FontCache::Find(unsigned long character, int size, int style, _IFont::Glyph** p } bool -_FontCache::Add(unsigned long character, int size, int style, _IFont::Glyph* pGlyph) +_FontCache::Add(unsigned long character, _Util::FixedPoint26_6 size, int style, _IFont::Glyph* pGlyph) { unsigned long bufferSize = 0; unsigned long id = 0; @@ -352,7 +348,7 @@ _FontCache::Add(unsigned long character, int size, int style, _IFont::Glyph* pGl } void -_FontCache::Remove(unsigned long character, int size, int style) +_FontCache::Remove(unsigned long character, _Util::FixedPoint26_6 size, int style) { unsigned long id = 0; bool rtn = _MakeId(character, size, style, id); diff --git a/src/graphics/FGrp_FontCache.h b/src/graphics/FGrp_FontCache.h index 96e09f3..3185b66 100644 --- a/src/graphics/FGrp_FontCache.h +++ b/src/graphics/FGrp_FontCache.h @@ -43,9 +43,9 @@ public: bool IsValid(void) const; - bool Find(unsigned long character, int size, int style, _IFont::Glyph** pOut); - bool Add(unsigned long character, int size, int style, _IFont::Glyph* pGlyph); - void Remove(unsigned long character, int size, int style); + bool Find(unsigned long character, _Util::FixedPoint26_6 size, int style, _IFont::Glyph** pOut); + bool Add(unsigned long character, _Util::FixedPoint26_6 size, int style, _IFont::Glyph* pGlyph); + void Remove(unsigned long character, _Util::FixedPoint26_6 size, int style); void RemoveFirst(void); bool IsEmpty(void); diff --git a/src/graphics/FGrp_FontFt2.cpp b/src/graphics/FGrp_FontFt2.cpp index 7ab4f3c..877d1a8 100644 --- a/src/graphics/FGrp_FontFt2.cpp +++ b/src/graphics/FGrp_FontFt2.cpp @@ -27,6 +27,7 @@ #include #include +#include #include FT_FREETYPE_H #include FT_OUTLINE_H @@ -38,46 +39,43 @@ #include "FGrp_FontFt2.h" #include "FGrp_FontCache.h" +#include "FGrp_FontBidiUtil.h" #include "util/FGrp_UtilTemplate.h" - -#include -#include -#include +#include "util/FGrp_UtilType.h" #define CHECK_NULL_PARAM(data) if (data == null) \ { \ return false; \ } -#define CONVERT_INTEGER_TO_26_6_FIXED_POINT(value) (value * 64) -#define CONVERT_26_6_FIXED_POINT_TO_INTEGER(value) (value / 64) using namespace Tizen::Base; using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; namespace // unnamed { const double _M_PI = 3.14159265358979323846; const double _ITALIC_ANGLE = 10.619655; -const long _DEFAULT_FONT_SIZE = CONVERT_INTEGER_TO_26_6_FIXED_POINT(16); // 16 pixel size in 26.6 fixed point +const int _SYSTEM_DEFAULT_FONT_SIZE = 16; const long _DEFAULT_RES = 72; -const long _FIXED_SHIFT = 10; // in fixed point number, the number of assigned bit below point. + const unsigned long _INDEX_FIRST = 32; // in first resource, the first chracter(space) const unsigned long _INDEX_COUNT = 95; // first resource character count bool -_CompareFamilyForTitling(String& familyName) +_CompareFamilyForTitling(const char* pFamilyName) { - String _compNames[] = + static const char* _compNames[] = { - L"TitlingGothicFB Comp", - L"TitlingGothicFB Cond", - L"TitlingGothicFB Narrow", - L"TitlingGothicFB Skyline" + "TitlingGothicFB Comp", + "TitlingGothicFB Cond", + "TitlingGothicFB Narrow", + "TitlingGothicFB Skyline" }; for (unsigned int i = 0; i < sizeof(_compNames) / sizeof(_compNames[0]); i++) { - if (familyName == _compNames[i]) + if (strcmp(pFamilyName, _compNames[i]) == 0) { return true; } @@ -86,163 +84,64 @@ _CompareFamilyForTitling(String& familyName) return false; } -const hb_script_t _HarfbuzzScript[] = -{ - HB_SCRIPT_COMMON, - HB_SCRIPT_INHERITED, - HB_SCRIPT_ARABIC, - HB_SCRIPT_ARMENIAN, - HB_SCRIPT_BENGALI, - HB_SCRIPT_BOPOMOFO, - HB_SCRIPT_CHEROKEE, - HB_SCRIPT_COPTIC, - HB_SCRIPT_CYRILLIC, - HB_SCRIPT_DESERET, - HB_SCRIPT_DEVANAGARI, - HB_SCRIPT_ETHIOPIC, - HB_SCRIPT_GEORGIAN, - HB_SCRIPT_GOTHIC, - HB_SCRIPT_GREEK, - HB_SCRIPT_GUJARATI, - HB_SCRIPT_GURMUKHI, - HB_SCRIPT_HAN, - HB_SCRIPT_HANGUL, - HB_SCRIPT_HEBREW, - HB_SCRIPT_HIRAGANA, - HB_SCRIPT_KANNADA, - HB_SCRIPT_KATAKANA, - HB_SCRIPT_KHMER, - HB_SCRIPT_LAO, - HB_SCRIPT_LATIN, - HB_SCRIPT_MALAYALAM, - HB_SCRIPT_MONGOLIAN, - HB_SCRIPT_MYANMAR, - HB_SCRIPT_OGHAM, - HB_SCRIPT_OLD_ITALIC, - HB_SCRIPT_ORIYA, - HB_SCRIPT_RUNIC, - HB_SCRIPT_SINHALA, - HB_SCRIPT_SYRIAC, - HB_SCRIPT_TAMIL, - HB_SCRIPT_TELUGU, - HB_SCRIPT_THAANA, - HB_SCRIPT_THAI, - HB_SCRIPT_TIBETAN, - HB_SCRIPT_CANADIAN_ABORIGINAL, - HB_SCRIPT_YI, - HB_SCRIPT_TAGALOG, - HB_SCRIPT_HANUNOO, - HB_SCRIPT_BUHID, - HB_SCRIPT_TAGBANWA, - - /* Unicode-4.0 additions */ - HB_SCRIPT_BRAILLE, - HB_SCRIPT_CYPRIOT, - HB_SCRIPT_LIMBU, - HB_SCRIPT_OSMANYA, - HB_SCRIPT_SHAVIAN, - HB_SCRIPT_LINEAR_B, - HB_SCRIPT_TAI_LE, - HB_SCRIPT_UGARITIC, - - /* Unicode-4.1 additions */ - HB_SCRIPT_NEW_TAI_LUE, - HB_SCRIPT_BUGINESE, - HB_SCRIPT_GLAGOLITIC, - HB_SCRIPT_TIFINAGH, - HB_SCRIPT_SYLOTI_NAGRI, - HB_SCRIPT_OLD_PERSIAN, - HB_SCRIPT_KHAROSHTHI, - - /* Unicode-5.0 additions */ - HB_SCRIPT_UNKNOWN, - HB_SCRIPT_BALINESE, - HB_SCRIPT_CUNEIFORM, - HB_SCRIPT_PHOENICIAN, - HB_SCRIPT_PHAGS_PA, - HB_SCRIPT_NKO, - - /* Unicode-5.1 additions */ - HB_SCRIPT_KAYAH_LI, - HB_SCRIPT_LEPCHA, - HB_SCRIPT_REJANG, - HB_SCRIPT_SUNDANESE, - HB_SCRIPT_SAURASHTRA, - HB_SCRIPT_CHAM, - HB_SCRIPT_OL_CHIKI, - HB_SCRIPT_VAI, - HB_SCRIPT_CARIAN, - HB_SCRIPT_LYCIAN, - HB_SCRIPT_LYDIAN, - - /* Unicode-5.2 additions */ - HB_SCRIPT_AVESTAN, - HB_SCRIPT_BAMUM, - HB_SCRIPT_EGYPTIAN_HIEROGLYPHS, - HB_SCRIPT_IMPERIAL_ARAMAIC, - HB_SCRIPT_INSCRIPTIONAL_PAHLAVI, - HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, - HB_SCRIPT_JAVANESE, - HB_SCRIPT_KAITHI, - HB_SCRIPT_TAI_THAM, - HB_SCRIPT_LISU, - HB_SCRIPT_MEETEI_MAYEK, - HB_SCRIPT_OLD_SOUTH_ARABIAN, - HB_SCRIPT_OLD_TURKIC, - HB_SCRIPT_SAMARITAN, - HB_SCRIPT_TAI_VIET, - - /* Unicode-6.0 additions */ - HB_SCRIPT_BATAK, - HB_SCRIPT_BRAHMI, - HB_SCRIPT_MANDAIC -}; - template class _FontHashCodeProvider : public IHashCodeProviderT { public: - _FontHashCodeProvider(void) - { - } - - virtual ~_FontHashCodeProvider(void) - { - } - virtual int GetHashCode(const T& obj) const { return obj.GetHashCode(); } -}; +}; // _FontHashCodeProvider template class _FontComparer : public IComparerT { public: - _FontComparer(void) + virtual result Compare(const T& obj1, const T& obj2, int& cmp) const { + String& objString1 = static_cast (const_cast (obj1)); + String& objString2 = static_cast (const_cast (obj2)); + + cmp = objString1.CompareTo(objString2); + + return E_SUCCESS; } +}; // _FontComparer + - virtual ~_FontComparer(void) +#ifdef USE_OTHER_CONTAINER + // nothing +#else +template +class _FontHashCodeProviderEx + : public IHashCodeProviderT +{ +public: + virtual int GetHashCode(const T& obj) const { + return reinterpret_cast(obj.c_str()); } +}; // _FontHashCodeProviderEx +template +class _FontComparerEx + : public IComparerT +{ +public: virtual result Compare(const T& obj1, const T& obj2, int& cmp) const { - String& objString1 = static_cast (const_cast (obj1)); - String& objString2 = static_cast (const_cast (obj2)); - - cmp = objString1.CompareTo(objString2); + cmp = wcscmp((wchar_t*)obj1.c_str(), (wchar_t*)obj1.c_str()); return E_SUCCESS; } -}; +}; // _FontComparerEx -const _FontHashCodeProvider _fontHashCodeProvider; -const _FontComparer _fontComparer; +const _FontHashCodeProviderEx<_Util::WString> _fontHashCodeProviderEx; +const _FontComparerEx<_Util::WString> _fontComparerEx; +#endif } // unnamed @@ -262,17 +161,26 @@ _FontFt2::_FontFt2() , __pFontFace(null) , __pFontBuffer(null) , __isStaticBuffer(false) + , __isEmoji(false) { - __fontAttrib.size = _DEFAULT_FONT_SIZE; + _Util::FixedPoint26_6 defaultSize, defaultBoldWeight; + defaultSize.SetConvertToFixedPoint(_SYSTEM_DEFAULT_FONT_SIZE); + defaultBoldWeight.SetConvertToFixedPoint(1); + + __fontAttrib.size = defaultSize; __fontAttrib.angle = 0.0f; __fontAttrib.style = _IFont::STYLE_NONE; __fontAttrib.quality = _IFont::QUALITY_HIGH; __fontAttrib.xExpansion = 100; - __fontAttrib.boldWeight = 1 << 6; //5L<<14; + __fontAttrib.boldWeight = defaultBoldWeight; //5L<<14; - __fallbackFontMap.Construct(1, 0, _fontHashCodeProvider, _fontComparer); - //create cache +#ifdef USE_OTHER_CONTAINER + // nothing +#else + __fallbackFontMap.Construct(1, 0, _fontHashCodeProviderEx, _fontComparerEx); +#endif + //create cache __fontCache.reset(new (std::nothrow) _FontCache()); } @@ -286,7 +194,11 @@ _FontFt2::~_FontFt2() __CleanUp(); __isValid = false; +#ifdef USE_OTHER_CONTAINER + __fallbackFontMap.clear(); +#else __fallbackFontMap.RemoveAll(); +#endif } bool @@ -336,6 +248,8 @@ _FontFt2::Create(const void* pBuffer, long bufSize, long face) __isValid = true; + __InitProperty(); + return true; } @@ -374,6 +288,8 @@ _FontFt2::Create(const char* pFilePath, long face) __isValid = true; + __InitProperty(); + return true; } @@ -416,6 +332,9 @@ _FontFt2::CreateStatic(const void* pBuffer, long bufSize, long face) } __isValid = true; + + __InitProperty(); + return true; } @@ -471,6 +390,8 @@ _FontFt2::Reload(const void* pBuffer, long bufSize, long face) __isValid = true; + __InitProperty(); + return true; } @@ -511,6 +432,8 @@ _FontFt2::Reload(const char* filePath, long face) __isValid = true; + __InitProperty(); + return true; } @@ -527,13 +450,13 @@ _FontFt2::Destroy(void) } bool -_FontFt2::FindCache(unsigned long character, int size, int style, Glyph** pOut) +_FontFt2::FindCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph** pOut) { return (__fontCache.get()) ? __fontCache->Find(character, __fontAttrib.size, __fontAttrib.style, pOut) : false; } bool -_FontFt2::AddCache(unsigned long character, int size, int style, Glyph* pGlyph) +_FontFt2::AddCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph* pGlyph) { return (__fontCache.get()) ? __fontCache->Add(character, size, style, pGlyph) : false; } @@ -552,10 +475,10 @@ _FontFt2::SetAttrib(const Attrib& fontAttrib) return false; } - if (!(fontAttrib.size >= CONVERT_INTEGER_TO_26_6_FIXED_POINT(1)) || + if (!(fontAttrib.size >= 1) || !(fontAttrib.quality >= 0 && fontAttrib.quality <= 3) || !(fontAttrib.xExpansion >= 1) || - !(CONVERT_26_6_FIXED_POINT_TO_INTEGER(fontAttrib.size) * fontAttrib.xExpansion >= _DEFAULT_RES) || + !(fontAttrib.size.ToInt() * fontAttrib.xExpansion >= _DEFAULT_RES) || !(fontAttrib.boldWeight > 0)) { return false; @@ -566,9 +489,12 @@ _FontFt2::SetAttrib(const Attrib& fontAttrib) return false; } - if (FT_Set_Char_Size(FT_Face(__pFontFace), fontAttrib.size * _DEFAULT_RES, fontAttrib.size * _DEFAULT_RES, 1, 1) > 0) + if (__fontAttrib.size != fontAttrib.size) { - return false; + if (FT_Set_Char_Size(FT_Face(__pFontFace), fontAttrib.size.__fixedPoint * _DEFAULT_RES, fontAttrib.size.__fixedPoint * _DEFAULT_RES, 1, 1) > 0) + { + return false; + } } // set @@ -645,9 +571,8 @@ _FontFt2::GetKerning(unsigned long character1, unsigned long character2, long& x return false; } - const int shiftBit = 6; - xVector = (delta.x >> shiftBit); - yVector = (delta.y >> shiftBit); + xVector = _Util::FixedPoint26_6(delta.x).ToInt(); + yVector = _Util::FixedPoint26_6(delta.y).ToInt(); } else { @@ -698,27 +623,13 @@ _FontFt2::LoadGlyph(unsigned long character, Glyph** ppFontGlyphData) __SetTransMatrix(&matrix); FT_Set_Transform(pFace, &matrix, &pen); - if (__fontAttrib.quality == _IFont::QUALITY_MONO) - { - //TODO sunmi557.shin, will not support - FT_Error errCode = 1; - - errCode = FT_Load_Glyph(pFace, ixCurr, FT_LOAD_RENDER | FT_LOAD_MONOCHROME); - - if (errCode) - { - SysLogException(NID_GRP, E_SYSTEM, "[E_SYSTEM] FT_Load_Glyph_MONO(errCode = %#x)=", errCode); - - return false; - } - } - else if (__fontAttrib.quality == _IFont::QUALITY_LOW || + if (__fontAttrib.quality == _IFont::QUALITY_LOW || __fontAttrib.quality == _IFont::QUALITY_MEDIUM || __fontAttrib.quality == _IFont::QUALITY_HIGH) { FT_Error errCode = 1; - bool isSynthetic = (__fontAttrib.style & _IFont::STYLE_BOLD) && !(pFace->style_flags & FT_STYLE_FLAG_BOLD); + bool isSynthetic = (__fontAttrib.style & _IFont::STYLE_BOLD) && (__fontProperty.weightClass < 500); if (isSynthetic) { @@ -739,11 +650,24 @@ _FontFt2::LoadGlyph(unsigned long character, Glyph** ppFontGlyphData) if (isSynthetic) { - FT_Outline_Embolden(&pFace->glyph->outline, __fontAttrib.boldWeight); + FT_Outline_Embolden(&pFace->glyph->outline, __fontAttrib.boldWeight.__fixedPoint); } FT_Render_Glyph(pFace->glyph, FT_RENDER_MODE_NORMAL); + } + else if (__fontAttrib.quality == _IFont::QUALITY_MONO) + { + //TODO sunmi557.shin, will not support + FT_Error errCode = 1; + + errCode = FT_Load_Glyph(pFace, ixCurr, FT_LOAD_RENDER | FT_LOAD_MONOCHROME); + + if (errCode) + { + SysLogException(NID_GRP, E_SYSTEM, "[E_SYSTEM] FT_Load_Glyph_MONO(errCode = %#x)=", errCode); + return false; + } } else { @@ -797,65 +721,62 @@ _FontFt2::CheckGlyph(unsigned long character) } bool -_FontFt2::GetFontProperty(Property& property) const +_FontFt2::GetFontSizeProperty(SizeProperty& sizeProperty) const { if (!__isValid) { return false; } - FT_Face face = (FT_Face) __pFontFace; + FT_Face pFace = (FT_Face) __pFontFace; - if (FT_IS_SCALABLE(face)) + if (FT_IS_SCALABLE(pFace)) { - const int shiftBit = 6; - // validation check - if (face->size == null) + if (pFace->size == null) { return false; } // fill out - property.pFamilyName = face->family_name; - property.pStyleName = face->style_name; - property.maxWidth = face->size->metrics.max_advance >> shiftBit; - property.maxHeight = face->size->metrics.height >> shiftBit; - property.baseLine = (face->size->metrics.height + face->size->metrics.descender) >> shiftBit; - property.ascender = face->size->metrics.ascender >> shiftBit; - property.descender = face->size->metrics.descender >> shiftBit; // (-) - property.leading = (face->size->metrics.height - face->size->metrics.ascender + face->size->metrics.descender) >> shiftBit; - - String familyName = String(property.pFamilyName); - - if (_CompareFamilyForTitling(familyName))// temp + + sizeProperty.maxWidth = pFace->size->metrics.max_advance; + sizeProperty.maxHeight = pFace->size->metrics.height; + sizeProperty.baseLine = pFace->size->metrics.height + pFace->size->metrics.descender; + sizeProperty.ascender = pFace->size->metrics.ascender; + sizeProperty.descender = pFace->size->metrics.descender; // (-) + sizeProperty.leading = pFace->size->metrics.height - pFace->size->metrics.ascender + pFace->size->metrics.descender; + + + if (_CompareFamilyForTitling(pFace->family_name)) { - int min = (face->bbox.yMin * face->size->metrics.y_ppem) / face->units_per_EM; - int max = (face->bbox.yMax * face->size->metrics.y_ppem) / face->units_per_EM; + _Util::FixedPoint26_6 min = (pFace->bbox.yMin * pFace->size->metrics.y_ppem) / pFace->units_per_EM; + _Util::FixedPoint26_6 max = (pFace->bbox.yMax * pFace->size->metrics.y_ppem) / pFace->units_per_EM; - if (property.ascender < max) + if (sizeProperty.ascender < max) { - property.ascender = max; + sizeProperty.ascender = max; } - if (property.descender > min) + if (sizeProperty.descender > min) { - property.descender = min; + sizeProperty.descender = min; } - property.maxHeight = property.ascender - property.descender; - property.baseLine = (property.maxHeight + property.descender) >> shiftBit; - property.leading = (property.maxHeight - property.ascender + property.descender) >> shiftBit; + sizeProperty.maxHeight = sizeProperty.ascender - sizeProperty.descender; + sizeProperty.baseLine = sizeProperty.maxHeight + sizeProperty.descender; + sizeProperty.leading = sizeProperty.maxHeight - sizeProperty.ascender + sizeProperty.descender; } // shkim, TODO - // engine name and min/max size need to be verified - property.pEngineName = "FreeType2"; - property.minSize = 8; - property.maxSize = 540; - property.styleCaps = _IFont::STYLE_ITALIC | _IFont::STYLE_BOLD | _IFont::STYLE_BACKSLANT; - property.fontCaps = _IFont::CAPS_SCALABLE | _IFont::CAPS_ANGLE | _IFont::CAPS_X_EXPANSION | _IFont::CAPS_QUALITY_MONO | - _IFont::CAPS_QUALITY_LOW | _IFont::CAPS_QUALITY_MEDIUM | _IFont::CAPS_QUALITY_HIGH; + // min/max size need to be verified + + _Util::FixedPoint26_6 minSize, maxSize; + minSize.SetConvertToFixedPoint(8); + maxSize.SetConvertToFixedPoint(540); + + sizeProperty.minSize = minSize; + sizeProperty.maxSize = maxSize; } else { @@ -865,154 +786,147 @@ _FontFt2::GetFontProperty(Property& property) const return true; } -Tizen::Base::Collection::HashMapT* -_FontFt2::GetFallbackMap() -{ - return &__fallbackFontMap; -} - bool -_FontFt2::GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) const +_FontFt2::__InitProperty() { - //hb_font_funcs_t *ffuncs; - FT_Face face = null; - hb_buffer_t *hBuffer = null; - hb_glyph_position_t *positions = null; - hb_glyph_info_t *infos = null; - unsigned int slen; - - /*FriBidiChar *friText = new (std::nothrow) FriBidiChar[length]; - FriBidiCharType *ctypes = new (std::nothrow) FriBidiCharType[length]; - FriBidiLevel *emblevels = new (std::nothrow) FriBidiLevel[length]; - FriBidiJoiningType *join_types = new (std::nothrow) FriBidiJoiningType[length]; - FriBidiParType base_direction = FRIBIDI_PAR_ON; - FriBidiCharType type; - char *ouputChar = new (std::nothrow) char[length];*/ - - //int last_break = 0; - //bool bRTL = true; - -/* - ffuncs = hb_font_funcs_create (); - hb_font_funcs_set_glyph_h_advance_func (ffuncs, glyph_h_advance_func, NULL, NULL); - hb_font_funcs_set_glyph_func (ffuncs, glyph_func, NULL, NULL); - hb_font_funcs_set_glyph_h_kerning_func (ffuncs, glyph_h_kerning_func, NULL, NULL); - hb_font_set_funcs (hFont, ffuncs, NULL, NULL);*/ - - // if(hb_version_check(0, 9, 0))//0.9.0 - // { - // hBuffer = hb_buffer_create(); - // hb_buffer_set_unicode_funcs(hBuffer, hb_unicode_funcs_get_default()); - // hb_buffer_set_language(hBuffer, hb_language_from_string("th", -1)); - // } - //else// 0.7.0 - // { - face = FT_Face(__pFontFace); - - hb_font_t *hFont = hb_ft_font_create (face, NULL); - hb_font_t *hSubFont = hb_font_create_sub_font(hFont); - hb_font_destroy (hFont); - - hBuffer = hb_buffer_create(); - hb_buffer_set_unicode_funcs(hBuffer, hb_unicode_funcs_get_default()); - //hb_buffer_set_language(hBuffer, hb_language_from_string("th")); - - if (isRtl) - { - //hb_buffer_set_language(hBuffer, hb_language_from_string("ar", -1)); - hb_buffer_set_script(hBuffer, _HarfbuzzScript[script]); - hb_buffer_set_direction(hBuffer, HB_DIRECTION_RTL); - } - else + if (!__isValid) { - //hb_buffer_set_language(hBuffer, hb_language_from_string("en", -1)); - //hb_buffer_set_script(hBuffer, HB_SCRIPT_THAI); - //hb_buffer_set_direction(hBuffer, HB_DIRECTION_LTR); - hb_buffer_set_script(hBuffer, _HarfbuzzScript[script]); - hb_buffer_set_direction(hBuffer, HB_DIRECTION_LTR); + return false; } - if (sizeof(wchar_t) == sizeof(uint32_t)) - { - hb_buffer_add_utf32(hBuffer, (const uint32_t*)text.pStart, text.length, 0, text.length); - } - else - { - uint32_t* pDst = new (std::nothrow) uint32_t[text.length + 1]; + FT_Face pFace = (FT_Face) __pFontFace; - if (pDst) + if (FT_IS_SCALABLE(pFace)) + { + // validation check + if (pFace->size == null) { - { - const wchar_t* pSrc = text.pStart; + return false; + } + + TT_OS2* pFontSpecTable = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2); + + // fill out + __fontProperty.pFamilyName = pFace->family_name; + __fontProperty.pStyleName = pFace->style_name; + __fontProperty.weightClass = (pFontSpecTable != null) ? pFontSpecTable->usWeightClass : 400; + __fontProperty.styleFlag = pFace->style_flags; + // shkim, TODO + // engine name and min/max size need to be verified + __fontProperty.pEngineName = "FreeType2"; + __fontProperty.styleCaps = _IFont::STYLE_ITALIC | _IFont::STYLE_BOLD | _IFont::STYLE_BACKSLANT; + __fontProperty.fontCaps = _IFont::CAPS_SCALABLE | _IFont::CAPS_ANGLE | _IFont::CAPS_X_EXPANSION | _IFont::CAPS_QUALITY_MONO | + _IFont::CAPS_QUALITY_LOW | _IFont::CAPS_QUALITY_MEDIUM | _IFont::CAPS_QUALITY_HIGH; + + FT_Set_Char_Size(FT_Face(__pFontFace), __fontAttrib.size.__fixedPoint * _DEFAULT_RES, __fontAttrib.size.__fixedPoint * _DEFAULT_RES, 1, 1); - uint32_t* pDstBegin = pDst; - uint32_t* pDstEnd = pDstBegin + text.length; + static const char* emojiFaceNames[] = + { + "keitaiemoji" + }; - while (pDstBegin < pDstEnd) - { - *pDstBegin++ = *pSrc++; - } + __isEmoji = false; - *pDstBegin = 0; + for (unsigned int i = 0; i < sizeof(emojiFaceNames) / sizeof(emojiFaceNames[0]); i++) + { + if (strcmp(__fontProperty.pFamilyName, emojiFaceNames[i]) == 0) + { + __isEmoji = true; + break; } + } + } + else + { + return false; + } - hb_buffer_add_utf32(hBuffer, pDst, text.length, 0, text.length); + return true; +} - delete[] pDst; - } +bool +_FontFt2::IsEmoji(void) const +{ + return __isEmoji; +} + +bool +_FontFt2::GetFontProperty(Property& property) const +{ + if (!__isValid) + { + return false; } - /*{ - hb_font_funcs_t *font_funcs = hb_font_funcs_create(); + property.pFamilyName = __fontProperty.pFamilyName; + property.pStyleName = __fontProperty.pStyleName; + property.styleFlag = __fontProperty.styleFlag; + property.weightClass = __fontProperty.weightClass; + property.pEngineName = __fontProperty.pEngineName; + property.styleCaps = __fontProperty.styleCaps; + property.fontCaps = __fontProperty.fontCaps; + + return true; +} + +_IFont::FontMapT* +_FontFt2::GetFallbackMap() +{ + return &__fallbackFontMap; +} - hb_font_funcs_set_glyph_h_advance_func(font_funcs, _evas_common_font_ot_hb_get_glyph_advance, NULL, NULL); - hb_font_funcs_set_glyph_h_kerning_func(font_funcs, _evas_common_font_ot_hb_get_kerning, NULL, NULL); +bool +_FontFt2::GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) +{ + FT_Face pFace = FT_Face(__pFontFace); - hb_font_set_funcs(hSubFont, font_funcs, fi, NULL); - }*/ + { + FT_Matrix matrix; + FT_Vector pen = {0, 0}; - hb_shape (hSubFont, hBuffer, NULL, 0); + this->__SetTransMatrix(&matrix); - slen = hb_buffer_get_length (hBuffer); - positions = hb_buffer_get_glyph_positions (hBuffer, NULL); - infos = hb_buffer_get_glyph_infos (hBuffer, NULL); + FT_Set_Transform(pFace, &matrix, &pen); + } - //_IFont::Glyph *pFontGlyphData = (_IFont::Glyph*) new (std::nothrow) char[sizeof(_IFont::Glyph) + (image.bytesPerLine * image.height)]; + _FontGlyphList glyphList(text, pFace, script, isRtl); out.RemoveAll(); - for(unsigned int i = 0; i < slen; i++) + for (unsigned int i = 0; i < glyphList.GetCount(); i++) { - FT_UInt glyph_index = infos->codepoint; + const _FontGlyphList::GlyphAuxInfo& auxInfo = glyphList.GetGlyphAuxInfo(i); + + FT_UInt glyph_index = auxInfo.glyphIndex; _IFont::GlyphBitmap image; - FT_Error error = FT_Load_Glyph(face, glyph_index, /*FT_LOAD_RENDER*/FT_LOAD_DEFAULT/* | FT_LOAD_NO_BITMAP*/); - if(error) + FT_Error error = FT_Load_Glyph(pFace, glyph_index, /*FT_LOAD_RENDER*/FT_LOAD_DEFAULT/* | FT_LOAD_NO_BITMAP*/); + + if (error) { continue; } - error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL); - if(error) + error = FT_Render_Glyph(pFace->glyph, FT_RENDER_MODE_NORMAL); + + if (error) { continue; } - FT_GlyphSlot pSlot = FT_GlyphSlot(face->glyph); + FT_GlyphSlot pSlot = FT_GlyphSlot(pFace->glyph); switch (pSlot->bitmap.pixel_mode) { - case ft_pixel_mode_mono: - image.depth = 1; - break; - - case ft_pixel_mode_grays: - image.depth = 8; - break; - - default: - continue; + case ft_pixel_mode_mono: + image.depth = 1; + break; + case ft_pixel_mode_grays: + image.depth = 8; + break; + default: + continue; } image.width = pSlot->bitmap.width; @@ -1023,50 +937,52 @@ _FontFt2::GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IList _IFont::Glyph *pFontGlyphData = (_IFont::Glyph*) new (std::nothrow) char[sizeof(_IFont::Glyph) + (image.bytesPerLine * image.height)]; if (pFontGlyphData == null) + { continue; + } + + _Util::FixedPoint22_10 bitmapLeft, bitmapTop, xOffset, yOffset, xAdvance, yAdvance; + bitmapLeft.SetConvertToFixedPoint(pSlot->bitmap_left); + bitmapTop.SetConvertToFixedPoint(pSlot->bitmap_top); + + xOffset.SetConvertToFixedPoint(auxInfo.xOffset.ToInt()); + yOffset.SetConvertToFixedPoint(auxInfo.yOffset.ToInt()); + xAdvance.SetConvertToFixedPoint(auxInfo.xAdvance.ToInt()); + yAdvance.SetConvertToFixedPoint(auxInfo.yAdvance.ToInt()); pFontGlyphData->id = 0; - pFontGlyphData->xOffset = (positions->x_offset >> 6) + pSlot->bitmap_left; - pFontGlyphData->yOffset = (positions->y_offset >> 6) + pSlot->bitmap_top; - pFontGlyphData->xAdvance = pSlot->advance.x << (_FIXED_SHIFT - 6); - pFontGlyphData->yAdvance = -(pSlot->advance.y << (_FIXED_SHIFT - 6)); - //pFontGlyphData->xOffset = positions->x_offset; - //pFontGlyphData->yOffset = positions->y_offset; - //pFontGlyphData->xAdvance = positions->x_advance; - //pFontGlyphData->yAdvance = positions->y_advance; + pFontGlyphData->xOffset = xOffset + bitmapLeft; + pFontGlyphData->yOffset = yOffset + bitmapTop; + pFontGlyphData->xAdvance = xAdvance; + pFontGlyphData->yAdvance = -yAdvance; + pFontGlyphData->hasOwnerShip = 0; pFontGlyphData->image = image; pFontGlyphData->image.pBitmap = (unsigned char*)(pFontGlyphData + 1); memcpy(pFontGlyphData->image.pBitmap, image.pBitmap, image.bytesPerLine * image.height); out.Add(pFontGlyphData); - - infos++; - positions++; } - hb_font_destroy (hSubFont); - hb_buffer_destroy(hBuffer); - return true; } void _FontFt2::__CleanUp() { - if (__pFontFace) + if (__pFontFace != null) { FT_Done_Face(FT_Face(__pFontFace)); __pFontFace = null; } - if (__pFontEngine) + if (__pFontEngine != null) { FT_Done_FreeType(FT_Library(__pFontEngine)); __pFontEngine = null; } - if (__pFontBuffer && !__isStaticBuffer) + if ((__pFontBuffer != null) && !__isStaticBuffer) { delete[] static_cast(__pFontBuffer); } @@ -1084,12 +1000,13 @@ _FontFt2::__GetCharIndex(unsigned long character) const } FT_Face pFace = FT_Face(__pFontFace); + if (pFace == null) { return false; } - if (pFace->charmap) + if (pFace->charmap != null) { unsigned long ixCurr = FT_Get_Char_Index(pFace, character); @@ -1135,13 +1052,22 @@ _FontFt2::__ConvertPrivateToImage(void* pData1, _IFont::Glyph** ppFontGlyphData) return false; } + _Util::FixedPoint26_6 xAdvanceTmp(pSlot->advance.x); + _Util::FixedPoint26_6 yAdvanceTmp(pSlot->advance.y); + + _Util::FixedPoint22_10 bitmapLeft, bitmapTop, xAdvance, yAdvance;; + bitmapLeft.SetConvertToFixedPoint(pSlot->bitmap_left); + bitmapTop.SetConvertToFixedPoint(pSlot->bitmap_top); + xAdvance.SetConvertToFixedPoint(xAdvanceTmp.ToInt()); + yAdvance.SetConvertToFixedPoint(yAdvanceTmp.ToInt()); + (*ppFontGlyphData)->id = 0; - (*ppFontGlyphData)->xOffset = pSlot->bitmap_left << _FIXED_SHIFT; - (*ppFontGlyphData)->yOffset = pSlot->bitmap_top << _FIXED_SHIFT; - (*ppFontGlyphData)->xAdvance = pSlot->advance.x << (_FIXED_SHIFT - 6); - (*ppFontGlyphData)->yAdvance = -(pSlot->advance.y << (_FIXED_SHIFT - 6)); - (*ppFontGlyphData)->hasOwnerShip = 0; - (*ppFontGlyphData)->image = image; + (*ppFontGlyphData)->xOffset = bitmapLeft; + (*ppFontGlyphData)->yOffset = bitmapTop; + (*ppFontGlyphData)->xAdvance = xAdvance; + (*ppFontGlyphData)->yAdvance = -yAdvance; + (*ppFontGlyphData)->hasOwnerShip = 0; + (*ppFontGlyphData)->image = image; // shkim, set the memory address of bitmap to the allocated by ourself above //(*pFontGlyphData)->image.bitmap = (unsigned char*)((*pFontGlyphData) + 1); diff --git a/src/graphics/FGrp_FontFt2.h b/src/graphics/FGrp_FontFt2.h index ac78b1b..50c00d4 100644 --- a/src/graphics/FGrp_FontFt2.h +++ b/src/graphics/FGrp_FontFt2.h @@ -48,11 +48,14 @@ public: virtual bool UnloadGlyph(Glyph** ppFontGlyphData); virtual unsigned long CheckGlyph(unsigned long character); - virtual bool GetFontProperty(Property& property) const; + virtual bool GetFontSizeProperty(SizeProperty& sizeProperty) const; + virtual bool GetFontProperty(_IFont::Property& property) const; - virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) const; + virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script); - virtual Tizen::Base::Collection::HashMapT* GetFallbackMap(void); + virtual _IFont::FontMapT* GetFallbackMap(void); + + virtual bool IsEmoji(void) const; protected: virtual bool Create(const void* pBuffer, long bufSize, long face = 0); @@ -61,8 +64,8 @@ protected: virtual bool Reload(const void* pBuffer, long bufSize, long face = 0); virtual bool Reload(const char* filePath, long face = 0); virtual void Destroy(void); - virtual bool FindCache(unsigned long character, int size, int style, Glyph** pOut); - virtual bool AddCache(unsigned long character, int size, int style, Glyph* pGlyph); + virtual bool FindCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph** pOut); + virtual bool AddCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph* pGlyph); virtual bool CleanCache(void); private: @@ -81,19 +84,23 @@ private: // set translate matrix bool __SetTransMatrix(void* pMatrix); + bool __InitProperty(void); + private: bool __isValid; bool __isLoadGlyph; _IFont::Attrib __fontAttrib; + _IFont::Property __fontProperty; void* __pFontEngine; void* __pFontFace; void* __pFontBuffer; bool __isStaticBuffer; + bool __isEmoji; //_FontCache fontCache; std::auto_ptr<_FontCache> __fontCache; // fallback font resources - Tizen::Base::Collection::HashMapT __fallbackFontMap; + _IFont::FontMapT __fallbackFontMap; }; // _FontFt2 diff --git a/src/graphics/FGrp_FontImpl.cpp b/src/graphics/FGrp_FontImpl.cpp index a792c1c..2d2fc40 100644 --- a/src/graphics/FGrp_FontImpl.cpp +++ b/src/graphics/FGrp_FontImpl.cpp @@ -42,8 +42,6 @@ code; \ } #define IsSucceeded(X) (!IsFailed(X)) -#define CONVERT_INTEGER_TO_26_6_FIXED_POINT(value) (value * 64) - namespace Tizen { namespace Graphics { @@ -52,16 +50,29 @@ struct _FontCoordHolder { _ResUtil::CoordHolder size; _ResUtil::CoordHolder charSpace; + _ResUtil::CoordHolder sizeF; + _ResUtil::CoordHolder charSpaceF; _FontCoordHolder() { Reset(-1); + Reset(-1.0f); } void Reset(int _size) { size = _size; charSpace = 0; + sizeF = static_cast(_size); + charSpaceF = 0.0f; + } + + void Reset(float _size) + { + size = static_cast(_size); + charSpace = 0; + sizeF = _size; + charSpaceF = 0.0f; } }; @@ -122,10 +133,15 @@ _FontImpl::Construct(int style, int vcSize) IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); // convert VC -> PC - int pcSize = _ResUtil::ConvertToPhyCoordHeight(CONVERT_INTEGER_TO_26_6_FIXED_POINT(vcSize)); - if (vcSize > 0 && pcSize <= CONVERT_INTEGER_TO_26_6_FIXED_POINT(1)) + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(static_cast(vcSize))); + + if (vcSize > 0 && pcSize <= 1) { - pcSize = CONVERT_INTEGER_TO_26_6_FIXED_POINT(1); + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1); + pcSize = tmpSize; } result r = _pNativeFont->Construct(style, pcSize); @@ -142,10 +158,15 @@ _FontImpl::Construct(const Tizen::Base::String& fontName, int style, int vcSize, IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); // convert VC -> PC - int pcSize = _ResUtil::ConvertToPhyCoordHeight(CONVERT_INTEGER_TO_26_6_FIXED_POINT(vcSize)); - if (vcSize > 0 && pcSize <= CONVERT_INTEGER_TO_26_6_FIXED_POINT(1)) + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(static_cast(vcSize))); + + if (vcSize > 0 && pcSize <= 1) { - pcSize = CONVERT_INTEGER_TO_26_6_FIXED_POINT(1); + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1); + pcSize = tmpSize; } result r = _pNativeFont->Construct(fontName, style, pcSize, isPathEnabled); @@ -162,10 +183,90 @@ _FontImpl::Construct(const Tizen::Base::ByteBuffer& fontData, int style, int vcS IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); // convert VC -> PC - int pcSize = _ResUtil::ConvertToPhyCoordHeight(CONVERT_INTEGER_TO_26_6_FIXED_POINT(vcSize)); - if (vcSize > 0 && pcSize <= CONVERT_INTEGER_TO_26_6_FIXED_POINT(1)) + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(static_cast(vcSize))); + + if (vcSize > 0 && pcSize <= 1) + { + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1); + pcSize = tmpSize; + } + + result r = _pNativeFont->Construct(fontData, style, pcSize); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Failed to construct _Font", GetErrorMessage(r)); + + _pCoordHolder->Reset(vcSize); + + return E_SUCCESS; +} + +result +_FontImpl::Construct(int style, float vcSize) +{ + IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); + + // convert VC -> PC + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(vcSize)); + + if (vcSize > 0.0f && pcSize <= 1.0f) + { + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1.0f); + pcSize = tmpSize; + } + + result r = _pNativeFont->Construct(style, pcSize); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Failed to construct _Font", GetErrorMessage(r)); + + _pCoordHolder->Reset(vcSize); + + return E_SUCCESS; +} + +result +_FontImpl::Construct(const Tizen::Base::String& fontName, int style, float vcSize, bool isPathEnabled) +{ + IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); + + // convert VC -> PC + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(vcSize)); + + if (vcSize > 0.0f && pcSize <= 1.0f) + { + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1.0f); + pcSize = tmpSize; + } + + result r = _pNativeFont->Construct(fontName, style, pcSize, isPathEnabled); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Failed to construct _Font", GetErrorMessage(r)); + + _pCoordHolder->Reset(vcSize); + + return E_SUCCESS; +} + +result +_FontImpl::Construct(const Tizen::Base::ByteBuffer& fontData, int style, float vcSize) +{ + IF_NOT_INITIALIZED(return E_OUT_OF_MEMORY); + + // convert VC -> PC + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(vcSize)); + + if (vcSize > 0.0f && pcSize <= 1.0f) { - pcSize = CONVERT_INTEGER_TO_26_6_FIXED_POINT(1); + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1.0f); + pcSize = tmpSize; } result r = _pNativeFont->Construct(fontData, style, pcSize); @@ -189,41 +290,75 @@ _FontImpl::GetMaxHeight(void) const { IF_NOT_CONSTRUCTED(return -1); - int pcMaxHeight = _pNativeFont->GetMaxHeight(); + int pcMaxHeight = _pNativeFont->GetMaxHeight().ToInt(); int vcMaxHeight = _ResUtil::ConvertToVirCoordY(pcMaxHeight); return vcMaxHeight; } +float +_FontImpl::GetMaxHeightF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + float pcMaxHeight = _pNativeFont->GetMaxHeight().ToFloat(); + float vcMaxHeight = _ResUtil::ConvertToVirCoordY(pcMaxHeight); + + return vcMaxHeight; +} + int _FontImpl::GetMaxWidth(void) const { IF_NOT_CONSTRUCTED(return -1); - int pcMaxWidth = _pNativeFont->GetMaxWidth(); + int pcMaxWidth = _pNativeFont->GetMaxWidth().ToInt(); int vcMaxWidth = _ResUtil::ConvertToVirCoordX(pcMaxWidth); return vcMaxWidth; } +float +_FontImpl::GetMaxWidthF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + float pcMaxWidth = _pNativeFont->GetMaxWidth().ToFloat(); + float vcMaxWidth = _ResUtil::ConvertToVirCoordX(pcMaxWidth); + + return vcMaxWidth; +} + int _FontImpl::GetAscender(void) const { IF_NOT_CONSTRUCTED(return -1); - int pcAscender = _pNativeFont->GetAscender(); + int pcAscender = _pNativeFont->GetAscender().ToInt(); int vcAscender = _ResUtil::ConvertToVirCoordY(pcAscender); return vcAscender; } +float +_FontImpl::GetAscenderF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + float pcAscender = _pNativeFont->GetAscender().ToFloat(); + float vcAscender = _ResUtil::ConvertToVirCoordY(pcAscender); + + return vcAscender; +} + int _FontImpl::GetDescender(void) const { IF_NOT_CONSTRUCTED(return -1); - int pcDescender = _pNativeFont->GetDescender(); + int pcDescender = _pNativeFont->GetDescender().ToInt(); int vcDescender = _ResUtil::ConvertToVirCoordY(pcDescender); + if (vcDescender < 0) { vcDescender *= -1; @@ -232,16 +367,51 @@ _FontImpl::GetDescender(void) const return vcDescender; } +float +_FontImpl::GetDescenderF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + float pcDescender = _pNativeFont->GetDescender().ToFloat(); + float vcDescender = _ResUtil::ConvertToVirCoordY(pcDescender); + + if (vcDescender < 0.0f) + { + vcDescender *= -1.0f; + } + + return vcDescender; +} + result _FontImpl::GetLeftBear(wchar_t character, int& vcLeftBear) const { IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); - int pcLeftBear = 0; + _Util::FixedPoint22_10 pcLeftBear = 0; result r = _pNativeFont->GetLeftBear(character, pcLeftBear); // set outparam - vcLeftBear = _ResUtil::ConvertToVirCoordX(pcLeftBear); + if (r == E_SUCCESS) + { + vcLeftBear = _ResUtil::ConvertToVirCoordX(pcLeftBear.ToInt()); + } + + return r; +} + +result +_FontImpl::GetLeftBear(wchar_t character, float& vcLeftBear) const +{ + IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); + + _Util::FixedPoint22_10 pcLeftBear = 0; + result r = _pNativeFont->GetLeftBear(character, pcLeftBear); + + if (r == E_SUCCESS) + { + vcLeftBear = _ResUtil::ConvertToVirCoordX(pcLeftBear.ToFloat()); + } return r; } @@ -251,11 +421,30 @@ _FontImpl::GetRightBear(wchar_t character, int& vcRightBear) const { IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); - int pcRightBear = 0; + _Util::FixedPoint22_10 pcRightBear = 0; result r = _pNativeFont->GetRightBear(character, pcRightBear); // set outparam - vcRightBear = _ResUtil::ConvertToVirCoordX(pcRightBear); + if (r == E_SUCCESS) + { + vcRightBear = _ResUtil::ConvertToVirCoordX(pcRightBear.ToInt()); + } + + return r; +} + +result +_FontImpl::GetRightBear(wchar_t character, float& vcRightBear) const +{ + IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); + + _Util::FixedPoint22_10 pcRightBear = 0; + result r = _pNativeFont->GetRightBear(character, pcRightBear); + + if (r == E_SUCCESS) + { + vcRightBear = _ResUtil::ConvertToVirCoordX(pcRightBear.ToFloat()); + } return r; } @@ -268,7 +457,7 @@ _FontImpl::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& if (_ResUtil::NeedToConvertCoord()) { Dimension pcDim; - result r = _pNativeFont->GetTextExtent(text, length, pcDim); + result r = _pNativeFont->GetTextExtent(_Util::String(text.GetPointer(), text.GetLength(), 0, length), pcDim); if (IsSucceeded(r)) { @@ -279,10 +468,27 @@ _FontImpl::GetTextExtent(const Tizen::Base::String& text, int length, Dimension& } else { - return _pNativeFont->GetTextExtent(text, length, vcDim); + return _pNativeFont->GetTextExtent(_Util::String(text.GetPointer(), text.GetLength(), 0, length), vcDim); } } +result +_FontImpl::GetTextExtent(const Tizen::Base::String& text, int length, FloatDimension& vcDim) const +{ + IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); + + Dimension pcDim; + result r = _pNativeFont->GetTextExtent(_Util::String(text.GetPointer(), text.GetLength(), 0, length), pcDim); + + if (IsSucceeded(r)) + { + vcDim.width = _ResUtil::ConvertToVirCoord(static_cast(pcDim.width)); + vcDim.height = _ResUtil::ConvertToVirCoord(static_cast(pcDim.height)); + } + + return r; +} + bool _FontImpl::IsBold(void) const { @@ -328,14 +534,15 @@ _FontImpl::GetSize(void) const { IF_NOT_CONSTRUCTED(return -1); - if (_ResUtil::NeedToConvertCoord()) - { - return _pCoordHolder->size.required; - } - else - { - return _pNativeFont->GetSize(); - } + return _pCoordHolder->size.required; +} + +float +_FontImpl::GetSizeF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + return _pCoordHolder->sizeF.required; } void @@ -343,7 +550,9 @@ _FontImpl::SetStrikeOut(bool strikeOut) { IF_NOT_CONSTRUCTED(return); - return _pNativeFont->SetStrikeOut(strikeOut); + _pNativeFont->SetStrikeOut(strikeOut); + + return; } void @@ -351,7 +560,9 @@ _FontImpl::SetUnderline(bool underline) { IF_NOT_CONSTRUCTED(return); - return _pNativeFont->SetUnderline(underline); + _pNativeFont->SetUnderline(underline); + + return; } void @@ -365,7 +576,25 @@ _FontImpl::SetCharSpace(int vcSpace) // convert VC -> PC int pcSpace = _ResUtil::ConvertToPhyCoordWidth(vcSpace); - return _pNativeFont->SetCharSpace(pcSpace); + _pNativeFont->SetCharSpace(pcSpace); + + return; +} + +void +_FontImpl::SetCharSpace(float vcSpace) +{ + IF_NOT_CONSTRUCTED(return); + + // save it + _pCoordHolder->charSpaceF = vcSpace; + + // convert VC -> PC + float pcSpace = _ResUtil::ConvertToPhyCoordWidth(vcSpace); + + _pNativeFont->SetCharSpace(pcSpace); + + return; } int @@ -373,14 +602,15 @@ _FontImpl::GetCharSpace(void) const { IF_NOT_CONSTRUCTED(return 0); - if (_ResUtil::NeedToConvertCoord()) - { - return _pCoordHolder->charSpace.required; - } - else - { - return _pNativeFont->GetCharSpace(); - } + return _pCoordHolder->charSpace.required; +} + +float +_FontImpl::GetCharSpaceF(void) const +{ + IF_NOT_CONSTRUCTED(return 0.0f); + + return _pCoordHolder->charSpaceF.required; } Tizen::Base::String @@ -442,7 +672,7 @@ _FontImpl::GetTextExtent(int vcWidth, const Tizen::Base::String& text, int start { int pcWidth = _ResUtil::ToPhyCoordW(vcWidth); Dimension pcDim; - result r = _pNativeFont->GetTextExtent(pcWidth, text, startIndex, length, outline, count, pcDim); + result r = _pNativeFont->GetTextExtent(pcWidth, _Util::String(text.GetPointer(), text.GetLength(), startIndex, length), outline, count, pcDim); if (IsSucceeded(r)) { @@ -453,7 +683,7 @@ _FontImpl::GetTextExtent(int vcWidth, const Tizen::Base::String& text, int start } else { - return _pNativeFont->GetTextExtent(vcWidth, text, startIndex, length, outline, count, vcDim); + return _pNativeFont->GetTextExtent(vcWidth, _Util::String(text.GetPointer(), text.GetLength(), startIndex, length), outline, count, vcDim); } } @@ -469,7 +699,7 @@ _FontImpl::GetTextExtent(int vcWidth, const Tizen::Base::String& text, int start { int pcWidth = _ResUtil::ToPhyCoordW(vcWidth); Dimension pcDim; - result r = _pNativeFont->GetTextExtent(pcWidth, text, startIndex, length, outline, delimiter, count, pcDim); + result r = _pNativeFont->GetTextExtent(pcWidth, _Util::String(text.GetPointer(), text.GetLength(), startIndex, length), outline, delimiter, count, pcDim); if (IsSucceeded(r)) { @@ -480,7 +710,7 @@ _FontImpl::GetTextExtent(int vcWidth, const Tizen::Base::String& text, int start } else { - return _pNativeFont->GetTextExtent(vcWidth, text, startIndex, length, outline, delimiter, count, vcDim); + return _pNativeFont->GetTextExtent(vcWidth, _Util::String(text.GetPointer(), text.GetLength(), startIndex, length), outline, delimiter, count, vcDim); } } @@ -493,10 +723,16 @@ _FontImpl::SetSize(int vcSize) _pCoordHolder->Reset(vcSize); // convert VC -> PC - int pcSize = _ResUtil::ConvertToPhyCoordHeight(CONVERT_INTEGER_TO_26_6_FIXED_POINT(vcSize)); - if (vcSize > 0 && pcSize <= CONVERT_INTEGER_TO_26_6_FIXED_POINT(1)) + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(vcSize)); + + if (vcSize > 0 && pcSize <= 1) { - pcSize = CONVERT_INTEGER_TO_26_6_FIXED_POINT(1); + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1); + pcSize = tmpSize; + _pCoordHolder->size.phyCoord = pcSize; _pCoordHolder->size.virCoord = vcSize; } @@ -508,6 +744,35 @@ _FontImpl::SetSize(int vcSize) } result +_FontImpl::SetSize(float vcSize) +{ + IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); + SysTryReturnResult(NID_GRP, vcSize > 0.0f, E_INVALID_ARG, "font size should be greater than 0"); + + _pCoordHolder->Reset(vcSize); + + // convert VC -> PC + _Util::FixedPoint26_6 pcSize; + pcSize.SetConvertToFixedPoint(_ResUtil::ConvertToPhyCoordHeight(vcSize)); + + if (vcSize > 0.0f && pcSize <= 1.0f) + { + _Util::FixedPoint26_6 tmpSize; + + tmpSize.SetConvertToFixedPoint(1.0f); + pcSize = tmpSize; + + _pCoordHolder->sizeF.phyCoord = pcSize; + _pCoordHolder->sizeF.virCoord = vcSize; + } + + result r = _pNativeFont->SetSize(pcSize); + SysTryReturnResult(NID_GRP, r == E_SUCCESS, E_SYSTEM, "Failed to set the size of _Font"); + + return E_SUCCESS; +} + +result _FontImpl::SetStyle(int style) { IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED); @@ -533,12 +798,23 @@ _FontImpl::GetLeading(void) const { IF_NOT_CONSTRUCTED(return -1); - int pcLeading = _pNativeFont->GetLeading(); + int pcLeading = _pNativeFont->GetLeading().ToInt(); int vcLeading = _ResUtil::ConvertToVirCoordY(pcLeading); return vcLeading; } +float +_FontImpl::GetLeadingF(void) const +{ + IF_NOT_CONSTRUCTED(return -1.0f); + + float pcLeading = _pNativeFont->GetLeading().ToFloat(); + float vcLeading = _ResUtil::ConvertToVirCoordY(pcLeading); + + return vcLeading; +} + _FontImpl* _FontImpl::GetInstance(Font& font) { @@ -558,3 +834,40 @@ _FontImpl::UpdateDefaultFont(const Tizen::Base::String& key) } }} // Tizen::Graphics + + + +//////////////////////////////////////////////////////////////////////////////// +// +// Temporary code for test case +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "FGrp_FontUtil.h" + +namespace Tizen { namespace Graphics +{ + _OSP_EXPORT_ bool _TestGetTextExtentList(Tizen::Graphics::Font& font, const Tizen::Base::String& string, std::vector >& outList) + { + _Font* pInternalFont = GetFontEx(font); + _Util::String text(string.GetPointer(), string.GetLength()); + _Util::AccumList<_Util::Pair > outAccumList; + + if (pInternalFont->GetTextExtentList(text, outAccumList) != E_SUCCESS) + { + return false; + } + + outList.clear(); + + for (_Util::AccumList<_Util::Pair >::Iterator iter = outAccumList.Begin(); iter != outAccumList.End(); ++iter) + { + outList.push_back(std::make_pair(iter->first, iter->second)); + } + + return true; + } + +}} // Tizen::Graphics diff --git a/src/graphics/FGrp_FontMemoryManager.cpp b/src/graphics/FGrp_FontMemoryManager.cpp index adac645..49c29ab 100644 --- a/src/graphics/FGrp_FontMemoryManager.cpp +++ b/src/graphics/FGrp_FontMemoryManager.cpp @@ -31,17 +31,17 @@ namespace Tizen { namespace Graphics { -class CountBasedMemoryMgr +class _CountBasedMemoryMgr : public _FontMemoryManager::IMemoryAllocator { public: - CountBasedMemoryMgr(unsigned long size) + _CountBasedMemoryMgr(unsigned long size) : __maxCount(size) , __currentCount(0) { } - virtual ~CountBasedMemoryMgr(void) {} + virtual ~_CountBasedMemoryMgr(void) {} virtual void* Alloc(unsigned long size) { @@ -77,19 +77,19 @@ private: unsigned long __currentCount; }; -class SizeBasedMemoryMgr +class _SizeBasedMemoryMgr : public _FontMemoryManager::IMemoryAllocator { typedef unsigned long PtrDiffType; public: - SizeBasedMemoryMgr(unsigned long size) + _SizeBasedMemoryMgr(unsigned long size) : __maxMemory(size) , __currentUsedMemory(0) { } - virtual ~SizeBasedMemoryMgr(void) + virtual ~_SizeBasedMemoryMgr(void) { } @@ -136,15 +136,15 @@ private: unsigned long __currentUsedMemory; }; -class FixedSizeMemoryMgr +class _FixedSizeMemoryMgr : public _FontMemoryManager::IMemoryAllocator { public: - FixedSizeMemoryMgr(unsigned long size) + _FixedSizeMemoryMgr(unsigned long size) { } - virtual ~FixedSizeMemoryMgr(void) {} + virtual ~_FixedSizeMemoryMgr(void) {} virtual void* Alloc(unsigned long size) { @@ -168,13 +168,13 @@ _FontMemoryManager::_FontMemoryManager(_FontMemoryManager::Type type, int size) switch (type) { case _FontMemoryManager::TYPE_COUNT: - p = new (std::nothrow) CountBasedMemoryMgr(size); + p = new (std::nothrow) _CountBasedMemoryMgr(size); break; case _FontMemoryManager::TYPE_SIZE: - p = new (std::nothrow) SizeBasedMemoryMgr(size); + p = new (std::nothrow) _SizeBasedMemoryMgr(size); break; case _FontMemoryManager::TYPE_FIXED_MEMORY: - p = new (std::nothrow) FixedSizeMemoryMgr(size); + p = new (std::nothrow) _FixedSizeMemoryMgr(size); break; default: break; diff --git a/src/graphics/FGrp_FontRsrcManager.cpp b/src/graphics/FGrp_FontRsrcManager.cpp index aec2e73..f356d01 100644 --- a/src/graphics/FGrp_FontRsrcManager.cpp +++ b/src/graphics/FGrp_FontRsrcManager.cpp @@ -71,7 +71,7 @@ const int _DEFAULT_FONT_ENGINE = 0; const int _DEFAULT_FONT_FACE = 0; const char* _DEFAULT_SYSTEM_FONT = "DefaultSystemFont"; const char* _DEFAULT_SYSTEM_BOLD_FONT = "DefaultSystemBoldFont"; -const int _SYSTEM_DEFAULT_FONT_SIZE = 16 * 64; +const int _SYSTEM_DEFAULT_FONT_SIZE = 16; class _FontNull : public Tizen::Graphics::_IFont @@ -107,7 +107,12 @@ public: return 0; } - virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) const + virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) + { + return false; + } + + virtual bool GetFontSizeProperty(SizeProperty& sizeProperty) const { return false; } @@ -117,11 +122,16 @@ public: return false; } - virtual Tizen::Base::Collection::HashMapT* GetFallbackMap(void) + virtual FontMapT* GetFallbackMap(void) { return null; } + virtual bool IsEmoji(void) const + { + return false; + } + protected: virtual bool Create(const void* pBuffer, long bufSize, long face = 0) { @@ -150,12 +160,12 @@ protected: virtual void Destroy(void) {} - virtual bool FindCache(unsigned long character, int size, int style, Glyph** pOut) + virtual bool FindCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph** pOut) { return false; } - virtual bool AddCache(unsigned long character, int size, int style, Glyph* pGlyph) + virtual bool AddCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph* pGlyph) { return false; } @@ -193,8 +203,34 @@ public: } }; // _FontComparer -} +#ifdef USE_OTHER_CONTAINER + // nothing +#else +template +class _FontHashCodeProviderEx + : public IHashCodeProviderT +{ +public: + virtual int GetHashCode(const T& obj) const + { + return reinterpret_cast(obj.c_str()); + } +}; // _FontHashCodeProviderEx + +template +class _FontComparerEx + : public IComparerT +{ +public: + virtual result Compare(const T& obj1, const T& obj2, int& cmp) const + { + cmp = wcscmp((wchar_t*)obj1.c_str(), (wchar_t*)obj1.c_str()); + return E_SUCCESS; + } +}; // _FontComparerEx +#endif +} namespace Tizen { namespace Graphics { @@ -204,15 +240,21 @@ _FontRsrcManager* _FontRsrcManager::__pTheInstance = null; _FontRsrcManager::_FontRsrcManager() : __isAppFontListInitialized(false) { - static _FontHashCodeProvider fontHashCodeProvider; - static _FontComparer fontComparer; + static _FontHashCodeProvider fontHashCodeProvider; + static _FontComparer fontComparer; // are you worry about failing to construct? // but, HashMapT only can give E_SUCCESS/E_INVALID_ARG/E_OUT_OF_MEMORY. - // it means, if you have already verified input param, don't need to concern yourself. + // it means, if you ha2ve already verified input param, don't need to concern yourself. // even though you have E_OUT_OF_MEMORY, it's already out of our control, // and surely the other member function can give a error message. - __fontRsrcMap.Construct(0, 0, fontHashCodeProvider, fontComparer); +#ifdef USE_OTHER_CONTAINER + // nothing +#else + static _FontHashCodeProviderEx<_Util::WString> fontHashCodeProviderEx; + static _FontComparerEx<_Util::WString> fontComparerEx; + __fontRsrcMap.Construct(0, 0, fontHashCodeProviderEx, fontComparerEx); +#endif __appFontMap.Construct(0, 0, fontHashCodeProvider, fontComparer); __defaultSystemFontPath.Clear(); @@ -234,7 +276,12 @@ _FontRsrcManager::_FontRsrcManager() _FontRsrcManager::~_FontRsrcManager() { +#ifdef USE_OTHER_CONTAINER + __fontRsrcMap.clear(); +#else __fontRsrcMap.RemoveAll(); +#endif + __appFontMap.RemoveAll(); delete __pDefaultSystemFont; @@ -244,8 +291,10 @@ _FontRsrcManager::~_FontRsrcManager() } result -_FontRsrcManager::GetFont(const Tizen::Base::String& fontPath, int style, int size, SharedFontResource& out) +_FontRsrcManager::GetFont(const Tizen::Base::String& fontPath, int style, _Util::FixedPoint26_6 size, SharedFontResource& out) { + _Util::WString fontPathTemp(fontPath.GetPointer()); + SharedFontResource sharedFont; _IFont* pFont = null; @@ -276,7 +325,7 @@ _FontRsrcManager::GetFont(const Tizen::Base::String& fontPath, int style, int si // if we already have specified resoruce, // return it with increasing reference count //-------------------------------------------------------------------------- - rtn = __SearchFont(fontPath, sharedFont); + rtn = __SearchFont(fontPathTemp, sharedFont); if (rtn) { @@ -350,7 +399,7 @@ _FontRsrcManager::GetFont(const Tizen::Base::String& fontPath, int style, int si // // add newly created font resource to rsrc manager //-------------------------------------------------------------------------- - rtn = __AddFont(fontPath, sharedFont); + rtn = __AddFont(fontPathTemp, sharedFont); SysTryReturnResult(NID_GRP, rtn, E_SYSTEM, "Failed to add font resource into the shared container."); // set @@ -367,8 +416,10 @@ _FontRsrcManager::GetFont(const Tizen::Base::String& fontPath, int style, int si } result -_FontRsrcManager::GetTempFont(const Tizen::Base::String& fontPath, int style, int size, SharedFontResource& out) +_FontRsrcManager::GetTempFont(const Tizen::Base::String& fontPath, int style, _Util::FixedPoint26_6 size, SharedFontResource& out) { + _Util::WString fontPathTemp(fontPath.GetPointer()); + SharedFontResource sharedFont; _IFont* pFont = null; //_FontCache* pFontCache = null; @@ -400,7 +451,7 @@ _FontRsrcManager::GetTempFont(const Tizen::Base::String& fontPath, int style, in // if we already have specified resoruce, // return it with increasing reference count //-------------------------------------------------------------------------- - rtn = __SearchFont(fontPath, sharedFont); + rtn = __SearchFont(fontPathTemp, sharedFont); if (rtn) { @@ -450,7 +501,7 @@ _FontRsrcManager::GetTempFont(const Tizen::Base::String& fontPath, int style, in } result -_FontRsrcManager::AddFont(const Tizen::Base::String& fontPath, SharedFontResource& out) +_FontRsrcManager::AddFont(const _Util::WString& fontPath, SharedFontResource& out) { bool rtn = false; @@ -462,7 +513,7 @@ _FontRsrcManager::AddFont(const Tizen::Base::String& fontPath, SharedFontResourc bool -_FontRsrcManager::SearchFont(const Tizen::Base::String& fontName) +_FontRsrcManager::SearchFont(const _Util::WString& fontName) { SharedFontResource sharedFont; @@ -470,9 +521,8 @@ _FontRsrcManager::SearchFont(const Tizen::Base::String& fontName) } result -_FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, int size, SharedFontResource& out) +_FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, _Util::FixedPoint26_6 size, SharedFontResource& out) { - const char* pUserMemoryFont = "UserMemoryFont"; SharedFontResource sharedFont; _IFont* pFont = null; @@ -506,9 +556,13 @@ _FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, in // add newly created font resource to rsrc manager //-------------------------------------------------------------------------- static long long idx = 0; - String fontName(pUserMemoryFont); + + String fontName(L"UserMemoryFont"); fontName.Append(idx++); - rtn = __AddFont(fontName, sharedFont); + + _Util::WString fontNameTemp(fontName.GetPointer()); + + rtn = __AddFont(fontNameTemp, sharedFont); SysTryReturnResult(NID_GRP, rtn, E_SYSTEM, "Failed to add font resrouce into the shared container."); // set @@ -525,13 +579,15 @@ _FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, in } result -_FontRsrcManager::GetFont(int style, int size, SharedFontResource& out) +_FontRsrcManager::GetFont(int style, _Util::FixedPoint26_6 size, SharedFontResource& out) { SharedFontResource sharedFont; bool isBold = (style & FONT_STYLE_BOLD) ? true : false; String systemFontName = isBold ? _DEFAULT_SYSTEM_BOLD_FONT : _DEFAULT_SYSTEM_FONT; + _Util::WString systemFontNameTemp(systemFontName.GetPointer()); + _IFont* pFont = null; bool rtn = false; @@ -541,7 +597,7 @@ _FontRsrcManager::GetFont(int style, int size, SharedFontResource& out) // if we already have specified resoruce, // return it with increasing reference count //-------------------------------------------------------------------------- - rtn = __SearchFont(systemFontName, sharedFont); + rtn = __SearchFont(systemFontNameTemp, sharedFont); if (rtn) { @@ -618,7 +674,7 @@ _FontRsrcManager::GetFont(int style, int size, SharedFontResource& out) // // add newly created font resource to rsrc manager //-------------------------------------------------------------------------- - rtn = __AddFont(systemFontName, sharedFont); + rtn = __AddFont(systemFontNameTemp, sharedFont); SysTryReturnResult(NID_GRP, rtn, E_SYSTEM, "Failed to add font resource into the shared container"); // set @@ -635,7 +691,7 @@ _FontRsrcManager::GetFont(int style, int size, SharedFontResource& out) } result -_FontRsrcManager::GetSystemFont(const Tizen::Base::String& fontName, int style, int size, SharedFontResource& out) +_FontRsrcManager::GetSystemFont(const Tizen::Base::String& fontName, int style, _Util::FixedPoint26_6 size, SharedFontResource& out) { FcPattern *pFontPattern = null; FcFontSet *pFontSet = null; @@ -651,8 +707,8 @@ _FontRsrcManager::GetSystemFont(const Tizen::Base::String& fontName, int style, } std::auto_ptr utfString(pBuffer); - FcBool rtn = FcInitReinitialize(); - SysTryCatch(NID_GRP, rtn != FcFalse, , r, "[E_SYSTEM] Failed to init fontconfig"); + //FcBool rtn = FcInitReinitialize(); + //SysTryCatch(NID_GRP, rtn != FcFalse, , r, "[E_SYSTEM] Failed to init fontconfig"); pFontPattern = FcPatternBuild(NULL, FC_STYLE, FcTypeString, (FcChar8*)fcStyle, NULL); SysTryCatch(NID_GRP, pFontPattern, , r, "[E_SYSTEM] Failed to FcPatternBuild()"); @@ -804,22 +860,38 @@ _FontRsrcManager::__CreateStaticFont(int fontEngine, const void* pBuffer, long b } bool -_FontRsrcManager::__SearchFont(const String& fontPath, SharedFontResource& out) const +_FontRsrcManager::__SearchFont(const _Util::WString& fontPath, SharedFontResource& out) const { // check input param SysTryReturn(NID_GRP, out.get() == null, false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid out param is given"); - return (__fontRsrcMap.GetValue(const_cast (fontPath), out) == E_SUCCESS); +#ifdef USE_OTHER_CONTAINER + FontMapT::const_iterator fontIterator = __fontRsrcMap.find(fontPath); + + if (fontIterator != __fontRsrcMap.end()) + { + out = fontIterator->second; + return true; + } + + return false; +#else + return (__fontRsrcMap.GetValue(fontPath, out) == E_SUCCESS); +#endif } bool -_FontRsrcManager::__AddFont(const String& key, const SharedFontResource& font) +_FontRsrcManager::__AddFont(const _Util::WString& key, const SharedFontResource& font) { // check input param SysTryReturn(NID_GRP, font.get() != null, false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid input param is given"); +#ifdef USE_OTHER_CONTAINER + __fontRsrcMap[key] = font; +#else result r = __fontRsrcMap.Add(key, font); SysTryReturn(NID_GRP, r == E_SUCCESS, false, false, "[%s] Failed to add font into resource pool", GetErrorMessage(r)); +#endif return true; } @@ -827,13 +899,35 @@ _FontRsrcManager::__AddFont(const String& key, const SharedFontResource& font) void _FontRsrcManager::__RemoveUnusedFont(void) { - ArrayListT keys; + ArrayListT<_Util::WString> keys; String systemFontName(_DEFAULT_SYSTEM_FONT); String systemBoldFontName(_DEFAULT_SYSTEM_BOLD_FONT); + _Util::WString systemFontNameTemp(systemFontName.GetPointer()); + _Util::WString systemBoldFontNameTemp(systemBoldFontName.GetPointer()); + // find out unused font + +#ifdef USE_OTHER_CONTAINER + { + for (FontMapT::iterator fontIterator = __fontRsrcMap.begin(); fontIterator != __fontRsrcMap.end(); ++fontIterator) + { + SharedFontResource font(fontIterator->second); + + if (font != null && font.use_count() == 2) + { + _Util::WString key(fontIterator->first); + + if (key != systemFontNameTemp && key != systemBoldFontNameTemp) + { + keys.Add(key); + } + } + } + } +#else { - std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); + std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); result r = GetLastResult(); SysTryReturnVoidResult(NID_GRP, enumerator.get() != null, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -844,32 +938,37 @@ _FontRsrcManager::__RemoveUnusedFont(void) if (r == E_SUCCESS && font.use_count() == 2) { - String key; + _Util::WString key(L""); r = enumerator->GetKey(key); - if (r == E_SUCCESS && (key != systemFontName && key != systemBoldFontName)) + if (r == E_SUCCESS && (key != systemFontNameTemp && key != systemBoldFontNameTemp)) { keys.Add(key); } } } } +#endif // remove if (keys.GetCount() > 0) { - std::auto_ptr > enumerator(keys.GetEnumeratorN()); + std::auto_ptr > enumerator(keys.GetEnumeratorN()); result r = GetLastResult(); SysTryReturnVoidResult(NID_GRP, enumerator.get() != null, r, "[%s] Propagating.", GetErrorMessage(r)); while (enumerator->MoveNext() == E_SUCCESS) { - String key; + _Util::WString key(L""); r = enumerator->GetCurrent(key); if (r == E_SUCCESS) { +#ifdef USE_OTHER_CONTAINER + __fontRsrcMap.erase(key); +#else __fontRsrcMap.Remove(key); +#endif } } } @@ -881,7 +980,7 @@ bool _FontRsrcManager::__ReloadFont(String fontName, bool isBold) { SharedFontResource sharedFont; - String systemFontName(fontName); + _Util::WString systemFontName(fontName.GetPointer()); _IFont* pFont = null; bool rtn = false; @@ -944,6 +1043,9 @@ _FontRsrcManager::__ReloadFont(String fontName, bool isBold) bool _FontRsrcManager::ReloadDefaultSystemFont(void) { + // reinitialize fontconfig library + FcInitReinitialize(); + String systemFontName; systemFontName = _DEFAULT_SYSTEM_FONT; @@ -971,7 +1073,10 @@ _FontRsrcManager::GetDefaultSystemFont(void) if (font.get()) { - result r = font->Construct(FONT_STYLE_PLAIN, _SYSTEM_DEFAULT_FONT_SIZE); + _Util::FixedPoint26_6 defaultSize; + defaultSize.SetConvertToFixedPoint(_SYSTEM_DEFAULT_FONT_SIZE); + + result r = font->Construct(FONT_STYLE_PLAIN, defaultSize); if (r == E_SUCCESS) { @@ -1001,8 +1106,8 @@ _FontRsrcManager::__GetFontPath(bool isBold) FcPattern* pFontPattern = null; const char* fcStyle = isBold ? "Bold" : "Regular"; // initialize fontconfig library - FcBool rtn = FcInitReinitialize(); - SysTryCatch(NID_GRP, rtn != FcFalse, , E_SYSTEM, "[E_SYSTEM] Failed to init fontconfig"); + //FcBool rtn = FcInitReinitialize(); + //SysTryCatch(NID_GRP, rtn != FcFalse, , E_SYSTEM, "[E_SYSTEM] Failed to init fontconfig"); // create pattern pFontPattern = FcPatternCreate(); @@ -1098,8 +1203,19 @@ bool _FontRsrcManager::RemoveMemory(unsigned long requestedSize) { #ifdef USE_REMOVE_ALL_CACHE + +#ifdef USE_OTHER_CONTAINER + for (FontMapT::iterator fontIterator = __fontRsrcMap.begin(); fontIterator != __fontRsrcMap.end(); ++fontIterator) + { + SharedFontResource fontRsrc(fontIterator->second); + + fontRsrc.get()->CleanCache(); + } + + return true; +#else result r = E_SUCCESS; - std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); + std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); while (enumerator->MoveNext() == E_SUCCESS) { @@ -1110,6 +1226,8 @@ _FontRsrcManager::RemoveMemory(unsigned long requestedSize) } return true; +#endif + #else unsigned long remainedMemory = 0; result r = E_SUCCESS; @@ -1117,8 +1235,9 @@ _FontRsrcManager::RemoveMemory(unsigned long requestedSize) ArrayListT keys; String systemFontName(_DEFAULT_SYSTEM_FONT); + _Util::WString systemFontNameTemp(systemFontName.GetPointer()); - std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); + std::auto_ptr > enumerator(__fontRsrcMap.GetMapEnumeratorN()); while (enumerator->MoveNext() == E_SUCCESS) { @@ -1127,9 +1246,9 @@ _FontRsrcManager::RemoveMemory(unsigned long requestedSize) break; } - String key; + _Util::WString key; r = enumerator->GetKey(key); - if (r == E_SUCCESS/* && key != systemFontName*/) + if (r == E_SUCCESS/* && key != systemFontNameTemp*/) { SharedFontResource fontRsrc; r = enumerator->GetValue(fontRsrc); @@ -1156,11 +1275,12 @@ _FontRsrcManager::RemoveMemory(unsigned long requestedSize) Tizen::Base::String _FontRsrcManager::FindAppFontName(const Tizen::Base::String& fontName) { - Tizen::Base::String fontPath = L""; + String fontPath(L""); if (__isAppFontListInitialized) { - __appFontMap.GetValue(const_cast (fontName), fontPath); + __appFontMap.GetValue(fontName, fontPath); + return fontPath; } else @@ -1180,6 +1300,7 @@ _FontRsrcManager::FindAppFontName(const Tizen::Base::String& fontName) // Reads all the directory entries pDirEnum = dir.ReadN(); + if (!pDirEnum) { return fontPath; @@ -1193,11 +1314,13 @@ _FontRsrcManager::FindAppFontName(const Tizen::Base::String& fontName) String name; String token; DirEntry entry = pDirEnum->GetCurrentDirEntry(); - Tizen::Base::Utility::StringTokenizer formatTok(entry.GetName(), "."); + Tizen::Base::Utility::StringTokenizer formatTok(entry.GetName(), L"."); + while (formatTok.GetTokenCount()) { formatTok.GetNextToken(token); } + if (entry.IsDirectory() == false) { name.Append(dirName); @@ -1215,7 +1338,8 @@ _FontRsrcManager::FindAppFontName(const Tizen::Base::String& fontName) __isAppFontListInitialized = true; - __appFontMap.GetValue(const_cast (fontName), fontPath); + __appFontMap.GetValue(fontName, fontPath); + return fontPath; } } diff --git a/src/graphics/FGrp_FontRsrcManager.h b/src/graphics/FGrp_FontRsrcManager.h index 5e01770..dcea55e 100644 --- a/src/graphics/FGrp_FontRsrcManager.h +++ b/src/graphics/FGrp_FontRsrcManager.h @@ -27,6 +27,12 @@ #include #include +#define USE_OTHER_CONTAINER + +#ifdef USE_OTHER_CONTAINER + #include +#endif + #include #include #include @@ -34,7 +40,6 @@ #include "FGrp_FontMemoryManager.h" #include "util/FGrp_UtilTemplate.h" - namespace Tizen { namespace Graphics { @@ -46,18 +51,23 @@ class _FontRsrcManager { public: typedef std::tr1::shared_ptr<_IFont> SharedFontResource; +#ifdef USE_OTHER_CONTAINER + typedef std::tr1::unordered_map<_Util::WString, SharedFontResource> FontMapT; +#else + typedef Tizen::Base::Collection::HashMapT <_Util::WString, SharedFontResource> FontMapT; +#endif virtual ~_FontRsrcManager(void); - result GetFont(const Tizen::Base::String& fontPath, int style, int size, SharedFontResource& out); - result GetFont(const byte* pFontData, int fontDataSize, int style, int size, SharedFontResource& out); - result GetFont(int style, int size, SharedFontResource& out); + result GetFont(const Tizen::Base::String& fontPath, int style, _Util::FixedPoint26_6 size, SharedFontResource& out); + result GetFont(const byte* pFontData, int fontDataSize, int style, _Util::FixedPoint26_6 size, SharedFontResource& out); + result GetFont(int style, _Util::FixedPoint26_6 size, SharedFontResource& out); - result GetSystemFont(const Tizen::Base::String& fontName, int style, int size, SharedFontResource& out); + result GetSystemFont(const Tizen::Base::String& fontName, int style, _Util::FixedPoint26_6 size, SharedFontResource& out); - result GetTempFont(const Tizen::Base::String& fontPath, int style, int size, SharedFontResource& out); - result AddFont(const Tizen::Base::String& fontPath, SharedFontResource& out); - bool SearchFont(const Tizen::Base::String& fontName); + result GetTempFont(const Tizen::Base::String& fontPath, int style, _Util::FixedPoint26_6 size, SharedFontResource& out); + result AddFont(const _Util::WString& fontPath, SharedFontResource& out); + bool SearchFont(const _Util::WString& fontName); bool ReloadDefaultSystemFont(void); _FontMemoryManager& GetMemoryManager(void); @@ -76,8 +86,8 @@ private: bool __CreateFont(int fontEngine, const void* pBuffer, long bufSize, long face, _IFont** pOut); bool __CreateFont(int fontEngine, const char* filePath, long face, _IFont** pOut); bool __CreateStaticFont(int fontEngine, const void* pBuffer, long bufSize, long face, _IFont** pOut); - bool __SearchFont(const Tizen::Base::String& fontName, SharedFontResource& out) const; - bool __AddFont(const Tizen::Base::String& key, const SharedFontResource& font); + bool __SearchFont(const _Util::WString& fontName, SharedFontResource& out) const; + bool __AddFont(const _Util::WString& key, const SharedFontResource& font); void __RemoveUnusedFont(void); long __GetMaxFontEngine(void) const; const Tizen::Base::String& __GetDefaultSystemFontPath(bool isBold); @@ -87,7 +97,7 @@ private: static void __InitFontRsrcManager(void); private: - Tizen::Base::Collection::HashMapT __fontRsrcMap; + FontMapT __fontRsrcMap; Tizen::Base::Collection::HashMapT __appFontMap; Tizen::Base::String __defaultSystemFontPath; diff --git a/src/graphics/FGrp_IFont.h b/src/graphics/FGrp_IFont.h index 6d36556..1d3afa0 100644 --- a/src/graphics/FGrp_IFont.h +++ b/src/graphics/FGrp_IFont.h @@ -27,11 +27,16 @@ #include #include +#define USE_OTHER_CONTAINER + +#ifdef USE_OTHER_CONTAINER +#include +#endif + #include #include "util/FGrp_UtilType.h" - namespace Tizen { namespace Graphics { @@ -40,6 +45,13 @@ class _FontRsrcManager; class _IFont { public: + typedef std::tr1::shared_ptr<_IFont> SharedFontResource; +#ifdef USE_OTHER_CONTAINER + typedef std::tr1::unordered_map<_Util::WString, SharedFontResource> FontMapT; +#else + typedef Tizen::Base::Collection::HashMapT <_Util::WString, SharedFontResource> FontMapT; +#endif + //! Enumerated definition of the font style. enum Style { @@ -75,12 +87,12 @@ public: //! Attrib structure struct Attrib { - long size; //!< Size of the font. (26.6 fixed point unit) + _Util::FixedPoint26_6 size; //!< Size of the font. (26.6 fixed point unit) unsigned int style; //!< Style of the font. (_IFont::Style) int quality; //!< Quality of the font. (_IFont::Quality) float angle; //!< Angle of the font. long xExpansion; //!< Expansion of the font. - long boldWeight; //!< Bold weight of the font + _Util::FixedPoint26_6 boldWeight; //!< Bold weight of the font }; //! GlyphBitmap structure @@ -97,38 +109,44 @@ public: struct Glyph { unsigned long id; //!< Internal identifier of the font. - long xOffset; //!< Starting point of displaying the font. - long yOffset; //!< Starting point of displaying the font. - long xAdvance; //!< Distance to move for displaying the next font. - long yAdvance; //!< Distance to move for displaying the next font. + _Util::FixedPoint22_10 xOffset; //!< Starting point of displaying the font. + _Util::FixedPoint22_10 yOffset; //!< Starting point of displaying the font. + _Util::FixedPoint22_10 xAdvance; //!< Distance to move for displaying the next font. + _Util::FixedPoint22_10 yAdvance; //!< Distance to move for displaying the next font. long hasOwnerShip; GlyphBitmap image; //!< Image information of a glyph. void* ptrAux; //!< Internal data for each target. }; - //! Property structure + //! Size Property structure + struct SizeProperty + { + _Util::FixedPoint26_6 minSize; //!< Minimal size of the supportable font. + _Util::FixedPoint26_6 maxSize; //!< Maximal size of the supportable font. + + _Util::FixedPoint26_6 maxWidth; //!< Maximal width of this font data. + _Util::FixedPoint26_6 maxHeight; //!< Maximal height of this font data. + _Util::FixedPoint26_6 baseLine; //!< BaseLine of this font data. + _Util::FixedPoint26_6 ascender; //!< Ascender of this font data. + _Util::FixedPoint26_6 descender; //!< Descender of this font data. + _Util::FixedPoint26_6 leading; //!< Leading of this font data. + }; + + //! Font Property structure struct Property { int fontCaps; //!< Flag for the font capability. (_IFont::Capability) int styleCaps; //!< Flag for the font style capability. (_IFont::Style) - unsigned long minSize; //!< Minimal size of the supportable font. - unsigned long maxSize; //!< Maximal size of the supportable font. const char* pEngineName; //!< Name of the font engine. const char* pFamilyName; //!< Name of the font family. const char* pStyleName; //!< Name of the font style. - long maxWidth; //!< Maximal width of this font data. - long maxHeight; //!< Maximal height of this font data. - long baseLine; //!< BaseLine of this font data. - long ascender; //!< Ascender of this font data. - long descender; //!< Descender of this font data. - long leading; //!< Leading of this font data. + long styleFlag; //!< flag value of the font style. (Regular = 0, Bold = 2) + long weightClass; //!< Value of the font WeightClass. }; virtual ~_IFont(void) {} - typedef std::tr1::shared_ptr<_IFont> SharedFontResource; - //! Changes the attribute using fontAttrib. virtual bool SetAttrib(const Attrib& fontAttrib) = 0; //! Gets current attribute and store it in fontAttrib. @@ -145,13 +163,16 @@ public: virtual unsigned long CheckGlyph(unsigned long character) = 0; //! Gets the support range and the property for this font engine. + virtual bool GetFontSizeProperty(SizeProperty& sizeProperty) const = 0; virtual bool GetFontProperty(Property& property) const = 0; //! Harfbuzz test - virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT& out, bool isRtl, int script) const = 0; + virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT& out, bool isRtl, int script) = 0; //! Gets the font fallback map. - virtual Tizen::Base::Collection::HashMapT* GetFallbackMap(void) = 0; + virtual FontMapT* GetFallbackMap(void) = 0; + + virtual bool IsEmoji(void) const = 0; protected: //! Initializes a font instance with the font data on the memory buffer. @@ -167,9 +188,9 @@ protected: //! Destroys the instance. virtual void Destroy(void) = 0; //! Finds glyph in the cache - virtual bool FindCache(unsigned long character, int size, int style, Glyph** pOut) = 0; + virtual bool FindCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph** pOut) = 0; //! Adds glyph in the cache - virtual bool AddCache(unsigned long character, int size, int style, Glyph* pGlyph) = 0; + virtual bool AddCache(unsigned long character, _Util::FixedPoint26_6 size, int style, Glyph* pGlyph) = 0; //! Clean cache virtual bool CleanCache(void) = 0; @@ -177,12 +198,6 @@ private: friend class _FontRsrcManager; }; // _IFont -struct _FontResource -{ - std::auto_ptr<_IFont> first; - //std::auto_ptr<_FontCache> second; -}; - }} // Tizen::Graphics #endif // _FGRP_INTERNAL_IFONT_H_ diff --git a/src/graphics/FGrp_NonScale.cpp b/src/graphics/FGrp_NonScale.cpp old mode 100644 new mode 100755 index 206cc59..701da40 --- a/src/graphics/FGrp_NonScale.cpp +++ b/src/graphics/FGrp_NonScale.cpp @@ -37,20 +37,20 @@ namespace // unnamed { -Tizen::Graphics::_BitmapCoordHolder* -_GetBitmapCoordHolder(const Tizen::Graphics::_BitmapImpl& bitmap) +Tizen::Graphics::_BitmapCoordinateHolder* +_GetBitmapCoordinateHolder(const Tizen::Graphics::_BitmapImpl& bitmap) { class BitmapHacked : public Tizen::Graphics::_BitmapImpl { public: - inline Tizen::Graphics::_BitmapCoordHolder* GetBitmapCoordHolder(void) + inline Tizen::Graphics::_BitmapCoordinateHolder* GetBitmapCoordinateHolder(void) { return this->_sharedItem->coordHolder.get(); } }; - return ((BitmapHacked*) &bitmap)->GetBitmapCoordHolder(); + return ((BitmapHacked*) &bitmap)->GetBitmapCoordinateHolder(); } } @@ -59,24 +59,25 @@ namespace Tizen { namespace Graphics { _BitmapImpl* -_NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& rq_dim, BitmapPixelFormat pixelFormat) +_NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& rqDim, BitmapPixelFormat pixelFormat) { - Dimension vc_dim = _ResUtil::ConvertToVirCoord(rq_dim); + FloatDimension pcDimF(static_cast(rqDim.width), static_cast(rqDim.height)); + FloatDimension vcDimF = _ResUtil::ConvertToVirCoord(pcDimF); - return _NonScale::CreateBitmapN(buffer, rq_dim, pixelFormat, vc_dim); + return _NonScale::CreateBitmapN(buffer, rqDim, pixelFormat, vcDimF); } _BitmapImpl* -_NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& rq_dim, BitmapPixelFormat pixelFormat, - const Dimension& logicalSize) +_NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& rqDim, BitmapPixelFormat pixelFormat, + const FloatDimension& logicalSizeF) { result r = E_SUCCESS; SysTryReturn(NID_GRP - , rq_dim.width > 0 && rq_dim.height > 0 + , rqDim.width > 0 && rqDim.height > 0 , null , E_INVALID_ARG - , "[E_INVALID_ARG] The reqired size(%d, %d) is invalid.", rq_dim.width, rq_dim.height); + , "[E_INVALID_ARG] The reqired size(%d, %d) is invalid.", rqDim.width, rqDim.height); SysTryReturn(NID_GRP , BITMAP_PIXEL_FORMAT_MIN < pixelFormat && pixelFormat < BITMAP_PIXEL_FORMAT_MAX @@ -108,7 +109,7 @@ _NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& , "[E_UNSUPPORTED_FORMAT] The given bytes-per-pixel(%d) is not supported.", bytePerPixel); int numOfBytes = buffer.GetLimit(); - int expectedBufferSize = rq_dim.width * rq_dim.height * bytePerPixel; + int expectedBufferSize = rqDim.width * rqDim.height * bytePerPixel; SysTryReturn(NID_GRP , expectedBufferSize <= numOfBytes @@ -125,7 +126,7 @@ _NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& , E_OUT_OF_MEMORY , "[E_OUT_OF_MEMORY] _BitmapImpl is not allocated."); - _Bitmap* pBitmapEx = GetBitmapEx(*bitmap.get()); + _Bitmap* pBitmapEx = _GetBitmapEx(*bitmap.get()); SysTryReturn(NID_GRP , pBitmapEx @@ -133,40 +134,23 @@ _NonScale::CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& , E_OUT_OF_MEMORY , "[E_OUT_OF_MEMORY] _Bitmap is not allocated."); - if (_ResUtil::NeedToConvertCoord()) - { - r = pBitmapEx->Construct(buffer, rq_dim, pixelFormat); - - SysTryReturn(NID_GRP - , !IsFailed(r) - , null - , r - , "[%s] _Bitmap::Construct() failed.", GetErrorMessage(r)); + r = pBitmapEx->Construct(buffer, rqDim, pixelFormat); - Dimension pc_dim = rq_dim; - Dimension vc_dim = logicalSize; - - _ResUtil::Rect vc_rect(0, 0, vc_dim.width, vc_dim.height); - _ResUtil::Rect pc_rect(0, 0, pc_dim.width, pc_dim.height); + SysTryReturn(NID_GRP + , !IsFailed(r) + , null + , r + , "[%s] _Bitmap::Construct() failed.", GetErrorMessage(r)); - _BitmapCoordHolder* pBitmapCoordHolder = _GetBitmapCoordHolder(*bitmap.get()); + _BitmapCoordinateHolder* pBitmapCoordinateHolder = _GetBitmapCoordinateHolder(*bitmap.get()); - if (pBitmapCoordHolder) - { - pBitmapCoordHolder->bitmapSize.required = vc_rect; - pBitmapCoordHolder->bitmapSize.phyCoord = pc_rect; - pBitmapCoordHolder->bitmapSize.virCoord = vc_rect; - } - } - else + if (pBitmapCoordinateHolder) { - r = pBitmapEx->Construct(buffer, rq_dim, pixelFormat); + _Util::Dimension vcDimF = { logicalSizeF.width, logicalSizeF.height }; + _Util::Dimension vcDim = { _FloatToIntForSize(vcDimF.w), _FloatToIntForSize(vcDimF.h) }; + _Util::Dimension pcDim = { rqDim.width, rqDim.height }; - SysTryReturn(NID_GRP - , !IsFailed(r) - , null - , r - , "[%s] _Bitmap::Construct() failed.", GetErrorMessage(r)); + pBitmapCoordinateHolder->ResetFromPc(pcDim, vcDim, vcDimF); } return bitmap.release(); diff --git a/src/graphics/FGrp_ResUtil.h b/src/graphics/FGrp_ResUtil.h old mode 100644 new mode 100755 index f83f677..2ea91ea --- a/src/graphics/FGrp_ResUtil.h +++ b/src/graphics/FGrp_ResUtil.h @@ -26,6 +26,8 @@ #include +#include + #include #include #include @@ -1032,6 +1034,48 @@ ToPhyCoord(const _Util::Point& sour) } template<> +inline _Util::Point +ToPhyCoord(const _Util::Point& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer) + { + _Util::Point temp = + { + sour.x * float(pTransformer->GetHorizontalScaleFactor()), + sour.y * float(pTransformer->GetVerticalScaleFactor()) + }; + + return temp; + } + else + { + return sour; + } +} + +template<> +inline _Util::Dimension +ToPhyCoord(const _Util::Dimension& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer == null) + { + return sour; + } + + _Util::Dimension dest = + { + pTransformer->TransformHorizontal(sour.w), + pTransformer->TransformVertical(sour.h) + }; + + return dest; +} + +template<> inline _Util::Dimension ToPhyCoord(const _Util::Dimension& sour) { @@ -1054,6 +1098,50 @@ ToPhyCoord(const _Util::Dimension& sour) } template<> +inline _Util::Dimension +ToPhyCoord(const _Util::Dimension& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer) + { + _Util::Dimension temp = + { + sour.w * float(pTransformer->GetHorizontalScaleFactor()), + sour.h * float(pTransformer->GetVerticalScaleFactor()) + }; + + return temp; + } + else + { + return sour; + } +} + +template<> +inline _Util::Rectangle +ToPhyCoord(const _Util::Rectangle& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer == null) + { + return sour; + } + + _Util::Rectangle dest = + { + pTransformer->TransformHorizontal(sour.x), + pTransformer->TransformVertical(sour.y), + pTransformer->TransformHorizontal(sour.w), + pTransformer->TransformVertical(sour.h) + }; + + return dest; +} + +template<> inline _Util::Rectangle ToPhyCoord(const _Util::Rectangle& sour) { @@ -1078,6 +1166,30 @@ ToPhyCoord(const _Util::Rectangle& sour) } template<> +inline _Util::Rectangle +ToPhyCoord(const _Util::Rectangle& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetTransformer(); + + if (pTransformer) + { + _Util::Rectangle temp = + { + sour.x * float(pTransformer->GetHorizontalScaleFactor()), + sour.y * float(pTransformer->GetVerticalScaleFactor()), + sour.w * float(pTransformer->GetHorizontalScaleFactor()), + sour.h * float(pTransformer->GetVerticalScaleFactor()) + }; + + return temp; + } + else + { + return sour; + } +} + +template<> inline Rect ToPhyCoord(const Rect& sour) { @@ -1145,6 +1257,25 @@ ToVirCoord(const Pos& sour) return Pos(point2.x, point2.y); } +template<> +inline _Util::Dimension +ToVirCoord(const _Util::Dimension& sour) +{ + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetInstance()->GetInverseTransformer(); + + if (pTransformer == null) + { + return sour; + } + + Dimension dim1(sour.w, sour.h); + Dimension dim2 = pTransformer->Transform(dim1); + + _Util::Dimension temp = { dim2.width, dim2.height }; + + return temp; +} + //////////////////////////////////////////////////////////////////////////////// template @@ -1326,8 +1457,44 @@ struct CoordHolder } }; +template +struct CoordinateHolder +{ + FloatType vcFloat; + FloatType vcFloatActual; + IntType vcInt; + IntType pcInt; +}; + +template +struct CoordinateHolderSimple +{ + FloatType vcFloat; + IntType vcInt; +}; + } // _ResUtil +//////////////////////////////////////////////////////////////////////////////// + +inline int _FloatToIntForPos(float f) +{ + return static_cast(floorf(f)); +} + +inline int _FloatToIntForSize(float f) +{ + if (f > 0.0f) + { + int i = static_cast(f); + return (i > 0) ? i : 1; + } + else + { + return 0; + } +} + }} // Tizen::Graphics #endif diff --git a/src/graphics/FGrp_TextElementImpl.cpp b/src/graphics/FGrp_TextElementImpl.cpp index 40fc863..e228dc2 100644 --- a/src/graphics/FGrp_TextElementImpl.cpp +++ b/src/graphics/FGrp_TextElementImpl.cpp @@ -935,7 +935,7 @@ _TextElementImpl::CreateAutoLink(const Tizen::Base::String& text, unsigned long { TextLinkInfo* pCurrent = pTextLinkInfo; pTextLinkInfo = pTextLinkInfo->pNextLinkInfo; - free(pCurrent); + delete pCurrent; } if (pParser) diff --git a/src/graphics/effect/FGrp_Effect.h b/src/graphics/effect/FGrp_Effect.h old mode 100644 new mode 100755 index f5a6814..d3e93f4 --- a/src/graphics/effect/FGrp_Effect.h +++ b/src/graphics/effect/FGrp_Effect.h @@ -70,7 +70,7 @@ bool RotateImage(Tizen::Graphics::_Util::Pixmap& dstImage, long xDest, long yDes bool DrawImageWithAlpha(Tizen::Graphics::_Util::Pixmap& dstImage, long xDest, long yDest, const Tizen::Graphics::_Util::Pixmap& srcImage, long constantAlpha); -bool IsNinePatchedBitmap(const Tizen::Graphics::_Util::Pixmap& dstImage); +bool IsNinePatchedBitmap(const Tizen::Graphics::_Util::Pixmap& dstImage, bool checkStrictly); bool IsOpaqueAllOver(const Tizen::Graphics::_Util::Pixmap& dstImage); diff --git a/src/graphics/effect/FGrp_EffectManip.cpp b/src/graphics/effect/FGrp_EffectManip.cpp old mode 100644 new mode 100755 index abc4568..d3c89df --- a/src/graphics/effect/FGrp_EffectManip.cpp +++ b/src/graphics/effect/FGrp_EffectManip.cpp @@ -111,11 +111,98 @@ _IsNinePatched(const _Util::Pixmap& dstImage, Pixel dummy) return true; } +template +bool +_IsNinePatchedStrictly(const _Util::Pixmap& dstImage, Pixel dummy) +{ + // >> condition + // 1. Bitmap pixel format should be ARGB8888 + // 2. Topmost horizontal line must have a pixel(s) of 0xFF000000 + // 3. Leftmost vertical line must have a pixel(s) of 0xFF000000 + // 4. Topmost horizontal line and Leftmost vertical line must be composed of only 0xFF000000 and 0x00?????? (00 <= ?? <= FF) + + enum + { + KEY = _NinePatchedKey ::KEY + }; + + // assert(dstImage.depth == sizeof(Pixel)*8); + + if (dstImage.depth != sizeof(Pixel) * 8) + { + return false; + } + + // verify horizontal line + { + bool keyFound = false; + + Pixel* pProbe = (Pixel*) (dstImage.pBitmap); + Pixel* pProbeEnd = pProbe + dstImage.width; + + --pProbe; + + while (++pProbe < pProbeEnd) + { + if (*pProbe == KEY) + { + keyFound = true; + } + else + { + if ((*pProbe & 0xFF000000) != 0) + { + return false; + } + } + } + + if (!keyFound) + { + return false; + } + } + + // verify vertical line + { + bool keyFound = false; + + int pitch = dstImage.bytesPerLine / (dstImage.depth / 8); + + Pixel* pProbe = (Pixel*) (dstImage.pBitmap); + Pixel* pProbeEnd = pProbe + dstImage.height * pitch; + + while (pProbe < pProbeEnd) + { + if (*pProbe == KEY) + { + keyFound = true; + } + else + { + if ((*pProbe & 0xFF000000) != 0) + { + return false; + } + } + + pProbe += pitch; + } + + if (!keyFound) + { + return false; + } + } + + return true; +} + } bool -Tizen::Graphics::_Effect::IsNinePatchedBitmap(const _Util::Pixmap& dstImage) +Tizen::Graphics::_Effect::IsNinePatchedBitmap(const _Util::Pixmap& dstImage, bool checkStrictly) { // verifiy the spcified parameters { @@ -125,14 +212,27 @@ Tizen::Graphics::_Effect::IsNinePatchedBitmap(const _Util::Pixmap& dstImage) } } - switch (dstImage.depth) + if (checkStrictly) { - case 32: - return _IsNinePatched (dstImage, 0); - case 16: - return _IsNinePatched (dstImage, 0); - default: - return false; + switch (dstImage.depth) + { + case 32: + return _IsNinePatchedStrictly (dstImage, 0); + default: + return false; + } + } + else + { + switch (dstImage.depth) + { + case 32: + return _IsNinePatched (dstImage, 0); + case 16: + return _IsNinePatched (dstImage, 0); + default: + return false; + } } } diff --git a/src/graphics/inc/FGrp_BitmapImpl.h b/src/graphics/inc/FGrp_BitmapImpl.h old mode 100644 new mode 100755 index 381e65c..daebcd6 --- a/src/graphics/inc/FGrp_BitmapImpl.h +++ b/src/graphics/inc/FGrp_BitmapImpl.h @@ -68,14 +68,27 @@ public: result Construct(const BufferInfo& bufferInfo); result Construct(const Tizen::Base::String& fileName, BitmapPixelFormat pixelFormat); + result Construct(const FloatRectangle& rect); + result Construct(const FloatDimension& dim, BitmapPixelFormat format); + result Construct(const _CanvasImpl& canvas, const FloatRectangle& rect); + result Construct(const _BitmapImpl& bitmap, const FloatRectangle& rect); + bool IsConstructed(void) const; const Tizen::Base::String& GetFileName(void) const; result Scale(const Dimension& dim); + result Scale(const FloatDimension& dim); + result Merge(const Point& destPoint, const _BitmapImpl& srcBitmap, const Rectangle& srcRect); + result Merge(const FloatPoint& destPoint, const _BitmapImpl& srcBitmap, const FloatRectangle& srcRect); int GetHeight(void) const; + float GetHeightF(void) const; + float GetActualHeight(void) const; + int GetWidth(void) const; + float GetWidthF(void) const; + float GetActualWidth(void) const; int GetBitsPerPixel(void) const; BitmapPixelFormat GetPixelColorFormat(void) const; @@ -100,6 +113,8 @@ public: result LockFast(BufferInfo& info, long timeout = INFINITE); result UnlockFast(void); + static bool CheckNinePatchedBitmapStrictly(const Bitmap& bitmap); + /** * This method is for internal use only. The Tizen C++ platform team is not * responsible for any behavioral correctness, consistency, and @@ -122,6 +137,7 @@ public: * @remarks The specific error code can be accessed using the GetLastResult() method. */ static Bitmap* GetExpandedBitmapN(const Bitmap& ninePatchedBitmap, int width, int height); + static Bitmap* GetExpandedBitmapFN(const Bitmap& ninePatchedBitmap, float width, float height); /** * This method is for internal use only. The Tizen C++ platform team is not @@ -189,6 +205,9 @@ public: * @remarks The specific error code can be accessed using the GetLastResult() method. */ static Bitmap* GetNonScaledBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat); + static Bitmap* GetNonScaledBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, const FloatDimension& logicalSize); + + static bool HasNinePatchedBitmapTag(Tizen::Base::String fileName); static _BitmapImpl* GetInstance(Bitmap& bitmap); static const _BitmapImpl* GetInstance(const Bitmap& bitmap); @@ -213,7 +232,7 @@ protected: struct _SharedItem { std::auto_ptr<_Bitmap> nativeBitmap; - std::auto_ptr coordHolder; + std::auto_ptr coordHolder; long lazyScaling; std::auto_ptr<_Bitmap> scaledNativeBitmap; // depend on lazyScaling flag bool isMutable; diff --git a/src/graphics/inc/FGrp_CanvasImpl.h b/src/graphics/inc/FGrp_CanvasImpl.h old mode 100644 new mode 100755 index 3bde208..dec26b1 --- a/src/graphics/inc/FGrp_CanvasImpl.h +++ b/src/graphics/inc/FGrp_CanvasImpl.h @@ -80,38 +80,6 @@ enum TextOrigin TEXT_ORIGIN_BASELINE }; -/* For test, CR not approved */ -enum BlendingMode -{ - BLENDING_MODE_CLEAR, // [0, 0] - BLENDING_MODE_SRC, // [Sa, Sc] - BLENDING_MODE_DST, // [Da, Dc] - BLENDING_MODE_SRC_OVER, // [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] - BLENDING_MODE_DST_OVER, // [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc] - BLENDING_MODE_SRC_IN, // [Sa * Da, Sc * Da] - BLENDING_MODE_DST_IN, // [Sa * Da, Sa * Dc] - BLENDING_MODE_SRC_OUT, // [Sa * (1 - Da), Sc * (1 - Da)] - BLENDING_MODE_DST_OUT, // [Da * (1 - Sa), Dc * (1 - Sa)] - BLENDING_MODE_SRC_ATOP, // [Da, Sc * Da + (1 - Sa) * Dc] - BLENDING_MODE_DST_ATOP, // [Sa, Sa * Dc + Sc * (1 - Da)] - BLENDING_MODE_DST_XOR, // [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc] - BLENDING_MODE_ADD, - BLENDING_MODE_SATURATE, // Saturate(S + D) - // Pixman extension 1 - BLENDING_MODE_MULTIPLY, // [Sa * Da, Sc * Dc] - BLENDING_MODE_SCREEN, // [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] - BLENDING_MODE_OVERLAY, - BLENDING_MODE_DARKEN, // [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] - BLENDING_MODE_LIGHTEN, // [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] - // Pixman extension 2 - BLENDING_MODE_COLOR_DODGE, - BLENDING_MODE_COLOR_BURN, - BLENDING_MODE_HARD_LIGHT, - BLENDING_MODE_SOFT_LIGHT, - BLENDING_MODE_DIFFERENCE, - BLENDING_MODE_EXCLUSION -}; - class _OSP_EXPORT_ _CanvasImpl : public Tizen::Base::Object { @@ -121,64 +89,82 @@ public: result Construct(void); result Construct(const Rectangle& rect); - result Construct(Handle windowHandle, const Rectangle& rect); result Construct(const BufferInfo& bufferInfo); + result Construct(Handle windowHandle); + result Construct(Handle windowHandle, const Rectangle& rect); + + result Construct(const FloatRectangle& rect); + result Construct(Handle windowHandle, const FloatRectangle& rect); bool IsConstructed(void) const; result Clear(void); result Clear(const Rectangle& rect); + result Clear(const FloatRectangle& rect); result Copy(const Point& destPoint, const _CanvasImpl& srcCanvas, const Rectangle& srcRect); + result Copy(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect); result Copy(const Rectangle& destRect, const _CanvasImpl& srcCanvas, const Rectangle& srcRect); - result Copy(const Point& destPoint, const _CanvasImpl& srcCanvas, const Rectangle& srcRect, BlendingMode blendingMode); + result Copy(const FloatRectangle& destRect, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect); + result Copy(const Point& destPoint, const _CanvasImpl& srcCanvas, const Rectangle& srcRect, CompositeMode compositeMode); + result Copy(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect, CompositeMode compositeMode); result CopyEx(const Point& destPoint, const _CanvasImpl& srcCanvas, const Rectangle& srcRect); + result CopyEx(const FloatPoint& destPoint, const _CanvasImpl& srcCanvas, const FloatRectangle& srcRect); LineStyle GetLineStyle(void) const; int GetLineWidth(void) const; + float GetLineWidthF(void) const; + LineCapStyle GetLineCapStyle(void) const; + LineJoinStyle GetLineJoinStyle(void) const; result SetLineStyle(LineStyle style); result SetLineWidth(int width); + result SetLineWidth(float width); + result SetLineCapStyle(LineCapStyle lineCapStyle); + result SetLineJoinStyle(LineJoinStyle lineJoinStyle); result GetDashPattern(Tizen::Base::Collection::IListT& pattern, int& offset); + result GetDashPattern(Tizen::Base::Collection::IListT& pattern, float& offset); result SetDashPattern(const Tizen::Base::Collection::IListT& pattern, int offset); + result SetDashPattern(const Tizen::Base::Collection::IListT& pattern, float offset); result SetDrawingQuality(BitmapDrawingQuality quality); BitmapDrawingQuality GetDrawingQuality(void) const; - result SetBlendingMode(BlendingMode blendingMode); - BlendingMode GetBlendingMode(void) const; + result SetCompositeMode(CompositeMode compositeMode); + CompositeMode GetCompositeMode(void) const; result GetPixel(const Point& point, Color& color) const; + result GetPixel(const FloatPoint& point, Color& color) const; result SetPixel(const Point& point); - result SetPixel(const FloatPoint& point); // floating-point version + result SetPixel(const FloatPoint& point); result DrawRectangle(const Rectangle& rect); - result DrawRectangle(const FloatRectangle& rect); // floating-point version + result DrawRectangle(const FloatRectangle& rect); result FillRectangle(const Color& color, const Rectangle& rect); - result FillRectangle(const Color& color, const FloatRectangle& rect); // floating-point version + result FillRectangle(const Color& color, const FloatRectangle& rect); result DrawRoundRectangle(const Rectangle& rect, const Dimension& arcDim); - result DrawRoundRectangle(const FloatRectangle& rect, const FloatDimension& arcDim); // floating-point version + result DrawRoundRectangle(const FloatRectangle& rect, const FloatDimension& arcDim); result FillRoundRectangle(const Color& color, const Rectangle& rect, const Dimension& arcDim); - result FillRoundRectangle(const Color& color, const FloatRectangle& rect, const FloatDimension& arcDim); // floating-point version + result FillRoundRectangle(const Color& color, const FloatRectangle& rect, const FloatDimension& arcDim); result DrawEllipse(const Rectangle& rect); - result DrawEllipse(const FloatRectangle& rect); // floating-point version + result DrawEllipse(const FloatRectangle& rect); result FillEllipse(const Color& color, const Rectangle& rect); - result FillEllipse(const Color& color, const FloatRectangle& rect); // floating-point version + result FillEllipse(const Color& color, const FloatRectangle& rect); result DrawArc(const Rectangle& rect, int startAngle, int endAngle, ArcStyle arcStyle); - result DrawArc(const FloatRectangle& rect, float startAngle, float endAngle, ArcStyle arcStyle); // floating-point version + result DrawArc(const FloatRectangle& rect, float startAngle, float endAngle, ArcStyle arcStyle); result DrawTriangle(const Point& point1, const Point& point2, const Point& point3); - result DrawTriangle(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); // floating-point version + result DrawTriangle(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); result FillTriangle(const Color& color, const Point& point1, const Point& point2, const Point& point3); - result FillTriangle(const Color& color, const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); // floating-point version + result FillTriangle(const Color& color, const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point3); result DrawLine(const Point& point1, const Point& point2); - result DrawLine(const FloatPoint& point1, const FloatPoint& point2); // floating-point version + result DrawLine(const FloatPoint& point1, const FloatPoint& point2); result DrawPolyline(const Tizen::Base::Collection::IList& points); result DrawPolygon(const Tizen::Base::Collection::IList& points); result FillPolygon(const Color& color, const Tizen::Base::Collection::IList& points); @@ -194,26 +180,37 @@ public: result DrawText(const Point& point, const Tizen::Base::String& text, int startIndex, int length, const Color& outlineColor); result DrawText(const Point& point, const EnrichedText& enrichedText); + result DrawText(const FloatPoint& point, const Tizen::Base::String& text); + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int startIndex, int length); + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int startIndex, const Color& outlineColor); + result DrawText(const FloatPoint& point, const Tizen::Base::String& text, int startIndex, int length, const Color& outlineColor); + result DrawText(const FloatPoint& point, const EnrichedText& enrichedText); + result DrawBitmap(const Point& point, const _BitmapImpl& bitmap); - result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap); // floating-point version + result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap); result DrawBitmap(const Rectangle& rect, const _BitmapImpl& bitmap); - result DrawBitmap(const FloatRectangle& rect, const _BitmapImpl& bitmap); // floating-point version + result DrawBitmap(const FloatRectangle& rect, const _BitmapImpl& bitmap); result DrawBitmap(const Rectangle& destRect, const _BitmapImpl& srcBitmap, const Rectangle& srcRect); - result DrawBitmap(const FloatRectangle& destRect, const _BitmapImpl& srcBitmap, const FloatRectangle& srcRect); // floating-point version + result DrawBitmap(const FloatRectangle& destRect, const _BitmapImpl& srcBitmap, const FloatRectangle& srcRect); result DrawBitmap(const Point& point, const _BitmapImpl& bitmap, FlipDirection dir); - result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap, FlipDirection dir); // floating-point version + result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap, FlipDirection dir); result DrawBitmap(const Point& point, const _BitmapImpl& bitmap, const Point& pivot, int degree); - result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap, const FloatPoint& pivot, float degree); // floating-point version + result DrawBitmap(const FloatPoint& point, const _BitmapImpl& bitmap, const FloatPoint& pivot, float degree); result DrawNinePatchedBitmap(const Rectangle& rect, const _BitmapImpl& bitmap); - result DrawNinePatchedBitmap(const FloatRectangle& rect, const _BitmapImpl& bitmap); // floating-point version + result DrawNinePatchedBitmap(const FloatRectangle& rect, const _BitmapImpl& bitmap); + result DrawNineTiledBitmap(const Rectangle& rect, const _BitmapImpl& bitmap); result Show(void); result Show(const Rectangle& rect); Rectangle GetBounds(void) const; + FloatRectangle GetBoundsF(void) const; + FloatRectangle GetActualBounds(void) const; result SetClipBounds(const Rectangle& rect); + result SetClipBounds(const FloatRectangle& rect); Rectangle GetClipBounds(void) const; + FloatRectangle GetClipBoundsF(void) const; result Lock(BufferInfo& info, long timeout = INFINITE); result Unlock(void); @@ -227,6 +224,7 @@ public: result SetPosition(int x, int y); Canvas* GetSubCanvasN(const Rectangle& subRegion) const; + Canvas* GetSubCanvasFN(const FloatRectangle& subRegion) const; /* * Sets a priority font to the %_CanvasImpl. This font have priority at user font which is installed through _CanvasImpl::SetFont() @@ -264,8 +262,10 @@ protected: struct _CanvasCoordHolder* _pCoordHolder; Font* _pFont; Font* _pPriorityFont; - Tizen::Base::Collection::ArrayListT _dashList; + Tizen::Base::Collection::ArrayListT _dashList; int _dashOffset; + bool (* _pShowCallbackFunc)(void*); + void* _pShowCallbackParam; friend class _Canvas; friend class _CanvasImplPrivate; diff --git a/src/graphics/inc/FGrp_CanvasTextureImpl.h b/src/graphics/inc/FGrp_CanvasTextureImpl.h index 5cd78f1..164e5f3 100644 --- a/src/graphics/inc/FGrp_CanvasTextureImpl.h +++ b/src/graphics/inc/FGrp_CanvasTextureImpl.h @@ -48,8 +48,6 @@ public: Canvas* GetCanvasN(void) const; - static bool IsSupported(void); - public: static _CanvasTextureImpl* GetInstance(CanvasTexture& canvasTexture); static const _CanvasTextureImpl* GetInstance(const CanvasTexture& canvasTexture); diff --git a/src/graphics/inc/FGrp_CanvasTool.h b/src/graphics/inc/FGrp_CanvasTool.h new file mode 100755 index 0000000..70b0c9f --- /dev/null +++ b/src/graphics/inc/FGrp_CanvasTool.h @@ -0,0 +1,48 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FGrp_CanvasTool.h + * @brief This is the header file for internal _CanvasTool namespace. + * + */ + +#ifndef _FGRP_INTERNAL_CANVASTOOL_H_ +#define _FGRP_INTERNAL_CANVASTOOL_H_ + +#include +#include + + +namespace Tizen { namespace Graphics +{ + +namespace _CanvasTool +{ + +bool +SetCallback(Tizen::Graphics::Canvas& canvas, + bool (* ShowCallback)(void*), void* pCallbackParam); + +void +ResetCallback(Tizen::Graphics::Canvas& canvas); + +} // Tizen::Graphics::_CanvasTool + +}} // Tizen::Graphics + +#endif // _FGRP_INTERNAL_CANVASTOOL_H_ diff --git a/src/graphics/inc/FGrp_CoordinateSystem.h b/src/graphics/inc/FGrp_CoordinateSystem.h index 195aa0c..ae50a73 100644 --- a/src/graphics/inc/FGrp_CoordinateSystem.h +++ b/src/graphics/inc/FGrp_CoordinateSystem.h @@ -28,7 +28,9 @@ #include #include #include - +#include +#include +#include namespace Tizen { namespace Graphics { @@ -87,10 +89,18 @@ public: virtual int TransformHorizontal(int scalar) const = 0; virtual int TransformVertical(int scalar) const = 0; + virtual FloatRectangle Transform(const FloatRectangle& rect) const = 0; + virtual FloatDimension Transform(const FloatDimension& dim) const = 0; + virtual FloatPoint Transform(const FloatPoint& point) const = 0; + virtual float Transform(float scalar) const = 0; virtual float TransformHorizontal(float scalar) const = 0; virtual float TransformVertical(float scalar) const = 0; + virtual int TransformFloatToInt(float scalar) const = 0; + virtual int TransformHorizontalFloatToInt(float scalar) const = 0; + virtual int TransformVerticalFloatToInt(float scalar) const = 0; + virtual float GetHorizontalScaleFactor(void) const = 0; virtual float GetVerticalScaleFactor(void) const = 0; @@ -120,6 +130,22 @@ public: return point; } + virtual FloatRectangle Transform(const FloatRectangle& rect) const + { + return rect; + } + + virtual FloatDimension Transform(const FloatDimension& dim) const + { + return dim; + } + + virtual FloatPoint Transform(const FloatPoint& point) const + { + return point; + } + + virtual int Transform(int scalar) const { return scalar; @@ -210,6 +236,9 @@ public: void SetTransformEnabled(bool enabled); bool IsTransformEnabled(void) const; + double GetAppBaseScaleFactor(void); + double GetTargetBaseScaleFactor(void); + private: _CoordinateSystem(void); ~_CoordinateSystem(void); diff --git a/src/graphics/inc/FGrp_CoordinateSystemUtils.h b/src/graphics/inc/FGrp_CoordinateSystemUtils.h new file mode 100755 index 0000000..92c2188 --- /dev/null +++ b/src/graphics/inc/FGrp_CoordinateSystemUtils.h @@ -0,0 +1,103 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FGrp_CoordinateSystemUtils.h + * @brief This is the header file for the _CoordinateSystemUtils class. + * + * This header file contains the declarations of the _CoordinateSystemUtils class. + */ + +#ifndef _FGRP_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ +#define _FGRP_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ + +#include +#include +#include +#include +#include +#include + +namespace Tizen { namespace Graphics { + +class _OSP_EXPORT_ _CoordinateSystemUtils +{ +public: + // Convert To Float + static Tizen::Graphics::FloatRectangle ConvertToFloat(const Tizen::Graphics::Rectangle& rect); + static Tizen::Graphics::FloatRectangle ConvertToFloat(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatDimension ConvertToFloat(const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatPoint ConvertToFloat(const Tizen::Graphics::Point& point); + static float ConvertToFloat(int scalar); + + // Convert To Integer + static Tizen::Graphics::Rectangle ConvertToInteger(const Tizen::Graphics::FloatRectangle& rect); + static Tizen::Graphics::Rectangle ConvertToInteger(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Dimension ConvertToInteger(const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Point ConvertToInteger(const Tizen::Graphics::FloatPoint& point); + static int ConvertToInteger(float scalar); + + // Transform Utilities + static Tizen::Graphics::Rectangle Transform(const Tizen::Graphics::Rectangle& rect); + static Tizen::Graphics::FloatRectangle Transform(const Tizen::Graphics::FloatRectangle& rect); + static Tizen::Graphics::Rectangle Transform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatRectangle Transform(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Dimension Transform(const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatDimension Transform(const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Point Transform(const Tizen::Graphics::Point& point); + static Tizen::Graphics::FloatPoint Transform(const Tizen::Graphics::FloatPoint& point); + static int HorizontalTransform(int scalar); + static float HorizontalTransform(float scalar); + static int VerticalTransform(int scalar); + static float VerticalTransform(float scalar); + + // Inverse Transform Utilities + static Tizen::Graphics::Rectangle InverseTransform(const Tizen::Graphics::Rectangle& rect); + static Tizen::Graphics::FloatRectangle InverseTransform(const Tizen::Graphics::FloatRectangle& rect); + static Tizen::Graphics::Rectangle InverseTransform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatRectangle InverseTransform(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Dimension InverseTransform(const Tizen::Graphics::Dimension& dim); + static Tizen::Graphics::FloatDimension InverseTransform(const Tizen::Graphics::FloatDimension& dim); + static Tizen::Graphics::Point InverseTransform(const Tizen::Graphics::Point& point); + static Tizen::Graphics::FloatPoint InverseTransform(const Tizen::Graphics::FloatPoint& point); + static int InverseHorizontalTransform(int scalar); + static float InverseHorizontalTransform(float scalar); + static int InverseVerticalTransform(int scalar); + static float InverseVerticalTransform(float scalar); + +private: + _CoordinateSystemUtils(void); + ~_CoordinateSystemUtils(void); + + _CoordinateSystemUtils(const _CoordinateSystemUtils&); + _CoordinateSystemUtils& operator =(const _CoordinateSystemUtils&); + + static Tizen::Graphics::_ICoordinateSystemTransformer* GetTransformer(void); + static Tizen::Graphics::_ICoordinateSystemTransformer* GetInverseTransformer(void); + +private: + // WARNING: + // Some float functions like sin and cos emit too-much float-error. + // So, the rounding const must be a bigger value than expected. + static const float __floatIntegralEpsilon; + static Tizen::Graphics::_CoordinateSystem* __pCoordinateSystemInstance; + +}; //class _CoordinateSystemUtils + +}} // Tizen::Graphics + +#endif //_FGRP_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ diff --git a/src/graphics/inc/FGrp_EnrichedTextImpl.h b/src/graphics/inc/FGrp_EnrichedTextImpl.h index 9260dd3..b6b7fcc 100644 --- a/src/graphics/inc/FGrp_EnrichedTextImpl.h +++ b/src/graphics/inc/FGrp_EnrichedTextImpl.h @@ -77,6 +77,7 @@ public: virtual ~_EnrichedTextImpl(void); result Construct(const Tizen::Graphics::Dimension& dim); + result Construct(const Tizen::Graphics::FloatDimension& dim); result InsertAt(int elementIndex, TextElement& element); result RemoveAt(int elementIndex, bool deallocate); result Remove(TextElement& element, bool deallocate); @@ -86,11 +87,17 @@ public: TextElement* GetTextElementAt(int elementIndex) const; int GetTextElementCount(void) const; result SetSize(const Tizen::Graphics::Dimension& size); + result SetSize(const Tizen::Graphics::FloatDimension& size); result SetSize(int width, int height); + result SetSize(float width, float height); Tizen::Graphics::Dimension GetSize(void) const; + Tizen::Graphics::FloatDimension GetSizeF(void) const; void GetSize(int& width, int& height) const; + void GetSize(float& width, float& height) const; int GetWidth(void) const; + float GetWidthF(void) const; int GetHeight(void) const; + float GetHeightF(void) const; result SetVerticalAlignment(TextVerticalAlignment alignment); result SetHorizontalAlignment(TextHorizontalAlignment alignment); TextVerticalAlignment GetVerticalAlignment(void) const; @@ -100,29 +107,40 @@ public: result SetTextAbbreviationEnabled(bool enable); bool IsTextAbbreviationEnabled(void) const; result SetLineSpace(int lineSpace); + result SetLineSpace(float lineSpace); int GetLineSpace(void) const; + float GetLineSpaceF(void) const; void Refresh(void); int GetTotalLineCount(void) const; int GetTotalLineHeight(void) const; + float GetTotalLineHeightF(void) const; int GetDisplayLineCount(void) const; int GetLineLength(int lineIndex) const; int GetFirstTextIndex(int lineIndex) const; int GetLineIndex(int textIndex) const; int GetLineHeight(int lineIndex) const; + float GetLineHeightF(int lineIndex) const; int GetTextLength(void) const; result GetTextExtent(int startTextIndex, int textLength, int& width, int& height, int& actualLength) const; + result GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const; result GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const; + result GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const; Tizen::Graphics::Dimension GetTextExtent(void) const; + Tizen::Graphics::FloatDimension GetTextExtentF(void) const; result Add(const Tizen::Graphics::Bitmap& bitmap); result InsertAt(int elementIndex, const Tizen::Graphics::Bitmap& bitmap); - result GetLinkInfoFromPosition(const Point& point, Tizen::Base::Utility::LinkInfo& linkInfo) const; + result GetLinkInfoFromPosition(const Tizen::Graphics::Point& point, Tizen::Base::Utility::LinkInfo& linkInfo) const; + result GetLinkInfoFromPosition(const Tizen::Graphics::FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const; result GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const; + result GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const; TextVerticalAlignment GetElementVerticalAlignment(void) const; result SetElementVerticalAlignment(TextVerticalAlignment alignment); Tizen::Graphics::Rectangle GetBounds(void) const; + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; result IndexOfFromLinkedList(TextElement& textElement, int& index); int GetTextElementIndexFromPosition(Tizen::Graphics::Point& point) const; + int GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const; Tizen::Graphics::_Text::TextObjectAlignment ConvertHAlignment(TextHorizontalAlignment halign); TextHorizontalAlignment ConvertHAlignment(Tizen::Graphics::_Text::TextObjectAlignment halign); Tizen::Graphics::_Text::TextObjectAlignment ConvertVAlignment(TextVerticalAlignment valign); @@ -133,6 +151,7 @@ public: Tizen::Graphics::_Text::TextObject* GetTextObject(void) const; Tizen::Graphics::_Text::TextElementType GetTypeFromIndex(int textObjectIndex) const; int GetIndexFromTouchPosition(int posX, int posY) const; + int GetIndexFromTouchPosition(float posX, float posY) const; result RemoveFromTextObject(_TextElementImpl* pTextElementImpl); result InsertAtFromTextObject(int index, _TextElementImpl* pTextElementImpl); int GetTextElementIndex(_TextElementImpl* pTextElementImpl) const; diff --git a/src/graphics/inc/FGrp_FontImpl.h b/src/graphics/inc/FGrp_FontImpl.h index 12e3214..df5803a 100644 --- a/src/graphics/inc/FGrp_FontImpl.h +++ b/src/graphics/inc/FGrp_FontImpl.h @@ -44,6 +44,7 @@ class IList; namespace Tizen { namespace Graphics { class Dimension; +class FloatDimension; class Font; class _Font; @@ -58,26 +59,47 @@ public: result Construct(int style, int size); result Construct(const Tizen::Base::String& fontName, int style, int size, bool isPathEnabled = true); result Construct(const Tizen::Base::ByteBuffer& fontData, int style, int size); + result Construct(int style, float size); + result Construct(const Tizen::Base::String& fontNameOrPath, int style, float size, bool isPathEnabled = true); + result Construct(const Tizen::Base::ByteBuffer& fontData, int style, float size); bool IsConstructed(void) const; int GetMaxHeight(void) const; + float GetMaxHeightF(void) const; int GetMaxWidth(void) const; + float GetMaxWidthF(void) const; + int GetAscender(void) const; + float GetAscenderF(void) const; int GetDescender(void) const; + float GetDescenderF(void) const; + result GetLeftBear(wchar_t character, int& leftBear) const; + result GetLeftBear(wchar_t character, float& leftBear) const; result GetRightBear(wchar_t character, int& rightBear) const; + result GetRightBear(wchar_t character, float& rightBear) const; + result GetTextExtent(const Tizen::Base::String& text, int length, Dimension& dim) const; + result GetTextExtent(const Tizen::Base::String& text, int length, FloatDimension& dim) const; + bool IsBold(void) const; bool IsItalic(void) const; bool IsPlain(void) const; bool IsStrikeOut(void) const; bool IsUnderlined(void) const; + int GetSize(void) const; + float GetSizeF(void) const; + void SetStrikeOut(bool strikeOut); void SetUnderline(bool underline); + void SetCharSpace(int space); + void SetCharSpace(float space); int GetCharSpace(void) const; + float GetCharSpaceF(void) const; + Tizen::Base::String GetFaceName(void) const; static Tizen::Base::Collection::IList* GetSystemFontListN(void); static Tizen::Base::String GetFaceName(const Tizen::Base::String& filePath); @@ -136,6 +158,7 @@ public: * @exception E_SYSTEM The system error occurs. */ result SetSize(int size); + result SetSize(float size); /* * Sets the font style. @@ -164,6 +187,7 @@ public: * else @c -1 if the method fails */ int GetLeading(void) const; + float GetLeadingF(void) const; static _FontImpl* GetInstance(Font& font); static const _FontImpl* GetInstance(const Font& font); diff --git a/src/graphics/inc/FGrp_NonScale.h b/src/graphics/inc/FGrp_NonScale.h old mode 100644 new mode 100755 index f8ef365..f6daa43 --- a/src/graphics/inc/FGrp_NonScale.h +++ b/src/graphics/inc/FGrp_NonScale.h @@ -35,7 +35,9 @@ class ByteBuffer; namespace Tizen { namespace Graphics { + class Dimension; +class FloatDimension; class _BitmapImpl; @@ -48,7 +50,7 @@ namespace _NonScale * @exception E_OUT_OF_MEMORY Insufficient memory. */ _OSP_EXPORT_ _BitmapImpl* CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat); -_OSP_EXPORT_ _BitmapImpl* CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, const Dimension& logicalSize); +_OSP_EXPORT_ _BitmapImpl* CreateBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, const FloatDimension& logicalSizeF); /* * @exception E_SUCCESS The method was successful. diff --git a/src/graphics/inc/FGrp_TextCommon.h b/src/graphics/inc/FGrp_TextCommon.h index 7a2d924..897d3b0 100644 --- a/src/graphics/inc/FGrp_TextCommon.h +++ b/src/graphics/inc/FGrp_TextCommon.h @@ -112,9 +112,12 @@ enum TextObjectSpaceHideType enum TextComponentInfoValueType { SET_FONT = 0, + SET_FONT_SIZE, + SET_FONT_STYLE, SET_FONT_FGCOLOR, SET_FONT_BGCOLOR, SET_FONT_OUTLINECOLOR, + SET_ALTERNATE_DISPLAY_BITMAP, MAX_TEXTOBJECT_VALUE, SET_IMAGE_RECT, SET_IMAGE_ALIGN, @@ -191,6 +194,12 @@ struct TextObjectSweepComposeLineInfo int currentLineWidth; }; +struct BitmapDisplayProperty +{ + bool displayEnable; + const Bitmap* pBitmap; +}; + typedef int TextObjectAlignment; //special character definistion diff --git a/src/graphics/inc/FGrp_TextTextCutLink.h b/src/graphics/inc/FGrp_TextTextCutLink.h index 4086e4a..61088cb 100644 --- a/src/graphics/inc/FGrp_TextTextCutLink.h +++ b/src/graphics/inc/FGrp_TextTextCutLink.h @@ -84,6 +84,9 @@ private: virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, + const TextObjectActionType action); + virtual Font* GetCurrentFont(void) const; virtual Color GetCurrentForegroundColor(void) const; diff --git a/src/graphics/inc/FGrp_TextTextElement.h b/src/graphics/inc/FGrp_TextTextElement.h index fbf221f..986cc89 100644 --- a/src/graphics/inc/FGrp_TextTextElement.h +++ b/src/graphics/inc/FGrp_TextTextElement.h @@ -48,9 +48,15 @@ public: virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, + int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value); virtual TextElement* CopyN(int textStart, int textLength); @@ -59,10 +65,16 @@ public: virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(void) const; + virtual float GetHeightF(void) const; + virtual int GetTextLength(void) const; virtual void SetTextLength(int length); diff --git a/src/graphics/inc/FGrp_TextTextImage.h b/src/graphics/inc/FGrp_TextTextImage.h index 1858931..326e4f4 100644 --- a/src/graphics/inc/FGrp_TextTextImage.h +++ b/src/graphics/inc/FGrp_TextTextImage.h @@ -56,19 +56,31 @@ public: virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value); virtual TextElement* CopyN(int textStart, int textLength); virtual result GetRegion(int textIndex, int startTextIndex, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(void) const; + virtual float GetHeightF(void) const; + virtual result SetValue(TextComponentInfoValueType type, unsigned int value); virtual unsigned int GetValue(TextComponentInfoValueType type) const; @@ -79,8 +91,12 @@ public: result SetBounds(const Rectangle& rect); + result SetBounds(const FloatRectangle& rect); + Rectangle GetBounds(void) const; + FloatRectangle GetBoundsF(void) const; + result SetAlignment(TextObjectAlignment alignment); TextObjectAlignment GetAlignment(void) const; diff --git a/src/graphics/inc/FGrp_TextTextObject.h b/src/graphics/inc/FGrp_TextTextObject.h index f813d38..0373e2c 100644 --- a/src/graphics/inc/FGrp_TextTextObject.h +++ b/src/graphics/inc/FGrp_TextTextObject.h @@ -54,6 +54,8 @@ public: result Construct(const Rectangle& rect); + result Construct(const FloatRectangle& rect); + TextObject* CloneN(void); result Draw(_CanvasImpl& canvasImpl); @@ -70,6 +72,8 @@ public: int GetText(wchar_t* pCopiedText, int textLength) const; + result Remove(int startTextIndex, int textLength); + result RemoveAll(bool deallocate = true); result RemoveElement(TextElement& textElement, bool deallocate); @@ -92,9 +96,13 @@ public: TextElement* GetElementAtTextIndex(int textIndex) const; - int GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode = false) const; + int GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode = true) const; + + int GetTextIndexFromPosition(float lcX, float lcY, bool cursorMode = true) const; + + int GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMode = true) const; - int GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMode = false) const; + int GetTextIndexFromPositionAtLine(int lineIndex, float lcX, bool cursorMode = true) const; result ChangeTextOffset(wchar_t* pText, int textIndex, int gap); @@ -106,24 +114,36 @@ public: int GetTotalHeight(void) const; + float GetTotalHeightF(void) const; + int GetLineHeightAt(int lineIndex) const; + float GetLineHeightAtF(int lineIndex) const; + int GetLineWidthAt(int lineIndex) const; + float GetLineWidthAtF(int lineIndex) const; + int GetDisplayLineCount(void) const; int GetLineIndexAtPositionY(int lcY) const; + int GetLineIndexAtPositionY(float lcY) const; + int GetFirstTextIndexAt(int lineIndex) const; int GetTextLengthAt(int lineIndex) const; int GetMaxLineHeight(void) const; + float GetMaxLineHeightF(void) const; + int GetTextLength(void) const; Dimension GetTextExtent(int startTextIndex, int textLength) const; + FloatDimension GetTextExtentF(int startTextIndex, int textLength) const; + result SetAction(TextObjectActionType action); TextObjectActionType GetAction(void) const; @@ -138,12 +158,20 @@ public: result SetBounds(const Rectangle& lcRect); + result SetBounds(const FloatRectangle& lcRect); + Rectangle GetBounds(void) const; + FloatRectangle GetBoundsF(void) const; + result SetLineSpace(int lcLineSpacing); + result SetLineSpace(float lcLineSpacing); + int GetLineSpace(void) const; + float GetLineSpaceF(void) const; + result SetRange(int startTextIndex, int textLength); void GetRange(int& startTextIndex, int& textLength) const; @@ -152,10 +180,45 @@ public: const Font* GetFont(int textIndex) const; + // font size + result SetDefaultFontSize(int size); + + result SetDefaultFontSize(float size); + + int GetDefaultFontSize(void) const; + + float GetDefaultFontSizeF(void) const; + + result SetFontSize(int size, int startTextIndex, int textLength); + + result SetFontSize(float size, int startTextIndex, int textLength); + + int GetFontSize(int textIndex) const; + + float GetFontSizeF(int textIndex) const; + + // font style + + result SetDefaultFontStyle(int style); + + int GetDefaultFontStyle(void) const; + + result SetFontStyle(int style, int startTextIndex, int textLength); + + int GetFontStyle(int textIndex) const; + + // foreground color + + result SetDefaultForegroundColor(const Color& color); + + Color GetDefaultForegroundColor(void) const; + result SetForegroundColor(const Color& color, int startTextIndex, int textLength); Color GetForegroundColor(int textIndex) const; + // background color + result SetBackgroundColor(const Color& color, int startTextIndex, int textLength); Color GetBackgroundColor(int textIndex) const; @@ -164,6 +227,10 @@ public: Color GetOutlineColor(int textIndex) const; + result SetDisplayBitmap(const Bitmap* pBitmap, int startTextIndex, int textLength); + + const Bitmap* GetDisplayBitmap(int textIndex) const; + result SetWrap(TextObjectWrapType wrap); TextObjectWrapType GetWrap(void) const; @@ -200,8 +267,12 @@ public: result SetFirstDisplayPositionY(int lcY); + result SetFirstDisplayPositionY(float lcY); + int GetFirstDisplayPositionY(void) const; + float GetFirstDisplayPositionYF(void) const; + result SetPartialComposingModeEnabled(bool enable); bool IsPartialComposingModeEnabled(void) const; @@ -222,6 +293,8 @@ public: int GetCutLinkIndexFromPositionData(int lcX, int lcY) const; + int GetCutLinkIndexFromPositionData(float lcX, float lcY) const; + TextElement* GetCutLinkElementAtCutLinkElementIndex(int linkIndex) const; result ChangeCutLinkState(int linkIndex, bool select); @@ -234,6 +307,8 @@ public: result GetCutLinkBounds(int cutLinkIndex, Point& startPoint, Point& endPoint) const; + result GetCutLinkBounds(int cutLinkIndex, FloatPoint& startPoint, FloatPoint& endPoint) const; + bool IsActionOn(void) const; bool IsDisplayedAtStartPosition(void) const; @@ -242,6 +317,12 @@ public: result GetTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const; + result GetTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const; + + result GetBlockTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const; + + result GetBlockTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const; + TextObjectSweepInfo GetSweepInfo(void) const; result ResetSweepInfo(void); @@ -254,25 +335,51 @@ public: Rectangle GetBoundsAtLine(int lineIndex) const; + FloatRectangle GetBoundsAtLineF(int lineIndex) const; + result SetBlockColor(const Color& color); Color GetBlockColor(void) const; + Tizen::Base::String GetDisplayableText(void); + + bool WordExceedsWidthAt(int lineIndex) const; + private: result DrawByLine(_CanvasImpl& canvasImpl, const Rectangle& displayRect); + result DrawByLine(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect); + int GetTotalComposedHeight(void) const; + float GetTotalComposedHeightF(void) const; + result GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const; + result GetTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const; + + result GetBlockTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, + int& logicalX, int& logicalY) const; + + result GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const; + result GetTextPositionInfoInNoneWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const; + result GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const; + int GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode = true) const; + int GetTextIndexFromPositionInWrap(float pcX, float pcY, bool cursorMode = true) const; + int GetTextIndexFromPositionInNoneWrap(int pcX, int pcY, bool cursorMode = true) const; + int GetTextIndexFromPositionInNoneWrap(float pcX, float pcY, bool cursorMode = true) const; + result UpdateChangedInfo(int startTextIndex, int textLength = -1, bool initTextWidthManager = true); result NotifyTextAdded(int textIndex, int textLength); @@ -291,6 +398,8 @@ private: Point GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset); + FloatPoint GetDisplayPositionAtLineF(int lineIndex, int textIndexFromLineOffset); + // Attribute private: Rectangle __rect; diff --git a/src/graphics/inc/FGrp_TextTextSimple.h b/src/graphics/inc/FGrp_TextTextSimple.h index ed63b49..bd58e39 100644 --- a/src/graphics/inc/FGrp_TextTextSimple.h +++ b/src/graphics/inc/FGrp_TextTextSimple.h @@ -58,19 +58,31 @@ public: virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment alignment, const TextObjectActionType action); + virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + virtual TextElement* CloneN(TextComponentInfoValueType type, unsigned int value); virtual TextElement* CopyN(int startTextIndex, int textLength); virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(void) const; + virtual float GetHeightF(void) const; + virtual unsigned int GetValue(TextComponentInfoValueType type) const; virtual result SetValue(TextComponentInfoValueType type, unsigned int value); @@ -108,7 +120,7 @@ public: const wchar_t* GetText(void) const; bool IsSame(wchar_t* pText, Font* pFont, const Color& foregroundColor, - const Color& backgroundColor, const Color& outlineColor); + const Color& backgroundColor, const Color& outlineColor, const bool isBitmapDisplayMode) const; void SetUserWrap(TextObjectWrapType userWrap); @@ -116,8 +128,12 @@ public: result SetBitmap(const Bitmap& bitmap); + result SetBitmap(BitmapDisplayProperty bitmapDisplayProperty); + const Bitmap* GetBitmap(void) const; + bool IsBitmapDisplayMode(void) const; + private: static int ConvertEnterToSpace(wchar_t* pDstText, const wchar_t* pSrcText, int textLength); @@ -131,6 +147,8 @@ private: int GetWordWrapLengthEx(const wchar_t* pText, int textLength, int& actualLength) const; + int GetGlyphedLength(const wchar_t* pText, int textLength, int& actualLength) const; + protected: virtual Font* GetCurrentFont(void) const; @@ -152,7 +170,7 @@ protected: bool _isBackgroundDrawingModeEnabled; private: - const Bitmap* __pBitmap; + BitmapDisplayProperty __bitmapProperty; private: TextSimple(const TextSimple& other); // NOT IMPLMENTED diff --git a/src/graphics/inc/FGrp_VideoTextureImpl.h b/src/graphics/inc/FGrp_VideoTextureImpl.h index 4ce579b..cd13cb3 100644 --- a/src/graphics/inc/FGrp_VideoTextureImpl.h +++ b/src/graphics/inc/FGrp_VideoTextureImpl.h @@ -49,6 +49,7 @@ public: static _VideoTextureImpl* GetInstance(VideoTexture& videoTexture); static const _VideoTextureImpl* GetInstance(const VideoTexture& videoTexture); static unsigned int GetPixmap(void* pData); + static void PixmapErrorCallback(unsigned int* pPixmap, void* pData); private: diff --git a/src/graphics/opengl/FGrpEgl.cpp b/src/graphics/opengl/FGrpEgl.cpp index 6c6f6d6..be40228 100644 --- a/src/graphics/opengl/FGrpEgl.cpp +++ b/src/graphics/opengl/FGrpEgl.cpp @@ -21,6 +21,9 @@ * */ +#include +#include + #include #include #include @@ -70,7 +73,8 @@ extern "C" #include #include #include -#include +#include +#include #endif typedef int _SglIndex; @@ -86,12 +90,20 @@ void _GlesInterfaceTerminate_1(); void _GlesInterfaceTerminate_2(); #endif +#include + +void _GlFlush_1(void); +void _GlFlush_2(void); +void _GlClear_1(GLbitfield mask); +void _GlClear_2(GLbitfield mask); + +EGLBoolean _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); + using namespace Tizen::Ui::Controls; #define FGRAPHICS_INTERNAL_USE_FBO #if defined(FGRAPHICS_INTERNAL_USE_FBO) -#include bool _GlesFboInitialize_1(int& fboWidth, int& fboHeight, GLuint& frameBufferObject, GLuint& depthRenderBuffer, GLuint& stencilRenderBuffer , GLuint colorSize, GLuint depthSize, GLuint stencilSize, GLuint& textureId); bool _GlesFboBinding_1(const GLuint frameBufferObject); @@ -123,16 +135,21 @@ namespace Opengl namespace // unnamed { +class _SglInfo; + #define FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) void _PostRenderCallback(Ecore_Evas* ee); -void _SaveCurrentContext(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +void _SaveCurrentContext(_SglInfo* pSglInfo); void _UnregisterRenderCallback(Evas_Object* pObject); #endif -#if !defined(_OSP_EMUL_) -#define FGRAPHICS_INTERNAL_USE_EVAS_NATIVE_SURFACE +#if !defined (_OSP_EMUL_) +#define FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP #endif +bool isDoublePixmapEnabled = false; + +#define FGRAPHICS_INTERNAL_USE_EVAS_NATIVE_SURFACE bool isEvasNativeSetEnabled = false; void _OnBoundsChanged(void* pData); @@ -157,8 +174,10 @@ public: , pBitmap(null) , pObject(null) , nativePixmap((EGLNativePixmapType)0) - , pVisualElementImpl(null) - , pControl(null) + , pVisualElement(null) + , pVisualElementSurface(null) + , glVersion(0) + , pWindow(null) #if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER) , pEcoreImage(null) , width(0) @@ -175,11 +194,14 @@ public: , textureId(0) , program(0) , pFrame(null) - , glVersion(0) , isFboAvailable(true) , fboWidth(0) , fboHeight(0) #endif + , isBackbuffer(true) + , wasShown(false) + , swapDone(false) + , pSecondSglInfo(null) { } @@ -191,55 +213,37 @@ public: ecore_x_image_free(this->pEcoreImage); } #endif - if (pBitmap != null && pObject != null) + if (pBitmap == null) { - int objectWidth = 0; - int objectHeight = 0; - int objectBitsPerPixel = 0; - Evas_Colorspace colorSpace = EVAS_COLORSPACE_ARGB8888; + return; + } -#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) - if (isEvasNativeSetEnabled) - { - _UnregisterRenderCallback(pObject); - } -#endif - evas_object_image_size_get(pObject, &objectWidth, &objectHeight); - colorSpace = evas_object_image_colorspace_get(pObject); - if (colorSpace == EVAS_COLORSPACE_ARGB8888) - { - objectBitsPerPixel = 32; - } - else if (colorSpace == EVAS_COLORSPACE_RGB565_A5P) - { - objectBitsPerPixel = 24; - } - else if (colorSpace == EVAS_COLORSPACE_GRY8) - { - objectBitsPerPixel = 8; - } - else - { - SysLog(NID_GRP, "Incompatible color space for Evas Object."); - objectBitsPerPixel = 0; - } + SysTryReturnVoidResult(NID_GRP, pObject != null, E_OPERATION_FAILED, "Invalid object."); - int size = objectWidth * objectHeight * objectBitsPerPixel; + bool needAllocateObject = true; - if (size > 0) + if (isEvasNativeSetEnabled) + { +#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) + _UnregisterRenderCallback(pObject); +#endif + if (isDoublePixmapEnabled) { - void* pPtr = new (std::nothrow) int[size]; - if (pPtr == null) + if (!isBackbuffer) { - SysLog(NID_GRP, "Fail to allocate memory for Evas Object."); + delete pVisualElementSurface; + delete pBitmap; + needAllocateObject = false; } - - evas_object_image_data_set(pObject, pPtr); } - else + } + + if (needAllocateObject) + { + if (pVisualElement != null) { - evas_object_image_data_set(pObject, NULL); - SysLog(NID_GRP, "Incompatible size for Evas object. w:%d h:%d bps:%d", objectWidth, objectHeight, objectBitsPerPixel); + delete pVisualElementSurface; + pVisualElement->SetSurface(null); } delete pBitmap; @@ -255,8 +259,10 @@ public: Bitmap* pBitmap; Evas_Object* pObject; EGLNativePixmapType nativePixmap; - _VisualElementImpl* pVisualElementImpl; - Control* pControl; + VisualElement* pVisualElement; + VisualElementSurface* pVisualElementSurface; + int glVersion; + Tizen::Ui::Window* pWindow; #if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER) Ecore_X_Image* pEcoreImage; int width; @@ -273,11 +279,14 @@ public: GLuint textureId; GLuint program; Frame* pFrame; - int glVersion; bool isFboAvailable; int fboWidth; int fboHeight; #endif + bool isBackbuffer; + bool wasShown; + bool swapDone; + _SglInfo* pSecondSglInfo; private: _SglInfo(const _SglInfo& sglInfo); @@ -290,8 +299,9 @@ public: _PixmapInfo(void) : nativePixmap((Pixmap)0) #if defined(FGRAPHICS_INTERNAL_USE_DRM) - , pDrmBufMgr(null) - , pDrmBufferObject(null) + , pTbmBufMgr(null) + , pTbmBufferObject(null) + , drmFd(0) #endif { } @@ -300,13 +310,13 @@ public: { Display* pDisplay = (Display*)ecore_x_display_get(); #if defined(FGRAPHICS_INTERNAL_USE_DRM) - drm_slp_bo_unmap(this->pDrmBufferObject, DRM_SLP_DEVICE_CPU); - drm_slp_bo_unref(this->pDrmBufferObject); - if (this->pDrmBufMgr) + tbm_bo_unmap(this->pTbmBufferObject); + if (this->pTbmBufMgr) { - close(this->pDrmBufMgr->drm_fd); + close(this->drmFd); } - drm_slp_bufmgr_destroy(this->pDrmBufMgr); + + tbm_bufmgr_deinit(this->pTbmBufMgr); DRI2DestroyDrawable(pDisplay, this->nativePixmap); #endif XFreePixmap(pDisplay, this->nativePixmap); @@ -315,8 +325,9 @@ public: public: Pixmap nativePixmap; #if defined(FGRAPHICS_INTERNAL_USE_DRM) - drm_slp_bufmgr pDrmBufMgr; - drm_slp_bo pDrmBufferObject; + tbm_bufmgr pTbmBufMgr; + tbm_bo pTbmBufferObject; + int drmFd; #endif }; @@ -325,200 +336,155 @@ void _EvasObjectImageChange(_SglInfo* pSglInfo); void _OnBoundsChanged(void* pData) { - _SglInfo* pSglInfo = (_SglInfo*)pData; - _SglIndex readSurface = 0; - _SglIndex drawSurface = 0; - bool needMakeCurrent = false; - EGLBoolean ret = EGL_FALSE; - int width = 0; - int height = 0; - VisualElementSurface* pVisualElementSurface = null; - _VisualElementSurfaceImpl* pVisualElementSurfaceImpl = null; + _SglInfo* pSglInfo = dynamic_cast<_SglInfo*> ((_SglInfo*)pData); + SysTryReturnVoidResult(NID_GRP, pSglInfo != null + && pSglInfo->sglIndex > INVALID_SGL_INDEX + && pSglInfo->pVisualElement != null + && pSglInfo->pWindow != null + , E_INVALID_STATE, "Invalid state."); + + EGLDisplay eglDisplay = eglGetCurrentDisplay(); + _SglIndex readSurface = (_SglIndex)_SglGetCurrentSurface(EGL_READ); + _SglIndex drawSurface = (_SglIndex)_SglGetCurrentSurface(EGL_DRAW); + EGLSurface eglContext = eglGetCurrentContext(); + + eglMakeCurrent(pSglInfo->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + EGLBoolean ret = eglDestroySurface(pSglInfo->display, pSglInfo->surface); + SysTryReturnVoidResult(NID_GRP, ret == EGL_TRUE, E_OPERATION_FAILED, "eglDestroySurface failed."); + + FloatRectangle rect = pSglInfo->pVisualElement->GetBounds(); + int width = int(rect.width); + int height = int(rect.height); + SysTryReturnVoidResult(NID_GRP, width > 0 && height > 0, E_OUT_OF_RANGE, "Invalid size. w:%d h:%d", width, height); + + delete pSglInfo->pVisualElementSurface; + pSglInfo->pVisualElementSurface = null; + + Evas* pEvas = evas_object_evas_get(pSglInfo->pObject); + Evas_Object* pObject = evas_object_image_filled_add(pEvas); + SysTryReturnVoidResult(NID_GRP, pObject != null, E_INVALID_STATE, "Invalid object."); + + evas_object_image_alpha_set(pObject, EINA_TRUE); + evas_object_image_size_set(pObject, width, height); + evas_object_resize(pObject, width, height); + evas_object_hide(pObject); + + VisualElementSurface* pVisualElementSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN( + *pSglInfo->pWindow->GetDisplayContext(), (Handle)pObject, Dimension(width, height)); + SysTryReturnVoidResult(NID_GRP, pVisualElementSurface != null, E_OPERATION_FAILED, "Creating VisualElementSurface failed."); - result r = E_SUCCESS; - Tizen::Graphics::FloatRectangle rect; + delete pSglInfo->pBitmap; + pSglInfo->pBitmap = null; - if (pSglInfo == null || pSglInfo->sglIndex <= INVALID_SGL_INDEX) - { - goto CATCH_01; - } + std::auto_ptr bitmap(new (std::nothrow) Bitmap); + SysTryReturnVoidResult(NID_GRP, bitmap.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient."); - readSurface = (_SglIndex)_SglGetCurrentSurface(EGL_READ); - drawSurface = (_SglIndex)_SglGetCurrentSurface(EGL_DRAW); - if (readSurface == pSglInfo->sglIndex || drawSurface == pSglInfo->sglIndex) - { - needMakeCurrent = true; - } + result r = bitmap.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturnVoidResult(NID_GRP, r == E_SUCCESS, r, "Propagating."); - ret = eglMakeCurrent(pSglInfo->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (ret == EGL_FALSE) - { - goto CATCH_01; - } + EGLNativePixmapType nativePixmap = _CreateNativePixmap(pSglInfo->sglIndex, bitmap.get()); + SysTryReturnVoidResult(NID_GRP, nativePixmap != (EGLNativePixmapType)0, E_OPERATION_FAILED, "Propagating."); - ret = eglDestroySurface(pSglInfo->display, pSglInfo->surface); - if (ret == EGL_FALSE) - { - goto CATCH_02; - } + EGLSurface eglSurface = eglCreatePixmapSurface(pSglInfo->display, pSglInfo->config, nativePixmap, null); + SysTryReturnVoidResult(NID_GRP, eglSurface != EGL_NO_SURFACE, E_OPERATION_FAILED, "eglCreatePixmapSurface failed."); - if (pSglInfo->pVisualElementImpl == null) + eglMakeCurrent(pSglInfo->display, eglSurface, eglSurface, pSglInfo->context); + if (pSglInfo->glVersion == 1) { - goto CATCH_02; + _GlClear_1(GL_COLOR_BUFFER_BIT); } - - rect = pSglInfo->pVisualElementImpl->GetBounds(); - width = int(rect.width); - height = int(rect.height); - if (width <= 0 || height <=0) + else { - goto CATCH_02; + _GlClear_2(GL_COLOR_BUFFER_BIT); } - if (isEvasNativeSetEnabled) + pSglInfo->nativePixmap = nativePixmap; + pSglInfo->surface = eglSurface; + pSglInfo->pObject = pObject; + pSglInfo->pVisualElementSurface = pVisualElementSurface; + + if (isDoublePixmapEnabled) { - if (pSglInfo->pControl == null) - { - goto CATCH_02; - } + _SglInfo* pSglInfoSecond = pSglInfo->pSecondSglInfo; + SysTryReturnVoidResult(NID_GRP, pSglInfoSecond != null, E_INVALID_STATE, "Invalid pSecondSglInfo."); - _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pSglInfo->pControl); - if (pControlImpl == null) - { - goto CATCH_02; - } + eglMakeCurrent(pSglInfo->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + ret = eglDestroySurface(pSglInfoSecond->display, pSglInfoSecond->surface); + SysTryReturnVoidResult(NID_GRP, ret == EGL_TRUE, E_OPERATION_FAILED, "eglDestroySurface failed."); - VisualElement* pVE = pControlImpl->GetCore().GetVisualElement(); - if (pVE == null) - { - goto CATCH_02; - } + delete pSglInfoSecond->pVisualElementSurface; + pSglInfoSecond->pVisualElementSurface = null; - Control* pFrame = pSglInfo->pControl; - Control* pTemp = pFrame->GetParent(); - while(pTemp != null) - { - pFrame = pTemp; - pTemp = pTemp->GetParent(); - } + pObject = evas_object_image_filled_add(pEvas); + SysTryReturnVoidResult(NID_GRP, pObject != null, E_INVALID_STATE, "Invalid object."); - Dimension size(width, height); - Tizen::Ui::Window* pWindow = dynamic_cast (pFrame); - if (pWindow == null) - { - goto CATCH_02; - } + evas_object_image_alpha_set(pObject, EINA_TRUE); + evas_object_image_size_set(pObject, width, height); + evas_object_resize(pObject, width, height); + evas_object_hide(pObject); - pVisualElementSurface = new (std::nothrow) VisualElementSurface(); - if (pVisualElementSurface == null) - { - goto CATCH_02; - } + pVisualElementSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN( + *pSglInfo->pWindow->GetDisplayContext(), (Handle)pObject, Dimension(width, height)); + SysTryReturnVoidResult(NID_GRP, pVisualElementSurface != null, E_OPERATION_FAILED, "Creating VisualElementSurface failed."); - r = pVisualElementSurface->Construct(*pWindow->GetDisplayContext(), size); - pVE->SetSurface(pVisualElementSurface); - } - else - { - pVisualElementSurface = pSglInfo->pVisualElementImpl->GetSurfaceN(); - if (pVisualElementSurface == null) - { - goto CATCH_02; - } - } + delete pSglInfoSecond->pBitmap; + pSglInfoSecond->pBitmap = null; - if (pSglInfo->pBitmap != null) - { - delete pSglInfo->pBitmap; - pSglInfo->pBitmap = null; - } + std::auto_ptr bitmapSecond(new (std::nothrow) Bitmap); + SysTryReturnVoidResult(NID_GRP, bitmapSecond.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient."); - pSglInfo->pBitmap = new (std::nothrow) Tizen::Graphics::Bitmap; - if (pSglInfo->pBitmap == null) - { - goto CATCH_03; - } - - r = pSglInfo->pBitmap->Construct(Tizen::Graphics::Rectangle(0, 0, width, height)); - if (r != E_SUCCESS) - { - goto CATCH_04; - } + r = bitmapSecond.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturnVoidResult(NID_GRP, r == E_SUCCESS, r, "Propagating."); - pSglInfo->nativePixmap = _CreateNativePixmap(pSglInfo->sglIndex, pSglInfo->pBitmap); - if (pSglInfo->nativePixmap == 0) - { - goto CATCH_04; - } + EGLNativePixmapType nativePixmap = _CreateNativePixmap(pSglInfoSecond->sglIndex, bitmapSecond.get()); + SysTryReturnVoidResult(NID_GRP, nativePixmap != (EGLNativePixmapType)0, E_OPERATION_FAILED, "Propagating."); - pSglInfo->surface = eglCreatePixmapSurface(pSglInfo->display, pSglInfo->config, pSglInfo->nativePixmap, null); - if (pSglInfo->surface == EGL_NO_SURFACE) - { - goto CATCH_04; - } + EGLSurface eglSurface = eglCreatePixmapSurface(pSglInfoSecond->display, pSglInfoSecond->config, nativePixmap, null); + SysTryReturnVoidResult(NID_GRP, eglSurface != EGL_NO_SURFACE, E_OPERATION_FAILED, "eglCreatePixmapSurface failed."); - if (needMakeCurrent) - { - eglMakeCurrent(pSglInfo->display, pSglInfo->surface, pSglInfo->surface, pSglInfo->context); - eglWaitGL(); -#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) - _SaveCurrentContext(pSglInfo->display, pSglInfo->surface, pSglInfo->surface, pSglInfo->context); -#endif - } + eglMakeCurrent(pSglInfoSecond->display, eglSurface, eglSurface, pSglInfoSecond->context); + if (pSglInfoSecond->glVersion == 1) + { + _GlClear_1(GL_COLOR_BUFFER_BIT); + } + else + { + _GlClear_2(GL_COLOR_BUFFER_BIT); + } - pVisualElementSurfaceImpl = _VisualElementSurfaceImpl::GetInstance(*pVisualElementSurface); - if (pVisualElementSurfaceImpl == null) - { - goto CATCH_04; + pSglInfoSecond->nativePixmap = nativePixmap; + pSglInfoSecond->surface = eglSurface; + pSglInfoSecond->pObject = pObject; + pSglInfoSecond->pVisualElementSurface = pVisualElementSurface; + pSglInfoSecond->pBitmap = bitmapSecond.release(); + _EvasObjectImageChange(pSglInfoSecond); } - - pSglInfo->pObject = (Evas_Object*)pVisualElementSurfaceImpl->GetNativeHandle(); - if (pSglInfo->pObject == null) + else { - goto CATCH_04; + if (pSglInfo->pVisualElement != null) + { + pSglInfo->pVisualElement->SetSurface(pVisualElementSurface); + } } + pSglInfo->pBitmap = bitmap.release(); _EvasObjectImageChange(pSglInfo); - return; - -CATCH_04: - delete pSglInfo->pBitmap; - pSglInfo->pBitmap = null; - //fall through - -CATCH_03: - delete pVisualElementSurface; - //fall through + _SglMakeCurrent(eglDisplay, (EGLSurface)drawSurface, (EGLSurface)readSurface, eglContext); -CATCH_02: - if (needMakeCurrent) - { - eglMakeCurrent(pSglInfo->display, pSglInfo->surface, pSglInfo->surface, pSglInfo->context); - eglWaitGL(); -#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) - _SaveCurrentContext(pSglInfo->display, pSglInfo->surface, pSglInfo->surface, pSglInfo->context); -#endif - } - //fall through - -CATCH_01: - SysLog(NID_GRP, "_OnBoundsChanged failed!! pSglInfo:%#x", (unsigned int)pSglInfo); + return; } #if defined(FGRAPHICS_INTERNAL_USE_FBO) void _OnBoundsChangedFbo(void* pData) { - _SglInfo* pSglInfo = (_SglInfo*)pData; + _SglInfo* pSglInfo = dynamic_cast<_SglInfo*> ((_SglInfo*)pData); + SysTryReturnVoidResult(NID_GRP, pSglInfo != null + && pSglInfo->pVisualElement != null + , E_INVALID_STATE, "Invalid state."); - if (pSglInfo == null || pSglInfo->pVisualElementImpl == null) - { - SysLog(NID_GRP, "FBO Invalid data"); - return; - } - - FloatRectangle rect = pSglInfo->pVisualElementImpl->GetBounds(); + FloatRectangle rect = pSglInfo->pVisualElement->GetBounds(); pSglInfo->fboWidth = int(rect.width); pSglInfo->fboHeight = int(rect.height); @@ -579,6 +545,22 @@ _OnBoundsChangedFbo(void* pData) } #endif //#if defined(FGRAPHICS_INTERNAL_USE_FBO) +void +_OnDestroyed(void* pData) +{ + _SglInfo* pSglInfo = dynamic_cast<_SglInfo*> ((_SglInfo*)pData); + + if (pSglInfo != null) + { + pSglInfo->pVisualElement = null; + + if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null) + { + pSglInfo->pSecondSglInfo->pVisualElement = null; + } + } +} + class _SglInfoTableManipulator { public: @@ -650,9 +632,10 @@ public: __SglInfoTable[0] = new (std::nothrow) _SglInfo; if (__SglInfoTable[0] != null) - { + { ret = true; __SglInitialized = true; + __SglInfoTable[0]->glVersion = 2; } __SglMutex.Release(); @@ -809,13 +792,13 @@ _PixmapSurfaceDestroyCallback(void* pCallbackParam) void _PixmapLockCallBack(void* pCallbackParam) { - drm_slp_bo_map((drm_slp_bo)pCallbackParam, DRM_SLP_DEVICE_CPU, DRM_SLP_OPTION_READ | DRM_SLP_OPTION_WRITE); + tbm_bo_map((tbm_bo)pCallbackParam, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE); } void _PixmapUnlockCallBack(void* pCallbackParam) { - drm_slp_bo_unmap((drm_slp_bo)pCallbackParam, DRM_SLP_DEVICE_CPU); + tbm_bo_unmap((tbm_bo)pCallbackParam); } #endif @@ -879,7 +862,7 @@ _EvasObjectImageChange(_SglInfo* pSglInfo) } else { - Tizen::Graphics::BufferInfo bufferInfo; + BufferInfo bufferInfo; pSglInfo->pBitmap->Lock(bufferInfo); evas_object_image_data_set(pSglInfo->pObject, bufferInfo.pPixels); pSglInfo->pBitmap->Unlock(); @@ -888,74 +871,110 @@ _EvasObjectImageChange(_SglInfo* pSglInfo) #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) int __registerCallbackCount = 0; -EGLDisplay __previousDisplay = EGL_NO_DISPLAY; -EGLSurface __previousDrawSurface = EGL_NO_SURFACE; -EGLSurface __previousReadSurface = EGL_NO_SURFACE; -EGLContext __previousContext = EGL_NO_CONTEXT; +_SglInfo* __pPreviousSglInfo = null; void _PostRenderCallback(Ecore_Evas* ee) { - EGLBoolean ret = eglMakeCurrent(__previousDisplay, __previousDrawSurface, __previousReadSurface, __previousContext); - SysTryLog(NID_GRP, ret == EGL_TRUE, "fail to restore previous surface and context. %#x %#x %#x %#x egl error:%#x" - , (unsigned int)__previousDisplay - , (unsigned int)__previousDrawSurface - , (unsigned int)__previousReadSurface - , (unsigned int)__previousContext - , (unsigned int)eglGetError()); + if (__pPreviousSglInfo != null) + { + EGLDisplay display = __pPreviousSglInfo->display; + EGLSurface surface = __pPreviousSglInfo->surface; + EGLContext context = __pPreviousSglInfo->context; + + if (isDoublePixmapEnabled) + { + _SglInfo* pBackSglInfo = null; + _SglInfo* pFrontSglInfo = null; + + if (__pPreviousSglInfo->isBackbuffer) + { + pBackSglInfo = __pPreviousSglInfo; + pFrontSglInfo = __pPreviousSglInfo->pSecondSglInfo; + } + else + { + pBackSglInfo = __pPreviousSglInfo->pSecondSglInfo; + pFrontSglInfo = __pPreviousSglInfo; + } + + if (!pBackSglInfo->wasShown && __pPreviousSglInfo->pVisualElement != null) + { + __pPreviousSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface); + evas_object_image_pixels_dirty_set(pFrontSglInfo->pObject, EINA_TRUE); + evas_object_hide(pBackSglInfo->pObject); + + pBackSglInfo->wasShown = true; + pFrontSglInfo->swapDone = true; + } + + surface = pBackSglInfo->surface; + } + + EGLBoolean ret = eglMakeCurrent(display, surface, surface, context); + SysTryLog(NID_GRP, ret == EGL_TRUE, "fail to restore previous surface and context. %#x %#x %#x %#x egl error:%#x" + , (unsigned int)display + , (unsigned int)surface + , (unsigned int)surface + , (unsigned int)context + , (unsigned int)eglGetError()); + } } void -_SaveCurrentContext(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) +_SaveCurrentContext(_SglInfo* pSglInfo) { - __previousDisplay = dpy; - __previousDrawSurface = draw; - __previousReadSurface = read; - __previousContext = ctx; + __pPreviousSglInfo = pSglInfo; } void _RegisterRenderCallback(Evas_Object* pObject) { - if (__registerCallbackCount == 0) + if (isEvasNativeSetEnabled && pObject != null) { - Evas* pEvas = evas_object_evas_get(pObject); - if (pEvas == null) + if (__registerCallbackCount == 0) { - return; - } + Evas* pEvas = evas_object_evas_get(pObject); + if (pEvas == null) + { + return; + } - Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(pEvas); - if (pEcoreEvas == null) - { - return; - } + Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(pEvas); + if (pEcoreEvas == null) + { + return; + } - ecore_evas_callback_post_render_set(pEcoreEvas, _PostRenderCallback); + ecore_evas_callback_post_render_set(pEcoreEvas, _PostRenderCallback); + } + __registerCallbackCount++; } - __registerCallbackCount++; } void _UnregisterRenderCallback(Evas_Object* pObject) { - __registerCallbackCount--; - - if (__registerCallbackCount == 0) + if (isEvasNativeSetEnabled && pObject != null) { - Evas* pEvas = evas_object_evas_get(pObject); - if (pEvas == null) - { - return; - } + __registerCallbackCount--; - Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(pEvas); - if (pEcoreEvas == null) + if (__registerCallbackCount == 0) { - return; - } + Evas* pEvas = evas_object_evas_get(pObject); + if (pEvas == null) + { + return; + } - ecore_evas_callback_post_render_set(pEcoreEvas, NULL); + Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(pEvas); + if (pEcoreEvas == null) + { + return; + } + + ecore_evas_callback_post_render_set(pEcoreEvas, NULL); + } } } #endif //#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) @@ -1042,38 +1061,25 @@ EGLSurface _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint* pAttribList) { _SglIndex sglIndex = INVALID_SGL_INDEX; - Tizen::Graphics::Bitmap* pBitmap = null; - VisualElementSurface* pVisualElementSurface = null; Object* pObj = (Object*)win; - VisualElement* pVE = dynamic_cast(pObj); - Tizen::Ui::Control* pControl = dynamic_cast(pObj); + VisualElement* pVisualElement = dynamic_cast (pObj); + Tizen::Ui::Control* pControl = dynamic_cast (pObj); #if !defined(_OSP_EMUL_) - Tizen::Ui::Controls::Frame* pFrame = dynamic_cast(pControl); + Tizen::Ui::Controls::Frame* pFrame = dynamic_cast (pControl); #endif + SysTryReturn(NID_GRP, pControl != null || pVisualElement != null, EGL_NO_SURFACE, E_INVALID_ARG, "Invalid NativeWindow."); _SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance(); - if (pControl == null && pVE == null) - { - goto CATCH_01; - } - #if !defined(_OSP_EMUL_) if (pFrame != null && !_IsEvasGlEnabled()) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl); _WindowImpl* pWindowImpl = dynamic_cast<_WindowImpl*> (pControlImpl); - if (pWindowImpl == null) - { - goto CATCH_01; - } + SysTryReturn(NID_GRP, pWindowImpl != null, EGL_NO_SURFACE, E_INVALID_STATE, "Invalid window state."); EGLNativeWindowType nativeWindow = (EGLNativeWindowType)pWindowImpl->GetNativeHandle(); - sglIndex = pSglInfoTableManipulatorInstance->CreateSglIndex(); - if (sglIndex <= INVALID_SGL_INDEX) - { - goto CATCH_01; - } + SysTryReturn(NID_GRP, sglIndex > INVALID_SGL_INDEX, EGL_NO_SURFACE, E_OPERATION_FAILED, "Invalid SglIndex."); EGLSurface windowSurface = eglCreateWindowSurface(dpy, config, nativeWindow, pAttribList); if (windowSurface == EGL_NO_SURFACE) @@ -1083,12 +1089,18 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi } else { - _VisualElementImpl* visualElementImpl = _VisualElementImpl::GetInstance(*pControlImpl->GetCore().GetVisualElement()); - if (visualElementImpl == null) + VisualElement* pVisualElement = pControlImpl->GetCore().GetVisualElement(); + if (pVisualElement == null) + { + pSglInfoTableManipulatorInstance->DestroySglIndex(sglIndex); + return EGL_NO_SURFACE; + } + + _VisualElementImpl* pVisualElementImpl = _VisualElementImpl::GetInstance(*pVisualElement); + if (pVisualElementImpl == null) { pSglInfoTableManipulatorInstance->DestroySglIndex(sglIndex); - sglIndex = 0; - goto CATCH_01; + return EGL_NO_SURFACE; } _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); @@ -1100,8 +1112,8 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi eglGetConfigAttrib(dpy, config, EGL_STENCIL_SIZE, &pSglInfo->stencilSize); pSglInfo->display = dpy; - pSglInfo->pVisualElementImpl = visualElementImpl; - pSglInfo->pVisualElementImpl->SetBoundsChangedCallback(_OnBoundsChangedFbo, pSglInfo); + pSglInfo->pVisualElement = pVisualElement; + pVisualElementImpl->SetBoundsChangedCallback(_OnBoundsChangedFbo, pSglInfo); #endif pSglInfo->surface = windowSurface; @@ -1113,37 +1125,7 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi else #endif //#if !defined(_OSP_EMUL_) { - _VisualElementImpl* pVisualElementImpl = null; - _VisualElementSurfaceImpl* pVisualElementSurfaceImpl = null; - int width = 0; - int height = 0; result r = E_SUCCESS; - Tizen::Graphics::FloatRectangle rect; - _SglInfo* pSglInfo = null; - - if (pVE == null) - { - _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl); - if (pControlImpl == null) - { - goto CATCH_01; - } - pVE = pControlImpl->GetCore().GetVisualElement(); - } - - pVisualElementImpl = _VisualElementImpl::GetInstance(*pVE); - if (pVisualElementImpl == null) - { - goto CATCH_01; - } - - rect = pVisualElementImpl->GetBounds(); - width = int(rect.width); - height = int(rect.height); - if (width <= 0 || height <= 0) - { - goto CATCH_01; - } #if defined (FGRAPHICS_INTERNAL_USE_EVAS_NATIVE_SURFACE) isEvasNativeSetEnabled = _IsEvasGlEnabled(); @@ -1151,110 +1133,145 @@ _SglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType wi isEvasNativeSetEnabled = false; #endif - if (isEvasNativeSetEnabled) +#if defined (FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP) + isDoublePixmapEnabled = isEvasNativeSetEnabled; +#else + isDoublePixmapEnabled = false; +#endif + + if (pVisualElement == null) { - Control* pFrame = pControl; - Control* pTemp = pFrame->GetParent(); - while(pTemp != null) - { - pFrame = pTemp; - pTemp = pTemp->GetParent(); - } + pVisualElement = pControl->GetVisualElement(); + } + SysTryReturn(NID_GRP, pVisualElement != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - Dimension size(width, height); - Tizen::Ui::Window* pWindow = dynamic_cast (pFrame); - if (pWindow == null) - { - goto CATCH_01; - } + _VisualElementImpl* pVisualElementImpl = _VisualElementImpl::GetInstance(*pVisualElement); + SysTryReturn(NID_GRP, pVisualElementImpl != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - pVisualElementSurface = new (std::nothrow) VisualElementSurface(); - if (pVisualElementSurface == null) - { - goto CATCH_01; - } + FloatRectangle rect = pVisualElement->GetBounds(); + int width = int(rect.width); + int height = int(rect.height); + SysTryReturn(NID_GRP, width > 0 && height > 0, EGL_NO_SURFACE, E_OUT_OF_RANGE, "Invalid size. w:%d h:%d", width, height); - r = pVisualElementSurface->Construct(*pWindow->GetDisplayContext(), size); - pVE->SetSurface(pVisualElementSurface); - } - else + Control* pFrame = pControl; + Control* pTemp = pFrame->GetParent(); + while(pTemp != null) { - pVisualElementSurface = pVisualElementImpl->GetSurfaceN(); - if (pVisualElementSurface == null) - { - goto CATCH_01; - } + pFrame = pTemp; + pTemp = pTemp->GetParent(); } - pBitmap = new (std::nothrow) Tizen::Graphics::Bitmap; - if (pBitmap == null) - { - goto CATCH_02; - } + Tizen::Ui::Window* pWindow = dynamic_cast (pFrame); + SysTryReturn(NID_GRP, pWindow != null, EGL_NO_SURFACE, E_INVALID_STATE, "Invalid window."); - r = pBitmap->Construct(Tizen::Graphics::Rectangle(0, 0, width, height)); - if (r != E_SUCCESS) - { - goto CATCH_03; - } + VisualElementSurface* pVisualElementSurface = pVisualElement->GetSurfaceN(); + SysTryReturn(NID_GRP, pVisualElementSurface != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - sglIndex = (_SglIndex)_SglCreatePixmapSurface(dpy, config, (EGLNativePixmapType)pBitmap, null); - if (sglIndex <= INVALID_SGL_INDEX) - { - goto CATCH_03; - } + _VisualElementSurfaceImpl* pVisualElementSurfaceImpl = _VisualElementSurfaceImpl::GetInstance(*pVisualElementSurface); + SysTryReturn(NID_GRP, pVisualElementSurfaceImpl != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); - pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); + Evas_Object* pObject = (Evas_Object*)pVisualElementSurfaceImpl->GetNativeHandle(); + delete pVisualElementSurface; + + Evas* pEvas = evas_object_evas_get(pObject); + pObject = evas_object_image_filled_add(pEvas); + SysTryReturn(NID_GRP, pObject != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Invalid object."); + + evas_object_image_alpha_set(pObject, EINA_TRUE); + evas_object_image_size_set(pObject, width, height); + evas_object_resize(pObject, width, height); + evas_object_hide(pObject); + + pVisualElementSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN( + *pWindow->GetDisplayContext(), (Handle)pObject, Dimension(width, height)); + SysTryReturn(NID_GRP, pVisualElementSurface != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); + + std::auto_ptr bitmap(new (std::nothrow) Bitmap); + SysTryReturn(NID_GRP, bitmap.get() != null, EGL_NO_SURFACE, E_OUT_OF_MEMORY, "The memory is insufficient."); + r = bitmap.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturn(NID_GRP, r == E_SUCCESS, EGL_NO_SURFACE, r, "Propagating."); + + sglIndex = (_SglIndex)_SglCreatePixmapSurface(dpy, config, (EGLNativePixmapType)bitmap.get(), null); + SysTryReturn(NID_GRP, sglIndex > INVALID_SGL_INDEX, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); + + BufferInfo bufferInfo; + bitmap.get()->Lock(bufferInfo); + memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); + bitmap.get()->Unlock(); + + _SglInfo* pSglInfo = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); pSglInfo->sglIndex = sglIndex; pSglInfo->display = dpy; pSglInfo->config = config; - pSglInfo->pBitmap = pBitmap; - pSglInfo->pVisualElementImpl = pVisualElementImpl; - pSglInfo->pControl = pControl; - - pVisualElementImpl->SetBoundsChangedCallback(_OnBoundsChanged, pSglInfo); - + pSglInfo->pVisualElement = pVisualElement; + pSglInfo->pWindow = pWindow; + pSglInfo->pObject = pObject; + pSglInfo->pVisualElementSurface = pVisualElementSurface; pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); - pVisualElementSurfaceImpl = _VisualElementSurfaceImpl::GetInstance(*pVisualElementSurface); - if (pVisualElementSurfaceImpl == null) + if (isDoublePixmapEnabled) { - goto CATCH_03; - } + pObject = evas_object_image_filled_add(pEvas); + SysTryReturn(NID_GRP, pObject != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Invalid object."); + + evas_object_image_alpha_set(pObject, EINA_TRUE); + evas_object_image_size_set(pObject, width, height); + evas_object_resize(pObject, width, height); + evas_object_hide(pObject); + + pVisualElementSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN( + *pWindow->GetDisplayContext(), (Handle)pObject, Dimension(width, height)); + SysTryReturn(NID_GRP, pSglInfo->pVisualElementSurface != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); + + delete pSglInfo->pBitmap; + pSglInfo->pBitmap = null; + + std::auto_ptr bitmapSecond(new (std::nothrow) Bitmap); + SysTryReturn(NID_GRP, bitmapSecond.get() != null, EGL_NO_SURFACE, E_OUT_OF_MEMORY, "The memory is insufficient."); + + r = bitmapSecond.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturn(NID_GRP, r == E_SUCCESS, EGL_NO_SURFACE, r, "Propagating."); + + sglIndex = (_SglIndex)_SglCreatePixmapSurface(dpy, config, (EGLNativePixmapType)bitmapSecond.get(), null); + SysTryReturn(NID_GRP, sglIndex > INVALID_SGL_INDEX, EGL_NO_SURFACE, E_OPERATION_FAILED, "Propagating."); + + bitmapSecond.get()->Lock(bufferInfo); + memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height); + bitmapSecond.get()->Unlock(); + + _SglInfo* pSglInfoSecond = pSglInfoTableManipulatorInstance->LockSglInfoTable(sglIndex); + pSglInfoSecond->sglIndex = sglIndex; + pSglInfoSecond->display = dpy; + pSglInfoSecond->config = config; + pSglInfoSecond->pVisualElement = pVisualElement; + pSglInfoSecond->pWindow = pWindow; + pSglInfoSecond->pObject = pObject; + pSglInfoSecond->pVisualElementSurface = pVisualElementSurface; + pSglInfoSecond->swapDone = true; + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); - pSglInfo->pObject = (Evas_Object*)pVisualElementSurfaceImpl->GetNativeHandle(); - if (pSglInfo->pObject == null) + pSglInfo->pSecondSglInfo = pSglInfoSecond; + pSglInfoSecond->pSecondSglInfo = pSglInfo; + + pSglInfoSecond->pBitmap = bitmapSecond.release(); + _EvasObjectImageChange(pSglInfoSecond); + } + else { - goto CATCH_03; + pVisualElement->SetSurface(pSglInfo->pVisualElementSurface); } + pSglInfo->pBitmap = bitmap.release(); _EvasObjectImageChange(pSglInfo); + pVisualElementImpl->SetBoundsChangedCallback(_OnBoundsChanged, pSglInfo); + pVisualElementImpl->SetDestroyedCallback(_OnDestroyed, pSglInfo); #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) - if (isEvasNativeSetEnabled) - { - _RegisterRenderCallback(pSglInfo->pObject); - } + _RegisterRenderCallback(pSglInfo->pObject); #endif - - return (EGLSurface)sglIndex; + return (EGLSurface)pSglInfo->sglIndex; } - -CATCH_03: - delete pBitmap; - - pSglInfoTableManipulatorInstance->DestroySglIndex(sglIndex); - //fall through - -CATCH_02: - delete pVisualElementSurface; - //fall through - -CATCH_01: - SysLog(NID_GRP, "_SglCreateWindowSurface failed!! dpy:%#x config:%#x pControl:%#x pAttribList:%#x", - (unsigned int)dpy, (unsigned int)config, (unsigned int)pControl, (unsigned int)pAttribList); - return eglCreateWindowSurface(dpy, config, (EGLNativeWindowType) 0, pAttribList); } EGLSurface @@ -1309,8 +1326,8 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) int dri2Width = 0; int dri2Height = 0; int dri2BufferCount = 0; - int drmFile = 0; - void* pData = null; + tbm_bo_handle tbmData = { null, }; + Bool ret = False; drm_magic_t magic = 0; #endif @@ -1368,22 +1385,23 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) goto CATCH_03; } - drmFile = open(pDeviceName, O_RDWR); + pPixmapInfo->drmFd = open(pDeviceName, O_RDWR); + free(pDeviceName); - if (drmFile < 0) + if (pPixmapInfo->drmFd < 0) { goto CATCH_03; } - drmGetMagic(drmFile, &magic); + drmGetMagic(pPixmapInfo->drmFd, &magic); ret = DRI2Authenticate(pNativeDisplay, nativeWindow, (unsigned int)magic); if (!ret) { goto CATCH_04; } - pPixmapInfo->pDrmBufMgr = drm_slp_bufmgr_init(drmFile, null); - if (pPixmapInfo->pDrmBufMgr == null) + pPixmapInfo->pTbmBufMgr = tbm_bufmgr_init(pPixmapInfo->drmFd); + if (pPixmapInfo->pTbmBufMgr == null) { goto CATCH_04; } @@ -1394,20 +1412,20 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) goto CATCH_05; } - pPixmapInfo->pDrmBufferObject = drm_slp_bo_import(pPixmapInfo->pDrmBufMgr, pDri2Buffer->name); + pPixmapInfo->pTbmBufferObject = tbm_bo_import(pPixmapInfo->pTbmBufMgr, pDri2Buffer->name); free(pDri2Buffer); - if (pPixmapInfo->pDrmBufferObject == null) + if (pPixmapInfo->pTbmBufferObject == null) { goto CATCH_05; } - pData = (void*)drm_slp_bo_get_handle(pPixmapInfo->pDrmBufferObject, DRM_SLP_DEVICE_CPU); - if (pData == null) + tbmData = tbm_bo_get_handle(pPixmapInfo->pTbmBufferObject, TBM_DEVICE_CPU); + if (tbmData.ptr == null) { goto CATCH_06; } - r = Tizen::Graphics::_BitmapTool::ChangeBuffer(*pBitmap, pData, width * bitsPerPixel / 8, + r = Tizen::Graphics::_BitmapTool::ChangeBuffer(*pBitmap, tbmData.ptr, width * bitsPerPixel / 8, _PixmapSurfaceDestroyCallback, (void*)pPixmapInfo); if (r != E_SUCCESS) { @@ -1415,7 +1433,7 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) } if (!Tizen::Graphics::_BitmapTool::SetCallback(*pBitmap, _PixmapSurfaceDestroyCallback, pPixmapInfo, - _PixmapLockCallBack, pPixmapInfo->pDrmBufferObject,_PixmapUnlockCallBack, pPixmapInfo->pDrmBufferObject)) + _PixmapLockCallBack, pPixmapInfo->pTbmBufferObject,_PixmapUnlockCallBack, pPixmapInfo->pTbmBufferObject)) { goto CATCH_06; } @@ -1471,16 +1489,15 @@ _CreateNativePixmap(_SglIndex sglIndex, Tizen::Graphics::Bitmap* pBitmap) CATCH_06: #if defined(FGRAPHICS_INTERNAL_USE_DRM) - drm_slp_bo_unmap(pPixmapInfo->pDrmBufferObject, DRM_SLP_DEVICE_CPU); - drm_slp_bo_unref(pPixmapInfo->pDrmBufferObject); + tbm_bo_unmap(pPixmapInfo->pTbmBufferObject); //fall through CATCH_05: - drm_slp_bufmgr_destroy(pPixmapInfo->pDrmBufMgr); + tbm_bufmgr_deinit(pPixmapInfo->pTbmBufMgr); //fall through CATCH_04: - close(drmFile); + close(pPixmapInfo->drmFd); //fall through CATCH_03: @@ -1501,12 +1518,14 @@ CATCH_01: _OSP_LOCAL_ EGLNativePixmapType _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferInfo bufferInfo) { -#if defined(FGRAPHICS_INTERNAL_USE_DRM) int width = 0; int height = 0; int bitsPerPixel = 0; Display* pNativeDisplay = null; Drawable nativeWindow = 0; + Tizen::Graphics::_BitmapImpl* pBitmapImpl = null; + _PixmapInfo* pPixmapInfo = null; +#if defined(FGRAPHICS_INTERNAL_USE_DRM) unsigned int attachments[] = { DRI2BufferFrontLeft }; char* pDeviceName = null; char* pDriverName = null; @@ -1514,13 +1533,12 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI int dri2Width = 0; int dri2Height = 0; int dri2BufferCount = 0; - int drmFile = 0; + tbm_bo_handle tbmData = { null, }; + Bool ret = False; result r = E_FAILURE; - Tizen::Graphics::_BitmapImpl* pBitmapImpl = null; drm_magic_t magic = 0; - _PixmapInfo* pPixmapInfo = null; - +#endif if (pBitmap == null) { goto CATCH_01; @@ -1550,11 +1568,14 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI goto CATCH_01; } - pPixmapInfo->nativePixmap = XCreatePixmap(pNativeDisplay, nativeWindow, width, height, bitsPerPixel); + pPixmapInfo->nativePixmap = XCreatePixmap(pNativeDisplay, nativeWindow, width, height + , bitsPerPixel); if (pPixmapInfo->nativePixmap == (Pixmap)0) { goto CATCH_02; } + +#if defined(FGRAPHICS_INTERNAL_USE_DRM) DRI2CreateDrawable(pNativeDisplay, pPixmapInfo->nativePixmap); XSync(pNativeDisplay, False); @@ -1565,22 +1586,22 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI goto CATCH_03; } - drmFile = open(pDeviceName, O_RDWR); + pPixmapInfo->drmFd = open(pDeviceName, O_RDWR); free(pDeviceName); - if (drmFile < 0) + if (pPixmapInfo->drmFd < 0) { goto CATCH_03; } - drmGetMagic(drmFile, &magic); + drmGetMagic(pPixmapInfo->drmFd, &magic); ret = DRI2Authenticate(pNativeDisplay, nativeWindow, (unsigned int)magic); if (!ret) { goto CATCH_04; } - pPixmapInfo->pDrmBufMgr = drm_slp_bufmgr_init(drmFile, null); - if (pPixmapInfo->pDrmBufMgr == null) + pPixmapInfo->pTbmBufMgr = tbm_bufmgr_init(pPixmapInfo->drmFd); + if (pPixmapInfo->pTbmBufMgr == null) { goto CATCH_04; } @@ -1591,22 +1612,23 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI goto CATCH_05; } - pPixmapInfo->pDrmBufferObject = drm_slp_bo_import(pPixmapInfo->pDrmBufMgr, pDri2Buffer->name); + pPixmapInfo->pTbmBufferObject = tbm_bo_import(pPixmapInfo->pTbmBufMgr, pDri2Buffer->name); free(pDri2Buffer); - if (pPixmapInfo->pDrmBufferObject == null) + if (pPixmapInfo->pTbmBufferObject == null) { goto CATCH_05; } - bufferInfo.pPixels = (void*)drm_slp_bo_get_handle(pPixmapInfo->pDrmBufferObject, DRM_SLP_DEVICE_CPU); - if (bufferInfo.pPixels == null) + tbmData = tbm_bo_get_handle(pPixmapInfo->pTbmBufferObject, TBM_DEVICE_CPU); + if (tbmData.ptr == null) { goto CATCH_06; } + bufferInfo.pPixels = tbmData.ptr; bufferInfo.bitsPerPixel = 32; bufferInfo.pixelFormat = PIXEL_FORMAT_ARGB8888; - bufferInfo.pitch = bufferInfo.width*bufferInfo.bitsPerPixel/4; + bufferInfo.pitch = bufferInfo.width * bufferInfo.bitsPerPixel / 4; memset(bufferInfo.pPixels, 0, bufferInfo.width * bufferInfo.height * 4); r = pBitmapImpl->Construct(bufferInfo); if (r != E_SUCCESS) @@ -1614,31 +1636,35 @@ _CreateNativePixmapEx(Tizen::Graphics::Bitmap* pBitmap, Tizen::Graphics::BufferI goto CATCH_06; } - if (!Tizen::Graphics::_BitmapTool::SetCallback(*pBitmap, _PixmapSurfaceDestroyCallback, pPixmapInfo, - _PixmapLockCallBack, pPixmapInfo->pDrmBufferObject,_PixmapUnlockCallBack, pPixmapInfo->pDrmBufferObject)) + if (!Tizen::Graphics::_BitmapTool::SetCallback(*pBitmap + , _PixmapSurfaceDestroyCallback, pPixmapInfo + , _PixmapLockCallBack, pPixmapInfo->pTbmBufferObject + ,_PixmapUnlockCallBack, pPixmapInfo->pTbmBufferObject)) { goto CATCH_06; } +#endif //#if defined(FGRAPHICS_INTERNAL_USE_DRM) return (EGLNativePixmapType)pPixmapInfo->nativePixmap; +#if defined(FGRAPHICS_INTERNAL_USE_DRM) CATCH_06: - drm_slp_bo_unmap(pPixmapInfo->pDrmBufferObject, DRM_SLP_DEVICE_CPU); - drm_slp_bo_unref(pPixmapInfo->pDrmBufferObject); + tbm_bo_unmap(pPixmapInfo->pTbmBufferObject); //fall through CATCH_05: - drm_slp_bufmgr_destroy(pPixmapInfo->pDrmBufMgr); + tbm_bufmgr_deinit(pPixmapInfo->pTbmBufMgr); //fall through CATCH_04: - close(drmFile); + close(pPixmapInfo->drmFd); //fall through CATCH_03: DRI2DestroyDrawable(pNativeDisplay, pPixmapInfo->nativePixmap); XFreePixmap(pNativeDisplay, pPixmapInfo->nativePixmap); //fall through +#endif CATCH_02: delete pPixmapInfo; @@ -1647,9 +1673,6 @@ CATCH_02: CATCH_01: SysLog(NID_GRP, "_CreateNativePixmap failed!! pBitmap:%#x", (unsigned int)pBitmap); return (EGLNativePixmapType)0; -#else - return (EGLNativePixmapType)0; -#endif //#if !defined(FGRAPHICS_INTERNAL_USE_DRM) } EGLSurface @@ -1718,7 +1741,8 @@ _SglDestroySurface(EGLDisplay dpy, EGLSurface surface) if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null) { pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); - SysLog(NID_GRP, "_SglDestroySurface failed!! dpy:%#x sglIndex:%#x", (unsigned int)dpy, (unsigned int)surface); + SysLog(NID_GRP, "_SglDestroySurface failed!! dpy:%#x sglIndex:%#x", (unsigned int)dpy + , (unsigned int)surface); return eglDestroySurface(dpy, EGL_NO_SURFACE); } @@ -1748,9 +1772,14 @@ _SglDestroySurface(EGLDisplay dpy, EGLSurface surface) #endif ret = eglDestroySurface(dpy, pSglInfo->surface); pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); - pSglInfoTableManipulatorInstance->DestroySglIndex(sglIndex); + if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null) + { + eglDestroySurface(dpy, pSglInfo->pSecondSglInfo->surface); + pSglInfoTableManipulatorInstance->DestroySglIndex(pSglInfo->pSecondSglInfo->sglIndex); + } + return ret; } @@ -1966,6 +1995,11 @@ _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx } sglInfoReadSurface = sglInfoRead->surface; + if (isDoublePixmapEnabled && !sglInfoRead->isBackbuffer) + { + sglInfoReadSurface = sglInfoRead->pSecondSglInfo->surface; + } + pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); } @@ -1978,14 +2012,27 @@ _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx return eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx); } + if (isDoublePixmapEnabled && !sglInfoDraw->isBackbuffer && sglInfoDraw->pSecondSglInfo != null) + { + sglInfoDraw = sglInfoDraw->pSecondSglInfo; + } + sglInfoDraw->context = ctx; EGLBoolean ret = eglMakeCurrent(dpy, sglInfoDraw->surface, sglInfoReadSurface, ctx); #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT) - _SaveCurrentContext(dpy, sglInfoDraw->surface, sglInfoReadSurface, ctx); + if (isEvasNativeSetEnabled) + { + _SaveCurrentContext(sglInfoDraw); + } #endif + if (sglInfoDraw->glVersion == 0 && ctx != EGL_NO_CONTEXT) + { + eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &sglInfoDraw->glVersion); + } + #if defined(FGRAPHICS_INTERNAL_USE_FBO) if (ret != EGL_TRUE || sglInfoDraw->surface == EGL_NO_SURFACE || sglInfoReadSurface == EGL_NO_SURFACE @@ -1995,13 +2042,9 @@ _SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx return ret; } - if (sglInfoDraw->glVersion == 0) - { - eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &sglInfoDraw->glVersion); #if defined(_OSP_EMUL_) //fixme - sglInfoDraw->isFboAvailable = false; + sglInfoDraw->isFboAvailable = false; #endif - } if (sglInfoDraw->pFrame != null) { @@ -2144,7 +2187,8 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface) if (sglIndex <= INVALID_SGL_INDEX || pSglInfo == null) { pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); - SysLog(NID_GRP, "_SglSwapBuffers failed!! dpy:%#x sglIndex:%#x", (unsigned int)dpy, (unsigned int)sglIndex); + SysLog(NID_GRP, "_SglSwapBuffers failed!! dpy:%#x sglIndex:%#x", (unsigned int)dpy + , (unsigned int)sglIndex); return eglSwapBuffers(dpy, EGL_NO_SURFACE); } @@ -2154,7 +2198,18 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface) #if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER) _SglUpdateBufferOSP(dpy, surface); #else - if (!isEvasNativeSetEnabled) + if (isEvasNativeSetEnabled) + { + if (pSglInfo->glVersion == 1) + { + _GlFlush_1(); + } + else + { + _GlFlush_2(); + } + } + else { eglWaitGL(); } @@ -2162,13 +2217,49 @@ _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface) if (isEvasNativeSetEnabled) { - evas_object_image_pixels_dirty_set(pSglInfo->pObject, EINA_TRUE); + if (isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null) + { + if (pSglInfo->swapDone || pSglInfo->pSecondSglInfo->swapDone) + { + _SglInfo* pBackSglInfo = null; + _SglInfo* pFrontSglInfo = null; + + if (pSglInfo->isBackbuffer) + { + pBackSglInfo = pSglInfo; + pFrontSglInfo = pSglInfo->pSecondSglInfo; + } + else + { + pBackSglInfo = pSglInfo->pSecondSglInfo; + pFrontSglInfo = pSglInfo; + } + pBackSglInfo->isBackbuffer = false; + pFrontSglInfo->isBackbuffer = true; + + pFrontSglInfo->wasShown = false; + pFrontSglInfo->swapDone = false; + if (pSglInfo->pVisualElement != null) + { + pSglInfo->pVisualElement->SetSurface(pFrontSglInfo->pVisualElementSurface); + } + evas_object_image_pixels_dirty_set(pFrontSglInfo->pObject, EINA_TRUE); + evas_object_hide(pBackSglInfo->pObject); + } + } + else + { + if (pSglInfo->pObject != null) + { + evas_object_image_pixels_dirty_set(pSglInfo->pObject, EINA_TRUE); + } + } } else { - if (pSglInfo->pVisualElementImpl != null) + if (pSglInfo->pVisualElement != null) { - pSglInfo->pVisualElementImpl->SetFlushNeeded(); + pSglInfo->pVisualElement->SetFlushNeeded(); } } @@ -2246,7 +2337,7 @@ _SglUpdateBufferOSP(EGLDisplay dpy, EGLSurface surface) } eglCopyBuffers(dpy, pSglInfo->surface, pSglInfo->nativePixmap); - ecore_x_image_get(pSglInfo->pEcoreImage, pSglInfo->nativePixmap, + ecore_x_image_get(pSglInfo->pEcoreImage, (Ecore_X_Drawable)pSglInfo->nativePixmap, 0, 0, 0, 0, pSglInfo->width, pSglInfo->height); pSglInfoTableManipulatorInstance->UnlockSglInfoTable(); diff --git a/src/graphics/opengl/FGrpGles1.cpp b/src/graphics/opengl/FGrpGles1.cpp index 7677a15..ce96319 100644 --- a/src/graphics/opengl/FGrpGles1.cpp +++ b/src/graphics/opengl/FGrpGles1.cpp @@ -1418,7 +1418,11 @@ _GlesInterfaceInitialize_1(void) { ptrdiff_t** ppPtr = (ptrdiff_t**) (&_glesImpl1); - _pGlesLib1 = dlopen("libGLESv1_CM.so", RTLD_LAZY | RTLD_GLOBAL); +#if defined(_OSP_EMUL_) + _pGlesLib1 = dlopen("/usr/lib/libGLESv1_CM.so", RTLD_LAZY | RTLD_GLOBAL); +#else + _pGlesLib1 = dlopen("/usr/lib/driver/libGLESv1_CM.so", RTLD_LAZY | RTLD_GLOBAL); +#endif if (_pGlesLib1 == NULL) { SysLog(NID_GRP, "gles1 dlopen failed! %s", dlerror()); diff --git a/src/graphics/opengl/FGrpGles2.cpp b/src/graphics/opengl/FGrpGles2.cpp index bddf4a9..e063152 100644 --- a/src/graphics/opengl/FGrpGles2.cpp +++ b/src/graphics/opengl/FGrpGles2.cpp @@ -1273,7 +1273,11 @@ _GlesInterfaceInitialize_2(void) { ptrdiff_t** ppPtr = (ptrdiff_t**) (&_glesImpl2); - _pGlesLib2 = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); +#if defined(_OSP_EMUL_) + _pGlesLib2 = dlopen("/usr/lib/libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); +#else + _pGlesLib2 = dlopen("/usr/lib/driver/libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); +#endif if (_pGlesLib2 == NULL) { SysLog(NID_GRP, "gles2 dlopen failed! %s", dlerror()); diff --git a/src/graphics/opengl/FGrp_CanvasTexture.cpp b/src/graphics/opengl/FGrp_CanvasTexture.cpp index 503c7af..ab67829 100644 --- a/src/graphics/opengl/FGrp_CanvasTexture.cpp +++ b/src/graphics/opengl/FGrp_CanvasTexture.cpp @@ -24,15 +24,13 @@ #include #include -#include - #include - #include #include #include #include +#include "FGrp_CanvasTool.h" #include "FGrp_CanvasTexture.h" using namespace Tizen::Base; @@ -47,124 +45,216 @@ extern "C" #endif EGLNativePixmapType _CreateNativePixmapEx(Bitmap* pBitmap, BufferInfo& bufferInfo); +void _GlBindTexture_1(GLenum target, GLuint texture); +void _GlGetIntegerv_1(GLenum pname, GLint* params); +const GLubyte* _GlGetString_1(GLenum name); +void _GlTexImage2D_1(GLenum target, GLint level, GLint internalformat + , GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pPixels); +void _GlTexSubImage2D_1(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pPixels); +void _GlTexImage2D_2(GLenum target, GLint level, GLenum internalformat + , GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pPixels); +void _GlTexSubImage2D_2(GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pPixels); #ifdef __cplusplus } #endif _CanvasTexture::_CanvasTexture(void) - : __nativePixmap((EGLNativePixmapType)0) - , __eglImage((EGLImageKHR)0) + : __glVersion(0) + , __eglDisplay(EGL_NO_DISPLAY) + , __eglSurface(EGL_NO_SURFACE) + , __eglContext(EGL_NO_CONTEXT) + , __nativePixmap((EGLNativePixmapType)0) + , __textureId(0) + , __textureFormat(GL_RGBA) , __pBitmap(null) + , __pBitmapColorConvert(null) { } _CanvasTexture::~_CanvasTexture(void) { - __Release(); + delete this->__pBitmap; + delete this->__pBitmapColorConvert; } result _CanvasTexture::Construct(const int textureId, const int width, const int height) { -#if !defined(_OSP_EMUL_) - EGLDisplay display = eglGetCurrentDisplay(); + this->__eglDisplay = eglGetCurrentDisplay(); + this->__eglSurface = eglGetCurrentSurface(EGL_DRAW); + this->__eglContext = eglGetCurrentContext(); + + eglQueryContext(this->__eglDisplay, this->__eglContext, EGL_CONTEXT_CLIENT_VERSION, &this->__glVersion); + SysTryReturnResult(NID_GRP + , this->__eglDisplay != EGL_NO_DISPLAY + && this->__eglSurface != EGL_NO_SURFACE + && this->__eglContext != EGL_NO_CONTEXT + && (this->__glVersion == 1 || this->__glVersion == 2), E_INVALID_STATE + , "Getting egl informations failed! eglDisplay:%#x eglContext:%#x glVersion:%d" + , (unsigned int)this->__eglDisplay, (unsigned int)this->__eglContext, this->__glVersion); + GLint maxTextureSize = 0; + if (this->__glVersion == 1) + { + _GlGetIntegerv_1(GL_MAX_TEXTURE_SIZE, &maxTextureSize); + } + else + { + _GlGetIntegerv_2(GL_MAX_TEXTURE_SIZE, &maxTextureSize); + } + SysTryReturnResult(NID_GRP, (width > 0 && height > 0 && width <= maxTextureSize && height <= maxTextureSize) + , E_INVALID_ARG, "width(%d) or height(%d) not supported.", width, height); - SysTryReturnResult(NID_GRP, IsSupported(), E_SYSTEM, "CanvasTexture not supported on this device."); + std::auto_ptr bitmap(new (std::nothrow) Bitmap); + SysTryReturnResult(NID_GRP, bitmap.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient."); - PFNEGLCREATEIMAGEKHRPROC funcEglCreateImageKhr = - (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC funcGlEglImageTargetTexture2dOes = - (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); - SysTryReturnResult(NID_GRP, (funcEglCreateImageKhr != null && funcGlEglImageTargetTexture2dOes != null), - E_UNSUPPORTED_OPERATION, "CanvasTexture not supported on this device"); + result r = bitmap.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "[%s] Propagating.", GetErrorMessage(r)); - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); + if (IsSupported(L"GL_EXT_texture_format_BGRA8888")) + { + this->__textureFormat = GL_BGRA; + } + else + { + std::auto_ptr bitmapColorConvert(new (std::nothrow) Bitmap); + SysTryReturnResult(NID_GRP, bitmapColorConvert.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient."); - SysTryReturnResult(NID_GRP, (width > 0 && height > 0 && width <= maxTextureSize && height <= maxTextureSize), - E_INVALID_ARG, "width(%d) or height(%d) not supported.", width, height); + r = bitmapColorConvert.get()->Construct(Rectangle(0, 0, width, height)); + SysTryReturnResult(NID_GRP, !IsFailed(r), r, "[%s] Propagating.", GetErrorMessage(r)); + this->__pBitmapColorConvert = bitmapColorConvert.release(); + } - std::auto_ptr bitmap(new (std::nothrow) Bitmap); - SysTryReturnResult(NID_GRP, bitmap.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient."); + bitmap.get()->Lock(__bufferInfo); + memset(__bufferInfo.pPixels, 0, __bufferInfo.pitch * __bufferInfo.height); + bitmap.get()->Unlock(); - BufferInfo bufferInfo; - bufferInfo.width = width; - bufferInfo.height = height; - bufferInfo.bitsPerPixel = ecore_x_default_depth_get(ecore_x_display_get(), ecore_x_default_screen_get()); + if (this->__glVersion == 1) + { + _GlBindTexture_1(GL_TEXTURE_2D, textureId); + _GlTexImage2D_1(GL_TEXTURE_2D, 0, this->__textureFormat, width, height, 0, this->__textureFormat, GL_UNSIGNED_BYTE, __bufferInfo.pPixels); + } + else + { + _GlBindTexture_2(GL_TEXTURE_2D, textureId); + _GlTexImage2D_2(GL_TEXTURE_2D, 0, this->__textureFormat, width, height, 0, this->__textureFormat, GL_UNSIGNED_BYTE, __bufferInfo.pPixels); + } - this->__nativePixmap = _CreateNativePixmapEx(bitmap.get(), bufferInfo); - SysTryReturnResult(NID_GRP, this->__nativePixmap != (EGLNativePixmapType)0, E_OUT_OF_MEMORY, "Creating native pixmap failed."); + this->__pBitmap = bitmap.release(); + this->__textureId = textureId; - this->__eglImage = funcEglCreateImageKhr(display, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, - (EGLClientBuffer)this->__nativePixmap, null); - SysTryReturnResult(NID_GRP, this->__eglImage != (EGLImageKHR)0, E_OUT_OF_MEMORY, "Creating ImageKHR failed."); + return r; +} - glBindTexture(GL_TEXTURE_2D, textureId); - funcGlEglImageTargetTexture2dOes(GL_TEXTURE_2D, this->__eglImage); +bool +_CanvasTexture::ShowCallback(void* pParam) +{ + _CanvasTexture* pCanvasTexture = dynamic_cast<_CanvasTexture*> ((_CanvasTexture*)pParam); + SysTryReturnResult(NID_GRP, pCanvasTexture != null, true, "Invalid parameter."); - this->__pBitmap = bitmap.release(); - return E_SUCCESS; -#else - return E_UNSUPPORTED_OPERATION; -#endif + pCanvasTexture->UpdateTexture(); + + return true; } Canvas* _CanvasTexture::GetCanvasN(void) const { - SysTryReturn(NID_GRP, this->__IsValid(), null, E_OPERATION_FAILED, "This instance is not constructed yet.\n"); - - BufferInfo bufferInfo; - this->__pBitmap->Lock(bufferInfo); - this->__pBitmap->Unlock(); - std::auto_ptr canvas(new (std::nothrow) Canvas); - SysTryReturn(NID_GRP, canvas.get() != null, null, E_OUT_OF_MEMORY, "The memory is insufficient."); + SysTryReturnResult(NID_GRP, canvas.get() != null, null, "The memory is insufficient."); + + result r = canvas.get()->Construct(__bufferInfo); + SysTryReturnResult(NID_GRP, !IsFailed(r), null, "[%s] Propagating.", GetErrorMessage(r)); - result r = canvas.get()->Construct(bufferInfo); - SysTryReturn(NID_GRP, r == E_SUCCESS, null, E_OPERATION_FAILED, "[E_SYSTEM] Canvas construction failed."); + bool ret = _CanvasTool::SetCallback(*canvas.get(), this->ShowCallback, (void*)this); + SysTryReturnResult(NID_GRP, ret, null, "[%s] Propagating."); return canvas.release(); } bool -_CanvasTexture::IsSupported(void) +_CanvasTexture::IsSupported(String string) { - const char* pString = (const char*)glGetString(GL_EXTENSIONS); + char* pString = null; + if (this->__glVersion == 1) + { + pString = (char*)_GlGetString_1(GL_EXTENSIONS); + } + else + { + pString = (char*)_GlGetString_2(GL_EXTENSIONS); + } String extensions(pString); - return extensions.Contains(Tizen::Base::String("GL_OES_EGL_image")); + return extensions.Contains(string); } -result -_CanvasTexture::__Release(void) +void +_CanvasTexture::UpdateTexture(void) { - if (this->__eglImage != (EGLImageKHR)0) + bool needMakeCurrent = false; + + EGLDisplay eglDisplay = eglGetCurrentDisplay(); + EGLSurface eglSurface = eglGetCurrentSurface(EGL_DRAW); + EGLContext eglContext = eglGetCurrentContext(); + + if (this->__eglDisplay != eglDisplay + || this->__eglSurface == eglSurface + || this->__eglContext == eglContext) { - PFNEGLDESTROYIMAGEKHRPROC funcEglDestroyImageKhr = - (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); - SysTryReturnResult(NID_GRP, funcEglDestroyImageKhr != null, E_SYSTEM, "Destroy ImageKHR failed."); + needMakeCurrent = true; + eglMakeCurrent(this->__eglDisplay, this->__eglSurface, this->__eglSurface, this->__eglContext); + } - EGLDisplay display = eglGetCurrentDisplay(); - funcEglDestroyImageKhr(display, this->__eglImage); - this->__eglImage = (EGLImageKHR)0; + if (__glVersion == 1) + { + _GlBindTexture_1(GL_TEXTURE_2D, __textureId); + } + else + { + _GlBindTexture_2(GL_TEXTURE_2D, __textureId); } - delete this->__pBitmap; - this->__pBitmap = null; - this->__nativePixmap = (EGLNativePixmapType)0; + void* pPixels = __bufferInfo.pPixels; - return E_SUCCESS; -} + if (this->__textureFormat == GL_RGBA && this->__pBitmapColorConvert != null) + { + int index = 0; + BufferInfo bufferInfoConvert; + this->__pBitmapColorConvert->Lock(bufferInfoConvert); + this->__pBitmapColorConvert->Unlock(); + + unsigned int* pSource = (unsigned int*)__bufferInfo.pPixels; + unsigned int* pDestination = (unsigned int*)bufferInfoConvert.pPixels; + + for (int y = 0; y < __bufferInfo.height; y++) + { + index = __bufferInfo.width * y; + for (int x = 0; x < __bufferInfo.width; x++) + { + pDestination[index + x] = (0x000000ffu & (pSource[index + x]>> 16)) + | (0xff00ff00u & (pSource[index + x])) + | (0x00ff0000u & (pSource[index + x] << 16)); + } + } + pPixels = (unsigned int*)pDestination; + } -bool -_CanvasTexture::__IsValid(void) const -{ - return (this->__nativePixmap != (EGLNativePixmapType)0 && - this->__eglImage != (EGLImageKHR)0 && - this->__pBitmap != null); + if (__glVersion == 1) + { + _GlTexSubImage2D_1(GL_TEXTURE_2D, 0, 0, 0, __bufferInfo.width, __bufferInfo.height + , __textureFormat, GL_UNSIGNED_BYTE, pPixels); + } + else + { + _GlTexSubImage2D_2(GL_TEXTURE_2D, 0, 0, 0, __bufferInfo.width, __bufferInfo.height + , __textureFormat, GL_UNSIGNED_BYTE, pPixels); + } } }}} // Tizen::Graphics::Opengl + diff --git a/src/graphics/opengl/FGrp_CanvasTexture.h b/src/graphics/opengl/FGrp_CanvasTexture.h index e02b1fc..c2112fc 100644 --- a/src/graphics/opengl/FGrp_CanvasTexture.h +++ b/src/graphics/opengl/FGrp_CanvasTexture.h @@ -25,6 +25,7 @@ #define _FGRP_INTERNAL_CANVAS_TEXTURE_H_ #include +#include namespace Tizen { namespace Graphics { class Bitmap; @@ -44,21 +45,30 @@ public: Tizen::Graphics::Canvas* GetCanvasN(void) const; - static bool IsSupported(void); + bool IsSupported(Tizen::Base::String string); + + static bool ShowCallback(void* pParam); + + void UpdateTexture(void); private: _CanvasTexture(const _CanvasTexture& rhs); _CanvasTexture& operator =(const _CanvasTexture& rhs); private: - result __Release(void); - bool __IsValid(void) const; - + int __glVersion; + EGLDisplay __eglDisplay; + EGLSurface __eglSurface; + EGLContext __eglContext; EGLNativePixmapType __nativePixmap; - EGLImageKHR __eglImage; + GLuint __textureId; + GLint __textureFormat; + Tizen::Graphics::BufferInfo __bufferInfo; Bitmap* __pBitmap; + Bitmap* __pBitmapColorConvert; }; // _CanvasTexture }}} // Tizen::Graphics::Opengl #endif //_FGRP_CANVAS_TEXTURE_H_ + diff --git a/src/graphics/opengl/FGrp_CanvasTextureImpl.cpp b/src/graphics/opengl/FGrp_CanvasTextureImpl.cpp index 6b57536..a8b559a 100644 --- a/src/graphics/opengl/FGrp_CanvasTextureImpl.cpp +++ b/src/graphics/opengl/FGrp_CanvasTextureImpl.cpp @@ -61,12 +61,6 @@ _CanvasTextureImpl::GetCanvasN(void) const return this->__pNativeCanvasTexture->GetCanvasN(); } -bool -_CanvasTextureImpl::IsSupported(void) -{ - return _CanvasTexture::IsSupported(); -} - _CanvasTextureImpl* _CanvasTextureImpl::GetInstance(CanvasTexture& canvasTexture) { diff --git a/src/graphics/opengl/FGrp_GlPlayerImpl.cpp b/src/graphics/opengl/FGrp_GlPlayerImpl.cpp index 85e04c9..6f5ad67 100644 --- a/src/graphics/opengl/FGrp_GlPlayerImpl.cpp +++ b/src/graphics/opengl/FGrp_GlPlayerImpl.cpp @@ -205,11 +205,8 @@ _GlPlayerImpl::Start(void) SysTryReturnResult(NID_GRP, false, E_OPENGL_ERROR, "Fail to active the current context with eglMakeCurrent()."); } - if (__fps > 0) - { - result r = __pTimer->Start(__renderTimeInterval); - SysTryReturnResult(NID_GRP, r == E_SUCCESS, r, "Fail to resume Timer."); - } + result r = __pTimer->Start(__renderTimeInterval); + SysTryReturnResult(NID_GRP, r == E_SUCCESS, r, "Fail to resume Timer."); __playerState = PLAYER_STATE_START; @@ -324,11 +321,11 @@ _GlPlayerImpl::SetFps(int fps) __fps = fps; if (fps > 0) { - __renderTimeInterval = (int)((float)1000 / (float)fps + 0.5f); + __renderTimeInterval = (int)((float)1000 / (float)fps); } else { - __renderTimeInterval = -1; + __renderTimeInterval = 1; } return E_SUCCESS; diff --git a/src/graphics/opengl/FGrp_VideoTexture.cpp b/src/graphics/opengl/FGrp_VideoTexture.cpp index 6925fa6..6331dd9 100644 --- a/src/graphics/opengl/FGrp_VideoTexture.cpp +++ b/src/graphics/opengl/FGrp_VideoTexture.cpp @@ -67,10 +67,12 @@ const GLubyte* _GlGetString_1(GLenum name); namespace Tizen { namespace Graphics { namespace Opengl { +#if defined (FGRAPHICS_INTERNAL_USE_THRESHOLD_EVENT_TIMER) namespace //unnamed { const long long _DEQUEUE_THRESHOLD_EVENT_TIME = 1000; } +#endif _DamageEvent::_DamageEvent(void) : __pDisplay(NULL) @@ -197,10 +199,12 @@ _VideoTexture::Construct(const int textureId, const int width, const int height) __funcGlEglImageTargetTexture2dOes = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); PFNEGLCREATEIMAGEKHRPROC funcEglCreateImageKhr = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); +#if !defined(_OSP_EMUL_) //fixme SysTryReturnResult(NID_GRP, IsSupported(L"GL_OES_EGL_image") && __funcGlEglImageTargetTexture2dOes != null && funcEglCreateImageKhr != null , E_UNSUPPORTED_OPERATION, "Not supported on this device."); - +#endif + if (IsSupported(L"GL_OES_EGL_sync")) { __funcEglCreateSyncKhr = (PFNEGLCREATESYNCKHRPROC)eglGetProcAddress("eglCreateSyncKHR"); @@ -282,45 +286,36 @@ _VideoTexture::BindTexture(void) { if (__pBuffer[i].__bufferState == _BUFFER_STATE_ENQUEUE) { - count++; if (__pBuffer[i].__timeStamp < timeStamp) { + count++; oldestReadableBuffer = i; timeStamp = __pBuffer[i].__timeStamp; } } } - if (count <= 0 || count > _VIDEO_TEXTURE_BUFFER_MAX) + if (count == 0) { - if (__currentReadingBuffer < 0) + if (__currentReadingBuffer == -1) { SysLog(NID_GRP, "A video frame is not ready."); return E_INVALID_STATE; } - else - { - oldestReadableBuffer = __currentReadingBuffer; - } + oldestReadableBuffer = __currentReadingBuffer; } else { if (__isEglSyncAvailable) { - if (__currentReadingBuffer != oldestReadableBuffer) + if (__pBuffer[__currentReadingBuffer].__eglSync == EGL_NO_SYNC_KHR) { - if (__pBuffer[__currentReadingBuffer].__eglSync == EGL_NO_SYNC_KHR) - { - __pBuffer[__currentReadingBuffer].__eglSync = __funcEglCreateSyncKhr(__eglDisplay, EGL_SYNC_FENCE_KHR, NULL);//EGL_SYNC_FENCE_KHR EGL_SYNC_REUSABLE_KHR - } + __pBuffer[__currentReadingBuffer].__eglSync = __funcEglCreateSyncKhr(__eglDisplay, EGL_SYNC_FENCE_KHR, NULL);//EGL_SYNC_FENCE_KHR EGL_SYNC_REUSABLE_KHR } } else { - if (__currentReadingBuffer != oldestReadableBuffer) - { - eglWaitGL(); - } + eglWaitGL(); } } @@ -372,9 +367,9 @@ _VideoTexture::FindFreeBuffer(void) { if (__pBuffer[i].__bufferState == _BUFFER_STATE_FREE) { - count++; if (__pBuffer[i].__timeStamp < timeStamp) { + count++; oldestFreedBuffer = i; timeStamp = __pBuffer[i].__timeStamp; } @@ -438,6 +433,23 @@ _VideoTexture::GetPixmap(void) return (unsigned int)__pBuffer[oldestFreedBuffer].__nativePixmap; } +void +_VideoTexture::PixmapErrorCallback(unsigned int* pPixmap) +{ + if (pPixmap != null) + { + for (int i = 0; i < _VIDEO_TEXTURE_BUFFER_MAX; i++) + { + if ((unsigned int)this->__pBuffer[i].__nativePixmap == (unsigned int)*pPixmap) + { + this->__pBuffer[i].__bufferState = _BUFFER_STATE_FREE; + SystemTime::GetTicks(this->__pBuffer[i].__timeStamp); + return; + } + } + } +} + bool _VideoTexture::IsSupported(String string) { diff --git a/src/graphics/opengl/FGrp_VideoTexture.h b/src/graphics/opengl/FGrp_VideoTexture.h index 94752f7..a1da68e 100644 --- a/src/graphics/opengl/FGrp_VideoTexture.h +++ b/src/graphics/opengl/FGrp_VideoTexture.h @@ -93,7 +93,7 @@ public: bool IsSupported(Tizen::Base::String string); Pixmap GetPixmap(void); - + void PixmapErrorCallback(unsigned int* pPixmap); private: _VideoTexture(const _VideoTexture& rhs); diff --git a/src/graphics/opengl/FGrp_VideoTextureImpl.cpp b/src/graphics/opengl/FGrp_VideoTextureImpl.cpp index 07b575b..fe50dfe 100644 --- a/src/graphics/opengl/FGrp_VideoTextureImpl.cpp +++ b/src/graphics/opengl/FGrp_VideoTextureImpl.cpp @@ -92,4 +92,17 @@ _VideoTextureImpl::GetPixmap(void* pData) return (unsigned int)pVideoTextureImpl->__pNativeVideoTexture->GetPixmap(); } +void +_VideoTextureImpl::PixmapErrorCallback(unsigned int* pPixmap, void* pData) +{ + _VideoTextureImpl* pVideoTextureImpl = dynamic_cast<_VideoTextureImpl*> ((_VideoTextureImpl*)pData); + if (pVideoTextureImpl == null || pVideoTextureImpl->__pNativeVideoTexture == null) + { + SysLog(NID_GRP, "pData is null."); + return; + } + + pVideoTextureImpl->__pNativeVideoTexture->PixmapErrorCallback(pPixmap); +} + }}} // Tizen::Graphics diff --git a/src/graphics/text/FGrp_TextTextColumn.cpp b/src/graphics/text/FGrp_TextTextColumn.cpp index 7a86696..bb30e75 100644 --- a/src/graphics/text/FGrp_TextTextColumn.cpp +++ b/src/graphics/text/FGrp_TextTextColumn.cpp @@ -28,6 +28,7 @@ #include "FGrp_TextTextLine.h" #include "FGrp_TextTextColumn.h" #include "FGrp_TextTextUtility.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base::Utility; @@ -152,6 +153,20 @@ TextColumn::GetRegion(int textIndex, int textLength, int& width, int& height) co return r; } +result +TextColumn::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + + result r = GetRegion(textIndex, textLength, newWidth, newHeight); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newWidth); + + return r; +} + int TextColumn::GetHeight(int textIndex) const { @@ -163,6 +178,12 @@ TextColumn::GetHeight(int textIndex) const return __pCompositeText->GetHeight(textIndex); } +float +TextColumn::GetHeightF(int textIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex)); +} + result TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action) @@ -183,9 +204,7 @@ TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI } pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); if (__pLines->nodeCount < pTextLine->GetIndex()) { @@ -242,9 +261,7 @@ TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI TextObjectAlignment horizontalAlignment = (TextObjectAlignment)(alignment & TEXT_ALIGNMASK_HORIZ); r = pTextLine->Draw(canvasImpl, displayRect, 0, lineLength, horizontalAlignment, lineAction); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __displayLineCount++; @@ -272,9 +289,7 @@ TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI } pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); if (__pLines->nodeCount < pTextLine->GetIndex()) { @@ -287,6 +302,111 @@ TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI return E_SUCCESS; } +result +TextColumn::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment alignment, const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return Draw(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action); +} + +result +TextColumn::CalculateDisplayableLineCount(Rectangle& displayRect, const TextObjectActionType action) +{ + int displayLineCount = 0; + + SimpleNode* pTextLineNode = TextSimpleList::GetNthNode(__pLines, __firstDisplayLineIndex); + if (pTextLineNode == null) + { + return E_SUCCESS; + } + + TextLine* pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + if (__pLines->nodeCount < pTextLine->GetIndex()) + { + return -1; + } + + Rectangle lineBounds = pTextLine->GetBounds(); + + if (__firstDisplayPositionY != lineBounds.y) + { + displayRect.height += __firstDisplayPositionY - lineBounds.y; + } + + while (pTextLineNode != null && 0 <= displayRect.height) + { + if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV) + { + TextLine* pNextTextLine = (pTextLineNode->pNext == null) ? null : static_cast < TextLine* >(pTextLineNode->pNext->pObject); + + if (pNextTextLine == null) + { + if (pTextLine->GetTextOffset() + pTextLine->GetTextLength() < __pCompositeText->GetTextLength()) + { + displayLineCount++; + return displayLineCount; + } + } + else + { + Rectangle nextLineBounds; + if (__pLines->nodeCount < pNextTextLine->GetIndex()) + { + return -1; + } + + nextLineBounds = pNextTextLine->GetBounds(); + if (displayRect.height < (lineBounds.height + nextLineBounds.height)) + { + displayLineCount++; + return displayLineCount; + } + } + } + + displayLineCount++; + + if (lineBounds.height < displayRect.height) + { + displayRect.height -= lineBounds.height; + } + else + { + break; + } + + pTextLineNode = pTextLineNode->pNext; + if (pTextLineNode == null) + { + break; + } + + pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + if (__pLines->nodeCount < pTextLine->GetIndex()) + { + return -1; + } + + lineBounds = pTextLine->GetBounds(); + } + + return displayLineCount; +} + +result +TextColumn::CalculateDisplayableLineCount(FloatRectangle& displayRect, const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return CalculateDisplayableLineCount(newDisplayRect, action); +} + int TextColumn::GetTextLength(void) const { @@ -312,9 +432,7 @@ TextColumn::GetLineIndexAtTextIndex(int textIndex) const while (pTextLineNode) { pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineOffset = pTextLine->GetTextOffset(); lineLength = pTextLine->GetTextLength(); @@ -360,9 +478,7 @@ TextColumn::GetLineIndexAtPositionY(int y) while (pTextLineNode) { pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); @@ -400,9 +516,7 @@ TextColumn::GetLineIndexAtPositionY(int y) while (pTextLineNode) { pTextLine = static_cast < TextLine* >(pTextLineNode->pObject); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); @@ -432,6 +546,12 @@ TextColumn::GetLineIndexAtPositionY(int y) } int +TextColumn::GetLineIndexAtPositionY(float y) +{ + return GetLineIndexAtPositionY(_CoordinateSystemUtils::ConvertToInteger(y)); +} + +int TextColumn::GetTotalHeight(void) const { SimpleNode* pTextLineNode = null; @@ -456,6 +576,12 @@ TextColumn::GetTotalHeight(void) const return height; } +float +TextColumn::GetTotalHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTotalHeight()); +} + int TextColumn::GetLineHeightAt(int index) const { @@ -472,6 +598,12 @@ TextColumn::GetLineHeightAt(int index) const return lineRect.height; } +float +TextColumn::GetLineHeightAtF(int index) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetLineHeightAt(index)); +} + int TextColumn::GetTextLengthAt(int lineIndex) const { @@ -1537,24 +1669,48 @@ TextColumn::SetFirstDisplayPositionY(int y) __firstDisplayPositionY = y; } +void +TextColumn::SetFirstDisplayPositionY(float y) +{ + __firstDisplayPositionY = _CoordinateSystemUtils::ConvertToInteger(y); +} + int TextColumn::GetFirstDisplayPositionY(void) const { return __firstDisplayPositionY; } +float +TextColumn::GetFirstDisplayPositionYF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__firstDisplayPositionY); +} + void TextColumn::SetDisplayHeight(int height) { __displayHeight = height; } +void +TextColumn::SetDisplayHeight(float height) +{ + __displayHeight = _CoordinateSystemUtils::ConvertToInteger(height); +} + int TextColumn::GetDisplayHeight(void) const { return __displayHeight; } +float +TextColumn::GetDisplayHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__displayHeight); +} + SimpleNode* TextColumn::GetTextLineNode(int lineIndex) const { @@ -1573,24 +1729,50 @@ TextColumn::SetSlidingDimension(Dimension& slidingDimension) return E_SUCCESS; } +result +TextColumn::SetSlidingDimension(FloatDimension& slidingDimension) +{ + Dimension newSlidingDimension = _CoordinateSystemUtils::ConvertToInteger(slidingDimension); + + return SetSlidingDimension(newSlidingDimension); +} + Dimension TextColumn::GetSlidingDimension(void) const { return __slidingDimension; } +FloatDimension +TextColumn::GetSlidingDimensionF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__slidingDimension); +} + void TextColumn::SetSlidingPosition(int slidingPosition) { __slidingPosition = slidingPosition; } +void +TextColumn::SetSlidingPosition(float slidingPosition) +{ + __slidingPosition = _CoordinateSystemUtils::ConvertToInteger(slidingPosition); +} + int TextColumn::GetSlidingPosition(void) const { return __slidingPosition; } +float +TextColumn::GetSlidingPositionF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__slidingPosition); +} + void TextColumn::SetChangedStartLineIndex(int changedStartLineIndex) { @@ -1622,6 +1804,14 @@ TextColumn::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex return -1; } +int +TextColumn::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height) +{ + return -1; +} + + result TextColumn::RemoveAllKeepLines(void) { diff --git a/src/graphics/text/FGrp_TextTextColumn.h b/src/graphics/text/FGrp_TextTextColumn.h index db58d4a..836b447 100644 --- a/src/graphics/text/FGrp_TextTextColumn.h +++ b/src/graphics/text/FGrp_TextTextColumn.h @@ -74,15 +74,25 @@ public: virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, + int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(int textIndex) const; + virtual float GetHeightF(int textIndex) const; + virtual int GetTextLength(void) const; virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + result Append(TextLine* pTextLine); result AddLineDuringCompose(TextLine* pTextLine); @@ -99,14 +109,20 @@ public: int GetTotalHeight(void) const; + float GetTotalHeightF(void) const; + int GetLineHeightAt(int index) const; + float GetLineHeightAtF(int index) const; + int GetTotalLineCount(void) const; int GetLineIndexAtTextIndex(int textIndex) const; int GetLineIndexAtPositionY(int y); + int GetLineIndexAtPositionY(float y); + TextLine* GetTextLine(int lineIndex) const; SimpleNode* GetTextLineNode(int lineIndex) const; @@ -121,24 +137,40 @@ public: void SetDisplayHeight(int height); + void SetDisplayHeight(float height); + int GetDisplayHeight(void) const; + float GetDisplayHeightF(void) const; + void SetFirstDisplayPositionY(int y); + void SetFirstDisplayPositionY(float y); + int GetFirstDisplayPositionY(void) const; + float GetFirstDisplayPositionYF(void) const; + int GetTextLengthAt(int lineIndex) const; int GetFirstTextIndexAt(int lineIndex) const; result SetSlidingDimension(Tizen::Graphics::Dimension& slidingDimension); + result SetSlidingDimension(Tizen::Graphics::FloatDimension& slidingDimension); + Tizen::Graphics::Dimension GetSlidingDimension(void) const; + Tizen::Graphics::FloatDimension GetSlidingDimensionF(void) const; + void SetSlidingPosition(int slidingPosition); + void SetSlidingPosition(float slidingPosition); + int GetSlidingPosition(void) const; + float GetSlidingPositionF(void) const; + TextLine* GetPrevLineChangedStartLine(void) const; int GetChangeActionEventCount(void) const; @@ -167,6 +199,10 @@ public: result CompareDeletedLine(void); + result CalculateDisplayableLineCount(Rectangle& displayRect, const TextObjectActionType action); + + result CalculateDisplayableLineCount(FloatRectangle& displayRect, const TextObjectActionType action); + private: result RemoveLines(int lineIndex, int lineCount); diff --git a/src/graphics/text/FGrp_TextTextComposite.cpp b/src/graphics/text/FGrp_TextTextComposite.cpp index 8f78eb7..2cb01c4 100644 --- a/src/graphics/text/FGrp_TextTextComposite.cpp +++ b/src/graphics/text/FGrp_TextTextComposite.cpp @@ -27,6 +27,7 @@ #include "FGrp_TextCommon.h" #include "FGrp_TextTextElement.h" #include "FGrp_TextTextSimple.h" +#include "FGrp_TextTextImage.h" #include "FGrp_TextTextCutLink.h" #include "FGrp_TextTextLine.h" #include "FGrp_TextTextColumn.h" @@ -36,6 +37,7 @@ #include "FGrp_CanvasImpl.h" #include "FGrp_TextTextWidthManager.h" #include "../FGrp_Canvas.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Utility; @@ -48,6 +50,11 @@ using namespace Tizen::Base::Collection; x = null; \ } +namespace // unnamed +{ + const int LINE_FEED_WIDTH = 8; +} + namespace Tizen { namespace Graphics { @@ -127,11 +134,8 @@ TextComposite::TextComposite(TextElement* pTextElement) TextComposite::~TextComposite(void) { - if (__pCutLinkListInfo) - { - delete __pCutLinkListInfo; - __pCutLinkListInfo = null; - } + Release(__pCutLinkListInfo); + Release(__pAbbrevTextElement); if (__pTextElementList) { @@ -139,28 +143,18 @@ TextComposite::~TextComposite(void) delete __pTextElementList; __pTextElementList = null; } - - if (__pAbbrevTextElement) - { - delete __pAbbrevTextElement; - __pAbbrevTextElement = null; - } } int TextComposite::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height) { - SysTryReturn(NID_GRP - , 0 <= startTextIndex && startTextIndex < __length - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. startTextIndex(%d)", startTextIndex); - - SysTryReturn(NID_GRP - , textLength <= __length - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. textLength(%d)", textLength); + SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, -1, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. startTextIndex(%d)", startTextIndex); + SysTryReturn(NID_GRP, textLength <= __length, -1, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. textLength(%d)", textLength); result r = E_SUCCESS; - Dimension textSize; int elementTextOffset = 0; int elementIndex = 0; @@ -181,11 +175,8 @@ TextComposite::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, width = 0; height = 0; - pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength,textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); textCount = 0; remainingWidth = maxWidth; @@ -196,28 +187,22 @@ TextComposite::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while ((remainingWidth != 0) && (remainingLength != 0)) { ret = pTextElement->ForwardAnalyze(textIndexFromElementOffset, currentLength, remainingWidth, - __wrap, textCount, textSize.width, textSize.height); + wrap, textCount, textSize.width, textSize.height); textSize.height += __lineSpacing; - remainingWidth -= textSize.width; remainingLength -= textCount; currentLength -= textCount; - if (textCount != 0) - { - actualLength += textCount; - width += textSize.width; - height = Math::Max(textSize.height, height); - } + actualLength += textCount; + width += textSize.width; + height = Math::Max(textSize.height, height); if (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD && ret != TEXT_RETBY_LIMITWIDTH) { @@ -293,15 +278,29 @@ CATCH: } int +TextComposite::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength, + float& width, float& height) +{ + int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + + int r = ForwardAnalyze(startTextIndex, textLength, newMaxWidth, wrap, actualLength, newWidth, newHeight); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newWidth); + + return r; +} + +int TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height, int& baseline) { - SysTryReturn(NID_GRP - , 0 <= startTextIndex && startTextIndex < __length + SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. startTextIndex(%d)", startTextIndex); - SysTryReturn(NID_GRP - , textLength <= __length + SysTryReturn(NID_GRP, startTextIndex + textLength <= __length , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. textLength(%d)", textLength); result r = E_SUCCESS; @@ -329,9 +328,7 @@ TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, in pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); textCount = 0; remainingWidth = maxWidth; @@ -343,34 +340,27 @@ TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, in for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while (remainingLength != 0) { ret = pTextElement->ForwardAnalyze(textIndexFromElementOffset, currentLength, remainingWidth, - __wrap, textCount, textSize.width, textSize.height); + wrap, textCount, textSize.width, textSize.height); textSize.height += __lineSpacing; remainingWidth -= textSize.width; remainingLength -= textCount; currentLength -= textCount; - if (textCount != 0) + actualLength += textCount; + width += textSize.width; + baseline = Math::Max(pTextElement->GetBaseline(), baseline); + if (height < textSize.height) { - actualLength += textCount; - width += textSize.width; - baseline = Math::Max(pTextElement->GetBaseline(), baseline); + height = textSize.height; - // height = Math::Max(textSize.height, height); - if (height < textSize.height) - { - height = textSize.height; - - (pTextElement->GetType() == TEXT_ELEMENT_TYPE_IMAGE) ? isMaxHeightImage = true : isMaxHeightImage = false; - } + (pTextElement->GetType() == TEXT_ELEMENT_TYPE_IMAGE) ? isMaxHeightImage = true : isMaxHeightImage = false; } if (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD && ret != TEXT_RETBY_LIMITWIDTH) @@ -451,18 +441,37 @@ CATCH: return -1; } +int +TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength, + float& width, float& height, int& baseline) +{ + int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + + int r = ForwardAnalyzeWithBaseline(startTextIndex, textLength, newMaxWidth, wrap, actualLength, newWidth, newHeight, baseline); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newWidth); + + return r; +} + result TextComposite::GetRegion(int textIndex, int textLength, int& width, int& height) const { - SysTryReturn(NID_GRP - , 0 <= textIndex && textIndex < __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. textIndex(%d) __length(%d)" - , textIndex, __length); + if (textLength == 0) + { + width = 0; + height = 0; - SysTryReturn(NID_GRP - , textLength <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. textIndex(%d) __length(%d)" - , textIndex, __length); + return E_SUCCESS; + } + + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex < __length, E_INVALID_ARG, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. textIndex(%d) __length(%d)", textIndex, __length); + SysTryReturn(NID_GRP, textLength <= __length, E_INVALID_ARG, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. textIndex(%d) __length(%d)", textIndex, __length); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -476,19 +485,14 @@ TextComposite::GetRegion(int textIndex, int textLength, int& width, int& height) width = 0; height = 0; - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pEnum = __pTextElementList->GetEnumeratorN(); for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } currentLength = Math::Min(currentLength, textLength); @@ -527,6 +531,20 @@ CATCH: return r; } +result +TextComposite::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + + result r = GetRegion(textIndex, textLength, newWidth, newHeight); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newWidth); + + return r; +} + int TextComposite::GetHeight(int textIndex) const { @@ -535,9 +553,7 @@ TextComposite::GetHeight(int textIndex) const return 0; } - SysTryReturn(NID_GRP - , 0 <= textIndex && textIndex < __length - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex < __length, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); TextElement* pTextElement = null; int currentLength = 0; @@ -545,11 +561,8 @@ TextComposite::GetHeight(int textIndex) const int elementIndex = 0; int textIndexFromElementOffset = 0; - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryCatch(NID_GRP - , pTextElement - , , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); return pTextElement->GetHeight(); @@ -557,6 +570,12 @@ CATCH: return -1; } +float +TextComposite::GetHeightF(int textIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex)); +} + result TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action) @@ -566,54 +585,39 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe return E_SUCCESS; } - SysTryReturn(NID_GRP - , 0 <= startTextIndex && startTextIndex < __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , textLength <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textLength <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; TextElement* pTextElement = null; - Dimension textSize; Dimension spaceCharDim; Dimension abbrevTextDim; Rectangle adjustedRect = displayRect; + Rectangle blockRect; int currentLength = 0; int elementTextOffset = 0; int elementIndex = 0; int textIndexFromElementOffset = 0; - int blockStartTextIndex = 0; - int blockEndTextIndex = 0; bool drawAbbrevText = false; - bool isAlternateLookEnabled = false; - _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); - SysTryReturn(NID_GRP - , pCanvas - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); - pTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - - if (pTextElement && __ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) + if (__ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) { + pTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + const TextSimple* pSimpleText = dynamic_cast (pTextElement); if (pSimpleText != null) { int length = startTextIndex + textLength - elementTextOffset - 1; const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + SysTryReturn(NID_GRP, pText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); - SysTryReturn(NID_GRP - , length >= 0 && length < pSimpleText->GetTextLength() - , E_OUT_OF_RANGE, E_OUT_OF_RANGE - , "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",length, pSimpleText->GetTextLength()); + SysTryReturn(NID_GRP, length >= 0 && length < pSimpleText->GetTextLength() + , E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",length, pSimpleText->GetTextLength()); if (pText[length] == (wchar_t)L' ') { @@ -623,11 +627,8 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe } } - pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryCatch(NID_GRP - , pTextElement - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); if (__ignoreFrontBlank && __frontSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) { @@ -636,14 +637,10 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe { int index = startTextIndex - elementTextOffset; const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + SysTryReturn(NID_GRP, pText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); - SysTryReturn(NID_GRP - , index >= 0 && index < pSimpleText->GetTextLength() - , E_OUT_OF_RANGE, E_OUT_OF_RANGE - , "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",index, pSimpleText->GetTextLength()); + SysTryReturn(NID_GRP, index >= 0 && index < pSimpleText->GetTextLength() + , E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",index, pSimpleText->GetTextLength()); if (pText[index] == (wchar_t)L' ') { @@ -656,15 +653,32 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe } } - switch (alignment & TEXT_ALIGNMASK_HORIZ) + GetRegion(startTextIndex, textLength, textSize.width, textSize.height); + if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV) { - case TEXT_OBJECT_ALIGNMENT_LEFT: - // fall through - default: - break; + TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1); + SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); - case TEXT_OBJECT_ALIGNMENT_CENTER: - GetRegion(startTextIndex, textLength, textSize.width, textSize.height); + if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement); + SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element."); + + SetAbbrevObjectFontInfo(pSimpleText); + __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height); + } + + ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width + , TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height); + + textSize.width += abbrevTextDim.width; + currentLength = Math::Min(currentLength, textLength); + drawAbbrevText = true; + } + + switch (alignment & TEXT_ALIGNMASK_HORIZ) + { + case TEXT_OBJECT_ALIGNMENT_CENTER: if (textSize.width < adjustedRect.width) { adjustedRect.x += (adjustedRect.width - textSize.width) / 2; @@ -672,23 +686,26 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe break; case TEXT_OBJECT_ALIGNMENT_RIGHT: - GetRegion(startTextIndex, textLength, textSize.width, textSize.height); if (textSize.width < adjustedRect.width) { adjustedRect.x += adjustedRect.width - textSize.width; } break; + + case TEXT_OBJECT_ALIGNMENT_LEFT: + // fall through + default: + break; } pEnum = __pTextElementList->GetEnumeratorN(); for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } + blockRect = Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height); currentLength = Math::Min(textLength, currentLength); while (textLength > 0) @@ -697,77 +714,8 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe pTextElement->GetRegion(textIndexFromElementOffset, currentLength, textSize.width, textSize.height); - if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV && (pTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)) - { - TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); - SysTryCatch(NID_GRP - , pSimpleText - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element."); - - SetAbbrevObjectFontInfo(pSimpleText); - - int textCount = 0; - __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height); - - if (adjustedRect.width < textSize.width + abbrevTextDim.width || textLength <= 0) - { - int endType = TEXT_RETBY_NORMAL; - - if (adjustedRect.width > abbrevTextDim.width) - { - int remainingLength = pSimpleText->GetTextLength() - textIndexFromElementOffset; - endType = pSimpleText->ForwardAnalyze(textIndexFromElementOffset, remainingLength, adjustedRect.width - abbrevTextDim.width, - TEXT_OBJECT_WRAP_TYPE_NONE, textCount, textSize.width, textSize.height); - - if (endType == TEXT_RETBY_OVERWIDTH) - { - textSize.width = 0; - textSize.height = 0; - textCount = 0; - } - } - else - { - textSize.width = 0; - textCount = 0; - textSize.height = pSimpleText->GetHeight(); - } - - currentLength = textCount; - drawAbbrevText = true; - - switch (alignment & TEXT_ALIGNMASK_HORIZ) - { - case TEXT_OBJECT_ALIGNMENT_CENTER: - if (textSize.width + abbrevTextDim.width < adjustedRect.width) - { - adjustedRect.x = displayRect.x + (adjustedRect.width - (textSize.width + abbrevTextDim.width)) / 2; - } - break; - - case TEXT_OBJECT_ALIGNMENT_RIGHT: - if (textSize.width + abbrevTextDim.width < adjustedRect.width) - { - adjustedRect.x = displayRect.x + adjustedRect.width - (textSize.width + abbrevTextDim.width); - } - break; - - case TEXT_OBJECT_ALIGNMENT_LEFT: - // fall through - default: - break; - } - } - } - switch (alignment & TEXT_ALIGNMASK_VERT) { - case TEXT_OBJECT_ALIGNMENT_TOP: - // fall through - default: - adjustedRect.y = displayRect.y; - break; - case TEXT_OBJECT_ALIGNMENT_MIDDLE: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height) / 2; break; @@ -775,59 +723,23 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe case TEXT_OBJECT_ALIGNMENT_BOTTOM: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height); break; + + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + adjustedRect.y = displayRect.y; + break; } if (pTextElement->IsBackGroundDrawingModeEnable()) { - Dimension blockSize; - r = pTextElement->GetRegion(textIndexFromElementOffset, currentLength, blockSize.width, blockSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, blockSize.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + DrawBackgroundBlock(canvasImpl, Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action); } - isAlternateLookEnabled = (bool)pTextElement->GetValue(SET_ALTERNATE_LOOK); + bool isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false; if (__displayBlock && isAlternateLookEnabled == false) { - Dimension tempTextSize; - int adjustedX = 0; - - blockStartTextIndex = Math::Max(__workStart, startTextIndex); - blockEndTextIndex = Math::Min(__workStart + __workLength, startTextIndex + currentLength); - - if (blockStartTextIndex < blockEndTextIndex) - { - blockStartTextIndex = textIndexFromElementOffset + (blockStartTextIndex - startTextIndex); - blockEndTextIndex = textIndexFromElementOffset + (blockEndTextIndex - startTextIndex); - adjustedX = adjustedRect.x; - - if (textIndexFromElementOffset < blockStartTextIndex) - { - //[TODO] yunji19.park : to change api -> _Font::GetPosition() - pTextElement->GetRegion(textIndexFromElementOffset, blockStartTextIndex - textIndexFromElementOffset, tempTextSize.width, tempTextSize.height); - adjustedX += tempTextSize.width; - } - - Rectangle blockRect = adjustedRect; - blockRect.x = adjustedX; - - Dimension blockSize; - int blockLength = blockEndTextIndex - blockStartTextIndex; - r = pTextElement->GetBlockRegion(blockStartTextIndex, blockLength, blockSize.width, blockSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x, displayRect.y, blockSize.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - } + DrawBlock(canvasImpl, blockRect, startTextIndex, currentLength, alignment, action); } pTextElement->Draw(canvasImpl, adjustedRect, textIndexFromElementOffset, currentLength, alignment, action); @@ -835,24 +747,6 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe adjustedRect.x += textSize.width; adjustedRect.width -= textSize.width; - if (drawAbbrevText) - { - if (pTextElement->IsBackGroundDrawingModeEnable()) - { - r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - - __pAbbrevTextElement->Draw(canvasImpl, adjustedRect, 0, 1, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_TOP | TEXT_OBJECT_ALIGNMENT_LEFT), action); - - adjustedRect.x += abbrevTextDim.width; - adjustedRect.width -= abbrevTextDim.width; - - break; - } - if (!textLength || adjustedRect.width <= 0) { break; @@ -880,6 +774,20 @@ TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTe } } + if (drawAbbrevText) + { + if (pTextElement->IsBackGroundDrawingModeEnable()) + { + r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + + __pAbbrevTextElement->Draw(canvasImpl, adjustedRect, 0, 1, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_TOP | TEXT_OBJECT_ALIGNMENT_LEFT), action); + + adjustedRect.x += abbrevTextDim.width; + adjustedRect.width -= abbrevTextDim.width; + } + Release(pEnum); return E_SUCCESS; @@ -889,6 +797,15 @@ CATCH: } result +TextComposite::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, + const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return Draw(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action); +} + +result TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action, int baseline) { @@ -897,13 +814,8 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, return E_SUCCESS; } - SysTryReturn(NID_GRP - , 0 <= startTextIndex && startTextIndex < __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , textLength <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textLength <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -913,36 +825,28 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, Dimension spaceCharDim; Dimension abbrevTextDim; Rectangle adjustedRect = displayRect; + Rectangle blockRect; int currentLength = 0; int elementTextOffset = 0; int elementIndex = 0; int textIndexFromElementOffset = 0; - int blockStartTextIndex = 0; - int blockEndTextIndex = 0; bool drawAbbrevText = false; - bool isAlternateLookEnabled = false; _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); - SysTryReturn(NID_GRP - , pCanvas - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); - - pTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); - if (pTextElement && __ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) + if (__ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) { + pTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); const TextSimple* pSimpleText = dynamic_cast (pTextElement); if (pSimpleText != null) { int length = startTextIndex + textLength - elementTextOffset - 1; const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + SysTryReturn(NID_GRP, pText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); - SysTryReturn(NID_GRP - , length >= 0 && length < pSimpleText->GetTextLength() + SysTryReturn(NID_GRP, length >= 0 && length < pSimpleText->GetTextLength() , E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",length, pSimpleText->GetTextLength()); if (pText[length] == (wchar_t)L' ') @@ -953,11 +857,8 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, } } - pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryCatch(NID_GRP - , pTextElement - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); if (__ignoreFrontBlank && __frontSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) { @@ -966,12 +867,9 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, { int index = startTextIndex - elementTextOffset; const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + SysTryReturn(NID_GRP, pText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text."); - SysTryReturn(NID_GRP - , index >= 0 && index < pSimpleText->GetTextLength() + SysTryReturn(NID_GRP, index >= 0 && index < pSimpleText->GetTextLength() , E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",index, pSimpleText->GetTextLength()); if (pText[index] == (wchar_t)L' ') @@ -984,15 +882,32 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, } } - switch (alignment & TEXT_ALIGNMASK_HORIZ) + GetRegion(startTextIndex, textLength, textSize.width, textSize.height); + if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV) { - case TEXT_OBJECT_ALIGNMENT_LEFT: - // fall through - default: - break; + TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1); + SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + + if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement); + SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element."); + + SetAbbrevObjectFontInfo(pSimpleText); + __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height); + } + + ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width + , TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height); + + textSize.width += abbrevTextDim.width; + currentLength = textLength; + drawAbbrevText = true; + } + switch (alignment & TEXT_ALIGNMASK_HORIZ) + { case TEXT_OBJECT_ALIGNMENT_CENTER: - GetRegion(startTextIndex, textLength, textSize.width, textSize.height); if (textSize.width < adjustedRect.width) { adjustedRect.x += (adjustedRect.width - textSize.width) / 2; @@ -1000,23 +915,26 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, break; case TEXT_OBJECT_ALIGNMENT_RIGHT: - GetRegion(startTextIndex, textLength, textSize.width, textSize.height); if (textSize.width < adjustedRect.width) { adjustedRect.x += adjustedRect.width - textSize.width; } break; + + case TEXT_OBJECT_ALIGNMENT_LEFT: + // fall through + default: + break; } pEnum = __pTextElementList->GetEnumeratorN(); for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } + blockRect = Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height); adjustedRect.y = displayRect.y + displayRect.height - baseline; canvasImpl.SetTextOrigin(TEXT_ORIGIN_BASELINE); @@ -1028,140 +946,32 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, pTextElement->GetRegion(textIndexFromElementOffset, currentLength, textSize.width, textSize.height); - if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV && (pTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)) + if (pTextElement->IsBackGroundDrawingModeEnable()) { - TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); - SysTryCatch(NID_GRP - , pSimpleText - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element."); + DrawBackgroundBlock(canvasImpl, Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action); + } - SetAbbrevObjectFontInfo(pSimpleText); + bool isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false; + if (__displayBlock && isAlternateLookEnabled == false) + { + DrawBlock(canvasImpl, blockRect, startTextIndex, currentLength, alignment, action); + } - int textCount = 0; - __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height); + Rectangle imageRect = adjustedRect; + imageRect.y -= textSize.height; + TextElementType objectType = pTextElement->GetType(); - if (adjustedRect.width < textSize.width + abbrevTextDim.width || textLength <= 0) - { - int endType = TEXT_RETBY_NORMAL; + if (objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT) + { + pTextElement->Draw(canvasImpl, adjustedRect, textIndexFromElementOffset, currentLength, alignment, action); + } + else + { + pTextElement->Draw(canvasImpl, imageRect, textIndexFromElementOffset, currentLength, alignment, action); + } - if (adjustedRect.width > abbrevTextDim.width) - { - int remainingLength = pSimpleText->GetTextLength() - textIndexFromElementOffset; - endType = pSimpleText->ForwardAnalyze(textIndexFromElementOffset, remainingLength, adjustedRect.width - abbrevTextDim.width, - TEXT_OBJECT_WRAP_TYPE_NONE, textCount, textSize.width, textSize.height); - - if (endType == TEXT_RETBY_OVERWIDTH) - { - textSize.width = 0; - textSize.height = 0; - textCount = 0; - } - } - else - { - textSize.width = 0; - textCount = 0; - textSize.height = pSimpleText->GetHeight(); - } - - currentLength = textCount; - drawAbbrevText = true; - - switch (alignment & TEXT_ALIGNMASK_HORIZ) - { - case TEXT_OBJECT_ALIGNMENT_CENTER: - if (textSize.width + abbrevTextDim.width < adjustedRect.width) - { - adjustedRect.x = displayRect.x + (adjustedRect.width - (textSize.width + abbrevTextDim.width)) / 2; - } - break; - - case TEXT_OBJECT_ALIGNMENT_RIGHT: - if (textSize.width + abbrevTextDim.width < adjustedRect.width) - { - adjustedRect.x = displayRect.x + adjustedRect.width - (textSize.width + abbrevTextDim.width); - } - break; - - case TEXT_OBJECT_ALIGNMENT_LEFT: - // fall through - default: - break; - } - } - } - - if (pTextElement->IsBackGroundDrawingModeEnable()) - { - Dimension blockSize; - r = pTextElement->GetRegion(textIndexFromElementOffset, currentLength, blockSize.width, blockSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, blockSize.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - - isAlternateLookEnabled = (bool)pTextElement->GetValue(SET_ALTERNATE_LOOK); - if (__displayBlock && isAlternateLookEnabled == false) - { - Dimension tempTextSize; - int adjustedX = 0; - - blockStartTextIndex = Math::Max(__workStart, startTextIndex); - blockEndTextIndex = Math::Min(__workStart + __workLength, startTextIndex + currentLength); - if (blockStartTextIndex < blockEndTextIndex) - { - blockStartTextIndex = textIndexFromElementOffset + (blockStartTextIndex - startTextIndex); - blockEndTextIndex = textIndexFromElementOffset + (blockEndTextIndex - startTextIndex); - adjustedX = adjustedRect.x; - - if (textIndexFromElementOffset < blockStartTextIndex) - { - pTextElement->GetRegion(textIndexFromElementOffset, blockStartTextIndex - textIndexFromElementOffset, tempTextSize.width, tempTextSize.height); - adjustedX += tempTextSize.width; - } - - Rectangle block_rect = adjustedRect; - block_rect.x = adjustedX; - } - } - - Rectangle imageRect = adjustedRect; - imageRect.y -= textSize.height; - TextElementType objectType = pTextElement->GetType(); - if (objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT) - { - pTextElement->Draw(canvasImpl, adjustedRect, textIndexFromElementOffset, currentLength, alignment, action); - } - else - { - pTextElement->Draw(canvasImpl, imageRect, textIndexFromElementOffset, currentLength, alignment, action); - } - - adjustedRect.x += textSize.width; - adjustedRect.width -= textSize.width; - - if (drawAbbrevText) - { - if (pTextElement->IsBackGroundDrawingModeEnable()) - { - r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - - __pAbbrevTextElement->Draw(canvasImpl, adjustedRect, 0, 1, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_TOP | TEXT_OBJECT_ALIGNMENT_LEFT), action); - - adjustedRect.x += abbrevTextDim.width; - adjustedRect.width -= abbrevTextDim.width; - - break; - } + adjustedRect.x += textSize.width; + adjustedRect.width -= textSize.width; if (!textLength || adjustedRect.width <= 0) { @@ -1190,6 +1000,20 @@ TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, } } + if (drawAbbrevText) + { + if (pTextElement->IsBackGroundDrawingModeEnable()) + { + r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + + __pAbbrevTextElement->Draw(canvasImpl, adjustedRect, 0, 1, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_TOP | TEXT_OBJECT_ALIGNMENT_LEFT), action); + + adjustedRect.x += abbrevTextDim.width; + adjustedRect.width -= abbrevTextDim.width; + } + canvasImpl.SetTextOrigin(TEXT_ORIGIN_LEFT_TOP); Release(pEnum); @@ -1203,12 +1027,208 @@ CATCH: } result +TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, + const TextObjectActionType action, int baseline) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawWithBaseline(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action, baseline); +} + +result +TextComposite::DrawBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + int lineIndex = __pCurrentTextColumn->GetLineIndexAtTextIndex(startTextIndex); + TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(lineIndex); + SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + int lineOffset = pTextLine->GetTextOffset(); + int blockStartTextIndex = Math::Max(__workStart, startTextIndex); + int blockEndTextIndex = Math::Min(__workStart + __workLength, startTextIndex + textLength); + int blockTextLength = blockEndTextIndex - blockStartTextIndex; + + if (blockStartTextIndex >= blockEndTextIndex) + { + return E_SUCCESS; + } + + _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + + Rectangle lineBounds = pTextLine->GetBounds(); + blockStartTextIndex -= lineOffset; + blockEndTextIndex -= lineOffset; + + Rectangle blockRect = displayRect; + blockRect.y = lineBounds.y; + + LinkedListT<_Util::Pair* >* pGapList = pTextLine->GetTextExtentList(); + + int left = 0; + int right = 0; + int blockStart = 0; + int blockEnd = 0; + + _Util::Pair* pPair = null; + IEnumeratorT<_Util::Pair* >* pEnum = pGapList->GetEnumeratorN(); + + for (int i = 0; i <= blockStartTextIndex; i++) + { + pEnum->MoveNext(); + } + + for (int count = 0; count < blockTextLength; count++) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + if (right == pPair->first || left == pPair->second) + { + blockStart = (pPair->first < blockStart) ? pPair->first : blockStart; + blockEnd = (pPair->second > blockEnd) ? pPair->second : blockEnd; + } + else + { + if (blockStart != blockEnd) + { + pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height)); + } + + blockStart = pPair->first; + blockEnd = pPair->second; + } + + left = pPair->first; + right = pPair->second; + } + + pEnum->MoveNext(); + } + + if (blockStart != blockEnd) + { + pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height)); + } + + if ((pTextLine->GetEndType() == TEXT_RETBY_LINEFEED) && (pTextLine->GetTextLength() == blockEndTextIndex)) + { + pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height)); + } + + Release(pEnum); + + return E_SUCCESS; +} + +result +TextComposite::DrawBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawBlock(canvasImpl, newDisplayRect, startTextIndex, textLength, align, action); +} + +result +TextComposite::DrawBackgroundBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + if (textLength == 0) + { + return E_SUCCESS; + } + + TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(__pCurrentTextColumn->GetLineIndexAtTextIndex(startTextIndex)); + SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + + int blockEndTextIndex = startTextIndex + textLength; + int prevLeft = 0; + int prevRight = 0; + int blockStart = 0; + int blockEnd = 0; + int currentLength = 0; + int elementTextOffset = 0; + int elementIndex = 0; + int textIndexFromElementOffset = 0; + + Rectangle lineBounds = pTextLine->GetBounds(); + blockEndTextIndex -= pTextLine->GetTextOffset(); + Rectangle blockRect = displayRect; + blockRect.y = lineBounds.y; + + TextElement* pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + + TextElementType objectType = pTextElement->GetType(); + if (objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); + if (pSimpleText != null) + { + Color backgroundColor = pSimpleText->GetBackgroundColor(); + + _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont()))); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + + _Util::AccumList<_Util::Pair > elemenGaptList; + const wchar_t* pText = pSimpleText->GetTextSource(); + pFont->GetTextExtentList(_Util::String(pText, wcslen(pText), textIndexFromElementOffset, textLength), elemenGaptList); + + for (_Util::AccumList<_Util::Pair >::Iterator iterator = elemenGaptList.Begin(); iterator != elemenGaptList.End(); iterator++) + { + if (prevRight == iterator->first || prevLeft == iterator->second) + { + blockStart = (iterator->first < blockStart) ? iterator->first : blockStart; + blockEnd = (iterator->second > blockEnd) ? iterator->second : blockEnd; + } + else + { + if (blockStart != blockEnd) + { + pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height)); + } + + blockStart = iterator->first; + blockEnd = iterator->second; + } + + prevLeft = iterator->first; + prevRight = iterator->second; + } + + if (blockStart != blockEnd) + { + pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height)); + } + + if ((pTextLine->GetEndType() == TEXT_RETBY_LINEFEED) && (pTextLine->GetTextLength() == blockEndTextIndex)) + { + pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height)); + } + } + } + + return E_SUCCESS; +} + +result +TextComposite::DrawBackgroundBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawBackgroundBlock(canvasImpl, newDisplayRect, startTextIndex, textLength, align, action); +} + +result TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rectangle& displayRect, const TextObjectAlignment align, const TextObjectActionType action) { - SysTryReturn(NID_GRP - , pTextLine - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); int lineOffset = 0; int lineLength = 0; @@ -1217,6 +1237,9 @@ TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rect Rectangle lineBounds; Dimension lineTextSize; + _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + lineLength = pTextLine->GetTextLength(); lineOffset = pTextLine->GetTextOffset(); @@ -1229,26 +1252,33 @@ TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rect if (__elementVertialAlignment & TEXT_OBJECT_ALIGNMENT_BASELINE) { - return DrawWithBaseline(canvasImpl, adjustedRect, lineOffset, lineLength, (TextObjectAlignment)((TEXT_ALIGNMASK_HORIZ & align) | TEXT_OBJECT_ALIGNMENT_BASELINE), action, pTextLine->GetBaseline()); + return DrawWithBaseline(canvasImpl, adjustedRect, lineOffset, lineLength, + (TextObjectAlignment)((TEXT_ALIGNMASK_HORIZ & align) | TEXT_OBJECT_ALIGNMENT_BASELINE), action, pTextLine->GetBaseline()); } else { - return Draw(canvasImpl, adjustedRect, lineOffset, lineLength, (TextObjectAlignment)((TEXT_ALIGNMASK_HORIZ & align) | __elementVertialAlignment), action); + return Draw(canvasImpl, adjustedRect, lineOffset, lineLength, + (TextObjectAlignment)((TEXT_ALIGNMASK_HORIZ & align) | __elementVertialAlignment), action); } } result +TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const FloatRectangle& displayRect, + const TextObjectAlignment align, const TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawLine(canvasImpl, pTextLine, newDisplayRect, align, action); +} + +result TextComposite::GetValue(TextElement* pTextElement, TextComponentInfoValueType type, unsigned int* value) const { - SysTryReturn(NID_GRP - , pTextElement - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pTextElement, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); TextElementType objectType = TextUtility::GetObjectTypeFromValueType(type); - SysTryReturn(NID_GRP - , pTextElement->GetType() == objectType - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get type."); + SysTryReturn(NID_GRP, pTextElement->GetType() == objectType, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get type."); *value = pTextElement->GetValue(type); @@ -1258,9 +1288,7 @@ TextComposite::GetValue(TextElement* pTextElement, TextComponentInfoValueType ty result TextComposite::InsertElementAt(TextElement& textElement, int textIndex) { - SysTryReturn(NID_GRP - , 0 <= textIndex && textIndex <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; @@ -1280,23 +1308,17 @@ TextComposite::InsertElementAt(TextElement& textElement, int textIndex) if (textIndex == elementTextOffset) { r = __pTextElementList->InsertAt(textElement, elementIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); } else { pCurrentTextElement->SetTextLength(pCurrentTextElement->GetTextLength() - currentLength); r = __pTextElementList->InsertAt(textElement, ++elementIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); pNewTextElement = pCurrentTextElement->CloneN(SET_ALLVALUE_CLONE, 0); - SysTryReturn(NID_GRP - , pNewTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); pNewTextElement->SetTextLength(currentLength); @@ -1306,9 +1328,7 @@ TextComposite::InsertElementAt(TextElement& textElement, int textIndex) } r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); } } else @@ -1316,9 +1336,7 @@ TextComposite::InsertElementAt(TextElement& textElement, int textIndex) if (textIndex == __length) { r = __pTextElementList->Add(textElement); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to add element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to add element.", GetErrorMessage(r)); } else { @@ -1363,9 +1381,7 @@ TextComposite::AppendElement(TextElement& textElement) int elementTextLength = textElement.GetTextLength(); r = __pTextElementList->Add(textElement); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to add element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to add element.", GetErrorMessage(r)); __workStart = __length; __workLength = elementTextLength; @@ -1396,41 +1412,133 @@ TextComposite::AppendElement(TextElement& textElement) } result -TextComposite::RemoveElementAt(int elementIndex, bool deallocate) +TextComposite::Remove(int startTextIndex, int textLength) { - SysTryReturn(NID_GRP - , elementIndex >= 0 && elementIndex < __pTextElementList->GetCount() - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + if (textLength == 0) + { + return E_SUCCESS; + } result r = E_SUCCESS; - TextElement* pTextElement = null; + TextElement* pNewTextElement = null; + int startElementIndex = -1; + int endElementIndex = -1; + int elementTextOffset = 0; + int elementIndex = 0; + int currentLength = 0; + int textIndexFromElementOffset = 0; + int textIndex = startTextIndex; + int remainingLength = textLength; - pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(elementIndex)); - if (pTextElement != null) + TextElement* pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, currentLength > 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] _Text::TextElement is invalid."); + + startElementIndex = elementIndex; + + if (elementTextOffset == textIndex && remainingLength == currentLength) { - int elementTextLength = pTextElement->GetTextLength(); - int elementTextOffset = GetFirstTextIndexAt(elementIndex); + __pTextElementList->RemoveAt(elementIndex, true); - r = __pTextElementList->RemoveAt(elementIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to remove element.", GetErrorMessage(r)); + goto TRUE_CATCH; + } + else if (elementTextOffset < textIndex && remainingLength < currentLength) + { + pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); - if (pTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK) - { - __pCutLinkListInfo->RemoveCutLinkElementInfo(dynamic_cast < TextCutLink* >(pTextElement)); - } - else + pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); + SysTryReturn(NID_GRP, pNewTextElement, r, r, "[E_SYSTEM] Fail to clone text element."); + + pNewTextElement->SetTextLength(currentLength - remainingLength); + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + remainingLength); + + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + endElementIndex = elementIndex; + + goto TRUE_CATCH; + } + else if (elementTextOffset < textIndex) + { + pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); + + textIndex += currentLength; + remainingLength -= currentLength; + elementIndex++; + } + + while (remainingLength > 0) + { + pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(elementIndex)); + if (!pTextElement) { - __pCutLinkListInfo->RemoveText(elementTextOffset, elementTextLength); + endElementIndex = elementIndex; + break; } - __length -= elementTextLength; + textIndexFromElementOffset = pTextElement->GetValue(SET_TEXT_OFFSET); + currentLength = pTextElement->GetTextLength(); - if (deallocate) + if (remainingLength < currentLength) + { + pTextElement->SetTextLength(currentLength - remainingLength); + pTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + remainingLength); + + endElementIndex = elementIndex; + break; + } + else { - delete pTextElement; - pTextElement = null; + __pTextElementList->RemoveAt(elementIndex, true); + } + + endElementIndex = elementIndex; + remainingLength -= currentLength; + } + +TRUE_CATCH: + __length -= textLength; + Optimize(startElementIndex, endElementIndex); + return E_SUCCESS; + +CATCH: + Release(pNewTextElement); + return r; +} + +result +TextComposite::RemoveElementAt(int elementIndex, bool deallocate) +{ + SysTryReturn(NID_GRP, elementIndex >= 0 && elementIndex < __pTextElementList->GetCount() + , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + result r = E_SUCCESS; + TextElement* pTextElement = null; + + pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(elementIndex)); + if (pTextElement != null) + { + int elementTextLength = pTextElement->GetTextLength(); + int elementTextOffset = GetFirstTextIndexAt(elementIndex); + + r = __pTextElementList->RemoveAt(elementIndex); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to remove element.", GetErrorMessage(r)); + + if (pTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK) + { + __pCutLinkListInfo->RemoveCutLinkElementInfo(dynamic_cast < TextCutLink* >(pTextElement)); + } + else + { + __pCutLinkListInfo->RemoveText(elementTextOffset, elementTextLength); + } + + __length -= elementTextLength; + + if (deallocate) + { + Release(pTextElement); } } @@ -1449,19 +1557,13 @@ TextComposite::RemoveAllElements(bool deallocate) __pTextElementList->RemoveAll(deallocate); - SysTryCatch(NID_GRP - , __pTextElementList->GetCount() == 0 - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to remove all elements."); + SysTryCatch(NID_GRP, __pTextElementList->GetCount() == 0, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to remove all elements."); __workStart = 0; __workLength = 0; __length = 0; __displayBlock = false; - __ignoreRearBlank = false; - __ignoreFrontBlank = false; __cursorIndex = -1; - __rearSpaceHideMode = TEXT_OBJECT_SPACE_HIDE_TYPE_NONE; - __frontSpaceHideMode = TEXT_OBJECT_SPACE_HIDE_TYPE_NONE; return E_SUCCESS; @@ -1477,9 +1579,7 @@ CATCH: TextElement* TextComposite::SearchTextElement(TextElementType type, int textIndex, int& elementTextOffset) const { - SysTryReturn(NID_GRP - , 0 <= textIndex && textIndex < __length - , null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex < __length, null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -1489,11 +1589,8 @@ TextComposite::SearchTextElement(TextElementType type, int textIndex, int& eleme int currentLength = 0; int textIndexFromElementOffset = 0; - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); if (pTextElement->GetType() == type) { @@ -1506,9 +1603,7 @@ TextComposite::SearchTextElement(TextElementType type, int textIndex, int& eleme for (int i = 0; i < elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while (pEnum->MoveNext() == E_SUCCESS) @@ -1538,16 +1633,132 @@ CATCH: return null; } +wchar_t* +TextComposite::GetTextN(int startTextIndex, int textLength) const +{ + SysTryReturn(NID_GRP, 0 <= startTextIndex && textLength <= __length, null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + result r = E_SUCCESS; + IEnumerator* pEnum = null; + + int currentLength = 0; + int elementTextOffset = 0; + int elementIndex = 0; + int textIndexFromElementOffset = 0; + + wchar_t* pText = new (std::nothrow) wchar_t[textLength+1]; + SysTryReturn(NID_GRP, pText, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + wchar_t* pTextPointer = pText; + + TextElement* pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, , E_SYSTEM, "[E_SYSTEM] Fail to get element."); + + textIndexFromElementOffset = startTextIndex - elementTextOffset; + + pEnum = __pTextElementList->GetEnumeratorN(); + for (int i = 0; i < elementIndex; i++) + { + r = pEnum->MoveNext(); + } + + while (pEnum->MoveNext() == E_SUCCESS) + { + pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); + if (pTextElement) + { + currentLength = Math::Min(pTextElement->GetTextLength() - textIndexFromElementOffset, textLength); + + TextElementType objectType = pTextElement->GetType(); + + if (objectType == TEXT_ELEMENT_TYPE_TEXT || objectType == TEXT_ELEMENT_TYPE_CUTLINK) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); + if (pSimpleText) + { + const wchar_t* pSrcText = pSimpleText->GetText(); + TextUtility::CopyText(pTextPointer, &pSrcText[textIndexFromElementOffset], currentLength); + } + + textLength -= currentLength; + pTextPointer += currentLength; + } + } + + if (textLength <= 0) + { + break; + } + + textIndexFromElementOffset = 0; + } + + Release(pEnum); + return pText; + +CATCH: + if (pText) + { + delete[] pText; + pText = null; + } + + Release(pEnum); + return null; +} + +wchar_t +TextComposite::GetCharacter(int textIndex) const +{ + wchar_t ch = { 0 }; + + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex <= __length, ch, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. textIndex(%d), __length(%d)", textIndex, __length); + + result r = E_SUCCESS; + IEnumerator* pEnum = null; + int currentLength = 0; + int elementTextOffset = 0; + int elementIndex = 0; + int textIndexFromElementOffset = 0; + + TextElement* pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, ch, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + + textIndexFromElementOffset = textIndex - elementTextOffset; + + pEnum = __pTextElementList->GetEnumeratorN(); + for (int i = 0; i < elementIndex + 1; i++) + { + r = pEnum->MoveNext(); + } + + pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); + + if (pTextElement) + { + TextElementType objectType = pTextElement->GetType(); + + if (objectType == TEXT_ELEMENT_TYPE_TEXT || objectType == TEXT_ELEMENT_TYPE_CUTLINK) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); + if (pSimpleText) + { + const wchar_t* pText = pSimpleText->GetText(); + ch = pText[textIndexFromElementOffset]; + } + } + } + + Release(pEnum); + return ch; +} + result TextComposite::GetText(TextComposite* pTargetCompsiteText, int textIndex, int textLength) { - SysTryReturn(NID_GRP - , pTargetCompsiteText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , 0 < textLength - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pTargetCompsiteText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 < textLength, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -1564,11 +1775,8 @@ TextComposite::GetText(TextComposite* pTargetCompsiteText, int textIndex, int te textIndex = 0; } - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element."); textIndexFromElementOffset = textIndex - elementTextOffset; @@ -1576,9 +1784,7 @@ TextComposite::GetText(TextComposite* pTargetCompsiteText, int textIndex, int te for (int i = 0; i < elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while (pEnum->MoveNext() == E_SUCCESS) @@ -1612,9 +1818,7 @@ CATCH : int TextComposite::Compose(Rectangle& rect, TextColumn* pTextColumn) { - SysTryReturn(NID_GRP - , pTextColumn - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pTextColumn, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); __pCurrentTextColumn = pTextColumn; @@ -1634,8 +1838,8 @@ TextComposite::Compose(Rectangle& rect, TextColumn* pTextColumn) if (__drawAbbrevText) { __pCurrentTextColumn->PrepareCompose(); - __drawTextEllipsis = false; + if (__TextObjectEllipsisType == TEXT_OBJECT_ELLIPSIS_TYPE_TAIL) { lineCount = ComposeInNoneWrap(rect); @@ -1660,8 +1864,7 @@ TextComposite::Compose(Rectangle& rect, TextColumn* pTextColumn) noneWrapComposeInfo.prevTextOffset = pTextLine->GetTextOffset(); noneWrapComposeInfo.prevTextLength = pTextLine->GetTextLength(); - pTextLine->GetRegion(0, noneWrapComposeInfo.prevTextLength, - noneWrapComposeInfo.prevWidth, noneWrapComposeInfo.prevHeight); + pTextLine->GetRegion(0, noneWrapComposeInfo.prevTextLength, noneWrapComposeInfo.prevWidth, noneWrapComposeInfo.prevHeight); noneWrapComposeInfo.prevEndType = pTextLine->GetEndType(); setNoneWrapComposeInfo = true; } @@ -1708,50 +1911,299 @@ TextComposite::Compose(Rectangle& rect, TextColumn* pTextColumn) __pCurrentTextColumn->FinishCompose(); } - break; - } - } + break; + } + } + + return lineCount; +} + +int +TextComposite::Compose(FloatRectangle& rect, TextColumn* pTextColumn) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return Compose(newRect, pTextColumn); +} + +result +TextComposite::SetRange(int textStartIndex, int textLength) +{ + SysTryReturn(NID_GRP, 0 <= textStartIndex && textStartIndex <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + __workStart = textStartIndex; + __workLength = textLength; + + return E_SUCCESS; +} + +void +TextComposite::GetRange(int& startTextIndex, int& textLength) const +{ + startTextIndex = __workStart; + textLength = __workLength; +} + +result +TextComposite::SetDisplayBitmap(const Bitmap* pBitmap) +{ + if (__workLength == 0) + { + return E_SUCCESS; + } + + result r = E_SUCCESS; + IEnumerator* pEnum = null; + TextElement* pTextElement = null; + TextElement* pNewTextElement = null; + int startElementIndex = -1; + int endElementIndex = -1; + int textIndex = __workStart; + int textLength = __workLength; + int elementTextOffset = 0; + int elementIndex = 0; + int currentLength = 0; + int textIndexFromElementOffset = 0; + int found = false; + TextComponentInfoValueType type = SET_ALTERNATE_DISPLAY_BITMAP; + + BitmapDisplayProperty displayProperty; + displayProperty.displayEnable = true; + displayProperty.pBitmap = pBitmap; + + while (textLength > 0) + { + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, 0 < currentLength, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] _Text::TextElement is invalid."); + + if (pTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT) + { + found = true; + startElementIndex = elementIndex; + break; + } + + textIndex += currentLength; + textLength -= currentLength; + } + + if (!found) + { + return E_SUCCESS; + } + + if (elementTextOffset == textIndex && textLength == currentLength) + { + pTextElement->SetValue(SET_ALTERNATE_DISPLAY_BITMAP, (unsigned int)&displayProperty); + displayProperty.displayEnable = false; + goto TRUE_CATCH; + } + else if (elementTextOffset < textIndex && textLength < currentLength) + { + pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); + + pNewTextElement = pTextElement->CloneN(SET_ALTERNATE_DISPLAY_BITMAP, (unsigned int)&displayProperty); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + + pNewTextElement->SetTextLength(textLength); + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset); + displayProperty.displayEnable = false; + + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); + SysTryReturn(NID_GRP, pNewTextElement, r, r, "[E_SYSTEM] Fail to clone text element."); + + pNewTextElement->SetTextLength(currentLength - textLength); + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + textLength); + + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + endElementIndex = elementIndex; + goto TRUE_CATCH; + } + else if (elementTextOffset < textIndex) + { + pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); + + pNewTextElement = pTextElement->CloneN(SET_ALTERNATE_DISPLAY_BITMAP, (unsigned int)&displayProperty); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset); + pNewTextElement->SetTextLength(currentLength); + displayProperty.displayEnable = false; + + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + textIndex += currentLength; + textLength -= currentLength; + + if (textLength > 0) + { + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + if (pTextElement == null) + { + goto TRUE_CATCH; + } + } + else + { + endElementIndex = elementIndex; + goto TRUE_CATCH; + } + } + + pEnum = __pTextElementList->GetEnumeratorN(); + for (int i = 0; i <= elementIndex; i++) + { + r = pEnum->MoveNext(); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + } + + while (textLength > 0) + { + TextElementType objectType = pTextElement->GetType(); + TextElementType objectTypeFromValueType = TextUtility::GetObjectTypeFromValueType(type); + unsigned int elementValue = pTextElement->GetValue(SET_ALTERNATE_DISPLAY_BITMAP); + + if (objectType == objectTypeFromValueType && (unsigned int)&displayProperty != elementValue) + { + if (textLength < currentLength) + { + pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + + pNewTextElement->SetTextLength(currentLength - textLength); + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + textLength); + + pTextElement->SetValue(SET_ALTERNATE_DISPLAY_BITMAP, (unsigned int)&displayProperty); + pTextElement->SetTextLength(textLength); + + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + break; + } + else + { + pTextElement->SetValue(SET_ALTERNATE_DISPLAY_BITMAP, (unsigned int)&displayProperty); + } + + displayProperty.displayEnable = false; + endElementIndex = elementIndex; + } + + elementTextOffset += currentLength; + textLength -= currentLength; + elementIndex++; + + if (pEnum->MoveNext() != E_SUCCESS) + { + break; + } + + pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); + if (pTextElement == null) + { + break; + } + + currentLength = pTextElement->GetTextLength(); + textIndexFromElementOffset = pTextElement->GetValue(SET_TEXT_OFFSET); + } + +TRUE_CATCH: + Optimize(startElementIndex, endElementIndex); + Release(pEnum); + return E_SUCCESS; + +CATCH: + Release(pNewTextElement); + Release(pEnum); + return r; +} + +const Bitmap* +TextComposite::GetDisplayBitmap(int textIndex) const +{ + result r = E_SUCCESS; + unsigned int value = 0; + + r = GetValue(textIndex, SET_ALTERNATE_DISPLAY_BITMAP, &value); + SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return (Bitmap*)value; +} + +result +TextComposite::SetFont(Font* pFont) +{ + return SetValueToAllTextElements(SET_FONT, (unsigned int)pFont); +} + +Font* +TextComposite::GetFont(int textIndex) const +{ + unsigned int value = 0; + + GetValue(textIndex, SET_FONT, &value); + Font* pFont = static_cast < Font* >((void*)value); + + SetLastResult(E_SUCCESS); - return lineCount; + return pFont; } result -TextComposite::SetRange(int textStartIndex, int textLength) +TextComposite::SetFontSize(int size) { - SysTryReturn(NID_GRP - , 0 <= textStartIndex && textStartIndex <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + return SetValueToAllTextElements(SET_FONT_SIZE, (unsigned int)size); +} - __workStart = textStartIndex; - __workLength = textLength; +result +TextComposite::SetFontSize(float size) +{ + return SetFontSize(_CoordinateSystemUtils::ConvertToInteger(size)); +} - return E_SUCCESS; +int +TextComposite::GetFontSize(int textIndex) const +{ + unsigned int value = 0; + + result r = GetValue(textIndex, SET_FONT_SIZE, &value); + SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); + + return (int)value; } -void -TextComposite::GetRange(int& startTextIndex, int& textLength) const +float +TextComposite::GetFontSizeF(int textIndex) const { - startTextIndex = __workStart; - textLength = __workLength; + return _CoordinateSystemUtils::ConvertToInteger(GetFontSize(textIndex)); } result -TextComposite::SetFont(Font* pFont) +TextComposite::SetFontStyle(int style) { - return SetValueToAllTextElements(SET_FONT, (unsigned int)pFont); + return SetValueToAllTextElements(SET_FONT_STYLE, (unsigned int)style); } -Font* -TextComposite::GetFont(int textIndex) const +int +TextComposite::GetFontStyle(int textIndex) const { unsigned int value = 0; - GetValue(textIndex, SET_FONT, &value); - Font* pFont = static_cast < Font* >((void*)value); - - SetLastResult(E_SUCCESS); + result r = GetValue(textIndex, SET_FONT_STYLE, &value); + SysTryReturn(NID_GRP + , r == E_SUCCESS + , -1, r, "[%s] Propagating.", GetErrorMessage(r)); - return pFont; + return (int)value; } result @@ -1767,9 +2219,7 @@ TextComposite::GetForegroundColor(int textIndex) const unsigned int value = 0; r = GetValue(textIndex, SET_FONT_FGCOLOR, &value); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); return Color(value); } @@ -1787,9 +2237,7 @@ TextComposite::GetBackgroundColor(int textIndex) const unsigned int value = 0; r = GetValue(textIndex, SET_FONT_BGCOLOR, &value); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); return Color(value); } @@ -1807,9 +2255,7 @@ TextComposite::GetOutlineColor(int textIndex) const unsigned int value = 0; r = GetValue(textIndex, SET_FONT_OUTLINECOLOR, &value); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); return Color(value); } @@ -1817,17 +2263,14 @@ TextComposite::GetOutlineColor(int textIndex) const Color TextComposite::GetAlternativeForegroundColor(int textIndex) const { - SysTryReturn(NID_GRP - , 0 <= textIndex && textIndex < __length + SysTryReturn(NID_GRP, 0 <= textIndex && textIndex < __length , Color::GetColor(COLOR_ID_BLACK), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; unsigned int value = 0; r = GetValue(textIndex, SET_ALTERNATIVE_FGCOLOR, &value); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, Color::GetColor(COLOR_ID_BLACK), r, "[%s] Propagating.", GetErrorMessage(r)); return Color(value); } @@ -1863,6 +2306,12 @@ TextComposite::GetMaxLineHeight(void) const return maxHeight; } +float +TextComposite::GetMaxLineHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetMaxLineHeight()); +} + TextElement* TextComposite::GetElementAtTextIndex(int textIndex, int& elementTextOffset, int& elementIndex, int& elementTextLength, int& textIndexFromElementOffset) const @@ -1885,14 +2334,11 @@ TextComposite::GetElementAtTextIndex(int textIndex, int& elementTextOffset, int& pEnum = __pTextElementList->GetEnumeratorN(); r = pEnum->MoveNext(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , null, r, "[%s] Fail to move next element. Now Elements count is (%d)", GetErrorMessage(r), __pTextElementList->GetCount()); + SysTryReturn(NID_GRP, r == E_SUCCESS, null, r + , "[%s] Fail to move next element. Now Elements count is (%d)", GetErrorMessage(r), __pTextElementList->GetCount()); pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); - SysTryReturn(NID_GRP - , pTextElement - , null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); while (1) { @@ -1947,21 +2393,18 @@ TextComposite::GetElementAtTextIndex(int textIndex) const int currentElementLength = 0; int elementTextOffset = 0; - if (__pTextElementList->GetCount() == 0) + if (__pTextElementList->GetCount() == 0 || textIndex < 0) { return null; } pEnum = __pTextElementList->GetEnumeratorN(); r = pEnum->MoveNext(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , null, r, "[%s] Fail to move next element. Now Elements count is (%d)", GetErrorMessage(r), __pTextElementList->GetCount()); + SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Fail to move next element. Now Elements count is (%d)" + , GetErrorMessage(r), __pTextElementList->GetCount()); pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); - SysTryReturn(NID_GRP - , pTextElement - , null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, null, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); while (1) { @@ -2037,39 +2480,22 @@ TextComposite::SetWrap(TextObjectWrapType wrap) result TextComposite::Optimize(int startElementIndex, int endElementIndex) { - int elementCount = 0; - int nodeIndex = 0; - TextElement* pStartTextElement = null; TextElement* pEndTextElement = null; TextElement* pCurrentTextElement = null; TextElement* pNextTextElement = null; + int elementIndex = 0; + int elementCount = __pTextElementList->GetCount(); - elementCount = __pTextElementList->GetCount(); if (elementCount == 0) { return E_SUCCESS; } - if (startElementIndex == -1 || startElementIndex < 0) - { - startElementIndex = 0; - } - - if (endElementIndex == -1 || endElementIndex < 0 || endElementIndex > elementCount - 1) - { - endElementIndex = elementCount - 1; - } - - if (0 < startElementIndex) - { - startElementIndex--; - } - - if (endElementIndex < elementCount - 1) - { - endElementIndex++; - } + startElementIndex = (startElementIndex == -1 || startElementIndex < 0) ? 0 : startElementIndex; + endElementIndex = (endElementIndex == -1 || endElementIndex < 0 || endElementIndex > elementCount - 1) ? elementCount - 1 : endElementIndex; + startElementIndex = (0 < startElementIndex) ? startElementIndex - 1 : startElementIndex; + endElementIndex = (endElementIndex < elementCount - 1) ? endElementIndex + 1 : endElementIndex; if (endElementIndex - startElementIndex < 1) { @@ -2077,22 +2503,17 @@ TextComposite::Optimize(int startElementIndex, int endElementIndex) } pStartTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(startElementIndex)); - SysTryReturn(NID_GRP - , pStartTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pStartTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pEndTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(endElementIndex)); - SysTryReturn(NID_GRP - , pEndTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pEndTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); do { pCurrentTextElement = pStartTextElement; - nodeIndex = startElementIndex + 1; - - pNextTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(nodeIndex)); + elementIndex = startElementIndex + 1; + pNextTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(elementIndex)); if (pNextTextElement == null) { break; @@ -2101,15 +2522,19 @@ TextComposite::Optimize(int startElementIndex, int endElementIndex) if (TextUtility::CanMerge(pCurrentTextElement, pNextTextElement)) { pCurrentTextElement->SetTextLength(pCurrentTextElement->GetTextLength() + pNextTextElement->GetTextLength()); - __pTextElementList->Remove(*pNextTextElement, true); + __pTextElementList->RemoveAt(elementIndex, true); } else { pStartTextElement = pNextTextElement; + startElementIndex++; } - startElementIndex++; pStartTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(startElementIndex)); + if (pStartTextElement == null) + { + break; + } } while (startElementIndex != endElementIndex); @@ -2119,13 +2544,8 @@ TextComposite::Optimize(int startElementIndex, int endElementIndex) result TextComposite::ChangeTextOffset(wchar_t* pText, int elementIndex, int gap) { - SysTryReturn(NID_GRP - , 0 <= elementIndex - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , gap != 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= elementIndex, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, gap != 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -2135,9 +2555,7 @@ TextComposite::ChangeTextOffset(wchar_t* pText, int elementIndex, int gap) for (int i = 0; i < elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while (pEnum->MoveNext() == E_SUCCESS) @@ -2186,7 +2604,7 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen int textIndexFromElementOffset = 0; bool isOptimized = false; - SetWorkWidth(pFont, pText, __workStart, textLength); + SetWorkWidth(pFont, pText, __workStart, gap); if (gap > 0) { @@ -2207,11 +2625,8 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen if (pTextElement == null) { TextSimple* pSimpleText = null; - pSimpleText = new (std::nothrow)TextSimple(pText, gap, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont, fgColor, bgColor, - outlineColor); - SysTryReturn(NID_GRP - , pSimpleText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + pSimpleText = new (std::nothrow)TextSimple(pText, gap, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont, fgColor, bgColor, outlineColor); + SysTryReturn(NID_GRP, pSimpleText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); pSimpleText->SetTextOffset(__workStart - startTextIndex); InsertElementAt(*pSimpleText, __workStart); @@ -2229,7 +2644,7 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen pSimpleText = dynamic_cast < TextSimple* >(pTextElement); if (pSimpleText != null) { - if (pSimpleText->IsSame(pText, pFont, fgColor, bgColor, outlineColor)) + if (pSimpleText->IsSame(pText, pFont, fgColor, bgColor, outlineColor, false)) { canMerge = true; } @@ -2259,7 +2674,7 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen pSimpleText = dynamic_cast < TextSimple* >(pNextTextElement); if (pSimpleText != null) { - if (pSimpleText->IsSame(pText, pFont, fgColor, bgColor, outlineColor)) + if (pSimpleText->IsSame(pText, pFont, fgColor, bgColor, outlineColor, false)) { elementIndex++; pTextElement = pNextTextElement; @@ -2287,18 +2702,14 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen TextSimple* pSimpleText = null; pSimpleText = new (std::nothrow)TextSimple(pText, gap, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont, fgColor, bgColor, outlineColor); - SysTryReturn(NID_GRP - , pSimpleText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pSimpleText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); pSimpleText->SetTextOffset(__workStart - startTextIndex); InsertElementAt(*pSimpleText, __workStart); isOptimized = true; r = __pTextElementList->IndexOf(*pSimpleText, elementIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to get element index.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to get element index.", GetErrorMessage(r)); } else { @@ -2316,17 +2727,13 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen int currentelementIndex = 0; textIndex = __workStart + remainingGap; - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength,textIndexFromElementOffset); if (pTextElement == null || elementTextOffset == textIndex) { - pTextElement = GetElementAtTextIndex(textIndex - 1, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); + pTextElement = GetElementAtTextIndex(textIndex - 1, elementTextOffset, elementIndex, currentLength,textIndexFromElementOffset); } - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); currentelementIndex = elementIndex; currentGap = Math::Min(remainingGap, textIndex - elementTextOffset); @@ -2356,9 +2763,7 @@ TextComposite::NotifyTextChanged(wchar_t* pText, int startTextIndex, int textLen while (remainingGap > 0) { pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(--currentelementIndex)); - SysTryReturn(NID_GRP - , pTextElement - , r, r, "[%s] Fail to get element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pTextElement, r, r, "[%s] Fail to get element.", GetErrorMessage(r)); int elementTextLength = pTextElement->GetTextLength(); currentGap = Math::Min(elementTextLength, remainingGap); @@ -2404,21 +2809,17 @@ TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength int remainingWidth = 0; int remainingLength = 0; int ret = TEXT_RETBY_NORMAL; + bool isFirstWord = true; + int index = 0; IEnumerator* pEnum = null; TextElement* pTextElement = null; - bool isFirstWord = true; - int index = 0; - cursorIndex = 0; type = TEXT_ELEMENT_TYPE_MAX; - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); remainingWidth = maxWidth; remainingLength = textLength; @@ -2427,9 +2828,7 @@ TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } currentLength = Math::Min(remainingLength, currentLength); @@ -2443,9 +2842,7 @@ TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength { Dimension tempTextSize; r = pTextElement->GetRegion(textIndexFromElementOffset, textCount + 1, tempTextSize.width, tempTextSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if ((remainingWidth - textSize.width) > (tempTextSize.width - remainingWidth)) { @@ -2455,10 +2852,7 @@ TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength } remainingWidth -= textSize.width; - if (remainingWidth < 0) - { - remainingWidth = 0; - } + remainingWidth = (remainingWidth < 0) ? 0 : remainingWidth; remainingLength -= textCount; currentLength -= textCount ; @@ -2536,6 +2930,15 @@ CATCH: return -1; } +int +TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, float maxWidth, + int& cursorIndex, TextElementType& type) +{ + int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + + return ForwardAnalyzeWithFocusedObjectType(textIndex, textLength, newMaxWidth, cursorIndex, type); +} + void TextComposite::HideFrontSpace(TextObjectSpaceHideType mode) { @@ -2563,19 +2966,15 @@ TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength int remainingWidth = 0; int remainingLength = 0; int ret = TEXT_RETBY_NORMAL; - - IEnumerator* pEnum = null; - TextElement* pTextElement = null; - bool isFirstWord = true; int index = 0; textIndex = 0; - pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + IEnumerator* pEnum = null; + TextElement* pTextElement = null; + + pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); textCount = 0; remainingWidth = maxWidth; @@ -2585,9 +2984,7 @@ TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } currentLength = Math::Min(remainingLength, currentLength); @@ -2603,19 +3000,14 @@ TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength { Dimension tempTextSize; r = pTextElement->GetRegion(textIndexFromElementOffset, textCount + 1, tempTextSize.width, tempTextSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); textSize.width = tempTextSize.width; textCount++; } remainingWidth -= textSize.width; - if (remainingWidth < 0) - { - remainingWidth = 0; - } + remainingWidth = (remainingWidth < 0) ? 0 : remainingWidth; remainingLength -= textCount; currentLength -= textCount; @@ -2694,6 +3086,14 @@ CATCH: } int +TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, float maxWidth, int& textIndex) +{ + int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + + return ForwardAnalyzeInNoneCursorMode(startTextIndex, textLength, newMaxWidth, textIndex); +} + +int TextComposite::GetCutLinkElementCount(void) const { return __pCutLinkListInfo->GetCutLinkElementCount(); @@ -2726,13 +3126,17 @@ TextComposite::ChangeCutLinkState(int linkIndex, bool select) result TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsigned int value) { + if (__workLength == 0) + { + return E_SUCCESS; + } + result r = E_SUCCESS; IEnumerator* pEnum = null; TextElement* pTextElement = null; TextElement* pNewTextElement = null; - - int startelementIndex = -1; - int endelementIndex = -1; + int startElementIndex = -1; + int endElementIndex = -1; int textIndex = 0; int textLength = 0; int elementTextOffset = 0; @@ -2744,44 +3148,34 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign textIndex = __workStart; textLength = __workLength; - if (textLength == 0) - { - return E_SUCCESS; - } - - while (0 < textLength) + while (textLength > 0) { - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); - - SysTryReturn(NID_GRP - , 0 < currentLength - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element node."); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element. textIndex(%d)", textIndex); + SysTryReturn(NID_GRP, 0 < currentLength, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] _Text::TextElement is invalid."); TextElementType objectType = pTextElement->GetType(); + unsigned int elementValue = pTextElement->GetValue(type); TextElementType objectTypeFromValueType = TextUtility::GetObjectTypeFromValueType(type); - unsigned int objectValue = pTextElement->GetValue(type); - if ((objectType == objectTypeFromValueType) && (value != objectValue)) + if (objectType == objectTypeFromValueType && value != elementValue) { found = true; - startelementIndex = elementIndex; + startElementIndex = elementIndex; break; } - else if ((COMMONOBJECT_VALUE_START <= type && type < MAX_COMMONOBJECT_VALUE) && (value != objectValue)) + else if ((COMMONOBJECT_VALUE_START <= type && type < MAX_COMMONOBJECT_VALUE) && (value != elementValue)) { found = true; - startelementIndex = elementIndex; + startElementIndex = elementIndex; break; } + textIndex += currentLength; textLength -= currentLength; } - if (found == false) + if (!found) { return E_SUCCESS; } @@ -2791,37 +3185,29 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign pTextElement->SetValue(type, value); goto TRUE_CATCH; } - else if ((elementTextOffset < textIndex) && (textLength < currentLength)) + else if (elementTextOffset < textIndex && textLength < currentLength) { pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); pNewTextElement = pTextElement->CloneN(type, value); - SysTryReturn(NID_GRP - , pNewTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); pNewTextElement->SetTextLength(textLength); pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset); r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); - SysTryReturn(NID_GRP - , pNewTextElement - , r, r, "[E_SYSTEM] Fail to clone text element."); + SysTryReturn(NID_GRP, pNewTextElement, r, r, "[E_SYSTEM] Fail to clone text element."); pNewTextElement->SetTextLength(currentLength - textLength); pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + textLength); r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); - endelementIndex = elementIndex; + endElementIndex = elementIndex; goto TRUE_CATCH; } else if (elementTextOffset < textIndex) @@ -2829,24 +3215,20 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign pTextElement->SetTextLength(pTextElement->GetTextLength() - currentLength); pNewTextElement = pTextElement->CloneN(type, value); - SysTryReturn(NID_GRP - , pNewTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset); pNewTextElement->SetTextLength(currentLength); r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); textIndex += currentLength; textLength -= currentLength; + if (textLength > 0) { - pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, - textIndexFromElementOffset); + pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); if (pTextElement == null) { goto TRUE_CATCH; @@ -2854,7 +3236,7 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign } else { - endelementIndex = elementIndex; + endElementIndex = elementIndex; goto TRUE_CATCH; } } @@ -2863,47 +3245,39 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign for (int i = 0; i <= elementIndex; i++) { r = pEnum->MoveNext(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to move next element.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r)); } while (textLength > 0) { TextElementType objectType = pTextElement->GetType(); TextElementType objectTypeFromValueType = TextUtility::GetObjectTypeFromValueType(type); + unsigned int elementValue = pTextElement->GetValue(type); - if (objectType == objectTypeFromValueType) + if (objectType == objectTypeFromValueType && value != elementValue) { - if (value != objectTypeFromValueType) + if (textLength < currentLength) { - if (textLength < currentLength) - { - pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); - SysTryReturn(NID_GRP - , pNewTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); - - pNewTextElement->SetTextLength(currentLength - textLength); - pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + textLength); + pNewTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE, 0); + SysTryReturn(NID_GRP, pNewTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to clone text element."); - pTextElement->SetValue(type, value); - pTextElement->SetTextLength(textLength); + pNewTextElement->SetTextLength(currentLength - textLength); + pNewTextElement->SetValue(SET_TEXT_OFFSET, textIndexFromElementOffset + textLength); - r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + pTextElement->SetValue(type, value); + pTextElement->SetTextLength(textLength); - break; - } - else - { - pTextElement->SetValue(type, value); - } + r = __pTextElementList->InsertAt(*pNewTextElement, ++elementIndex); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); - endelementIndex = elementIndex; + break; + } + else + { + pTextElement->SetValue(type, value); } + + endElementIndex = elementIndex; } elementTextOffset += currentLength; @@ -2926,17 +3300,12 @@ TextComposite::SetValueToAllTextElements(TextComponentInfoValueType type, unsign } TRUE_CATCH: - Optimize(startelementIndex, endelementIndex); + Optimize(startElementIndex, endElementIndex); Release(pEnum); return E_SUCCESS; CATCH: - if (pNewTextElement != null) - { - delete pNewTextElement; - pNewTextElement = null; - } - + Release(pNewTextElement); Release(pEnum); return r; } @@ -2944,9 +3313,7 @@ CATCH: bool TextComposite::SetAbbrevObjectFontInfo(TextSimple* pSimpleText) { - SysTryReturn(NID_GRP - , __pAbbrevTextElement - , false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pAbbrevTextElement, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); __pAbbrevTextElement->SetFont(pSimpleText->GetFont()); __pAbbrevTextElement->SetForegroundColor(pSimpleText->GetForegroundColor()); @@ -2961,9 +3328,7 @@ TextComposite::SetAbbrevObjectFontInfo(TextSimple* pSimpleText) int TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo) { - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); TextLine* pTextLine = null; Rectangle lineBounds; @@ -2972,31 +3337,17 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap int lineLength = 0; int endType = TEXT_RETBY_NORMAL; bool isChanged = false; - bool forwardSearch = true; - int textIndex = __workStart; int baseline = 0; + int textIndex = 0; - if (textIndex < 0) - { - textIndex = 0; - } - - if (textIndex > __length) - { - textIndex = __length; - } - - if (textIndex == __length) - { - forwardSearch = false; - } + textIndex = (__workStart < 0) ? 0 : __workStart; + textIndex = (textIndex > __length) ? __length : textIndex; + bool forwardSearch = (textIndex == __length) ? false : true; if (__pCurrentTextColumn->GetTotalLineCount() > 0) { pTextLine = __pCurrentTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); endType = pTextLine->GetEndType(); @@ -3017,9 +3368,7 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap else { pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); if (forwardSearch) { @@ -3056,8 +3405,6 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap if (forwardSearch) { -// endType = ForwardAnalyze(lineOffset, __length - lineOffset, lineBounds.width, __wrap, -// lineLength, textSize.width, textSize.height); endType = ForwardAnalyzeWithBaseline(lineOffset, __length - lineOffset, lineBounds.width, __wrap, lineLength, textSize.width, textSize.height, baseline); @@ -3068,6 +3415,7 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap pTextLine->SetRegion(textSize.width, textSize.height); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } else { @@ -3078,14 +3426,7 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap lineBounds.height = textSize.height; lineOffset -= (textCount - 1); lineLength = textCount; - if (lineOffset == 0) - { - endType = TEXT_RETBY_NORMAL; - } - else - { - endType = TEXT_RETBY_LIMITWIDTH; - } + endType = (lineOffset == 0) ? TEXT_RETBY_NORMAL : TEXT_RETBY_LIMITWIDTH; pTextLine->SetBounds(lineBounds); pTextLine->SetTextOffset(lineOffset); @@ -3093,6 +3434,7 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap pTextLine->SetRegion(textSize.width, textSize.height); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } } @@ -3115,8 +3457,7 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap else if (forwardSearch && textIndex >= lineOffset + lineLength) { Dimension needDim; - GetRegion(lineOffset + lineLength, textIndex - (lineOffset + lineLength) + 1, - needDim.width, needDim.height); + GetRegion(lineOffset + lineLength, textIndex - (lineOffset + lineLength) + 1, needDim.width, needDim.height); int index = 0; int remainingWidth = needDim.width - (lineBounds.width - textSize.width); @@ -3133,65 +3474,182 @@ TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrap remainingWidth -= charDim.width; textSize.width -= charDim.width; - if (remainingWidth <= 0) - { - break; + if (remainingWidth <= 0) + { + break; + } + } + + lineLength -= index; + } + else if (endType != TEXT_RETBY_LIMITWIDTH && lineLength != __length) + { + if (lineOffset > 0) + { + Dimension lineTextSize; + int textCount = 0; + int remainingWidth = 0; + + pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); + remainingWidth = lineBounds.width - lineTextSize.width; + BackwardAnalyze(lineOffset - 1, remainingWidth, &textCount, &textSize.width, &textSize.height); + + if (textSize.width > 0) + { + lineOffset -= textCount; + lineLength += textCount; + textSize.width += lineTextSize.width; + lineBounds.height = textSize.height; + endType = TEXT_RETBY_LIMITLENGTH; + } + else + { + return 1; + } + } + else + { + return 1; + } + } + else + { + return 1; + } + + pTextLine->SetBounds(lineBounds); + pTextLine->SetRegion(textSize.width, textSize.height); + pTextLine->SetTextLength(lineLength); + pTextLine->SetTextOffset(lineOffset); + pTextLine->SetEndType(endType); + pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); + + return 1; +} + +int +TextComposite::ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInNoneWrap(newRect, pNoneWrapComposeInfo); +} + +result +TextComposite::GetTextExtentList(TextLine* pTextLine) const +{ + result r = E_SUCCESS; + int lineOffset = pTextLine->GetTextOffset(); + int lineLength = pTextLine->GetTextLength(); + int elementTextOffset = 0; + int elementIndex = 0; + int currentLength = 0; + int textIndexFromElementOffset = 0; + int remainingLength = 0; + int right = 0; + int maxWidth = 0; + + TextElement* pTextElement = GetElementAtTextIndex(lineOffset, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + + remainingLength = lineLength; + currentLength = Math::Min(remainingLength, currentLength); + + LinkedListT <_Util::Pair* >* pGapList = new (std::nothrow) LinkedListT <_Util::Pair* >; + _Util::Pair* pGap = null; + + IEnumerator* pEnum = __pTextElementList->GetEnumeratorN(); + for (int i = 0; i <= elementIndex; i++) + { + r = pEnum->MoveNext(); + } + + while (remainingLength != 0) + { + TextElementType objectType = pTextElement->GetType(); + if (objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pTextElement); + if (pSimpleText != null) + { + const Bitmap* pBitmap = pSimpleText->GetBitmap(); + if (pBitmap) + { + pGap = new (std::nothrow) _Util::Pair; + pGap->first = maxWidth; + pGap->second = pGap->first + pBitmap->GetWidth() ; + + pGapList->Add(pGap); + right = (right < pGap->second) ? pGap->second : right; + } + else + { + _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont()))); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + + _Util::AccumList<_Util::Pair > elemenGaptList; + const wchar_t* pText = pSimpleText->GetTextSource(); + pFont->GetTextExtentList(_Util::String(pText, wcslen(pText), textIndexFromElementOffset, currentLength), elemenGaptList); + + for (_Util::AccumList<_Util::Pair >::Iterator iterator = elemenGaptList.Begin(); iterator != elemenGaptList.End(); iterator++) + { + pGap = new (std::nothrow) _Util::Pair; + pGap->first = maxWidth + iterator->first; + pGap->second = maxWidth + iterator->second; + + pGapList->Add(pGap); + right = (right < pGap->second) ? pGap->second : right; + } + } } } - - lineLength -= index; - } - else if (endType != TEXT_RETBY_LIMITWIDTH && lineLength != __length) - { - if (lineOffset > 0) + else if (objectType == TEXT_ELEMENT_TYPE_IMAGE) { - Dimension lineTextSize; - int textCount = 0; - int remainingWidth = 0; + TextImage* pImageText = dynamic_cast < TextImage* >(pTextElement); + if (pImageText != null) + { + Rectangle rect = pImageText->GetBounds(); - pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); - remainingWidth = lineBounds.width - lineTextSize.width; - BackwardAnalyze(lineOffset - 1, remainingWidth, &textCount, &textSize.width, &textSize.height); + pGap = new (std::nothrow) _Util::Pair; + pGap->first = maxWidth; + pGap->second = pGap->first + rect.width; - if (textSize.width > 0) - { - lineOffset -= textCount; - lineLength += textCount; - textSize.width += lineTextSize.width; - lineBounds.height = textSize.height; - endType = TEXT_RETBY_LIMITLENGTH; - } - else - { - return 1; + pGapList->Add(pGap); + right = (right < pGap->second) ? pGap->second : right; } } - else + + remainingLength -= currentLength; + + if (pEnum->MoveNext() != E_SUCCESS) { - return 1; + break; } - } - else - { - return 1; + + pTextElement = static_cast < TextElement* >(pEnum->GetCurrent()); + if (pTextElement == null) + { + break; + } + + textIndexFromElementOffset = pTextElement->GetValue(SET_TEXT_OFFSET); + currentLength = Math::Min(pTextElement->GetTextLength(), remainingLength); + maxWidth = right; + right = 0; } - pTextLine->SetBounds(lineBounds); - pTextLine->SetRegion(textSize.width, textSize.height); - pTextLine->SetTextLength(lineLength); - pTextLine->SetTextOffset(lineOffset); - pTextLine->SetEndType(endType); - pTextLine->SetBaseline(baseline); + pTextLine->SetTextExtentList(pGapList); - return 1; + Release(pEnum); + + return E_SUCCESS; } int TextComposite::ComposeInWrap(Rectangle& rect) { - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); int textCount = 0; int lineCount = 0; @@ -3249,9 +3707,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.y = nextY; @@ -3261,6 +3717,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3287,9 +3744,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) if (!hasPrevLine) { pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.width = rect.width; @@ -3307,6 +3762,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_NORMAL); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3329,8 +3785,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) if (ret == -1) { - delete pTextLine; - pTextLine = null; + Release(pTextLine); break; } @@ -3354,6 +3809,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextOffset(lineOffset); pTextLine->SetEndType(ret); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); lineCount++; @@ -3383,6 +3839,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextLength(lineLength); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } else { @@ -3403,6 +3860,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextLength(lineLength); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } if (textCount > 0) @@ -3428,9 +3886,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) int nextY = lineBounds.y + lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.y = nextY; @@ -3447,9 +3903,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.y = nextY; @@ -3462,6 +3916,7 @@ TextComposite::ComposeInWrap(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); lineCount++; @@ -3498,6 +3953,14 @@ TextComposite::ComposeInWrap(Rectangle& rect) } int +TextComposite::ComposeInWrap(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInWrap(newRect); +} + +int TextComposite::ComposeInPartialMode(Rectangle& rect) { SysTryReturn(NID_GRP @@ -3522,7 +3985,6 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) int displayHeight = 0; int baseline = 0; int lineBaseline = 0; - TextLine* pTextLine = null; int endType = TEXT_RETBY_NORMAL; @@ -3566,9 +4028,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.y = nextY; @@ -3578,6 +4038,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3604,9 +4065,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) if (!hasPrevLine) { pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.width = rect.width; @@ -3624,6 +4083,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_NORMAL); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3650,13 +4110,11 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) while (remainingLength != 0) { - //ret = ForwardAnalyze(textIndex, remainingLength, remainingWidth, __wrap, textCount, textSize.width, textSize.height); ret = ForwardAnalyzeWithBaseline(textIndex, remainingLength, remainingWidth, __wrap, textCount, textSize.width, textSize.height, baseline); if (ret == -1) { - delete pTextLine; - pTextLine = null; + Release(pTextLine); break; } @@ -3680,6 +4138,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextOffset(lineOffset); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3712,6 +4171,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextLength(lineLength); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } else { @@ -3732,6 +4192,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextLength(lineLength); pTextLine->SetEndType(endType); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); } if (textCount > 0) @@ -3761,9 +4222,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) int nextY = lineBounds.y + lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.y = nextY; @@ -3780,9 +4239,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.y = nextY; @@ -3795,6 +4252,7 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); pTextLine->SetBaseline(0); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3838,12 +4296,28 @@ TextComposite::ComposeInPartialMode(Rectangle& rect) } int +TextComposite::ComposeInPartialMode(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInPartialMode(newRect); +} + +int TextComposite::ComposeInNormalWrap(Rectangle& rect) { return ComposeInWrap(rect); } int +TextComposite::ComposeInNormalWrap(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInNormalWrap(newRect); +} + +int TextComposite::ComposeInWordWrap(Rectangle& rect) { if (IsWidthManagerEnabled()) @@ -3857,6 +4331,14 @@ TextComposite::ComposeInWordWrap(Rectangle& rect) } int +TextComposite::ComposeInWordWrap(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInWordWrap(newRect); +} + +int TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect) { int endType = TEXT_RETBY_NORMAL; @@ -3885,14 +4367,10 @@ TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect) TextSimple* pSimpleText = null; pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(0)); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); TextElementType objectType = pTextElement->GetType(); - SysTryReturn(NID_GRP - , objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pSimpleText = dynamic_cast < TextSimple* >(pTextElement); if (pSimpleText != null) @@ -3911,17 +4389,12 @@ TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect) ForwardAnalyze(__middleEllipsisTextLengthInHead, __length - __middleEllipsisTextLengthInHead, lineBounds.width - __middleEllipsisWidth - __middleEllipsisHeadWidth, __wrap, length, textSize.width, textSize.height); - __middleEllipsisTextLengthInTail = length; - if (maxHeight < textSize.height) - { - maxHeight = textSize.height; - } + __middleEllipsisTextLengthInTail = length; + maxHeight = (maxHeight < textSize.height) ? textSize.height : maxHeight; TextLine* pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); pTextLine->SetBounds(lineBounds); pTextLine->SetRegion(lineBounds.width, maxHeight); @@ -3929,6 +4402,7 @@ TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect) pTextLine->SetTextOffset(0); pTextLine->SetEndType(TEXT_RETBY_NORMAL); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -3938,11 +4412,17 @@ TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect) } int +TextComposite::ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInNoneWrapMiddleEllipsis(newRect); +} + +int TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect) { - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); int endType = TEXT_RETBY_NORMAL; Rectangle lineBounds; @@ -3969,13 +4449,10 @@ TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect) TextSimple* pSimpleText = null; pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(0)); - SysTryReturn(NID_GRP - , pTextElement - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); TextElementType objectType = pTextElement->GetType(); - SysTryReturn(NID_GRP - , objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT + SysTryReturn(NID_GRP, objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pSimpleText = dynamic_cast < TextSimple* >(pTextElement); @@ -3991,9 +4468,7 @@ TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect) maxHeight = textSize.height; TextLine* pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); pTextLine->SetBounds(lineBounds); pTextLine->SetRegion(lineBounds.width, maxHeight); @@ -4001,6 +4476,7 @@ TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect) pTextLine->SetTextOffset(0); pTextLine->SetEndType(TEXT_RETBY_NORMAL); pTextLine->SetBaseline(baseline); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -4009,6 +4485,14 @@ TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect) return 1; } +int +TextComposite::ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInNoneWrapHeadEllipsis(newRect); +} + result TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment align) { @@ -4025,6 +4509,14 @@ TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const Rectangle& displayRect, } result +TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment align) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawAbbrev(canvasImpl, newDisplayRect, align); +} + +result TextComposite::GetValue(int textIndex, TextComponentInfoValueType type, unsigned int* value) const { IEnumerator* pEnum = null; @@ -4097,12 +4589,20 @@ TextComposite::BackwardAnalyze(int startTextIndex, int maxWidth, int* actualLeng return true; } +bool +TextComposite::BackwardAnalyze(int startTextIndex, float maxWidth, int* actualLength, float* width, float* height) +{ + int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int newWidth = _CoordinateSystemUtils::ConvertToInteger(*width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(*height); + + return BackwardAnalyze(startTextIndex, newMaxWidth, actualLength, &newWidth, &newHeight); +} + int TextComposite::GetFirstTextIndexAt(int elementIndex) const { - SysTryReturn(NID_GRP - , elementIndex >= 0 && elementIndex < __pTextElementList->GetCount() - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, elementIndex >= 0 && elementIndex < __pTextElementList->GetCount(), -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); IEnumerator* pEnum = null; TextElement* pTextElement = null; @@ -4149,9 +4649,7 @@ result TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment) { TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); Dimension textSize; Rectangle adjustedRect; @@ -4162,12 +4660,6 @@ TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectang switch (alignment & TEXT_ALIGNMASK_VERT) { - case TEXT_OBJECT_ALIGNMENT_TOP: - // fall through - default: - adjustedRect.y = displayRect.y; - break; - case TEXT_OBJECT_ALIGNMENT_MIDDLE: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height) / 2; break; @@ -4175,6 +4667,12 @@ TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectang case TEXT_OBJECT_ALIGNMENT_BOTTOM: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height); break; + + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + adjustedRect.y = displayRect.y; + break; } adjustedRect.height = displayRect.height - (displayRect.y - adjustedRect.y); @@ -4182,13 +4680,10 @@ TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectang TextSimple* pSimpleText = null; pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(0)); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); TextElementType objectType = pTextElement->GetType(); - SysTryReturn(NID_GRP - , objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT + SysTryReturn(NID_GRP, objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to draw to symbol object."); pSimpleText = dynamic_cast < TextSimple* >(pTextElement); @@ -4209,12 +4704,18 @@ TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectang } result +TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawAbbrevInMiddleEllipsis(canvasImpl, newDisplayRect, alignment); +} + +result TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment) { TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); result r = E_SUCCESS; Dimension textSize; @@ -4226,12 +4727,6 @@ TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle switch (alignment & TEXT_ALIGNMASK_VERT) { - case TEXT_OBJECT_ALIGNMENT_TOP: - // fall through - default: - adjustedRect.y = displayRect.y; - break; - case TEXT_OBJECT_ALIGNMENT_MIDDLE: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height) / 2; break; @@ -4239,6 +4734,12 @@ TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle case TEXT_OBJECT_ALIGNMENT_BOTTOM: adjustedRect.y = displayRect.y + (displayRect.height - textSize.height); break; + + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + adjustedRect.y = displayRect.y; + break; } adjustedRect.height = displayRect.height - (displayRect.y - adjustedRect.y); @@ -4247,13 +4748,10 @@ TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(0)); r = GetLastResult(); - SysTryReturn(NID_GRP - , pTextElement - , r, r, "[%s] Fail to get element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pTextElement, r, r, "[%s] Fail to get element.", GetErrorMessage(r)); TextElementType objectType = pTextElement->GetType(); - SysTryReturn(NID_GRP - , objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT + SysTryReturn(NID_GRP, objectType == TEXT_ELEMENT_TYPE_CUTLINK || objectType == TEXT_ELEMENT_TYPE_TEXT , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to draw to symbol object."); pSimpleText = dynamic_cast < TextSimple* >(pTextElement); @@ -4271,15 +4769,18 @@ TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle } result -TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength) +TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment) { - SysTryReturn(NID_GRP - , 0 <= startTextIndex && startTextIndex < __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); - SysTryReturn(NID_GRP - , textLength <= __length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + return DrawAbbrevInHeadEllipsis(canvasImpl, newDisplayRect, alignment); +} + +result +TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength) +{ + SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textLength <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; IEnumerator* pEnum = null; @@ -4297,15 +4798,11 @@ TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int int textIndex = startTextIndex; _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); - SysTryReturn(NID_GRP - , pCanvas - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, nodeIndex, currentLength, textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); currentLength = Math::Min(textLength, currentLength); @@ -4319,12 +4816,10 @@ TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int if (pTextElement->IsBackGroundDrawingModeEnable()) { r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, textSize.width, displayRect.height)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - isAlternateLookEnabled = pTextElement->GetValue(SET_ALTERNATE_LOOK); + isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false; if ((__displayBlock) && (isAlternateLookEnabled == false)) { Dimension tempTextSize; @@ -4383,6 +4878,14 @@ TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int return E_SUCCESS; } +result +TextComposite::DrawPartial(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return DrawPartial(canvasImpl, newDisplayRect, startTextIndex, textLength); +} + void TextComposite::SetPartialComposingModeEnabled(bool enable) { @@ -4402,9 +4905,7 @@ TextComposite::InitPartialComposeMode(void) __totalComposedHeight = 0; __composePartialLimitHeight = 0; - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); __pCurrentTextColumn->SetFirstDisplayLineIndex(0); __pCurrentTextColumn->SetFirstDisplayPositionY(0); @@ -4416,9 +4917,7 @@ TextComposite::InitPartialComposeMode(void) bool TextComposite::IsComposeDone() const { - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); return __pCurrentTextColumn->IsComposeDone(); } @@ -4426,9 +4925,7 @@ TextComposite::IsComposeDone() const int TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) { - SysTryReturn(NID_GRP - , __pCurrentTextColumn - , false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + SysTryReturn(NID_GRP, __pCurrentTextColumn, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); Rectangle lineBounds; int lineCount = 0; @@ -4478,15 +4975,14 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); pTextLine->SetBounds(lineBounds); pTextLine->SetRegion(0, lineTextSize.height); pTextLine->SetTextLength(0); pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); @@ -4536,9 +5032,7 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) } pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.height = composeInfo.height; @@ -4547,6 +5041,7 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) pTextLine->SetRegion(composeInfo.width, composeInfo.height); pTextLine->SetTextLength(composeInfo.length); pTextLine->SetEndType(composeInfo.endType); + GetTextExtentList(pTextLine); __pCurrentTextColumn->AddLineDuringCompose(pTextLine); lineCount++; @@ -4579,9 +5074,7 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) lineTextSize.height = lineBounds.height; pTextLine = new (std::nothrow)TextLine(this); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); lineBounds.x = rect.x; lineBounds.y = nextY; @@ -4593,6 +5086,8 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) pTextLine->SetTextLength(0); pTextLine->SetTextOffset(textIndex); pTextLine->SetEndType(TEXT_RETBY_LINEFEED); + GetTextExtentList(pTextLine); + __pCurrentTextColumn->AddLineDuringCompose(pTextLine); lineCount++; @@ -4616,6 +5111,14 @@ TextComposite::ComposeInWrapByTextWidth(Rectangle& rect) return lineCount; } +int +TextComposite::ComposeInWrapByTextWidth(FloatRectangle& rect) +{ + Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect); + + return ComposeInWrapByTextWidth(newRect); +} + result TextComposite::GetCutLinkObjectInfo(int cutLinkIndex, int& textStartIndex, int& textLength) const { @@ -4628,6 +5131,12 @@ TextComposite::GetTotalComposedHeight(void) const return __totalComposedHeight; } +float +TextComposite::GetTotalComposedHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__totalComposedHeight); +} + int TextComposite::GetAnalysedTotalHeight(void) const { @@ -4651,12 +5160,24 @@ TextComposite::GetAnalysedTotalHeight(void) const return (int)(GetTotalComposedHeight() * __length / composedLength); } +float +TextComposite::GetAnalysedTotalHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetAnalysedTotalHeight()); +} + void TextComposite::SetComposePartialLimitHeight(int limitHeight) { __composePartialLimitHeight = limitHeight; } +void +TextComposite::SetComposePartialLimitHeight(float limitHeight) +{ + __composePartialLimitHeight = _CoordinateSystemUtils::ConvertToInteger(limitHeight); +} + int TextComposite::GetComposePartialLimitHeight(void) const { @@ -4664,6 +5185,12 @@ TextComposite::GetComposePartialLimitHeight(void) const } +float +TextComposite::GetComposePartialLimitHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__composePartialLimitHeight); +} + TextElementType TextComposite::GetObjectType(int textIndex) const { @@ -4694,9 +5221,7 @@ TextComposite::GetElementIndexOf(TextElement& textElement) const result r = E_SUCCESS; r = __pTextElementList->IndexOf(textElement, index); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , false, r, "[%s] Fail to add element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, false, r, "[%s] Fail to add element.", GetErrorMessage(r)); return index; } @@ -4708,9 +5233,7 @@ TextComposite::GetElementAtElementIndex(int nodeIndex) const TextElement* pTextElement = null; pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(nodeIndex)); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , null, r, "[%s] Fail to add element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Fail to add element.", GetErrorMessage(r)); return pTextElement; } @@ -4751,12 +5274,24 @@ TextComposite::SetLineSpace(int gap) __lineSpacing = gap; } +void +TextComposite::SetLineSpace(float gap) +{ + SetLineSpace(_CoordinateSystemUtils::ConvertToInteger(gap)); +} + int TextComposite::GetLineSpace(void) const { return __lineSpacing; } +float +TextComposite::GetLineSpaceF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(__lineSpacing); +} + void TextComposite::SetElementVerticalAlignment(TextObjectAlignment alignment) { @@ -4835,9 +5370,7 @@ TextComposite::GetImageAlign(int textIndex) const unsigned int value = 0; r = GetValue(textIndex, SET_IMAGE_ALIGN, &value); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , TEXT_OBJECT_ALIGNMENT_INVALID, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, TEXT_OBJECT_ALIGNMENT_INVALID, r, "[%s] Propagating.", GetErrorMessage(r)); return (TextObjectAlignment)value; } @@ -4860,6 +5393,102 @@ TextComposite::GetBlockColor(void) const return __defaultBlockColor; } +Tizen::Base::String +TextComposite::GetDisplayableText(Rectangle displayRect, TextObjectActionType action) +{ + int firstDisplayLineIndex = __pCurrentTextColumn->GetFirstDisplayLineIndex(); + TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(firstDisplayLineIndex); + int firstDisplayTextIndex = pTextLine->GetTextOffset(); + int displayableTextLength = 0; + int displayableLineCount = __pCurrentTextColumn->CalculateDisplayableLineCount(displayRect, action); + int lastDisplayLineIndex = firstDisplayLineIndex + displayableLineCount - 1; + + for (int i = firstDisplayLineIndex; i < lastDisplayLineIndex; i++) + { + pTextLine = __pCurrentTextColumn->GetTextLine(i); + displayableTextLength += pTextLine->GetTextLength(); + } + + pTextLine = __pCurrentTextColumn->GetTextLine(lastDisplayLineIndex); + + int lineOffset = pTextLine->GetTextOffset(); + int lineLength = pTextLine->GetTextLength(); + int elementTextOffset = 0; + int elementIndex = 0; + int currentLength = 0; + int textIndexFromElementOffset = 0; + int remainingLength = lineLength; + + if (lineOffset + remainingLength < __length) // abbreviation mode + { + TextElement* pTextElement = GetElementAtTextIndex(lineOffset, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset); + SysTryReturn(NID_GRP, pTextElement, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to get element."); + + if (__ignoreFrontBlank && __frontSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE) + { + const TextSimple* pSimpleText = dynamic_cast (pTextElement); + if (pSimpleText != null) + { + int index = lineOffset - elementTextOffset; + const wchar_t* pText = pSimpleText->GetText(); + SysTryReturn(NID_GRP, pText, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to get text."); + + SysTryReturn(NID_GRP, index >= 0 && index < pSimpleText->GetTextLength() + , String(L""), E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)" + ,index, pSimpleText->GetTextLength()); + + if (pText[index] == (wchar_t)L' ') + { + remainingLength--; + lineOffset++; + } + } + } + + if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV) + { + Dimension textSize; + Dimension abbrevTextSize; + Rectangle lineBounds = pTextLine->GetBounds(); + + GetRegion(lineOffset, remainingLength, textSize.width, textSize.height); + + TextElement* pLastTextElement = GetElementAtTextIndex(lineOffset + lineLength - 1); + SysTryReturn(NID_GRP, pLastTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get element."); + + if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT) + { + TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement); + SysTryReturn(NID_GRP, pSimpleText, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to cast text element."); + + SetAbbrevObjectFontInfo(pSimpleText); + __pAbbrevTextElement->GetRegion(0, 1, abbrevTextSize.width, abbrevTextSize.height); + } + + ForwardAnalyze(lineOffset, __length - lineOffset, lineBounds.width - abbrevTextSize.width + , TEXT_OBJECT_WRAP_TYPE_CHARACTER, lineLength, textSize.width, textSize.height); + } + } + + displayableTextLength += lineLength; + + wchar_t* pText = GetTextN(firstDisplayTextIndex, displayableTextLength); + SysTryReturn(NID_GRP, pText, String(L""), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + String text(pText); + delete[] pText; + + return text; +} + +Tizen::Base::String +TextComposite::GetDisplayableText(FloatRectangle displayRect, TextObjectActionType action) +{ + Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return GetDisplayableText(newDisplayRect, action); +} + void TextComposite::SetTextWidthManager(TextWidthManager* pTextWidthManager) { @@ -4890,9 +5519,7 @@ TextComposite::SetWorkWidth(Font* pFont, wchar_t* pText, int workStart, int text workLength = Math::Abs(textLength); r = TextUtility::GetTextExtent(pFont, pSrc, workLength, false, width, height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if (textLength < 0) { @@ -4949,3 +5576,4 @@ TextComposite::UpdateTextSweepInfo(TextObjectSweepInfo* pTextSweepInfo) } }}} // Tizen::Graphics::_Text + diff --git a/src/graphics/text/FGrp_TextTextComposite.h b/src/graphics/text/FGrp_TextTextComposite.h index b4f5121..5513707 100644 --- a/src/graphics/text/FGrp_TextTextComposite.h +++ b/src/graphics/text/FGrp_TextTextComposite.h @@ -53,42 +53,75 @@ public: virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + virtual int ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height, int& baseline); + virtual int ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height, int& baseline); + virtual int ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, int maxWidth, int& cursorIndex, TextElementType& type); + virtual int ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, float maxWidth, + int& cursorIndex, TextElementType& type); + virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, + const TextObjectActionType action); + virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(int textIndex) const; + virtual float GetHeightF(int textIndex) const; + virtual int GetTextLength(void) const; virtual int Compose(Rectangle& rect, TextColumn* pTextColumn); + virtual int Compose(FloatRectangle& rect, TextColumn* pTextColumn); + result DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action, int baseline); + result DrawWithBaseline(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, + const TextObjectActionType action, int baseline); + result InsertElementAt(TextElement& textElement, int textIndex); result AppendElement(TextElement& textElement); + result Remove(int startTextIndex, int textLength); + result RemoveElementAt(int elementIndex, bool deallocate = true); result RemoveAllElements(bool deallocate = true); result DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rectangle& displayRect, const TextObjectAlignment align, const TextObjectActionType action); + result DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const FloatRectangle& displayRect, const TextObjectAlignment align, const TextObjectActionType action); + result DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength); + result DrawPartial(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength); + result DrawAbbrev(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment align); + result DrawAbbrev(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment align); + result GetText(TextComposite* pTargetCompsiteText, int textIndex, int textLength); + wchar_t GetCharacter(int textIndex) const; + + wchar_t* GetTextN(int startTextIndex, int textLength) const; + result Optimize(int startElementIndex, int endElementIndex); bool IsComposeDone(void) const; @@ -115,10 +148,26 @@ public: TextElement* GetElementAtTextIndex(int textIndex) const; + result SetDisplayBitmap(const Bitmap* pBitmap); + + const Bitmap* GetDisplayBitmap(int textIndex) const; + result SetFont(Font* pFont); Font* GetFont(int textIndex) const; + result SetFontSize(int size); + + result SetFontSize(float size); + + int GetFontSize(int textIndex) const; + + float GetFontSizeF(int textIndex) const; + + result SetFontStyle(int style); + + int GetFontStyle(int textIndex) const; + result SetForegroundColor(const Color& color); Color GetForegroundColor(int textIndex) const; @@ -139,8 +188,12 @@ public: void SetLineSpace(int gap); + void SetLineSpace(float gap); + int GetLineSpace(void) const; + float GetLineSpaceF(void) const; + void SetElementVerticalAlignment(TextObjectAlignment alignment); TextObjectAlignment GetElementVerticalAlignment(void) const; @@ -171,8 +224,12 @@ public: void SetComposePartialLimitHeight(int limitHeight); + void SetComposePartialLimitHeight(float limitHeight); + int GetComposePartialLimitHeight(void) const; + float GetComposePartialLimitHeightF(void) const; + void SetWidthManagerEnabled(bool widthManagerEnable); bool IsWidthManagerEnabled(void) const; @@ -183,10 +240,16 @@ public: int ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, int maxWidth, int& textIndex); + int ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, float maxWidth, int& textIndex); + int GetTotalComposedHeight(void) const; + float GetTotalComposedHeightF(void) const; + int GetAnalysedTotalHeight(void) const; + float GetAnalysedTotalHeightF(void) const; + bool IsChanged(void) const; result ChangeCutLinkState(int linkIndex, bool select); @@ -211,6 +274,8 @@ public: int GetMaxLineHeight(void) const; + float GetMaxLineHeightF(void) const; + int GetWorkStart(void) const; int GetWorkLength(void) const; @@ -231,29 +296,57 @@ public: Color GetBlockColor(void) const; + result GetTextExtentList(TextLine* pTextLine) const; + + Tizen::Base::String GetDisplayableText(Rectangle displayRect, TextObjectActionType action); + + Tizen::Base::String GetDisplayableText(FloatRectangle displayRect, TextObjectActionType action); + private: int ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo = null); + int ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo = null); + int ComposeInNormalWrap(Rectangle& rect); + int ComposeInNormalWrap(FloatRectangle& rect); + int ComposeInWordWrap(Rectangle& rect); + int ComposeInWordWrap(FloatRectangle& rect); + int ComposeInWrap(Rectangle& rect); + int ComposeInWrap(FloatRectangle& rect); + int ComposeInWrapByTextWidth(Rectangle& rect); + int ComposeInWrapByTextWidth(FloatRectangle& rect); + int ComposeInNoneWrapMiddleEllipsis(Rectangle& rect); + int ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect); + int ComposeInNoneWrapHeadEllipsis(Rectangle& rect); + int ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect); + int ComposeInPartialMode(Rectangle& rect); + int ComposeInPartialMode(FloatRectangle& rect); + bool BackwardAnalyze(int startTextIndex, int maxWidth, int* actualLength, int* width, int* height); + bool BackwardAnalyze(int startTextIndex, float maxWidth, int* actualLength, float* width, float* height); + result DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment); + result DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment); + result DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignmen); + result DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignmen); + result SetValueToAllTextElements(TextComponentInfoValueType type, unsigned int value); bool SetAbbrevObjectFontInfo(TextSimple* pSimpleTextElement); @@ -262,6 +355,18 @@ private: int GetFirstTextIndexAt(int elementIndex) const; + result DrawBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + + result DrawBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + + result DrawBackgroundBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + + result DrawBackgroundBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + private: bool __isChanged; TextObjectWrapType __wrap; diff --git a/src/graphics/text/FGrp_TextTextCutLink.cpp b/src/graphics/text/FGrp_TextTextCutLink.cpp index 41d90dc..3ef0e4b 100644 --- a/src/graphics/text/FGrp_TextTextCutLink.cpp +++ b/src/graphics/text/FGrp_TextTextCutLink.cpp @@ -28,6 +28,7 @@ #include "FGrp_TextTextSimple.h" #include "FGrp_TextTextCutLink.h" #include "FGrp_CanvasImpl.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base::Utility; @@ -80,6 +81,15 @@ TextCutLink::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startText return TextSimple::Draw(canvasImpl, displayRect, startTextIndex, textLength, align, action); } +result +TextCutLink::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, + const TextObjectActionType action) +{ + Rectangle intDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect); + + return Draw(canvasImpl, intDisplayRect, startTextIndex, textLength, align, action); +} + TextElement* TextCutLink::CloneN(TextComponentInfoValueType type, unsigned int value) { diff --git a/src/graphics/text/FGrp_TextTextCutLinkParser.cpp b/src/graphics/text/FGrp_TextTextCutLinkParser.cpp index b9ea72a..d97fc8c 100644 --- a/src/graphics/text/FGrp_TextTextCutLinkParser.cpp +++ b/src/graphics/text/FGrp_TextTextCutLinkParser.cpp @@ -31,7 +31,8 @@ using namespace Tizen::Base::Utility; using namespace Tizen::Graphics; static const int _MIN_TEXT_LENGTH = 5; -static const int _MIN_PHONE_NUMBER_LENGTH = 4; +static const int _MIN_PHONE_NUMBER_LENGTH = 7; +static const int _MAX_PHONE_NUMBER_LENGTH = 15; static ArrayListT * gpDomainNames = null; static ArrayListT * gpUrlPrefixes = null; @@ -703,9 +704,16 @@ TextCutLinkParser::Parse(const wchar_t* pText, int textLength, int startPosition else if ((__linkMask & LINK_TYPE_TEL_NUM) && IsPhoneNumCharacter(checkLetter) && IsPhoneNumber(text, i, linkLength)) { - linkParsed = true; - linkStartIndex = i; - linkType = LINK_TYPE_TEL_NUM; + if (linkLength > _MAX_PHONE_NUMBER_LENGTH) + { + i += (linkLength - 1); + } + else + { + linkParsed = true; + linkStartIndex = i; + linkType = LINK_TYPE_TEL_NUM; + } } if (linkParsed) diff --git a/src/graphics/text/FGrp_TextTextElement.cpp b/src/graphics/text/FGrp_TextTextElement.cpp index f1a9797..f3d4732 100644 --- a/src/graphics/text/FGrp_TextTextElement.cpp +++ b/src/graphics/text/FGrp_TextTextElement.cpp @@ -23,6 +23,7 @@ #include #include #include "FGrp_TextTextElement.h" +#include "FGrp_CoordinateSystemUtils.h" namespace Tizen { namespace Graphics { @@ -70,6 +71,13 @@ TextElement::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Te return -1; } +int +TextElement::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height) +{ + return -1; +} + result TextElement::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment, const TextObjectActionType action) @@ -77,6 +85,13 @@ TextElement::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startText return E_SYSTEM; } +result +TextElement::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, + int textLength, const TextObjectAlignment alignment, const TextObjectActionType action) +{ + return E_SYSTEM; +} + TextElement* TextElement::CloneN(TextComponentInfoValueType type, unsigned int value) { @@ -96,17 +111,35 @@ TextElement::GetRegion(int textIndex, int textLength, int& width, int& height) c } result +TextElement::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + return E_SYSTEM; +} + +result TextElement::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const { return E_SYSTEM; } +result +TextElement::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const +{ + return E_SYSTEM; +} + int TextElement::GetHeight(void) const { return -1; } +float +TextElement::GetHeightF(void) const +{ + return -1; +} + int TextElement::GetTextLength(void) const { diff --git a/src/graphics/text/FGrp_TextTextImage.cpp b/src/graphics/text/FGrp_TextTextImage.cpp old mode 100644 new mode 100755 index 98b920c..164bbcd --- a/src/graphics/text/FGrp_TextTextImage.cpp +++ b/src/graphics/text/FGrp_TextTextImage.cpp @@ -30,6 +30,7 @@ #include "FGrp_TextTextImage.h" #include "../FGrp_BitmapUtil.h" #include "../FGrp_Canvas.h" +#include "FGrp_CoordinateSystemUtils.h" namespace Tizen { namespace Graphics { @@ -134,6 +135,19 @@ TextImage::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Text return TEXT_RETBY_NORMAL; } +int +TextImage::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height) +{ + int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int r = ForwardAnalyze(startTextIndex, textLength, iMaxWidth, wrap, actualLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + result TextImage::GetRegion(int textIndex, int textLength, int& width, int& height) const { @@ -159,17 +173,45 @@ TextImage::GetRegion(int textIndex, int textLength, int& width, int& height) con } result +TextImage::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + result r = GetRegion(textIndex, textLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + +result TextImage::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const { return GetRegion(textIndex, textLength, width, height); } +result +TextImage::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const +{ + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + result r = GetBlockRegion(textIndex, textLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + int TextImage::GetHeight(void) const { return __rect.height; } +float +TextImage::GetHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetHeight()); +} + result TextImage::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action) { @@ -241,7 +283,7 @@ TextImage::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIn break; } - r = pCanvas->DrawBitmap(bitmapRect, *GetBitmapEx(*_BitmapImpl::GetInstance(*__pBitmap))); + r = pCanvas->DrawBitmap(bitmapRect, *_GetBitmapEx(*_BitmapImpl::GetInstance(*__pBitmap))); SysTryReturn(NID_GRP , r == E_SUCCESS , r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -257,6 +299,19 @@ TextImage::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIn return E_SUCCESS; } +result +TextImage::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + Rectangle iDisplayRect; + iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x); + iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y); + iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width); + iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height); + + return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, align, action); +} + TextElement* TextImage::CloneN(TextComponentInfoValueType type, unsigned int value) { @@ -371,6 +426,13 @@ TextImage::SetBounds(const Rectangle& rect) } result +TextImage::SetBounds(const FloatRectangle& rect) +{ + const Rectangle iRect = _CoordinateSystemUtils::ConvertToInteger(rect); + return SetBounds(iRect); +} + +result TextImage::SetAlignment(TextObjectAlignment alignment) { SysTryReturn(NID_GRP @@ -388,6 +450,12 @@ TextImage::GetBounds(void) const return __rect; } +FloatRectangle +TextImage::GetBoundsF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetBounds()); +} + TextObjectAlignment TextImage::GetAlignment(void) const { diff --git a/src/graphics/text/FGrp_TextTextLine.cpp b/src/graphics/text/FGrp_TextTextLine.cpp index 371cd92..c00e17f 100644 --- a/src/graphics/text/FGrp_TextTextLine.cpp +++ b/src/graphics/text/FGrp_TextTextLine.cpp @@ -26,6 +26,19 @@ #include "FGrp_TextCommon.h" #include "FGrp_TextTextComposite.h" #include "FGrp_TextTextLine.h" +#include "FGrp_CoordinateSystemUtils.h" + +#include + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +#define Release(x) \ + if (x) \ + { \ + delete x; \ + x = null; \ + } namespace Tizen { namespace Graphics { @@ -47,6 +60,7 @@ TextLine::TextLine(TextComposite* pCompositeText) __rect.width = 0; __baseline = 0; __pCompositeText = pCompositeText; + __pExtentList = null; // For Sweep Info __sweepComposeLineInfo.isValid = false; @@ -67,7 +81,11 @@ TextLine::TextLine(TextComposite* pCompositeText) TextLine::~TextLine(void) { - + if (__pExtentList) + { + __pExtentList->RemoveAll(); + delete __pExtentList; + } } result @@ -85,6 +103,17 @@ TextLine::GetRegion(int textIndex, int textLength, int& width, int& height) cons return E_SUCCESS; } +result +TextLine::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + result r = GetRegion(textIndex, textLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + int TextLine::GetHeight(int textIndex) const { @@ -102,6 +131,12 @@ TextLine::GetHeight(int textIndex) const } } +float +TextLine::GetHeightF(int textIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex)); +} + result TextLine::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action) @@ -114,6 +149,23 @@ TextLine::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextInd } result +TextLine::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action) +{ + SysTryReturn(NID_GRP + , startTextIndex == 0 && textLength == __textLength && __pCompositeText != null + , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + Rectangle iDisplayRect; + iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x); + iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y); + iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width); + iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height); + + return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, align, action); +} + +result TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, Rectangle& displayRect) { SysTryReturn(NID_GRP @@ -125,6 +177,22 @@ TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLengt return __pCompositeText->DrawPartial(canvasImpl, displayRect, textIndexAtLine, textLength); } +result +TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, FloatRectangle& displayRect) +{ + SysTryReturn(NID_GRP + , __pCompositeText != null + , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + Rectangle iDisplayRect; + iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x); + iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y); + iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width); + iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height); + + return DrawPartial(canvasImpl, startTextIndex, textLength, iDisplayRect); +} + TextLine* TextLine::CopyN(void) { @@ -156,6 +224,11 @@ TextLine::GetBounds(void) const return __rect; } +FloatRectangle +TextLine::GetBoundsF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetBounds()); +} int TextLine::GetTextLength(void) const @@ -203,6 +276,13 @@ TextLine::SetBounds(const Rectangle& rect) return E_SUCCESS; } +result +TextLine::SetBounds(const FloatRectangle& rect) +{ + const Rectangle iRect = _CoordinateSystemUtils::ConvertToInteger(rect); + return SetBounds(iRect); +} + void TextLine::SetEndType(int endType) { @@ -220,6 +300,14 @@ TextLine::SetRegion(int width, int height) { __width = width; __height = height; + return; +} + +void +TextLine::SetRegion(float width, float height) +{ + SetRegion(_CoordinateSystemUtils::ConvertToInteger(width), _CoordinateSystemUtils::ConvertToInteger(height)); + return; } void @@ -241,6 +329,13 @@ TextLine::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextO return -1; } +int +TextLine::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height) +{ + return -1; +} + result TextLine::ResetSweepInfo(void) { @@ -349,4 +444,345 @@ TextLine::GetKeyInputLength(void) return __keyInputTextLength; } +result +TextLine::SetTextExtentList(LinkedListT<_Util::Pair* >* pList) +{ + if (__pExtentList) + { + __pExtentList->RemoveAll(); + delete __pExtentList; + } + + __pExtentList = pList; + + return E_SUCCESS; +} + +LinkedListT<_Util::Pair* >* +TextLine::GetTextExtentList(void) const +{ + return __pExtentList; +} + +int +TextLine::GetTextIndexFromPosition(int pcX, bool cursorMode) +{ + SysTryReturn(NID_GRP, pcX >= 0 + , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + SysTryReturn(NID_GRP, __pExtentList + , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + _Util::Pair* pPair = null; + IEnumeratorT<_Util::Pair* >* pEnum = __pExtentList->GetEnumeratorN(); + pEnum->MoveNext(); + + int textIndex = -1; + + for (int i = 0; i < __textLength; i++, pEnum->MoveNext()) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + if (pPair->first <= pcX && pcX < pPair->second) + { + textIndex = i + __textOffset; + + FriBidiChar text[1] = { __pCompositeText->GetCharacter(textIndex) }; + FriBidiCharType type[1] = { 0 }; + fribidi_get_bidi_types(text, 1, type); + bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0; + + if (isRtl == true) + { + textIndex = (pcX - pPair->first < pPair->second - pcX) ? i + __textOffset + 1 : i + __textOffset; + } + else + { + textIndex = (pcX - pPair->first < pPair->second - pcX) ? i + __textOffset : i + __textOffset + 1; + } + + break; + } + } + } + + if (textIndex < 0) + { + textIndex = __textOffset + __textLength; + } + + Release(pEnum); + + return textIndex; +} + +int +TextLine::GetTextIndexFromPosition(float pcX, bool cursorMode) +{ + return GetTextIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(pcX), cursorMode); +} + +Rectangle +TextLine::GetTextExtent(int textIndexFromLineOffset, int textLength) const +{ + SysTryReturn(NID_GRP, 0 <= textIndexFromLineOffset && textLength <= __textLength + , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + SysTryReturn(NID_GRP, __pExtentList + , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + _Util::Pair* pPair = null; + Rectangle extent; + IEnumeratorT<_Util::Pair* >* pEnum = __pExtentList->GetEnumeratorN(); + + if (textIndexFromLineOffset == __textLength) + { + for (int i = 0; i < textIndexFromLineOffset; i++) + { + pEnum->MoveNext(); + } + + pEnum->GetCurrent(pPair); + if (pPair) + { + FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) }; + FriBidiCharType type[1] = { 0 }; + fribidi_get_bidi_types(text, 1, type); + bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0; + + extent.x = (isRtl == true) ? pPair->first : pPair->second; + extent.width = 0; + } + } + else if (textIndexFromLineOffset == 0) + { + pEnum->MoveNext(); + pEnum->GetCurrent(pPair); + if (pPair) + { + FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) }; + FriBidiCharType type[1] = { 0 }; + fribidi_get_bidi_types(text, 1, type); + bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0; + + extent.x = (isRtl == true) ? pPair->second : pPair->first; + extent.width = 0; + } + + for (int i = 0; i < textLength; i++) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + extent.width += pPair->second - pPair->first; + } + pEnum->MoveNext(); + } + } + else + { + int prevLeft = 0; + int prevRight = 0; + FriBidiChar text[2] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1), __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset)}; + FriBidiCharType type[2] = { 0, 0 }; + fribidi_get_bidi_types(text, 2, type); + bool isRtl[2] = {(type[0] & FRIBIDI_MASK_RTL) > 0, (type[1] & FRIBIDI_MASK_RTL) > 0}; + + for (int i = 0; i < textIndexFromLineOffset; i++) + { + pEnum->MoveNext(); + } + + pEnum->GetCurrent(pPair); + if (pPair) + { + prevLeft = pPair->first; + prevRight = pPair->second; + } + + pEnum->MoveNext(); + pEnum->GetCurrent(pPair); + + if (pPair) + { + if (isRtl[0] && isRtl[1]) // R + R + { + extent.x = prevLeft; + } + else if (isRtl[0] && !isRtl[1]) // R + L + { + extent.x = prevLeft; + } + else if (!isRtl[0] && !isRtl[1]) // L + L + { + extent.x = pPair->first; + } + else if (!isRtl[0] && isRtl[1]) // L + R + { + extent.x = prevRight; + } + } + + extent.width = 0; + + for (int i = 0; i < textLength; i++) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + extent.width += pPair->second - pPair->first; + } + + pEnum->MoveNext(); + } + } + + Release(pEnum); + + return extent; +} + +FloatRectangle +TextLine::GetTextExtentF(int textIndexFromLineOffset, int textLength) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent(textIndexFromLineOffset, textLength)); +} + +Rectangle +TextLine::GetBlockTextExtent(int textIndexFromLineOffset, int textLength) const +{ + SysTryReturn(NID_GRP, 0 <= textIndexFromLineOffset && textLength <= __textLength + , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + SysTryReturn(NID_GRP, __pExtentList + , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + _Util::Pair* pPair = null; + Rectangle extent; + IEnumeratorT<_Util::Pair* >* pEnum = __pExtentList->GetEnumeratorN(); + + if (textIndexFromLineOffset == __textLength) + { + for (int i = 0; i < textIndexFromLineOffset; i++) + { + pEnum->MoveNext(); + } + + pEnum->GetCurrent(pPair); + if (pPair) + { + if (__endType == TEXT_RETBY_LINEFEED) + { + extent.x = pPair->first + 10; + extent.width = 0; + } + else + { + FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) }; + FriBidiCharType type[1] = { 0 }; + fribidi_get_bidi_types(text, 1, type); + bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0; + + extent.x = (isRtl == true) ? pPair->first : pPair->second; + extent.width = 0; + } + } + } + else if (textIndexFromLineOffset == 0) + { + pEnum->MoveNext(); + pEnum->GetCurrent(pPair); + if (pPair) + { + FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) }; + FriBidiCharType type[1] = { 0 }; + fribidi_get_bidi_types(text, 1, type); + bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0; + + extent.x = (isRtl == true) ? pPair->second : pPair->first; + extent.width = 0; + } + + for (int i = 0; i < textLength; i++) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + extent.width += pPair->second - pPair->first; + } + pEnum->MoveNext(); + } + } + else + { + { + int prevLeft = 0; + int prevRight = 0; + FriBidiChar text[2] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1), __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset)}; + FriBidiCharType type[2] = { 0, 0 }; + fribidi_get_bidi_types(text, 2, type); + bool isRtl[2] = {(type[0] & FRIBIDI_MASK_RTL) > 0, (type[1] & FRIBIDI_MASK_RTL) > 0}; + + for (int i = 0; i < textIndexFromLineOffset; i++) + { + pEnum->MoveNext(); + } + + pEnum->GetCurrent(pPair); + if (pPair) + { + prevLeft = pPair->first; + prevRight = pPair->second; + } + + pEnum->MoveNext(); + pEnum->GetCurrent(pPair); + + if (pPair) + { + if (isRtl[0] && isRtl[1]) // R + R + { + extent.x = prevLeft; + } + else if (isRtl[0] && !isRtl[1]) // R + L + { + extent.x = pPair->first; + } + else if (!isRtl[0] && !isRtl[1]) // L + L + { + extent.x = pPair->first; + } + else if (!isRtl[0] && isRtl[1]) // L + R + { + extent.x = prevRight; + } + } + + extent.width = 0; + + for (int i = 0; i < textLength; i++) + { + pEnum->GetCurrent(pPair); + if (pPair) + { + extent.width += pPair->second - pPair->first; + } + + pEnum->MoveNext(); + } + } + } + + Release(pEnum); + + return extent; +} + +FloatRectangle +TextLine::GetBlockTextExtentF(int textIndexFromLineOffset, int textLength) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetBlockTextExtent(textIndexFromLineOffset, textLength)); +} + }}} // Tizen::Graphics::_Text diff --git a/src/graphics/text/FGrp_TextTextLine.h b/src/graphics/text/FGrp_TextTextLine.h index f03eeb7..c93a866 100644 --- a/src/graphics/text/FGrp_TextTextLine.h +++ b/src/graphics/text/FGrp_TextTextLine.h @@ -25,7 +25,10 @@ #ifndef _FGRP_INTERNAL_TEXT_LINE_H_ #define _FGRP_INTERNAL_TEXT_LINE_H_ +#include + #include "FGrp_TextCommon.h" +#include "../FGrp_Font.h" namespace Tizen { namespace Graphics { @@ -48,15 +51,27 @@ public: virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action); + virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment align, const TextObjectActionType action); + virtual result DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, Rectangle& displayRect); + virtual result DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, FloatRectangle& displayRect); + virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength, int& width, int& height); + virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height); + virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const; + virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const; + virtual int GetHeight(int textIndex) const; + virtual float GetHeightF(int textIndex) const; + virtual int GetTextLength(void) const; virtual void SetTextLength(int length); @@ -71,13 +86,19 @@ public: result SetBounds(const Rectangle& rect); + result SetBounds(const FloatRectangle& rect); + Rectangle GetBounds(void) const; + FloatRectangle GetBoundsF(void) const; + void SetEndType(int endType); int GetEndType(void) const; void SetRegion(int width, int height); + + void SetRegion(float width, float height); TextLine* CopyN(void); @@ -115,6 +136,22 @@ public: int GetKeyInputLength(void); + result SetTextExtentList(Tizen::Base::Collection::LinkedListT<_Util::Pair* >* pList); + + Tizen::Base::Collection::LinkedListT<_Util::Pair* >* GetTextExtentList(void) const; + + int GetTextIndexFromPosition(int pcX, bool cursorMode = true); + + int GetTextIndexFromPosition(float pcX, bool cursorMode = true); + + Rectangle GetTextExtent(int textIndexFromLineOffset, int textLength) const; + + FloatRectangle GetTextExtentF(int textIndexFromLineOffset, int textLength) const; + + Rectangle GetBlockTextExtent(int textIndexFromLineOffset, int textLength) const; + + FloatRectangle GetBlockTextExtentF(int textIndexFromLineOffset, int textLength) const; + // Attribute private: TextComposite* __pCompositeText; @@ -133,6 +170,7 @@ private: bool __isKeyInputChanged; int __keyInputTextIndex; int __keyInputTextLength; + Tizen::Base::Collection::LinkedListT<_Util::Pair* >* __pExtentList; private: TextLine(const TextLine& other); // NOT IMPLMENTED diff --git a/src/graphics/text/FGrp_TextTextObject.cpp b/src/graphics/text/FGrp_TextTextObject.cpp index dc5e991..c66d55f 100644 --- a/src/graphics/text/FGrp_TextTextObject.cpp +++ b/src/graphics/text/FGrp_TextTextObject.cpp @@ -38,12 +38,25 @@ #include "FGrp_TextTextUtility.h" #include "FGrp_TextTextWidthManager.h" #include "FGrp_Screen.h" +#include "FGrp_CoordinateSystemUtils.h" + +namespace // unnamed +{ + const int DEFAULT_FONT_SIZE = 42; +} #define IF_NOT_CONSTRUCTED(code) if (this->__pCompositeText == null || this->__pTextColumn == null) \ { \ code; \ } +#define Release(x) \ + if (x) \ + { \ + delete x; \ + x = null; \ + } + using namespace Tizen::Base::Utility; using namespace Tizen::Base; @@ -53,6 +66,125 @@ namespace Tizen { namespace Graphics namespace _Text { +namespace // unnamed +{ + const long long MAX_INT = 0x7FFFFFFF; + const long long MIN_INT = -MAX_INT - 1; +} + +inline int +ToVirCoord(const int& sour) +{ + int logicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolutionInt(); + Dimension physicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetPhysicalResolutionDim(); + + long long tempSrc = sour; + + if (logicalResolution == 720 && (physicalResolution.width == 480 || physicalResolution.height == 480)) + { + if (tempSrc >= 0) + { + tempSrc = tempSrc * 3 / 2; + + return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc); + } + else + { + tempSrc = (tempSrc * 3 - 1) / 2; + + return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc); + } + } + else if (logicalResolution == 480 && physicalResolution.width == 720) + { + + if (tempSrc > 0) + { + tempSrc = (tempSrc + 1) * 2 / 3; + + return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc); + } + else + { + tempSrc = tempSrc * 2 / 3; + + return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc); + } + } + else + { + return sour; + } +} + +inline int +ConvertToVirCoord(const int& sour) +{ + return _ResUtil::NeedToConvertCoord() ? ToVirCoord(sour) : sour; +} + +inline int +ToPhyCoord(const int& sour) +{ + int logicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolutionInt(); + Dimension physicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetPhysicalResolutionDim(); + + long long tempSrc = sour; + + if (logicalResolution == 720 && (physicalResolution.width == 480 || physicalResolution.height == 480)) + { + if (tempSrc > 0) + { + tempSrc = (tempSrc + 1) * 2 / 3; + + return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc); + } + else + { + tempSrc = tempSrc * 2 / 3; + + return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc); + } + } + else if (logicalResolution == 480 && physicalResolution.width == 720) + { + if (tempSrc >= 0) + { + tempSrc = tempSrc * 3 / 2; + + return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc); + } + else + { + tempSrc = (tempSrc * 3 - 1) / 2; + + return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc); + } + } + else + { + return sour; + } +} + +inline int +ConvertToPhyCoord(const int& sour) +{ + return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour; +} + +inline int +ConvertToPhyCoordWidth(const int& sour) +{ + return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour; +} + +inline int +ConvertToPhyCoordHeight(const int& sour) +{ + return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour; +} + TextObject::TextObject(void) { __action = TEXT_OBJECT_ACTION_TYPE_NONE; @@ -106,29 +238,10 @@ TextObject::TextObject(void) TextObject::~TextObject(void) { - if (__pCompositeText) - { - delete __pCompositeText; - __pCompositeText = null; - } - - if (__pTextColumn) - { - delete __pTextColumn; - __pTextColumn = null; - } - - if (__pTextWidthManager) - { - delete __pTextWidthManager; - __pTextWidthManager = null; - } - - if (__pDefaultFont) - { - delete __pDefaultFont; - __pDefaultFont = null; - } + Release(__pCompositeText); + Release(__pTextColumn); + Release(__pTextWidthManager); + Release(__pDefaultFont); } result @@ -150,24 +263,16 @@ TextObject::Construct(void) __pTextWidthManager = null; __pCompositeText = new (std::nothrow)TextComposite(); - SysTryCatch(NID_GRP - , __pCompositeText - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); __pTextColumn = new (std::nothrow)TextColumn(__pCompositeText); - SysTryCatch(NID_GRP - , __pTextColumn - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pTextColumn, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); __pDefaultFont = new (std::nothrow)Font(); - SysTryCatch(NID_GRP - , __pTextColumn - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pDefaultFont, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); - r = __pDefaultFont->Construct(FONT_STYLE_PLAIN, 20); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , E_SYSTEM, "[E_SYSTEM] Fail to set font."); + r = __pDefaultFont->Construct(FONT_STYLE_PLAIN, DEFAULT_FONT_SIZE); + SysTryCatch(NID_GRP, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Fail to set font."); __pCompositeText->SetWrap(__wrap); __pCompositeText->SetTextSweepInfo(&__sweepInfo); @@ -175,29 +280,10 @@ TextObject::Construct(void) return E_SUCCESS; CATCH: - if (__pDefaultFont) - { - delete __pDefaultFont; - __pDefaultFont = null; - } - - if (__pCompositeText) - { - delete __pCompositeText; - __pCompositeText = null; - } - - if (__pTextColumn) - { - delete __pTextColumn; - __pTextColumn = null; - } - - if (__pTextWidthManager) - { - delete __pTextWidthManager; - __pTextWidthManager = null; - } + Release(__pDefaultFont); + Release(__pCompositeText); + Release(__pTextColumn); + Release(__pTextWidthManager); return r; } @@ -220,30 +306,22 @@ TextObject::Construct(const Rectangle& rect) __linkViewModeEnabled = false; __pTextWidthManager = null; __rect = rect; - __pcRect.x = _ResUtil::ConvertToPhyCoord(rect.x); - __pcRect.y = _ResUtil::ConvertToPhyCoord(rect.y); - __pcRect.width = _ResUtil::ConvertToPhyCoordWidth(rect.width); - __pcRect.height = _ResUtil::ConvertToPhyCoordHeight(rect.height); + __pcRect.x = _Text::ConvertToPhyCoord(rect.x); + __pcRect.y = _Text::ConvertToPhyCoord(rect.y); + __pcRect.width = _Text::ConvertToPhyCoordWidth(rect.width); + __pcRect.height = _Text::ConvertToPhyCoordHeight(rect.height); __pCompositeText = new (std::nothrow)TextComposite(); - SysTryCatch(NID_GRP - , __pCompositeText - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); __pTextColumn = new (std::nothrow)TextColumn(__pCompositeText); - SysTryCatch(NID_GRP - , __pTextColumn - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pTextColumn, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); __pDefaultFont = new (std::nothrow)Font(); - SysTryCatch(NID_GRP - , __pTextColumn - , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryCatch(NID_GRP, __pTextColumn, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); - r = __pDefaultFont->Construct(FONT_STYLE_PLAIN, 20); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , E_SYSTEM, "[E_SYSTEM] Fail to set font."); + r = __pDefaultFont->Construct(FONT_STYLE_PLAIN, DEFAULT_FONT_SIZE); + SysTryCatch(NID_GRP, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Fail to set font."); __pCompositeText->SetWrap(__wrap); __pCompositeText->SetTextSweepInfo(&__sweepInfo); @@ -251,29 +329,59 @@ TextObject::Construct(const Rectangle& rect) return E_SUCCESS; CATCH: - if (__pDefaultFont) - { - delete __pDefaultFont; - __pDefaultFont = null; - } + Release(__pDefaultFont); + Release(__pCompositeText); + Release(__pTextColumn); + Release(__pTextWidthManager); - if (__pCompositeText) - { - delete __pCompositeText; - __pCompositeText = null; - } + return r; +} - if (__pTextColumn) - { - delete __pTextColumn; - __pTextColumn = null; - } +result +TextObject::Construct(const FloatRectangle& rect) +{ + result r = E_SUCCESS; - if (__pTextWidthManager) - { - delete __pTextWidthManager; - __pTextWidthManager = null; - } + __action = TEXT_OBJECT_ACTION_TYPE_NONE; + __align = (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP); + __wrap = TEXT_OBJECT_WRAP_TYPE_WORD; + __isActionOn = false; + __isChanged = false; + __defaultForegroundColor = Color::GetColor(COLOR_ID_BLACK); + __defaultBackgroundColor = Color::GetColor(COLOR_ID_WHITE); + __defaultOutlineColor = Color::GetColor(COLOR_ID_WHITE); + __slidingStep = 2; + __isAlternateLookEnabled = false; + __linkViewModeEnabled = false; + __pTextWidthManager = null; + __rect = _CoordinateSystemUtils::ConvertToInteger(rect); + __pcRect.x = _Text::ConvertToPhyCoord(rect.x); + __pcRect.y = _Text::ConvertToPhyCoord(rect.y); + __pcRect.width = _Text::ConvertToPhyCoordWidth(rect.width); + __pcRect.height = _Text::ConvertToPhyCoordHeight(rect.height); + + __pCompositeText = new (std::nothrow)TextComposite(); + SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + __pTextColumn = new (std::nothrow)TextColumn(__pCompositeText); + SysTryCatch(NID_GRP, __pTextColumn, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + __pDefaultFont = new (std::nothrow)Font(); + SysTryCatch(NID_GRP, __pTextColumn, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + r = __pDefaultFont->Construct(FONT_STYLE_PLAIN, DEFAULT_FONT_SIZE); + SysTryCatch(NID_GRP, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Fail to set font."); + + __pCompositeText->SetWrap(__wrap); + __pCompositeText->SetTextSweepInfo(&__sweepInfo); + + return E_SUCCESS; + +CATCH: + Release(__pDefaultFont); + Release(__pCompositeText); + Release(__pTextColumn); + Release(__pTextWidthManager); return r; } @@ -290,21 +398,15 @@ TextObject::CloneN(void) int count = __pCompositeText->GetElementCount(); pTextObject = new (std::nothrow)TextObject(); - SysTryReturn(NID_GRP - , pTextObject - , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pTextObject, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); r = pTextObject->Construct(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); for (int i=0; i < count; i++) { pTextElement = __pCompositeText->GetElementAtElementIndex(i); - SysTryCatch(NID_GRP - , pTextElement - , , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryCatch(NID_GRP, pTextElement, , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pCloneTextElement = pTextElement->CloneN(SET_ALLVALUE_CLONE,0); pTextObject->AppendElement(*pCloneTextElement); @@ -315,8 +417,7 @@ TextObject::CloneN(void) return pTextObject; CATCH: - delete pTextObject; - pTextObject = null; + Release(pTextObject); return null; } @@ -339,19 +440,14 @@ TextObject::Draw(_CanvasImpl& canvasImpl) int totalHeight = 0; int slidingWidth = 0; - SysTryReturn(NID_GRP - , __pcRect.width > 0 && __pcRect.height > 0 - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __pcRect.width, __pcRect.height); + SysTryReturn(NID_GRP, __pcRect.width > 0 && __pcRect.height > 0, E_INVALID_STATE, E_INVALID_STATE + , "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __pcRect.width, __pcRect.height); _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); - SysTryReturn(NID_GRP - , pCanvas - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pCanvas, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); r = Compose(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if (__pTextColumn->GetTotalLineCount() <= 1) { @@ -473,9 +569,7 @@ CONTINUE_PROC: finalClipRect.width = Math::Min(clipRect.x + clipRect.width, targetBounds.x + targetBounds.width) - finalClipRect.x; finalClipRect.height = Math::Min(clipRect.y + clipRect.height, targetBounds.y + targetBounds.height) - finalClipRect.y; - SysTryReturn(NID_GRP - , 0 <= finalClipRect.width && 0 <= finalClipRect.height - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle."); + SysTryReturn(NID_GRP, 0 <= finalClipRect.width && 0 <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle."); pCanvas->SetClipBounds(finalClipRect); @@ -483,9 +577,7 @@ CONTINUE_PROC: { case TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT: pTextLine = __pTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); __pTextColumn->SetDisplayLineCount(1); @@ -516,9 +608,8 @@ CONTINUE_PROC: if (slidingRect.x < targetBounds.x + targetBounds.width) { slidingRect.width = targetBounds.x + targetBounds.width - slidingRect.x; - - __pCompositeText->Draw(canvasImpl, slidingRect, 0, __pCompositeText->GetTextLength(), - (TextObjectAlignment)(__align & TEXT_ALIGNMASK_HORIZ), TEXT_OBJECT_ACTION_TYPE_NONE); + __pCompositeText->Draw(canvasImpl, slidingRect, 0, __pCompositeText->GetTextLength() + ,(TextObjectAlignment)(__align & TEXT_ALIGNMASK_HORIZ), TEXT_OBJECT_ACTION_TYPE_NONE); } } else @@ -541,8 +632,7 @@ CONTINUE_PROC: { lineBounds = pTextLine->GetBounds(); slidingRect.height = lineBounds.height; - if ((slidingRect.y + slidingRect.height >= targetBounds.y) && - (slidingRect.y < targetBounds.y + targetBounds.height)) + if ((slidingRect.y + slidingRect.height >= targetBounds.y) && (slidingRect.y < targetBounds.y + targetBounds.height)) { pTextLine->Draw(canvasImpl, slidingRect, 0, pTextLine->GetTextLength(), (TextObjectAlignment)(__align & TEXT_ALIGNMASK_HORIZ), TEXT_OBJECT_ACTION_TYPE_NONE); @@ -584,9 +674,7 @@ TextObject::GetChangedLineRange(int& startChangedLineIndex, int& endChangedLineI result r = E_SUCCESS; r = Compose(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); startChangedLineIndex = __sweepInfo.sweepRegionStartLineIndex; endChangedLineIndex = __sweepInfo.sweepRegionStartLineIndex + __sweepInfo.sweepRegionLineCount - 1; @@ -599,9 +687,7 @@ TextObject::DrawLine(_CanvasImpl& canvasImpl, int lineIndex) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); result r = E_SUCCESS; TextLine* pTextLine = null; @@ -609,9 +695,7 @@ TextObject::DrawLine(_CanvasImpl& canvasImpl, int lineIndex) int firstDisplayY = __pTextColumn->GetFirstDisplayPositionY(); r = Compose(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); pTextLine = __pTextColumn->GetTextLine(lineIndex); if (pTextLine == null) @@ -636,9 +720,7 @@ TextObject::DrawWithOffset(_CanvasImpl& canvasImpl) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , __isActionOn - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Action is off."); + SysTryReturn(NID_GRP, __isActionOn, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Action is off."); int slidingStartIndex = __pTextColumn->GetSlidingPosition(); Dimension slidingDim = __pTextColumn->GetSlidingDimension(); @@ -704,9 +786,7 @@ TextObject::UpdateChangedInfo(int startTextIndex, int textLength, bool initTextW if (startTextIndex >= 0) { r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_UNKONWN, startTextIndex, 0); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if (__pCompositeText->IsWidthManagerEnabled() && __pTextWidthManager && initTextWidthManager) { @@ -759,16 +839,12 @@ TextObject::Compose(void) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + SysTryReturn(NID_GRP, __pcRect.width >= 0 && __pcRect.height >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); + int lineCount = 0; - Rectangle rect; + Rectangle rect = __pcRect; Rectangle lineBounds; - SysTryReturn(NID_GRP - , __pcRect.width >= 0 && __pcRect.height >= 0 - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet."); - - rect = __pcRect; - if (__pCompositeText->IsPartialComposingModeEnabled()) { if (__pCompositeText->IsComposeDone() || !__isFirstDisplayPositionYChanged) @@ -869,13 +945,8 @@ TextObject::GetText(wchar_t* pCopiedText, int textLength) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , pCopiedText - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , textLength > 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pCopiedText, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textLength > 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); int textElementCount = 0; int totalLength = 0; @@ -904,16 +975,12 @@ TextObject::GetText(wchar_t* pCopiedText, int textLength) const if (pSimpleText != null) { copiedLength = (elementTextLength > outLength - totalLength) ? outLength - totalLength : elementTextLength; - SysTryReturn(NID_GRP - , 0 <= copiedLength - , -1, E_SYSTEM, "[E_SYSTEM] Fail to string copy."); + SysTryReturn(NID_GRP, 0 <= copiedLength, -1, E_SYSTEM, "[E_SYSTEM] Fail to string copy."); pSrcText = (wchar_t*)pSimpleText->GetText(); result r = TextUtility::CopyText(pDstText, pSrcText, copiedLength); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , -1, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); pDstText += copiedLength; totalLength += copiedLength; @@ -944,9 +1011,7 @@ TextObject::SetFirstDisplayLineIndex(int lineIndex) __pTextColumn->SetFirstDisplayLineIndex(lineIndex); pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryCatch(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryCatch(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); lineBounds = pTextLine->GetBounds(); firstDisplayPositionY = lineBounds.y; @@ -969,7 +1034,7 @@ TextObject::SetFirstDisplayPositionY(int lcY) result r = E_SUCCESS; - int pcY = _ResUtil::ConvertToPhyCoord(lcY); + int pcY = _Text::ConvertToPhyCoord(lcY); if (IsPartialComposingModeEnabled()) { __isFirstDisplayPositionYChanged = true; @@ -979,9 +1044,7 @@ TextObject::SetFirstDisplayPositionY(int lcY) __pCompositeText->SetComposePartialLimitHeight(pcY + __pcRect.height - GetTotalComposedHeight()); r = Compose(); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } } @@ -995,6 +1058,12 @@ CATCH: return r; } +result +TextObject::SetFirstDisplayPositionY(float lcY) +{ + return SetFirstDisplayPositionY(_CoordinateSystemUtils::ConvertToInteger(lcY)); +} + int TextObject::GetMaxLineHeight(void) const { @@ -1002,25 +1071,27 @@ TextObject::GetMaxLineHeight(void) const int pcMaxHeight = __pCompositeText->GetMaxLineHeight(); pcMaxHeight = Math::Max(pcMaxHeight, TextUtility::GetFontMaxHeight(__pDefaultFont)); - int lcMaxHeight = _ResUtil::ConvertToVirCoord(pcMaxHeight); + int lcMaxHeight = _Text::ConvertToVirCoord(pcMaxHeight); return lcMaxHeight; } +float +TextObject::GetMaxLineHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetMaxLineHeight()); +} + bool TextObject::IsDisplayedAtStartPosition(void) const { IF_NOT_CONSTRUCTED(return false); int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); - if (firstDisplayPositionY == 0) - { - return true; - } - else - { - return false; - } + + bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0) ? true : false; + + return isDisplayedAtStartPosition; } bool @@ -1034,14 +1105,9 @@ TextObject::IsDisplayedAtEndPosition(void) const firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); totalHeight = __pTextColumn->GetTotalHeight(); - if ((totalHeight - firstDisplayPositionY) <= __pcRect.height) - { - return true; - } - else - { - return false; - } + bool isDisplayedAtEndPosition = ((totalHeight - firstDisplayPositionY) <= __pcRect.height) ? true : false; + + return isDisplayedAtEndPosition; } result @@ -1049,8 +1115,7 @@ TextObject::SetAction(TextObjectActionType action) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , TEXT_OBJECT_ACTION_TYPE_NONE <= action && action < TEXT_OBJECT_ACTION_TYPE_MAX + SysTryReturn(NID_GRP, TEXT_OBJECT_ACTION_TYPE_NONE <= action && action < TEXT_OBJECT_ACTION_TYPE_MAX , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); if (__action != action) @@ -1067,14 +1132,9 @@ TextObject::SetAction(TextObjectActionType action) UpdateChangedInfo(0, 0); } } - if (__action == TEXT_OBJECT_ACTION_TYPE_ABBREV) - { - __pCompositeText->SetTextAbbreviationEnabled(true); - } - else - { - __pCompositeText->SetTextAbbreviationEnabled(false); - } + + bool isAbbreviationEnable = (__action == TEXT_OBJECT_ACTION_TYPE_ABBREV) ? true : false; + __pCompositeText->SetTextAbbreviationEnabled(isAbbreviationEnable); return E_SUCCESS; } @@ -1084,8 +1144,7 @@ TextObject::SetAlignment(TextObjectAlignment alignment) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , TEXT_OBJECT_ALIGNMENT_LEFT <= alignment && alignment < TEXT_OBJECT_ALIGNMENT_INVALID + SysTryReturn(NID_GRP, TEXT_OBJECT_ALIGNMENT_LEFT <= alignment && alignment < TEXT_OBJECT_ALIGNMENT_INVALID , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. alignment(%d)", alignment); if (__align != alignment) @@ -1102,9 +1161,8 @@ TextObject::SetBounds(const Rectangle& lcRect) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , (lcRect.width >= 0) && (lcRect.height >= 0) - , E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", lcRect.width, lcRect.height); + SysTryReturn(NID_GRP, (lcRect.width >= 0) && (lcRect.height >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE + , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", lcRect.width, lcRect.height); if (__rect.width != lcRect.width) { @@ -1115,17 +1173,16 @@ TextObject::SetBounds(const Rectangle& lcRect) if (_ResUtil::NeedToConvertCoord()) { - __pcRect.x = _ResUtil::ConvertToPhyCoord(__rect.x); - __pcRect.y = _ResUtil::ConvertToPhyCoord(__rect.y); - __pcRect.width = _ResUtil::ConvertToPhyCoordWidth(__rect.width); + __pcRect.x = _Text::ConvertToPhyCoord(__rect.x); + __pcRect.y = _Text::ConvertToPhyCoord(__rect.y); + __pcRect.width = _Text::ConvertToPhyCoordWidth(__rect.width); - // temporary code for tizen 2.0 - if (_Screen::GetWidth() == 600) + if (_Screen::GetWidth() == 600 || _Screen::GetWidth() == 1280 || _Screen::GetWidth() == 1920 || _Screen::GetWidth() == 2560) { __pcRect.width++; } - __pcRect.height = _ResUtil::ConvertToPhyCoordHeight(__rect.height); + __pcRect.height = _Text::ConvertToPhyCoordHeight(__rect.height); } else { @@ -1136,15 +1193,19 @@ TextObject::SetBounds(const Rectangle& lcRect) } result +TextObject::SetBounds(const FloatRectangle& lcRect) +{ + return SetBounds(_CoordinateSystemUtils::ConvertToInteger(lcRect)); +} + +result TextObject::SetLineSpace(int lcLineSpacing) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , lcLineSpacing >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, lcLineSpacing >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - int pcLineSpacing = _ResUtil::ConvertToPhyCoord(lcLineSpacing); + int pcLineSpacing = _Text::ConvertToPhyCoord(lcLineSpacing); if (__pCompositeText->GetLineSpace() != pcLineSpacing) { @@ -1156,12 +1217,17 @@ TextObject::SetLineSpace(int lcLineSpacing) } result +TextObject::SetLineSpace(float lcLineSpacing) +{ + return SetLineSpace(_CoordinateSystemUtils::ConvertToInteger(lcLineSpacing)); +} +result TextObject::SetElementVerticalAlignment(TextObjectAlignment alignment) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); SysTryReturn(NID_GRP - , (alignment & TEXT_OBJECT_ALIGNMENT_TOP) || (alignment & TEXT_OBJECT_ALIGNMENT_MIDDLE) || (alignment & TEXT_OBJECT_ALIGNMENT_BOTTOM) || (alignment & TEXT_OBJECT_ALIGNMENT_BASELINE) + , (alignment & TEXT_OBJECT_ALIGNMENT_TOP) || (alignment & TEXT_OBJECT_ALIGNMENT_MIDDLE) || (alignment & TEXT_OBJECT_ALIGNMENT_BOTTOM) || (alignment & TEXT_OBJECT_ALIGNMENT_BASELINE) , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. alignment(%d)", alignment); if (__pCompositeText->GetElementVerticalAlignment() == alignment) @@ -1182,19 +1248,22 @@ TextObject::GetTextExtent(int startTextIndex, int textLength) const Dimension pcTextSize; result r = __pCompositeText->GetRegion(startTextIndex, textLength, pcTextSize.width, pcTextSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , Dimension(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, Dimension(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r)); Dimension lcTextSize; - lcTextSize.width = _ResUtil::ConvertToVirCoord(pcTextSize.width); - lcTextSize.height = _ResUtil::ConvertToVirCoord(pcTextSize.height); - + lcTextSize.width = _Text::ConvertToVirCoord(pcTextSize.width); + lcTextSize.height = _Text::ConvertToVirCoord(pcTextSize.height); SetLastResult(E_SUCCESS); return lcTextSize; } +FloatDimension +TextObject::GetTextExtentF(int startTextIndex, int textLength) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent(startTextIndex,textLength)); +} + result TextObject::AppendElement(TextElement& textElement) { @@ -1241,9 +1310,7 @@ TextObject::AppendElement(TextElement& textElement) int elementTextLength = textElement.GetTextLength(); r = __pCompositeText->AppendElement(textElement); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); int elementCount = __pCompositeText->GetElementCount(); if (elementCount > 0) @@ -1309,9 +1376,7 @@ TextObject::InsertElementAt(int textIndex, TextElement& textElement) } r = __pCompositeText->InsertElementAt(textElement, textIndex); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Fail to insert element.", GetErrorMessage(r)); int elementIndex = __pCompositeText->GetElementIndexOf(textElement); if (elementIndex != -1) @@ -1337,14 +1402,10 @@ TextObject::RemoveAll(bool deallocate) IF_NOT_CONSTRUCTED(return E_INVALID_STATE); result r = __pTextColumn->RemoveAllLines(); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); r = __pCompositeText->RemoveAllElements(deallocate); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); UpdateChangedInfo(0); @@ -1354,6 +1415,24 @@ TextObject::RemoveAll(bool deallocate) } result +TextObject::Remove(int startTextIndex, int textLength) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + result r = __pTextColumn->RemoveAllLines(); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pCompositeText->Remove(startTextIndex, textLength); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + UpdateChangedInfo(0); + + return r; +} + +result TextObject::RemoveElement(TextElement& textElement, bool deallocate) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); @@ -1365,9 +1444,7 @@ TextObject::RemoveElement(TextElement& textElement, bool deallocate) TextElement* pCurrentTextElement = null; elementIndex = __pCompositeText->GetElementIndexOf(textElement); - SysTryReturn(NID_GRP - , 0 <= elementIndex - , E_INVALID_ARG, E_INVALID_ARG, "[E_SYSTEM] The argument is invalid."); + SysTryReturn(NID_GRP, 0 <= elementIndex, E_INVALID_ARG, E_INVALID_ARG, "[E_SYSTEM] The argument is invalid."); for (int i = 0; i < elementIndex; i++) { @@ -1381,9 +1458,7 @@ TextObject::RemoveElement(TextElement& textElement, bool deallocate) elementTextLength = textElement.GetTextLength(); r = __pCompositeText->RemoveElementAt(elementIndex, deallocate); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); NotifyTextDeleted(textIndex, elementTextLength); @@ -1406,11 +1481,8 @@ TextObject::GetElementAtTextIndex(int textIndex) const int elementIndex = 0; int elementOffset = 0; - pTextElement = __pCompositeText->GetElementAtTextIndex(textIndex, elementOffset, elementIndex, elementTextLength, - textIndexFromElementOffset); - SysTryCatch(NID_GRP - , pTextElement - , , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + pTextElement = __pCompositeText->GetElementAtTextIndex(textIndex, elementOffset, elementIndex, elementTextLength,textIndexFromElementOffset); + SysTryCatch(NID_GRP, pTextElement, , E_SYSTEM, "[E_SYSTEM] Fail to get text element."); SetLastResult(E_SUCCESS); return pTextElement; @@ -1426,35 +1498,23 @@ TextObject::SetFont(Font* pFont, int startTextIndex, int textLength) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , pFont - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - SysTryReturn(NID_GRP - , startTextIndex >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pFont, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; Font* pTmpFont = null; pTmpFont = _FontImpl::CloneN(const_cast < Font& >(*pFont)); r = GetLastResult(); - SysTryReturn(NID_GRP - , pTmpFont - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pTmpFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + Release(__pDefaultFont); - if (__pDefaultFont) - { - delete __pDefaultFont; - __pDefaultFont = null; - } __pDefaultFont = pTmpFont; __pCompositeText->SetRange(startTextIndex, textLength); r = __pCompositeText->SetFont(pFont); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); UpdateChangedInfo(__pCompositeText->GetWorkStart(), 0); @@ -1477,36 +1537,37 @@ TextObject::GetFont(int textIndex) const } result -TextObject::SetForegroundColor(const Color& color, int startTextIndex, int textLength) +TextObject::SetDefaultFontSize(int size) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , startTextIndex >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - - __defaultForegroundColor = color; - - __pCompositeText->SetRange(startTextIndex, textLength); - __pCompositeText->SetForegroundColor(color); + _FontImpl::GetInstance(*__pDefaultFont)->SetSize(size); return E_SUCCESS; } -Color -TextObject::GetForegroundColor(int textIndex) const +result +TextObject::SetDefaultFontSize(float size) { - IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); + return SetDefaultFontSize(_CoordinateSystemUtils::ConvertToInteger(size)); +} - SysTryReturn(NID_GRP - , textIndex >= 0 - , __defaultForegroundColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); +int +TextObject::GetDefaultFontSize(void) const +{ + IF_NOT_CONSTRUCTED(return -1); - return __pCompositeText->GetForegroundColor(textIndex); + return _FontImpl::GetInstance(*__pDefaultFont)->GetSize(); +} + +float +TextObject::GetDefaultFontSizeF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetDefaultFontSize()); } result -TextObject::SetBackgroundColor(const Color& color, int startTextIndex, int textLength) +TextObject::SetFontSize(int size, int startTextIndex, int textLength) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); @@ -1514,28 +1575,57 @@ TextObject::SetBackgroundColor(const Color& color, int startTextIndex, int textL , startTextIndex >= 0 , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - __defaultBackgroundColor = color; - __pCompositeText->SetRange(startTextIndex, textLength); - __pCompositeText->SetBackgroundColor(color); + __pCompositeText->SetFontSize(size); + UpdateChangedInfo(0, 0); return E_SUCCESS; } -Color -TextObject::GetBackgroundColor(int textIndex) const +result +TextObject::SetFontSize(float size, int startTextIndex, int textLength) { - IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); + return SetFontSize(_CoordinateSystemUtils::ConvertToInteger(size),startTextIndex,textLength); +} + +int +TextObject::GetFontSize(int textIndex) const +{ + IF_NOT_CONSTRUCTED(return -1); SysTryReturn(NID_GRP , textIndex >= 0 - , __defaultBackgroundColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - return __pCompositeText->GetBackgroundColor(textIndex); + return __pCompositeText->GetFontSize(textIndex); +} + +float +TextObject::GetFontSizeF(int textIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetFontSize(textIndex)); } result -TextObject::SetOutlineColor(const Color& color, int startTextIndex, int textLength) +TextObject::SetDefaultFontStyle(int style) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + _FontImpl::GetInstance(*__pDefaultFont)->SetStyle(style); + + return E_SUCCESS; +} + +int +TextObject::GetDefaultFontStyle(void) const +{ + IF_NOT_CONSTRUCTED(return FONT_STYLE_MIN); + + return _FontImpl::GetInstance(*__pDefaultFont)->GetStyle(); +} + +result +TextObject::SetFontStyle(int style, int startTextIndex, int textLength) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); @@ -1543,6 +1633,100 @@ TextObject::SetOutlineColor(const Color& color, int startTextIndex, int textLeng , startTextIndex >= 0 , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + __pCompositeText->SetRange(startTextIndex, textLength); + __pCompositeText->SetFontStyle(style); + UpdateChangedInfo(0, 0); + + return E_SUCCESS; +} + +int +TextObject::GetFontStyle(int textIndex) const +{ + IF_NOT_CONSTRUCTED(return -1); + + SysTryReturn(NID_GRP + , textIndex >= 0 + , FONT_STYLE_MIN, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + return __pCompositeText->GetFontStyle(textIndex); +} + +result +TextObject::SetDefaultForegroundColor(const Color& color) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + __defaultForegroundColor = color; + + return E_SUCCESS; +} + +Color +TextObject::GetDefaultForegroundColor(void) const +{ + IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); + + return __defaultForegroundColor; +} + +result +TextObject::SetForegroundColor(const Color& color, int startTextIndex, int textLength) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + __defaultForegroundColor = color; + + __pCompositeText->SetRange(startTextIndex, textLength); + __pCompositeText->SetForegroundColor(color); + + return E_SUCCESS; +} + +Color +TextObject::GetForegroundColor(int textIndex) const +{ + IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); + + SysTryReturn(NID_GRP, textIndex >= 0, __defaultForegroundColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + return __pCompositeText->GetForegroundColor(textIndex); +} + +result +TextObject::SetBackgroundColor(const Color& color, int startTextIndex, int textLength) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + __defaultBackgroundColor = color; + + __pCompositeText->SetRange(startTextIndex, textLength); + __pCompositeText->SetBackgroundColor(color); + + return E_SUCCESS; +} + +Color +TextObject::GetBackgroundColor(int textIndex) const +{ + IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); + + SysTryReturn(NID_GRP, textIndex >= 0, __defaultBackgroundColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + return __pCompositeText->GetBackgroundColor(textIndex); +} + +result +TextObject::SetOutlineColor(const Color& color, int startTextIndex, int textLength) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + __defaultOutlineColor = color; __pCompositeText->SetRange(startTextIndex, textLength); @@ -1556,9 +1740,7 @@ TextObject::GetOutlineColor(int textIndex) const { IF_NOT_CONSTRUCTED(return Color::GetColor(COLOR_ID_BLACK)); - SysTryReturn(NID_GRP - , textIndex >= 0 - , __defaultOutlineColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textIndex >= 0, __defaultOutlineColor, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); return __pCompositeText->GetOutlineColor(textIndex); } @@ -1582,21 +1764,39 @@ TextObject::GetBlockColor(void) const } result -TextObject::SetWrap(TextObjectWrapType wrap) +TextObject::SetDisplayBitmap(const Bitmap* pBitmap, int startTextIndex, int textLength) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - result r = E_SUCCESS; + SysTryReturn(NID_GRP, startTextIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + + __pCompositeText->SetRange(startTextIndex, textLength); + __pCompositeText->SetDisplayBitmap(pBitmap); + UpdateChangedInfo(0, 0); + + return E_SUCCESS; +} + +const Bitmap* +TextObject::GetDisplayBitmap(int textIndex) const +{ + IF_NOT_CONSTRUCTED(return null); + + return __pCompositeText->GetDisplayBitmap(textIndex); +} + +result +TextObject::SetWrap(TextObjectWrapType wrap) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); if (__wrap == wrap) { return E_SUCCESS; } - r = __pCompositeText->SetWrap(wrap); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + result r = __pCompositeText->SetWrap(wrap); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __wrap = wrap; UpdateChangedInfo(0, 0); @@ -1609,18 +1809,12 @@ TextObject::InsertElementAt(int textIndex, Bitmap& bitmap, TextElementSourceType { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - TextImage* pImageText = null; - int addedTextLength = 0; - int startTextIndex = 0; - - pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP)); - SysTryReturn(NID_GRP - , pImageText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP)); + SysTryReturn(NID_GRP, pImageText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); - addedTextLength = pImageText->GetTextLength(); + int addedTextLength = pImageText->GetTextLength(); __pCompositeText->InsertElementAt(*pImageText, textIndex); - startTextIndex = __pCompositeText->GetWorkStart(); + int startTextIndex = __pCompositeText->GetWorkStart(); NotifyTextAdded(startTextIndex, addedTextLength); return E_SUCCESS; @@ -1632,17 +1826,11 @@ TextObject::AppendElement(Bitmap& bitmap, TextElementSourceType sourceType) IF_NOT_CONSTRUCTED(return E_INVALID_STATE); result r = E_SUCCESS; - TextImage* pImageText = null; - - pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP)); - SysTryReturn(NID_GRP - , pImageText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP)); + SysTryReturn(NID_GRP, pImageText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); r = __pCompositeText->AppendElement(*pImageText); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); int startTextIndex = __pCompositeText->GetWorkStart(); int elementTextLength = pImageText->GetTextLength(); @@ -1657,11 +1845,10 @@ TextObject::SetAlternateLookEnabled(bool enable) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - int elementCount = 0; TextElement* pTextElement = null; __isAlternateLookEnabled = enable; - elementCount = __pCompositeText->GetElementCount(); + int elementCount = __pCompositeText->GetElementCount(); for (int i = 0; i < elementCount; i++) { @@ -1680,17 +1867,13 @@ TextObject::SetAlternativeForegroundColor(const Color& color) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - int elementCount = 0; TextElement* pTextElement = null; - - elementCount = __pCompositeText->GetElementCount(); + int elementCount = __pCompositeText->GetElementCount(); for (int i = 0; i < elementCount; i++) { pTextElement = __pCompositeText->GetElementAtElementIndex(i); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); pTextElement->SetAlternativeForegroundColor(color); } @@ -1712,14 +1895,10 @@ TextObject::ChangeTextOffset(wchar_t* pText, int textIndex, int gap) TextElement* pTextElement = __pCompositeText->GetElementAtTextIndex(textIndex, elementStartTextIndex, elementIndex, elementTextLength, textIndexFromElementOffset); - SysTryReturn(NID_GRP - , pTextElement - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); + SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element."); r = __pCompositeText->ChangeTextOffset(pText, elementIndex, gap); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } @@ -1730,16 +1909,11 @@ TextObject::NotifyTextChanged(wchar_t* pText, int textOffset, int textLength, in IF_NOT_CONSTRUCTED(return E_INVALID_STATE); result r = E_SUCCESS; - int startTextIndex = 0; - + int startTextIndex = __pCompositeText->GetWorkStart(); r = __pCompositeText->NotifyTextChanged(pText, textOffset, textLength, gap, __pDefaultFont, __defaultForegroundColor, __defaultBackgroundColor, __defaultOutlineColor); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , E_SYSTEM, "[E_SYSTEM] Fail to update change information."); - - startTextIndex = __pCompositeText->GetWorkStart(); + SysTryCatch(NID_GRP, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Fail to update change information."); if (__wrap != TEXT_OBJECT_WRAP_TYPE_NONE) { @@ -1799,8 +1973,8 @@ TextObject::GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode) const return -1; } - int pcX = _ResUtil::ConvertToPhyCoord(lcX); - int pcY = _ResUtil::ConvertToPhyCoord(lcY); + int pcX = _Text::ConvertToPhyCoord(lcX); + int pcY = _Text::ConvertToPhyCoord(lcY); if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) { @@ -1813,20 +1987,22 @@ TextObject::GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode) const } int +TextObject::GetTextIndexFromPosition(float lcX, float lcY, bool cursorMode) const +{ + return GetTextIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(lcX), _CoordinateSystemUtils::ConvertToInteger(lcY), cursorMode); +} + +int TextObject::GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMode) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); - int pcX = _ResUtil::ConvertToPhyCoord(lcX); + int pcX = _Text::ConvertToPhyCoord(lcX); int lineOffset = pTextLine->GetTextOffset(); int lineLength = pTextLine->GetTextLength(); int length = 0; @@ -1849,11 +2025,99 @@ TextObject::GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMo break; } - if (pcX < 0) + pcX = (pcX < 0) ? 0 : pcX; + __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); + + int endType = 0; + + if (cursorMode) { - pcX = 0; + __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, pcX, length, objectType); + } + else + { + endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, pcX, length); + } + + __pCompositeText->SetWrap(__wrap); + + if (!cursorMode) + { + if (endType == -1) + { + return -1; + } + } + + int index = pTextLine->GetTextOffset() + length; + if (pTextLine->GetEndType() == TEXT_RETBY_LINEFEED && lineLength == length && pTextLine->GetTextOffset() < index) + { + index--; + } + + if (index != GetTextLength() && index == lineOffset + lineLength) + { + TextElement* pTextElement = GetElementAtTextIndex(index-1); + if (pTextElement != null) + { + const TextSimple* pSimpleText = dynamic_cast (pTextElement); + if (pSimpleText != null) + { + const wchar_t* pText = pSimpleText->GetText(); + SysTryReturn(NID_GRP, pText, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + + int i = index - 1 - pSimpleText->GetTextOffset(); + SysTryReturn(NID_GRP, i >= 0 && i < pSimpleText->GetTextLength(), -1, E_OUT_OF_RANGE + , "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",i, pSimpleText->GetTextLength()); + + if (pText[i] == L' ') + { + index--; + } + } + } + } + + SetLastResult(E_SUCCESS); + + return index; +} + +int +TextObject::GetTextIndexFromPositionAtLine(int lineIndex, float lcX, bool cursorMode) const +{ + IF_NOT_CONSTRUCTED(return -1); + + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + + TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + lcX = _CoordinateSystemUtils::ConvertToInteger(lcX); + int pcX = _Text::ConvertToPhyCoord(lcX); + int lineOffset = pTextLine->GetTextOffset(); + int lineLength = pTextLine->GetTextLength(); + int length = 0; + TextElementType objectType; + Rectangle lineBounds = pTextLine->GetBounds(); + Dimension lineTextSize; + pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); + + switch (__align & TEXT_ALIGNMASK_HORIZ) + { + case TEXT_OBJECT_ALIGNMENT_LEFT: + break; + + case TEXT_OBJECT_ALIGNMENT_CENTER: + pcX -= (lineBounds.width - lineTextSize.width) / 2; + break; + + case TEXT_OBJECT_ALIGNMENT_RIGHT: + pcX -= (lineBounds.width - lineTextSize.width); + break; } + pcX = (pcX < 0) ? 0 : pcX; __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); int endType = 0; @@ -1892,14 +2156,11 @@ TextObject::GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMo if (pSimpleText != null) { const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text."); + SysTryReturn(NID_GRP, pText, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text."); int i = index - 1 - pSimpleText->GetTextOffset(); - SysTryReturn(NID_GRP - , i >= 0 && i < pSimpleText->GetTextLength() - , -1, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",i, pSimpleText->GetTextLength()); + SysTryReturn(NID_GRP, i >= 0 && i < pSimpleText->GetTextLength(), -1, E_OUT_OF_RANGE + , "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",i, pSimpleText->GetTextLength()); if (pText[i] == L' ') { @@ -1956,8 +2217,8 @@ TextObject::GetCutLinkIndexFromPositionData(int lcX, int lcY) const } int textIndex = 0; - int pcX = _ResUtil::ConvertToPhyCoord(lcX); - int pcY = _ResUtil::ConvertToPhyCoord(lcY); + int pcX = _Text::ConvertToPhyCoord(lcX); + int pcY = _Text::ConvertToPhyCoord(lcY); if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) { @@ -1985,17 +2246,18 @@ TextObject::GetCutLinkIndexFromPositionData(int lcX, int lcY) const { r = GetTextPositionInfoInWrapAt(textIndex, width, height, absPoint.x, absPoint.y, relPoint.x, relPoint.y); } - SysTryReturn(NID_GRP - , r == E_SUCCESS - , -1, r, "[%s] Propagating.", GetErrorMessage(r)); - - SysTryReturn(NID_GRP - , pcY + __pcRect.y >= relPoint.y - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text position information"); + SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pcY + __pcRect.y >= relPoint.y, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text position information"); return __pCompositeText->GetCutLinkElementIndexAt(textIndex); } +int +TextObject::GetCutLinkIndexFromPositionData(float lcX, float lcY) const +{ + return GetCutLinkIndexFromPositionData(_CoordinateSystemUtils::ConvertToInteger(lcX), _CoordinateSystemUtils::ConvertToInteger(lcY)); +} + TextElement* TextObject::GetCutLinkElementAtCutLinkElementIndex(int linkIndex) const { @@ -2009,9 +2271,8 @@ TextObject::SetCutLinkColor(LinkType linkType, const Color& color, const Color& { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , LINK_TYPE_NONE < linkType && linkType < LINK_TYPE_MAX - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, LINK_TYPE_NONE < linkType && linkType < LINK_TYPE_MAX, E_INVALID_ARG, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid."); switch (linkType) { @@ -2041,9 +2302,7 @@ TextObject::SetCutLinkColor(LinkType linkType, const Color& color, const Color& for (int i = 0; i < totalCutlinkTextCount; i++) { TextCutLink* pCutlinkText = dynamic_cast < TextCutLink* >(__pCompositeText->GetCutLinkElementAtCutLinkElementIndex(i)); - SysTryReturn(NID_GRP - , pCutlinkText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to convert to cutlink element."); + SysTryReturn(NID_GRP, pCutlinkText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to convert to cutlink element."); if (pCutlinkText->GetCutLinkType() == linkType) { @@ -2059,9 +2318,7 @@ TextObject::ResetCutLinkColor(LinkType linkType) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , LINK_TYPE_NONE < linkType && linkType < LINK_TYPE_MAX - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, LINK_TYPE_NONE < linkType && linkType < LINK_TYPE_MAX, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); switch (linkType) { @@ -2085,9 +2342,7 @@ TextObject::ResetCutLinkColor(LinkType linkType) for (int i = 0; i < totalCutlinkTextCount; i++) { TextCutLink* pCutlinkText = dynamic_cast < TextCutLink* >(__pCompositeText->GetCutLinkElementAtCutLinkElementIndex(i)); - SysTryReturn(NID_GRP - , pCutlinkText - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to convert to cutlink element."); + SysTryReturn(NID_GRP, pCutlinkText, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to convert to cutlink element."); if (pCutlinkText->GetCutLinkType() == linkType) { @@ -2111,33 +2366,23 @@ TextObject::GetCutLinkBounds(int cutLinkIndex, Point& startPoint, Point& endPoin Point tempPoint; r = __pCompositeText->GetCutLinkObjectInfo(cutLinkIndex, textIndex, textLength); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) { r = GetTextPositionInfoInNoneWrapAt(textIndex, width, heigth, tempPoint.x, tempPoint.y, startPoint.x, startPoint.y); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = GetTextPositionInfoInNoneWrapAt(textIndex + textLength - 1, width, heigth, tempPoint.x, tempPoint.y, endPoint.x, endPoint.y); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } else { r = GetTextPositionInfoInWrapAt(textIndex, width, heigth, tempPoint.x, tempPoint.y, startPoint.x, startPoint.y); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = GetTextPositionInfoInWrapAt(textIndex + textLength - 1, width, heigth, tempPoint.x, tempPoint.y, endPoint.x, endPoint.y); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } endPoint.x = endPoint.x + width; @@ -2145,10 +2390,10 @@ TextObject::GetCutLinkBounds(int cutLinkIndex, Point& startPoint, Point& endPoin if (_ResUtil::NeedToConvertCoord()) { - startPoint.x = _ResUtil::ConvertToVirCoord(startPoint.x); - startPoint.y = _ResUtil::ConvertToVirCoord(startPoint.y); - endPoint.x = _ResUtil::ConvertToVirCoord(endPoint.x); - endPoint.y = _ResUtil::ConvertToVirCoord(endPoint.y); + startPoint.x = _Text::ConvertToVirCoord(startPoint.x); + startPoint.y = _Text::ConvertToVirCoord(startPoint.y); + endPoint.x = _Text::ConvertToVirCoord(endPoint.x); + endPoint.y = _Text::ConvertToVirCoord(endPoint.y); } return E_SUCCESS; @@ -2163,6 +2408,19 @@ CATCH: } result +TextObject::GetCutLinkBounds(int cutLinkIndex, FloatPoint& startPoint, FloatPoint& endPoint) const +{ + Point newStartPoint = _CoordinateSystemUtils::ConvertToInteger(startPoint); + Point newEndPoint = _CoordinateSystemUtils::ConvertToInteger(endPoint); + result r = GetCutLinkBounds(cutLinkIndex, newStartPoint, newEndPoint); + + startPoint = _CoordinateSystemUtils::ConvertToFloat(newStartPoint); + endPoint = _CoordinateSystemUtils::ConvertToFloat(newEndPoint); + + return r; +} + +result TextObject::GetTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); @@ -2173,9 +2431,7 @@ TextObject::GetTextPositionInfoAt(int textIndex, int& width, int& height, int& a if (lineCount < 1) { _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); int maxHeight = TextUtility::GetFontMaxHeight(pFont); int posX = 0; @@ -2246,40 +2502,174 @@ TextObject::GetTextPositionInfoAt(int textIndex, int& width, int& height, int& a } else { - if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) - { - r = GetTextPositionInfoInNoneWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY); - } - else - { - r = GetTextPositionInfoInWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY); - } - - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) ? GetTextPositionInfoInNoneWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY) + : GetTextPositionInfoInWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } if (_ResUtil::NeedToConvertCoord()) { - width = _ResUtil::ConvertToVirCoord(width); - height = _ResUtil::ConvertToVirCoord(height); - absX = _ResUtil::ConvertToVirCoord(absX); - absY = _ResUtil::ConvertToVirCoord(absY); - logicalX = _ResUtil::ConvertToVirCoord(logicalX); - logicalY = _ResUtil::ConvertToVirCoord(logicalY); + width = _Text::ConvertToVirCoord(width); + height = _Text::ConvertToVirCoord(height); + absX = _Text::ConvertToVirCoord(absX); + absY = _Text::ConvertToVirCoord(absY); + logicalX = _Text::ConvertToVirCoord(logicalX); + logicalY = _Text::ConvertToVirCoord(logicalY); } return E_SUCCESS; } result -TextObject::SetTextObjectEllipsisType(TextObjectEllipsisType type) +TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const { - IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX); + int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY); + int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX); + int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY); + + result r = GetTextPositionInfoAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newHeight); + absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX); + absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY); + logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX); + logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY); - SysTryReturn(NID_GRP - , TEXT_OBJECT_ELLIPSIS_TYPE_INVALID < type && type < TEXT_OBJECT_ELLIPSIS_TYPE_MAX + return r; +} + +result +TextObject::GetBlockTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + result r = E_SUCCESS; + int lineCount = __pTextColumn->GetTotalLineCount(); + + if (lineCount < 1) + { + _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + int maxHeight = TextUtility::GetFontMaxHeight(pFont); + + int posX = 0; + int posY = 0; + absX = 0; + absY = 0; + + if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) + { + switch (__align & TEXT_ALIGNMASK_VERT) + { + case TEXT_OBJECT_ALIGNMENT_TOP: + break; + + case TEXT_OBJECT_ALIGNMENT_MIDDLE: + posY += (__pcRect.height - maxHeight) / 2; + break; + + case TEXT_OBJECT_ALIGNMENT_BOTTOM: + posY += (__pcRect.height - maxHeight); + break; + } + logicalY = __pcRect.y + posY; + + switch (__align & TEXT_ALIGNMASK_HORIZ) + { + case TEXT_OBJECT_ALIGNMENT_LEFT: + break; + + case TEXT_OBJECT_ALIGNMENT_CENTER: + posX += __pcRect.width / 2; + break; + + case TEXT_OBJECT_ALIGNMENT_RIGHT: + posX += __pcRect.width; + break; + } + logicalX = __pcRect.x + posX; + } + else + { + int lineHeight = maxHeight + __pCompositeText->GetLineSpace(); + TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); + switch (alignment & TEXT_ALIGNMASK_VERT) + { + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + break; + + case TEXT_OBJECT_ALIGNMENT_MIDDLE: + posY += (lineHeight - maxHeight) / 2; + break; + + case TEXT_OBJECT_ALIGNMENT_BOTTOM: + posY += lineHeight - maxHeight; + break; + } + + logicalX = __pcRect.x; + logicalY = posY + __pcRect.y; + } + + width = 0; + height = maxHeight; + absX = posX; + absY = posY; + } + else + { + r = (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE) ? GetTextPositionInfoInNoneWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY) + : GetBlockTextPositionInfoInWrapAt(textIndex, width, height, absX, absY, logicalX, logicalY); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + if (_ResUtil::NeedToConvertCoord()) + { + width = _Text::ConvertToVirCoord(width); + height = _Text::ConvertToVirCoord(height); + absX = _Text::ConvertToVirCoord(absX); + absY = _Text::ConvertToVirCoord(absY); + logicalX = _Text::ConvertToVirCoord(logicalX); + logicalY = _Text::ConvertToVirCoord(logicalY); + } + + return E_SUCCESS; +} + +result +TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX); + int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY); + int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX); + int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY); + + result r = GetBlockTextPositionInfoAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newHeight); + absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX); + absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY); + logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX); + logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY); + + return r; +} + +result +TextObject::SetTextObjectEllipsisType(TextObjectEllipsisType type) +{ + IF_NOT_CONSTRUCTED(return E_INVALID_STATE); + + SysTryReturn(NID_GRP, TEXT_OBJECT_ELLIPSIS_TYPE_INVALID < type && type < TEXT_OBJECT_ELLIPSIS_TYPE_MAX , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); __textObjectEllipsisType = type; @@ -2294,9 +2684,7 @@ TextObject::NotifyTextAdded(int textIndex, int textLength) result r = E_SUCCESS; r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_INSERT, textIndex, textLength); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if ((__pCompositeText->IsWidthManagerEnabled() == true) && (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD)) { @@ -2314,9 +2702,7 @@ TextObject::NotifyTextDeleted(int textIndex, int textLength) result r = E_SUCCESS; r = __pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_REMOVE, textIndex, textLength); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if ((__pCompositeText->IsWidthManagerEnabled() == true) && (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD)) { @@ -2338,6 +2724,12 @@ TextObject::DrawByLine(_CanvasImpl& canvasImpl, const Rectangle& displayRect) return __pTextColumn->Draw(canvasImpl, targetBounds, 0, __pTextColumn->GetTextLength(), __align, __action); } +result +TextObject::DrawByLine(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect) +{ + return DrawByLine(canvasImpl, _CoordinateSystemUtils::ConvertToInteger(displayRect)); +} + int TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) const { @@ -2347,7 +2739,6 @@ TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) co int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); int lineCount = __pTextColumn->GetTotalLineCount(); int lineIndex = 0; - TextElementType objectType; int totalHeight = __pTextColumn->GetTotalHeight(); @@ -2368,9 +2759,7 @@ TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) co for (lineIndex = firstDisplayLineIndex; lineIndex < lineCount; lineIndex++) { pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); @@ -2400,13 +2789,9 @@ TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) co } } - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); - int lineOffset = pTextLine->GetTextOffset(); int lineLength = pTextLine->GetTextLength(); - int length = 0; Dimension lineTextSize; pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); @@ -2429,60 +2814,7 @@ TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) co pcX = 0; } - __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - - int endType = 0; - - if (cursorMode) - { - __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, pcX, length, objectType); - } - else - { - endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, pcX, length); - } - - __pCompositeText->SetWrap(__wrap); - - if (!cursorMode) - { - if (endType == -1) - { - return -1; - } - } - - int index = pTextLine->GetTextOffset() + length; - if (pTextLine->GetEndType() == TEXT_RETBY_LINEFEED && lineLength == length && pTextLine->GetTextOffset() < index) - { - index--; - } - - if (index != GetTextLength() && index == lineOffset + lineLength) - { - TextElement* pTextElement = GetElementAtTextIndex(index-1); - if (pTextElement != null) - { - const TextSimple* pSimpleText = dynamic_cast (pTextElement); - if (pSimpleText != null) - { - const wchar_t* pText = pSimpleText->GetText(); - SysTryReturn(NID_GRP - , pText - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text."); - - int i = index - 1 - pSimpleText->GetTextOffset(); - SysTryReturn(NID_GRP - , i >= 0 && i < pSimpleText->GetTextLength() - , -1, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",i, pSimpleText->GetTextLength()); - - if (pText[i] == L' ') - { - index--; - } - } - } - } + int index = pTextLine->GetTextIndexFromPosition(pcX, cursorMode); SetLastResult(E_SUCCESS); @@ -2490,7 +2822,13 @@ TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) co } int -TextObject::GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode) const +TextObject::GetTextIndexFromPositionInWrap(float pcX, float pcY, bool cursorMode) const +{ + return GetTextIndexFromPositionInWrap(_CoordinateSystemUtils::ConvertToInteger(pcX), _CoordinateSystemUtils::ConvertToInteger(pcY), cursorMode); +} + +int +TextObject::GetTextIndexFromPositionInNoneWrap(int pcX, int pcY, bool cursorMode) const { Dimension lineTextSize; Rectangle lineBounds; @@ -2499,9 +2837,7 @@ TextObject::GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode) co TextLine* pTextLine = null; pTextLine = __pTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineOffset = pTextLine->GetTextOffset(); lineLength = pTextLine->GetTextLength(); @@ -2514,11 +2850,11 @@ TextObject::GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode) co break; case TEXT_OBJECT_ALIGNMENT_CENTER: - x -= (lineBounds.width - lineTextSize.width) / 2; + pcX -= (lineBounds.width - lineTextSize.width) / 2; break; case TEXT_OBJECT_ALIGNMENT_RIGHT: - x -= (lineBounds.width - lineTextSize.width); + pcX -= (lineBounds.width - lineTextSize.width); break; } @@ -2528,45 +2864,29 @@ TextObject::GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode) co break; case TEXT_OBJECT_ALIGNMENT_MIDDLE: - y -= (__pcRect.height - lineTextSize.height) / 2; + pcY -= (__pcRect.height - lineTextSize.height) / 2; break; case TEXT_OBJECT_ALIGNMENT_BOTTOM: - y -= (__pcRect.height - lineTextSize.height); + pcY -= (__pcRect.height - lineTextSize.height); break; } - if (x < 0) - { - x = 0; - } - - int length = 0; - TextElementType objectType = TEXT_ELEMENT_TYPE_TEXT; - - int endType = 0; - - if (cursorMode) - { - __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, x, length, objectType); - } - else - { - endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, x, length); - } - - if (!cursorMode) + if (pcX < 0) { - if (endType == -1) - { - return -1; - } + pcX = 0; } - lineOffset = length + pTextLine->GetTextOffset(); + int index = pTextLine->GetTextIndexFromPosition(pcX, cursorMode); SetLastResult(E_SUCCESS); - return lineOffset; + return index; +} + +int +TextObject::GetTextIndexFromPositionInNoneWrap(float pcX, float pcY, bool cursorMode) const +{ + return GetTextIndexFromPositionInNoneWrap(_CoordinateSystemUtils::ConvertToInteger(pcX), _CoordinateSystemUtils::ConvertToInteger(pcY), cursorMode); } result @@ -2594,9 +2914,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) } pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); @@ -2608,9 +2926,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) currentLineIndex = firstDisplayLineIndex; pTextLine = __pTextColumn->GetTextLine(currentLineIndex); - SysTryReturn(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); remainingHeight = __pcRect.height; @@ -2624,7 +2940,6 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) lineBounds = pTextLine->GetBounds(); remainingHeight -= lineBounds.height; - displayLineCount++; currentLineIndex++; @@ -2640,9 +2955,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) if (0 < remainingHeight && 0 < firstDisplayLineIndex) { pTextLine = __pTextColumn->GetTextLine(firstDisplayLineIndex - 1); - SysTryReturn(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); while (remainingHeight && pTextLine) { @@ -2672,9 +2985,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) else if (remainingHeight < 0 && (lineIndex == firstDisplayLineIndex + displayLineCount - 1)) { pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); remainingHeight = __pcRect.height; @@ -2711,9 +3022,7 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex) else { pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); @@ -2777,14 +3086,10 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex) Dimension lineTextSize; _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); TextLine* pTextLine = __pTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineOffset = pTextLine->GetTextOffset(); lineLength = pTextLine->GetTextLength(); @@ -2793,85 +3098,247 @@ TextObject::SetFirstDisplayLineIndexFromTextIndexInNoneWrap(int textIndex) lineBounds = pTextLine->GetBounds(); pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); - if (currentTextIndex < pTextLine->GetTextOffset() + 1) + if (currentTextIndex < pTextLine->GetTextOffset() + 1) + { + lineOffset = currentTextIndex; + pTextLine->SetTextOffset(lineOffset); + lineOffset = pTextLine->GetTextOffset(); + if (lineOffset > 0) + { + lineOffset--; + pTextLine->SetTextOffset(lineOffset); + } + + __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width, + __wrap, lineLength, lineTextSize.width, lineTextSize.height); + + lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height); + if (lineBounds.height == 0) + { + lineBounds.height = TextUtility::GetFontMaxHeight(pFont); + } + + pTextLine->SetBounds(lineBounds); + pTextLine->SetRegion(lineTextSize.width, lineTextSize.height); + pTextLine->SetTextLength(lineLength); + __pCompositeText->GetTextExtentList(pTextLine); + } + else if (lineEndIndex <= currentTextIndex) + { + int gapWidth = 0; + int gapHeight = 0; + int textCount = 0; + int tempWidth = 0; + + r = __pCompositeText->GetRegion(lineEndIndex, currentTextIndex - lineEndIndex, gapWidth, gapHeight); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + gapWidth -= lineBounds.width - lineTextSize.width; + + __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, gapWidth, __wrap, + textCount, tempWidth, gapHeight); + + if (tempWidth < gapWidth) + { + lineOffset += (textCount + 1); + } + else + { + lineOffset += textCount; + } + + __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width, + __wrap, lineLength, lineTextSize.width, lineTextSize.height); + + lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height); + if (lineBounds.height == 0) + { + lineBounds.height = TextUtility::GetFontMaxHeight(pFont); + } + + pTextLine->SetBounds(lineBounds); + pTextLine->SetRegion(lineTextSize.width, lineTextSize.height); + pTextLine->SetTextOffset(lineOffset); + pTextLine->SetTextLength(lineLength); + __pCompositeText->GetTextExtentList(pTextLine); + } + + __pTextColumn->SetFirstDisplayLineIndex(0); + __pTextColumn->SetFirstDisplayPositionY(0); + + return E_SUCCESS; +} + +result +TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, + int& logicalX, int& logicalY) const +{ + TextLine* pTextLine = null; + Rectangle lineBounds; + int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); + int lineCount = __pTextColumn->GetTotalLineCount(); + int lineIndex = 0; + int lineOffset = 0; + int lineLength = 0; + int textIndexFromLineOffset = 0; + int lineY = 0; + int posX = 0; + int posY = 0; + + _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + + for (lineIndex = 0; lineIndex < lineCount; lineIndex++) + { + pTextLine = __pTextColumn->GetTextLine(lineIndex); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + lineBounds = pTextLine->GetBounds(); + lineOffset = pTextLine->GetTextOffset(); + lineLength = pTextLine->GetTextLength(); + + if (lineOffset <= textIndex && textIndex < lineOffset + lineLength) + { + break; + } + + if (lineIndex + 1 < lineCount) + { + lineY += lineBounds.height; + } + } + + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + if (lineIndex == lineCount) + { + textIndexFromLineOffset = lineLength; + } + else + { + textIndexFromLineOffset = textIndex - lineOffset; + } + + Dimension lineTextSize; + pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); + + if (lineTextSize.height == 0) + { + lineTextSize.height = TextUtility::GetFontMaxHeight(pFont); + } + + switch (__align & TEXT_ALIGNMASK_HORIZ) + { + case TEXT_OBJECT_ALIGNMENT_LEFT: + break; + + case TEXT_OBJECT_ALIGNMENT_CENTER: + posX += (lineBounds.width - lineTextSize.width) / 2; + break; + + case TEXT_OBJECT_ALIGNMENT_RIGHT: + posX += (lineBounds.width - lineTextSize.width); + break; + } + + switch (__align & TEXT_ALIGNMASK_VERT) { - lineOffset = currentTextIndex; - pTextLine->SetTextOffset(lineOffset); - lineOffset = pTextLine->GetTextOffset(); - if (lineOffset > 0) - { - lineOffset--; - pTextLine->SetTextOffset(lineOffset); - } - - __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width, - __wrap, lineLength, lineTextSize.width, lineTextSize.height); + case TEXT_OBJECT_ALIGNMENT_TOP: + break; - lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height); - if (lineBounds.height == 0) - { - lineBounds.height = TextUtility::GetFontMaxHeight(pFont); - } + case TEXT_OBJECT_ALIGNMENT_MIDDLE: + posY += (__pcRect.height - __pTextColumn->GetDisplayHeight()) / 2; + break; - pTextLine->SetBounds(lineBounds); - pTextLine->SetRegion(lineTextSize.width, lineTextSize.height); - pTextLine->SetTextLength(lineLength); + case TEXT_OBJECT_ALIGNMENT_BOTTOM: + posY += (__pcRect.height - __pTextColumn->GetDisplayHeight()); + break; + } + if (posX < 0) + { + posX = 0; } - else if (lineEndIndex <= currentTextIndex) + + if (posY < 0) { - int gapWidth = 0; - int gapHeight = 0; - int textCount = 0; - int tempWidth = 0; + posY = 0; + } - r = __pCompositeText->GetRegion(lineEndIndex, currentTextIndex - lineEndIndex, gapWidth, gapHeight); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + Rectangle textExtent = pTextLine->GetTextExtent(textIndexFromLineOffset, 1); - gapWidth -= lineBounds.width - lineTextSize.width; + if (lineIndex == lineCount) + { + textExtent.width = 0; + } - __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, gapWidth, __wrap, - textCount, tempWidth, gapHeight); + if (textIndex >= 1) + { + Font* pTextFont = __pCompositeText->GetFont(textIndex - 1); + textExtent.height = TextUtility::GetFontMaxHeight(pTextFont); + } - if (tempWidth < gapWidth) - { - lineOffset += (textCount + 1); - } - else - { - lineOffset += textCount; - } + if (textExtent.height < 0) + { + textExtent.height = TextUtility::GetFontMaxHeight(pFont); + } - __pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width, - __wrap, lineLength, lineTextSize.width, lineTextSize.height); + TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); + switch (alignment & TEXT_ALIGNMASK_VERT) + { + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + break; - lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height); - if (lineBounds.height == 0) - { - lineBounds.height = TextUtility::GetFontMaxHeight(pFont); - } + case TEXT_OBJECT_ALIGNMENT_MIDDLE: + lineY = lineY + (lineBounds.height - textExtent.height) / 2; + break; - pTextLine->SetBounds(lineBounds); - pTextLine->SetRegion(lineTextSize.width, lineTextSize.height); - pTextLine->SetTextOffset(lineOffset); - pTextLine->SetTextLength(lineLength); + case TEXT_OBJECT_ALIGNMENT_BOTTOM: + lineY = lineY + (lineBounds.height - textExtent.height); + break; } - __pTextColumn->SetFirstDisplayLineIndex(0); - __pTextColumn->SetFirstDisplayPositionY(0); + width = textExtent.width; + height = textExtent.height; + absX = posX + textExtent.x; + logicalX = absX + __pcRect.x; + absY = lineY; + logicalY = absY - firstDisplayPositionY + __pcRect.y + posY; return E_SUCCESS; } result -TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, +TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX); + int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY); + int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX); + int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY); + + result r = GetTextPositionInfoInWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newHeight); + absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX); + absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY); + logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX); + logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY); + + return r; +} + +result +TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const { TextLine* pTextLine = null; Rectangle lineBounds; - int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); int lineCount = __pTextColumn->GetTotalLineCount(); int lineIndex = 0; @@ -2883,22 +3350,18 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int posY = 0; _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); for (lineIndex = 0; lineIndex < lineCount; lineIndex++) { pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineBounds = pTextLine->GetBounds(); lineOffset = pTextLine->GetTextOffset(); lineLength = pTextLine->GetTextLength(); - if (lineOffset <= textIndex && textIndex < lineOffset + lineLength) + if (lineOffset <= textIndex && textIndex <= lineOffset + lineLength) { break; } @@ -2909,9 +3372,7 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, } } - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); if (lineIndex == lineCount) { @@ -2968,36 +3429,22 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, posY = 0; } - int length = 0; - int tempWidth = 0; - int tempHeight = 0; - - __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); + Rectangle textExtent = pTextLine->GetBlockTextExtent(textIndexFromLineOffset, 1); - if (0 < textIndexFromLineOffset) + if (lineIndex == lineCount) { - __pCompositeText->ForwardAnalyze(lineOffset, textIndexFromLineOffset, lineTextSize.width, TEXT_OBJECT_WRAP_TYPE_NONE, - length, tempWidth, tempHeight); - - posX += tempWidth; + textExtent.width = 0; } if (textIndex >= 1) { Font* pTextFont = __pCompositeText->GetFont(textIndex - 1); - tempHeight = TextUtility::GetFontMaxHeight(pTextFont); - } - - if (lineIndex == lineCount) - { - tempWidth = 0; + textExtent.height = TextUtility::GetFontMaxHeight(pTextFont); } - __pCompositeText->SetWrap(__wrap); - - if (tempHeight == 0) + if (textExtent.height < 0) { - tempHeight = TextUtility::GetFontMaxHeight(pFont); + textExtent.height = TextUtility::GetFontMaxHeight(pFont); } TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); @@ -3009,47 +3456,61 @@ TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, break; case TEXT_OBJECT_ALIGNMENT_MIDDLE: - lineY = lineY + (lineBounds.height - tempHeight) / 2; + lineY = lineY + (lineBounds.height - textExtent.height) / 2; break; case TEXT_OBJECT_ALIGNMENT_BOTTOM: - lineY = lineY + (lineBounds.height - tempHeight); + lineY = lineY + (lineBounds.height - textExtent.height); break; } - width = tempWidth; - height = tempHeight; - absX = posX; + width = textExtent.width; + height = textExtent.height; + absX = posX + textExtent.x; + logicalX = absX + __pcRect.x; absY = lineY; - logicalY = lineY - firstDisplayPositionY + __pcRect.y + posY; - logicalX = posX + __pcRect.x; + logicalY = absY - firstDisplayPositionY + __pcRect.y + posY; return E_SUCCESS; } result +TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX); + int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY); + int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX); + int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY); + + result r = GetBlockTextPositionInfoInWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newHeight); + absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX); + absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY); + logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX); + logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY); + + return r; +} + +result TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const { TextLine* pTextLine = null; pTextLine = __pTextColumn->GetTextLine(0); - SysTryReturn(NID_GRP - , pTextLine - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); - int lineOffset = pTextLine->GetTextOffset(); int lineLength = pTextLine->GetTextLength(); int posX = 0; int posY = 0; - int displaposYX = 0; - int length = 0; - int tempWidth = 0; - int tempHeight = 0; _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); Dimension lineTextSize; Rectangle lineBounds; @@ -3089,99 +3550,70 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, int& width, int& heig break; } - if (posX < 0) - { - posX = 0; - } - if (posY < 0) - { - posY = 0; - } + posX = (posX < 0) ? 0 : posX; + posY = (posY < 0) ? 0 : posY; - if (lineOffset > 0) + Rectangle textExtent = pTextLine->GetTextExtent(textIndex - pTextLine->GetTextOffset(), 1); + + if (textIndex >= 1) { - int tempHeight = 0; - __pCompositeText->ForwardAnalyze(0, lineOffset, Integer::VALUE_MAX, __wrap, length, displaposYX, tempHeight); + Font* pTextFont = __pCompositeText->GetFont(textIndex - 1); + textExtent.height = TextUtility::GetFontMaxHeight(pTextFont); } - else + + if (textExtent.height < 0) { - displaposYX = 0; + textExtent.height = TextUtility::GetFontMaxHeight(pFont); } - if (textIndex >= __pCompositeText->GetTextLength()) + TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); + switch (alignment & TEXT_ALIGNMASK_VERT) { - __pCompositeText->ForwardAnalyze(0, __pCompositeText->GetTextLength(), 0x00ffffff, __wrap, length, tempWidth, tempHeight); - - absX = tempWidth; - logicalX = tempWidth - displaposYX + __pcRect.x + posX; - - __pCompositeText->ForwardAnalyze(textIndex - 1, 1, 0x00ffffff, __wrap, length, tempWidth, tempHeight); - - TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); - switch (alignment & TEXT_ALIGNMASK_VERT) - { - case TEXT_OBJECT_ALIGNMENT_TOP: - // fall through - default: - break; - - case TEXT_OBJECT_ALIGNMENT_MIDDLE: - posY = posY + (lineBounds.height - tempHeight) / 2; - break; + case TEXT_OBJECT_ALIGNMENT_TOP: + // fall through + default: + break; - case TEXT_OBJECT_ALIGNMENT_BOTTOM: - posY = posY + (lineBounds.height - tempHeight); - break; - } + case TEXT_OBJECT_ALIGNMENT_MIDDLE: + posY = posY + (lineBounds.height - textExtent.height) / 2; + break; - width = 0; - height = tempHeight; - absY = posY; - logicalY = __pcRect.y + posY; + case TEXT_OBJECT_ALIGNMENT_BOTTOM: + posY = posY + (lineBounds.height - textExtent.height); + break; } - else - { - __pCompositeText->ForwardAnalyze(0, textIndex, 0x00ffffff, __wrap, length, tempWidth, tempHeight); - - absX = tempWidth; - absY = posY; - logicalX = tempWidth - displaposYX + __pcRect.x + posX; - - __pCompositeText->ForwardAnalyze(textIndex - 1, 1, 0x00ffffff, __wrap, length, tempWidth, tempHeight); - - if (textIndex == __pCompositeText->GetTextLength()) - { - tempWidth = 0; - } - - if (tempHeight == 0) - { - tempHeight = TextUtility::GetFontMaxHeight(pFont); - } - - TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment(); - switch (alignment & TEXT_ALIGNMASK_VERT) - { - case TEXT_OBJECT_ALIGNMENT_TOP: - // fall through - default: - break; - case TEXT_OBJECT_ALIGNMENT_MIDDLE: - posY = posY + (lineBounds.height - tempHeight) / 2; - break; + absX = posX + textExtent.x; + logicalX = absX + __pcRect.x; + absY = posY; + logicalY = absY + __pcRect.y; + width = textExtent.width; + height = textExtent.height; - case TEXT_OBJECT_ALIGNMENT_BOTTOM: - posY = posY + (lineBounds.height - tempHeight); - break; - } + return E_SUCCESS; +} - logicalY = __pcRect.y + posY; - width = tempWidth; - height = tempHeight; - } +result +TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float& height, float& absX, float& absY, + float& logicalX, float& logicalY) const +{ + int newWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int newHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX); + int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY); + int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX); + int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY); + + result r = GetTextPositionInfoInNoneWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY); + + width = _CoordinateSystemUtils::ConvertToFloat(newWidth); + height = _CoordinateSystemUtils::ConvertToFloat(newHeight); + absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX); + absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY); + logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX); + logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY); - return E_SUCCESS; + return r; } int @@ -3190,6 +3622,12 @@ TextObject::GetTotalComposedHeight(void) const return __pCompositeText->GetTotalComposedHeight(); } +float +TextObject::GetTotalComposedHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTotalComposedHeight()); +} + int TextObject::GetLineWidthAt(int lineIndex) const { @@ -3203,18 +3641,14 @@ TextObject::GetLineWidthAt(int lineIndex) const int lcWidth = 0; pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryCatch(NID_GRP - , pTextLine - , , E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryCatch(NID_GRP, pTextLine, , E_SYSTEM, "[E_SYSTEM] Fail to get text line."); lineLength = pTextLine->GetTextLength(); r = pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); pcWidth = lineTextSize.width; - lcWidth = _ResUtil::ConvertToVirCoord(pcWidth); + lcWidth = _Text::ConvertToVirCoord(pcWidth); SetLastResult(E_SUCCESS); return lcWidth; @@ -3223,6 +3657,12 @@ CATCH: return -1; } +float +TextObject::GetLineWidthAtF(int lineIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetLineWidthAt(lineIndex)); +} + int TextObject::GetTotalHeight(void) const { @@ -3238,11 +3678,17 @@ TextObject::GetTotalHeight(void) const pcHeight = __pTextColumn->GetTotalHeight(); } - int lcHeight = _ResUtil::ConvertToVirCoord(pcHeight); + int lcHeight = _Text::ConvertToVirCoord(pcHeight); return lcHeight; } +float +TextObject::GetTotalHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetTotalHeight()); +} + int TextObject::GetElementIndexOf(TextElement& textElement) const { @@ -3284,7 +3730,7 @@ TextObject::GetSlidingStep(void) const { IF_NOT_CONSTRUCTED(return -1); - int lcSlidingStep = _ResUtil::ConvertToVirCoord(__slidingStep); + int lcSlidingStep = _Text::ConvertToVirCoord(__slidingStep); return lcSlidingStep; } @@ -3294,7 +3740,7 @@ TextObject::SetSlidingStep(int lcSlidingStep) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - int pcSlidingStep = _ResUtil::ConvertToPhyCoord(lcSlidingStep); + int pcSlidingStep = _Text::ConvertToPhyCoord(lcSlidingStep); __slidingStep = pcSlidingStep; @@ -3322,16 +3768,21 @@ TextObject::GetLineHeightAt(int lineIndex) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); int pcHeight = __pTextColumn->GetLineHeightAt(lineIndex); - int lcHeight = _ResUtil::ConvertToVirCoord(pcHeight); + int lcHeight = _Text::ConvertToVirCoord(pcHeight); return lcHeight; } +float +TextObject::GetLineHeightAtF(int lineIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetLineHeightAt(lineIndex)); +} + int TextObject::GetDisplayLineCount(void) const { @@ -3354,29 +3805,40 @@ TextObject::GetFirstDisplayPositionY(void) const IF_NOT_CONSTRUCTED(return -1); int pcFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY(); - int lcFirstDisplayPositionY = _ResUtil::ConvertToVirCoord(pcFirstDisplayPositionY); + int lcFirstDisplayPositionY = _Text::ConvertToVirCoord(pcFirstDisplayPositionY); return lcFirstDisplayPositionY; } +float +TextObject::GetFirstDisplayPositionYF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetFirstDisplayPositionY()); +} + int TextObject::GetLineIndexAtPositionY(int lcY) const { IF_NOT_CONSTRUCTED(return -1); - int pcY = _ResUtil::ConvertToPhyCoord(lcY); + int pcY = _Text::ConvertToPhyCoord(lcY); return __pTextColumn->GetLineIndexAtPositionY(pcY); } int +TextObject::GetLineIndexAtPositionY(float lcY) const +{ + return GetLineIndexAtPositionY(_CoordinateSystemUtils::ConvertToInteger(lcY)); +} + +int TextObject::GetFirstTextIndexAt(int lineIndex) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); return __pTextColumn->GetFirstTextIndexAt(lineIndex); } @@ -3386,9 +3848,8 @@ TextObject::GetTextLengthAt(int lineIndex) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); return __pTextColumn->GetTextLengthAt(lineIndex); } @@ -3401,17 +3862,29 @@ TextObject::GetBounds(void) const return __rect; } +FloatRectangle +TextObject::GetBoundsF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetBounds()); +} + int TextObject::GetLineSpace(void) const { IF_NOT_CONSTRUCTED(return -1); int pcLineSpacing = __pCompositeText->GetLineSpace(); - int lcLineSpacing = _ResUtil::ConvertToVirCoord(pcLineSpacing); + int lcLineSpacing = _Text::ConvertToVirCoord(pcLineSpacing); return lcLineSpacing; } +float +TextObject::GetLineSpaceF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetLineSpace()); +} + int TextObject::GetTextLength(void) const { @@ -3489,9 +3962,8 @@ TextObject::SetCursorIndex(int cursorIndex) { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , cursorIndex >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, cursorIndex >= 0, E_INVALID_ARG, E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid."); __pCompositeText->SetCursorIndex(cursorIndex); @@ -3531,9 +4003,7 @@ TextObject::SetBlockRange(int startTextIndex, int textLength) result r = E_SUCCESS; r = __pCompositeText->SetRange(startTextIndex, textLength); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } @@ -3607,20 +4077,14 @@ TextObject::SetWidthManagerEnabled(bool enable) if (enable) { __pTextWidthManager = new (std::nothrow)TextWidthManager(__pCompositeText); - SysTryReturn(NID_GRP - , __pTextWidthManager - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, __pTextWidthManager, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); __pCompositeText->SetTextWidthManager(__pTextWidthManager); __pTextWidthManager->Initialize(__pCompositeText->GetTextLength()); } else { - if (__pTextWidthManager) - { - delete __pTextWidthManager; - __pTextWidthManager = null; - } + Release(__pTextWidthManager); } __pCompositeText->SetWidthManagerEnabled(enable); @@ -3762,14 +4226,10 @@ TextObject::GetSweepComposeLineInfo(int lineIndex, TextObjectSweepComposeLineInf { IF_NOT_CONSTRUCTED(return E_INVALID_STATE); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); textSweepComposeLineInfo = pTextLine->GetSweepComposeInfo(); @@ -3781,14 +4241,10 @@ TextObject::GetTextOffsetAtLine(int lineIndex) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); return pTextLine->GetTextOffset(); } @@ -3798,14 +4254,10 @@ TextObject::GetTextLengthAtLine(int lineIndex) const { IF_NOT_CONSTRUCTED(return -1); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); return pTextLine->GetTextLength(); } @@ -3815,33 +4267,33 @@ TextObject::GetBoundsAtLine(int lineIndex) const { IF_NOT_CONSTRUCTED(return Rectangle(-1, -1, -1, -1)); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, Rectangle(-1, -1, -1, -1), E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line."); Rectangle lineBounds = pTextLine->GetBounds(); return lineBounds; } +FloatRectangle +TextObject::GetBoundsAtLineF(int lineIndex) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetBoundsAtLine(lineIndex)); +} + Point TextObject::GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset) { IF_NOT_CONSTRUCTED(return Point(-1, -1)); - SysTryReturn(NID_GRP - , lineIndex >= 0 - , Point(-1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + SysTryReturn(NID_GRP, lineIndex >= 0, Point(-1, -1), E_INVALID_ARG + , "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); - SysTryReturn(NID_GRP - , pTextLine - , Point(-1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + SysTryReturn(NID_GRP, pTextLine, Point(-1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line."); int lineOffset = pTextLine->GetTextOffset(); int lineLength = pTextLine->GetTextLength(); @@ -3853,8 +4305,7 @@ TextObject::GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset) pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height); lineBounds = pTextLine->GetBounds(); - __pCompositeText->ForwardAnalyze(lineOffset, textIndexFromLineOffset, lineTextSize.width, - __wrap, textCount, extentDim.width, extentDim.height); + __pCompositeText->ForwardAnalyze(lineOffset, textIndexFromLineOffset, lineTextSize.width, __wrap, textCount, extentDim.width, extentDim.height); switch (__align & TEXT_ALIGNMASK_HORIZ) { @@ -3878,5 +4329,33 @@ TextObject::GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset) return Point(extentDim.width + __rect.x, lineBounds.y - __pTextColumn->GetFirstDisplayPositionY() + __rect.y); } -}}} // Tizen::Graphics::_Text +FloatPoint +TextObject::GetDisplayPositionAtLineF(int lineIndex, int textIndexFromLineOffset) +{ + return _CoordinateSystemUtils::ConvertToFloat(GetDisplayPositionAtLine(lineIndex, textIndexFromLineOffset)); +} +Tizen::Base::String +TextObject::GetDisplayableText(void) +{ + IF_NOT_CONSTRUCTED(return -1); + + return __pCompositeText->GetDisplayableText(__rect, __action); +} + +bool +TextObject::WordExceedsWidthAt(int lineIndex) const +{ + IF_NOT_CONSTRUCTED(return false); + + SysTryReturn(NID_GRP, lineIndex >= 0, false, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex); + + TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex); + SysTryReturn(NID_GRP, pTextLine, false, E_SYSTEM, "[E_SYSTEM] Fail to get text line."); + + bool hasOneWord = (pTextLine->GetEndType() == TEXT_RETBY_LIMITWIDTH) ? true : false; + + return hasOneWord; +} + +}}} // Tizen::Graphics::_Text diff --git a/src/graphics/text/FGrp_TextTextSimple.cpp b/src/graphics/text/FGrp_TextTextSimple.cpp index a097c99..3ab22cf 100644 --- a/src/graphics/text/FGrp_TextTextSimple.cpp +++ b/src/graphics/text/FGrp_TextTextSimple.cpp @@ -31,6 +31,16 @@ #include "../FGrp_BitmapUtil.h" #include "../FGrp_Font.h" #include "../FGrp_Canvas.h" +#include "FGrp_CoordinateSystemUtils.h" + +#include + +#define Release(x) \ + if (x) \ + { \ + delete x; \ + x = null; \ + } namespace // unnamed { @@ -91,7 +101,9 @@ TextSimple::TextSimple(const wchar_t* pText, int length, TextElementSourceType s _length = length; _isBackgroundDrawingModeEnabled = false; _userWrap = TEXT_OBJECT_WRAP_TYPE_WORD; - __pBitmap = null; + + __bitmapProperty.displayEnable = false; + __bitmapProperty.pBitmap = null; } TextSimple::~TextSimple(void) @@ -105,17 +117,8 @@ TextSimple::~TextSimple(void) } } - if (__pBitmap) - { - delete __pBitmap; - __pBitmap = null; - } - - if (_pFont) - { - delete _pFont; - _pFont = null; - } + Release(__bitmapProperty.pBitmap); + Release(_pFont); } int @@ -139,34 +142,41 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex return TEXT_RETBY_NORMAL; } - if (__pBitmap) + if (__bitmapProperty.pBitmap) { - int bitmapWidth = __pBitmap->GetWidth(); - int bitmapHeight = __pBitmap->GetHeight(); - - if (maxWidth < bitmapWidth) + if (__bitmapProperty.displayEnable) { - actualLength = 0; - width = 0; - height = 0; + int bitmapWidth = __bitmapProperty.pBitmap->GetWidth(); + int bitmapHeight = __bitmapProperty.pBitmap->GetHeight(); - return TEXT_RETBY_OVERWIDTH; - } - else - { - actualLength = _length; - width = bitmapWidth; - height = bitmapHeight; + if (maxWidth < bitmapWidth) + { + actualLength = 0; + width = 0; + height = 0; - return TEXT_RETBY_NORMAL; + return TEXT_RETBY_OVERWIDTH; + } + else + { + actualLength = _length; + width = bitmapWidth; + height = bitmapHeight; + + return TEXT_RETBY_NORMAL; + } } + + actualLength = _length; + width = 0; + height = 0; + + return E_SUCCESS; } Font* pCurrentFont = GetCurrentFont(); _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont)); - SysTryReturn(NID_GRP - , pFont - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); const wchar_t* pText = &_pText[startTextIndex]; @@ -177,9 +187,7 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex if (_userWrap == TEXT_OBJECT_WRAP_TYPE_NONE) { wchar_t* pModifiedText = new (std::nothrow) wchar_t[textLength + 1]; - SysTryReturn(NID_GRP - , pModifiedText - , -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pModifiedText, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); int length = ConvertEnterToSpace(pModifiedText, pText, textLength); pModifiedText[length] = 0; @@ -204,12 +212,35 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex case TEXT_OBJECT_WRAP_TYPE_CHARACTER: r = GetSentenceLength(pText, textLength, charCount); actualLength = TextUtility::GetCharCountInWidth(pFont, pText, charCount, maxWidth, _outline, width, height); - if (_pText[startTextIndex + actualLength] == TEXT_LINE_FEED || - _pText[startTextIndex + actualLength] == TEXT_CARRIAGE_RETURN) + if (_pText[startTextIndex + actualLength] == TEXT_LINE_FEED || _pText[startTextIndex + actualLength] == TEXT_CARRIAGE_RETURN) { (actualLength)++; r = TEXT_RETBY_LINEFEED; } + else + { + // For bidi language, because bidi language is difference when word is split. + FriBidiChar text[1] = {_pText[startTextIndex + actualLength]}; + FriBidiCharType type[1] = {0}; + fribidi_get_bidi_types(text, 1, type); + bool isArabic[1] = {(type[0] & FRIBIDI_MASK_ARABIC) > 0}; + + if (isArabic[0]) + { + r = GetGlyphedLength(pText, actualLength, charCount); + if (charCount < actualLength) + { + r = (charCount == 0) ? TEXT_RETBY_LIMITWIDTH : TEXT_RETBY_NORMAL; + } + + if (charCount != 0) + { + actualLength = TextUtility::GetCharCountInWidth(pFont, pText, charCount, maxWidth, _outline, width, height); + actualLength = charCount; + } + } + } + break; case TEXT_OBJECT_WRAP_TYPE_WORD: @@ -236,18 +267,12 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex if (charCount < actualLength) { - if (charCount == 0) - { - r = TEXT_RETBY_LIMITWIDTH; - } - else - { - r = TEXT_RETBY_NORMAL; - } + r = (charCount == 0) ? TEXT_RETBY_LIMITWIDTH : TEXT_RETBY_NORMAL; } if (charCount != 0) { + // [TODO] If bidi language, if (charCount > (actualLength / 2)) is wrong....... if (charCount > (actualLength / 2)) { const wchar_t* pExtraText = &_pText[startTextIndex + charCount]; @@ -269,7 +294,7 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex if (height == 0 && (textLength > 0)) { - height = pFont->GetLeading(); + height = pFont->GetLeading().ToInt(); } if (actualLength < charCount) @@ -280,6 +305,19 @@ TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, Tex return r; } +int +TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, + int& actualLength, float& width, float& height) +{ + int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + int r = ForwardAnalyze(startTextIndex, textLength, iMaxWidth, wrap, actualLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + bool TextSimple::IsKorean(const wchar_t* ch) const { @@ -342,14 +380,10 @@ TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) co { const wchar_t* pText = null; Font* pCurrentFont = GetCurrentFont(); - SysTryReturn(NID_GRP - , pCurrentFont - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); + SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); if (textLength > _length) { @@ -364,10 +398,18 @@ TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) co return E_SUCCESS; } - if (__pBitmap) + if (__bitmapProperty.pBitmap) { - width = __pBitmap->GetWidth(); - height = __pBitmap->GetHeight(); + if (__bitmapProperty.displayEnable) + { + width = __bitmapProperty.pBitmap->GetWidth(); + height = __bitmapProperty.pBitmap->GetHeight(); + } + else + { + width = 0; + height = 0; + } return E_SUCCESS; } @@ -379,9 +421,7 @@ TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) co case TEXT_OBJECT_WRAP_TYPE_NONE: { wchar_t* pModifiedText = new (std::nothrow) wchar_t[textLength + 1]; - SysTryReturn(NID_GRP - , pModifiedText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pModifiedText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); int length = ConvertEnterToSpace(pModifiedText, pText, textLength); pModifiedText[textLength] = 0; @@ -402,25 +442,32 @@ TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) co if (height == 0 && (textLength > 0)) { - height = pFont->GetLeading(); + height = pFont->GetLeading().ToInt(); } return E_SUCCESS; } result +TextSimple::GetRegion(int textIndex, int textLength, float& width, float& height) const +{ + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + result r = GetRegion(textIndex, textLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + +result TextSimple::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const { const wchar_t* pText = null; Font* pCurrentFont = GetCurrentFont(); - SysTryReturn(NID_GRP - , pCurrentFont - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); + SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); if (textLength > _length) { @@ -435,10 +482,18 @@ TextSimple::GetBlockRegion(int textIndex, int textLength, int& width, int& heigh return E_SUCCESS; } - if (__pBitmap) + if (__bitmapProperty.pBitmap) { - width = __pBitmap->GetWidth(); - height = __pBitmap->GetHeight(); + if (__bitmapProperty.displayEnable) + { + width = __bitmapProperty.pBitmap->GetWidth(); + height = __bitmapProperty.pBitmap->GetHeight(); + } + else + { + width = 0; + height = 0; + } return E_SUCCESS; } @@ -450,9 +505,7 @@ TextSimple::GetBlockRegion(int textIndex, int textLength, int& width, int& heigh case TEXT_OBJECT_WRAP_TYPE_NONE: { wchar_t* pModifiedText = new (std::nothrow) wchar_t[textLength + 1]; - SysTryReturn(NID_GRP - , pModifiedText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pModifiedText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); int length = ConvertEnterToSpace(pModifiedText, pText, textLength); pModifiedText[textLength] = 0; @@ -478,25 +531,34 @@ TextSimple::GetBlockRegion(int textIndex, int textLength, int& width, int& heigh if (height == 0 && (textLength > 0)) { - height = pFont->GetLeading(); + pFont->GetLeading().ToInt(); } return E_SUCCESS; } +result +TextSimple::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const +{ + int iWidth = _CoordinateSystemUtils::ConvertToInteger(width); + int iHeight = _CoordinateSystemUtils::ConvertToInteger(height); + result r = GetBlockRegion(textIndex, textLength, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + return r; +} + int TextSimple::GetHeight(void) const { Font* pFont = GetCurrentFont(); - SysTryReturn(NID_GRP - , pFont - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); + SysTryReturn(NID_GRP, pFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); int maxHeight = 0; - if (__pBitmap) + if (__bitmapProperty.pBitmap) { - maxHeight = __pBitmap->GetHeight(); + maxHeight = (__bitmapProperty.displayEnable) ? __bitmapProperty.pBitmap->GetHeight() : 0; } else { @@ -506,13 +568,17 @@ TextSimple::GetHeight(void) const return maxHeight; } +float +TextSimple::GetHeightF(void) const +{ + return _CoordinateSystemUtils::ConvertToFloat(GetHeight()); +} + result TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action) { - SysTryReturn(NID_GRP - , textLength <= _length - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, textLength <= _length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); if (textLength == 0) { @@ -521,16 +587,15 @@ TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI result r = E_SUCCESS; _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl); - SysTryReturn(NID_GRP - , pCanvas - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); + SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance."); - if (__pBitmap) + if (__bitmapProperty.pBitmap) { - r = pCanvas->DrawBitmap(Point(displayRect.x, displayRect.y), *GetBitmapEx(*_BitmapImpl::GetInstance(*__pBitmap))); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + if (__bitmapProperty.displayEnable) + { + r = pCanvas->DrawBitmap(Point(displayRect.x, displayRect.y), *_GetBitmapEx(*_BitmapImpl::GetInstance(*__bitmapProperty.pBitmap))); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } return E_SUCCESS; } @@ -544,19 +609,13 @@ TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI Color outlineColor = GetCurrentOutlineColor(); Font* pCurrentFont = GetCurrentFont(); - SysTryReturn(NID_GRP - , pCurrentFont - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); + SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); r = pCanvas->SetPriorityFont(*pFont); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if (_userWrap != TEXT_OBJECT_WRAP_TYPE_NONE) { @@ -572,9 +631,7 @@ TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI else { wchar_t* pModifiedText = new (std::nothrow) wchar_t[textLength + 1]; - SysTryReturn(NID_GRP - , pModifiedText - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pModifiedText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); int length = ConvertEnterToSpace(pModifiedText, &_pText[startTextIndex], textLength); pModifiedText[length] = 0; @@ -597,6 +654,19 @@ TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextI return E_SUCCESS; } +result +TextSimple::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, + const TextObjectAlignment alignment, const TextObjectActionType action) +{ + Rectangle iDisplayRect; + iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x); + iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y); + iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width); + iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height); + + return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, alignment, action); +} + TextElement* TextSimple::CloneN(TextComponentInfoValueType type, unsigned int value) { @@ -605,9 +675,7 @@ TextSimple::CloneN(TextComponentInfoValueType type, unsigned int value) pSimpleTextElement = new (std::nothrow) TextSimple(_pText, _length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, _pFont, _foregroundColor, _backgroundColor, _outlineColor); - SysTryReturn(NID_GRP - , pSimpleTextElement - , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + SysTryReturn(NID_GRP, pSimpleTextElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); TextElement::CopyMembers(pSimpleTextElement); @@ -615,6 +683,7 @@ TextSimple::CloneN(TextComponentInfoValueType type, unsigned int value) pSimpleTextElement->SetValue(SET_ALTERNATE_LOOK, _isAlternateLookEnabled); pSimpleTextElement->SetValue(type, value); pSimpleTextElement->SetUserWrap(_userWrap); + pSimpleTextElement->SetBackGroundDrawingModeEnabled(_isBackgroundDrawingModeEnabled); return pSimpleTextElement; } @@ -643,13 +712,10 @@ TextSimple::CopyN(int startTextIndex, int textLength) pText = &_pText[_offset + startTextIndex]; - pSimpleTextElement = new (std::nothrow) TextSimple(pText, textLength, _sourceType, _pFont, - _foregroundColor, _backgroundColor, _outlineColor); - - SysTryReturn(NID_GRP - , pSimpleTextElement - , false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + pSimpleTextElement = new (std::nothrow) TextSimple(pText, textLength, _sourceType, _pFont, _foregroundColor, _backgroundColor, _outlineColor); + SysTryReturn(NID_GRP, pSimpleTextElement, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + pSimpleTextElement->SetUserWrap(_userWrap); pSimpleTextElement->_isBackgroundDrawingModeEnabled = _isBackgroundDrawingModeEnabled; return pSimpleTextElement; @@ -664,6 +730,14 @@ TextSimple::GetValue(TextComponentInfoValueType type) const // fall through return (unsigned int) _pFont; + case SET_FONT_SIZE: + // fall through + return (unsigned int) _pFont->GetSize(); + + case SET_FONT_STYLE: + // fall through + return (unsigned int) (_FontImpl::GetInstance(*_pFont))->GetStyle(); + case SET_FONT_FGCOLOR: // fall through return (unsigned int) _foregroundColor.GetRGB32(); @@ -688,6 +762,9 @@ TextSimple::GetValue(TextComponentInfoValueType type) const // fall through return (unsigned int) GetAlternativeForegroundColor().GetRGB32(); + case SET_ALTERNATE_DISPLAY_BITMAP: + return (unsigned int) &__bitmapProperty; + default: // fall through return -1; @@ -713,19 +790,22 @@ TextSimple::SetValue(TextComponentInfoValueType type, unsigned int value) pFont = _FontImpl::CloneN(const_cast (*(Font*) value)); r = GetLastResult(); - SysTryReturn(NID_GRP - , pFont - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + Release(_pFont); - if (_pFont) - { - delete _pFont; - _pFont = null; - } _pFont = pFont; } break; + case SET_FONT_SIZE: + (_FontImpl::GetInstance(*_pFont))->SetSize(static_cast(value)); + break; + + case SET_FONT_STYLE: + (_FontImpl::GetInstance(*_pFont))->SetStyle(value); + break; + case SET_FONT_FGCOLOR: _foregroundColor = Color(value); break; @@ -746,13 +826,17 @@ TextSimple::SetValue(TextComponentInfoValueType type, unsigned int value) break; case SET_ALTERNATE_LOOK: - _isAlternateLookEnabled = (bool) value; + _isAlternateLookEnabled = (value > 0) ? true : false; break; case SET_ALTERNATIVE_FGCOLOR: SetAlternativeForegroundColor(Color(value)); break; + case SET_ALTERNATE_DISPLAY_BITMAP: + SetBitmap(*(BitmapDisplayProperty*) value); + break; + default: break; } @@ -763,24 +847,17 @@ TextSimple::SetValue(TextComponentInfoValueType type, unsigned int value) result TextSimple::SetFont(const Font* pFont) { - SysTryReturn(NID_GRP - , pFont - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pFont, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; Font* pTmpFont = null; pTmpFont = _FontImpl::CloneN(const_cast (*pFont)); r = GetLastResult(); - SysTryReturn(NID_GRP - , pTmpFont - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, pTmpFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + Release(_pFont); - if (_pFont) - { - delete _pFont; - _pFont = null; - } _pFont = pTmpFont; return E_SUCCESS; @@ -832,9 +909,7 @@ TextSimple::GetOutlineColor(void) const result TextSimple::SetTextOffset(int offset) { - SysTryReturn(NID_GRP - , offset >= 0 - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, offset >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); _offset = offset; @@ -860,8 +935,7 @@ TextSimple::GetText(void) const } bool -TextSimple::IsSame(wchar_t* pText, Font* pFont, const Color& fgColor, - const Color& bgColor, const Color& outlineColor) +TextSimple::IsSame(wchar_t* pText, Font* pFont, const Color& fgColor, const Color& bgColor, const Color& outlineColor, const bool isBitmapDisplayMode) const { if (_pText != pText) { @@ -888,15 +962,18 @@ TextSimple::IsSame(wchar_t* pText, Font* pFont, const Color& fgColor, return false; } + if (__bitmapProperty.displayEnable != isBitmapDisplayMode) + { + return false; + } + return true; } result TextSimple::ChangeTextOffset(wchar_t* pText, int gap) { - SysTryReturn(NID_GRP - , _pText == pText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, _pText == pText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); _offset += gap; @@ -970,8 +1047,7 @@ TextSimple::GetWordWrapLength(const wchar_t* pText, int textLength, int& actualL actualLength++; return TEXT_RETBY_NORMAL; } - else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN - || *pText == TEXT_PARAGRAPH_SEPARATOR) + else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN || *pText == TEXT_PARAGRAPH_SEPARATOR) { wchar_t mch = *pText; @@ -1122,6 +1198,57 @@ TextSimple::GetWordWrapLengthEx(const wchar_t* pText, int textLength, int& actua return TEXT_RETBY_NORMAL; } +int +TextSimple::GetGlyphedLength(const wchar_t* pText, int textLength, int& actualLength) const +{ + FriBidiChar* pBidiText = new (std::nothrow) FriBidiChar[textLength]; + SysTryReturn(NID_GRP, pBidiText, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + for (int i = 0; i < textLength; i++) + { + pBidiText[i] = pText[i]; + } + + FriBidiCharType* pBidiType = new (std::nothrow) FriBidiCharType[textLength]; + SysTryCatch(NID_GRP, pBidiText, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + fribidi_get_bidi_types(pBidiText, textLength, pBidiType); + + actualLength = 0; + for (int i = textLength - 1; i >= 0; i--) + { + if (!(pBidiType[i] & FRIBIDI_MASK_STRONG)) + { + actualLength = ++i; + break; + } + } + + delete[] pBidiText; + delete[] pBidiType; + + if (actualLength == 0) + { + return TEXT_RETBY_LIMITLENGTH; + } + + return TEXT_RETBY_NORMAL; + +CATCH: + if (pBidiText) + { + delete[] pBidiText; + pBidiText = null; + } + + if (pBidiType) + { + delete[] pBidiType; + pBidiType = null; + } + + return -1; +} + Font* TextSimple::GetCurrentFont(void) const { @@ -1240,8 +1367,7 @@ TextSimple::GetWordLength(int textIndex, int& wordLength) const wordLength = 1; return WORD_SPACE; } - else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN - || *pText == TEXT_PARAGRAPH_SEPARATOR) + else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN || *pText == TEXT_PARAGRAPH_SEPARATOR) { if (length == 1) { @@ -1273,8 +1399,7 @@ TextSimple::GetWordLength(int textIndex, int& wordLength) const { return WORD_WORD; } - else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN - || *pText == TEXT_PARAGRAPH_SEPARATOR) + else if (*pText == TEXT_LINE_FEED || *pText == TEXT_CARRIAGE_RETURN || *pText == TEXT_PARAGRAPH_SEPARATOR) { return WORD_WORD; } @@ -1296,50 +1421,74 @@ TextSimple::SetBitmap(const Bitmap& bitmap) result r = E_SUCCESS; Bitmap* pBitmap = new (std::nothrow) Bitmap(); - SysTryReturn(NID_GRP - , pBitmap - , E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + SysTryReturn(NID_GRP, pBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); r = pBitmap->Construct(bitmap, Rectangle(0, 0, bitmap.GetWidth(), bitmap.GetHeight())); - if (r != E_SUCCESS) - { - delete pBitmap; - SysLog(NID_GRP, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); - return r; - } + Release(__bitmapProperty.pBitmap); - if (__pBitmap) + __bitmapProperty.pBitmap = pBitmap; + __bitmapProperty.displayEnable = true; + + return E_SUCCESS; + +CATCH: + Release(pBitmap); + return r; +} + +result +TextSimple::SetBitmap(BitmapDisplayProperty bitmapDisplayProperty) +{ + if (!bitmapDisplayProperty.pBitmap) { - delete __pBitmap; - __pBitmap = null; + Release(__bitmapProperty.pBitmap); + __bitmapProperty.displayEnable = false; + return E_SUCCESS; } - __pBitmap = pBitmap; + result r = E_SUCCESS; + Bitmap* pBitmap = new (std::nothrow) Bitmap(); + SysTryReturn(NID_GRP, pBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = pBitmap->Construct(*bitmapDisplayProperty.pBitmap, Rectangle(0, 0, bitmapDisplayProperty.pBitmap->GetWidth(), bitmapDisplayProperty.pBitmap->GetHeight())); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to insert element.", GetErrorMessage(r)); + + Release(__bitmapProperty.pBitmap); + + __bitmapProperty.pBitmap = pBitmap; + __bitmapProperty.displayEnable = bitmapDisplayProperty.displayEnable; return E_SUCCESS; + +CATCH: + Release(pBitmap); + return r; } const Bitmap* TextSimple::GetBitmap(void) const { - return __pBitmap; + return __bitmapProperty.pBitmap; +} + +bool +TextSimple::IsBitmapDisplayMode(void) const +{ + return __bitmapProperty.displayEnable; } int TextSimple::GetBaseline(void) const { Font* pCurrentFont = GetCurrentFont(); - SysTryReturn(NID_GRP - , pCurrentFont - , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); + SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet."); _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont)); - SysTryReturn(NID_GRP - , pFont - , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); - return (-1) * pFont->GetDescender(); + return (-1) * pFont->GetDescender().ToInt(); } }}} // Tizen::Graphics::_Text diff --git a/src/graphics/text/FGrp_TextTextUtility.cpp b/src/graphics/text/FGrp_TextTextUtility.cpp index 8823733..c68afb6 100644 --- a/src/graphics/text/FGrp_TextTextUtility.cpp +++ b/src/graphics/text/FGrp_TextTextUtility.cpp @@ -27,10 +27,15 @@ #include "FGrp_TextCommon.h" #include "FGrp_TextTextSimple.h" #include "FGrp_TextTextUtility.h" +#include "../util/FGrp_Util.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base::Utility; using namespace Tizen::Base; +// [TODO] use before _Font::GetTextExtent is working properly. +#define EXTENT_BIDI_LIST + namespace Tizen { namespace Graphics { @@ -54,12 +59,10 @@ TextUtility::GetObjectTypeFromValueType(TextComponentInfoValueType type) bool TextUtility::CanMerge(TextElement* pCurrentTextElement, TextElement* pNextTextElement) { - SysTryReturn(NID_GRP - , pCurrentTextElement && pCurrentTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT + SysTryReturn(NID_GRP, pCurrentTextElement && pCurrentTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT , false, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - SysTryReturn(NID_GRP - , pNextTextElement && pNextTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT + SysTryReturn(NID_GRP, pNextTextElement && pNextTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT , false, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); TextSimple* pCurrentSimpleText = dynamic_cast < TextSimple* >(pCurrentTextElement); @@ -94,6 +97,16 @@ TextUtility::CanMerge(TextElement* pCurrentTextElement, TextElement* pNextTextEl return false; } + if (pCurrentSimpleText->GetTextOffset() + pCurrentSimpleText->GetTextLength() != pNextSimpleText->GetTextOffset()) + { + return false; + } + + if (pCurrentSimpleText->IsBitmapDisplayMode() != pNextSimpleText->IsBitmapDisplayMode()) + { + return false; + } + return true; } @@ -142,11 +155,9 @@ TextUtility::GetFontMaxHeight(Font* pFont) } _Font* pNativeFont = _Font::GetInstance(*_FontImpl::GetInstance(*pFont)); - SysTryReturn(NID_GRP - , pNativeFont - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pNativeFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); - return pNativeFont->GetLeading(); + return pNativeFont->GetLeading().ToInt(); } int @@ -157,7 +168,20 @@ TextUtility::GetFontMaxHeight(_Font* pFont) return 0; } - return pFont->GetLeading(); + return pFont->GetLeading().ToInt(); +} + + +float +TextUtility::GetFontMaxHeightF(Font* pFont) +{ + return _CoordinateSystemUtils::ConvertToFloat(GetFontMaxHeight(pFont)); +} + +float +TextUtility::GetFontMaxHeightF(_Font* pFont) +{ + return _CoordinateSystemUtils::ConvertToFloat(GetFontMaxHeight(pFont)); } int @@ -184,15 +208,12 @@ TextUtility::GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLen result r = E_SUCCESS; int count = 0; Dimension lineDimension; - Tizen::Base::String text(pText); - r = pFont->GetTextExtent(maxWidth, text, 0, textLength, outline, L"", count, lineDimension); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + r = pFont->GetTextExtent(maxWidth, _Util::String(pText, textLength), outline, L"", count, lineDimension); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); width = lineDimension.width; - height = pFont->GetLeading(); + height = pFont->GetLeading().ToInt(); SetLastResult(E_SUCCESS); @@ -204,12 +225,23 @@ CATCH: return 0; } +int +TextUtility::GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height) +{ + int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth); + int iWidth = 0; + int iHeight = 0; + int charCount = GetCharCountInWidth(pFont, pText, textLength, iMaxWidth, outline, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + + return charCount; +} + result TextUtility::CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength) { - SysTryReturn(NID_GRP - , pDstText && pSrcText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pDstText && pSrcText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); int srcTextLength = 0; wchar_t ch = 0; @@ -253,9 +285,7 @@ TextUtility::CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength result TextUtility::CopyText(wchar_t* pDstText, const wchar_t* pSrcText) { - SysTryReturn(NID_GRP - , pDstText && pSrcText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pDstText && pSrcText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); int i = 0; wchar_t ch = 0; @@ -285,14 +315,18 @@ TextUtility::DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int t } r = canvas.DrawText(point, text, 0, textLength); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } result +TextUtility::DrawText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength) +{ + return DrawText(canvas, _CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), pText, textLength); +} + +result TextUtility::DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor) { result r = E_SUCCESS; @@ -306,31 +340,43 @@ TextUtility::DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText } r = canvas.DrawText(point, text, 0, textLength, outlineColor); - SysTryReturn(NID_GRP - , r == E_SUCCESS - , r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } result +TextUtility::DrawOutlineText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength, Color outlineColor) +{ + return DrawOutlineText(canvas, _CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), pText, textLength, outlineColor); +} + +result TextUtility::GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height) { - SysTryReturn(NID_GRP - , pFont && pText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pFont && pText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; Dimension lineDimension; - Tizen::Base::String text(pText); - r = pFont->GetTextExtent(text, textLength, lineDimension); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + // [TODO] use before _Font::GetTextExtent is working properly. +#if defined (EXTENT_BIDI_LIST) + _Util::AccumList<_Util::Pair > gaptList; + + r = pFont->GetTextExtentList(_Util::String(pText, textLength), gaptList); + for (_Util::AccumList<_Util::Pair >::Iterator iterator = gaptList.Begin(); iterator != gaptList.End(); iterator++) + { + lineDimension.width = (lineDimension.width < iterator->second) ? iterator->second : lineDimension.width; + } + +#else + r = pFont->GetTextExtent(_Util::String(pText, textLength), lineDimension); +#endif + + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); width = lineDimension.width; - height = pFont->GetLeading(); + height = pFont->GetLeading().ToInt(); return E_SUCCESS; @@ -343,27 +389,20 @@ CATCH: result TextUtility::GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height) { - SysTryReturn(NID_GRP - , pFont && pText - , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); + SysTryReturn(NID_GRP, pFont && pText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); result r = E_SUCCESS; int count = 0; Dimension lineDimension; - Tizen::Base::String text(pText); _Font* pNativeFont = _Font::GetInstance(*_FontImpl::GetInstance(*pFont)); - SysTryReturn(NID_GRP - , pNativeFont - , -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); + SysTryReturn(NID_GRP, pNativeFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance."); - r = pNativeFont->GetTextExtent((Integer::VALUE_MAX >> 1) - 1, text, 0, textLength, outline, L"", count, lineDimension); - SysTryCatch(NID_GRP - , r == E_SUCCESS - , , r, "[%s] Propagating.", GetErrorMessage(r)); + r = pNativeFont->GetTextExtent((Integer::VALUE_MAX >> 1) - 1, _Util::String(pText, textLength), outline, L"", count, lineDimension); + SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); width = lineDimension.width; - height = pNativeFont->GetLeading(); + height = pNativeFont->GetLeading().ToInt(); return E_SUCCESS; @@ -373,5 +412,31 @@ CATCH: return r; } +result +TextUtility::GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height) +{ + result r = E_SUCCESS; + int iWidth = 0; + int iHeight = 0; + r = GetTextExtent(pFont, pText, textLength, outline, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + + return r; +} + +result +TextUtility::GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height) +{ + result r = E_SUCCESS; + int iWidth = 0; + int iHeight = 0; + r = GetTextExtent(pFont, pText, textLength, outline, iWidth, iHeight); + width = _CoordinateSystemUtils::ConvertToFloat(iWidth); + height = _CoordinateSystemUtils::ConvertToFloat(iHeight); + + return r; +} + }}} // Tizen::Graphics::_Text diff --git a/src/graphics/text/FGrp_TextTextUtility.h b/src/graphics/text/FGrp_TextTextUtility.h index f9061e3..7e8fb54 100644 --- a/src/graphics/text/FGrp_TextTextUtility.h +++ b/src/graphics/text/FGrp_TextTextUtility.h @@ -48,22 +48,36 @@ public: static int GetFontMaxHeight(_Font* pFont); + static float GetFontMaxHeightF(Font* pFont); + + static float GetFontMaxHeightF(_Font* pFont); + static int GetTextLength(const wchar_t* pText); static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, int maxWidth, bool outline, int& width, int& height); + static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height); + static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height); static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height); + static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height); + + static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height); + static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength); static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText); static result DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength); + static result DrawText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength); + static result DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor); + static result DrawOutlineText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength, Color outlineColor); + }; // TextUtility }}} // Tizen::Graphics::_Text diff --git a/src/graphics/text/FGrp_TextTextWidthManager.cpp b/src/graphics/text/FGrp_TextTextWidthManager.cpp index 24fafbe..63351e8 100644 --- a/src/graphics/text/FGrp_TextTextWidthManager.cpp +++ b/src/graphics/text/FGrp_TextTextWidthManager.cpp @@ -28,6 +28,7 @@ #include "FGrp_TextTextComposite.h" #include "FGrp_TextTextSimpleList.h" #include "FGrp_TextTextWidthManager.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Base::Utility; @@ -497,6 +498,12 @@ TextWidthManager::GetCurrentLineInfo(int lineWidth, TextLineComposeInfo& textLin } bool +TextWidthManager::GetCurrentLineInfo(float lineWidth, TextLineComposeInfo& textLineComposeInfo) +{ + return GetCurrentLineInfo(_CoordinateSystemUtils::ConvertToInteger(lineWidth), textLineComposeInfo); +} + +bool TextWidthManager::EndCompose(void) { __isComposing = false; diff --git a/src/graphics/text/FGrp_TextTextWidthManager.h b/src/graphics/text/FGrp_TextTextWidthManager.h index 84298f6..c97c335 100644 --- a/src/graphics/text/FGrp_TextTextWidthManager.h +++ b/src/graphics/text/FGrp_TextTextWidthManager.h @@ -62,6 +62,8 @@ public: bool GetCurrentLineInfo(int lineWidth, TextLineComposeInfo& textLineComposeInfo); + bool GetCurrentLineInfo(float lineWidth, TextLineComposeInfo& textLineComposeInfo); + bool EndCompose(void); bool InformTextInsert(int textIndex, int textLength); diff --git a/src/graphics/util/FGrp_Util.cpp b/src/graphics/util/FGrp_Util.cpp old mode 100644 new mode 100755 index 336115b..5936d8a --- a/src/graphics/util/FGrp_Util.cpp +++ b/src/graphics/util/FGrp_Util.cpp @@ -119,6 +119,34 @@ _Util::Validate(const ::Tizen::Graphics::Rectangle& rtSrc, const ::Tizen::Graphi } result +_Util::Validate(const ::Tizen::Graphics::FloatRectangle& rtSrcF, const ::Tizen::Graphics::FloatRectangle& rtDestF) +{ + // check 1. is width/height less or equal than 0? + if (rtSrcF.width <= 0.0f || rtSrcF.height <= 0.0f || rtDestF.width <= 0.0f || rtDestF.height <= 0.0f) + { + SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The argument is out of range. (src(w:%f,h:%f), dst(w:%f,h:%f)).", + rtSrcF.width, rtSrcF.height, rtDestF.width, rtDestF.height); + } + + // check 2. is src exiting outside of dest entirely? + if (rtSrcF.x >= rtDestF.x + rtDestF.width || rtSrcF.x + rtSrcF.width <= rtDestF.x) + { + SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, + "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).", + rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height); + } + + if (rtSrcF.y >= rtDestF.y + rtDestF.height || rtSrcF.y + rtSrcF.height <= rtDestF.y) + { + SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, + "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).", + rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height); + } + + return E_SUCCESS; +} + +result _Util::Validate(const ::Tizen::Graphics::Point& ptSrc, const ::Tizen::Graphics::Rectangle& rtDest) { SysTryReturnResult(NID_GRP, rtDest.x <= ptSrc.x && diff --git a/src/graphics/util/FGrp_Util.h b/src/graphics/util/FGrp_Util.h old mode 100644 new mode 100755 index 747b0c5..7105faf --- a/src/graphics/util/FGrp_Util.h +++ b/src/graphics/util/FGrp_Util.h @@ -61,6 +61,7 @@ namespace _Util { result Validate(const ::Tizen::Graphics::Rectangle& rtSrc, const ::Tizen::Graphics::Rectangle& rtDest); +result Validate(const ::Tizen::Graphics::FloatRectangle& rtSrcF, const ::Tizen::Graphics::FloatRectangle& rtDestF); result Validate(const ::Tizen::Graphics::Point& ptSrc, const ::Tizen::Graphics::Rectangle& rtDest); template diff --git a/src/graphics/util/FGrp_UtilTemplate.h b/src/graphics/util/FGrp_UtilTemplate.h old mode 100644 new mode 100755 index 83a6096..b74a783 --- a/src/graphics/util/FGrp_UtilTemplate.h +++ b/src/graphics/util/FGrp_UtilTemplate.h @@ -154,6 +154,30 @@ public: } } + Iterator Insert(Iterator index, const DataType& data) + { + if (__first == 0) + { + this->Push(data); + return this->Begin(); + } + + index = (index > __first) ? index : __first; + index = (index < __last) ? index : __last; + + int offset = index - __first; + + // ..... + this->Push(data); + (__last - 1)->~DataType(); + + index = __CopyBackward(index, __last - 1, index + 1); + + new ((void*) index)DataType(data); + + return index; + } + void Clear(void) { __Cleanup(); @@ -199,6 +223,18 @@ private: return dest; } + Iterator __CopyBackward(Iterator first, Iterator last, Iterator dest) + { + dest += (last - first); + + for (; first != last;) + { + new (--dest) DataType(*(--last)); + } + + return first; + } + Iterator __first; Iterator __last; Iterator __end; diff --git a/src/graphics/util/FGrp_UtilType.h b/src/graphics/util/FGrp_UtilType.h index fb87a29..4334878 100644 --- a/src/graphics/util/FGrp_UtilType.h +++ b/src/graphics/util/FGrp_UtilType.h @@ -21,16 +21,212 @@ * */ +#include + #ifndef _FGRP_INTERNAL_UTIL_TYPE_H_ #define _FGRP_INTERNAL_UTIL_TYPE_H_ - namespace Tizen { namespace Graphics { namespace _Util { +template +struct FixedPoint +{ + FixedPoint(void) + : __fixedPoint(0) + { + } + + FixedPoint(const FixedPoint& rhs) + : __fixedPoint(rhs.__fixedPoint) + { + } + + FixedPoint(int fixedPointValue) + : __fixedPoint(fixedPointValue) + { + } + + inline int + ToInt() const + { + return (__fixedPoint >> SHIFT); + } + + inline float + ToFloat() const + { + return (__fixedPoint / ((1 << SHIFT) * 1.0f)); + } + + inline void + SetFixedPoint(int fixedPointValue) + { + __fixedPoint = fixedPointValue; + } + + inline void + SetConvertToFixedPoint(int integerValue) + { + __fixedPoint = integerValue << SHIFT; + } + + inline void + SetConvertToFixedPoint(long longValue) + { + __fixedPoint = longValue << SHIFT; + } + + inline void + SetConvertToFixedPoint(float floatValue) + { + __fixedPoint = floatValue * ((1 << SHIFT) * 1.0f); + } + + inline operator const int(void) + { + return __fixedPoint; + } + +// operator + + template + inline FixedPoint + operator +(const T& rhs) const + { + FixedPoint tempFixed(0); + + tempFixed.__fixedPoint = __fixedPoint + rhs; + + return tempFixed; + } + + inline FixedPoint + operator +(const FixedPoint& rhs) const + { + FixedPoint tempFixed(0); + + tempFixed.__fixedPoint = __fixedPoint + rhs.__fixedPoint; + + return tempFixed; + } + +// operator - + template + inline FixedPoint + operator -(const T& rhs) const + { + FixedPoint tempFixed(0); + + tempFixed.__fixedPoint = __fixedPoint - rhs; + + return tempFixed; + } + + inline FixedPoint + operator -(const FixedPoint& rhs) const + { + FixedPoint tempFixed(0); + + tempFixed.__fixedPoint = __fixedPoint - rhs.__fixedPoint; + + return tempFixed; + } + +// operator == + template + inline bool + operator ==(const T& rhs) const + { + return (ToFloat() == rhs); + } + + inline bool + operator ==(const FixedPoint& rhs) const + { + return (ToFloat() == rhs.ToFloat); + } + +// operator != + template + inline bool + operator !=(const T& rhs) const + { + return (ToFloat() != rhs); + } + + inline bool + operator !=(const FixedPoint& rhs) const + { + return (ToFloat() != rhs.ToFloat()); + } + +// operator <= + template + inline bool + operator <=(const T& rhs) const + { + return (ToFloat() <= rhs); + } + + inline bool + operator <=(const FixedPoint& rhs) const + { + return (ToFloat() <= rhs.ToFloat()); + } + +// operator >= + template + inline bool + operator >=(const T& rhs) const + { + return (ToFloat() >= rhs); + } + + inline bool + operator >=(const FixedPoint& rhs) const + { + return (ToFloat() >= rhs.ToFloat()); + } + +// operator > + template + inline bool + operator >(const T& rhs) const + { + return (ToFloat() > rhs); + } + + inline bool + operator >(const FixedPoint& rhs) const + { + return (ToFloat() > rhs.ToFloat()); + } + +// operator < + template + inline bool + operator <(const T& rhs) const + { + return (ToFloat() < rhs); + } + + inline bool + operator <(const FixedPoint& rhs) const + { + return (ToFloat() < rhs.ToFloat()); + } + + int __fixedPoint; + enum { SHIFT = postFixed }; +}; + +typedef FixedPoint<26, 6> FixedPoint26_6; +typedef FixedPoint<22, 10> FixedPoint22_10; + + template struct Point { @@ -125,7 +321,7 @@ struct String } else { - this->pStart = L""; + this->pStart = (pClippedStart == pInputString) ? pClippedStart : L""; this->length = 0; } } @@ -136,6 +332,8 @@ struct String } }; +typedef std::wstring WString; + } // Tizen::Graphics::_Util }} // Tizen::Graphics diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index f6e2b6c..6a338a0 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -40,6 +40,7 @@ SET (${this_target}_SOURCE_FILES animations/FUiAnim_RootVisualElement.cpp animations/FUiAnim_AnimationManager.cpp animations/FUiAnim_TransactionNode.cpp + animations/FUiAnim_AnimationGroupNode.cpp animations/FUiAnim_VisualElement.cpp animations/FUiAnim_VisualElementEnvironment.cpp animations/FUiAnim_VisualElementAnimationGroupImpl.cpp @@ -124,7 +125,6 @@ SET (${this_target}_SOURCE_FILES FUi_Window.cpp FUi_ControlImpl.cpp FUi_ContainerImpl.cpp - FUi_CoordinateSystemUtils.cpp FUi_WindowImpl.cpp FUi_ControlManager.cpp FUi_ControlImplManager.cpp @@ -136,12 +136,15 @@ SET (${this_target}_SOURCE_FILES FUiClipboardItem.cpp FUi_ClipboardItemImpl.cpp FUi_ClipboardItem.cpp + FUi_ClipboardPopupEvent.cpp FUi_CustomControlBaseImpl.cpp FUiDataBindingContext.cpp FUi_DataBinding.cpp FUi_DataBindingContext.cpp FUi_DataBindingContextImpl.cpp FUi_ResourceManager.cpp + FUi_UiManagerProxy.cpp + FUi_UiManagerIpcMessages.cpp FUi_UiBuilder.cpp FUi_UiBuilderControl.cpp FUi_UiBuilderControlElement.cpp @@ -201,6 +204,8 @@ SET (${this_target}_SOURCE_FILES FUi_TouchRotationGestureDetector.cpp FUi_TouchPanningGestureDetector.cpp FUiKeyEventManager.cpp + FUiKeyEventInfo.cpp + FUi_KeyEventInfoImpl.cpp FUi_KeyEventManagerImpl.cpp FUi_KeyEventManager.cpp FUi_VariantImpl.cpp @@ -222,6 +227,7 @@ SET (${this_target}_SOURCE_FILES FUi_TouchEventManagerImpl.cpp FUiTouchEventManager.cpp FUiSystemUtil.cpp + FUi_SystemUtilImpl.cpp controls/FUiCtrlAnimation.cpp controls/FUiCtrlAnimationFrame.cpp controls/FUiCtrlButton.cpp @@ -494,6 +500,12 @@ SET (${this_target}_SOURCE_FILES controls/FUiCtrl_PublicProgressPopupEvent.cpp controls/FUiCtrl_ProgressPopupEvent.cpp # End of ProgressPopup +# GroupContainer + controls/FUiCtrlGroupContainer.cpp + controls/FUiCtrl_GroupContainerImpl.cpp + controls/FUiCtrl_GroupContainer.cpp + controls/FUiCtrl_GroupContainerPresenter.cpp +# End of GroupContainer # 1.x Lists controls/FUiCtrlCustomListItem.cpp controls/FUiCtrlCustomListItemFormat.cpp @@ -521,6 +533,7 @@ SET (${this_target}_SOURCE_FILES controls/FUiCtrlGroupItem.cpp controls/FUiCtrlIGroupedListViewItemEventListener.cpp controls/FUiCtrlIGroupedListViewItemProvider.cpp + controls/FUiCtrlIGroupedListViewItemProviderF.cpp controls/FUiCtrlIListViewItemEventListener.cpp controls/FUiCtrlListContextItem.cpp controls/FUiCtrlListItemBase.cpp @@ -541,6 +554,7 @@ SET (${this_target}_SOURCE_FILES controls/FUiCtrl_ListViewItem.cpp controls/FUiCtrl_ListViewItemProviderAdaptor.cpp controls/FUiCtrl_ListViewModel.cpp + controls/FUiCtrl_ListViewTouchEventHandler.cpp controls/FUiCtrl_SimpleItemImpl.cpp controls/FUiCtrl_UiListViewItemEvent.cpp controls/FUiCtrl_UiListViewItemEventArg.cpp @@ -567,6 +581,7 @@ SET (${this_target}_SOURCE_FILES controls/FUiCtrl_TableViewItemProviderAdaptor.cpp controls/FUiCtrl_TableViewPresenter.cpp # end of TableView related + layout/FUi_LayoutLayoutMaker.cpp layout/FUi_LayoutLayout.cpp layout/FUi_LayoutLayoutItem.cpp layout/FUi_LayoutLayoutItemInfo.cpp @@ -601,11 +616,13 @@ SET (${this_target}_SOURCE_FILES resource/FUi_ResourceDateTimePickerConfig.cpp resource/FUi_ResourceFooterConfig.cpp resource/FUi_ResourceFormConfig.cpp + resource/FUi_ResourceGroupContainerConfig.cpp resource/FUi_ResourceHeaderConfig.cpp resource/FUi_ResourceIconListConfig.cpp resource/FUi_ResourceInputPadConfig.cpp resource/FUi_ResourceLabelConfig.cpp resource/FUi_ResourceListViewConfig.cpp + resource/FUi_ResourceLiveboxConfig.cpp resource/FUi_ResourceRadioGroupConfig.cpp resource/FUi_ResourceSplitPanelConfig.cpp resource/FUi_ResourceTabBarConfig.cpp @@ -623,6 +640,7 @@ SET (${this_target}_SOURCE_FILES resource/FUi_ResourceScrollConfig.cpp resource/FUi_ResourceSearchBarConfig.cpp resource/FUi_ResourceSliderConfig.cpp + resource/FUi_ResourceProgressConfig.cpp resource/FUi_ResourceTokenEditConfig.cpp resource/FUi_ResourceOptionMenuConfig.cpp resource/FUi_ResourceGalleryConfig.cpp diff --git a/src/ui/FUiAccessibilityElement.cpp b/src/ui/FUiAccessibilityElement.cpp index 675c945..37fda3f 100644 --- a/src/ui/FUiAccessibilityElement.cpp +++ b/src/ui/FUiAccessibilityElement.cpp @@ -16,6 +16,7 @@ // #include #include +#include #include #include #include "FUi_AccessibilityElementImpl.h" @@ -28,11 +29,13 @@ AccessibilityElement::AccessibilityElement(void) :__pAccessibilityElementImpl(null) { } + AccessibilityElement::~AccessibilityElement(void) { delete __pAccessibilityElementImpl; __pAccessibilityElementImpl = null; } + result AccessibilityElement::Construct(const Rectangle& bounds, const String& name) { @@ -41,6 +44,17 @@ AccessibilityElement::Construct(const Rectangle& bounds, const String& name) "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); __pAccessibilityElementImpl = new (std::nothrow) _AccessibilityElementImpl(*this); SysTryReturn(NID_UI, __pAccessibilityElementImpl, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); + return __pAccessibilityElementImpl->Construct(name, FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); +} + +result +AccessibilityElement::Construct(const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& name) +{ + ClearLastResult(); + SysAssertf(__pAccessibilityElementImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + __pAccessibilityElementImpl = new (std::nothrow) _AccessibilityElementImpl(*this); + SysTryReturn(NID_UI, __pAccessibilityElementImpl, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); return __pAccessibilityElementImpl->Construct(name, bounds); } @@ -49,8 +63,17 @@ AccessibilityElement::SetBounds(const Rectangle& bounds) { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); ClearLastResult(); + return __pAccessibilityElementImpl->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); +} + +void +AccessibilityElement::SetBounds(const Tizen::Graphics::FloatRectangle& bounds) +{ + SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); return __pAccessibilityElementImpl->SetBounds(bounds); } + void AccessibilityElement::SetLabel(const String& label) { @@ -58,6 +81,7 @@ AccessibilityElement::SetLabel(const String& label) ClearLastResult(); return __pAccessibilityElementImpl->SetLabel(label); } + void AccessibilityElement::SetHint(const String& hint) { @@ -65,48 +89,65 @@ AccessibilityElement::SetHint(const String& hint) ClearLastResult(); return __pAccessibilityElementImpl->SetHint(hint); } + void AccessibilityElement::SetTrait(const String& trait) { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->SetTrait(trait); } + void AccessibilityElement::SetValue(const Tizen::Base::String& value) { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->SetValue(value); } + String AccessibilityElement::GetName(void) const { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->GetName(); } + Rectangle AccessibilityElement::GetBounds(void) const { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); + FloatRectangle floatRectangle = __pAccessibilityElementImpl->GetBounds(); + Rectangle rectangle((int)floatRectangle.x, (int)floatRectangle.y, (int)floatRectangle.width, (int)floatRectangle.height); + return rectangle; +} + +Tizen::Graphics::FloatRectangle +AccessibilityElement::GetBoundsF(void) const +{ + SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->GetBounds(); } + String AccessibilityElement::GetLabel(void) const { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->GetLabel(); } + String AccessibilityElement::GetHint(void) const { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->GetHint(); } + String AccessibilityElement::GetTrait(void) const { SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use."); return __pAccessibilityElementImpl->GetTraitString(); } + Tizen::Base::String AccessibilityElement::GetValue(void) const { diff --git a/src/ui/FUiCardLayout.cpp b/src/ui/FUiCardLayout.cpp old mode 100644 new mode 100755 diff --git a/src/ui/FUiClipboard.cpp b/src/ui/FUiClipboard.cpp index 2f50bec..484397d 100644 --- a/src/ui/FUiClipboard.cpp +++ b/src/ui/FUiClipboard.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiClipboard.cpp * @brief This is the implementation file for Clipboard class. @@ -21,6 +22,7 @@ * * This file contains the implementation of Header class. */ + #include #include #include diff --git a/src/ui/FUiClipboardItem.cpp b/src/ui/FUiClipboardItem.cpp index 721669a..f17439c 100644 --- a/src/ui/FUiClipboardItem.cpp +++ b/src/ui/FUiClipboardItem.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiClipboardItem.cpp * @brief This is the implementation file for ClipboardItem class. @@ -21,6 +22,7 @@ * * This file contains the implementation of ClipboardItem class. */ + #include #include #include diff --git a/src/ui/FUiContainer.cpp b/src/ui/FUiContainer.cpp old mode 100644 new mode 100755 index 4888580..d6d14fe --- a/src/ui/FUiContainer.cpp +++ b/src/ui/FUiContainer.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiContainer.cpp * @brief This is the implementation file for Container class. @@ -69,12 +70,32 @@ Container::Construct(const Rectangle& rect, bool resizable, bool movable) } result +Container::Construct(const FloatRectangle& rect, bool resizable, bool movable) +{ + result r = E_SUCCESS; + SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + _ContainerImpl* pImpl = _ContainerImpl::CreateContainerImplN(this, rect, null, null, resizable, movable); + r = GetLastResult(); + SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + return E_SUCCESS; +} + +result Container::Construct(const Layout& layout, const Rectangle& rect, bool resizable, bool movable) { return Construct(layout, layout, rect, resizable, movable); } result +Container::Construct(const Layout& layout, const FloatRectangle& rect, bool resizable, bool movable) +{ + return Construct(layout, layout, rect, resizable, movable); +} + +result Container::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, const Rectangle& rect, bool resizable, bool movable) { @@ -94,12 +115,37 @@ Container::Construct(const Layout& portraitLayout, const Layout& landscapeLayout } result +Container::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, + const FloatRectangle& rect, bool resizable, bool movable) +{ + result r = E_SUCCESS; + SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + _ContainerImpl* pImpl = + _ContainerImpl::CreateContainerImplN(this, rect, &portraitLayout, &landscapeLayout, resizable, movable); + + r = GetLastResult(); + SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + + _pControlImpl = pImpl; + + return E_SUCCESS; +} + +result Container::AddControl(const Control& control) { + return AddControl(const_cast< Control* >(&control)); +} + +result +Container::AddControl(Control* pControl) +{ _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->AddChild(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(control))); + result r = pImpl->AddChild(_ControlImpl::GetInstance(*pControl)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -117,10 +163,16 @@ Container::RemoveAllControls(void) result Container::RemoveControl(const Control& control) { + return RemoveControl(const_cast< Control* >(&control)); +} + +result +Container::RemoveControl(Control* pControl) +{ _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->RemoveChild(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(control))); + result r = pImpl->RemoveChild(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(*pControl))); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -141,10 +193,16 @@ Container::RemoveControl(int index) result Container::SetControlAt(const Control& control, int index) { + return SetControlAt(const_cast< Control* >(&control), index); +} + +result +Container::SetControlAt(Control* pControl, int index) +{ _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->SetChildAt(_ControlImpl::GetInstance(control), index); + result r = pImpl->SetChildAt(_ControlImpl::GetInstance(*pControl), index); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -153,10 +211,16 @@ Container::SetControlAt(const Control& control, int index) result Container::GetControlAt(const Control& control, int& index) const { + return GetControlAt(&control, index); +} + +result +Container::GetControlAt(const Control* pControl, int& index) const +{ const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - int childIndex = pImpl->GetChildIndex(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(control))); + int childIndex = pImpl->GetChildIndex(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(*pControl))); result r = GetLastResult(); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -165,6 +229,7 @@ Container::GetControlAt(const Control& control, int& index) const return E_SUCCESS; } + int Container::GetControlCount(void) const { @@ -218,10 +283,16 @@ Container::GetControls(void) const bool Container::IsAncestorOf(const Control& control) const { + return IsAncestorOf(&control); +} + +bool +Container::IsAncestorOf(const Control* pControl) const +{ const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - bool ancestorOf = pImpl->IsAncestorOf(_ControlImpl::GetInstance(control)); + bool ancestorOf = pImpl->IsAncestorOf(_ControlImpl::GetInstance(*pControl)); result r = GetLastResult(); SysTryReturn(NID_UI, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -261,8 +332,20 @@ Container::OnBoundsChanging(const Rectangle& oldRect, const Rectangle& newRect) return E_SUCCESS; } +result +Container::OnBoundsChanging(const FloatRectangle& oldRect, const FloatRectangle& newRect) +{ + return E_SUCCESS; +} + void -Container::OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize) +Container::OnEvaluateSize(Dimension& evaluatedSize) +{ + +} + +void +Container::OnEvaluateSize(FloatDimension& evaluatedSize) { } @@ -274,6 +357,12 @@ Container::OnBoundsChanged(const Rectangle& oldRect, const Rectangle& newRect) } void +Container::OnBoundsChanged(const FloatRectangle& oldRect, const FloatRectangle& newRect) +{ + +} + +void Container::OnShowStateChanging(bool showState) { @@ -348,22 +437,34 @@ Container::SetControlAlwaysAtBottom(Control& control, bool alwaysAtBottom) return E_SUCCESS; } + bool Container::IsControlAlwaysAtBottom(const Control& control) const { + return IsControlAlwaysAtBottom(&control); +} + +bool +Container::IsControlAlwaysAtBottom(const Control* pControl) const +{ const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - return pImpl->IsControlAlwaysAtBottom(control); + return pImpl->IsControlAlwaysAtBottom(*pControl); } - bool Container::IsControlAlwaysOnTop(const Control& control) const { + return IsControlAlwaysOnTop(&control); +} + +bool +Container::IsControlAlwaysOnTop(const Control* pControl) const +{ const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - return pImpl->IsControlAlwaysOnTop(control); + return pImpl->IsControlAlwaysOnTop(*pControl); } }} //Tizen::Ui diff --git a/src/ui/FUiControl.cpp b/src/ui/FUiControl.cpp old mode 100644 new mode 100755 index c2d1e7e..60e5f3a --- a/src/ui/FUiControl.cpp +++ b/src/ui/FUiControl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiControl.cpp * @brief This is the implementation file for the Control class. @@ -154,6 +155,21 @@ void* STO_CreateNativeImageObject(void* pDisplayContext, int width, int height) } extern "C" _OSP_EXPORT_ void +STO_FillSet(void* pVisualElement, int x, int y, int w, int h) +{ + VisualElement* pVE = (VisualElement*)pVisualElement; + + _VisualElementImpl* pVEImpl = _VisualElementImpl::GetInstance(*pVE); + + _EflNode* pNode = (_EflNode*)pVEImpl->GetNativeNode(); + Evas_Object* pEvasObject = pNode->GetNativeObject(); + if (pEvasObject) + { + evas_object_image_fill_set(pEvasObject, x, y, w, h); + } +} + +extern "C" _OSP_EXPORT_ void STO_Destroy(void* pVisualElement, void* pEvasObject) { VisualElement* pVE = (VisualElement* )pVisualElement; @@ -201,6 +217,18 @@ Control::Construct(void) } result +Control::Destroy(void) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->Destroy(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::Draw(void) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -236,7 +264,18 @@ Control::Invalidate(bool recursive) } void -Control::InvalidateBounds(const Tizen::Graphics::Rectangle& bounds) +Control::InvalidateBounds(const Rectangle& bounds) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + pControlImpl->Invalidate(bounds); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} + +void +Control::InvalidateBounds(const FloatRectangle& bounds) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); @@ -281,6 +320,23 @@ CATCH: } Canvas* +Control::GetCanvasN(float x, float y, float w, float h) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + Canvas* pCanvas = pControlImpl->GetCanvasN(FloatRectangle(x, y, w, h)); + result r = GetLastResult(); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return pCanvas; + +CATCH: + delete pCanvas; + return null; +} + +Canvas* Control::GetCanvasN(const Rectangle& bounds) const { const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -297,6 +353,23 @@ CATCH: return null; } +Canvas* +Control::GetCanvasN(const FloatRectangle& bounds) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + Canvas* pCanvas = pControlImpl->GetCanvasN(bounds); + result r = GetLastResult(); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return pCanvas; + +CATCH: + delete pCanvas; + return null; +} + result Control::SetEnabled(bool enable) { @@ -349,6 +422,22 @@ Control::GetBounds(int& x, int& y, int& w, int& h) const h = bounds.height; } +void +Control::GetBounds(float& x, float& y, float& w, float& h) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatRectangle bounds = pControlImpl->GetBoundsF(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + x = bounds.x; + y = bounds.y; + w = bounds.width; + h = bounds.height; +} + Rectangle Control::GetBounds(void) const { @@ -364,6 +453,21 @@ Control::GetBounds(void) const return bounds; } +FloatRectangle +Control::GetBoundsF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatRectangle bounds = pControlImpl->GetBoundsF(); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorBounds, r, "[%s] Propagating.", GetErrorMessage(r)); + + return bounds; +} + Dimension Control::GetSize(void) const { @@ -380,6 +484,22 @@ Control::GetSize(void) const return size; } +FloatDimension +Control::GetSizeF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const FloatDimension errorSize(errorBounds.width, errorBounds.height); + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatDimension size = pControlImpl->GetSizeF(); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorSize, r, "[%s] Propagating.", GetErrorMessage(r)); + + return size; +} + void Control::GetSize(int& w, int& h) const { @@ -394,6 +514,20 @@ Control::GetSize(int& w, int& h) const h = size.height; } +void +Control::GetSize(float& w, float& h) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatDimension size = pControlImpl->GetSizeF(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + w = size.width; + h = size.height; +} + Point Control::GetPosition(void) const { @@ -410,6 +544,22 @@ Control::GetPosition(void) const return position; } +FloatPoint +Control::GetPositionF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const FloatPoint errorPosition(errorBounds.x, errorBounds.y); + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatPoint position = pControlImpl->GetPositionF(); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorPosition, r, "[%s] Propagating.", GetErrorMessage(r)); + + return position; +} + void Control::GetPosition(int& x, int& y) const { @@ -424,6 +574,20 @@ Control::GetPosition(int& x, int& y) const y = position.y; } +void +Control::GetPosition(float& x, float& y) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatPoint position = pControlImpl->GetPositionF(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + x = position.x; + y = position.y; +} + int Control::GetX(void) const { @@ -440,6 +604,22 @@ Control::GetX(void) const return x; } +float +Control::GetXF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const float errorX = errorBounds.x; + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + float x = pControlImpl->GetPositionF().x; + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorX, r, "[%s] Propagating.", GetErrorMessage(r)); + + return x; +} + int Control::GetY(void) const { @@ -456,6 +636,22 @@ Control::GetY(void) const return y; } +float +Control::GetYF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const float errorY = errorBounds.y; + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + float y = pControlImpl->GetPositionF().y; + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorY, r, "[%s] Propagating.", GetErrorMessage(r)); + + return y; +} + int Control::GetWidth(void) const { @@ -472,6 +668,22 @@ Control::GetWidth(void) const return width; } +float +Control::GetWidthF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const float errorWidth = errorBounds.width; + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + float width = pControlImpl->GetSizeF().width; + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorWidth, r, "[%s] Propagating.", GetErrorMessage(r)); + + return width; +} + int Control::GetHeight(void) const { @@ -488,6 +700,22 @@ Control::GetHeight(void) const return height; } +float +Control::GetHeightF(void) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const float errorHeight = errorBounds.height; + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + float height = pControlImpl->GetSizeF().height; + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorHeight, r, "[%s] Propagating.", GetErrorMessage(r)); + + return height; +} + Container* Control::GetParent(void) const { @@ -523,6 +751,18 @@ Control::SetBounds(int x, int y, int w, int h) } result +Control::SetBounds(float x, float y, float w, float h) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetBounds(FloatRectangle(x, y, w, h)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetBounds(const Rectangle& bounds) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -535,6 +775,18 @@ Control::SetBounds(const Rectangle& bounds) } result +Control::SetBounds(const FloatRectangle& bounds) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetBounds(bounds); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetSize(int w, int h) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -547,6 +799,18 @@ Control::SetSize(int w, int h) } result +Control::SetSize(float w, float h) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetSize(FloatDimension(w, h)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetSize(const Dimension& size) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -559,6 +823,18 @@ Control::SetSize(const Dimension& size) } result +Control::SetSize(const FloatDimension& size) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetSize(size); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetPosition(int x, int y) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -571,6 +847,18 @@ Control::SetPosition(int x, int y) } result +Control::SetPosition(float x, float y) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetPosition(FloatPoint(x, y)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetPosition(const Point& position) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -583,6 +871,18 @@ Control::SetPosition(const Point& position) } result +Control::SetPosition(const FloatPoint& position) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetPosition(position); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetFont(const String& fontName) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -656,6 +956,15 @@ Control::Contains(int x, int y) const } bool +Control::Contains(float x, float y) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pControlImpl->Contains(FloatPoint(x, y)); +} + +bool Control::Contains(const Point& point) const { const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -665,6 +974,15 @@ Control::Contains(const Point& point) const } bool +Control::Contains(const FloatPoint& point) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pControlImpl->Contains(point); +} + +bool Control::HasFocus(void) const { const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -771,6 +1089,16 @@ Control::AddDragDropEventListener(IDragDropEventListener& listener) } void +Control::AddDragDropEventListener(IDragDropEventListenerF& listener) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->AddDragDropEventListener(listener); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} + +void Control::RemoveDragDropEventListener(IDragDropEventListener& listener) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -781,6 +1109,16 @@ Control::RemoveDragDropEventListener(IDragDropEventListener& listener) } void +Control::RemoveDragDropEventListenerF(IDragDropEventListenerF& listener) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->RemoveDragDropEventListenerF(listener); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} + +void Control::AddTouchModeChangedEventListener(ITouchModeChangedEventListener& listener) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -1024,6 +1362,18 @@ Control::SetMinimumSize(const Dimension& minSize) } result +Control::SetMinimumSize(const FloatDimension& minSize) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetMinimumSize(minSize); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result Control::SetMaximumSize(const Dimension& maxSize) { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); @@ -1035,6 +1385,18 @@ Control::SetMaximumSize(const Dimension& maxSize) return E_SUCCESS; } +result +Control::SetMaximumSize(const FloatDimension& maxSize) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetMaximumSize(maxSize); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + Point Control::ConvertToControlPosition(const Point& screenPosition) const { @@ -1051,6 +1413,22 @@ Control::ConvertToControlPosition(const Point& screenPosition) const return point; } +FloatPoint +Control::ConvertToControlPosition(const FloatPoint& screenPosition) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const FloatPoint errorPosition(errorBounds.x, errorBounds.y); + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + FloatPoint point = pControlImpl->ConvertToControlPosition(screenPosition); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorPosition, r, "[%s] Propagating.", GetErrorMessage(r)); + + return point; +} + Point Control::ConvertToScreenPosition(const Point& controlPosition) const { @@ -1067,6 +1445,22 @@ Control::ConvertToScreenPosition(const Point& controlPosition) const return point; } +FloatPoint +Control::ConvertToScreenPosition(const FloatPoint& controlPosition) const +{ + const FloatRectangle errorBounds = _ControlImpl::GetErrorBoundsF(); + const FloatPoint errorPosition(errorBounds.x, errorBounds.y); + + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + FloatPoint point = pControlImpl->ConvertToScreenPosition(controlPosition); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, errorPosition, r, "[%s] Propagating.", GetErrorMessage(r)); + + return point; +} + Dimension Control::GetMinimumSize(void) const { @@ -1076,6 +1470,15 @@ Control::GetMinimumSize(void) const return pControlImpl->GetMinimumSize(); } +FloatDimension +Control::GetMinimumSizeF(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pControlImpl->GetMinimumSizeF(); +} + Dimension Control::GetMaximumSize(void) const { @@ -1085,6 +1488,15 @@ Control::GetMaximumSize(void) const return pControlImpl->GetMaximumSize(); } +FloatDimension +Control::GetMaximumSizeF(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pControlImpl->GetMaximumSizeF(); +} + ControlAnimator* Control::GetControlAnimator(void) const { @@ -1097,10 +1509,16 @@ Control::GetControlAnimator(void) const result Control::AddGestureDetector(const TouchGestureDetector& gestureDetector) { + return AddGestureDetector(const_cast< TouchGestureDetector* >(&gestureDetector)); +} + +result +Control::AddGestureDetector(TouchGestureDetector* pGestureDetector) +{ _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pControlImpl->AddGestureDetector(gestureDetector); + result r = pControlImpl->AddGestureDetector(*pGestureDetector); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -1109,15 +1527,61 @@ Control::AddGestureDetector(const TouchGestureDetector& gestureDetector) result Control::RemoveGestureDetector(const TouchGestureDetector& gestureDetector) { + return RemoveGestureDetector(const_cast< TouchGestureDetector* >(&gestureDetector)); +} + +result +Control::RemoveGestureDetector(TouchGestureDetector* pGestureDetector) +{ _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pControlImpl->RemoveGestureDetector(gestureDetector); + result r = pControlImpl->RemoveGestureDetector(*pGestureDetector); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } +void +Control::SetContentAreaBounds(const Rectangle& rect) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + pControlImpl->SetContentAreaBounds(rect); +} + +void +Control::SetContentAreaBounds(const FloatRectangle& rect) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + pControlImpl->SetContentAreaBounds(rect); +} + +Rectangle +Control::GetContentAreaBounds(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + Rectangle bounds = pControlImpl->GetContentAreaBounds(); + + return bounds; +} + +FloatRectangle +Control::GetContentAreaBoundsF(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + FloatRectangle bounds = pControlImpl->GetContentAreaBoundsF(); + + return bounds; +} + Bitmap* Control::GetCapturedBitmapN(void) const { @@ -1136,6 +1600,15 @@ Control::GetInvalidatedBounds(void) const return pControlImpl->GetInvalidatedBounds(); } +FloatRectangle +Control::GetInvalidatedBoundsF(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pControlImpl->GetInvalidatedBoundsF(); +} + void Control::SetMultipointTouchEnabled(bool enable) { @@ -1174,4 +1647,106 @@ Control::GetAccessibilityContainer(void) return pControlImpl->GetAccessibilityContainer(); } + +void +Control::SetPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + pControlImpl->SetPublicPropagatedTouchEventListener(pListener); +} + +void +Control::SetPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + pControlImpl->SetPublicPropagatedKeyEventListener(pListener); +} + +void +Control::SetPreviousFocus(Control* pPreviousFocus) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + _ControlImpl* pPreviousFocusControlImpl = _ControlImpl::GetInstance(*pPreviousFocus); + SysAssertf(pPreviousFocusControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + pControlImpl->SetPreviousFocus(pPreviousFocusControlImpl); + +} + + void + Control::SetNextFocus(Control* pNextFocus) + { + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + _ControlImpl* pNextFocusControlImpl = _ControlImpl::GetInstance(*pNextFocus); + SysAssertf(pNextFocusControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + pControlImpl->SetNextFocus(pNextFocusControlImpl); + + } + +Control* +Control::GetPreviousFocus(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + _ControlImpl*previousControl = pControlImpl->GetPreviousFocus(); + return &previousControl->GetPublic(); + +} + +Control* +Control::GetNextFocus(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + _ControlImpl*nextControl = pControlImpl->GetNextFocus(); + return &nextControl->GetPublic(); + +} + +void +Control::SetTouchPressThreshold(float distance) +{ + _ControlImpl* pControlImpl = const_cast<_ControlImpl*>(_ControlImpl::GetInstance(*this)); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pControlImpl->SetTouchPressThreshold(distance); +} + +float +Control::GetTouchPressThreshold(void) const +{ + _ControlImpl* pControlImpl = const_cast<_ControlImpl*>(_ControlImpl::GetInstance(*this)); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pControlImpl->GetTouchPressThreshold(); +} +result +Control::SetFontFromFile(const Tizen::Base::String& fileName) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pControlImpl->SetFontFromFile(fileName); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return E_SUCCESS; +} + +String +Control::GetFontFile(void) const +{ + const _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this); + SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pControlImpl->GetFontFile(); +} }} // Tizen::Ui diff --git a/src/ui/FUiCustomControlBase.cpp b/src/ui/FUiCustomControlBase.cpp old mode 100644 new mode 100755 index 9b991b1..5af73e1 --- a/src/ui/FUiCustomControlBase.cpp +++ b/src/ui/FUiCustomControlBase.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCustomControlBase.cpp * @brief This is the implementation for the CustomControlBase class. diff --git a/src/ui/FUiGridLayout.cpp b/src/ui/FUiGridLayout.cpp old mode 100644 new mode 100755 index 01830af..336a7c1 --- a/src/ui/FUiGridLayout.cpp +++ b/src/ui/FUiGridLayout.cpp @@ -24,6 +24,7 @@ #include #include #include "FUi_GridLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -170,6 +171,23 @@ GridLayout::SetColumnSpacing(int columnIndex, int space) SysTryReturn(NID_UI, (columnIndex >= 0) && (columnIndex <= GetColumnCount() - 1), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The given parameter is out of range."); SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + result r = pGridLayoutImpl->SetColumnSpacing(columnIndex, _CoordinateSystemUtils::ConvertToFloat(space)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +GridLayout::SetColumnSpacing(int columnIndex, float space) +{ + ClearLastResult(); + + _GridLayoutImpl* pGridLayoutImpl = _GridLayoutImpl::GetInstance(*this); + SysAssertf(pGridLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + SysTryReturn(NID_UI, (columnIndex >= 0) && (columnIndex <= GetColumnCount() - 1), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The given parameter is out of range."); + SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + result r = pGridLayoutImpl->SetColumnSpacing(columnIndex, space); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -262,6 +280,23 @@ GridLayout::SetRowSpacing(int rowIndex, int space) SysTryReturn(NID_UI, (rowIndex >= 0) && (rowIndex <= GetRowCount() - 1), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The given parameter is out of range."); SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + result r = pGridLayoutImpl->SetRowSpacing(rowIndex, _CoordinateSystemUtils::ConvertToFloat(space)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +GridLayout::SetRowSpacing(int rowIndex, float space) +{ + ClearLastResult(); + + _GridLayoutImpl* pGridLayoutImpl = _GridLayoutImpl::GetInstance(*this); + SysAssertf(pGridLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + SysTryReturn(NID_UI, (rowIndex >= 0) && (rowIndex <= GetRowCount() - 1), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The given parameter is out of range."); + SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + result r = pGridLayoutImpl->SetRowSpacing(rowIndex, space); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -315,10 +350,34 @@ GridLayout::SetMargin(Control& childControl, int left, int right, int top, int b _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + float floatLeft = _CoordinateSystemUtils::ConvertToFloat(left); + float floatRight = _CoordinateSystemUtils::ConvertToFloat(right); + float floatTop = _CoordinateSystemUtils::ConvertToFloat(top); + float floatBottom = _CoordinateSystemUtils::ConvertToFloat(bottom); + result r = pGridLayoutImpl->SetMargin(*pControlImpl, floatLeft, floatRight, floatTop, floatBottom); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +GridLayout::SetMargin(Control& childControl, float left, float right, float top, float bottom) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, (left >= 0) && (right >= 0) && (top >= 0) && (bottom >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _GridLayoutImpl* pGridLayoutImpl = _GridLayoutImpl::GetInstance(*this); + SysAssertf(pGridLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pGridLayoutImpl->SetMargin(*pControlImpl, left, right, top, bottom); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; } + }} // Tizen::Ui diff --git a/src/ui/FUiHorizontalBoxLayout.cpp b/src/ui/FUiHorizontalBoxLayout.cpp old mode 100644 new mode 100755 index 5107f59..acf2aab --- a/src/ui/FUiHorizontalBoxLayout.cpp +++ b/src/ui/FUiHorizontalBoxLayout.cpp @@ -25,6 +25,7 @@ #include #include #include "FUi_HorizontalBoxLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -112,6 +113,25 @@ HorizontalBoxLayout::SetSpacing(Control& childControl, int space) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetSpacing(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(space)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +HorizontalBoxLayout::SetSpacing(Control& childControl, float space) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _HorizontalBoxLayoutImpl* pHorizontalBoxLayoutImpl = _HorizontalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pHorizontalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetSpacing(*pControlImpl, space); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -131,6 +151,27 @@ HorizontalBoxLayout::SetVerticalMargin(Control& childControl, int top, int botto _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + float floatTop = _CoordinateSystemUtils::ConvertToFloat(top); + float floatBottom = _CoordinateSystemUtils::ConvertToFloat(bottom); + result r = pHorizontalBoxLayoutImpl->SetVerticalMargin(*pControlImpl, floatTop, floatBottom); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +HorizontalBoxLayout::SetVerticalMargin(Control& childControl, float top, float bottom) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, (top >= 0) && (bottom >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _HorizontalBoxLayoutImpl* pHorizontalBoxLayoutImpl = _HorizontalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pHorizontalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetVerticalMargin(*pControlImpl, top, bottom); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -150,6 +191,25 @@ HorizontalBoxLayout::SetWidth(Control& childControl, int width) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetWidth(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(width)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +HorizontalBoxLayout::SetWidth(Control& childControl, float width) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, width >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _HorizontalBoxLayoutImpl* pHorizontalBoxLayoutImpl = _HorizontalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pHorizontalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetWidth(*pControlImpl, width); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -173,7 +233,6 @@ HorizontalBoxLayout::SetHorizontalFitPolicy(Control& childControl, FitPolicy pol { return E_SUCCESS; } - } result r = pHorizontalBoxLayoutImpl->SetItemHorizontalFitPolicy(*pControlImpl, policy); @@ -195,6 +254,25 @@ HorizontalBoxLayout::SetHeight(Control& childControl, int height) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetHeight(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(height)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +HorizontalBoxLayout::SetHeight(Control& childControl, float height) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, height >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _HorizontalBoxLayoutImpl* pHorizontalBoxLayoutImpl = _HorizontalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pHorizontalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pHorizontalBoxLayoutImpl->SetHeight(*pControlImpl, height); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/FUiInputConnection.cpp b/src/ui/FUiInputConnection.cpp old mode 100644 new mode 100755 index c5ace55..1341bc5 --- a/src/ui/FUiInputConnection.cpp +++ b/src/ui/FUiInputConnection.cpp @@ -27,7 +27,7 @@ #include "FUi_ControlImpl.h" #include "FUi_InputConnectionImpl.h" - +using namespace Tizen::Base; using namespace Tizen::Graphics; using namespace Tizen::Locales; using namespace Tizen::Security; @@ -70,6 +70,26 @@ CATCH: } result +InputConnection::Construct(const Control* pControl, IInputConnectionEventListenerF& listener, IInputConnectionProvider& provider) +{ + SysTryReturnResult(NID_UI, pControl, E_INVALID_ARG, "The argument is invalid."); + + __pInputConnectionImpl = _InputConnectionImpl::CreateInputConnectionImplN(this); + result r = GetLastResult(); + SysTryReturn(NID_UI, __pInputConnectionImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pInputConnectionImpl->Initialize(_ControlImpl::GetInstance(*pControl)->GetCore(), listener, provider); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete __pInputConnectionImpl; + __pInputConnectionImpl = null; + return r; +} + +result InputConnection::BindInputMethod(void) { result r = E_SUCCESS; @@ -205,6 +225,19 @@ InputConnection::SetCursorBounds(const Rectangle& rect) return r; } +result +InputConnection::SetCursorBounds(const FloatRectangle& rect) +{ + result r = E_SUCCESS; + + SysAssertf(__pInputConnectionImpl, "Not yet constructed. Construct() should be called before use."); + + r = __pInputConnectionImpl->SetCursorBounds(rect); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + Rectangle InputConnection::GetInputPanelBounds(void) const { @@ -219,6 +252,20 @@ InputConnection::GetInputPanelBounds(void) const return bounds; } +FloatRectangle +InputConnection::GetInputPanelBoundsF(void) const +{ + result r = E_SUCCESS; + + SysAssertf(__pInputConnectionImpl, "Not yet constructed. Construct() should be called before use."); + + FloatRectangle bounds = __pInputConnectionImpl->GetInputPanelBoundsF(); + r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), r, "[%s] Propagating.", GetErrorMessage(r)); + + return bounds; +} + void InputConnection::SetTextPredictionEnabled(bool enable) { @@ -229,4 +276,14 @@ InputConnection::SetTextPredictionEnabled(bool enable) return; } +void +InputConnection::SendOpaqueCommand(const String& command) +{ + SysAssertf(__pInputConnectionImpl, "Not yet constructed. Construct() should be called before use."); + + __pInputConnectionImpl->SendOpaqueCommand(command); + + return; +} + }} //Tizen::Ui diff --git a/src/ui/FUiKeyEventInfo.cpp b/src/ui/FUiKeyEventInfo.cpp new file mode 100644 index 0000000..2cdbd79 --- /dev/null +++ b/src/ui/FUiKeyEventInfo.cpp @@ -0,0 +1,80 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUiKeyEventInfo.cpp + * @brief This is the implementation file for the KeyEventInfo class. + */ + +#include +#include +#include +#include + +namespace Tizen { namespace Ui +{ + +KeyEventInfo::KeyEventInfo(KeyCode keyCode, int keyModifiers) +{ + _KeyEventInfoImpl* pImpl = _KeyEventInfoImpl::CreateInstanceN(this); + + result r = GetLastResult(); + SysAssertf(__pKeyEventInfoImpl != null, "[%s] Propagating.", GetErrorMessage(r)); + + __pKeyEventInfoImpl = pImpl; + __pKeyEventInfoImpl->SetKeyEventInfo(keyCode, keyModifiers); +} + +KeyEventInfo::~KeyEventInfo(void) +{ + delete __pKeyEventInfoImpl; + __pKeyEventInfoImpl = null; +} + +void +KeyEventInfo::SetKeyCode(KeyCode keyCode) +{ + SysAssertf(__pKeyEventInfoImpl != null, "Not yet constructed. KeyEventInfo() should be called before used."); + + __pKeyEventInfoImpl->SetKeyCode(keyCode); +} + +KeyCode +KeyEventInfo::GetKeyCode(void) const +{ + SysAssertf(__pKeyEventInfoImpl != null, "Not yet constructed. KeyEventInfo() should be called before used."); + + return __pKeyEventInfoImpl->GetKeyCode(); +} + +void +KeyEventInfo::SetKeyModifier(int keyModifiers) +{ + SysAssertf(__pKeyEventInfoImpl != null, "Not yet constructed. KeyEventInfo() should be called before used."); + + __pKeyEventInfoImpl->SetKeyModifier(keyModifiers); +} + +int +KeyEventInfo::GetKeyModifier(void) const +{ + SysAssertf(__pKeyEventInfoImpl != null, "Not yet constructed. KeyEventInfo() should be called before used."); + + return __pKeyEventInfoImpl->GetKeyModifier(); +} + +}} // Tizen::Ui + diff --git a/src/ui/FUiKeyEventManager.cpp b/src/ui/FUiKeyEventManager.cpp index 41b6a8c..20a76c8 100644 --- a/src/ui/FUiKeyEventManager.cpp +++ b/src/ui/FUiKeyEventManager.cpp @@ -70,7 +70,7 @@ KeyEventManager::GetInstance(void) void KeyEventManager::InitializeInstance(void) - { +{ static KeyEventManager instance; pKeyEventManagerInstance = &instance; diff --git a/src/ui/FUiKeyboardMap.cpp b/src/ui/FUiKeyboardMap.cpp old mode 100644 new mode 100755 diff --git a/src/ui/FUiRelativeLayout.cpp b/src/ui/FUiRelativeLayout.cpp old mode 100644 new mode 100755 index 609174f..b5498ff --- a/src/ui/FUiRelativeLayout.cpp +++ b/src/ui/FUiRelativeLayout.cpp @@ -24,6 +24,7 @@ #include #include #include "FUi_RelativeLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -82,6 +83,28 @@ RelativeLayout::SetRelation(Control& childControl, const Control& targetControl, } result +RelativeLayout::SetRelation(Control& childControl, Control* pTargetControl, RectangleEdgeRelation edgeRelation) +{ + ClearLastResult(); + + _RelativeLayoutImpl* pRelativeLayoutImpl = _RelativeLayoutImpl::GetInstance(*this); + SysAssertf(pRelativeLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + + _ControlImpl* pTargetControlImpl = _ControlImpl::GetInstance(*pTargetControl); + SysTryReturn(NID_UI, pTargetControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + + result r = E_SUCCESS; + + r = pRelativeLayoutImpl->SetRelation(*pControlImpl, *pTargetControlImpl, edgeRelation); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result RelativeLayout::ResetRelation(Control& childControl, RectangleEdgeType edgeType) { ClearLastResult(); @@ -143,6 +166,27 @@ RelativeLayout::SetMargin(Control& childControl, int left, int right, int top, i _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + float floatLeft = _CoordinateSystemUtils::ConvertToFloat(left); + float floatRight = _CoordinateSystemUtils::ConvertToFloat(right); + float floatTop = _CoordinateSystemUtils::ConvertToFloat(top); + float floatBottom = _CoordinateSystemUtils::ConvertToFloat(bottom); + result r = pRelativeLayoutImpl->SetItemMargin(*pControlImpl, floatLeft, floatRight, floatTop, floatBottom); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +RelativeLayout::SetMargin(Control& childControl, float left, float right, float top, float bottom) +{ + ClearLastResult(); + + _RelativeLayoutImpl* pRelativeLayoutImpl = _RelativeLayoutImpl::GetInstance(*this); + SysAssertf(pRelativeLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pRelativeLayoutImpl->SetItemMargin(*pControlImpl, left, right, top, bottom); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -160,6 +204,23 @@ RelativeLayout::SetWidth(Control& childControl, int width) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pRelativeLayoutImpl->SetWidth(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(width)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +RelativeLayout::SetWidth(Control& childControl, float width) +{ + ClearLastResult(); + + _RelativeLayoutImpl* pRelativeLayoutImpl = _RelativeLayoutImpl::GetInstance(*this); + SysAssertf(pRelativeLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pRelativeLayoutImpl->SetWidth(*pControlImpl, width); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -177,6 +238,23 @@ RelativeLayout::SetHeight(Control& childControl, int height) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pRelativeLayoutImpl->SetHeight(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(height)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +RelativeLayout::SetHeight(Control& childControl, float height) +{ + ClearLastResult(); + + _RelativeLayoutImpl* pRelativeLayoutImpl = _RelativeLayoutImpl::GetInstance(*this); + SysAssertf(pRelativeLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pRelativeLayoutImpl->SetHeight(*pControlImpl, height); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/FUiSystemUtil.cpp b/src/ui/FUiSystemUtil.cpp index 937de6e..d31c800 100644 --- a/src/ui/FUiSystemUtil.cpp +++ b/src/ui/FUiSystemUtil.cpp @@ -14,25 +14,16 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#include -#include -#include -#include -//to avoid camera key code definition -#ifdef KEY_CAMERA -#undef KEY_CAMERA -#endif -#include -#include #include #include +#include #include -#include #include #include #include "FSec_AccessController.h" #include "FApp_AppInfo.h" +#include "FUi_UiKeyEvent.h" using namespace Tizen::Security; using namespace Tizen::Graphics; @@ -41,108 +32,6 @@ using namespace Tizen::Base; namespace Tizen { namespace Ui { -struct ConvertKeys -{ - KeyCode code; - const char* pName; -}; - -const ConvertKeys KeyCodeMap[] = { - { KEY_INVALID, "" }, - { KEY_SIDE_UP, "XF86AudioRaiseVolume" }, - { KEY_SIDE_DOWN, "XF86AudioLowerVolume" }, - { KEY_OK, "XF86Phone" }, - { KEY_CLEAR, "" }, - { KEY_CAMERA, "" }, - { KEY_SWITCH, "" }, - { KEY_0, "0" }, - { KEY_1, "1" }, - { KEY_2, "2" }, - { KEY_3, "3" }, - { KEY_4, "4" }, - { KEY_5, "5" }, - { KEY_6, "6" }, - { KEY_7, "7" }, - { KEY_8, "8" }, - { KEY_9, "9" }, - { KEY_ASTERISK, "" }, - { KEY_SHARP, "" }, - { KEY_LEFT, "KP_Left" }, - { KEY_UP, "KP_Up" }, - { KEY_DOWN, "KP_Down" }, - { KEY_RIGHT, "KP_Right" }, - { KEY_MAX, "" }, - { KEY_A, "a" }, - { KEY_B, "b" }, - { KEY_C, "c" }, - { KEY_D, "d" }, - { KEY_E, "e" }, - { KEY_F, "f" }, - { KEY_G, "g" }, - { KEY_H, "h" }, - { KEY_I, "i" }, - { KEY_J, "j" }, - { KEY_K, "k" }, - { KEY_L, "l" }, - { KEY_M, "m" }, - { KEY_N, "n" }, - { KEY_O, "o" }, - { KEY_P, "p" }, - { KEY_Q, "q" }, - { KEY_R, "r" }, - { KEY_S, "s" }, - { KEY_T, "t" }, - { KEY_U, "u" }, - { KEY_V, "v" }, - { KEY_W, "w" }, - { KEY_Y, "y" }, - { KEY_X, "x" }, - { KEY_Z, "z" }, - { KEY_BACKSPACE, "BackSpace" }, - { KEY_COMMA, "comma" }, - { KEY_ENTER, "" }, - { KEY_CAPSLOCK, "Caps_Lock" }, - { KEY_QUESTION, "" }, - { KEY_ALT, "Alt_L" }, - { KEY_SYM, "" }, - { KEY_SETTING, "" }, - { KEY_SPACE, "space" }, - { KEY_DOT, "" }, - { KEY_FN, "" }, - { KEY_CAMERA_HALF_SHUTTER, "" }, - { KEY_CHAR_SYM_1, "" }, - { KEY_CHAR_SYM_2, "" }, - { KEY_CHAR_SYM_3, "" }, - { KEY_CHAR_SYM_4, "" }, - { KEY_CHAR_SYM_5, "" }, - { KEY_CHAR_SYM_6, "" }, - { KEY_CHAR_SYM_7, "" }, - { KEY_CHAR_SYM_8, "" }, - { KEY_CHAR_SYM_9, "" }, - { KEY_CHAR_SYM_A, "" }, - { KEY_CHAR_SYM_B, "" }, - { KEY_CHAR_SYM_C, "" }, - { KEY_CHAR_SYM_D, "" }, - { KEY_CHAR_SYM_E, "" }, - { KEY_CHAR_SYM_F, "" }, - { KEY_FN_1, "" }, - { KEY_FN_2, "" }, - { KEY_FN_3, "" }, - { KEY_FN_4, "" }, - { KEY_FN_5, "" }, - { KEY_POWER_HOLD, "XF86PowerOff" }, - { KEY_DELETE, "" }, - { KEY_HARDWARE_MAX, "" }, -}; - -struct _DisplayDeleter -{ - void operator()(Display* pDisplay) - { - XCloseDisplay(pDisplay); - } -}; - SystemUtil::SystemUtil(void) { } @@ -156,50 +45,13 @@ SystemUtil::GenerateKeyEvent(KeyEventType KeyEvent, KeyCode keyCode) { result r = E_SUCCESS; - const String& appId = Tizen::App::_AppInfo::GetAppId(); + const String& packageId = Tizen::App::_AppInfo::GetPackageId(); - r = _AccessController::CheckSystemPrivilege(appId, _PRV_INPUTMANAGER); + r = _AccessController::CheckSystemPrivilege(packageId, _PRV_INPUTMANAGER); SysTryReturn(NID_UI, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.")); - Display* pDisplay = (Display*)ecore_x_display_get(); - SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!"); - - std::unique_ptr pDpy(XOpenDisplay(NULL)); - SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); - - int key = -1; - - for (unsigned int idx = 0; idx < sizeof(KeyCodeMap) / sizeof(ConvertKeys); ++idx) - { - if (KeyCodeMap[idx].code == keyCode) - { - KeySym keySym = XStringToKeysym(KeyCodeMap[idx].pName); - key = (int) XKeysymToKeycode(pDpy.get(), keySym); - break; - } - } - - if (key == -1) - { - SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Unsupported KeyCode argument."); - return E_INVALID_ARG; - } - - switch (KeyEvent) - { - case KEY_EVENT_TYPE_PRESSED: - XTestFakeKeyEvent(pDisplay, key, true, CurrentTime); - break; - - case KEY_EVENT_TYPE_RELEASED: - XTestFakeKeyEvent(pDisplay, key, false, CurrentTime); - break; - - default: - SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Invalid KeyEventType argument."); - return E_INVALID_ARG; - } + r = _SystemUtilImpl::GenerateKeyEvent(KeyEvent, static_cast(keyCode)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -209,52 +61,31 @@ result SystemUtil::GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point) { result r = E_SUCCESS; - const String& appId = Tizen::App::_AppInfo::GetAppId(); + const String& packageId = Tizen::App::_AppInfo::GetPackageId(); - r = _AccessController::CheckSystemPrivilege(appId, _PRV_INPUTMANAGER); + r = _AccessController::CheckSystemPrivilege(packageId, _PRV_INPUTMANAGER); SysTryReturn(NID_UI, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.")); - Display* pDisplay = (Display*)ecore_x_display_get(); - SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!"); - - std::unique_ptr pDpy(XOpenDisplay(NULL)); - SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); - - int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get())); - int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get())); - - if (( point.x<0 || point.x>width) || (point.y<0 || point.y>height)) - { - SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Out of bounds x, y argument."); - return E_INVALID_ARG; - } + r = _SystemUtilImpl::GenerateTouchEvent(touchEvent, point); - int screenNumber = 0; //main screen - int button = 1; //left button + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return r; +} - switch (touchEvent) - { - case TOUCH_EVENT_TYPE_PRESSED: - XWarpPointer(pDisplay, None, XRootWindow(pDisplay, 0), 0, 0, 0, 0, point.x, point.y); - XTestFakeButtonEvent(pDisplay, button, true, CurrentTime); - break; +result +SystemUtil::GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::FloatPoint& point) +{ + result r = E_SUCCESS; + const String& packageId = Tizen::App::_AppInfo::GetPackageId(); - case TOUCH_EVENT_TYPE_RELEASED: - XWarpPointer(pDisplay, None, XRootWindow(pDisplay, 0), 0, 0, 0, 0, point.x, point.y); - XTestFakeButtonEvent(pDisplay, button, false, CurrentTime); - break; + r = _AccessController::CheckSystemPrivilege(packageId, _PRV_INPUTMANAGER); - case TOUCH_EVENT_TYPE_MOVED: - XTestFakeMotionEvent(pDisplay, screenNumber, point.x, point.y, CurrentTime); - break; + SysTryReturn(NID_UI, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED, ("[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.")); - default: - SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Invalid TouchEventType argument."); - return E_INVALID_ARG; - } + r = _SystemUtilImpl::GenerateTouchEvent(touchEvent, point); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); //fix me + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; } @@ -262,36 +93,13 @@ Tizen::Graphics::Bitmap* SystemUtil::CaptureScreenN(void) { result r = E_SUCCESS; - const String& appId = Tizen::App::_AppInfo::GetAppId(); + const String& packageId = Tizen::App::_AppInfo::GetPackageId(); - r = _AccessController::CheckSystemPrivilege(appId, _PRV_INPUTMANAGER); + r = _AccessController::CheckSystemPrivilege(packageId, _PRV_INPUTMANAGER); SysTryReturn(NID_UI, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); - std::unique_ptr pDpy(XOpenDisplay(NULL)); - SysTryReturn(NID_UI, pDpy, null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); - - int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get())); - int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get())); - - void* pDump = utilx_create_screen_shot(pDpy.get(), width, height); - SysTryReturn(NID_UI, pDump, null, E_SYSTEM, "[E_SYSTEM] pDump is invalid. something wrong!"); - - std::unique_ptr pBuffer(new (std::nothrow) ByteBuffer()); - SysTryReturn(NID_UI, pBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure."); - - r = pBuffer->Construct(static_cast(pDump), 0, width*height*4, width*height*4); - SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - - Tizen::Graphics::Dimension dim(width, height); - std::unique_ptr pBitmap(new (std::nothrow) Bitmap()); - SysTryReturn(NID_UI, pBitmap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure."); - - r = pBitmap->Construct(*pBuffer, dim, BITMAP_PIXEL_FORMAT_ARGB8888); - SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - - utilx_release_screen_shot(); - return pBitmap.release(); + return _SystemUtilImpl::CaptureScreenN(); } }} //Tizen::Ui diff --git a/src/ui/FUiTouch.cpp b/src/ui/FUiTouch.cpp index 66d494c..529a86a 100644 --- a/src/ui/FUiTouch.cpp +++ b/src/ui/FUiTouch.cpp @@ -129,7 +129,7 @@ Touch::GetPosition(void) const _TouchManager* pTouchManager = _TouchManager::GetInstance(); SysTryReturn(NID_UI, pTouchManager, errorPoint, E_SYSTEM, "[E_SYSTEM] System error occurred."); - return pTouchManager->GetScreenPoint(pTouchManager->GetCurrentPointId()); + return _CoordinateSystemUtils::ConvertToInteger(pTouchManager->GetScreenPoint(pTouchManager->GetCurrentPointId())); } Point @@ -140,7 +140,7 @@ Touch::GetPosition(unsigned long id) const _TouchManager* pTouchManager = _TouchManager::GetInstance(); SysTryReturn(NID_UI, pTouchManager, errorPoint, E_SYSTEM, "[E_SYSTEM] System error occurred."); - return pTouchManager->GetScreenPoint(id); + return _CoordinateSystemUtils::ConvertToInteger(pTouchManager->GetScreenPoint(id)); } Point diff --git a/src/ui/FUiTouchEventInfo.cpp b/src/ui/FUiTouchEventInfo.cpp index 8253d43..b9f0397 100644 --- a/src/ui/FUiTouchEventInfo.cpp +++ b/src/ui/FUiTouchEventInfo.cpp @@ -85,6 +85,14 @@ TouchEventInfo::GetStartPosition(void) const return __pTouchEventInfoImpl->GetStartPosition(); } +FloatPoint +TouchEventInfo::GetStartPositionF(void) const +{ + SysAssertf(__pTouchEventInfoImpl != null, "Not yet constructed. Construct() should be called before used."); + + return __pTouchEventInfoImpl->GetStartPositionF(); +} + Point TouchEventInfo::GetCurrentPosition(void) const { @@ -93,6 +101,14 @@ TouchEventInfo::GetCurrentPosition(void) const return __pTouchEventInfoImpl->GetCurrentPosition(); } +FloatPoint +TouchEventInfo::GetCurrentPositionF(void) const +{ + SysAssertf(__pTouchEventInfoImpl != null, "Not yet constructed. Construct() should be called before used."); + + return __pTouchEventInfoImpl->GetCurrentPositionF(); +} + TouchStatus TouchEventInfo::GetTouchStatus(void) const diff --git a/src/ui/FUiTouchFlickGestureDetector.cpp b/src/ui/FUiTouchFlickGestureDetector.cpp index 9ffdd52..d340f3a 100644 --- a/src/ui/FUiTouchFlickGestureDetector.cpp +++ b/src/ui/FUiTouchFlickGestureDetector.cpp @@ -82,6 +82,15 @@ TouchFlickGestureDetector::GetDistance(int& xDistance, int& yDistance) const return pTouchFlickGestureDetectorImpl->GetDistance(xDistance, yDistance); } +result +TouchFlickGestureDetector::GetDistance(float& xDistance, float& yDistance) const +{ + const _TouchFlickGestureDetectorImpl* pTouchFlickGestureDetectorImpl = _TouchFlickGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchFlickGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchFlickGestureDetectorImpl->GetDistance(xDistance, yDistance); +} + int TouchFlickGestureDetector::GetDuration(void) const { diff --git a/src/ui/FUiTouchGestureDetector.cpp b/src/ui/FUiTouchGestureDetector.cpp index 4675bb8..177fbb0 100644 --- a/src/ui/FUiTouchGestureDetector.cpp +++ b/src/ui/FUiTouchGestureDetector.cpp @@ -144,9 +144,15 @@ TouchGestureDetector::IsCancelTouchEventOnSuccessEnabled(void) const result TouchGestureDetector::StartOnFailureOf(const TouchGestureDetector& gesture) { + return StartOnFailureOf(const_cast< TouchGestureDetector* >(&gesture)); +} + +result +TouchGestureDetector::StartOnFailureOf(TouchGestureDetector* pGestureDetector) +{ SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); - result r = __pTouchGestureDetectorImpl->StartOnFailureOf(gesture); + result r = __pTouchGestureDetectorImpl->StartOnFailureOf(*pGestureDetector); SysTryLog(NID_UI, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); return r; diff --git a/src/ui/FUiTouchLongPressGestureDetector.cpp b/src/ui/FUiTouchLongPressGestureDetector.cpp index a22d305..4b66661 100644 --- a/src/ui/FUiTouchLongPressGestureDetector.cpp +++ b/src/ui/FUiTouchLongPressGestureDetector.cpp @@ -101,6 +101,17 @@ TouchLongPressGestureDetector::SetMoveAllowance(int allowance) return pTouchLongPressGestureDetectorImpl->SetMoveAllowance(allowance); } +result +TouchLongPressGestureDetector::SetMoveAllowance(float allowance) +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + _TouchLongPressGestureDetectorImpl* pTouchLongPressGestureDetectorImpl = _TouchLongPressGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchLongPressGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchLongPressGestureDetectorImpl->SetMoveAllowance(allowance); +} + int TouchLongPressGestureDetector::GetMoveAllowance(void) const { @@ -112,6 +123,17 @@ TouchLongPressGestureDetector::GetMoveAllowance(void) const return pTouchLongPressGestureDetectorImpl->GetMoveAllowance(); } +float +TouchLongPressGestureDetector::GetMoveAllowanceF(void) const +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + const _TouchLongPressGestureDetectorImpl* pTouchLongPressGestureDetectorImpl = _TouchLongPressGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchLongPressGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchLongPressGestureDetectorImpl->GetMoveAllowanceF(); +} + result TouchLongPressGestureDetector::SetTouchCount(int count) { diff --git a/src/ui/FUiTouchPinchGestureDetector.cpp b/src/ui/FUiTouchPinchGestureDetector.cpp index 27fc4d2..71ba652 100644 --- a/src/ui/FUiTouchPinchGestureDetector.cpp +++ b/src/ui/FUiTouchPinchGestureDetector.cpp @@ -78,6 +78,17 @@ TouchPinchGestureDetector::GetCenterPoint(void) const return pTouchPinchGestureDetectorImpl->GetCenterPoint(); } +Tizen::Graphics::FloatPoint +TouchPinchGestureDetector::GetCenterPointF(void) const +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + const _TouchPinchGestureDetectorImpl* pTouchPinchGestureDetectorImpl = _TouchPinchGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchPinchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchPinchGestureDetectorImpl->GetCenterPointF(); +} + int TouchPinchGestureDetector::GetScale(void) const { @@ -89,4 +100,15 @@ TouchPinchGestureDetector::GetScale(void) const return pTouchPinchGestureDetectorImpl->GetScale(); } +float +TouchPinchGestureDetector::GetScaleF(void) const +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + const _TouchPinchGestureDetectorImpl* pTouchPinchGestureDetectorImpl = _TouchPinchGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchPinchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchPinchGestureDetectorImpl->GetScaleF(); +} + } } //Tizen::Ui diff --git a/src/ui/FUiTouchRotationGestureDetector.cpp b/src/ui/FUiTouchRotationGestureDetector.cpp index 992b8bf..697a798 100644 --- a/src/ui/FUiTouchRotationGestureDetector.cpp +++ b/src/ui/FUiTouchRotationGestureDetector.cpp @@ -95,4 +95,14 @@ TouchRotationGestureDetector::GetDistance(void) const return pRotationGestureDetectorImpl->GetDistance(); } +float +TouchRotationGestureDetector::GetDistanceF(void) const +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + const _TouchRotationGestureDetectorImpl* pRotationGestureDetectorImpl = _TouchRotationGestureDetectorImpl::GetInstance(*this); + SysAssertf(pRotationGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pRotationGestureDetectorImpl->GetDistanceF(); +} }} //Tizen::Ui diff --git a/src/ui/FUiTouchTapGestureDetector.cpp b/src/ui/FUiTouchTapGestureDetector.cpp index c2a30d4..a0062ec 100644 --- a/src/ui/FUiTouchTapGestureDetector.cpp +++ b/src/ui/FUiTouchTapGestureDetector.cpp @@ -122,6 +122,17 @@ TouchTapGestureDetector::SetMoveAllowance(int allowance) return pTouchTapGestureDetectorImpl->SetMoveAllowance(allowance); } +result +TouchTapGestureDetector::SetMoveAllowance(float allowance) +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchTapGestureDetectorImpl->SetMoveAllowance(allowance); +} + int TouchTapGestureDetector::GetMoveAllowance(void) const { @@ -133,6 +144,17 @@ TouchTapGestureDetector::GetMoveAllowance(void) const return pTouchTapGestureDetectorImpl->GetMoveAllowance(); } +float +TouchTapGestureDetector::GetMoveAllowanceF(void) const +{ + SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + const _TouchTapGestureDetectorImpl* pTouchTapGestureDetectorImpl = _TouchTapGestureDetectorImpl::GetInstance(*this); + SysAssertf(pTouchTapGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used."); + + return pTouchTapGestureDetectorImpl->GetMoveAllowanceF(); +} + result TouchTapGestureDetector::SetTouchCount(int count) { diff --git a/src/ui/FUiUiConfiguration.cpp b/src/ui/FUiUiConfiguration.cpp index 66eb130..dd61b93 100644 --- a/src/ui/FUiUiConfiguration.cpp +++ b/src/ui/FUiUiConfiguration.cpp @@ -53,4 +53,20 @@ UiConfiguration::SetDefaultFont(const String& fontName) return E_SUCCESS; } +String +UiConfiguration::GetDefaultFontFile(void) +{ + _ControlManager* pControlManager = _ControlManager::GetInstance(); + return pControlManager->GetDefaultFontFile(); +} + +result +UiConfiguration::SetDefaultFontFromFile(const Tizen::Base::String& fileName) +{ + _ControlManager* pControlManager = _ControlManager::GetInstance(); + result r = pControlManager->SetDefaultFontFromFile(fileName); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return E_SUCCESS; +} + }} // Tizen::Ui diff --git a/src/ui/FUiVariant.cpp b/src/ui/FUiVariant.cpp index 74e3a9c..2b9ec92 100644 --- a/src/ui/FUiVariant.cpp +++ b/src/ui/FUiVariant.cpp @@ -15,7 +15,7 @@ // limitations under the License. // /** - * @file FUiVariant.cpp + * @file FUIVariant.cpp * @brief This is the implementation file for Variant class. */ @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include "FUi_VariantImpl.h" @@ -408,6 +410,38 @@ Variant::Variant(const FloatMatrix4& value) } } +Variant::Variant(const Tizen::Graphics::FloatPoint3& value) + : __pVariantImpl(null) +{ + __pVariantImpl = new (std::nothrow) _VariantImpl; + if (__pVariantImpl == null) + { + SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null."); + } + else + { + __pVariantImpl->__type = VARIANT_TYPE_FLOAT_POINT3; + __pVariantImpl->__data.pFloatPoint3 = null; + __pVariantImpl->__data.pFloatPoint3 = new (std::nothrow) FloatPoint3(value); + } +} + +Variant::Variant(const Tizen::Graphics::FloatVector4& value) + : __pVariantImpl(null) +{ + __pVariantImpl = new (std::nothrow) _VariantImpl; + if (__pVariantImpl == null) + { + SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null."); + } + else + { + __pVariantImpl->__type = VARIANT_TYPE_FLOAT_VECTOR4; + __pVariantImpl->__data.pFloatVector4 = null; + __pVariantImpl->__data.pFloatVector4 = new (std::nothrow) FloatVector4(value); + } +} + // Assignment Operators Variant& Variant::operator =(const Variant& rhs) @@ -444,6 +478,27 @@ Variant::operator =(const Variant& rhs) } \ } while (0); +#define CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(type, member, value) \ + do { \ + if (!__pVariantImpl || __pVariantImpl->__type != type) \ + { \ + _VariantImpl* pImpl = new (std::nothrow) _VariantImpl; \ + if (likely(pImpl)) \ + { \ + pImpl->__type = type; \ + pImpl->__data.member = value; \ + delete __pVariantImpl; \ + __pVariantImpl = pImpl; \ + } \ + } \ + else \ + { \ + /* __pVariantImpl != null && __pVariantImpl->__type == type */ \ + delete __pVariantImpl->__data.member; \ + __pVariantImpl->__data.member = value; \ + } \ + } while (0); + Variant& Variant::operator =(int rhs) { @@ -520,7 +575,7 @@ Variant& Variant::operator =(const char* pRhs) { String* pString = new (std::nothrow) String(pRhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_STRING, pString, pString); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString); return (*this); } @@ -529,7 +584,7 @@ Variant& Variant::operator =(const wchar_t* pRhs) { String* pString = new (std::nothrow) String(pRhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_STRING, pString, pString); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString); return (*this); } @@ -538,7 +593,7 @@ Variant& Variant::operator =(const String& rhs) { String* pString = new (std::nothrow) String(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_STRING, pString, pString); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString); return (*this); } @@ -547,7 +602,7 @@ Variant& Variant::operator =(const DateTime& rhs) { DateTime* pDateTime = new (std::nothrow) DateTime(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_DATETIME, pDateTime, pDateTime); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_DATETIME, pDateTime, pDateTime); return (*this); } @@ -556,7 +611,7 @@ Variant& Variant::operator =(const Color& rhs) { Color* pColor = new (std::nothrow) Color(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_COLOR, pColor, pColor); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_COLOR, pColor, pColor); return (*this); } @@ -565,7 +620,7 @@ Variant& Variant::operator =(const Point& rhs) { Point* pPoint = new (std::nothrow) Point(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_POINT, pPoint, pPoint); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_POINT, pPoint, pPoint); return (*this); } @@ -573,9 +628,8 @@ Variant::operator =(const Point& rhs) Variant& Variant::operator =(const FloatPoint& rhs) { - FloatPoint* pFloatPoint = new (std::nothrow) FloatPoint(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_FLOAT_POINT, pFloatPoint, pFloatPoint); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_POINT, pFloatPoint, pFloatPoint); return (*this); } @@ -584,7 +638,7 @@ Variant& Variant::operator =(const Rectangle& rhs) { Rectangle* pRectangle = new (std::nothrow) Rectangle(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_RECTANGLE, pRect, pRectangle); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_RECTANGLE, pRect, pRectangle); return (*this); } @@ -593,7 +647,7 @@ Variant& Variant::operator =(const FloatRectangle& rhs) { FloatRectangle* pFloatRectangle = new (std::nothrow) FloatRectangle(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_FLOAT_RECTANGLE, pRectf, pFloatRectangle); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_RECTANGLE, pRectf, pFloatRectangle); return (*this); } @@ -603,7 +657,7 @@ Variant::operator =(const Dimension& rhs) { Dimension* pDimension = new (std::nothrow) Dimension(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_DIMENSION, pDimension, pDimension); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_DIMENSION, pDimension, pDimension); return (*this); } @@ -612,7 +666,7 @@ Variant& Variant::operator =(const FloatDimension& rhs) { FloatDimension* pFloatDimension = new (std::nothrow) FloatDimension(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_FLOAT_DIMENSION, pFloatDimension, pFloatDimension); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_DIMENSION, pFloatDimension, pFloatDimension); return (*this); } @@ -621,7 +675,25 @@ Variant& Variant::operator =(const FloatMatrix4& rhs) { FloatMatrix4* pFloatMatrix4 = new (std::nothrow) FloatMatrix4(rhs); - CREATE_VARIANT_IMPL(VARIANT_TYPE_FLOAT_MATRIX4, pFloatMatrix4, pFloatMatrix4); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_MATRIX4, pFloatMatrix4, pFloatMatrix4); + + return (*this); +} + +Variant& +Variant::operator =(const Tizen::Graphics::FloatPoint3& rhs) +{ + FloatPoint3* pFloatPoint3 = new (std::nothrow) FloatPoint3(rhs); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_POINT3, pFloatPoint3, pFloatPoint3); + + return (*this); +} + +Variant& +Variant::operator =(const Tizen::Graphics::FloatVector4& rhs) +{ + FloatVector4* pFloatVector4 = new (std::nothrow) FloatVector4(rhs); + CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_VECTOR4, pFloatVector4, pFloatVector4); return (*this); } @@ -796,6 +868,30 @@ operator ==(const Variant& lhs, const Variant& rhs) } } + case VARIANT_TYPE_FLOAT_POINT3: + { + if (pLhsImpl->__data.pFloatPoint3) + { + return *pLhsImpl->__data.pFloatPoint3 == *pRhsImpl->__data.pFloatPoint3; + } + else + { + return false; + } + } + + case VARIANT_TYPE_FLOAT_VECTOR4: + { + if (pLhsImpl->__data.pFloatVector4) + { + return *pLhsImpl->__data.pFloatVector4 == *pRhsImpl->__data.pFloatVector4; + } + else + { + return false; + } + } + case VARIANT_TYPE_NONE: return pLhsImpl->__type == pRhsImpl->__type; @@ -1172,6 +1268,44 @@ Variant::ToFloatMatrix4(void) const return FloatMatrix4(); } +FloatPoint3 +Variant::ToFloatPoint3(void) const +{ + const _VariantImpl* pImpl = GetVariantImpl(); + if (pImpl) + { + if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_POINT3)) + { + SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_POINT3."); + } + else + { + return *pImpl->__data.pFloatPoint3; + } + } + + return FloatPoint3(); +} + +FloatVector4 +Variant::ToFloatVector4(void) const +{ + const _VariantImpl* pImpl = GetVariantImpl(); + if (pImpl) + { + if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_VECTOR4)) + { + SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_VECTOR4."); + } + else + { + return *pImpl->__data.pFloatVector4; + } + } + + return FloatVector4(); +} + bool Variant::IsEmpty(void) const { @@ -1181,7 +1315,7 @@ Variant::IsEmpty(void) const return pImpl->__type == VARIANT_TYPE_NONE; } - return false; + return true; } VariantType @@ -1362,6 +1496,30 @@ Variant::GetHashCode(void) const } } + case VARIANT_TYPE_FLOAT_POINT3: + { + if (pImpl->__data.pFloatPoint3) + { + return (pImpl->__data.pFloatPoint3)->GetHashCode(); + } + else + { + break; + } + } + + case VARIANT_TYPE_FLOAT_VECTOR4: + { + if (pImpl->__data.pFloatVector4) + { + return (pImpl->__data.pFloatVector4)->GetHashCode(); + } + else + { + break; + } + } + case VARIANT_TYPE_NONE: default: break; diff --git a/src/ui/FUiVerticalBoxLayout.cpp b/src/ui/FUiVerticalBoxLayout.cpp old mode 100644 new mode 100755 index 67bcf90..6ac24c6 --- a/src/ui/FUiVerticalBoxLayout.cpp +++ b/src/ui/FUiVerticalBoxLayout.cpp @@ -25,6 +25,7 @@ #include #include #include "FUi_VerticalBoxLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -104,6 +105,25 @@ VerticalBoxLayout::SetSpacing(Control& childControl, int space) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetSpacing(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(space)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +VerticalBoxLayout::SetSpacing(Control& childControl, float space) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, space >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _VerticalBoxLayoutImpl* pVerticalBoxLayoutImpl = _VerticalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pVerticalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetSpacing(*pControlImpl, space); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -123,6 +143,27 @@ VerticalBoxLayout::SetHorizontalMargin(Control& childControl, int left, int righ _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + float floatLeft = _CoordinateSystemUtils::ConvertToFloat(left); + float floatRight = _CoordinateSystemUtils::ConvertToFloat(right); + result r = pVerticalBoxLayoutImpl->SetHorizontalMargin(*pControlImpl, floatLeft, floatRight); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +VerticalBoxLayout::SetHorizontalMargin(Control& childControl, float left, float right) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, (left >= 0) && (right >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _VerticalBoxLayoutImpl* pVerticalBoxLayoutImpl = _VerticalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pVerticalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetHorizontalMargin(*pControlImpl, left, right); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -142,6 +183,25 @@ VerticalBoxLayout::SetWidth(Control& childControl, int width) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetWidth(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(width)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +VerticalBoxLayout::SetWidth(Control& childControl, float width) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, width >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _VerticalBoxLayoutImpl* pVerticalBoxLayoutImpl = _VerticalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pVerticalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetWidth(*pControlImpl, width); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -178,6 +238,25 @@ VerticalBoxLayout::SetHeight(Control& childControl, int height) _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetHeight(*pControlImpl, _CoordinateSystemUtils::ConvertToFloat(height)); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +VerticalBoxLayout::SetHeight(Control& childControl, float height) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, height >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given parameter is invalid."); + + _VerticalBoxLayoutImpl* pVerticalBoxLayoutImpl = _VerticalBoxLayoutImpl::GetInstance(*this); + SysAssertf(pVerticalBoxLayoutImpl != null, "Not yet constructed. Construct() should be called before use."); + + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(childControl); + SysTryReturn(NID_UI, pControlImpl, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] This instance is not constructed."); + result r = pVerticalBoxLayoutImpl->SetHeight(*pControlImpl, height); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/FUiWindow.cpp b/src/ui/FUiWindow.cpp old mode 100644 new mode 100755 index 5475836..76db12d --- a/src/ui/FUiWindow.cpp +++ b/src/ui/FUiWindow.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiWindow.cpp * @brief This is the implementation file for Window class. @@ -55,12 +56,32 @@ Window::Construct(const Rectangle& rect, bool resizable, bool movable) } result +Window::Construct(const FloatRectangle& rect, bool resizable, bool movable) +{ + result r = E_SUCCESS; + SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + _WindowImpl* pImpl = _WindowImpl::CreateWindowImplN(this, rect, null, null, resizable, movable); + r = GetLastResult(); + SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + return E_SUCCESS; +} + +result Window::Construct(const Layout& layout, const Rectangle& rect, bool resizable, bool movable) { return Construct(layout, layout, rect, resizable, movable); } result +Window::Construct(const Layout& layout, const FloatRectangle& rect, bool resizable, bool movable) +{ + return Construct(layout, layout, rect, resizable, movable); +} + +result Window::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, const Rectangle& rect, bool resizable, bool movable) { @@ -80,6 +101,25 @@ Window::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, } result +Window::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, + const FloatRectangle& rect, bool resizable, bool movable) +{ + result r = E_SUCCESS; + SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + _WindowImpl* pImpl = + _WindowImpl::CreateWindowImplN(this, rect, &portraitLayout, &landscapeLayout, resizable, movable); + + r = GetLastResult(); + SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + + _pControlImpl = pImpl; + + return E_SUCCESS; +} + +result Window::Show(void) { result r = E_SUCCESS; @@ -113,9 +153,6 @@ Window::GetDisplayContext(void) const result Window::SetZOrderGroup(WindowZOrderGroup windowZOrderGroup) { - result r = _AccessController::CheckUserPrivilege(_PRV_UIMANAGER); - SysTryReturnResult(NID_LOC, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); - _WindowImpl* pImpl = _WindowImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -131,6 +168,15 @@ Window::SetOwner(Tizen::Ui::Control *pControl) pImpl->SetOwner(pControl); } +Control* +Window::GetOwner(void) const +{ + const _WindowImpl* pImpl = _WindowImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetOwner(); +} + void Window::AddWindowEventListener(IWindowEventListener& listener) { diff --git a/src/ui/FUi_AccessibilityContainer.cpp b/src/ui/FUi_AccessibilityContainer.cpp index 86b3d2c..879fbe0 100644 --- a/src/ui/FUi_AccessibilityContainer.cpp +++ b/src/ui/FUi_AccessibilityContainer.cpp @@ -16,13 +16,14 @@ // #include -#include +#include #include "FUi_Control.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityElementImpl.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityManager.h" #include "FUi_IAccessibilityListener.h" +#include "FUi_IAccessibilityFocusHandler.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -44,8 +45,8 @@ public: } virtual result Compare(const T& obj1, const T& obj2, int& cmp) const { - Tizen::Graphics::Rectangle rect1= obj1->GetAbsoluteBounds(); - Tizen::Graphics::Rectangle rect2= obj2->GetAbsoluteBounds(); + Tizen::Graphics::FloatRectangle rect1= obj1->GetAbsoluteBounds(); + Tizen::Graphics::FloatRectangle rect2= obj2->GetAbsoluteBounds(); if(rect1.y > rect2.y) { @@ -82,11 +83,11 @@ _AccessibilityContainer::_AccessibilityContainer(const _Control& owner) : __pOwner(null) , __pParent(null) , __currentElementIndex(-1) - , __level(ACCESSIBILITY_PRIORTY_NORMAL) + , __level(ACCESSIBILITY_PRIORITY_NORMAL) , __activated(false) , __pListener(null) , __enableState(true) - , __focusManaged(false) + , __pFocusHandler(null) { __pOwner = &(const_cast<_Control&>(owner)); __handle = _AccessibilityManager::GetInstance()->Register(this); @@ -213,6 +214,19 @@ _AccessibilityContainer::SortElements(void) } _AccessibilityElement* +_AccessibilityContainer::GetChildElement(int index) const +{ + int count = __elementList.GetCount(); + if (count == 0 ||index > count - 1) + { + return null; + } + _AccessibilityElement* pElement = null; + __elementList.GetAt(index, pElement); + return pElement; +} + +_AccessibilityElement* _AccessibilityContainer::GetChildElement(const String& name) const { int count = __elementList.GetCount(); @@ -255,8 +269,11 @@ _AccessibilityContainer::GetElements(IListT<_AccessibilityElement*>& list) const r = __elementList.GetAt(i, pElement); SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System Error."); SysTryReturn(NID_UI, pElement, , E_SYSTEM, "[E_SYSTEM] System Error."); - - list.Add(pElement); + if(!list.Contains(pElement)) + { + list.Add(pElement); + } + pElement = null; } } @@ -294,7 +311,7 @@ _AccessibilityContainer::Hit(const Point& point) const if (!(pElement->IsActivated())) continue; - Rectangle rect = pElement->GetAbsoluteBounds(); + FloatRectangle rect = pElement->GetAbsoluteBounds(); if (rect.x < point.x && rect.y < point.y && rect.x + rect.width > point.x @@ -336,150 +353,51 @@ _AccessibilityContainer::MoveElement(const _AccessibilityElement* pPreviousEleme return E_SUCCESS; } void -_AccessibilityContainer::ManageFocus(bool set) +_AccessibilityContainer::SetFocusHandler(_IAccessibilityFocusHandler* pHandler) { - __focusManaged = set; + __pFocusHandler = pHandler; } bool _AccessibilityContainer::IsFocusManaged(void) { - return __focusManaged; + return (__pFocusHandler != null? true:false); } bool _AccessibilityContainer::MoveFocus(_AccessibilityFocusDirection direction) { - if(!__focusManaged) - { - return false; - } - int count = __elementList.GetCount(); - bool returnValue = false; - if (!__activated || count < 1) + if(!__pFocusHandler) { return false; } + return __pFocusHandler->OnMoveFocus(direction); +} - if (__currentElementIndex >= 0) +bool +_AccessibilityContainer::MoveFocus(const Tizen::Graphics::Point& point) +{ + if(__pFocusHandler) { - if (__currentElementIndex + direction < count - && __currentElementIndex + direction >= 0) - { - _AccessibilityElement* pElement = null; - if (__listenerList.GetCount() > 0) - { - for (int i = 0;i<__listenerList.GetCount();i++) - { - _IAccessibilityListener* pListener = null; - if (__listenerList.GetAt(i,pListener) == E_SUCCESS) - { - _AccessibilityElement* pElement = null; - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS) - { - pListener->OnAccessibilityFocusOut(*this,*pElement); - } - } - } - } - __currentElementIndex += direction; - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS) - { - if (__listenerList.GetCount() > 0) - { - for (int i = 0;i<__listenerList.GetCount();i++) - { - _IAccessibilityListener* pListener = null; - if (__listenerList.GetAt(i,pListener) == E_SUCCESS) - { - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS) - { - pListener->OnAccessibilityFocusIn(*this,*pElement); - if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS) - { - pListener->OnAccessibilityFocusMovedPrevious(*this, *pElement); - } - else if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_NEXT) - { - pListener->OnAccessibilityFocusMovedNext(*this, *pElement); - } - } - } - } - } - } - returnValue = true; - } - else - { - __currentElementIndex = -1; - returnValue = false; - } + return __pFocusHandler->OnMoveFocus(point); } else { - if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS) + _AccessibilityElement* pElement = Hit(point); + if(pElement == null) { - _AccessibilityElement* pElement = null; - __currentElementIndex = count - 1; - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS&& __listenerList.GetCount() > 0) - { - for (int i = 0;i<__listenerList.GetCount();i++) - { - _IAccessibilityListener* pListener = null; - if (__listenerList.GetAt(i,pListener) == E_SUCCESS) - { - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS) - { - pListener->OnAccessibilityFocusIn(*this,*pElement); - pListener->OnAccessibilityFocusMovedPrevious(*this, *pElement); - } - } - } - } + return false; + } + + int index = -1; + if (__elementList.IndexOf(pElement, index) != E_SUCCESS) + { + return false; } else { - _AccessibilityElement* pElement = null; - __currentElementIndex = 0; - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS && __listenerList.GetCount() > 0) - { - for (int i = 0;i<__listenerList.GetCount();i++) - { - _IAccessibilityListener* pListener = null; - if (__listenerList.GetAt(i,pListener) == E_SUCCESS) - { - if (__elementList.GetAt(__currentElementIndex, pElement) == E_SUCCESS) - { - pListener->OnAccessibilityFocusIn(*this,*pElement); - pListener->OnAccessibilityFocusMovedNext(*this, *pElement); - } - } - } - } + __currentElementIndex = index; } - returnValue = true; - } - return returnValue; -} - -bool -_AccessibilityContainer::MoveFocus(const Tizen::Graphics::Point& point) -{ - _AccessibilityElement* pElement = Hit(point); - if(pElement == null) - { - return false; - } - - int index = -1; - if (__elementList.IndexOf(pElement, index) != E_SUCCESS) - { - return false; - } - else - { - __currentElementIndex = index; + return true; } - return true; } void @@ -608,10 +526,10 @@ _AccessibilityContainer::IsActivated(void) const return __activated; } -Rectangle +FloatRectangle _AccessibilityContainer::GetAbsoluteBounds(void) const { - return __pOwner->GetAbsoluteBounds(); + return __pOwner->GetAbsoluteBoundsF(); } void diff --git a/src/ui/FUi_AccessibilityContainerImpl.cpp b/src/ui/FUi_AccessibilityContainerImpl.cpp index 07d96ce..7015041 100644 --- a/src/ui/FUi_AccessibilityContainerImpl.cpp +++ b/src/ui/FUi_AccessibilityContainerImpl.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "FUi_ControlImpl.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityElementImpl.h" @@ -275,23 +276,109 @@ _AccessibilityContainerImpl::OnAccessibilityFocusMovedPrevious(const _Accessibil return true; } bool -_AccessibilityContainerImpl::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_AccessibilityContainerImpl::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { + int count = __listenerList.GetCount(); + if (count > 0) + { + IAccessibilityListener* pListener = null; + for (int i = 0 ; i < count ; i++) + { + if(__listenerList.GetAt(i, pListener) == E_SUCCESS) + { + AccessibilityElement* pElement = GetChildElement(element.GetName()); + if (pElement != null) + { + pListener->OnAccessibilityScreenReaderStatusChanged(GetOwner().GetPublic(),*pElement, ACCESSIBILITY_SCREEN_READER_STATUS_READY); + } + } + } + } + return true; +} +bool +_AccessibilityContainerImpl::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + int count = __listenerList.GetCount(); + if (count > 0) + { + IAccessibilityListener* pListener = null; + for (int i = 0 ; i < count ; i++) + { + if(__listenerList.GetAt(i, pListener) == E_SUCCESS) + { + AccessibilityElement* pElement = GetChildElement(element.GetName()); + if (pElement != null) + { + pListener->OnAccessibilityScreenReaderStatusChanged(GetOwner().GetPublic(),*pElement, ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING); + } + } + } + } return true; } + bool _AccessibilityContainerImpl::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) { + int count = __listenerList.GetCount(); + if (count > 0) + { + IAccessibilityListener* pListener = null; + for (int i = 0 ; i < count ; i++) + { + if(__listenerList.GetAt(i, pListener) == E_SUCCESS) + { + AccessibilityElement* pElement = GetChildElement(element.GetName()); + if (pElement != null) + { + pListener->OnAccessibilityFocusIn(GetOwner().GetPublic(),*pElement); + } + } + } + } return true; } bool _AccessibilityContainerImpl::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element) { + int count = __listenerList.GetCount(); + if (count > 0) + { + IAccessibilityListener* pListener = null; + for (int i = 0 ; i < count ; i++) + { + if(__listenerList.GetAt(i, pListener) == E_SUCCESS) + { + AccessibilityElement* pElement = GetChildElement(element.GetName()); + if (pElement != null) + { + pListener->OnAccessibilityFocusOut(GetOwner().GetPublic(),*pElement); + } + } + } + } return true; } bool _AccessibilityContainerImpl::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) { + int count = __listenerList.GetCount(); + if (count > 0) + { + IAccessibilityListener* pListener = null; + for (int i = 0 ; i < count ; i++) + { + if(__listenerList.GetAt(i, pListener) == E_SUCCESS) + { + AccessibilityElement* pElement = GetChildElement(element.GetName()); + if (pElement != null) + { + pListener->OnAccessibilityActionPerformed(GetOwner().GetPublic(),*pElement); + } + } + } + } return true; } bool diff --git a/src/ui/FUi_AccessibilityElement.cpp b/src/ui/FUi_AccessibilityElement.cpp index bab21c5..7b54454 100644 --- a/src/ui/FUi_AccessibilityElement.cpp +++ b/src/ui/FUi_AccessibilityElement.cpp @@ -16,7 +16,6 @@ // #include -#include #include #include #include @@ -91,6 +90,9 @@ _AccessibilityElement::_AccessibilityElement(bool systemElement) , __systemElement(systemElement) , __activated(true) , __supportOperatingGesture(true) + , __setHintByUser(false) + , __disabledHint(false) + , __updateContents(false) { } _AccessibilityElement::~_AccessibilityElement(void) @@ -102,6 +104,13 @@ _AccessibilityElement::~_AccessibilityElement(void) } } result +_AccessibilityElement::Construct(const String& name, const FloatRectangle& bounds) +{ + __name = name; + __bounds.SetBounds(bounds.x,bounds.y,bounds.width,bounds.height); + return E_SUCCESS; +} +result _AccessibilityElement::Construct(const String& name, const Rectangle& bounds) { __name = name; @@ -117,27 +126,37 @@ void _AccessibilityElement::SetLabel(const String& label) { __label = label; + __updateContents = true; } void -_AccessibilityElement::SetHint(const String& hint) +_AccessibilityElement::SetHint(const String& hint, bool setHintByUser) { + if(__setHintByUser && !setHintByUser) + { + return; + } __hint = hint; + __setHintByUser = setHintByUser; + __updateContents = true; } void _AccessibilityElement::SetStatus(const String& status) { __status = status; + __updateContents = true; } void _AccessibilityElement::SetTrait(AccessibilityTraits trait) { __trait = trait; __traitString = (_traitString[__trait]); + __updateContents = true; } void _AccessibilityElement::SetTrait(const Tizen::Base::String& trait) { __traitString = trait; + __updateContents = true; } void _AccessibilityElement::SetParent(const _AccessibilityContainer& parent) @@ -148,6 +167,7 @@ void _AccessibilityElement::SetValue(const String& value) { __value = value; + __updateContents = true; } _AccessibilityContainer* _AccessibilityElement::GetParent(void) const @@ -159,7 +179,7 @@ _AccessibilityElement::GetName(void) const { return __name; } -Rectangle +FloatRectangle _AccessibilityElement::GetBounds(void) const { return __bounds; @@ -195,12 +215,17 @@ _AccessibilityElement::GetValue(void) const return __value; } void +_AccessibilityElement::SetHintDisabled(bool enable) +{ + __disabledHint = enable; +} +void _AccessibilityElement::Activate(bool enable) { __activated = enable; if(!enable) { - //__pParent->RemoveElement(*this); + // __pParent->RemoveElement(*this); __pUserData = null; } } @@ -234,21 +259,21 @@ _AccessibilityElement::GetReadingContents(void) const out += L", "; out += __status; } - if(__hint.GetLength() > 0) + if(__hint.GetLength() > 0 && !__disabledHint && __pParent->GetEnableState()) { out += L", "; out += __hint; } - if( __pParent->GetEnableState() == false) + if(__pParent->GetEnableState() == false) { out += L", "; out += L"unavailable"; } - + const_cast<_AccessibilityElement*>(this)->__updateContents = false; return out; } void -_AccessibilityElement::SetBounds(const Rectangle& bounds) +_AccessibilityElement::SetBounds(const FloatRectangle& bounds) { __bounds.SetBounds(bounds.x,bounds.y,bounds.width,bounds.height); if(__pParent && this == __pParent->GetCurrentFocusedElement()) @@ -256,12 +281,23 @@ _AccessibilityElement::SetBounds(const Rectangle& bounds) _AccessibilityManager::GetInstance()->RequestToDrawFocusUi(); } } -Rectangle + +void +_AccessibilityElement::SetBounds(const Tizen::Graphics::Rectangle& bounds) +{ + __bounds.SetBounds(bounds.x,bounds.y,bounds.width,bounds.height); + if(__pParent && this == __pParent->GetCurrentFocusedElement()) + { + _AccessibilityManager::GetInstance()->RequestToDrawFocusUi(); + } +} + +FloatRectangle _AccessibilityElement::GetAbsoluteBounds(void) const { - Rectangle controlAbsBounds = GetParent()->GetOwner().GetAbsoluteBounds(); - Rectangle rect(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height); - const_cast(__absBounds).SetBounds(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height); + FloatRectangle controlAbsBounds = GetParent()->GetOwner().GetAbsoluteBoundsF(); + FloatRectangle rect(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height); + const_cast(__absBounds).SetBounds(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height); return rect; } void @@ -290,4 +326,9 @@ _AccessibilityElement::IsSystemElement(void) { return __systemElement; } +bool +_AccessibilityElement::IsUpdated(void) +{ + return __updateContents; +} }} diff --git a/src/ui/FUi_AccessibilityElementImpl.cpp b/src/ui/FUi_AccessibilityElementImpl.cpp index dfb6b3f..2df51a4 100644 --- a/src/ui/FUi_AccessibilityElementImpl.cpp +++ b/src/ui/FUi_AccessibilityElementImpl.cpp @@ -16,7 +16,7 @@ // #include -#include +#include #include #include #include "FUi_AccessibilityElementImpl.h" @@ -62,13 +62,13 @@ _AccessibilityElementImpl::~_AccessibilityElementImpl(void) } result -_AccessibilityElementImpl::Construct(const Tizen::Base::String& name, const Tizen::Graphics::Rectangle& bounds) +_AccessibilityElementImpl::Construct(const Tizen::Base::String& name, const Tizen::Graphics::FloatRectangle& bounds) { SysTryReturn(NID_UI, __pCore, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System Error."); return __pCore->Construct(name, bounds); } void -_AccessibilityElementImpl::SetBounds(const Tizen::Graphics::Rectangle& bounds) +_AccessibilityElementImpl::SetBounds(const Tizen::Graphics::FloatRectangle& bounds) { SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error."); return __pCore->SetBounds(bounds); @@ -89,7 +89,7 @@ void _AccessibilityElementImpl::SetHint(const Tizen::Base::String& hint) { SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error."); - return __pCore->SetHint(hint); + return __pCore->SetHint(hint, true); } void _AccessibilityElementImpl::SetStatus(const Tizen::Base::String& status) @@ -146,10 +146,10 @@ _AccessibilityElementImpl::GetName(void) const SysTryReturn(NID_UI, __pCore, L"", E_SYSTEM, "[E_SYSTEM] System Error."); return __pCore->GetName(); } -Tizen::Graphics::Rectangle +Tizen::Graphics::FloatRectangle _AccessibilityElementImpl::GetBounds(void) const { - SysTryReturn(NID_UI, __pCore, Tizen::Graphics::Rectangle(0, 0, 0, 0), E_SYSTEM, "[E_SYSTEM] System Error."); + SysTryReturn(NID_UI, __pCore, Tizen::Graphics::FloatRectangle(0, 0, 0, 0), E_SYSTEM, "[E_SYSTEM] System Error."); return __pCore->GetBounds(); } Tizen::Base::String diff --git a/src/ui/FUi_AccessibilityGesture.cpp b/src/ui/FUi_AccessibilityGesture.cpp index b1b25a2..ebcbc7d 100644 --- a/src/ui/FUi_AccessibilityGesture.cpp +++ b/src/ui/FUi_AccessibilityGesture.cpp @@ -32,27 +32,79 @@ using namespace Tizen::Ui::Controls; namespace { - void ConvertTouchPosition(int &x, int&y) + void ConvertTouchPosition(Tizen::Ui::_AccessibilityGestureType& type, float &x, float&y) { Frame* pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame(); Form* pForm= pFrame->GetCurrentForm(); - Dimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSize(); - int _x = x; - int _y = y; + FloatDimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSizeF(); + float _x = x; + float _y = y; switch(pForm->GetOrientationStatus()) { case Tizen::Ui::ORIENTATION_STATUS_PORTRAIT: break; case Tizen::Ui::ORIENTATION_STATUS_LANDSCAPE: - x = screen.height - _y; - y= _x; + switch(type) + { + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP; + break; + default: + break; + } + x = _y; + y = screen.width - _x; break; case Tizen::Ui::ORIENTATION_STATUS_PORTRAIT_REVERSE: + switch(type) + { + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT; + break; + default: + break; + } + x = screen.width - _x; y = screen.height - _y; break; case Tizen::Ui::ORIENTATION_STATUS_LANDSCAPE_REVERSE: - x = _y; - y = screen.width - _x; + switch(type) + { + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP; + break; + case Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT: + type = Tizen::Ui::_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN; + break; + default: + break; + } + x = screen.height - _y; + y= _x; break; default: break; @@ -71,10 +123,10 @@ _AccessibilityGesture::~_AccessibilityGesture(void) } bool -_AccessibilityGesture::ProcessGesture(_AccessibilityGestureType type, int x, int y) +_AccessibilityGesture::ProcessGesture(_AccessibilityGestureType type, float x, float y) { - ConvertTouchPosition(x,y); - _AccessibilityManager::GetInstance()->ProcessGesture(type,Tizen::Graphics::Point(CoordinateSystem::ConvertToLogicalX(x),CoordinateSystem::ConvertToLogicalY(y)), null); + ConvertTouchPosition(type, x,y); + _AccessibilityManager::GetInstance()->ProcessGesture(type,Tizen::Graphics::FloatPoint(CoordinateSystem::ConvertToLogicalX(x),CoordinateSystem::ConvertToLogicalY(y)), null); return true; } }} //Tizen::Ui diff --git a/src/ui/FUi_AccessibilityManager.cpp b/src/ui/FUi_AccessibilityManager.cpp index 0ab267b..39ead74 100644 --- a/src/ui/FUi_AccessibilityManager.cpp +++ b/src/ui/FUi_AccessibilityManager.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -96,25 +96,47 @@ class AutoReadingTimer public: AutoReadingTimer(Tizen::Ui::_AccessibilityManager* pManager) : __pAccessibilityManager(pManager) + , __mode(Tizen::Ui::_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM) + , __start(false) { timer.Construct(*this); } virtual ~AutoReadingTimer(void) {} - void Start(void) + void Start(Tizen::Ui::_AccessibilityAutoReadingMode mode) { - timer.Start(500); + SysLog(NID_UI, "AccessibilityManager::AutoReadingTimer is requested mode : %d", mode); + if (__start) + { + return; + } + __start = true; + SysLog(NID_UI, "AccessibilityManager::AutoReadingTimer is started mode : %d", mode); + __mode = mode; + timer.Start(700); } void Stop(void) { timer.Cancel(); + __start = false; } virtual void OnTimerExpired(Timer& timer) { - __pAccessibilityManager->ReadElement(0); + SysLog(NID_UI, "mode %d", __mode); + if (__pAccessibilityManager->GetTtsStatus() != Tizen::Ui::ACCESSIBILITY_SCREEN_READER_STATUS_READY + && __pAccessibilityManager->GetTtsStatus() != Tizen::Ui::ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING) + { + Start(__mode); + return; + SysLog(NID_UI, "AccessibilityManager::AutoReadingTimer is started again because tts is not initialized."); + } + __start = false; + __pAccessibilityManager->ReadElement(__mode); } Tizen::Ui::_AccessibilityManager* __pAccessibilityManager; Timer timer; + Tizen::Ui::_AccessibilityAutoReadingMode __mode; + bool __start; }; GuidePopupTimer* pGuidePopupTimer; @@ -138,24 +160,24 @@ public: Tizen::Graphics::Rectangle rect1= obj1->GetAbsoluteBounds(); Tizen::Graphics::Rectangle rect2= obj2->GetAbsoluteBounds(); - if(rect1.y > rect2.y) + if (rect1.y > rect2.y) { cmp = 1; return E_SUCCESS; } - else if(rect1.y < rect2.y) + else if (rect1.y < rect2.y) { cmp = -1; return E_SUCCESS; } else { - if(rect1.x > rect2.x) + if (rect1.x > rect2.x) { cmp = 1; return E_SUCCESS; } - else if(rect1.x < rect2.x) + else if (rect1.x < rect2.x) { cmp = -1; return E_SUCCESS; @@ -182,39 +204,39 @@ public: } virtual result Compare(const T& obj1, const T& obj2, int& cmp) const { - if(obj1->GetParent()->GetPriority() > obj2->GetParent()->GetPriority()) + if (obj1->GetParent()->GetPriority() > obj2->GetParent()->GetPriority()) { cmp = -1; return E_SUCCESS; } - else if(obj1->GetParent()->GetPriority() < obj2->GetParent()->GetPriority()) + else if (obj1->GetParent()->GetPriority() < obj2->GetParent()->GetPriority()) { cmp = 1; return E_SUCCESS; } else { - Tizen::Graphics::Rectangle rect1= obj1->GetAbsoluteBounds(); - Tizen::Graphics::Rectangle rect2= obj2->GetAbsoluteBounds(); + Tizen::Graphics::FloatRectangle rect1= obj1->GetAbsoluteBounds(); + Tizen::Graphics::FloatRectangle rect2= obj2->GetAbsoluteBounds(); - if(rect1.y > rect2.y) + if (rect1.y > rect2.y) { cmp = 1; return E_SUCCESS; } - else if(rect1.y < rect2.y) + else if (rect1.y < rect2.y) { cmp = -1; return E_SUCCESS; } else { - if(rect1.x > rect2.x) + if (rect1.x > rect2.x) { cmp = 1; return E_SUCCESS; } - else if(rect1.x < rect2.x) + else if (rect1.x < rect2.x) { cmp = -1; return E_SUCCESS; @@ -233,7 +255,7 @@ static _AccessibilityManager* pAccManager = null; bool _AccessibilityManager::__screenReaderIsEnabled = false; _AccessibilityManager::_AccessibilityManager(void) : __pAccGesture(null) - , __pPlayer(null) + , __pTtsPlayer(null) , __pSettingLoader(null) , __pTargetContainer(null) , __pTargetElement(null) @@ -251,20 +273,10 @@ _AccessibilityManager::~_AccessibilityManager(void) { delete __pAccGesture; __pAccGesture = null; - delete __pPlayer; - __pPlayer = null; + delete __pTtsPlayer; + __pTtsPlayer = null; delete __pSettingLoader; __pSettingLoader = null; - if (__pReadingVe) - { - __pReadingVe->Destroy(); - __pReadingVe = null; - } - if (__pFocusVe) - { - __pFocusVe->Destroy(); - __pFocusVe = null; - } delete pGuidePopupTimer; pGuidePopupTimer = null; delete pAutoReadingTimer; @@ -304,14 +316,15 @@ _AccessibilityManager::Initialize(void) { __pAccGesture = new (std::nothrow) _AccessibilityGesture(*this); SysTryReturn(NID_UI, __pAccGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - __pPlayer = new (std::nothrow) _AccessibilityTtsPlayer(*this); - SysTryCatch(NID_UI, __pPlayer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); + __pTtsPlayer = new (std::nothrow) _AccessibilityTtsPlayer(*this); + SysTryCatch(NID_UI, __pTtsPlayer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); __pSettingLoader = new (std::nothrow) _AccessibilitySystemSettingLoader(*this); SysTryCatch(NID_UI, __pSettingLoader, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); if (IsScreenReaderActivated()) { - __pPlayer->Activate(); + __pTtsPlayer->SetLocale(__pSettingLoader->GetLocaleString()); + __pTtsPlayer->Activate(); } pGuidePopupTimer = new (std::nothrow) GuidePopupTimer; @@ -323,8 +336,8 @@ _AccessibilityManager::Initialize(void) CATCH: delete __pAccGesture; __pAccGesture = null; - delete __pPlayer; - __pPlayer = null; + delete __pTtsPlayer; + __pTtsPlayer = null; delete __pSettingLoader; __pSettingLoader = null; delete pGuidePopupTimer; @@ -333,46 +346,75 @@ CATCH: pAutoReadingTimer = null; } AccessibilityScreenReaderStatus -_AccessibilityManager::GetReadingtatus(void) +_AccessibilityManager::GetTtsStatus(void) { - if (__pPlayer) + if (__pTtsPlayer) { - return __pPlayer->GetStatus(); + return __pTtsPlayer->GetStatus(); } return ACCESSIBILITY_SCREEN_READER_STATUS_ERROR; } result _AccessibilityManager::ReadContent(const Tizen::Base::String& content) { - if (__pPlayer) + if (__pTtsPlayer) { ShowPopup(content); - __pPlayer->ReadGrammar(content); + __pTtsPlayer->ReadGrammar(content); } return E_SUCCESS; } void -_AccessibilityManager::ReadElement(int index) +_AccessibilityManager::ReadElement(_AccessibilityAutoReadingMode mode) { MakeList(); int count = __candidateList.GetCount(); - if (count < 1 || index > count -1) + if (count < 1) { return; } _AccessibilityElement* pElement = null; - result r = __candidateList.GetAt(index, pElement); - if (r != E_SUCCESS) + result r = E_SYSTEM; + + if (mode == _ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM) { + r = __candidateList.GetAt(0, pElement); + } + else if (mode == _ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM_OF_CONTENTS) + { + for (int i = 0 ; i < count ; i++) + { + r = __candidateList.GetAt(i, pElement); + if (r == E_SUCCESS && pElement) + { + if (pElement->GetParent()->GetPriority() < ACCESSIBILITY_PRIORITY_TOP) + { + break; + } + } + } + } + else //_ACCESSIBILITY_AUTO_READING_MODE_CURRENT_FOCUS + { + if (IsContainerValid(__pTargetContainer)) + { + pElement = __pTargetElement; + r = E_SUCCESS; + } + } + if (r != E_SUCCESS || pElement == null) + { + SysLog(NID_UI, "cause 1"); return; } - if (pElement == null || __pTitleElement == pElement) + if (mode == _ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM && __pTitleElement == pElement && !(__pTitleElement->IsUpdated())) { + SysLog(NID_UI, "cause 2"); return; } __pTitleElement = pElement; pElement->GetParent()->SetCurrentFocusedElement(pElement); - DrawFocusUi(*(pElement->GetParent())); + DrawFocusUi(*pElement); __pTargetContainer = pElement->GetParent(); __pTargetElement = pElement; __targetControlHandle = __pTargetContainer->GetOwner().GetHandle(); @@ -382,7 +424,7 @@ _AccessibilityManager::ReadElement(int index) result _AccessibilityManager::ReadElement(const _AccessibilityElement& element) { - if (__pPlayer) + if (__pTtsPlayer) { LinkedListT<_IAccessibilityListener*>* pList = static_cast*>(__pTargetContainer->GetListenerListN()); if (pList != null) @@ -392,14 +434,14 @@ _AccessibilityManager::ReadElement(const _AccessibilityElement& element) _IAccessibilityListener* pListener = null; if (pList->GetAt(i, pListener) == E_SUCCESS) { - pListener->OnAccessibilityReadElement(*__pTargetContainer, element); + pListener->OnAccessibilityReadingElement(*__pTargetContainer, element); } } delete pList; pList = null; } ShowPopup(); - __pPlayer->ReadGrammar(element.GetReadingContents()); + __pTtsPlayer->ReadGrammar(element.GetReadingContents()); } return E_SUCCESS; } @@ -460,11 +502,7 @@ _AccessibilityManager::ShowPopup(const String& content) { int accesibilityVisualElementLevel = 3000; result r = E_SUCCESS; -#if!defined(MULTI_WINDOW) - VisualElement* pRootVe = _ControlManager::GetInstance()->GetRoot().GetVisualElement(); -#else VisualElement* pRootVe = _ControlManager::GetInstance()->GetTopVisibleWindow()->GetVisualElement(); -#endif __pReadingVe = new (std::nothrow) VisualElement(); SysTryCatch(NID_UI, __pReadingVe, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); @@ -480,15 +518,15 @@ _AccessibilityManager::ShowPopup(const String& content) { result r = E_SUCCESS; - int titleFontSize = 0; - int textFontSize = 0; - int popupWidth = 0; - int topMargin = 0; - int bottomMargin = 0; - int sideMargin = 0; - int titleHeight = 0; - int textTopMargin = 0; - int textHeight = 0; + float titleFontSize = 0; + float textFontSize = 0; + float popupWidth = 0; + float topMargin = 0; + float bottomMargin = 0; + float sideMargin = 0; + float titleHeight = 0; + float textTopMargin = 0; + float textHeight = 0; Color titleTextColor; Color pointTextColor; @@ -531,11 +569,11 @@ _AccessibilityManager::ShowPopup(const String& content) pEnrichedTitleText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedTitleText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - pEnrichedTitleText->Construct(Dimension(popupWidth-sideMargin*2, titleHeight)); + pEnrichedTitleText->Construct(FloatDimension(popupWidth-sideMargin*2, titleHeight)); pText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - pText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pElement = new (std::nothrow) TextElement; SysTryCatch(NID_UI, pElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); @@ -571,19 +609,19 @@ _AccessibilityManager::ShowPopup(const String& content) pText->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP); pText->SetTextAbbreviationEnabled(true); - int x = 40; - int y = 200; - int popupHeight = topMargin + bottomMargin + titleHeight + textTopMargin + textHeight; + float x = 40; + float y = 200; + float popupHeight = topMargin + bottomMargin + titleHeight + textTopMargin + textHeight; - Dimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSizeF(); __pReadingVe->SetBounds(FloatRectangle(x, y, popupWidth, popupHeight)); pCanvas = __pReadingVe->GetCanvasN(); SysTryCatch(NID_UI, pCanvas != null, , E_SYSTEM, "System error for accessibility popup"); - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, popupWidth, popupHeight), *pBgBitmap); - int drawingTextY = topMargin; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedTitleText); + pCanvas->DrawNinePatchedBitmap(FloatRectangle(0, 0, popupWidth, popupHeight), *pBgBitmap); + float drawingTextY = topMargin; + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedTitleText); drawingTextY += textTopMargin + titleHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pText); __pReadingVe->SetShowState(true); __pReadingVe->SetFlushNeeded(); pGuidePopupTimer->SetElement(__pReadingVe); @@ -630,7 +668,7 @@ _AccessibilityManager::ShowPopup() EnrichedText* pEnrichedBoundsText = null; EnrichedText* pEnrichedAbsBoundsText = null; TextElement* pElement = null; - Dimension screen; + FloatDimension screen; if (String("i686_emulated") != sysInfo.machine) { @@ -645,11 +683,7 @@ _AccessibilityManager::ShowPopup() { int accesibilityVisualElementLevel = 3000; result r = E_SUCCESS; -#if!defined(MULTI_WINDOW) - VisualElement* pRootVe = _ControlManager::GetInstance()->GetRoot().GetVisualElement(); -#else VisualElement* pRootVe = _ControlManager::GetInstance()->GetTopVisibleWindow()->GetVisualElement(); -#endif __pReadingVe = new (std::nothrow) VisualElement(); SysTryCatch(NID_UI, __pReadingVe, , E_SYSTEM, "[E_SYSTEM] System error"); @@ -662,20 +696,20 @@ _AccessibilityManager::ShowPopup() } } - screen = _ControlManager::GetInstance()->GetScreenSize(); + screen = _ControlManager::GetInstance()->GetScreenSizeF(); if (__pReadingVe) { result r = E_SUCCESS; - int titleFontSize = 0; - int textFontSize = 0; - int popupWidth = 0; - int topMargin = 0; - int bottomMargin = 0; - int sideMargin = 0; - int titleHeight = 0; - int textTopMargin = 0; - int textHeight = 0; + float titleFontSize = 0; + float textFontSize = 0; + float popupWidth = 0; + float topMargin = 0; + float bottomMargin = 0; + float sideMargin = 0; + float titleHeight = 0; + float textTopMargin = 0; + float textHeight = 0; Color titleTextColor; Color pointTextColor; @@ -718,39 +752,39 @@ _AccessibilityManager::ShowPopup() pEnrichedTitleText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedTitleText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - pEnrichedTitleText->Construct(Dimension(popupWidth-sideMargin*2, titleHeight)); + pEnrichedTitleText->Construct(FloatDimension(popupWidth-sideMargin*2, titleHeight)); pEnrichedNameText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedNameText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - pEnrichedNameText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedNameText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedLableText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedLableText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - pEnrichedLableText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedLableText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedTraitText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedTraitText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedTraitText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedTraitText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedStatusText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedStatusText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedStatusText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedStatusText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedHintText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedHintText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedHintText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedHintText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedValueText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedValueText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedValueText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedValueText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedBoundsText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedBoundsText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedBoundsText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedBoundsText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pEnrichedAbsBoundsText = new (std::nothrow) EnrichedText; SysTryCatch(NID_UI, pEnrichedAbsBoundsText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pEnrichedAbsBoundsText->Construct(Dimension(popupWidth-sideMargin*2, textHeight)); + pEnrichedAbsBoundsText->Construct(FloatDimension(popupWidth-sideMargin*2, textHeight)); pElement = new (std::nothrow) TextElement; r = pElement->Construct(L"Screen reading..."); @@ -935,9 +969,9 @@ _AccessibilityManager::ShowPopup() pElement = new (std::nothrow) TextElement; SysTryCatch(NID_UI, pElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - Rectangle rect = __pTargetElement->GetBounds(); + FloatRectangle rect = __pTargetElement->GetBounds(); String rectString; - rectString.Format(40, L"x:%d, y:%d, w:%d, h:%d", rect.x, rect.y, rect.width, rect.height); + rectString.Format(40, L"x:%f, y:%f, w:%f, h:%f", rect.x, rect.y, rect.width, rect.height); r = pElement->Construct(rectString); SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "System error for accessibility popup"); @@ -964,7 +998,7 @@ _AccessibilityManager::ShowPopup() SysTryCatch(NID_UI, pElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); rect = __pTargetElement->GetAbsoluteBounds(); rectString.Clear(); - rectString.Format(40, L"x:%d, y:%d, w:%d, h:%d", rect.x, rect.y, rect.width, rect.height); + rectString.Format(40, L"x:%f, y:%f, w:%f, h:%f", rect.x, rect.y, rect.width, rect.height); r = pElement->Construct(rectString); SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "System error for accessibility popup"); @@ -977,13 +1011,13 @@ _AccessibilityManager::ShowPopup() pEnrichedAbsBoundsText->SetTextWrapStyle(TEXT_WRAP_CHARACTER_WRAP); pEnrichedAbsBoundsText->SetTextAbbreviationEnabled(true); - int x = 0; - int y = 0; - int popupHeight = topMargin + bottomMargin + titleHeight + textTopMargin + textHeight * 8; + float x = 0; + float y = 0; + float popupHeight = topMargin + bottomMargin + titleHeight + textTopMargin + textHeight * 8; Frame* pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame(); Form* pForm = pFrame->GetCurrentForm(); - Dimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = Tizen::Ui::_ControlManager::GetInstance()->GetScreenSizeF(); if (pForm->GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || pForm->GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE) @@ -1014,25 +1048,25 @@ _AccessibilityManager::ShowPopup() __pReadingVe->SetBounds(FloatRectangle(x, y, popupWidth, popupHeight)); pCanvas = __pReadingVe->GetCanvasN(); SysTryCatch(NID_UI, pCanvas != null, , E_SYSTEM, "System error for accessibility popup"); - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, popupWidth, popupHeight), *pBgBitmap); - int drawingTextY = topMargin; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedTitleText); + pCanvas->DrawNinePatchedBitmap(FloatRectangle(0, 0, popupWidth, popupHeight), *pBgBitmap); + float drawingTextY = topMargin; + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedTitleText); drawingTextY += textTopMargin + titleHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedNameText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedNameText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedLableText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedLableText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedTraitText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedTraitText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedStatusText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedStatusText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedHintText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedHintText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedValueText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedValueText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedBoundsText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedBoundsText); drawingTextY += textHeight; - pCanvas->DrawText(Point(sideMargin, drawingTextY), *pEnrichedAbsBoundsText); + pCanvas->DrawText(FloatPoint(sideMargin, drawingTextY), *pEnrichedAbsBoundsText); __pReadingVe->SetShowState(true); __pReadingVe->SetFlushNeeded(); pGuidePopupTimer->SetElement(__pReadingVe); @@ -1044,47 +1078,47 @@ CATCH: pCanvas = null; delete pBgBitmap; pBgBitmap = null; - if(pEnrichedTitleText) + if (pEnrichedTitleText) { pEnrichedTitleText->RemoveAll(true); delete pEnrichedTitleText; } - if(pEnrichedNameText) + if (pEnrichedNameText) { pEnrichedNameText->RemoveAll(true); delete pEnrichedNameText; } - if(pEnrichedLableText) + if (pEnrichedLableText) { pEnrichedLableText->RemoveAll(true); delete pEnrichedLableText; } - if(pEnrichedTraitText) + if (pEnrichedTraitText) { pEnrichedTraitText->RemoveAll(true); delete pEnrichedTraitText; } - if(pEnrichedStatusText) + if (pEnrichedStatusText) { pEnrichedStatusText->RemoveAll(true); delete pEnrichedStatusText; } - if(pEnrichedHintText) + if (pEnrichedHintText) { pEnrichedHintText->RemoveAll(true); delete pEnrichedHintText; } - if(pEnrichedValueText) + if (pEnrichedValueText) { pEnrichedValueText->RemoveAll(true); delete pEnrichedValueText; } - if(pEnrichedBoundsText) + if (pEnrichedBoundsText) { pEnrichedBoundsText->RemoveAll(true); delete pEnrichedBoundsText; } - if(pEnrichedAbsBoundsText) + if (pEnrichedAbsBoundsText) { pEnrichedAbsBoundsText->RemoveAll(true); delete pEnrichedAbsBoundsText; @@ -1100,6 +1134,27 @@ _AccessibilityManager::OnFinishReading(const Tizen::Base::String& grammar) { __pReadingVe->SetShowState(false); } + if (!IsContainerValid(__pTargetContainer)) + { + return; + } + LinkedListT<_IAccessibilityListener*>* pList = static_cast*>(__pTargetContainer->GetListenerListN()); + if (pList != null) + { + for (int i = 0;iGetCount();i++) + { + _IAccessibilityListener* pListener = null; + if (pList->GetAt(i, pListener) == E_SUCCESS) + { + if (__pTargetElement) + { + pListener->OnAccessibilityReadedElement(*__pTargetContainer, *__pTargetElement); + } + } + } + delete pList; + pList = null; + } return; } @@ -1138,10 +1193,10 @@ _AccessibilityManager::MakeList(void) LinkedListT<_Control*> _list; int count = control.GetChildCount(); _Control* pControl = null; - for(int i = 0; i < count ; i++) + for (int i = 0; i < count ; i++) { pControl = control.GetChild(i); - if(pControl) + if (pControl) { _list.Add(pControl); } @@ -1151,14 +1206,14 @@ _AccessibilityManager::MakeList(void) int index = 0; list.IndexOf(&control, index); list.InsertItemsFrom(_list,index+1); - for(int i = 0; i < count ; i++) + for (int i = 0; i < count ; i++) { pControl = control.GetChild(i); DownVisitor(*pControl, list); } } }; - if(GetGestureMode() == MODE_FOCUS_MOVE) + if (GetGestureMode() == MODE_FOCUS_MOVE) { return; } @@ -1187,7 +1242,8 @@ _AccessibilityManager::MakeList(void) controlList.Add(pControl); } DownVisitor(*pControl, controlList); - + _AccessibilityItemComparer<_Control*> controlComparer; + //controlList.Sort(controlComparer); for (int i = 0; i < controlList.GetCount() ; i++) { if (controlList.GetAt(i, pControl) == E_SUCCESS) @@ -1197,7 +1253,7 @@ _AccessibilityManager::MakeList(void) { continue; } - if(IsContainerValid(pContainer)) + if (IsContainerValid(pContainer)) { pContainer->SortElements(); pContainer->GetElements(elementPositionList); @@ -1236,18 +1292,18 @@ _AccessibilityManager::MakeList(void) continue; } - if(pPositionListElement->GetParent()->GetPriority() > pPositionByControlListElement->GetParent()->GetPriority()) + if (pPositionListElement->GetParent()->GetPriority() > pPositionByControlListElement->GetParent()->GetPriority()) { elementPositionByControlList.Remove(pPositionListElement); - elementPositionByControlList.InsertAt(pPositionListElement, index > 2 ? index - 2 : 0); + elementPositionByControlList.InsertAt(pPositionListElement, index); __candidateList.Add(pPositionListElement); index++; continue; } - else if(pPositionListElement->GetParent()->GetPriority() < pPositionByControlListElement->GetParent()->GetPriority()) + else if (pPositionListElement->GetParent()->GetPriority() < pPositionByControlListElement->GetParent()->GetPriority()) { elementPositionList.Remove(pPositionByControlListElement); - elementPositionList.InsertAt(pPositionByControlListElement, index > 2 ? index - 2 : 0); + elementPositionList.InsertAt(pPositionByControlListElement, index); __candidateList.Add(pPositionByControlListElement); index++; continue; @@ -1256,7 +1312,7 @@ _AccessibilityManager::MakeList(void) if (pPositionListElement->GetAbsoluteBounds().y > pPositionByControlListElement->GetAbsoluteBounds().y) { elementPositionList.Remove(pPositionByControlListElement); - elementPositionList.InsertAt(pPositionByControlListElement, index > 2 ? index - 2 : 0); + elementPositionList.InsertAt(pPositionByControlListElement, index); __candidateList.Add(pPositionByControlListElement); index++; continue; @@ -1271,6 +1327,17 @@ _AccessibilityManager::MakeList(void) { break; } + else + { + if(pControl->GetParent()) + { + pControl = pControl->GetParent(); + } + else + { + break; + } + } } controlList.RemoveAll(); controlList.Add(pControl); @@ -1286,7 +1353,7 @@ _AccessibilityManager::MakeList(void) { continue; } - if(IsContainerValid(pContainer)) + if (IsContainerValid(pContainer)) { pContainer->GetElements(_elementPositionList); } @@ -1302,18 +1369,23 @@ _AccessibilityManager::MakeList(void) { continue; } + if (__candidateList.Contains(pElement)) + { + continue; + } __candidateList.Add(pElement); elementPositionByControlList.Remove(pElement); - elementPositionByControlList.InsertAt(pElement, index ); + elementPositionByControlList.InsertAt(pElement, index); elementPositionList.Remove(pElement); elementPositionList.InsertAt(pElement, index); index++; + } } else { elementPositionList.Remove(pPositionByControlListElement); - elementPositionList.InsertAt(pPositionByControlListElement, index > 2 ? index - 2 : 0); + elementPositionList.InsertAt(pPositionByControlListElement, index); __candidateList.Add(pPositionByControlListElement); index++; continue; @@ -1321,6 +1393,7 @@ _AccessibilityManager::MakeList(void) } count = __candidateList.GetCount(); + SysLog(NID_UI, "Accessibility element candidate count : %d", count); if (count < 1) { return; @@ -1342,7 +1415,7 @@ _AccessibilityManager::MakeList(void) __candidateList.Remove(pElement); __candidateList.InsertAt(pElement, 0); } - if(pElement->GetName() == L"ListViewItemText" ||pElement->GetName() == L"TableViewItem") + if (pElement->GetName() == L"ListViewItemText" ||pElement->GetName() == L"TableViewItem") { listItemEndIndex = i; } @@ -1350,13 +1423,13 @@ _AccessibilityManager::MakeList(void) { listItemStartIndex = i; } - if(fastScrollIndex == -1 && pElement->GetName() == L"FastScroll") + if (fastScrollIndex == -1 && pElement->GetName() == L"FastScroll") { fastScrollIndex = i; } } - if(listItemStartIndex != -1 && fastScrollIndex != -1) + if (listItemStartIndex != -1 && fastScrollIndex != -1) { if (fastScrollIndex > listItemStartIndex) { @@ -1412,7 +1485,7 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) int index = 0; _AccessibilityElement* pElement = null; _AccessibilityContainer* pContainer = null; - bool eventFired = false; + bool focusManaged = false; if (IsContainerValid(__pTargetContainer)) { r = __candidateList.IndexOf(__pTargetElement, 0, index); @@ -1427,7 +1500,7 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) if ((__pTargetContainer->MoveFocus(direction))) { pElement = __pTargetContainer->GetCurrentFocusedElement(); - eventFired = true; + focusManaged = true; } else { @@ -1441,6 +1514,13 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) index = 0; } __candidateList.GetAt(index, pElement); + if (pElement->GetParent()->IsFocusManaged()) + { + if ((pElement->GetParent()->MoveFocus(direction))) + { + focusManaged = true; + } + } } } } @@ -1450,15 +1530,35 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) } if (pElement) { - if (__pTargetContainer) + pContainer = pElement->GetParent(); + IListT<_IAccessibilityListener*>* pListenerList = pContainer->GetListenerListN(); + if (pListenerList) { - __pTargetContainer->SetCurrentFocusedElement(null); + int listenerCount = pListenerList->GetCount(); + if (listenerCount > 0) + { + for (int i = 0;iGetAt(i, pListener) == E_SUCCESS) + { + if (pListener->OnAccessibilityItemRefreshed(*pContainer, *pElement, direction) == true) + { + return MoveFocus(direction); + } + } + } + } + delete pListenerList; + pListenerList = null; } - pContainer = pElement->GetParent(); pContainer->SetCurrentFocusedElement(pElement); - if (!eventFired) + + if (__pTargetContainer) { - IListT<_IAccessibilityListener*>* pListenerList = pContainer->GetListenerListN(); + __pTargetContainer->SetCurrentFocusedElement(null); + + pListenerList = __pTargetContainer->GetListenerListN(); if (pListenerList) { int listenerCount = pListenerList->GetCount(); @@ -1473,18 +1573,28 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) } } } + delete pListenerList; + pListenerList = null; } } - DrawFocusUi(*pContainer); - __pTargetElement = pElement; - __pTargetContainer = pContainer; - __targetControlHandle = pContainer->GetOwner().GetHandle(); - ReadElement(*pElement); - if (!eventFired) + + if (focusManaged) + { + __pTargetElement = pElement; + __pTargetContainer = pContainer; + __targetControlHandle = pContainer->GetOwner().GetHandle(); + EraseFocusUi(); + } + + else { - IListT<_IAccessibilityListener*>* pListenerList = pContainer->GetListenerListN(); + DrawFocusUi(*pElement); + __pTargetElement = pElement; + __pTargetContainer = pContainer; + __targetControlHandle = pContainer->GetOwner().GetHandle(); + pListenerList = __pTargetContainer->GetListenerListN(); if (pListenerList) - { + { int listenerCount = pListenerList->GetCount(); if (listenerCount > 0) { @@ -1506,7 +1616,12 @@ _AccessibilityManager::MoveFocus(_AccessibilityFocusDirection direction) } } } + delete pListenerList; + pListenerList = null; + + ReadElement(*pElement); } + delete pListenerList; return true; } return false; @@ -1517,55 +1632,78 @@ _AccessibilityManager::RequestToDrawFocusUi() if (__pTargetContainer) { HidePopup(); - DrawFocusUi(*__pTargetContainer); + DrawFocusUi(*__pTargetElement); } } void -_AccessibilityManager::RequestAutoReading(void) +_AccessibilityManager::RequestAutoReading(_AccessibilityAutoReadingMode mode) { - pAutoReadingTimer->Start(); + pAutoReadingTimer->Start(mode); } void -_AccessibilityManager::DrawFocusUi(const _AccessibilityContainer& container) +_AccessibilityManager::SetTtsMode(_AccessibilityTtsMode mode) { - _AccessibilityElement* pElement = const_cast<_AccessibilityContainer&>(container).GetCurrentFocusedElement(); - if (pElement == null) + if (__pTtsPlayer) { - return; + __pTtsPlayer->SetMode(mode); } +} - Rectangle rectangle = pElement->GetBounds(); - Canvas* pCanvas = null; +void +_AccessibilityManager::SetGlobalFocusedElement(_AccessibilityElement& element) +{ + _AccessibilityElement* pElement = &element; + if (!IsContainerValid(pElement->GetParent())) + { + return; + } + __pTargetContainer = pElement->GetParent(); + __pTargetElement = pElement; + RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_CURRENT_FOCUS); +} - if (!(__targetControlHandle.IsValid())) +void +_AccessibilityManager::EraseFocusUi(void) +{ + if (__pFocusVe) { + __pFocusVe->Destroy(); __pFocusVe = null; } +} +void +_AccessibilityManager::DrawFocusUi(const _AccessibilityElement& element) +{ + FloatRectangle rectangle = element.GetBounds(); + Canvas* pCanvas = null; + + _AccessibilityContainer* pContainer = element.GetParent(); - if (&container != __pTargetContainer) + if (__focusedControlHandle.IsValid()) { if (__pFocusVe) { __pFocusVe->Destroy(); __pFocusVe = null; } - result r = E_SUCCESS; - _Control* pControl = &const_cast<_Control&>(container.GetOwner()); - _VisualElement* pControlVe = pControl->GetVisualElement(); + } + + result r = E_SUCCESS; + _Control* pControl = &const_cast<_Control&>(pContainer->GetOwner()); + _VisualElement* pControlVe = pControl->GetVisualElement(); - __pFocusVe = new (std::nothrow) VisualElement(); - SysTryCatch(NID_UI, pElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); - SysTryReturn(NID_UI, __pFocusVe, , E_SYSTEM, "[E_SYSTEM] System error"); - r = __pFocusVe->Construct(); - SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error"); + __pFocusVe = new (std::nothrow) VisualElement(); + SysTryCatch(NID_UI, __pFocusVe != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed"); + r = __pFocusVe->Construct(); + SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error"); - __pFocusVe->SetName("Accessibility focus ui"); - __pFocusVe->SetImplicitAnimationEnabled(false); - __pFocusVe->SetShowState(true); - pControlVe->AttachChild(*__pFocusVe); - } + __pFocusVe->SetName("Accessibility focus ui"); + __pFocusVe->SetImplicitAnimationEnabled(false); + __pFocusVe->SetShowState(true); + __focusedControlHandle = pControl->GetHandle(); + pControlVe->AttachChild(*__pFocusVe); if (__pFocusVe) { @@ -1604,7 +1742,7 @@ CATCH: return; } bool -_AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Point& point, const _TouchGestureDetector* pDetector) +_AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const FloatPoint& point, const _TouchGestureDetector* pDetector) { switch(type) { @@ -1629,7 +1767,8 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin SetGestureMode(MODE_TAP); __candidateList.RemoveAll(); } - _Control* pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(point); + Point pt((int)point.x, (int)point.y); + _Control* pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt); if (pControl == null) { return false; @@ -1648,7 +1787,7 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin return false; } } - _AccessibilityElement* pElement = pAccContainer->Hit(point); + _AccessibilityElement* pElement = pAccContainer->Hit(pt); if (pElement == null) { return false; @@ -1656,34 +1795,67 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin if (__pTargetElement == pElement) { - if (__pPlayer) + if (__pTtsPlayer) { - AccessibilityScreenReaderStatus status = __pPlayer->GetStatus(); + AccessibilityScreenReaderStatus status = __pTtsPlayer->GetStatus(); if (status == ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING) { return true; } } } - else + + if (!(pAccContainer->MoveFocus(pt))) { - if (IsContainerValid(__pTargetContainer)) - { - __pTargetContainer->ResetFocus(); - __pTargetContainer->GetOwner().Invalidate(); - } - if (!(pAccContainer->MoveFocus(point))) + return false; + } + LinkedListT<_IAccessibilityListener*>* pList = null; + if (IsContainerValid(__pTargetContainer)) + { + __pTargetContainer->ResetFocus(); + __pTargetContainer->GetOwner().Invalidate(); + pList = static_cast*>(__pTargetContainer->GetListenerListN()); + if (pList != null) { - return false; + int count = pList->GetCount(); + for (int i = 0;iGetAt(i, pListener) == E_SUCCESS) + { + pListener->OnAccessibilityFocusOut(*__pTargetContainer, *__pTargetElement); + } + } + delete pList; } - DrawFocusUi(*pAccContainer); + } + + if (pAccContainer->IsFocusManaged()) + { __pTargetContainer = pAccContainer; __targetControlHandle = pAccContainer->GetOwner().GetHandle(); __pTargetElement = pElement; } - - if (pElement != null) + else { + DrawFocusUi(*pElement); + __pTargetContainer = pAccContainer; + __targetControlHandle = pAccContainer->GetOwner().GetHandle(); + __pTargetElement = pElement; + pList = static_cast*>(__pTargetContainer->GetListenerListN()); + if (pList != null) + { + int count = pList->GetCount(); + for (int i = 0;iGetAt(i, pListener) == E_SUCCESS) + { + pListener->OnAccessibilityFocusIn(*__pTargetContainer, *__pTargetElement); + } + } + delete pList; + } ReadElement(*pElement); } } @@ -1723,10 +1895,10 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin return true; } - if(__pTargetElement->GetSupportOperatingGesture()) + if (__pTargetElement->GetSupportOperatingGesture()) { - Rectangle rect = __pTargetElement->GetAbsoluteBounds(); - Point _point(rect.x + rect.width/2, rect.y + rect.height/2); + FloatRectangle rect = __pTargetElement->GetAbsoluteBounds(); + Point _point((int)(rect.x + rect.width/2), (int)(rect.y + rect.height/2)); _UiTouchEvent pressedEvent(_pControl->GetHandle(), _TouchInfo(0, _TOUCH_PRESSED, _point, false, 0)); _UiTouchEvent releasedEvent(_pControl->GetHandle(), _TouchInfo(0, _TOUCH_RELEASED, _point, false, 0)); pressedEvent.SetAccessibilityEvent(true); @@ -1743,10 +1915,12 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin { return false; } + LinkedListT<_IAccessibilityListener*>* pList = static_cast*>(__pTargetContainer->GetListenerListN()); if (pList != null) { int count = pList->GetCount(); + SysLog(NID_UI, "Accessibility manager called listeners. count : %d", count); for (int i = 0;iGetOwner()); + if (pControl->GetEnableState() == false) + { + ReadContent(L"Unavailable"); + return true; + } + LinkedListT<_IAccessibilityListener*>* pList = static_cast*>(__pTargetContainer->GetListenerListN()); if (pList != null) { @@ -1784,7 +1966,7 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin _IAccessibilityListener* pListener = null; if (pList->GetAt(i, pListener) == E_SUCCESS) { - pListener->OnAccessibilityValueIncreased(*__pTargetContainer, *(__pTargetContainer->GetCurrentFocusedElement())); + pListener->OnAccessibilityValueIncreased(*__pTargetContainer, *__pTargetElement); } } delete pList; @@ -1797,6 +1979,14 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin { return false; } + + _Control* pControl = &(__pTargetContainer->GetOwner()); + if (pControl->GetEnableState() == false) + { + ReadContent(L"Unavailable"); + return true; + } + LinkedListT<_IAccessibilityListener*>* pList = static_cast*>(__pTargetContainer->GetListenerListN()); if (pList != null) { @@ -1806,7 +1996,7 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin _IAccessibilityListener* pListener = null; if (pList->GetAt(i, pListener) == E_SUCCESS) { - pListener->OnAccessibilityValueDecreased(*__pTargetContainer, *(__pTargetContainer->GetCurrentFocusedElement())); + pListener->OnAccessibilityValueDecreased(*__pTargetContainer, *__pTargetElement); } } delete pList; @@ -1815,13 +2005,14 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin break; case _ACCESSIBILITY_GESTURE_TYPE_TWO_FINGER_PANNING_STARTED: { - _Control* pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(point); + Point pt((int)point.x, (int)point.y); + _Control* pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt); if (pControl == null) { return false; } - _UiTouchEvent pressedEvent(pControl->GetHandle(), _TouchInfo(0, _TOUCH_PRESSED, point, false, 0)); + _UiTouchEvent pressedEvent(pControl->GetHandle(), _TouchInfo(0, _TOUCH_PRESSED, pt, false, 0)); pressedEvent.SetAccessibilityEvent(true); _UiEventManager::GetInstance()->SendEvent(pressedEvent); __pPanningControl = pControl; @@ -1834,7 +2025,8 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin { return false; } - _UiTouchEvent movedEvent(__pPanningControl->GetHandle(), _TouchInfo(0, _TOUCH_MOVED, point, false, 0)); + Point pt((int)point.x, (int)point.y); + _UiTouchEvent movedEvent(__pPanningControl->GetHandle(), _TouchInfo(0, _TOUCH_MOVED, pt, false, 0)); movedEvent.SetAccessibilityEvent(true); _UiEventManager::GetInstance()->SendEvent(movedEvent); } @@ -1845,7 +2037,8 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Poin { return false; } - _UiTouchEvent releasedEvent(__pPanningControl->GetHandle(), _TouchInfo(0, _TOUCH_RELEASED, point, false, 0)); + Point pt((int)point.x, (int)point.y); + _UiTouchEvent releasedEvent(__pPanningControl->GetHandle(), _TouchInfo(0, _TOUCH_RELEASED, pt, false, 0)); releasedEvent.SetAccessibilityEvent(true); _UiEventManager::GetInstance()->SendEvent(releasedEvent); __pPanningControl = null; @@ -1877,22 +2070,36 @@ _AccessibilityManager::Unregister(Tizen::Base::_HandleT <_AccessibilityContainer } void +_AccessibilityManager::OnChangedLocale(void) +{ + if (__pTtsPlayer && __pSettingLoader) + { + __pTtsPlayer->SetLocale(__pSettingLoader->GetLocaleString()); + __pTtsPlayer->ApplyLocale(); + } +} + +void _AccessibilityManager::OnAccessibilityScreenReaderIsActivated(bool set) { - if(__screenReaderIsEnabled == set) + if (__screenReaderIsEnabled == set) { return; } else { __screenReaderIsEnabled = set; - if(__screenReaderIsEnabled) + if (__screenReaderIsEnabled) { - __pPlayer->Activate(); + if (__pTtsPlayer) + { + __pTtsPlayer->SetLocale(__pSettingLoader->GetLocaleString()); + __pTtsPlayer->Activate(); + } } else { - __pPlayer->Deactivate(); + __pTtsPlayer->Deactivate(); } } } @@ -1907,7 +2114,7 @@ _AccessibilityManager::IsScreenReaderActivated(void) __screenReaderIsEnabled = __pSettingLoader->IsScreenReaderActivated(); return __screenReaderIsEnabled; } -int +float _AccessibilityManager::GetLargeFontSize(void) { return __pSettingLoader->GetLargeFontSize(); diff --git a/src/ui/FUi_AccessibilitySystemSettingLoader.cpp b/src/ui/FUi_AccessibilitySystemSettingLoader.cpp index 9241d22..a9e7dbd 100644 --- a/src/ui/FUi_AccessibilitySystemSettingLoader.cpp +++ b/src/ui/FUi_AccessibilitySystemSettingLoader.cpp @@ -15,12 +15,16 @@ // limitations under the License. // +#include +#include +#include #include "FUi_AccessibilitySystemSettingLoader.h" #include "FUi_AccessibilityManager.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" using namespace Tizen::Base; +using namespace Tizen::System; namespace Tizen { namespace Ui { @@ -32,13 +36,19 @@ _AccessibilitySystemSettingLoader::_AccessibilitySystemSettingLoader(_Accessibil { _screenReaderActivated = IsScreenReaderActivated(); _activated = _screenReaderActivated; + _SettingInfoImpl::AddSettingEventListenerForInternal(*this); } _AccessibilitySystemSettingLoader::~_AccessibilitySystemSettingLoader(void) { + _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this); } void _AccessibilitySystemSettingLoader::OnSettingChanged(String& key) { + if (key == L"http://tizen.org/setting/locale.country" || key == L"http://tizen.org/setting/locale.language") + { + __pManager->OnChangedLocale(); + } } bool @@ -46,16 +56,28 @@ _AccessibilitySystemSettingLoader::IsAccessibilityActivated(void) { return _activated; } + bool _AccessibilitySystemSettingLoader::IsScreenReaderActivated(void) { return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated(); } -int + +float _AccessibilitySystemSettingLoader::GetLargeFontSize(void) { return -1; } + +String +_AccessibilitySystemSettingLoader::GetLocaleString(void) +{ + String countryCode = L""; + result r = _SettingInfoImpl::GetValue(L"http://tizen.org/setting/locale.country", countryCode); + SysTryReturn(NID_UI, r == E_SUCCESS,L"", E_SYSTEM,"System error was occured."); + return countryCode; +} + void _AccessibilitySystemSettingLoader::SetSystemSetting(const Tizen::Base::String key, bool value) { diff --git a/src/ui/FUi_AccessibilityTtsPlayer.cpp b/src/ui/FUi_AccessibilityTtsPlayer.cpp index 11a8084..f41f254 100644 --- a/src/ui/FUi_AccessibilityTtsPlayer.cpp +++ b/src/ui/FUi_AccessibilityTtsPlayer.cpp @@ -18,20 +18,24 @@ #include #include #include +#include #include #include "FUi_AccessibilityTtsPlayer.h" -#include "FUi_AccessibilityManager.h" +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Locales; using namespace Tizen::Uix::Speech; namespace Tizen { namespace Ui { _AccessibilityTtsPlayer::_AccessibilityTtsPlayer(_AccessibilityManager& manager) : __pTts(null) - ,__grammar(L"") - ,__localeIdx(-1) - ,__status(ACCESSIBILITY_SCREEN_READER_STATUS_ERROR) - ,__pManager(&manager) + , __grammar(L"") + , __localeString(L"") + , __status(ACCESSIBILITY_SCREEN_READER_STATUS_ERROR) + , __ttsRequestMode(TEXT_TO_SPEECH_REQUEST_MODE_REPLACE) + , __pManager(&manager) { } _AccessibilityTtsPlayer::~_AccessibilityTtsPlayer(void) @@ -40,21 +44,22 @@ _AccessibilityTtsPlayer::~_AccessibilityTtsPlayer(void) __pTts = null; } result -_AccessibilityTtsPlayer::ReadGrammar(const Tizen::Base::String& grammar, bool bInit) +_AccessibilityTtsPlayer::ReadGrammar(const String& grammar, bool bInit) { if(grammar.GetLength() == 0) { return E_SUCCESS; } - if(bInit && GetStatus() == ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING) - { - StopReading(); - } +// if(bInit && GetStatus() == ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING) +// { +// StopReading(); +// } SetStatus(ACCESSIBILITY_SCREEN_READER_STATUS_PLAYING); __grammar = grammar; if (__pTts) { - __pTts->Speak(grammar, TEXT_TO_SPEECH_REQUEST_MODE_REPLACE); + SysLog(NID_UI, "Read Element : %ls", grammar.GetPointer()); + __pTts->Speak(grammar, __ttsRequestMode); } return E_SUCCESS; } @@ -73,7 +78,7 @@ _AccessibilityTtsPlayer::GetStatus(void) { return __status; } -Tizen::Base::String +String _AccessibilityTtsPlayer::GetCurrentGrammar(void) { return __grammar; @@ -107,22 +112,83 @@ _AccessibilityTtsPlayer::Deactivate(void) __pTts = null; return E_SUCCESS; } + void -_AccessibilityTtsPlayer::OnTextToSpeechInitialized(void) +_AccessibilityTtsPlayer::SetMode(_AccessibilityTtsMode mode) +{ + if (mode == _ACCESSIBILITY_TTS_MODE_APPEND) + { + __ttsRequestMode = TEXT_TO_SPEECH_REQUEST_MODE_APPEND; + } + else + { + __ttsRequestMode = TEXT_TO_SPEECH_REQUEST_MODE_REPLACE; + } +} + +void +_AccessibilityTtsPlayer::ApplyLocale(void) +{ + if (__pTts) + { + Locale locale = GetCurrentLocale(); + __pTts->SetLocale(locale); + } +} + +void +_AccessibilityTtsPlayer::SetLocale(const Tizen::Base::String& localeString) { - result r = E_SUCCESS; - Tizen::Locales::Locale locale(Tizen::Locales::LANGUAGE_ENG,Tizen::Locales::COUNTRY_US); + __localeString = localeString; +} + +Locale +_AccessibilityTtsPlayer::GetCurrentLocale(void) +{ + Locale locale(LANGUAGE_INVALID, COUNTRY_INVALID); if (__pTts) { - r=__pTts->SetLocale(locale); - SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error"); + const LinkedList* pList = static_cast(__pTts->GetSupportedLocales()); + int count = pList->GetCount(); + if(pList == null || count < 1) + { + delete __pTts; + __pTts = null; + SysLog(NID_UI, "System error was occured."); + } + + bool supportedLanguage = false; + for (int i = 0 ; i < count ; i++) + { + const Locale* pTempLocale = static_cast(pList->GetAt(i)); + String tempLocaleCode = L""; + tempLocaleCode.Append(pTempLocale->GetLanguageCodeString()); + tempLocaleCode.Append(L"_"); + tempLocaleCode.Append(pTempLocale->GetCountryCodeString()); + if (tempLocaleCode == __localeString) + { + locale = *pTempLocale; + supportedLanguage = true; + break; + } + } + if(!supportedLanguage) + { + locale = Locale(Tizen::Locales::LANGUAGE_ENG,Tizen::Locales::COUNTRY_US); + } } + return locale; +} + +void +_AccessibilityTtsPlayer::OnTextToSpeechInitialized(void) +{ + ApplyLocale(); } void _AccessibilityTtsPlayer::OnTextToSpeechCompleted(void) { - SetStatus(ACCESSIBILITY_SCREEN_READER_STATUS_READY); __pManager->OnFinishReading(__grammar); } @@ -146,9 +212,15 @@ _AccessibilityTtsPlayer::OnTextToSpeechStatusChanged (TextToSpeechStatus status) break; case TEXT_TO_SPEECH_STATUS_PAUSED: break; + case TEXT_TO_SPEECH_STATUS_READY: + if (__status == ACCESSIBILITY_SCREEN_READER_STATUS_ERROR) + { + __pManager->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); + } + SetStatus(ACCESSIBILITY_SCREEN_READER_STATUS_READY); + break; default: break; - } } void diff --git a/src/ui/FUi_CardLayoutImpl.cpp b/src/ui/FUi_CardLayoutImpl.cpp old mode 100644 new mode 100755 diff --git a/src/ui/FUi_CardLayoutImpl.h b/src/ui/FUi_CardLayoutImpl.h old mode 100644 new mode 100755 diff --git a/src/ui/FUi_Clipboard.cpp b/src/ui/FUi_Clipboard.cpp index 0f0d3da..dec7e69 100644 --- a/src/ui/FUi_Clipboard.cpp +++ b/src/ui/FUi_Clipboard.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Clipboard.cpp * @brief This is the implementation file for the _Clipboard class. */ + #include #include #include @@ -36,7 +38,9 @@ #include "FUi_ControlManager.h" #include "FUi_EcoreEvasMgr.h" #include "FUiCtrl_PublicClipboardPopupEvent.h" +#include "FUi_IClipboardPopupEventListener.h" +using namespace std; using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Base::Runtime; @@ -89,7 +93,10 @@ _Clipboard::ReleaseInstance(void) _Clipboard::~_Clipboard(void) { - HidePopup(); + if (IsPopupVisible() == true) + { + HidePopup(); + } if (__pPublicEvent) { @@ -506,6 +513,56 @@ _Clipboard::FireEvent(int format, char* pData) SetLastResult(E_SUCCESS); } +result +_Clipboard::AddClipboardPopupEventListener(_IClipboardPopupEventListener& listener) +{ + result r = E_SUCCESS; + + if (__pEvent.get() == null) + { + unique_ptr<_ClipboardPopupEvent> pEvent(_ClipboardPopupEvent::CreateInstanceN()); + SysTryReturnResult(NID_UI, pEvent, E_OUT_OF_MEMORY, "Memory is insufficient."); + + r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pEvent = move(pEvent); + } + + r = __pEvent->AddListener(listener); + + return r; +} + +result +_Clipboard::RemoveClipboardPopupEventListener(_IClipboardPopupEventListener& listener) +{ + SysTryReturnResult(NID_UI, __pEvent.get(), E_OBJ_NOT_FOUND, "The _IClipboardPopupEventListener does not exist in the event listener list."); + + result r = __pEvent->RemoveListener(listener); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +void +_Clipboard::FirePopupEvent(_ClipboardPopupState state, int width, int height) +{ + if (__pEvent.get() == null) + { + return; + } + + Dimension clipboardPopupSize(width, height); + IEventArg* pArg = _ClipboardPopupEvent::CreateClipboardPopupEventArgN(state, clipboardPopupSize); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI, pArg, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pEvent->Fire(*pArg); + + SetLastResult(E_SUCCESS); +} + _ClipFormat _Clipboard::ConvertToClipFormat(ClipboardDataType type) { diff --git a/src/ui/FUi_Clipboard.h b/src/ui/FUi_Clipboard.h index 6b5ce6a..1e70464 100644 --- a/src/ui/FUi_Clipboard.h +++ b/src/ui/FUi_Clipboard.h @@ -14,19 +14,23 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Clipboard.h * @brief This is the header file for the _Clipboard class. * * This header file contains the declarations of the %_Clipboard class. */ + #ifndef _FUI_INTERNAL_CLIPBOARD_H_ #define _FUI_INTERNAL_CLIPBOARD_H_ +#include #include #include #include "FUi_Types.h" #include "FUi_EcoreEvas.h" +#include "FUi_ClipboardPopupEvent.h" namespace Tizen { namespace Base { namespace Collection { class IList; @@ -44,6 +48,7 @@ namespace Tizen { namespace Ui { class _ClipboardItem; class IClipboardPopupEventListener; +class _IClipboardPopupEventListener; class _Clipboard : public Tizen::Base::Object @@ -63,6 +68,11 @@ public: void FireEvent(int format, char* pData); + result AddClipboardPopupEventListener(_IClipboardPopupEventListener& listener); + result RemoveClipboardPopupEventListener(_IClipboardPopupEventListener& listener); + + void FirePopupEvent(_ClipboardPopupState state, int width, int height); + private: _ClipFormat ConvertToClipFormat(ClipboardDataType type); ClipboardDataType ConvertToDataType(int format, const char* pData); @@ -88,6 +98,7 @@ private: private: Tizen::Ui::Controls::_PublicClipboardPopupEvent* __pPublicEvent; + std::unique_ptr<_ClipboardPopupEvent> __pEvent; static _Clipboard* __pInstance; }; // _Clipboard diff --git a/src/ui/FUi_ClipboardImpl.cpp b/src/ui/FUi_ClipboardImpl.cpp index 60263bd..60d256a 100644 --- a/src/ui/FUi_ClipboardImpl.cpp +++ b/src/ui/FUi_ClipboardImpl.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardImpl.cpp * @brief This is the implementation file for the _ClipboardImpl class. */ + #include #include #include diff --git a/src/ui/FUi_ClipboardImpl.h b/src/ui/FUi_ClipboardImpl.h index 509ccd3..87b45e5 100644 --- a/src/ui/FUi_ClipboardImpl.h +++ b/src/ui/FUi_ClipboardImpl.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardImpl.h * @brief This is the header file for the _ClipboardImpl class. * * This header file contains the declarations of the %_ClipboardImpl class. */ + #ifndef _FUI_INTERNAL_CLIPBOARD_IMPL_H_ #define _FUI_INTERNAL_CLIPBOARD_IMPL_H_ diff --git a/src/ui/FUi_ClipboardItem.cpp b/src/ui/FUi_ClipboardItem.cpp index 584f2b7..6cbe0d0 100644 --- a/src/ui/FUi_ClipboardItem.cpp +++ b/src/ui/FUi_ClipboardItem.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardItem.cpp * @brief This is the implementation file for the _ClipboardItem class. */ + #include #include #include diff --git a/src/ui/FUi_ClipboardItem.h b/src/ui/FUi_ClipboardItem.h index 87e5bfa..3cc0adc 100644 --- a/src/ui/FUi_ClipboardItem.h +++ b/src/ui/FUi_ClipboardItem.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardItem.h * @brief This is the header file for the _ClipboardItem class. * * This header file contains the declarations of the %_ClipboardItem class. */ + #ifndef _FUI_INTERNAL_CLIPBOARD_ITEM_H_ #define _FUI_INTERNAL_CLIPBOARD_ITEM_H_ diff --git a/src/ui/FUi_ClipboardItemImpl.cpp b/src/ui/FUi_ClipboardItemImpl.cpp index 4628021..26decc8 100644 --- a/src/ui/FUi_ClipboardItemImpl.cpp +++ b/src/ui/FUi_ClipboardItemImpl.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardItemImpl.cpp * @brief This is the implementation file for the _ClipboardItemImpl class. */ + #include #include #include diff --git a/src/ui/FUi_ClipboardItemImpl.h b/src/ui/FUi_ClipboardItemImpl.h index 6742aff..27a473b 100644 --- a/src/ui/FUi_ClipboardItemImpl.h +++ b/src/ui/FUi_ClipboardItemImpl.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ClipboardItemImpl.h * @brief This is the header file for the _ClipboardItemImpl class. * * This header file contains the declarations of the %_ClipboardItemImpl class. */ + #ifndef _FUI_INTERNAL_CLIPBOARD_ITEM_IMPL_H_ #define _FUI_INTERNAL_CLIPBOARD_ITEM_IMPL_H_ diff --git a/src/ui/FUi_ClipboardPopupEvent.cpp b/src/ui/FUi_ClipboardPopupEvent.cpp new file mode 100644 index 0000000..5802df1 --- /dev/null +++ b/src/ui/FUi_ClipboardPopupEvent.cpp @@ -0,0 +1,156 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_ClipboardPopupEvent.cpp + * @brief This is the implementation for the _ClipboardPopupEvent class. + * @version 1.0 + */ + +#include +#include +#include +#include +#include "FUi_ClipboardPopupEvent.h" + +using namespace std; +using namespace Tizen::Base; +using namespace Tizen::Base::Runtime; +using namespace Tizen::Graphics; + +namespace Tizen { namespace Ui +{ +/** + * @class _ClipboardPopupEventArg + * @brief This class is used as the argument to clipboard-popup event listener. + * + */ +class _ClipboardPopupEventArg + : public Tizen::Base::Runtime::IEventArg + , public Tizen::Base::Object +{ +public: + _ClipboardPopupEventArg(_ClipboardPopupState clipboardPopupState, Dimension& clipboardPopupSize); + + virtual ~_ClipboardPopupEventArg(void); + + _ClipboardPopupState GetClipboardPopupState(void) const; + Dimension GetClipboardPopupSize(void) const; + +private: + _ClipboardPopupEventArg(const _ClipboardPopupEventArg& rhs); + _ClipboardPopupEventArg& operator =(const _ClipboardPopupEventArg& rhs); + +private: + _ClipboardPopupState __clipboardPopupState; + Dimension __clipboardPopupSize; +}; // _ClipboardPopupEventArg + +_ClipboardPopupEventArg::_ClipboardPopupEventArg(_ClipboardPopupState clipboardPopupState, Dimension& clipboardPopupSize) + : __clipboardPopupState(clipboardPopupState) + , __clipboardPopupSize(clipboardPopupSize) +{ +} + +_ClipboardPopupEventArg::~_ClipboardPopupEventArg(void) +{ +} + +_ClipboardPopupState +_ClipboardPopupEventArg::GetClipboardPopupState(void) const +{ + return __clipboardPopupState; +} + +Dimension +_ClipboardPopupEventArg::GetClipboardPopupSize(void) const +{ + return __clipboardPopupSize; +} + +_ClipboardPopupEvent* +_ClipboardPopupEvent::CreateInstanceN(void) +{ + unique_ptr<_ClipboardPopupEvent> pClipboardPopupEvent(new (std::nothrow) _ClipboardPopupEvent()); + SysTryReturn(NID_UI, pClipboardPopupEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + SetLastResult(E_SUCCESS); + + return pClipboardPopupEvent.release(); +} + +IEventArg* +_ClipboardPopupEvent::CreateClipboardPopupEventArgN(_ClipboardPopupState clipboardPopupState, Dimension& clipboardPopupSize) +{ + ClearLastResult(); + + unique_ptr<_ClipboardPopupEventArg> pClipboardPopupEventArg(new (std::nothrow) _ClipboardPopupEventArg(clipboardPopupState, clipboardPopupSize)); + SysTryReturn(NID_UI, pClipboardPopupEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pClipboardPopupEventArg.release(); +} + +_ClipboardPopupEvent::~_ClipboardPopupEvent(void) +{ +} + +void +_ClipboardPopupEvent::FireImpl(IEventListener& listener, const IEventArg& arg) +{ + _IClipboardPopupEventListener* pEventListener = dynamic_cast <_IClipboardPopupEventListener*>(&listener); + SysTryReturnVoidResult(NID_UI, pEventListener, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); + + const _ClipboardPopupEventArg* pArg = dynamic_cast (&arg); + SysTryReturnVoidResult(NID_UI, pArg, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); + + _ClipboardPopupState state = pArg->GetClipboardPopupState(); + Dimension clipboardPopupSize = pArg->GetClipboardPopupSize(); + + switch (state) + { + case _CLIPBOARD_POPUP_STATE_OPENED: + pEventListener->OnClipboardPopupOpened(clipboardPopupSize); + break; + case _CLIPBOARD_POPUP_STATE_CLOSED: + pEventListener->OnClipboardPopupClosed(); + break; + case _CLIPBOARD_POPUP_STATE_BOUNDS_CHANGED: + pEventListener->OnClipboardPopupBoundsChanged(clipboardPopupSize); + break; + default: + SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + break; + } + + SetLastResult(E_SUCCESS); +} + +_ClipboardPopupEvent::_ClipboardPopupEvent(void) +{ + result r = _Event::Initialize(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + SetLastResult(E_SUCCESS); +} + +}} // Tizen::Ui diff --git a/src/ui/FUi_ContainerImpl.cpp b/src/ui/FUi_ContainerImpl.cpp old mode 100644 new mode 100755 index e9c7bf8..17645fe --- a/src/ui/FUi_ContainerImpl.cpp +++ b/src/ui/FUi_ContainerImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ContainerImpl.cpp * @brief This is the implementation file for _ContainerImpl class. @@ -25,6 +26,7 @@ #include "FUi_ContainerImpl.h" #include "FUi_WindowImpl.h" #include "FUi_Control.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_LayoutImpl.h" using namespace Tizen::App; @@ -72,6 +74,27 @@ _ContainerImpl::CreateContainerImplN(Container* pPublic, const Rectangle& bounds return pImpl; } +_ContainerImpl* +_ContainerImpl::CreateContainerImplN(Container* pPublic, const FloatRectangle& bounds, + const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, + bool resizable, bool movable) +{ + result r = E_SUCCESS; + + _Control* pCore = _Control::CreateControlN(); + SysTryReturn(NID_UI, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + + _ContainerImpl* pImpl = + new (std::nothrow) _ContainerImpl(pPublic, pCore, bounds, + pPublicPortraitLayout, pPublicLandscapeLayout, + resizable, movable); + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + ClearLastResult(); + + return pImpl; +} _ContainerImpl* _ContainerImpl::GetInstance(Container& container) @@ -153,6 +176,24 @@ _ContainerImpl::AddChild(_ControlImpl* pChild, bool transferOwnership) return E_SUCCESS; } +result +_ContainerImpl::Destroy(void) +{ + result r = E_SUCCESS; + _ContainerImpl* pParent = GetParent(); + if (pParent) + { + r = pParent->RemoveChild(this, true); + } + else + { + RemoveAllChildren(true); + delete &GetPublic(); + return E_SUCCESS; + } + return r; +} + // E_INVALID_ARG, E_OBJ_NOT_FOUND result _ContainerImpl::RemoveChild(_ControlImpl* pChild, bool deallocate) @@ -169,7 +210,7 @@ _ContainerImpl::RemoveChild(_ControlImpl* pChild, bool deallocate) return E_SUCCESS; } - GetChildIndex(pChild); + GetChildIndex(pChild); r = GetLastResult(); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -371,7 +412,7 @@ _ContainerImpl::GetChildIndex(const _ControlImpl* pChild) const result r = __controlPublics.IndexOf(pChild->GetPublic(), index); if (IsFailed(r)) { - SysAssert(r == E_OBJ_NOT_FOUND); // I can't beleve Tizen::Base. + SysAssert(r == E_OBJ_NOT_FOUND); SysLogException(NID_UI, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container."); return -1; } @@ -449,7 +490,7 @@ _ContainerImpl::SetChildAt(const _ControlImpl* pChild, int index) return E_SUCCESS; } - r = __controlPublics.SetAt(*pChild, index); + r = __controlPublics.SetAt(pChild->GetPublic(), index); SysAssert(r == E_SUCCESS); _Control* pTargetChild = GetCore().GetChild(index); @@ -509,28 +550,64 @@ _ContainerImpl::OnVisibleStateChanging(void) void _ContainerImpl::OnVisibleStateChanged(void) { - GetPublic().OnShowStateChanged(GetVisibleState()); _ControlImpl::OnVisibleStateChanged(); + GetPublic().OnShowStateChanged(GetVisibleState()); } result _ContainerImpl::OnBoundsChanging(const Rectangle& bounds) { - GetPublic().OnBoundsChanging(__oldBounds, bounds); + _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic()); + if (pChild) + { + GetPublic().OnBoundsChanging(_CoordinateSystemUtils::ConvertToInteger(__oldBounds), bounds); + } + + return _ControlImpl::OnBoundsChanging(bounds); +} + +result +_ContainerImpl::OnBoundsChanging(const FloatRectangle& bounds) +{ + _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic()); + if (pChild) + { + GetPublic().OnBoundsChanging(__oldBounds, bounds); + } return _ControlImpl::OnBoundsChanging(bounds); } void _ContainerImpl::OnBoundsChanged(void) { - GetPublic().OnBoundsChanged(__oldBounds, GetBounds()); _ControlImpl::OnBoundsChanged(); + _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic()); + if (pChild) + { + GetPublic().OnBoundsChanged(_CoordinateSystemUtils::ConvertToInteger(__oldBounds), GetBounds()); + GetPublic().OnBoundsChanged(__oldBounds, GetBoundsF()); + } } void _ContainerImpl::OnEvaluateSize(Dimension& evaluatedSize) { - GetPublic().OnEvaluateSize(evaluatedSize); + _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic()); + if (pChild) + { + GetPublic().OnEvaluateSize(evaluatedSize); + } + _ControlImpl::OnEvaluateSize(evaluatedSize); +} + +void +_ContainerImpl::OnEvaluateSize(FloatDimension& evaluatedSize) +{ + _ContainerImpl* pChild = _ContainerImpl::GetInstance(GetPublic()); + if (pChild) + { + GetPublic().OnEvaluateSize(evaluatedSize); + } _ControlImpl::OnEvaluateSize(evaluatedSize); } @@ -612,6 +689,29 @@ _ContainerImpl::_ContainerImpl(Control* pPublic, _Control* pCore, const Rectangl pCore->SetMovable(movable); } +_ContainerImpl::_ContainerImpl(Control* pPublic, _Control* pCore, const FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable) + : _ControlImpl(pPublic, pCore) +{ + result r = E_SUCCESS; + + Initialize(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout); + + r = GetLastResult(); + if (IsFailed(r)) + { + return; + } + + bool allOrNone = (pPublicPortraitLayout && pPublicLandscapeLayout) || (!pPublicPortraitLayout && !pPublicLandscapeLayout); + SysAssert(allOrNone); + + r = SetBounds(bounds); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + pCore->SetResizable(resizable); + pCore->SetMovable(movable); +} + result _ContainerImpl::SetLayout(_Control& core, _ControlOrientation orientation, const Layout* pPublicLayout) { diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index e8be5e7..6fc14e4 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Control.cpp * @brief This is the implementation file for the _Control class. @@ -28,8 +29,10 @@ #include #include #include +#include "FSys_SystemInfoImpl.h" #include "FUi_Control.h" #include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_Window.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" @@ -42,8 +45,9 @@ #include "FUi_TouchTapGestureDetector.h" #include "FUi_AccessibilityContainer.h" #include "FUi_ResourceManager.h" -#include "FUiAnim_VisualElement.h" #include "FUiAnim_ControlVisualElement.h" +#include "FUiAnim_Debug.h" +#include "FUiAnim_VisualElement.h" #include "FUiAnim_VisualElementImpl.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" @@ -82,7 +86,7 @@ GetZOrderGroupOfVisualElement(_ControlLayer layer) } inline bool -AdjustSizeToRange(int& width, int& height, const Dimension& minDim, const Dimension& maxDim) +AdjustSizeToRange(float& width, float& height, const FloatDimension& minDim, const FloatDimension& maxDim) { bool changed = false; if (width < minDim.width) @@ -111,7 +115,7 @@ AdjustSizeToRange(int& width, int& height, const Dimension& minDim, const Dimens } inline bool -AdjustSizeToRange(Dimension& dim, const Dimension& minDim, const Dimension& maxDim) +AdjustSizeToRange(FloatDimension& dim, const FloatDimension& minDim, const FloatDimension& maxDim) { return AdjustSizeToRange(dim.width, dim.height, minDim, maxDim); } @@ -396,42 +400,44 @@ public: __pControl->SetVisibleState(visible); } - result SetItemBounds(const Rectangle& rect) + result SetItemBounds(const FloatRectangle& rect) { - SysAssert(__pControl->IsInSizeRange(Dimension(rect.width, rect.height))); - FloatRectangle floatBounds(rect.x, rect.y, rect.width, rect.height); - return __pControl->SetBoundsFinal(floatBounds, false, true); + SysAssert(__pControl->IsInSizeRange(Dimension(_CoordinateSystemUtils::ConvertToInteger(rect.width), _CoordinateSystemUtils::ConvertToInteger(rect.height)))); + return __pControl->SetBoundsFinal(rect, false, true); } - Rectangle GetItemBounds(void) const + FloatRectangle GetItemBounds(void) const { - return __pControl->GetBounds(); + return __pControl->GetBoundsF(); } - Rectangle GetItemClientBoundsFromSize(const Dimension& size) const + FloatRectangle GetItemClientBoundsFromSize(const FloatDimension& size) const { - return __pControl->GetClientBounds(size); + return __pControl->GetClientBoundsF(size); } - Dimension GetItemContentSize(void) const + FloatDimension GetItemContentSize(void) const { - return __pControl->GetControlDelegate().GetContentSize(); + Dimension dim = __pControl->GetControlDelegate().GetContentSize(); + return FloatDimension(dim.width, dim.height); } - Dimension GetItemMinimumSize(void) const + FloatDimension GetItemMinimumSize(void) const { - return __pControl->GetMinimumSize(); + return __pControl->GetMinimumSizeF(); } - Dimension GetItemMaximumSize(void) const + FloatDimension GetItemMaximumSize(void) const { - return __pControl->GetMaximumSize(); + return __pControl->GetMaximumSizeF(); } - result OnItemMeasure(int& width, int& height) + result OnItemMeasure(float& width, float& height) { - Dimension evaluatedSize(width, height); + Dimension evaluatedSize(_CoordinateSystemUtils::ConvertToInteger(width), _CoordinateSystemUtils::ConvertToInteger(height)); + FloatDimension evaluatedSizeF(width, height); __pControl->GetControlDelegate().OnEvaluateSize(evaluatedSize); + __pControl->GetControlDelegate().OnEvaluateSize(evaluatedSizeF); width = evaluatedSize.width; height = evaluatedSize.height; @@ -625,6 +631,10 @@ _Control::OnFocusGained(const _Control& source) bool _Control::OnFocusLost(const _Control& source) { + if (__pFocusVisualElement) + { + __pFocusVisualElement.reset(); + } return false; } @@ -658,7 +668,14 @@ Dimension _Control::GetContentSize(void) const { ClearLastResult(); - return GetSize(); + return Dimension(0, 0); +} + +FloatDimension +_Control::GetContentSizeF(void) const +{ + ClearLastResult(); + return FloatDimension(0.0f, 0.0f); } HitTestResult @@ -677,16 +694,16 @@ _Control::HitTest(const FloatPoint& point) return HIT_TEST_NOWHERE; } -int +float _Control::GetVerticalScrollPosition(void) const { - return 0; + return 0.0f; } -int +float _Control::GetHorizontalScrollPosition(void) const { - return 0; + return 0.0f; } _ControlOrientation @@ -708,6 +725,13 @@ _Control::OnCanvasRequestedN(const Dimension& size) return null; } +Canvas* +_Control::OnCanvasRequestedFN(const FloatDimension& size) +{ + + return null; +} + Bitmap* _Control::OnCapturedBitmapRequestedN(void) { @@ -762,6 +786,12 @@ _Control::OnBoundsChanging(const Rectangle& bounds) return E_SUCCESS; } +result +_Control::OnBoundsChanging(const FloatRectangle& bounds) +{ + return E_SUCCESS; +} + void _Control::OnBoundsChanged(void) { @@ -771,13 +801,19 @@ _Control::OnBoundsChanged(void) void _Control::OnEvaluateSize(Dimension& evaluatedSize) { + } void -_Control::OnParentBoundsChanged(const _Control& parent) +_Control::OnEvaluateSize(FloatDimension& evaluatedSize) { + } +void +_Control::OnParentBoundsChanged(const _Control& parent) +{ +} void _Control::OnChildAttached(const _Control& child) @@ -860,6 +896,16 @@ _Control::OnFontInfoRequested(unsigned long& style, int& size) } void +_Control::OnFontInfoRequested(unsigned long& style, float& size) +{ +} + +void +_Control::OnBackgroundColorChanged(Color& backgroundColor) +{ +} + +void _Control::OnTouchCancelHandled(const _Control& control) { } @@ -1035,6 +1081,16 @@ _Control::Invalidate(const Rectangle& rect) FloatRectangle rectf(rect.x, rect.y, rect.width, rect.height); GetVisualElement()->InvalidateRectangle(&rectf); + __invalidatedBounds = _CoordinateSystemUtils::ConvertToFloat(rect); +} + +void +_Control::Invalidate(const FloatRectangle& rect) +{ + ClearLastResult(); + FloatRectangle rectf(rect.x, rect.y, rect.width, rect.height); + GetVisualElement()->InvalidateRectangle(&rectf); + __invalidatedBounds = rect; } @@ -1048,6 +1104,17 @@ _Control::Contains(const Point& point) const return bounds.Contains(point); } +bool +_Control::Contains(const FloatPoint& point) const +{ + ClearLastResult(); + + FloatRectangle bounds = GetBoundsF(); + bounds.x = bounds.y = 0; + return bounds.Contains(point); +} + + void _Control::PartialUpdateLayout(void) { @@ -1444,13 +1511,7 @@ _Control::StartAttaching(_Control& child, _ControlArea area) r = GetLastResult(); SysTryReturn(NID_UI, pMgr, r, r, "[%s] Propagating.", GetErrorMessage(r)); -#if !defined(MULTI_WINDOW) - if (this != &(pMgr->GetRoot())) -#endif - { - r = __pLayoutContainer->AddItem(child.GetLayoutContainer()); - } - + r = __pLayoutContainer->AddItem(child.GetLayoutContainer()); if (IsFailed(r)) { child.GetControlDelegate().OnAttachingFailed(*this); @@ -1461,11 +1522,7 @@ _Control::StartAttaching(_Control& child, _ControlArea area) if (IsAttachedToMainTree()) { -#if defined(MULTI_WINDOW) if (!(IsOrientationRoot() && child.IsOrientationRoot())) -#else - if (IsLayoutChangable() && child.IsLayoutChangable()) -#endif { child.ChangeLayout(_ControlManager::GetInstance()->GetOrientation()); } @@ -1494,12 +1551,12 @@ _Control::EndAttaching(_Control& child) { child.SetParent(this); - FloatRectangle floatBounds(child.GetBounds().x, child.GetBounds().y, child.GetBounds().width, child.GetBounds().height); + FloatRectangle floatBounds(child.GetBoundsF().x, child.GetBoundsF().y, child.GetBoundsF().width, child.GetBoundsF().height); result r = E_SUCCESS; if (child.IsLayoutChangable() == false) { - r = child.UpdateBoundsOfVisualElement(FloatRectangle(0, 0, floatBounds.width, floatBounds.height)); + r = child.UpdateBoundsOfVisualElement(FloatRectangle(0.0f, 0.0f, floatBounds.width, floatBounds.height)); } else { @@ -1705,13 +1762,8 @@ _Control::DetachChild(_Control& child) r = GetLastResult(); SysTryReturn(NID_UI, pMgr, r, r, "[%s] Propagating.", GetErrorMessage(r)); -#if !defined(MULTI_WINDOW) - if (this != &(pMgr->GetRoot())) -#endif - { - r = __pLayoutContainer->RemoveItem(child.GetLayoutContainer()); - SysAssert(r == E_SUCCESS); // [ToDo] Exception check and rollback. - } + r = __pLayoutContainer->RemoveItem(child.GetLayoutContainer()); + SysAssert(r == E_SUCCESS); // [ToDo] Exception check and rollback. } child.SetParent(null); @@ -2033,7 +2085,7 @@ _Control::GetParent(void) const Canvas* _Control::GetCanvasN(void) const { - return GetCanvasN(Rectangle(0, 0, __bounds.width, __bounds.height)); + return GetCanvasN(FloatRectangle(0.0f, 0.0f, __bounds.width, __bounds.height)); } Canvas* @@ -2060,6 +2112,30 @@ _Control::GetCanvasN(const Rectangle& bounds) const return pCanvas; } +Canvas* +_Control::GetCanvasN(const FloatRectangle& bounds) const +{ + ClearLastResult(); + Canvas *pCanvas = GetControlDelegate().OnCanvasRequestedFN(FloatDimension(bounds.width, bounds.height)); + if (pCanvas == null) + { + GetVisualElement()->SetFlushNeeded(); + pCanvas = GetVisualElement()->GetCanvasN(bounds); + if (IsFailed(GetLastResult())) + { + SysLog(NID_UI_CTRL, "[%s] Propagated", GetErrorMessage(GetLastResult())); + } + + if (pCanvas && !__isCalledGetCanvasN) + { + pCanvas->SetBackgroundColor(GetBackgroundColor()); + pCanvas->Clear(); + const_cast <_Control*>(this)->__isCalledGetCanvasN = true; + } + } + return pCanvas; +} + bool _Control::IsCalledGetCanvasN(void) const { @@ -2160,13 +2236,6 @@ _Control::IsAttachedToMainTree(void) const return false; } -#if !defined(MULTI_WINDOW) - if (this == &(pMgr->GetRoot())) - { - return true; - } -#endif - _Window* pRootWindow = GetRootWindow(); if (pRootWindow == null) { @@ -2264,7 +2333,7 @@ _Control::GetFocused(void) const } result -_Control::SetFocused(void) +_Control::SetFocused(bool on) { ClearLastResult(); @@ -2276,64 +2345,75 @@ _Control::SetFocused(void) IsFocusable(), E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This Control isn't focusable control."); - _Window* pTop = GetRootWindow(); - SysAssert(pTop); + if (on) + { + _Window* pTop = GetRootWindow(); + SysAssert(pTop); + pTop->SetFocusState(false); - pTop->SetFocusOff(this); - SetFocusOn(); + _ControlManager* pControlMgr = _ControlManager::GetInstance(); + SysAssert(pControlMgr); - _ControlManager* pControlMgr = _ControlManager::GetInstance(); - SysAssert(pControlMgr); + if (pTop->IsActivated() && pTop->IsFocusableDescendant(this)) + { + pControlMgr->SetFocusedControl(*this); + SetFocusState(true); + } - if (pTop->IsActivated() && pTop->IsFocusableDescendant(this)) - { - pControlMgr->SetFocusedControl(*this); // Dangerous if _Control::Manager::SetFocusedControl() is called by User. + if (IsFailed(GetLastResult())) + { + SysLog(NID_UI_CTRL, "[%s] Propagated", GetErrorMessage(GetLastResult())); + } } - - if (IsFailed(GetLastResult())) + else { - SysLog(NID_UI_CTRL, "[%s] Propagated", GetErrorMessage(GetLastResult())); + _ControlManager* pControlMgr = _ControlManager::GetInstance(); + SysAssert(pControlMgr); + pControlMgr->SetFocusedControl(*this, false); + SetFocusState(false); + + if (IsFailed(GetLastResult())) + { + SysLog(NID_UI_CTRL, "[%s] Propagated", GetErrorMessage(GetLastResult())); + } } return E_SUCCESS; } - -// [ToDo] Assume the control is attached to the main tree. -void -_Control::SetFocusOn(void) -{ - ClearLastResult(); - - __focusSet = true; - _Control* pParent = GetParent(); - if (pParent) - { - pParent->SetFocusOn(); - } -} - // [ToDo] Find the focused descendent and clear flags upwards. void -_Control::SetFocusOff(_Control* pFocus) +_Control::SetFocusState(bool on) { ClearLastResult(); - __focusSet = false; - for (int i = 0; i < GetChildCount(); ++i) + if (on) { - _Control* pChild = GetChild(i); - - SysAssert(pChild); - if (pChild == null) + __focusSet = true; + _Control* pParent = GetParent(); + if (pParent) { - continue; + pParent->SetFocusState(true); } - - if (pChild->__focusSet == true) + } + else + { + __focusSet = false; + for (int i = 0; i < GetChildCount(); ++i) { - pChild->SetFocusOff(pFocus); - return; + _Control* pChild = GetChild(i); + + SysAssert(pChild); + if (pChild == null) + { + continue; + } + + if (pChild->__focusSet == true) + { + pChild->SetFocusState(false); + return; + } } } } @@ -2350,6 +2430,7 @@ _Control::SetFont(const String& fontName) __isControlFontChanged = true; __fontName = fontName; + __fontFileName.Clear(); Font* pFont = GetFallbackFont(); @@ -2364,14 +2445,18 @@ _Control::SetFont(const String& fontName) Font* _Control::GetFallbackFont(void) { - unsigned long style; - int textSize; + unsigned long style = 0; + int textSize = 0; + float floatTextSize = 0.0f; result r = E_SUCCESS; _IControlDelegate& delegate = GetControlDelegate(); delegate.OnFontInfoRequested(style, textSize); + delegate.OnFontInfoRequested(style, floatTextSize); _ControlManager* pControlManager = _ControlManager::GetInstance(); - if (!(__isControlFontChanged || pControlManager->IsDefaultFontChanged()) && __pFont != null && __pFont->GetSize() == textSize) + if (!(__isControlFontChanged || pControlManager->IsDefaultFontChanged()) + && __pFont != null + && ((__pFont->GetSize() == textSize || __pFont->GetSizeF() == floatTextSize))) { return __pFont; } @@ -2384,22 +2469,78 @@ _Control::GetFallbackFont(void) _FontImpl* pFontImpl = _FontImpl::GetInstance(*pTempFont); SysAssertf(pFontImpl != null, "Getting _FontImpl instance failed."); - r = pFontImpl->Construct(__fontName, style, textSize, false); + if (floatTextSize > 0.0f) + { + r = pFontImpl->Construct(__fontName, style, floatTextSize, false); + } + else + { + r = pFontImpl->Construct(__fontName, style, textSize, false); + } + + SysTryReturn(NID_UI, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "%s.", GetErrorMessage(r)); + SysTryReturn(NID_UI, r == E_SUCCESS, null, E_FILE_NOT_FOUND, "%s.", GetErrorMessage(r)); + } + else if (!__fontFileName.IsEmpty()) + { + __isControlFontChanged = false; + _FontImpl* pFontImpl = _FontImpl::GetInstance(*pTempFont); + SysAssertf(pFontImpl != null, "Getting _FontImpl instance failed."); + + if (floatTextSize > 0.0f) + { + r = pFontImpl->Construct(__fontFileName, style, floatTextSize); + } + else + { + r = pFontImpl->Construct(__fontFileName, style, textSize); + } SysTryReturn(NID_UI, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "%s.", GetErrorMessage(r)); SysTryReturn(NID_UI, r == E_SUCCESS, null, E_FILE_NOT_FOUND, "%s.", GetErrorMessage(r)); + } else if (!pControlManager->GetDefaultFont().IsEmpty()) { _FontImpl* pFontImpl = _FontImpl::GetInstance(*pTempFont); SysAssertf(pFontImpl != null, "Getting _FontImpl instance failed."); - r = pFontImpl->Construct(pControlManager->GetDefaultFont(), style, textSize, false); + if (floatTextSize > 0.0f) + { + r = pFontImpl->Construct(pControlManager->GetDefaultFont(), style, floatTextSize, false); + } + else + { + r = pFontImpl->Construct(pControlManager->GetDefaultFont(), style, textSize, false); + } + SysTryReturn(NID_UI, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "%s.", GetErrorMessage(r)); + SysTryReturn(NID_UI, r == E_SUCCESS, null, E_FILE_NOT_FOUND, "%s.", GetErrorMessage(r)); + } + else if (!pControlManager->GetDefaultFontFile().IsEmpty()) + { + _FontImpl* pFontImpl = _FontImpl::GetInstance(*pTempFont); + SysAssertf(pFontImpl != null, "Getting _FontImpl instance failed."); + + if (floatTextSize > 0.0f) + { + r = pFontImpl->Construct(pControlManager->GetDefaultFontFile(), style, floatTextSize); + } + else + { + r = pFontImpl->Construct(pControlManager->GetDefaultFontFile(), style, textSize); + } SysTryReturn(NID_UI, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "%s.", GetErrorMessage(r)); SysTryReturn(NID_UI, r == E_SUCCESS, null, E_FILE_NOT_FOUND, "%s.", GetErrorMessage(r)); } else { - r = pTempFont->Construct(style, textSize); + if (floatTextSize > 0.0f) + { + r = pTempFont->Construct(style, floatTextSize); + } + else + { + r = pTempFont->Construct(style, textSize); + } SysTryReturn(NID_UI, r != E_OUT_OF_MEMORY, null, E_OUT_OF_MEMORY, "%s.", GetErrorMessage(r)); SysTryReturn(NID_UI, r == E_SUCCESS, null, E_FILE_NOT_FOUND, "%s.", GetErrorMessage(r)); } @@ -2471,7 +2612,7 @@ _Control::SetEnableState(bool enabledState) } bool -_Control::IsInputEnabled(void) const +_Control::IsInputEventEnabled(void) const { ClearLastResult(); @@ -2508,10 +2649,18 @@ _Control::GetInputEnableState(void) const } void -_Control::SetInputEnableState(bool inputEnabledState) +_Control::SetInputEventEnableState(bool enableState) { + _TouchManager* pTouchManager = _TouchManager::GetInstance(); + SysTryReturnVoidResult(NID_UI, pTouchManager != null, E_SYSTEM, "[E_SYSTEM] TouchManager Instance is null"); + + if (enableState == false) + { + pTouchManager->SetTouchReleased(); + } + ClearLastResult(); - __inputEnabledState = inputEnabledState; + __inputEnabledState = enableState; } bool @@ -2644,6 +2793,13 @@ Rectangle _Control::GetBounds(void) const { ClearLastResult(); + return _CoordinateSystemUtils::ConvertToInteger(__bounds); +} + +FloatRectangle +_Control::GetBoundsF(void) const +{ + ClearLastResult(); return __bounds; } @@ -2651,14 +2807,28 @@ Point _Control::GetPosition(void) const { ClearLastResult(); - return Point(__bounds.x, __bounds.y); + return Point(_CoordinateSystemUtils::ConvertToInteger(__bounds.x), _CoordinateSystemUtils::ConvertToInteger(__bounds.y)); +} + +FloatPoint +_Control::GetPositionF(void) const +{ + ClearLastResult(); + return FloatPoint(__bounds.x, __bounds.y); } Dimension _Control::GetSize(void) const { ClearLastResult(); - return Dimension(__bounds.width, __bounds.height); + return Dimension(_CoordinateSystemUtils::ConvertToInteger(__bounds.width), _CoordinateSystemUtils::ConvertToInteger(__bounds.height)); +} + +FloatDimension +_Control::GetSizeF(void) const +{ + ClearLastResult(); + return FloatDimension(__bounds.width, __bounds.height); } // E_SYSTEM @@ -2689,11 +2859,11 @@ _Control::IsInSizeRange(const Dimension& size) // Custom Exception: ex) Location::Map result -_Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseRect, bool callBoundsChangeCallbacks) +_Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseRect, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) { result r = E_SUCCESS; - Rectangle bounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + FloatRectangle bounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height); _IControlDelegate& delegate = GetControlDelegate(); @@ -2702,6 +2872,12 @@ _Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseR if ((moved || resized) && callBoundsChangeCallbacks) { + r = delegate.OnBoundsChanging(_CoordinateSystemUtils::ConvertToInteger(bounds)); + if (IsFailed(r)) + { + SysLogException(NID_UI, r, "[%s] Callback returns exception.", GetErrorMessage(r)); + return r; // Relay the result; + } r = delegate.OnBoundsChanging(bounds); if (IsFailed(r)) { @@ -2710,12 +2886,12 @@ _Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseR } } - if (moved || resized) + if ((moved || resized) && callUpdateBoundsOfVisualElement) { const FloatRectangle fbounds(bounds.x, bounds.y, bounds.width, bounds.height); if (IsLayoutChangable() == false) { - r = UpdateBoundsOfVisualElement(FloatRectangle(0, 0, fbounds.width, fbounds.height)); + r = UpdateBoundsOfVisualElement(FloatRectangle(0.0f, 0.0f, fbounds.width, fbounds.height)); } else { @@ -2736,7 +2912,7 @@ _Control::SetBoundsFinal(const FloatRectangle& newBounds, bool changeLayoutBaseR { if (IsMovable() && IsResizable()) { - SetClientBounds(Rectangle(0, 0, GetSize().width, GetSize().height)); + SetClientBounds(FloatRectangle(0.0f, 0.0f, GetSizeF().width, GetSizeF().height)); } delegate.OnBoundsChanged(); @@ -2773,7 +2949,7 @@ _Control::AdjustSizeToRange(void) SysAssert(IsResizable()); - Dimension size = GetSize(); + FloatDimension size = GetSizeF(); bool changed = ::AdjustSizeToRange(size, __minSize, __maxSize); if (!changed) { @@ -2793,7 +2969,7 @@ _Control::AdjustSizeToRange(void) // Custom Exception: ex) Location::Map // E_INVALID_ARG result -_Control::SetBoundsInternal(const FloatRectangle& bounds, bool callBoundsChangeCallbacks) +_Control::SetBoundsInternal(const FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) { SysTryReturn(NID_UI, IsInSizeRange(Dimension(bounds.width, bounds.height)), E_INVALID_ARG, @@ -2803,14 +2979,14 @@ _Control::SetBoundsInternal(const FloatRectangle& bounds, bool callBoundsChangeC SetUpdateLayoutState(true); - return SetBoundsFinal(bounds, true, callBoundsChangeCallbacks); + return SetBoundsFinal(bounds, true, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); } // Custom Exception: ex) Location::Map // E_INVALID_ARG // E_UNSUPPORTED_OPERATION result -_Control::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks) +_Control::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) { ClearLastResult(); @@ -2822,14 +2998,14 @@ _Control::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks) } FloatRectangle floatBounds(bounds.x, bounds.y, bounds.width, bounds.height); - return SetBoundsInternal(floatBounds, callBoundsChangeCallbacks); + return SetBoundsInternal(floatBounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); } // Custom Exception: ex) Location::Map // E_INVALID_ARG // E_UNSUPPORTED_OPERATION result -_Control::SetBounds(const FloatRectangle& bounds, bool callBoundsChangeCallbacks) +_Control::SetBounds(const FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) { ClearLastResult(); @@ -2840,7 +3016,7 @@ _Control::SetBounds(const FloatRectangle& bounds, bool callBoundsChangeCallbacks E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not movable nor resizable."); } - return SetBoundsInternal(bounds, callBoundsChangeCallbacks); + return SetBoundsInternal(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); } // A custom Exception can occur. ex) Location::Map @@ -2858,6 +3034,18 @@ _Control::SetPosition(const Point& position) return SetBoundsInternal(FloatRectangle(position.x, position.y, __bounds.width, __bounds.height), true); } +result +_Control::SetPosition(const FloatPoint& position) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, + IsMovable(), E_UNSUPPORTED_OPERATION, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not movable."); + + return SetBoundsInternal(FloatRectangle(position.x, position.y, __bounds.width, __bounds.height), true); +} + // Custom Exception: ex) Location::Map // E_INVALID_ARG // E_UNSUPPORTED_OPERATION @@ -2873,11 +3061,31 @@ _Control::SetSize(const Dimension& size) return SetBoundsInternal(FloatRectangle(__bounds.x, __bounds.y, size.width, size.height), true); } +result +_Control::SetSize(const FloatDimension& size) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, + IsResizable(), E_UNSUPPORTED_OPERATION, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not resizable."); + + return SetBoundsInternal(FloatRectangle(__bounds.x, __bounds.y, size.width, size.height), true); +} + Dimension _Control::GetMinimumSize(void) const { ClearLastResult(); + return _CoordinateSystemUtils::ConvertToInteger(__minSize); +} + +FloatDimension +_Control::GetMinimumSizeF(void) const +{ + ClearLastResult(); + return __minSize; } @@ -2886,6 +3094,14 @@ _Control::GetMaximumSize(void) const { ClearLastResult(); + return _CoordinateSystemUtils::ConvertToInteger(__maxSize); +} + +FloatDimension +_Control::GetMaximumSizeF(void) const +{ + ClearLastResult(); + return __maxSize; } @@ -2918,6 +3134,36 @@ _Control::SetMinimumSize(const Dimension& newMinSize) __maxSize.height = newMinSize.height; } + __minSize = _CoordinateSystemUtils::ConvertToFloat(newMinSize); + return AdjustSizeToRange(); +} + +result +_Control::SetMinimumSize(const FloatDimension& newMinSize) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, + IsResizable(), E_UNSUPPORTED_OPERATION, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not resizable."); + + SysTryReturn(NID_UI, + (newMinSize.width >= 0 && newMinSize.height >= 0), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The width or height is smaller than 0."); + + SysTryReturn(NID_UI, + (newMinSize.width <= MAX_LENGTH && newMinSize.height <= MAX_LENGTH), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The width or height is greater than %d.", MAX_LENGTH); + + if (__maxSize.width < newMinSize.width) + { + __maxSize.width = newMinSize.width; + } + if (__maxSize.height < newMinSize.height) + { + __maxSize.height = newMinSize.height; + } + __minSize = newMinSize; return AdjustSizeToRange(); } @@ -2951,10 +3197,41 @@ _Control::SetMaximumSize(const Dimension& newMaxSize) __minSize.height = newMaxSize.height; } + __maxSize = _CoordinateSystemUtils::ConvertToFloat(newMaxSize); + return AdjustSizeToRange(); +} + +result +_Control::SetMaximumSize(const FloatDimension& newMaxSize) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, + IsResizable(), E_UNSUPPORTED_OPERATION, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not resizable."); + + SysTryReturn(NID_UI, + (newMaxSize.width >= 0 && newMaxSize.height >= 0), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The width or height is smaller than 0."); + + SysTryReturn(NID_UI, + (newMaxSize.width <= MAX_LENGTH && newMaxSize.height <= MAX_LENGTH), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The width or height is greater than %d.", MAX_LENGTH); + + if (newMaxSize.width < __minSize.width) + { + __minSize.width = newMaxSize.width; + } + if (newMaxSize.height < __minSize.height) + { + __minSize.height = newMaxSize.height; + } + __maxSize = newMaxSize; return AdjustSizeToRange(); } + Point _Control::ConvertToControlPosition(const Point& screenPosition) const { @@ -2967,6 +3244,18 @@ _Control::ConvertToControlPosition(const Point& screenPosition) const return controlPosition; } +FloatPoint +_Control::ConvertToControlPosition(const FloatPoint& screenPosition) const +{ + FloatPoint controlPosition; + FloatRectangle absoluteBounds = GetAbsoluteBoundsF(); + + controlPosition.x = screenPosition.x - absoluteBounds.x; + controlPosition.y = screenPosition.y - absoluteBounds.y; + + return controlPosition; +} + Point _Control::ConvertToScreenPosition(const Point& controlPosition) const { @@ -2979,6 +3268,18 @@ _Control::ConvertToScreenPosition(const Point& controlPosition) const return screenPosition; } +FloatPoint +_Control::ConvertToScreenPosition(const FloatPoint& controlPosition) const +{ + FloatPoint screenPosition; + FloatRectangle absoluteBounds = GetAbsoluteBoundsF(); + + screenPosition.x = controlPosition.x + absoluteBounds.x; + screenPosition.y = controlPosition.y + absoluteBounds.y; + + return screenPosition; +} + Rectangle _Control::GetClientBounds(void) const { @@ -2987,34 +3288,53 @@ _Control::GetClientBounds(void) const return Rectangle(0, 0, __bounds.width, __bounds.height); } + return _CoordinateSystemUtils::ConvertToInteger(__clientBounds); +} + +FloatRectangle +_Control::GetClientBoundsF(void) const +{ + if (!__isSetClientBounds) + { + return FloatRectangle(0.0f, 0.0f, __bounds.width, __bounds.height); + } + return __clientBounds; } + Rectangle -_Control::GetClientBounds(const Dimension& size) const +_Control::GetClientBounds(const Tizen::Graphics::Dimension& size) const { if (!__isSetClientBounds) { return Rectangle(0, 0, size.width, size.height); } + return _CoordinateSystemUtils::ConvertToInteger(__clientBounds); +} + + +FloatRectangle +_Control::GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const +{ + if (!__isSetClientBounds) + { + return FloatRectangle(0.0f, 0.0f, size.width, size.height); + } + return __clientBounds; } Rectangle _Control::GetAbsoluteBounds(void) const { -#if !defined(MULTI_WINDOW) Point accumPoint; Rectangle absoluteBounds; Rectangle clientBounds; const _Control* pSelf = this; const _Control* pParent = GetParent(); - if (!pParent) - { - accumPoint += pSelf->GetPosition(); - } while (pParent) { @@ -3031,16 +3351,30 @@ _Control::GetAbsoluteBounds(void) const pParent = pParent->GetParent(); } + _Window* pWindow = GetRootWindow(); + + if (pWindow) + { + Point winPoint = pWindow->GetPosition(); + + accumPoint.x += winPoint.x; + accumPoint.y += winPoint.y; + } + absoluteBounds.x = accumPoint.x; absoluteBounds.y = accumPoint.y; absoluteBounds.width = __bounds.width; absoluteBounds.height = __bounds.height; return absoluteBounds; -#else - Point accumPoint; - Rectangle absoluteBounds; - Rectangle clientBounds; +} + +FloatRectangle +_Control::GetAbsoluteBoundsF(void) const +{ + FloatPoint accumPoint; + FloatRectangle absoluteBounds; + FloatRectangle clientBounds; const _Control* pSelf = this; const _Control* pParent = GetParent(); @@ -3049,13 +3383,13 @@ _Control::GetAbsoluteBounds(void) const { if ((pSelf->GetArea() == _CONTROL_AREA_CLIENT) && pParent) { - clientBounds = pParent->GetClientBounds(); - accumPoint += Point(clientBounds.x, clientBounds.y); + clientBounds = pParent->GetClientBoundsF(); + accumPoint += FloatPoint(clientBounds.x, clientBounds.y); accumPoint.x -= pParent->GetHorizontalScrollPosition(); accumPoint.y -= pParent->GetVerticalScrollPosition(); } - accumPoint += pSelf->GetPosition(); + accumPoint += pSelf->GetPositionF(); pSelf = pParent; pParent = pParent->GetParent(); } @@ -3064,7 +3398,7 @@ _Control::GetAbsoluteBounds(void) const if (pWindow) { - Point winPoint = pWindow->GetPosition(); + FloatPoint winPoint = pWindow->GetPositionF(); accumPoint.x += winPoint.x; accumPoint.y += winPoint.y; @@ -3076,7 +3410,6 @@ _Control::GetAbsoluteBounds(void) const absoluteBounds.height = __bounds.height; return absoluteBounds; -#endif } result @@ -3087,6 +3420,22 @@ _Control::SetClientBounds(const Rectangle& bounds) SysTryReturn(NID_UI, IsMovable() && IsResizable(), E_UNSUPPORTED_OPERATION, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not movable nor resizable."); + __clientBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); + __isSetClientBounds = true; + + SetUpdateLayoutState(true); + + return E_SUCCESS; +} + +result +_Control::SetClientBounds(const FloatRectangle& bounds) +{ + ClearLastResult(); + + SysTryReturn(NID_UI, + IsMovable() && IsResizable(), E_UNSUPPORTED_OPERATION, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Not movable nor resizable."); __clientBounds = bounds; __isSetClientBounds = true; @@ -3126,6 +3475,9 @@ _Control::SetBackgroundColor(const Color& color) ) ); } + + GetControlDelegate().OnBackgroundColorChanged(const_cast(color)); + ClearLastResult(); } _Control::~_Control(void) @@ -3201,12 +3553,13 @@ _Control::_Control(void) , __pParent(null) , __pChildren(null) , __pOwnees(null) - , __bounds(0, 0, 0, 0) - , __clientBounds(0, 0, 0, 0) - , __absoluteBounds(0, 0, 0, 0) - , __invalidatedBounds(0, 0, 0, 0) - , __minSize(Dimension(0, 0)) - , __maxSize(Dimension(MAX_LENGTH, MAX_LENGTH)) + , __bounds(0.0f, 0.0f, 0.0f, 0.0f) + , __contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __clientBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __invalidatedBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __minSize(FloatDimension(0.0f, 0.0f)) + , __maxSize(FloatDimension(MAX_LENGTH, MAX_LENGTH)) , __backgroundColor(Color::GetColor(COLOR_ID_BLACK)) , __movable(true) , __resizable(true) @@ -3246,7 +3599,7 @@ _Control::_Control(void) , __pCoreGestureDetectors(null) , __pDetectStartedGestureMap(null) , __pDelayedTouchInfoList(null) - ,__touchMoveAllowance(TOUCH_MOVE_ALLOWANCE_SENSITIVE) + , __touchMoveAllowance(3) , __isSentDelayedEvent(false) , __isSendingDelayedEvent(false) , __isChangingEventTarget(false) @@ -3254,15 +3607,20 @@ _Control::_Control(void) , __pControlDelegate(null) , __pUserData(null) , __destroying(false) - , __isEventReceivable(true) + , __isEventEnableState(true) , __isControlFontChanged(false) , __pFont(null) , __fontName(L"") + , __fontFileName(L"") + , __pPreviousFocus(null) + , __pNextFocus(null) + , __pFocusVisualElement(null) { ClearLastResult(); SetControlDelegate(*this); __pAccessibilityContainer = new (std::nothrow) _AccessibilityContainer(*this); + __pAccessibilityContainer->Activate(true); __pLayoutItemHandler = new (std::nothrow) LayoutItemHandler(this); if (!__pLayoutItemHandler) @@ -3335,7 +3693,7 @@ _Control::_Control(void) SetPropagatedTouchEventListener(this); SetPropagatedKeyEventListener(this); - _ResourceManager::GetInstance()->GetColor(L"DEFAULTCOLORTABLE::background", __backgroundColor); + GET_COLOR_CONFIG(BASIC::background, __backgroundColor); if (IsFailed(GetLastResult())) { @@ -3508,13 +3866,13 @@ _Control::SetResizable(bool resizable) if (!resizable) { - __minSize = __maxSize = GetSize(); + __minSize = __maxSize = GetSizeF(); } if (!__resizable && resizable) { - __minSize = Dimension(0, 0); - __maxSize = Dimension(MAX_LENGTH, MAX_LENGTH); + __minSize = FloatDimension(0.0f, 0.0f); + __maxSize = FloatDimension(MAX_LENGTH, MAX_LENGTH); } __resizable = resizable; @@ -3602,17 +3960,10 @@ _Control::GetTopmostChildAt(const Point& point) const _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager, null, E_SYSTEM, "[E_SYSTEM] _ControlManager does not exist."); -#if !defined(MULTI_WINDOW) - _ControlVisualElement* pRootControlElement = - dynamic_cast <_ControlVisualElement*>(pControlManager->GetRoot().GetVisualElement()); -#else _Window* pRootWindow = GetRootWindow(); SysTryReturn(NID_UI, pRootWindow, null, E_SYSTEM, "[E_SYSTEM] GetRootWindow() is null, this control is detached from the main trree"); - _ControlVisualElement* pRootControlElement = - dynamic_cast <_ControlVisualElement*>(pRootWindow->GetVisualElement()); -#endif - + _ControlVisualElement* pRootControlElement = dynamic_cast <_ControlVisualElement*>(pRootWindow->GetVisualElement()); SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] pRootControlElement is null."); _ControlVisualElement* pHitTestElm = pRootControlElement->GetControlChildAtPoint(ptf); @@ -3623,6 +3974,34 @@ _Control::GetTopmostChildAt(const Point& point) const return pTouchedControl; } +void +_Control::SetContentAreaBounds(const Rectangle& rect) +{ + ClearLastResult(); + + __contentAreaBounds = _CoordinateSystemUtils::ConvertToFloat(rect); +} + +void +_Control::SetContentAreaBounds(const FloatRectangle& rect) +{ + ClearLastResult(); + + __contentAreaBounds = rect; +} + +Rectangle +_Control::GetContentAreaBounds(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(__contentAreaBounds); +} + +FloatRectangle +_Control::GetContentAreaBoundsF(void) const +{ + return __contentAreaBounds; +} + Bitmap* _Control::GetCapturedBitmapN(bool includeChildren) const { @@ -3681,6 +4060,12 @@ CATCH: Tizen::Graphics::Rectangle _Control::GetInvalidatedBounds(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__invalidatedBounds); +} + +Tizen::Graphics::FloatRectangle +_Control::GetInvalidatedBoundsF(void) const +{ return __invalidatedBounds; } @@ -3698,6 +4083,8 @@ _Control::AddGestureDetector(const _TouchGestureDetector& gestureDetector) r = const_cast<_TouchGestureDetector&>(gestureDetector).SetControl(*this); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "Control handle is not valid."); + const_cast<_TouchGestureDetector&>(gestureDetector).OnTouchGestureDetectorAdded(); + return r; } @@ -3709,6 +4096,8 @@ _Control::RemoveGestureDetector(const _TouchGestureDetector& gestureDetector) result r = __pCoreGestureDetectors->Remove(&(const_cast<_TouchGestureDetector&>(gestureDetector))); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + const_cast<_TouchGestureDetector&>(gestureDetector).OnTouchGestureDetectorRemoved(); + return E_SUCCESS; } @@ -4012,7 +4401,7 @@ _Control::AddTouchInfo(const _TouchInfo& touchInfo) _TouchInfo* pTouchInfo = new (std::nothrow) _TouchInfo; SysTryReturnVoidResult(NID_UI, pTouchInfo, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - Point screenPoint = pTouchManager->GetScreenPoint(touchInfo.GetPointId()); + FloatPoint screenPoint = pTouchManager->GetScreenPoint(touchInfo.GetPointId()); pTouchInfo->SetTouchInfo(touchInfo.GetPointId(), touchInfo.GetTouchStatus(), screenPoint, false, 0); __pDelayedTouchInfoList->Add(pTouchInfo); } @@ -4031,16 +4420,20 @@ _Control::GetVisualElement(void) const } void -_Control::PrintDescription(bool printChildren) +_Control::PrintDescription(bool printChildren, int level) { - int count = PrintDescription(printChildren, 0); + int count = PrintDescription(printChildren, 0, level); SysLog(NID_UI, "%d controls were printed.", count); } int -_Control::PrintDescription(bool printChildren, int depth) +_Control::PrintDescription(bool printChildren, int depth, int level) { + const int PRINT_CONTROL_VE = 1; + const int PRINT_CONTROL_EVAS = 2; + const int PRINT_CONTROL_VE_EVAS = 3; + String indent(L""); String format(L""); @@ -4074,7 +4467,7 @@ _Control::PrintDescription(bool printChildren, int depth) Rectangle clientBounds = GetClientBounds(); Rectangle absoluteBounds = GetAbsoluteBounds(); - SysLog(NID_UI, "%ls bounds(%d %d %d %d) min(%d %d) max(%d %d) scrollPos(%d %d) cbounds(%d %d %d %d) abounds(%d %d %d %d)", + SysLog(NID_UI, "%ls bounds(%d %d %d %d) min(%d %d) max(%d %d) scrollPos(%.2f %.2f) cbounds(%d %d %d %d) abounds(%d %d %d %d)", indent.GetPointer(), bounds.x, bounds.y, bounds.width, bounds.height, min.width, min.height, max.width, max.height, GetVerticalScrollPosition(), GetHorizontalScrollPosition(), @@ -4119,8 +4512,10 @@ _Control::PrintDescription(bool printChildren, int depth) SysLog(NID_UI, "%ls Ownees(%ls)", indent.GetPointer(), ownees.GetPointer()); } - SysLog(NID_UI, "%ls VisualElement(0x%x) VisualElementContentProvider(0x%x) VisualElementEventListener(0x%x)", - indent.GetPointer(), GetVisualElement(), __pVisualElementContentProvider, __pVisualElementEventListener); + _VisualElementImpl* pVisualElementImpl = _VisualElementImpl::GetInstance(*__pVisualElement); + + SysLog(NID_UI, "%ls _VisualElement(0x%x) _VisualElementImpl(0x%x) VisualElementContentProvider(0x%x) VisualElementEventListener(0x%x)", + indent.GetPointer(), __pVisualElement, pVisualElementImpl, __pVisualElementContentProvider, __pVisualElementEventListener); // Layout SysLog(NID_UI, "%ls LayoutItemHandler(0x%x) PortraitLayout(0x%x) LandscapeLayout(0x%x) LayoutContainer(0x%x)", @@ -4146,12 +4541,47 @@ _Control::PrintDescription(bool printChildren, int depth) pEnumerator->GetCurrent(pGestureDetector); if (pGestureDetector) { - SysLog(NID_UI, "%ls %ls", indent.GetPointer(), pGestureDetector->GetDescription().GetPointer()); + SysLog(NID_UI, "%ls AddedGesture : %ls", indent.GetPointer(), pGestureDetector->GetDescription().GetPointer()); } } delete pEnumerator; + // Print Started Gesture List + IMapEnumeratorT <_TouchGestureDetector*, _TouchGestureDetectorState>* pStartedGestureEnumerator = GetStartedGestureDetectorEnumeratorN(); + SysTryReturn(NID_UI, pStartedGestureEnumerator, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + while (pStartedGestureEnumerator->MoveNext() == E_SUCCESS) + { + _TouchGestureDetector* pStartedGestureDetector = null; + pStartedGestureEnumerator->GetKey(pStartedGestureDetector); + if (pStartedGestureDetector) + { + SysLog(NID_UI, "%ls StartedGesture : %ls", indent.GetPointer(), pStartedGestureDetector->GetDescription().GetPointer()); + } + } + + delete pStartedGestureEnumerator; + + // Print VE and Evas + switch (level) + { + case PRINT_CONTROL_VE: + _VeDebug::DumpVeTree(pVisualElementImpl, 0); + break; + + case PRINT_CONTROL_EVAS: + _VeDebug::DumpEvasTree(pVisualElementImpl, 0); + break; + + case PRINT_CONTROL_VE_EVAS: + _VeDebug::DumpVeTree(pVisualElementImpl, 0); + _VeDebug::DumpEvasTree(pVisualElementImpl, 0); + break; + + default: + break; + } static int totalCount = 0; @@ -4172,7 +4602,7 @@ _Control::PrintDescription(bool printChildren, int depth) _Control* pChild = GetChild(i); if (pChild) { - pChild->PrintDescription(printChildren, depth); + pChild->PrintDescription(printChildren, depth, level); } } } @@ -4271,13 +4701,25 @@ _Control::SetDropEnabled(bool enabled) } void -_Control::SetTouchMoveAllowance(_TouchMoveAllowance touchMoveAllowanceType) +_Control::SetTouchPressThreshold(float distance) { - __touchMoveAllowance = touchMoveAllowanceType; + int dpi = 0; + Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.dpi", dpi); + + __touchMoveAllowance = static_cast(distance * dpi); } -_TouchMoveAllowance -_Control::GetTouchMoveAllowance(void) const +float +_Control::GetTouchPressThreshold(void) const +{ + int dpi = 0; + Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.dpi", dpi); + + return static_cast(__touchMoveAllowance /dpi); +} + +int +_Control::GetTouchPressThresholdPixel(void) const { return __touchMoveAllowance; } @@ -4295,15 +4737,112 @@ _Control::GetChangingEventTarget(void) const } void -_Control::SetEventReceivable(bool receivable) +_Control::SetEventEnableState(bool enableState) { - __isEventReceivable = receivable; + __isEventEnableState = enableState; } bool -_Control::IsEventReceivable(void) const +_Control::IsEventEnabled(void) const +{ + return __isEventEnableState; +} + +void +_Control::SetPreviousFocus(_Control* pPreviousFocus) +{ + __pPreviousFocus = pPreviousFocus; + +} +void +_Control::SetNextFocus(_Control* pNextFocus) +{ + __pNextFocus = pNextFocus; +} +_Control* +_Control::GetPreviousFocus(void) const +{ + return __pPreviousFocus; +} +_Control* +_Control::GetNextFocus(void) const +{ + return __pNextFocus; +} + +void +_Control::OnDrawFocus(void) +{ + unique_ptr pFocusVisualElement (new (std::nothrow) VisualElement, _VisualElementDeleter()); + SysTryReturn(NID_UI, pFocusVisualElement, , E_SYSTEM, "[E_SYSTEM] System error"); + + result r = pFocusVisualElement->Construct(); + SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error"); + + __pFocusVisualElement.reset(pFocusVisualElement.release()); + __pFocusVisualElement->SetImplicitAnimationEnabled(false); + __pFocusVisualElement->SetShowState(true); + + _VisualElement* pControVisualElement = this->GetVisualElement(); + pControVisualElement->AttachChild(*__pFocusVisualElement); + + if (__pFocusVisualElement) + { + Rectangle rectangle = this->GetBounds(); + __pFocusVisualElement->SetBounds(FloatRectangle(0, 0, rectangle.width, rectangle.height)); + unique_ptrpCanvas(__pFocusVisualElement->GetCanvasN()); + pCanvas->SetBackgroundColor(0x55555555); + pCanvas->Clear(); + Bitmap* pBitmap = null; + result r = GET_BITMAP_CONFIG_N(ACCESSIBILITY::POPUP_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + + if (r == E_SUCCESS) + { + if (pBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap); + } + else + { + r = pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap); + } + } + __pFocusVisualElement->SetShowState(true); + } +} + +void +_Control::OnChildControlFocusMoved(const _Control& control) { - return __isEventReceivable; } +result +_Control::SetFontFromFile(const String& fileName) +{ + result r = E_SUCCESS; + + if (__fontFileName.Equals(fileName)) + { + return E_SUCCESS; + } + + __isControlFontChanged = true; + __fontFileName = fileName; + __fontName.Clear(); + + Font* pFont = GetFallbackFont(); + + if (pFont == null) + { + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + return E_SUCCESS; +} + +Tizen::Base::String +_Control::GetFontFile(void) const +{ + return __fontFileName; +} }} // Tizen::Ui diff --git a/src/ui/FUi_ControlImpl.cpp b/src/ui/FUi_ControlImpl.cpp old mode 100755 new mode 100644 index 08eea3b..53e1e1c --- a/src/ui/FUi_ControlImpl.cpp +++ b/src/ui/FUi_ControlImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlImpl.cpp * @brief This is the implementation file for _ControlImpl class. @@ -30,11 +31,15 @@ #include #include #include +#include +#include +#include #include "FUi_ControlImpl.h" #include "FUi_ContainerImpl.h" #include "FUi_Control.h" #include "FUi_ControlManager.h" #include "FUi_ControlImplManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiEventManager.h" #include "FUi_UiNotificationEvent.h" #include "FUi_UiTouchEvent.h" @@ -45,9 +50,7 @@ #include "FUi_TouchGestureDetectorImpl.h" #include "FUi_AccessibilityContainerImpl.h" #include "FUi_ResourceManager.h" -#if defined(MULTI_WINDOW) #include "FUi_WindowImpl.h" -#endif #include "FUiAnim_VisualElement.h" #include "FUiAnim_VisualElementImpl.h" @@ -73,24 +76,48 @@ _ControlImpl::SizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) c return Dimension(0, 0); } +FloatDimension +_ControlImpl::SizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + return FloatDimension(0.0f, 0.0f); +} + Dimension _ControlImpl::SizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const { return Dimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); } +FloatDimension +_ControlImpl::SizeInfo::GetDefaultMaximumSizeF(_ControlOrientation orientation) const +{ + return FloatDimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); +} + Dimension _ControlImpl::SizeInfo::GetMinimumSizeLimit(_ControlOrientation orientation) const { return Dimension(0, 0); } +FloatDimension +_ControlImpl::SizeInfo::GetMinimumSizeLimitF(_ControlOrientation orientation) const +{ + return FloatDimension(0.0f, 0.0f); +} + Dimension _ControlImpl::SizeInfo::GetMaximumSizeLimit(_ControlOrientation orientation) const { return Dimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); } +FloatDimension +_ControlImpl::SizeInfo::GetMaximumSizeLimitF(_ControlOrientation orientation) const +{ + return FloatDimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); +} + result _ControlImpl::SizeInfo::CheckInitialSizeValid(const Dimension& size, _ControlOrientation orientation) const { @@ -112,6 +139,27 @@ _ControlImpl::SizeInfo::CheckInitialSizeValid(const Dimension& size, _ControlOri return E_SUCCESS; } +result +_ControlImpl::SizeInfo::CheckInitialSizeValidF(const FloatDimension& size, _ControlOrientation orientation) const +{ + ClearLastResult(); + + const FloatDimension minSize = GetDefaultMinimumSizeF(orientation); + const FloatDimension maxSize = GetDefaultMaximumSizeF(orientation); + + SysTryReturn(NID_UI, + (minSize.width <= size.width) && (size.width <= maxSize.width), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The width %f is out of width range(%f ~ %f).", + size.width, minSize.width, maxSize.width); + + SysTryReturn(NID_UI, + (minSize.height <= size.height) && (size.height <= maxSize.height), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The height %f is out of height range(%f ~ %f).", + size.height, minSize.height, maxSize.height); + + return E_SUCCESS; +} + const _ControlImpl::SizeInfo& _ControlImpl::GetFullScreenSizeInfo(void) { @@ -123,21 +171,41 @@ _ControlImpl::GetFullScreenSizeInfo(void) return GetScreenSize(); } + virtual FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const + { + return GetScreenSizeF(); + } + virtual Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const { return GetScreenSize(); } + virtual FloatDimension GetDefaultMaximumSizeF(_ControlOrientation orientation) const + { + return GetScreenSizeF(); + } + virtual Dimension GetMinimumSizeLimit(_ControlOrientation orientation) const { return GetScreenSize(); } + virtual FloatDimension GetMinimumSizeLimitF(_ControlOrientation orientation) const + { + return GetScreenSizeF(); + } + virtual Dimension GetMaximumSizeLimit(_ControlOrientation orientation) const { return GetScreenSize(); } + virtual FloatDimension GetMaximumSizeLimitF(_ControlOrientation orientation) const + { + return GetScreenSizeF(); + } + private: Dimension GetScreenSize(void) const { @@ -145,6 +213,13 @@ _ControlImpl::GetFullScreenSizeInfo(void) SysTryReturn(NID_UI, pMgr, Dimension(0, 0), E_SYSTEM, "[E_SYSTEM] Failed to get control manager."); return pMgr->GetScreenSize(); } + + FloatDimension GetScreenSizeF(void) const + { + _ControlManager* pMgr = _ControlManager::GetInstance(); + SysTryReturn(NID_UI, pMgr, FloatDimension(0.0f, 0.0f), E_SYSTEM, "[E_SYSTEM] Failed to get control manager."); + return pMgr->GetScreenSizeF(); + } }; static FullScreenSizeInfo sizeInfo; @@ -198,11 +273,39 @@ _ControlImpl::InitializeBoundsProperties(const SizeInfo& sizeInfo, const Tizen:: } result +_ControlImpl::InitializeBoundsPropertiesF(const SizeInfo& sizeInfo, const Tizen::Graphics::FloatRectangle& bounds, _ControlOrientation orientation) +{ + result r = InitializeBoundsProperties(sizeInfo, orientation); + if (IsFailed(r)) + { + return r; + } + + bool movable = IsMovable(); + bool resizable = IsResizable(); + SetMovable(true); + SetResizable(true); + + r = SetBounds(bounds); + + SetMovable(movable); + SetResizable(resizable); + + return r; +} + +result _ControlImpl::InitializeBoundsProperties(const SizeInfo& sizeInfo, const Tizen::Graphics::Dimension& size, _ControlOrientation orientation) { return InitializeBoundsProperties(sizeInfo, Rectangle(0, 0, size.width, size.height), orientation); } +result +_ControlImpl::InitializeBoundsPropertiesF(const SizeInfo& sizeInfo, const Tizen::Graphics::FloatDimension& size, _ControlOrientation orientation) +{ + return InitializeBoundsPropertiesF(sizeInfo, FloatRectangle(0.0f, 0.0f, size.width, size.height), orientation); +} + _ControlImpl* _ControlImpl::CreateControlImplN(Control& control) { @@ -220,6 +323,24 @@ _ControlImpl::CreateControlImplN(Control& control) return pImpl; } +result +_ControlImpl::Destroy(void) +{ + result r = E_SUCCESS; + _ContainerImpl* pParent = GetParent(); + if (pParent) + { + r = pParent->RemoveChild(this, true); + SysAssert(r == E_SUCCESS); + } + else + { + Dispose(true); + } + + return r; +} + _ControlImpl* _ControlImpl::GetInstance(Control& control) { @@ -556,7 +677,12 @@ public: IDragDropEventListener* pDragDropEventListener = dynamic_cast (pDragListener); if (pDragDropEventListener != null) { - pDragDropEventListener->OnTouchDragged(__public, touchInfo.GetCurrentPosition(), touchInfo.GetCurrentPosition()); + pDragDropEventListener->OnTouchDragged(__public, _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition()), _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition())); + } + IDragDropEventListenerF* pDragDropEventListenerF = dynamic_cast (pDragListener); + if (pDragDropEventListener != null) + { + pDragDropEventListenerF->OnTouchDraggedF(__public, touchInfo.GetCurrentPosition(), touchInfo.GetCurrentPosition()); } } } @@ -591,7 +717,7 @@ public: IDragDropEventListener* pDropEventListener = dynamic_cast (pDropListener); if (pDropEventListener != null) { - pDropEventListener->OnTouchDropped(__public, __pTouchManager->GetStartPoint(touchInfo.GetPointId()), touchInfo.GetCurrentPosition()); + pDropEventListener->OnTouchDropped(__public, _CoordinateSystemUtils::ConvertToInteger(__pTouchManager->GetStartPoint(touchInfo.GetPointId())), _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition())); } } } @@ -656,7 +782,7 @@ public: if (pDropEventListener != null) { pDropEventListener->OnTouchDropped(pTopmostTouchedTarget->GetPublic(), - publicTouchInfo.GetStartPosition(), touchInfo.GetCurrentPosition()); + publicTouchInfo.GetStartPosition(), _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition())); } } } @@ -678,7 +804,7 @@ public: ITouchEventListener* pPublicListener = dynamic_cast (pListener); SysAssert(pPublicListener); - pPublicListener->OnTouchReleased(pTopmostTouchedTarget->GetPublic(), touchInfo.GetCurrentPosition(), publicTouchInfo); + pPublicListener->OnTouchReleased(pTopmostTouchedTarget->GetPublic(), _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition()), publicTouchInfo); } } delete pEnumerator; @@ -693,7 +819,7 @@ public: ITouchEventListener* pDefaultListener = pTopmostTouchedTarget->GetDefaultTouchEventListener(); if (pDefaultListener) { - pDefaultListener->OnTouchReleased(pTopmostTouchedTarget->GetPublic(), touchInfo.GetCurrentPosition(), publicTouchInfo); + pDefaultListener->OnTouchReleased(pTopmostTouchedTarget->GetPublic(), _CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition()), publicTouchInfo); if (pTopmostTouchedTarget->IsInputEventConsumed()) { @@ -1214,24 +1340,274 @@ public: virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchPressed(control, publicTouchInfo); + if (isFiltered) + { + return true; + } + } + return __impl.CallOnTouchPressed(source, touchInfo); } virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchReleased(control, publicTouchInfo); + if (isFiltered) + { + return true; + } + } + return __impl.CallOnTouchReleased(source, touchInfo); } virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchMoved(control, publicTouchInfo); + if (isFiltered) + { + return true; + } + } + return __impl.CallOnTouchMoved(source, touchInfo); } virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchCanceled(control, publicTouchInfo); + if (isFiltered) + { + return true; + } + } + return __impl.CallOnTouchCanceled(source, touchInfo); } + virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchInfo) + { + _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, _UI_TOUCH_EVENT_DELIVERY_YES, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchPressed(control, publicTouchInfo) == true) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + } + + // 3. Impl + isFiltered = __impl.OnPreviewTouchPressed(__impl, touchInfo); + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + + // 4. Core + isFiltered = __core.OnPreviewTouchPressed(source, touchInfo); + + return _UI_TOUCH_EVENT_DELIVERY_NO; + } + + virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) + { + _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, _UI_TOUCH_EVENT_DELIVERY_YES, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchReleased(control, publicTouchInfo) == true) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + } + + // 3. Impl + isFiltered = __impl.OnPreviewTouchReleased(__impl, touchInfo); + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + + // 4. Core + isFiltered = __core.OnPreviewTouchReleased(source, touchInfo); + + return _UI_TOUCH_EVENT_DELIVERY_NO; + } + + virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchInfo) + { + _UiTouchEventDelivery isFiltered = _UI_TOUCH_EVENT_DELIVERY_NO; + + if (__impl.__pPublicPropagatedTouchEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, _UI_TOUCH_EVENT_DELIVERY_YES, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturn(NID_UI, pEventArg, _UI_TOUCH_EVENT_DELIVERY_YES, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + publicTouchInfo.Construct(*pEventArg); + + if (pEventArg) + { + delete pEventArg; + pEventArg = null; + } + + if (__impl.__pPublicPropagatedTouchEventListener->OnPreviewTouchMoved(control, publicTouchInfo) == true) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + } + + // 3. Impl + isFiltered = __impl.OnPreviewTouchMoved(__impl, touchInfo); + if (isFiltered == _UI_TOUCH_EVENT_DELIVERY_YES) + { + return _UI_TOUCH_EVENT_DELIVERY_YES; + } + + // 4. Core + isFiltered = __core.OnPreviewTouchMoved(source, touchInfo); + + return _UI_TOUCH_EVENT_DELIVERY_NO; + } + + virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) + { + return _UI_TOUCH_EVENT_DELIVERY_NO; + } + virtual void OnTouchPressHandled(const _Control& source) { __impl.OnTouchPressHandled(source); @@ -1300,6 +1676,29 @@ public: bool isFiltered = false; + //SysLog(NID_UI, ">>> [impl.1] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + + if (__impl.__pPublicPropagatedKeyEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); + + //SysLog(NID_UI, ">>> [impl.2] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + + isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyPressed(control, *pKeyEventInfo); + if (isFiltered) + { + return true; + } + } + + //SysLog(NID_UI, ">>> [impl.3] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + if (&source == &__core) { if (!__isKeyPressed) @@ -1344,12 +1743,35 @@ public: bool isFiltered = false; - if (&source == &__core) + //SysLog(NID_UI, ">>> [impl.1] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + + if (__impl.__pPublicPropagatedKeyEventListener != null) { - __isKeyPressed = false; - __pKeyInfo = null; + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); - if (__pTimer != null) + Control& control = static_cast(pControlImpl->GetPublic()); + + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); + + //SysLog(NID_UI, ">>> [impl.2] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + + isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyReleased(control, *pKeyEventInfo); + if (isFiltered) + { + return true; + } + } + + //SysLog(NID_UI, ">>> [impl.3] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier()); + + if (&source == &__core) + { + __isKeyPressed = false; + __pKeyInfo = null; + + if (__pTimer != null) { __pTimer->Cancel(); @@ -1377,6 +1799,73 @@ public: return isFiltered; } + virtual bool OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo) + { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedKeyEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); + + isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyPressed(control, *pKeyEventInfo); + if (isFiltered) + { + return true; + } + } + + // 3. Impl + isFiltered = __impl.OnPreviewKeyPressed(__impl, keyInfo); + if (isFiltered) + { + return true; + } + + // 4. Core + isFiltered = __core.OnPreviewKeyPressed(source, keyInfo); + + return isFiltered; + } + + virtual bool OnPreviewKeyReleased(const _Control& source, const _KeyInfo& keyInfo) + { + bool isFiltered = false; + + if (__impl.__pPublicPropagatedKeyEventListener != null) + { + _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData()); + SysTryReturn(NID_UI, pControlImpl, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] pControlImpl == null."); + + Control& control = static_cast(pControlImpl->GetPublic()); + + KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast(keyInfo.GetKeyCode()), + static_cast(keyInfo.GetKeyModifier())); + + isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyReleased(control, *pKeyEventInfo); + if (isFiltered) + { + return true; + } + } + + // 3. Impl + isFiltered = __impl.OnPreviewKeyReleased(__impl, keyInfo); + if (isFiltered) + { + return true; + } + + // 4. Core + isFiltered = __core.OnPreviewKeyReleased(source, keyInfo); + + return isFiltered; + } private: _ControlImpl& __impl; _Control& __core; @@ -1393,6 +1882,12 @@ _ControlImpl::GetErrorBounds(void) return Rectangle(0, 0, -1, -1); } +FloatRectangle +_ControlImpl::GetErrorBoundsF(void) +{ + return FloatRectangle(0.0f, 0.0f, -1.0f, -1.0f); +} + CompositeMode _ControlImpl::GetErrorCompositeMode(void) { @@ -1411,12 +1906,24 @@ _ControlImpl::GetErrorMinimumSize(void) return Dimension(-1, -1); } +FloatDimension +_ControlImpl::GetErrorMinimumSizeF(void) +{ + return FloatDimension(-1.0f, -1.0f); +} + Dimension _ControlImpl::GetErrorMaximumSize(void) { return Dimension(-1, -1); } +FloatDimension +_ControlImpl::GetErrorMaximumSizeF(void) +{ + return FloatDimension(-1.0f, -1.0f); +} + const char* _ControlImpl::GetPublicClassName(void) const { @@ -1479,23 +1986,7 @@ _ControlImpl::AddTouchEventListener(ITouchEventListener& listener) __pPublicTouchEventListeners->Add(const_cast (&listener)) == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); - // Firt time, enable gesture. - if (__pPublicTouchEventListeners->GetCount() == 1) - { - result r = E_SUCCESS; - - r = __pControlCore->AddGestureDetector(*__pLongPressGestureDetector); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = __pLongPressGestureDetector->AddGestureListener(*__pCoreEventListener); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = __pControlCore->AddGestureDetector(*__pFlickGestureDetector); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = __pFlickGestureDetector->AddGestureListener(*__pCoreEventListener); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - } + OnTouchEventListenerAdded(); return E_SUCCESS; } @@ -1517,6 +2008,17 @@ _ControlImpl::AddDragDropEventListener(IDragDropEventListener& listener) return E_SUCCESS; } +result +_ControlImpl::AddDragDropEventListener(IDragDropEventListenerF& listener) +{ + ClearLastResult(); + SysTryReturn(NID_UI, + __pPublicDragDropEventListeners->Add(const_cast (&listener)) == E_SUCCESS, E_SYSTEM, + E_SYSTEM, "[E_SYSTEM] System error occurred."); + + return E_SUCCESS; +} + Tizen::Base::Collection::LinkedListT * _ControlImpl::GetDragDropEventListener(void) const { @@ -1567,6 +2069,8 @@ _ControlImpl::RemoveTouchEventListener(ITouchEventListener& listener) // [ToDo] if the number of touch event listers becomes 0, disable gesture recognition. + OnTouchEventListenerRemoved(); + return E_SUCCESS; } @@ -1582,6 +2086,17 @@ _ControlImpl::RemoveDragDropEventListener(IDragDropEventListener& listener) } result +_ControlImpl::RemoveDragDropEventListenerF(IDragDropEventListenerF& listener) +{ + ClearLastResult(); + SysTryReturn(NID_UI, + __pPublicDragDropEventListeners->Remove(&listener) == E_SUCCESS, E_SYSTEM, + E_SYSTEM, "[E_SYSTEM] System error occurred."); + + return E_SUCCESS; +} + +result _ControlImpl::RemoveTouchModeChangedEventListener(ITouchModeChangedEventListener& listener) { ClearLastResult(); @@ -1650,6 +2165,12 @@ _ControlImpl::GetContentSize(void) const return GetCore().GetContentSize(); } +FloatDimension +_ControlImpl::GetContentSizeF(void) const +{ + return GetCore().GetContentSizeF(); +} + HitTestResult _ControlImpl::HitTest(const Tizen::Graphics::FloatPoint& point) { @@ -1862,6 +2383,12 @@ _ControlImpl::OnCanvasRequestedN(const Tizen::Graphics::Dimension& size) return GetCore().OnCanvasRequestedN(size); } +Tizen::Graphics::Canvas* +_ControlImpl::OnCanvasRequestedFN(const Tizen::Graphics::FloatDimension& size) +{ + return GetCore().OnCanvasRequestedFN(size); +} + Tizen::Graphics::Bitmap* _ControlImpl::OnCapturedBitmapRequestedN(void) { @@ -1940,7 +2467,15 @@ _ControlImpl::OnDetaching(void) result _ControlImpl::OnBoundsChanging(const Rectangle& bounds) { - __oldBounds = GetBounds(); + __oldBounds = _CoordinateSystemUtils::ConvertToFloat(GetBounds()); + + return GetCore().OnBoundsChanging(bounds); +} + +result +_ControlImpl::OnBoundsChanging(const FloatRectangle& bounds) +{ + __oldBounds = GetBoundsF(); return GetCore().OnBoundsChanging(bounds); } @@ -1958,6 +2493,12 @@ _ControlImpl::OnEvaluateSize(Dimension& evaluatedSize) } void +_ControlImpl::OnEvaluateSize(FloatDimension& evaluatedSize) +{ + GetCore().OnEvaluateSize(evaluatedSize); +} + +void _ControlImpl::OnParentBoundsChanged(const _Control& parent) { GetCore().OnParentBoundsChanged(parent); @@ -2121,6 +2662,19 @@ _ControlImpl::OnFontInfoRequested(unsigned long& style, int& size) { GetCore().OnFontInfoRequested(style, size); } + +void +_ControlImpl::OnFontInfoRequested(unsigned long& style, float& size) +{ + GetCore().OnFontInfoRequested(style, size); +} + +void +_ControlImpl::OnBackgroundColorChanged(Color& backgroundColor) +{ + GetCore().OnBackgroundColorChanged(backgroundColor); +} + void _ControlImpl::OnTouchCancelHandled(const _Control& control) { @@ -2139,6 +2693,16 @@ _ControlImpl::OnKeyReleased(const _ControlImpl& source, const _KeyInfo& keyInfo) return false; } +bool _ControlImpl::OnPreviewKeyPressed(const _ControlImpl& source, const _KeyInfo& keyInfo) +{ + return false; +} + +bool _ControlImpl::OnPreviewKeyReleased(const _ControlImpl& source, const _KeyInfo& keyInfo) +{ + return false; +} + bool _ControlImpl::CallOnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { @@ -2154,10 +2718,10 @@ _ControlImpl::CallOnTouchPressed(const _Control& source, const _TouchInfo& touch return false; } - GetCore().SetEventReceivable(true); + GetCore().SetEventEnableState(true); LinkedListT * pList = GetTouchEventListener(); - if (pList && pList->GetCount() > 0) + if (pList && (pList->GetCount() > 0) && (&source == &GetCore())) { bool returnValue = __pCoreTouchEvent->ProcessDoublePress(touchinfo, isFiltered); if (returnValue) @@ -2180,7 +2744,7 @@ _ControlImpl::CallOnTouchPressed(const _Control& source, const _TouchInfo& touch _TouchManager* __pTouchManager = _TouchManager::GetInstance(); SysTryReturn(NID_UI, __pTouchManager, false, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] __pTouchManager == null."); - if (!GetCore().IsEventReceivable()) + if (!GetCore().IsEventEnabled()) { __pTouchManager->ResetTouchInfo(); isFiltered = true; @@ -2331,6 +2895,36 @@ _ControlImpl::CallOnTouchCanceled(const _Control& source, const _TouchInfo& touc return isFiltered; } +result +_ControlImpl::OnTouchEventListenerAdded(void) +{ + // First time, enable gesture. + if (__pPublicTouchEventListeners->GetCount() == 1) + { + result r = E_SUCCESS; + + r = __pControlCore->AddGestureDetector(*__pLongPressGestureDetector); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pLongPressGestureDetector->AddGestureListener(*__pCoreEventListener); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pControlCore->AddGestureDetector(*__pFlickGestureDetector); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pFlickGestureDetector->AddGestureListener(*__pCoreEventListener); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + return E_SUCCESS; +} + +result +_ControlImpl::OnTouchEventListenerRemoved(void) +{ + return E_SUCCESS; +} + + bool _ControlImpl::OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo) { @@ -2355,6 +2949,30 @@ _ControlImpl::OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchin return false; } +_UiTouchEventDelivery +_ControlImpl::OnPreviewTouchPressed(const _ControlImpl& source, const _TouchInfo& touchInfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_NO; +} + +_UiTouchEventDelivery +_ControlImpl::OnPreviewTouchReleased(const _ControlImpl& source, const _TouchInfo& touchInfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_NO; +} + +_UiTouchEventDelivery +_ControlImpl::OnPreviewTouchMoved(const _ControlImpl& source, const _TouchInfo& touchInfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_NO; +} + +_UiTouchEventDelivery +_ControlImpl::OnPreviewTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchInfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_NO; +} + bool _ControlImpl::OnFocusGained(const _ControlImpl& source) { @@ -2463,6 +3081,16 @@ _ControlImpl::Invalidate(const Rectangle& rect) } void +_ControlImpl::Invalidate(const FloatRectangle& rect) +{ + SysTryReturnVoidResult(NID_UI, + IsAttachedToMainTree(), + E_INVALID_OPERATION, "[E_INVALID_OPERATION] The control should be attached to the main tree."); + + GetCore().Invalidate(rect); +} + +void _ControlImpl::RequestRedraw(bool show) const { ClearLastResult(); @@ -2530,6 +3158,12 @@ _ControlImpl::Contains(const Point& point) const return GetCore().Contains(point); } +bool +_ControlImpl::Contains(const FloatPoint& point) const +{ + return GetCore().Contains(point); +} + void _ControlImpl::ConsumeInputEvent(void) { @@ -2643,6 +3277,35 @@ _ControlImpl::GetCanvasN(const Rectangle& bounds) const } Canvas* +_ControlImpl::GetCanvasN(const FloatRectangle& bounds) const +{ + SysTryReturn(NID_UI, + GetParent() || IsAttachedToMainTree(), null, + E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control should have a parent or be attached to the main tree."); + + Canvas* pCanvas = GetCore().GetCanvasN(bounds); + result r = GetLastResult(); + if (IsFailed(r)) + { + if (r == E_OPERATION_FAILED) + { + SetLastResult(E_INVALID_OPERATION); + } + SysLog(NID_UI_CTRL, "[%s] Propagated", GetErrorMessage(GetLastResult())); + } + else + { + if (pCanvas) + { + pCanvas->SetBackgroundColor(GetBackgroundColor()); + pCanvas->SetForegroundColor(GetForegroundColor()); + } + } + + return pCanvas; +} + +Canvas* _ControlImpl::GetClientCanvasN(void) const { SysTryReturn(NID_UI, @@ -2743,6 +3406,7 @@ _ControlImpl::GetFont(void) const return GetCore().GetFont(); } + bool _ControlImpl::IsEnabled(void) const { @@ -2762,9 +3426,9 @@ _ControlImpl::SetEnableState(bool enableState) } bool -_ControlImpl::IsInputEnabled(void) const +_ControlImpl::IsInputEventEnabled(void) const { - return GetCore().IsInputEnabled(); + return GetCore().IsInputEventEnabled(); } bool @@ -2774,9 +3438,9 @@ _ControlImpl::GetInputEnableState(void) const } void -_ControlImpl::SetInputEnableState(bool inputEnableState) +_ControlImpl::SetInputEventEnableState(bool enableState) { - GetCore().SetInputEnableState(inputEnableState); + GetCore().SetInputEventEnableState(enableState); } bool @@ -2858,20 +3522,38 @@ _ControlImpl::GetBounds(void) const return GetCore().GetBounds(); } +FloatRectangle +_ControlImpl::GetBoundsF(void) const +{ + return GetCore().GetBoundsF(); +} + Point _ControlImpl::GetPosition(void) const { return GetCore().GetPosition(); } +FloatPoint +_ControlImpl::GetPositionF(void) const +{ + return GetCore().GetPositionF(); +} + Dimension _ControlImpl::GetSize(void) const { return GetCore().GetSize(); } +FloatDimension +_ControlImpl::GetSizeF(void) const +{ + return GetCore().GetSizeF(); +} + result -_ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks) +_ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) { Rectangle builderBounds; _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT; @@ -2883,6 +3565,11 @@ _ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks) _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance(); OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this); + if (orientation == ORIENTATION_STATUS_NONE) + { + return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); + } + if (orientation == ORIENTATION_STATUS_LANDSCAPE || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE) { @@ -2899,7 +3586,39 @@ _ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks) SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds); } } - return GetCore().SetBounds(bounds, callBoundsChangeCallbacks); + return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); +} + +result +_ControlImpl::SetBounds(const FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement) +{ + FloatRectangle builderBounds; + _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT; + bool exist = GetBuilderBoundsF(controlOrientation, builderBounds); + if (exist) + { + if (IsAttachedToMainTree()) + { + _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance(); + OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this); + + if (orientation == ORIENTATION_STATUS_LANDSCAPE + || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE) + { + SetBuilderBoundsF(_CONTROL_ORIENTATION_LANDSCAPE, bounds); + } + else + { + SetBuilderBoundsF(_CONTROL_ORIENTATION_PORTRAIT, bounds); + } + } + else + { + SetBuilderBoundsF(_CONTROL_ORIENTATION_PORTRAIT, bounds); + SetBuilderBoundsF(_CONTROL_ORIENTATION_LANDSCAPE, bounds); + } + } + return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement); } result @@ -2914,37 +3633,84 @@ _ControlImpl::SetBoundsAndUpdateLayout(const Tizen::Graphics::Rectangle& bounds) } result +_ControlImpl::SetBoundsAndUpdateLayoutF(const Tizen::Graphics::FloatRectangle& bounds) +{ + result r = E_SUCCESS; + r = GetCore().SetBounds(bounds); + + GetCore().UpdateLayout(); + + return r; +} + +result _ControlImpl::SetPosition(const Point& position) { return GetCore().SetPosition(position); } result +_ControlImpl::SetPosition(const FloatPoint& position) +{ + return GetCore().SetPosition(position); +} + +result _ControlImpl::SetSize(const Dimension& size) { return GetCore().SetSize(size); } +result +_ControlImpl::SetSize(const FloatDimension& size) +{ + return GetCore().SetSize(size); +} + Dimension _ControlImpl::GetMinimumSize(void) const { return GetCore().GetMinimumSize(); } +FloatDimension +_ControlImpl::GetMinimumSizeF(void) const +{ + return GetCore().GetMinimumSizeF(); +} + Dimension _ControlImpl::GetMaximumSize(void) const { return GetCore().GetMaximumSize(); } +FloatDimension +_ControlImpl::GetMaximumSizeF(void) const +{ + return GetCore().GetMaximumSizeF(); +} + +result +_ControlImpl::SetMinimumSize(const Tizen::Graphics::Dimension& newMinSize) +{ + return GetCore().SetMinimumSize(newMinSize); +} + result -_ControlImpl::SetMinimumSize(const Dimension& newMinSize) +_ControlImpl::SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinSize) { return GetCore().SetMinimumSize(newMinSize); } result -_ControlImpl::SetMaximumSize(const Dimension& newMaxSize) +_ControlImpl::SetMaximumSize(const Tizen::Graphics::Dimension& newMaxSize) +{ + return GetCore().SetMaximumSize(newMaxSize); +} + +result +_ControlImpl::SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxSize) { return GetCore().SetMaximumSize(newMaxSize); } @@ -2955,12 +3721,24 @@ _ControlImpl::ConvertToControlPosition(const Point& screenPosition) const return GetCore().ConvertToControlPosition(screenPosition); } +FloatPoint +_ControlImpl::ConvertToControlPosition(const FloatPoint& screenPosition) const +{ + return GetCore().ConvertToControlPosition(screenPosition); +} + Point _ControlImpl::ConvertToScreenPosition(const Point& controlPosition) const { return GetCore().ConvertToScreenPosition(controlPosition); } +FloatPoint +_ControlImpl::ConvertToScreenPosition(const FloatPoint& controlPosition) const +{ + return GetCore().ConvertToScreenPosition(controlPosition); +} + // [ToDo] Must provide a static method. Dimension _ControlImpl::GetMinimumSizeLimit(void) const @@ -2969,6 +3747,13 @@ _ControlImpl::GetMinimumSizeLimit(void) const return Dimension(0, 0); } +FloatDimension +_ControlImpl::GetMinimumSizeLimitF(void) const +{ + ClearLastResult(); + return FloatDimension(0.0f, 0.0f); +} + // [ToDo] Must provide a static method. Dimension _ControlImpl::GetMaximumSizeLimit(void) const @@ -2977,24 +3762,50 @@ _ControlImpl::GetMaximumSizeLimit(void) const return Dimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); } +FloatDimension +_ControlImpl::GetMaximumSizeLimitF(void) const +{ + ClearLastResult(); + return FloatDimension(_Control::MAX_LENGTH, _Control::MAX_LENGTH); +} + + Rectangle _ControlImpl::GetClientBounds(void) const { return GetCore().GetClientBounds(); } +FloatRectangle +_ControlImpl::GetClientBoundsF(void) const +{ + return GetCore().GetClientBoundsF(); +} + Rectangle _ControlImpl::GetAbsoluteBounds(void) const { return GetCore().GetAbsoluteBounds(); } +FloatRectangle +_ControlImpl::GetAbsoluteBoundsF(void) const +{ + return GetCore().GetAbsoluteBoundsF(); +} + result _ControlImpl::SetClientBounds(const Rectangle& bounds) { return GetCore().SetClientBounds(bounds); } +result +_ControlImpl::SetClientBounds(const FloatRectangle& bounds) +{ + return GetCore().SetClientBounds(bounds); +} + Color _ControlImpl::GetBackgroundColor(void) const { @@ -3302,6 +4113,12 @@ _ControlImpl::Dispose(bool deallocateCore) delete __pAccessibilityContainerImpl; __pAccessibilityContainerImpl = null; + + delete __pPublicPropagatedTouchEventListener; + __pPublicPropagatedTouchEventListener = null; + + delete __pPublicPropagatedKeyEventListener; + __pPublicPropagatedKeyEventListener = null; } _ControlImpl::~_ControlImpl(void) @@ -3336,6 +4153,8 @@ _ControlImpl::_ControlImpl(Control* pPublic, _Control* pCore) , __pLongPressGestureDetector(null) , __pPublicGestureDetectors(null) , __pAccessibilityContainerImpl(null) + , __pPublicPropagatedTouchEventListener(null) + , __pPublicPropagatedKeyEventListener(null) { ClearLastResult(); result r = E_SUCCESS; @@ -3391,7 +4210,7 @@ _ControlImpl::_ControlImpl(Control* pPublic, _Control* pCore) r = GetLastResult(); SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = _ResourceManager::GetInstance()->GetColor(L"DEFAULTCOLORTABLE::foreground", __foregroundColor); + r = GET_COLOR_CONFIG(BASIC::foreground, __foregroundColor); SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); // Check @@ -3418,7 +4237,45 @@ _ControlImpl::SetBuilderBounds(_ControlOrientation orientation, const Rectangle& { if (__pBuilderPortraitBounds == null) { - __pBuilderPortraitBounds = new (std::nothrow) Rectangle(0, 0, 0, 0); + __pBuilderPortraitBounds = new (std::nothrow) FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + + SysTryReturn(NID_UI, + __pBuilderPortraitBounds, E_OUT_OF_MEMORY, + E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + } + + *__pBuilderPortraitBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); + return E_SUCCESS; + } + else if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + { + if (__pBuilderLandscapeBounds == null) + { + __pBuilderLandscapeBounds = new (std::nothrow) FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + + SysTryReturn(NID_UI, + __pBuilderLandscapeBounds, E_OUT_OF_MEMORY, + E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + } + + *__pBuilderLandscapeBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); + return E_SUCCESS; + } + + SysAssert(false); + return E_SYSTEM; +} + +result +_ControlImpl::SetBuilderBoundsF(_ControlOrientation orientation, const FloatRectangle& bounds) +{ + ClearLastResult(); + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + if (__pBuilderPortraitBounds == null) + { + __pBuilderPortraitBounds = new (std::nothrow) FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); SysTryReturn(NID_UI, __pBuilderPortraitBounds, E_OUT_OF_MEMORY, @@ -3432,7 +4289,7 @@ _ControlImpl::SetBuilderBounds(_ControlOrientation orientation, const Rectangle& { if (__pBuilderLandscapeBounds == null) { - __pBuilderLandscapeBounds = new (std::nothrow) Rectangle(0, 0, 0, 0); + __pBuilderLandscapeBounds = new (std::nothrow) FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); SysTryReturn(NID_UI, __pBuilderLandscapeBounds, E_OUT_OF_MEMORY, @@ -3454,6 +4311,25 @@ _ControlImpl::GetBuilderBounds(_ControlOrientation orientation, Rectangle& bound if (orientation == _CONTROL_ORIENTATION_PORTRAIT && __pBuilderPortraitBounds) { + bounds = _CoordinateSystemUtils::ConvertToInteger(*__pBuilderPortraitBounds); + return true; + } + else if (orientation == _CONTROL_ORIENTATION_LANDSCAPE && __pBuilderLandscapeBounds) + { + bounds = _CoordinateSystemUtils::ConvertToInteger(*__pBuilderLandscapeBounds); + return true; + } + + return false; +} + +bool +_ControlImpl::GetBuilderBoundsF(_ControlOrientation orientation, FloatRectangle& bounds) const +{ + ClearLastResult(); + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT && __pBuilderPortraitBounds) + { bounds = *__pBuilderPortraitBounds; return true; } @@ -3466,6 +4342,30 @@ _ControlImpl::GetBuilderBounds(_ControlOrientation orientation, Rectangle& bound return false; } +void +_ControlImpl::SetContentAreaBounds(const Rectangle& rect) +{ + GetCore().SetContentAreaBounds(rect); +} + +void +_ControlImpl::SetContentAreaBounds(const FloatRectangle& rect) +{ + GetCore().SetContentAreaBounds(rect); +} + +Rectangle +_ControlImpl::GetContentAreaBounds(void) const +{ + return GetCore().GetContentAreaBounds(); +} + +FloatRectangle +_ControlImpl::GetContentAreaBoundsF(void) const +{ + return GetCore().GetContentAreaBoundsF(); +} + Bitmap* _ControlImpl::GetCapturedBitmapN(void) const { @@ -3478,6 +4378,12 @@ _ControlImpl::GetInvalidatedBounds(void) const return GetCore().GetInvalidatedBounds(); } +FloatRectangle +_ControlImpl::GetInvalidatedBoundsF(void) const +{ + return GetCore().GetInvalidatedBoundsF(); +} + result _ControlImpl::GenerateKeyEvent(KeyState keyState, _KeyCode keyCode) { @@ -3542,4 +4448,115 @@ _ControlImpl::GetAccessibilityContainer(void) } } +result +_ControlImpl::SetPublicPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener) +{ + __pPublicPropagatedTouchEventListener = pListener; + return E_SUCCESS; +} + +IPropagatedTouchEventListener* +_ControlImpl::GetPublicPropagatedTouchEventListener(void) const +{ + return __pPublicPropagatedTouchEventListener; +} + +result +_ControlImpl::SetPublicPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener) +{ + __pPublicPropagatedKeyEventListener = pListener; + return E_SUCCESS; +} + +IPropagatedKeyEventListener* +_ControlImpl::GetPublicPropagatedKeyEventListener(void) const +{ + return __pPublicPropagatedKeyEventListener; +} + +void +_ControlImpl::SetPreviousFocus(_ControlImpl* pPreviousFocus) +{ + if (pPreviousFocus == null) + { + _Control* pControl = null; + return GetCore().SetPreviousFocus(pControl); + } + return GetCore().SetPreviousFocus(&pPreviousFocus->GetCore()); +} + +void +_ControlImpl::SetNextFocus(_ControlImpl* pNextFocus) +{ + if (pNextFocus == null) + { + _Control* pControl = null; + return GetCore().SetPreviousFocus(pControl); + } + return GetCore().SetNextFocus(&pNextFocus->GetCore()); +} + +_ControlImpl* +_ControlImpl::GetPreviousFocus(void) const +{ + if (GetCore().GetPreviousFocus() == null) + { + return null; + } + return static_cast <_ControlImpl* >(GetCore().GetPreviousFocus()->GetUserData()); +} + + _ControlImpl* + _ControlImpl::GetNextFocus(void) const + { + if (GetCore().GetNextFocus() == null) + { + return null; + } + return static_cast <_ControlImpl* >(GetCore().GetNextFocus()->GetUserData()); + } + +void +_ControlImpl::OnDrawFocus(void) +{ + GetCore().OnDrawFocus(); +} + +void +_ControlImpl::OnChildControlFocusMoved(const _Control& control) +{ + GetCore().OnChildControlFocusMoved(control); +} + +void +_ControlImpl::SetTouchPressThreshold(float distance) +{ + GetCore().SetTouchPressThreshold(distance); +} + +float +_ControlImpl::GetTouchPressThreshold(void) const +{ + return GetCore().GetTouchPressThreshold(); +} + +int +_ControlImpl::GetTouchPressThresholdPixel(void) const +{ + return GetCore().GetTouchPressThresholdPixel(); +} + +result +_ControlImpl::SetFontFromFile(const String& fileName) +{ + result r = GetCore().SetFontFromFile(fileName); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return E_SUCCESS; +} + +Tizen::Base::String +_ControlImpl::GetFontFile(void) const +{ + return GetCore().GetFontFile(); +} }} // Tizen::Ui diff --git a/src/ui/FUi_ControlImplManager.cpp b/src/ui/FUi_ControlImplManager.cpp index 167da4c..b113013 100644 --- a/src/ui/FUi_ControlImplManager.cpp +++ b/src/ui/FUi_ControlImplManager.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlImplManager.cpp * @brief This is the implementation file for the _ControlImplManager class. @@ -40,6 +41,7 @@ #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_FormImpl.h" +#include "FUiCtrl_PopupImpl.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -245,25 +247,6 @@ _ControlImplManager::OnScreenRotated(int rotation) SysAssert(pCore); pCore->OnScreenRotated(rotation); - -#if !defined(MULTI_WINDOW) - Controls::_FrameImpl* pFrameImpl = dynamic_cast(GetCurrentFrame()); - if (pFrameImpl == null) - { - return; - } - - Controls::_FormImpl* pCurrentFormImpl = pFrameImpl->GetCurrentForm(); - - if (pCurrentFormImpl != null) - { - pCurrentFormImpl->UpdateOrientationStatus(true); - } - else - { - pFrameImpl->UpdateOrientationStatus(); - } -#endif } void @@ -275,16 +258,6 @@ _ControlImplManager::SetOrientationStatus(OrientationStatus orientationStatus) pCore->SetOrientationStatus(::Convert(orientationStatus)); } -#if !defined(MULTI_WINDOW) -void -_ControlImplManager::RotateScreen(OrientationStatus orientationStatus) -{ - _ControlManager* pCore = _ControlManager::GetInstance(); - SysAssert(pCore); - - pCore->RotateScreen(::Convert(orientationStatus)); -} -#else void _ControlImplManager::RotateScreen(_ControlImpl* pControlImpl, OrientationStatus orientationStatus) { @@ -293,7 +266,6 @@ _ControlImplManager::RotateScreen(_ControlImpl* pControlImpl, OrientationStatus pCore->RotateScreen(pControlImpl->GetCore(), ::Convert(orientationStatus)); } -#endif OrientationStatus _ControlImplManager::GetOrientationStatus(Orientation mode) const @@ -336,9 +308,10 @@ _ControlImplManager::GetOrientationStatus(Orientation mode) const } OrientationStatus -_ControlImplManager::GetFormOrientationStatus(_ControlImpl *pControlImpl) +_ControlImplManager::GetFormOrientationStatus(_ControlImpl* pControlImpl) { _FormImpl* pParentImpl = null; + _ControlImpl* pTempControlImpl = pControlImpl; OrientationStatus orientation = ORIENTATION_STATUS_NONE; while(pControlImpl) { @@ -358,6 +331,19 @@ _ControlImplManager::GetFormOrientationStatus(_ControlImpl *pControlImpl) { orientation = pParentImpl->GetOrientationStatus(); } + else + { + _PopupImpl* pPopImpl = dynamic_cast(pTempControlImpl); + Form* pForm = null; + if (pPopImpl) + { + pForm = dynamic_cast(pPopImpl->GetOwner()); + if (pForm) + { + orientation = pForm->GetOrientationStatus(); + } + } + } return orientation; } diff --git a/src/ui/FUi_ControlManager.cpp b/src/ui/FUi_ControlManager.cpp old mode 100755 new mode 100644 index 240574d..47bf8d6 --- a/src/ui/FUi_ControlManager.cpp +++ b/src/ui/FUi_ControlManager.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlManager.cpp * @brief This is the implementation file for the _ControlManager class. @@ -22,15 +23,11 @@ #include #include #include -#if defined(MULTI_WINDOW) #include #include -#endif #include #include -#if defined(MULTI_WINDOW) #include -#endif #include #include #include @@ -56,15 +53,11 @@ #include "FUiAnim_AnimationManager.h" #include "FUiAnim_DisplayManager.h" #include "FUi_AccessibilityManager.h" -#if defined(MULTI_WINDOW) #include "FUiAnim_VisualElement.h" #include "FUiAnim_EflLayer.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_FormImpl.h" -#endif #include "FUiCtrl_Frame.h" -// #include "FUiCtrl_NotificationFrame.h" -// #include "FUiCtrl_NotificationFrameImpl.h" #include "FUiCtrl_IndicatorManager.h" using namespace Tizen::App; @@ -113,34 +106,22 @@ int Convert(_ControlRotation rotation) } // Anonymous -namespace Tizen { namespace Ui +extern "C" { - -class _UiDebug +_OSP_EXPORT_ void +_UiPrintControl(const _Control& control, bool printChildren, int level) { -public: - static void PrintControl(const _Control& control, bool printChildren = true); - static void PrintTree(void); -}; - -void -_UiDebug::PrintControl(const _Control& control, bool printChildren) -{ - const_cast<_Control&>(control).PrintDescription(printChildren); + const_cast<_Control&>(control).PrintDescription(printChildren, level); } -void -_UiDebug::PrintTree(void) +_OSP_EXPORT_ void +_UiPrintTree(int level) { _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); -#if !defined(MULTI_WINDOW) - PrintControl(pControlManager->GetRoot(), true); -#else if (pControlManager->GetWindowCount() == 0) { - SysLog(NID_UI, "There is no window."); return; } @@ -148,11 +129,13 @@ _UiDebug::PrintTree(void) for (int i = 0; i < count; i++) { _Window* pWindow = pControlManager->GetWindow((count-1) - i); - PrintControl(*pWindow, true); + _UiPrintControl(*pWindow, true, level); } -#endif +} } +namespace Tizen { namespace Ui +{ _ControlManager* _ControlManager::__pInstance = null; void @@ -254,7 +237,7 @@ _ControlManager::GetAppCoordinateSystem(bool& isCoordinateSystemLogical, int& lo { _PackageInfoImpl infoImpl; { - String subAppId(_AppInfo::GetAppId()); + String subAppId(_AppInfo::GetPackageId()); result r = infoImpl.Construct(subAppId); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -312,11 +295,7 @@ _ControlManager::GetLogicalBaseScreenSize(void) const } _ControlManager::_ControlManager(void) // [ToDo] exception check. -#if !defined(MULTI_WINDOW) - : __pRoot(null) -#else : __pWindowList(null) -#endif , __isCoordinateSystemLogical(true) , __logicalCoordinateSystem(0) , __logicalBaseScreenSize(BASE_SCREEN_SIZE_NONE) @@ -325,15 +304,10 @@ _ControlManager::_ControlManager(void) // [ToDo] exception check. , __screenRotation(_CONTROL_ROTATION_0) , __orientationStatus(_CONTROL_ROTATION_0) , __orientation(_CONTROL_ORIENTATION_PORTRAIT) -#if !defined(MULTI_WINDOW) - , __pWindowPi(null) -#endif , __pCurrentFrame(null) , __pGestureList(null) , __gestureMaxDuration(0) -#if defined(MULTI_WINDOW) , __touchedWindow(0) -#endif , __isDefaultFontChanged(false) , __defaultFontName(L"") { @@ -346,76 +320,6 @@ _ControlManager::_ControlManager(void) // [ToDo] exception check. r = _CoordinateSystem::Initialize(__logicalCoordinateSystem, __logicalBaseScreenSize, deviceResolution, deviceBaseScreenSize); SysAssert(r == E_SUCCESS); -#if !defined(MULTI_WINDOW) - _RootVisualElement* pVisualElementRoot = null; - _EflWindow* pWindowPi = null; - _Control* pRoot = null; - _ControlHandle rootHandle; - - // Initialize _UiEventManager - _UiEventManager::Initialize(); - - // Initialize _TouchManager - _TouchManager::Initialize(); - - _KeyEventManager::Initialize(); - - _AccessibilityManager::CreateInstance(); - - r = _AnimationManager::CreateInstance(); - SysAssertf(r == E_SUCCESS, "Failed to create animation manager!"); - - r = _DisplayManager::CreateInstance(); - SysAssertf(r == E_SUCCESS, "Failed to create display manager!"); - - pWindowPi = _EflWindow::CreateInstanceN(); - SysTryReturnVoidResult(NID_UI, pWindowPi, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - pRoot = new (std::nothrow) _Control; // The children of pRoot are set not to be clipped to the parent. - SysTryCatch(NID_UI, pRoot, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = GetLastResult(); - SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error occurred."); - - pVisualElementRoot = pWindowPi->GetRootVisualElement(); - SysTryCatch(NID_UI, pVisualElementRoot, , E_SYSTEM, "[E_SYSTEM] System error occurred."); - pVisualElementRoot->SetName(L"Root"); - - r = pVisualElementRoot->AttachChild(*pRoot->GetVisualElement()); - SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error occurred."); - pRoot->GetVisualElement()->SetClipChildrenEnabled(false); - pRoot->GetVisualElement()->SetName(L"RootControl"); - - __pSystemWindowList = new (std::nothrow)LinkedListT<_Window*>; - SysTryCatch(NID_UI, __pSystemWindowList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pGestureList = new (std::nothrow)LinkedListT<_TouchGestureDetector*>; - SysTryCatch(NID_UI, __pGestureList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - rootHandle = Register(pRoot); // [review] exception - SysAssert(rootHandle.IsValid()); - - __pWindowPi = pWindowPi; - __pRoot = pRoot; - - pWindowPi->SetFrame(*pRoot); - - return; - -CATCH: - delete pWindowPi; - pWindowPi = null; - - delete pRoot; - pRoot = null; - - delete __pGestureList; - __pGestureList = null; - - delete __pSystemWindowList; - __pSystemWindowList = null; - -#else r = _AnimationManager::CreateInstance(); SysAssertf(r == E_SUCCESS, "Failed to create animation manager!"); @@ -454,47 +358,10 @@ CATCH: delete __pGestureList; __pGestureList = null; } -#endif } _ControlManager::~_ControlManager(void) { -#if !defined(MULTI_WINDOW) - _EflWindow* pWindowPi = static_cast<_EflWindow*>(__pWindowPi); - - // Release frame window - if(pWindowPi) - { - _RootVisualElement* pRootVE = pWindowPi->GetRootVisualElement(); - _VisualElement* pControlRootVE = __pRoot->GetVisualElement(); - if (pRootVE && pControlRootVE) - { - pRootVE->DetachChild(*pControlRootVE); - } - } - - // Release clip board - _Clipboard::ReleaseInstance(); - - // Relese others - delete __pRoot; - delete __pWindowPi; - delete __pGestureList; - delete __pSystemWindowList; - - _AnimationManager::ReleaseInstance(); - - // Release ecore evas manager - DestroyEcoreEvasMgr(); - - // Check control handle count - if (GetUsedHandleCount() != 0) - { - SysLog(NID_UI, "[Control Manager] The number of unreleased controls: %d", GetUsedHandleCount()); - } - - _DisplayManager::ReleaseInstance(); -#else _Clipboard::ReleaseInstance(); if (__pWindowList) @@ -516,36 +383,20 @@ _ControlManager::~_ControlManager(void) SysLog(NID_UI, "[Control Manager] The number of unreleased controls: %d", GetUsedHandleCount()); } + + _IndicatorManager::ReleaseInstance(); + _DisplayManager::ReleaseInstance(); _AnimationManager::ReleaseInstance(); -#endif - _AccessibilityManager::ReleaseInstance(); - _IndicatorManager::ReleaseInstance(); + _AccessibilityManager::ReleaseInstance(); _KeyEventManager::ReleaseInstance(); _TouchManager::ReleaseInstance(); - _UiEventManager::Release(); } -#if !defined(MULTI_WINDOW) -const _Control& -_ControlManager::GetRoot(void) const -{ - SysAssert(__pRoot); - return *__pRoot; -} - -_Control& -_ControlManager::GetRoot(void) -{ - SysAssert(__pRoot); - return *__pRoot; -} -#endif - _Window* _ControlManager::GetTopWindow(void) const { @@ -559,7 +410,6 @@ _ControlManager::GetTopWindow(void) const return GetWindow(GetWindowCount() - 1); } -#if defined(MULTI_WINDOW) _Window* _ControlManager::GetTopVisibleWindow(void) const { @@ -613,7 +463,6 @@ _ControlManager::GetTopVisibleWindowAt(const Point& point) const return null; } -#endif bool _ControlManager::IsWindowOnTop(const _Window& window) const @@ -624,30 +473,13 @@ _ControlManager::IsWindowOnTop(const _Window& window) const bool _ControlManager::IsWindowAttached(const _Window& window) const { -#if !defined(MULTI_WINDOW) - if (window.IsSystemWindow()) - { - return __pSystemWindowList->Contains(const_cast<_Window*>(&window)); - } - - return window.GetParent() == __pRoot; -#else return __pWindowList->Contains(const_cast<_Window*>(&window)); -#endif } // Open a window and bring it to top. result _ControlManager::OpenWindow(_Window& window, bool invalidate) { -#if !defined(MULTI_WINDOW) - // [Temp] - if (dynamic_cast <_Frame*>(&window) != null) - { - __pWindowPi->SetFrame(window); - } -#endif - if (dynamic_cast <_Frame*>(&window) != null) { __pCurrentFrame = &window; @@ -671,61 +503,6 @@ _ControlManager::ActivateWindow(_Window& window) ClearLastResult(); result r = E_SUCCESS; -#if !defined(MULTI_WINDOW) - // if (dynamic_cast<_NotificationFrame*>(&window)) - if (window.IsSystemWindow()) - { - r = window.GetControlDelegate().OnAttaching(null); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = CallOnAttachingToMainTree(window); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - window.Activate(); - - r = window.GetControlDelegate().OnAttached(); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = CallOnAttachedToMainTree(window); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - else - { - if (IsWindowOnTop(window)) - { - return E_SUCCESS; - } - - if (window.IsActivatedOnOpen()) - { - _Window* pTopWindow = GetTopWindow(); - if (pTopWindow) - { - pTopWindow->Deactivate(); - } - } - - if (IsWindowAttached(window)) - { - r = MoveWindowToTop(window); // [ToDo] excpetion - SysAssert(r == E_SUCCESS); - - return E_SUCCESS; - } - - r = AttachWindow(window); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (window.IsActivatedOnOpen()) - { - window.Activate(); - } - else - { - window.SetWindowState(WINDOW_STATE_DEACTIVATED); - } - } -#else if (IsWindowOnTop(window)) { return E_SUCCESS; @@ -778,7 +555,6 @@ _ControlManager::ActivateWindow(_Window& window) r = CallOnAttachedToMainTree(window); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); -#endif return E_SUCCESS; } @@ -876,47 +652,6 @@ _ControlManager::CloseWindow(_Window& window) // [ToDo] exception check. ClearLastResult(); result r = E_SUCCESS; -#if !defined(MULTI_WINDOW) - // if (dynamic_cast<_NotificationFrame*>(&window)) - if (window.IsSystemWindow()) - { - r = CallOnDetachingFromMainTree(window); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - window.GetControlDelegate().OnDetaching(); - - window.Deactivate(); - } - else - { - if (IsWindowAttached(window) == false) - { - return E_SUCCESS; - } - - bool wasWindowOnTop = IsWindowOnTop(window); - - window.Deactivate(); - - r = DetachWindow(window); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (wasWindowOnTop) - { - _Window* pNewTopWindow = GetTopWindow(); - if (pNewTopWindow && pNewTopWindow->IsActivatedOnOpen()) - { - pNewTopWindow->Activate(); - } - } - - if (dynamic_cast <_Frame*>(&window) != null) - { - // __pWindowPi->SetFrame(null); // ? - __pCurrentFrame = null; - } - } -#else if (IsWindowAttached(window) == false) { return E_SUCCESS; @@ -947,7 +682,6 @@ _ControlManager::CloseWindow(_Window& window) // [ToDo] exception check. __pCurrentFrame = pNewTopWindow; } } -#endif return E_SUCCESS; } @@ -955,24 +689,16 @@ _ControlManager::CloseWindow(_Window& window) // [ToDo] exception check. _Window* _ControlManager::GetWindow(int index) const { -#if !defined(MULTI_WINDOW) - return dynamic_cast <_Window*>(GetRoot().GetChild(index)); -#else _Window* pWindow; __pWindowList->GetAt(index, pWindow); return pWindow; -#endif } int _ControlManager::GetWindowCount(void) const { -#if !defined(MULTI_WINDOW) - return GetRoot().GetChildCount(); -#else return __pWindowList->GetCount(); -#endif } result @@ -980,51 +706,35 @@ _ControlManager::AttachWindow(_Window& window) { _IndicatorManager::GetInstance()->AddWindow(&window); -#if !defined(MULTI_WINDOW) - return GetRoot().AttachChild(window); -#else return __pWindowList->Add(&window); -#endif } result _ControlManager::InsertWindowToBottom(_Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().InsertChildToBottom(window); -#else return __pWindowList->InsertAt(&window, 0); -#endif } result _ControlManager::InsertWindowAfter(const _Window& targetWindow, _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().InsertChildAfter(targetWindow, window); -#else int index = 0; result r = __pWindowList->IndexOf(const_cast<_Window*>(&targetWindow), index); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->InsertAt(&window, index+1); -#endif } result _ControlManager::InsertWindowBefore(const _Window& targetWindow, _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().InsertChildBefore(targetWindow, window); -#else int index = 0; result r = __pWindowList->IndexOf(const_cast<_Window*>(&targetWindow), index); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->InsertAt(&window, index); -#endif } result @@ -1032,55 +742,36 @@ _ControlManager::DetachWindow(_Window& window) { _IndicatorManager::GetInstance()->DeleteWindow(&window); -#if !defined(MULTI_WINDOW) - return GetRoot().DetachChild(window); -#else return __pWindowList->Remove(&window); -#endif } void _ControlManager::DetachAllWindows(void) { -#if !defined(MULTI_WINDOW) - GetRoot().DetachAllChildren(); -#else __pWindowList->RemoveAll(); -#endif } result _ControlManager::MoveWindowToTop(const _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().MoveChildToTop(window); -#else result r = __pWindowList->Remove(const_cast<_Window*>(&window)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->Add(const_cast<_Window*>(&window)); -#endif } result _ControlManager::MoveWindowToBottom(const _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().MoveChildToBottom(window); -#else result r = __pWindowList->Remove(const_cast<_Window*>(&window)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->InsertAt(const_cast<_Window*>(&window), 0); -#endif } result _ControlManager::MoveWindowAfter(const _Window& targetWindow, const _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().MoveChildAfter(targetWindow, window); -#else result r = __pWindowList->Remove(const_cast<_Window*>(&window)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1090,15 +781,11 @@ _ControlManager::MoveWindowAfter(const _Window& targetWindow, const _Window& win SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->InsertAt(const_cast<_Window*>(&window), index+1); -#endif } result _ControlManager::MoveWindowBefore(const _Window& targetWindow, const _Window& window) { -#if !defined(MULTI_WINDOW) - return GetRoot().MoveChildBefore(targetWindow, window); -#else result r = __pWindowList->Remove(const_cast<_Window*>(&window)); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1108,7 +795,6 @@ _ControlManager::MoveWindowBefore(const _Window& targetWindow, const _Window& wi SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return __pWindowList->InsertAt(const_cast<_Window*>(&window), index); -#endif } _ControlOrientation @@ -1154,9 +840,7 @@ _ControlManager::OnScreenRotated(int rotation) SysLog(NID_UI, "The angle of Emul or Target is %d.", rotation); __screenRotation = ::Convert(rotation); -#if defined(MULTI_WINDOW) int count = GetWindowCount(); - for (int i = 0; i < count; i++) { _Window* pWindow = GetWindow((count-1) - i); @@ -1182,10 +866,8 @@ _ControlManager::OnScreenRotated(int rotation) } } } -#endif } -#if defined(MULTI_WINDOW) void _ControlManager::SetTouchedWindow(unsigned int window) { @@ -1221,7 +903,6 @@ _ControlManager::GetTouchedWindow(void) const return null; } -#endif void _ControlManager::SetOrientationStatus(_ControlRotation orientationStatus) @@ -1230,25 +911,6 @@ _ControlManager::SetOrientationStatus(_ControlRotation orientationStatus) } void -_ControlManager::RotateScreen(_ControlRotation screenRotation) -{ - _EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas(); - SysAssert(pEcoreEvas); - if (pEcoreEvas == null) - { - return; - } - - pEcoreEvas->RotateWindow(::Convert(screenRotation)); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - if (pTouchManager) - { - pTouchManager->SetTouchCanceled(true); - } -} - -void _ControlManager::RotateScreen(const _Control& control, _ControlRotation screenRotation) { _EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas(); @@ -1265,7 +927,6 @@ _ControlManager::RotateScreen(const _Control& control, _ControlRotation screenRo pEcoreEvas->RotateWindow(*pRootWindow, ::Convert(screenRotation)); } -#if defined(MULTI_WINDOW) // Rotate Ownees. int owneeCount = control.GetOwneeCount(); for (int i = 0; i < owneeCount; i++) @@ -1276,7 +937,6 @@ _ControlManager::RotateScreen(const _Control& control, _ControlRotation screenRo pEcoreEvas->RotateWindow(*pOwnee, ::Convert(screenRotation)); } } -#endif _TouchManager* pTouchManager = _TouchManager::GetInstance(); if (pTouchManager) @@ -1288,24 +948,6 @@ _ControlManager::RotateScreen(const _Control& control, _ControlRotation screenRo void _ControlManager::OnWindowRotated(int rotation) { -#if !defined(MULTI_WINDOW) - IEnumeratorT<_Window*>* pEnumerator = __pSystemWindowList->GetEnumeratorN(); - SysTryReturnVoidResult(NID_UI, pEnumerator, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); - - while (pEnumerator->MoveNext() == E_SUCCESS) - { - _Window* pWindow = null; - pEnumerator->GetCurrent(pWindow); - if (pWindow) - { - _WindowImpl* pWindowImpl = static_cast<_WindowImpl*>(pWindow->GetUserData()); - if (pWindowImpl) - { - pWindowImpl->Rotate(Convert(rotation)); - } - } - } -#else // For non-ownees IEnumeratorT<_Window*>* pEnumerator = __pWindowList->GetEnumeratorN(); SysTryReturnVoidResult(NID_UI, pEnumerator, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); @@ -1325,51 +967,88 @@ _ControlManager::OnWindowRotated(int rotation) } } } -#endif delete pEnumerator; } void -_ControlManager::SetFocusedControl(const _Control& control) +_ControlManager::SetFocusedControl(const _Control& control, bool on) { - if (__pFocusedControl == &control) + if (on) { - return; - } + if (__pFocusedControl == &control) + { + return; + } - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] System error occurred."); + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] System error occurred."); - _Control *pPreviousFocusedControl = __pFocusedControl; - __pFocusedControl = const_cast<_Control*>(&control); + _Control *pPreviousFocusedControl = __pFocusedControl; + if (pPreviousFocusedControl) + { + // [review] make SetFocus() return result and use the returned result here. + pEcoreEvas->SetFocus(*pPreviousFocusedControl, false); + if (GetLastResult() == E_SUCCESS) + { + if (pPreviousFocusedControl) + { + pPreviousFocusedControl->SetFocusState(false); + } + _UiFocusEvent event(pPreviousFocusedControl->GetHandle(), FOCUS_LOST); + _UiEventManager::GetInstance()->SendEvent(event); + } + } - if (pPreviousFocusedControl) - { // [review] make SetFocus() return result and use the returned result here. - pEcoreEvas->SetFocus(*pPreviousFocusedControl, false); + + if (control.IsNativeObjectFocusable()) + { + pEcoreEvas->SetFocus(control, true); + } + if (GetLastResult() == E_SUCCESS) { - if (pPreviousFocusedControl) - { - pPreviousFocusedControl->SetFocusOff(pPreviousFocusedControl); - } - _UiFocusEvent event(pPreviousFocusedControl->GetHandle(), FOCUS_LOST); + __pFocusedControl = const_cast<_Control*>(&control); + _UiFocusEvent event(control.GetHandle(), FOCUS_GAINED); _UiEventManager::GetInstance()->SendEvent(event); } } - - // [review] make SetFocus() return result and use the returned result here. - if (control.IsNativeObjectFocusable()) + else { - pEcoreEvas->SetFocus(control, true); - } + if (__pFocusedControl != &control) + { + return; + } - if (GetLastResult() == E_SUCCESS) - { - _UiFocusEvent event(control.GetHandle(), FOCUS_GAINED); - _UiEventManager::GetInstance()->SendEvent(event); - const_cast<_Control*>(&control)->SetFocusOn(); + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] System error occurred."); + + if (__pFocusedControl) + { + // [review] make SetFocus() return result and use the returned result here. + pEcoreEvas->SetFocus(*__pFocusedControl, false); + if (GetLastResult() == E_SUCCESS) + { + _UiFocusEvent event(__pFocusedControl->GetHandle(), FOCUS_LOST); + _UiEventManager::GetInstance()->SendEvent(event); + } + } + + _Window* pTopWindow = GetTopWindow(); + if (pTopWindow) + { + // [review] make SetFocus() return result and use the returned result here. + pEcoreEvas->SetFocus(*pTopWindow, true); + if (GetLastResult() == E_SUCCESS) + { + pTopWindow->SetFocusState(true); + _UiFocusEvent event(pTopWindow->GetHandle(), FOCUS_GAINED); + _UiEventManager::GetInstance()->SendEvent(event); + } + + __pFocusedControl = static_cast<_Control*>(pTopWindow); + } } } @@ -1401,11 +1080,7 @@ _ControlManager::GetTopmostTouchedControl(const Point& point) _Control* pControl = null; _Window* pTopWindow = null; -#if !defined(MULTI_WINDOW) - pTopWindow = GetTopWindow(); -#else int count = GetWindowCount(); - if (count != 0) { for (int i = 0; i < count; i++) @@ -1472,27 +1147,14 @@ _ControlManager::GetTopmostTouchedControl(const Point& point) } } } -#endif if (pTopWindow != null) { Point winPos(0, 0); - -#if !defined(MULTI_WINDOW) - _Frame* pFrame = dynamic_cast<_Frame*>(pTopWindow); - if (pFrame) - { - winPos = pFrame->GetPosition(); - } - - Point relPos(point.x - winPos.x, point.y - winPos.y); - pControl = GetRoot().GetTopmostChildAt(relPos); -#else winPos = pTopWindow->GetPosition(); Point relPos(point.x - winPos.x, point.y - winPos.y); pControl = pTopWindow->GetTopmostChildAt(relPos); -#endif if (pControl != null) { if (pControl->GetRootWindow() == pTopWindow) @@ -1512,6 +1174,12 @@ _ControlManager::GetScreenSize(void) const return _CoordinateSystemUtils::InverseTransform(Dimension(_Screen::GetWidth(), _Screen::GetHeight())); } +FloatDimension +_ControlManager::GetScreenSizeF(void) const +{ + return _CoordinateSystemUtils::InverseTransform(FloatDimension(_Screen::GetWidth(), _Screen::GetHeight())); +} + _Window* _ControlManager::GetCurrentFrame(void) const { @@ -1529,13 +1197,14 @@ _ControlManager::SetDefaultFont(const String& appFontName) __isDefaultFontChanged = true; __defaultFontName = appFontName; + __defaultFontFileName.Clear(); struct _Visitor : public _Control::Visitor { virtual _Control::VisitType Visit(_Control& control) { - if (control.__fontName.IsEmpty()) + if (control.__fontName.IsEmpty() && control.__fontFileName.IsEmpty()) { control.GetFallbackFont(); _IControlDelegate& delegate = control.GetControlDelegate(); @@ -1547,18 +1216,12 @@ _ControlManager::SetDefaultFont(const String& appFontName) _Visitor visitor; -#if !defined(MULTI_WINDOW) - _Control& control = GetRoot(); - control.Accept(visitor); -#else int count = GetWindowCount(); - for (int j = 0; j < count; j++) { _Window* pWindow = GetWindow((count-1) - j); pWindow->Accept(visitor); } -#endif SetDefaultFontChangeState(false); @@ -1571,6 +1234,50 @@ _ControlManager::GetDefaultFont(void) return __defaultFontName; } +result +_ControlManager::SetDefaultFontFromFile(const Tizen::Base::String& fileName) +{ + if(fileName.Equals(__defaultFontFileName)) + { + return E_SUCCESS; + } + + __isDefaultFontChanged = true; + __defaultFontFileName = fileName; + __defaultFontName.Clear(); + struct _Visitor + : public _Control::Visitor + { + virtual _Control::VisitType Visit(_Control& control) + { + if (control.__fontName.IsEmpty() && control.__fontFileName.IsEmpty()) + { + control.GetFallbackFont(); + _IControlDelegate& delegate = control.GetControlDelegate(); + delegate.OnFontChanged(control.__pFont); + } + return _Control::VISIT_DOWNWARD; + } + }; + + _Visitor visitor; + + int count = GetWindowCount(); + for (int j = 0; j < count; j++) + { + _Window* pWindow = GetWindow((count-1) - j); + pWindow->Accept(visitor); + } + + SetDefaultFontChangeState(false); + + return E_SUCCESS; +} +String +_ControlManager::GetDefaultFontFile(void) const +{ + return __defaultFontFileName; +} bool _ControlManager::IsDefaultFontChanged(void) { @@ -1679,6 +1386,41 @@ _ControlManager::OnSettingChanged(Tizen::Base::String& key) pWindow->Invalidate(true); } } + + //fixme : check longpress duration key + //if (key == ) + { + if (!__pGestureList || (__pGestureList && (__pGestureList->GetCount() <= 0))) + { + return; + } + + IEnumeratorT<_TouchGestureDetector*>* pEnumerator = __pGestureList->GetEnumeratorN(); + SysTryReturnVoidResult(NID_UI, pEnumerator, E_SYSTEM, "[E_SYSTEM] System error occurred.") + + //fixme : check the elm_config_longpress_timeout_get api + int duration = 500; //static_cast(elm_config_longpress_timeout_get()); + + while (pEnumerator->MoveNext() == E_SUCCESS) + { + _TouchGestureDetector* pGestureDetector = null; + pEnumerator->GetCurrent(pGestureDetector); + + if (!pGestureDetector) + { + continue; + } + + if(pGestureDetector->GetDetectorType() == _TOUCH_GESTURE_DETECTOR_TYPE_LONG_PRESS) + { + _TouchLongPressGestureDetector* pGestureLongPress= dynamic_cast<_TouchLongPressGestureDetector*>(const_cast<_TouchGestureDetector*>(pGestureDetector)); + SysTryReturnVoidResult(NID_UI, pGestureLongPress, E_SYSTEM, "[E_SYSTEM] System error occurred.") + pGestureLongPress->SetDuration(duration); + } + } + + delete pEnumerator; + } } }} // Tizen::Ui diff --git a/src/ui/FUi_CoordinateSystemUtils.cpp b/src/ui/FUi_CoordinateSystemUtils.cpp deleted file mode 100644 index da02022..0000000 --- a/src/ui/FUi_CoordinateSystemUtils.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUi_CoordinateSystemUtils.cpp - * @brief This file contains implementation of _CoordinateSystemUtils class - * - * This file contains implementation _CoordinateSystemUtils class. - */ - -#include -#include -#include "FUi_CoordinateSystemUtils.h" - -using namespace Tizen::Graphics; - -namespace Tizen { namespace Ui { - -_CoordinateSystem* _CoordinateSystemUtils::__pCoordinateSystemInstance = null; - -_ICoordinateSystemTransformer* -_CoordinateSystemUtils::GetTransformer(void) -{ - if (__pCoordinateSystemInstance == null) - { - __pCoordinateSystemInstance = _CoordinateSystem::GetInstance(); - SysTryReturn(NID_UI, __pCoordinateSystemInstance, null, E_SYSTEM, "[E_SYSTEM] Coordinate system instance must not be null."); - } - - _ICoordinateSystemTransformer* pTransform = __pCoordinateSystemInstance->GetTransformer(); - SysTryReturn(NID_UI, pTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate transformer does not exist."); - - return pTransform; -} - -_ICoordinateSystemTransformer* -_CoordinateSystemUtils::GetInverseTransformer(void) -{ - if (__pCoordinateSystemInstance == null) - { - __pCoordinateSystemInstance = _CoordinateSystem::GetInstance(); - SysTryReturn(NID_UI, __pCoordinateSystemInstance, null, E_SYSTEM, "[E_SYSTEM] Coordinate system instance must not be null."); - } - - _ICoordinateSystemTransformer* pInverseTransform= __pCoordinateSystemInstance->GetInverseTransformer(); - SysTryReturn(NID_UI, pInverseTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate inverse transformer does not exist."); - - return pInverseTransform; -} - - -// Transform Utilities -Rectangle -_CoordinateSystemUtils::Transform(const Rectangle& rect) -{ - return GetTransformer()->Transform(rect); -} - -Rectangle -_CoordinateSystemUtils::Transform(const Point& point, const Dimension& dim) -{ - return GetTransformer()->Transform(Rectangle(point, dim)); -} - -Dimension -_CoordinateSystemUtils::Transform(const Dimension& dim) -{ - return GetTransformer()->Transform(dim); -} - -Point -_CoordinateSystemUtils::Transform(const Point& point) -{ - return GetTransformer()->Transform(point); -} - -int -_CoordinateSystemUtils::HorizontalTransform(int scalar) -{ - return GetTransformer()->TransformHorizontal(scalar); -} - -int -_CoordinateSystemUtils::VerticalTransform(int scalar) -{ - return GetTransformer()->TransformVertical(scalar); -} - - -// InverseTransform Utilities -Rectangle -_CoordinateSystemUtils::InverseTransform(const Rectangle& rect) -{ - return GetInverseTransformer()->Transform(rect); -} - -Rectangle -_CoordinateSystemUtils::InverseTransform(const Point& point, const Dimension& dim) -{ - return GetInverseTransformer()->Transform(Rectangle(point, dim)); -} - -Dimension -_CoordinateSystemUtils::InverseTransform(const Dimension& dim) -{ - return GetInverseTransformer()->Transform(dim); -} - -Point -_CoordinateSystemUtils::InverseTransform(const Point& point) -{ - return GetInverseTransformer()->Transform(point); -} - -int -_CoordinateSystemUtils::InverseHorizontalTransform(int scalar) -{ - return GetInverseTransformer()->TransformHorizontal(scalar); -} - -int -_CoordinateSystemUtils::InverseVerticalTransform(int scalar) -{ - return GetInverseTransformer()->TransformVertical(scalar); -} - -}} // Tizen::Ui diff --git a/src/ui/FUi_CustomControlBaseImpl.cpp b/src/ui/FUi_CustomControlBaseImpl.cpp old mode 100644 new mode 100755 index 23d6c5a..2158028 --- a/src/ui/FUi_CustomControlBaseImpl.cpp +++ b/src/ui/FUi_CustomControlBaseImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_CustomControlBaseImpl.cpp * @brief This is the implementation for the _CustomControlBaseImpl class and default transformer. diff --git a/src/ui/FUi_DataBinding.cpp b/src/ui/FUi_DataBinding.cpp index 0c6760f..8af5b4c 100644 --- a/src/ui/FUi_DataBinding.cpp +++ b/src/ui/FUi_DataBinding.cpp @@ -989,8 +989,16 @@ _DataBinding::_DataBinding(void) } _DataBinding::~_DataBinding(void) { - delete __pPropertyChangeEventListener; - __pPropertyChangeEventListener = null; + if (__pPropertyChangeEventListener) + { + _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle); + if (pControl) + { + pControl->RemovePropertyChangeEventListener(*__pPropertyChangeEventListener); + } + delete __pPropertyChangeEventListener; + __pPropertyChangeEventListener = null; + } } result diff --git a/src/ui/FUi_DragDropEvent.cpp b/src/ui/FUi_DragDropEvent.cpp index e236491..418ed4c 100644 --- a/src/ui/FUi_DragDropEvent.cpp +++ b/src/ui/FUi_DragDropEvent.cpp @@ -25,8 +25,10 @@ #include #include +#include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_DragDropEvent.h" #include "FUi_DragDropEventArg.h" @@ -94,7 +96,9 @@ _DragDropEvent::FireImpl(IEventListener* pListener, const IEventArg& arg) SysTryReturnResult(NID_UI, pListener, E_INVALID_ARG, "The Invalid argument is given."); IDragDropEventListener* pDragDropListener = dynamic_cast (pListener); - SysTryReturnResult(NID_UI, pDragDropListener, E_INVALID_ARG, "The Invalid argument is given."); + IDragDropEventListenerF* pDragDropListenerF = dynamic_cast (pListener); + + SysTryReturnResult(NID_UI, pDragDropListener || pDragDropListenerF, E_INVALID_ARG, "The Invalid argument is given."); const _DragDropEventArg* pArg = dynamic_cast (&arg); SysTryReturnResult(NID_UI, pArg, E_INVALID_ARG, "The invalid Event Argument is given."); @@ -132,11 +136,25 @@ _DragDropEvent::FireImpl(IEventListener* pListener, const IEventArg& arg) break; case DRAG_DROP_DRAGGED: - pDragDropListener->OnTouchDragged(*pArg->GetSource(), pArg->GetStartPosition(), pArg->GetCurrentPosition()); + if (pDragDropListener) + { + pDragDropListener->OnTouchDragged(*pArg->GetSource(), pArg->GetStartPosition(), pArg->GetCurrentPosition()); + } + if (pDragDropListenerF) + { + pDragDropListenerF->OnTouchDraggedF(*pArg->GetSource(), _CoordinateSystemUtils::ConvertToFloat(pArg->GetStartPosition()), _CoordinateSystemUtils::ConvertToFloat(pArg->GetCurrentPosition())); + } break; case DRAG_DROP_DROPPED: - pDragDropListener->OnTouchDropped(*pArg->GetSource(), pArg->GetStartPosition(), pArg->GetCurrentPosition()); + if (pDragDropListener) + { + pDragDropListener->OnTouchDropped(*pArg->GetSource(), pArg->GetStartPosition(), pArg->GetCurrentPosition()); + } + if (pDragDropListenerF) + { + pDragDropListenerF->OnTouchDroppedF(*pArg->GetSource(), _CoordinateSystemUtils::ConvertToFloat(pArg->GetStartPosition()), _CoordinateSystemUtils::ConvertToFloat(pArg->GetCurrentPosition())); + } break; default: diff --git a/src/ui/FUi_DragDropEventArg.cpp b/src/ui/FUi_DragDropEventArg.cpp index c1ed52c..93911ba 100644 --- a/src/ui/FUi_DragDropEventArg.cpp +++ b/src/ui/FUi_DragDropEventArg.cpp @@ -17,7 +17,7 @@ /** * @file FUi_DragDropEventArg.cpp * @brief This is the implementation file for _DragDropEventArg class - * @version 2.1 + * @version 2.0 * * This file contains the implementation of %_DragDropEventArg class. * diff --git a/src/ui/FUi_EcoreEvas.cpp b/src/ui/FUi_EcoreEvas.cpp index 98e2f63..79834cb 100644 --- a/src/ui/FUi_EcoreEvas.cpp +++ b/src/ui/FUi_EcoreEvas.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EcoreEvas.cpp * @brief This is the implementation file for the _EcoreEvas class. @@ -49,7 +50,6 @@ #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_DisplayManager.h" #include "FUiCtrl_Frame.h" -// #include "FUiCtrl_NotificationFrame.h" #include "FUi_Clipboard.h" #include "FUi_TouchManager.h" #include "FUi_ControlManager.h" @@ -75,6 +75,7 @@ using namespace Tizen::Ui::Controls; #define ATOM_CBHM_CLIPBOARD_SHOW "show0" #define ATOM_CBHM_CLIPBOARD_HIDE "cbhm_hide" #define ATOM_CBHM_SELECTED_ITEM "CBHM_SELECTED_ITEM" +#define ATOM_ROTATE_AUTO "_E_WINDOW_ROTATION_SUPPORTED" namespace Tizen { namespace Ui { @@ -87,145 +88,131 @@ namespace Ecore_X_Atom __atomRotateRootAngle = 0; Ecore_X_Atom __atomAccessibility = 0; -void -OnWindowDeleted(void* pData, Evas* pE, Evas_Object* pObj, void* pEventInfo) -{ -} +int __clipboardHeight = 0; Eina_Bool -OnPropertyChanged(void* pData, int type, void* pEvent) +OnWindowPropertyChanged(void* pData, int type, void* pEvent) { - SysLog(NID_UI, "This callback is called."); - - if (!pData) + Ecore_X_Event_Window_Property* pEv = (Ecore_X_Event_Window_Property*)pEvent; + if (!pEv) { - SysLog(NID_UI, "The data is not valid."); - return EINA_FALSE; + return ECORE_CALLBACK_PASS_ON; } - if (!pEvent) + Ecore_X_Window targetWin = pEv->win; + if (targetWin == 0) { - SysLog(NID_UI, "The event is not valid."); - return EINA_FALSE; + return ECORE_CALLBACK_PASS_ON; } - Ecore_X_Event_Window_Property* pE = (Ecore_X_Event_Window_Property*) pEvent; - - Ecore_X_Atom atom = pE->atom; - Ecore_X_Atom activeAtom = ecore_x_atom_get("_NET_ACTIVE_WINDOW"); - - if (atom != activeAtom) + if (pEv->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE) { - return ECORE_CALLBACK_PASS_ON; + Ecore_X_Window zone = ecore_x_e_illume_zone_get(targetWin); + Ecore_X_Illume_Clipboard_State clipboardState = ecore_x_e_illume_clipboard_state_get(zone); + + if (clipboardState == ECORE_X_ILLUME_CLIPBOARD_STATE_ON) + { + int x = 0; + int y = 0; + int w = 0; + int h = 0; + ecore_x_e_illume_clipboard_geometry_get(zone, &x, &y, &w, &h); + + Dimension clipboardDim = _CoordinateSystemUtils::InverseTransform(Dimension(w, h)); + + if (__clipboardHeight == 0) + { + _Clipboard::GetInstance()->FirePopupEvent(_CLIPBOARD_POPUP_STATE_OPENED, clipboardDim.width, clipboardDim.height); + __clipboardHeight = clipboardDim.height; + } + else + { + _Clipboard::GetInstance()->FirePopupEvent(_CLIPBOARD_POPUP_STATE_BOUNDS_CHANGED, clipboardDim.width, clipboardDim.height); + } + } + else + { + _Clipboard::GetInstance()->FirePopupEvent(_CLIPBOARD_POPUP_STATE_CLOSED, 0, 0); + __clipboardHeight = 0; + } } + else if (pEv->atom == ECORE_X_ATOM_WM_STATE) + { + _ControlManager* pControlManager = _ControlManager::GetInstance(); + if (!pControlManager) + { + return ECORE_CALLBACK_PASS_ON; + } - Ecore_X_Window win = pE->win; + int winCount = pControlManager->GetWindowCount(); - Ecore_X_Window activeWin = 0; - ecore_x_window_prop_window_get(win, activeAtom, &activeWin, 1); + for (int i = 0; i < winCount; i++) + { + _Window* pWindow = pControlManager->GetWindow(i); + if (!pWindow) + { + continue; + } - int pid = 0; - Eina_Bool ret = ecore_x_netwm_pid_get(activeWin, &pid); - if (ret != EINA_TRUE) - { - return ECORE_CALLBACK_PASS_ON; - } + Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle(); + if (win != targetWin) + { + continue; + } - char* pAppName = null; - ecore_x_netwm_name_get(activeWin, &pAppName); + if (pWindow->IsOrientationRoot() == true) + { + _Frame* pFrame = static_cast<_Frame*>(pWindow); - _EcoreEvas* pEcoreEvas = static_cast<_EcoreEvas*>(pData); - pEcoreEvas->FireActiveWindowEvent(activeWin, pid, pAppName); + Ecore_X_Window_State_Hint state = ecore_x_icccm_state_get(targetWin); + switch (state) + { + case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN: + // Frame was hidden. + break; + case ECORE_X_WINDOW_STATE_HINT_ICONIC: + pFrame->OnFrameMinimized(); + break; + case ECORE_X_WINDOW_STATE_HINT_NORMAL: + pFrame->OnFrameRestored(); + break; + default: + break; + } - if (pAppName) - { - free(pAppName); + break; + } + } } return ECORE_CALLBACK_PASS_ON; } Eina_Bool -OnVisibilityChanged(void* pData, int type, void* pEvent) +OnWindowVisibilityChanged(void* pData, int type, void* pEvent) { SysTryReturn(NID_UI, pData, EINA_FALSE, E_INVALID_ARG, "[E_INVALID_ARG] The specified data is not valid."); SysTryReturn(NID_UI, pEvent, EINA_FALSE, E_INVALID_ARG, "[E_INVALID_ARG] The specified data is not valid."); -#if !defined(MULTI_WINDOW) - _EcoreEvas* pEcoreEvas = static_cast<_EcoreEvas*>(pData); - Ecore_Evas* pEcore_Evas = pEcoreEvas->GetEcoreEvas(); - SysTryReturn(NID_UI, pEcore_Evas, EINA_FALSE, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcore_Evas); - - Ecore_X_Event_Window_Visibility_Change* pE = (Ecore_X_Event_Window_Visibility_Change*) pEvent; - - Tizen::Base::Collection::ArrayList* pArgs = null; - String* pType = null; - Integer* pObscured = null; - - if (window == pE->win) - { - const _Control* pDestination = pEcoreEvas->GetFrame(); - SysTryReturn(NID_UI, pDestination, EINA_FALSE, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - pArgs = new (std::nothrow) Tizen::Base::Collection::ArrayList; - SysTryReturn(NID_UI, pArgs, EINA_FALSE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); - - result r = pArgs->Construct(); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - pType = new (std::nothrow) String(L"VisibilityEvent"); - r = pArgs->Add(*pType); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - pObscured = new (std::nothrow) Integer(pE->fully_obscured); - r = pArgs->Add(*pObscured); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - _UiNotificationEvent event(pDestination->GetHandle(), pArgs); - - r = _UiEventManager::GetInstance()->SendEvent(event); - } -#else Ecore_X_Event_Window_Visibility_Change* pE = (Ecore_X_Event_Window_Visibility_Change*) pEvent; _ControlManager* pControlManager = _ControlManager::GetInstance(); int count = pControlManager->GetWindowCount(); _Window* pWindow = null; - Ecore_X_Window window = 0; bool found = false; for (int i = 0; i < count; i++) { pWindow = pControlManager->GetWindow(i); - if (!pWindow) - { - SysLog(NID_UI, "The efl layer is null."); - continue; - } - - _RootVisualElement* pRootVE = pWindow->GetRootVisualElement(); - if (!pRootVE) - { - SysLog(NID_UI, "The efl layer is null."); - continue; - } - - _EflLayer* pEflLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer()); - if (!pEflLayer) + if (pWindow) { - SysLog(NID_UI, "The efl layer is null."); - continue; - } - - window = (Ecore_X_Window)ecore_evas_window_get(pEflLayer->GetEcoreEvas()); - - if (window == pE->win) - { - found = true; - break; + NativeWindowHandle handle = pWindow->GetNativeHandle(); + if (handle == pE->win) + { + found = true; + break; + } } } @@ -255,7 +242,6 @@ OnVisibilityChanged(void* pData, int type, void* pEvent) r = _UiEventManager::GetInstance()->SendEvent(event); } -#endif return ECORE_CALLBACK_RENEW; @@ -276,6 +262,55 @@ CATCH: return EINA_FALSE; } +Eina_Bool +OnWindowShown(void* pData, int type, void* pEvent) +{ + Ecore_X_Event_Window_Show* pEv = (Ecore_X_Event_Window_Show*) pEvent; + if (!pEv) + { + return ECORE_CALLBACK_PASS_ON; + } + + Ecore_X_Window shownWin = pEv->win; + if (shownWin == 0) + { + return ECORE_CALLBACK_PASS_ON; + } + + _ControlManager* pControlManager = _ControlManager::GetInstance(); + if (!pControlManager) + { + return ECORE_CALLBACK_PASS_ON; + } + + int winCount = pControlManager->GetWindowCount(); + + for (int i = 0; i < winCount; i++) + { + _Window* pWindow = pControlManager->GetWindow(i); + if (!pWindow) + { + continue; + } + + Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle(); + + if (win == shownWin) + { + bool orientationEnabled = pWindow->IsOrientationEnabled(); + + _EcoreEvas* pEcoreEvas = static_cast<_EcoreEvas*>(pData); + if (pEcoreEvas) + { + SysLog(NID_UI, "ROTATE SYNC: Window(0x%x) <- X(0x%x) IsOrientationEnabled = %d", pWindow, win, orientationEnabled); + pEcoreEvas->SetWindowOrientationEnabled(*pWindow, orientationEnabled); + } + } + } + + return ECORE_CALLBACK_PASS_ON; +} + void OnAutoRotationChanged(runtime_info_key_e key, void* pUserData) { @@ -306,6 +341,7 @@ OnAutoRotationChanged(runtime_info_key_e key, void* pUserData) pControlImplManager->OnScreenRotated(angle); } } + Eina_Bool OnAccessibilitySettingMessageReceived(void* pData, int type, void* pEvent) { @@ -329,7 +365,6 @@ OnAccessibilitySettingMessageReceived(void* pData, int type, void* pEvent) return ECORE_CALLBACK_PASS_ON; } -// [Accessibility] Eina_Bool OnClientMessageReceived(void* pData, int type, void* pEvent) { @@ -355,7 +390,17 @@ OnClientMessageReceived(void* pData, int type, void* pEvent) SysLog(NID_UI, "Accessibility action : Move next"); _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_FLICK_DOWN); } - else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV) + else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT) + { + SysLog(NID_UI, "Accessibility action : Move next"); + _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_FLICK_RIGHT); + } + else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV) + { + SysLog(NID_UI, "Accessibility action : Move previous"); + _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_FLICK_LEFT); + } + else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV) { SysLog(NID_UI, "Accessibility action : Move previous"); _AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_FLICK_UP); @@ -394,6 +439,8 @@ namespace { #define __UNUSED__ +Ecore_X_Atom __atomRotateAuto = 0; + enum _ClipType { _CLIP_TYPE_PRIMARY, @@ -691,9 +738,6 @@ NotifyTarget(_Clip* pClip, Ecore_X_Event_Selection_Notify* pNotify) _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); SysTryReturn(NID_UI, pEcoreEvas, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#if !defined(MULTI_WINDOW) - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas->GetEcoreEvas()); -#else _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred."); @@ -708,11 +752,9 @@ NotifyTarget(_Clip* pClip, Ecore_X_Event_Selection_Notify* pNotify) Ecore_Evas* pEE = pLayer->GetEcoreEvas(); Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEE); -#endif Ecore_X_Atom dataType = 0; char* pBuffer = null; - if (pEcoreEvas->GetSelectedCbhmItem(&dataType, &pBuffer)) { free(pBuffer); @@ -937,38 +979,21 @@ CATCH: } _EcoreEvas::_EcoreEvas(void) - : __pEvas(null) - , __pForegroundWindow(null) - , __pFrame(null) - , __pXWindowVisibility(null) - , __pClientMessageHandler(null) + : __pWindowVisibilityChanged(null) + , __pWindowPropertyChanged(null) + , __pWindowShown(null) + , __pClientMessageReceived(null) , __pClearClip(null) , __pNotifyClip(null) , __pClipboardClosed(null) - , __pWindowPropertyChanged(null) - , __pActiveWindowEvent(null) - , __count(0) - , __pRootVE(null) - , __pLayer(null) + , __pEvas(null) + , __pForegroundWindow(null) + , __pFrame(null) , __changeBounds(true) , __openClipboard(false) { -#if !defined(MULTI_WINDOW) - CreateWindow(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, __pForegroundWindow, r, "[%s] Propagating.", GetErrorMessage(r)); - - // Auto-Rotation - //int ret = 0; - - r = SetIndicatorShowState(true); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - evas_object_event_callback_add(__pForegroundWindow, EVAS_CALLBACK_DEL, OnWindowDeleted, NULL); - SysTryCatch(NID_UI, evas_alloc_error() == EVAS_ALLOC_ERROR_NONE, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - __pXWindowVisibility = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnVisibilityChanged, (void*) this); - SysTryCatch(NID_UI, __pXWindowVisibility, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); + __pWindowVisibilityChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnWindowVisibilityChanged, (void*) this); + SysTryReturnVoidResult(NID_UI, __pWindowVisibilityChanged, E_SYSTEM, "[E_SYSTEM] A system error occurred."); ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, OnClientMessageReceived, NULL); @@ -980,81 +1005,55 @@ _EcoreEvas::_EcoreEvas(void) GetEcoreEvasMgr()->SetEcoreEvas(*this); - r = InitializeAtomList(); - SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Auto-Rotation + //int ret = 0; //ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, OnAutoRotationChanged, NULL); //SysTryCatch(NID_UI, ret == 0, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - SetLastResult(E_SUCCESS); - - return; - -CATCH: - evas_object_del(__pForegroundWindow); - __pForegroundWindow = null; - - if (__pXWindowVisibility) - { - ecore_event_handler_del(__pXWindowVisibility); - __pXWindowVisibility = null; - } - - if (__pClientMessageHandler) - { - ecore_event_handler_del(__pClientMessageHandler); - __pClientMessageHandler = null; - } -#else - __pXWindowVisibility = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnVisibilityChanged, (void*) this); - SysTryReturnVoidResult(NID_UI, __pXWindowVisibility, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, OnClientMessageReceived, NULL); - - ecore_x_event_mask_set(ecore_x_window_root_first_get(), ECORE_X_EVENT_MASK_WINDOW_CONFIGURE); - ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, OnAccessibilitySettingMessageReceived, NULL); - ecore_x_event_mask_set(ecore_x_window_root_first_get(), ECORE_X_EVENT_MASK_WINDOW_PROPERTY); - - _pEvas = this; - - GetEcoreEvasMgr()->SetEcoreEvas(*this); - - // Auto-Rotation - //int ret = 0; - result r = InitializeAtomList(); SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - // Auto-Rotation - //ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, OnAutoRotationChanged, NULL); - //SysTryCatch(NID_UI, ret == 0, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); + __pWindowShown = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnWindowShown, (void*) this); + SysTryCatch(NID_UI, __pWindowShown, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + __pWindowPropertyChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, OnWindowPropertyChanged, NULL); + SysTryCatch(NID_UI, __pWindowPropertyChanged, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); SetLastResult(E_SUCCESS); return; CATCH: - if (__pXWindowVisibility) + if (__pWindowVisibilityChanged) { - ecore_event_handler_del(__pXWindowVisibility); - __pXWindowVisibility = null; + ecore_event_handler_del(__pWindowVisibilityChanged); + __pWindowVisibilityChanged = null; + } + + if (__pWindowShown) + { + ecore_event_handler_del(__pWindowShown); + __pWindowShown = null; } -#endif } _EcoreEvas::~_EcoreEvas(void) { - if (__pXWindowVisibility) + if (__pWindowVisibilityChanged) + { + ecore_event_handler_del(__pWindowVisibilityChanged); + __pWindowVisibilityChanged = null; + } + + if (__pWindowShown) { - ecore_event_handler_del(__pXWindowVisibility); - __pXWindowVisibility = null; + ecore_event_handler_del(__pWindowShown); + __pWindowShown = null; } - if (__pClientMessageHandler) + if (__pClientMessageReceived) { - ecore_event_handler_del(__pClientMessageHandler); - __pClientMessageHandler = null; + ecore_event_handler_del(__pClientMessageReceived); + __pClientMessageReceived = null; } for (int i = 0; i < _ATOM_MAX; i++) @@ -1089,112 +1088,25 @@ _EcoreEvas::~_EcoreEvas(void) __pWindowPropertyChanged = null; } - if (__pActiveWindowEvent) - { - delete __pActiveWindowEvent; - __pActiveWindowEvent = null; - } - - if(__pLayer) - { - delete __pLayer; - __pLayer = null; - } - __pRootVE = null; - - // Auto-Rotation //runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED); } void -_EcoreEvas::RotateWindow(int orientation) -{ - bool rotatePartial = false; - - if (GetFloatingMode() == true) - { - rotatePartial = true; - } - - _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Control*>(GetFrame())); - if (pFrame) - { - FrameShowMode showMode = pFrame->GetShowMode(); - if (showMode != FRAME_SHOW_MODE_FULL_SCREEN) - { - rotatePartial = true; - } - } - - int rootW = 0; - int rootH = 0; - ecore_x_window_size_get(ecore_x_window_root_get(GetXWindow()), &rootW, &rootH); - - if (rotatePartial == false) - { - ecore_evas_rotation_with_resize_set(GetEcoreEvas(), orientation); - - evas_object_move(__pForegroundWindow, 0, 0); - - if ((orientation == 0) || (orientation == 180)) - { - evas_object_resize(__pForegroundWindow, rootW, rootH); - } - else - { - evas_object_resize(__pForegroundWindow, rootH, rootW); - } - } - else - { - ecore_evas_rotation_set(GetEcoreEvas(), orientation); - - if (!pFrame) - { - return; - } - - Rectangle frameBounds = _CoordinateSystemUtils::Transform(pFrame->GetBounds()); - int rotate = ecore_evas_rotation_get(GetEcoreEvas()); - - int winX = frameBounds.x; - int winY = frameBounds.y; - - switch (rotate) - { - case 270: - winX = rootW - frameBounds.y - frameBounds.height; - winY = frameBounds.x; - break; - case 90: - winX = frameBounds.y; - winY = rootH - frameBounds.x - frameBounds.width; - break; - case 180: - winX = rootW - frameBounds.x - frameBounds.width; - winY = rootH - frameBounds.y - frameBounds.height; - break; - default: - break; - } - - evas_object_move(__pForegroundWindow, winX, winY); - evas_object_resize(__pForegroundWindow, frameBounds.width, frameBounds.height); - - SysLog(NID_UI, "The window is moved to (%d, %d) and is resized to (%d, %d) with %d degree by rotating screen." , winX, winY, frameBounds.width, frameBounds.height, rotate); - } -} - -void _EcoreEvas::RotateWindow(const _Window& window, int orientation) { _EflLayer* pLayer = GetEflLayer(window); - if (!pLayer) { return; } + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + int currentOrientation = ecore_evas_rotation_get(pEcoreEvas); + if (currentOrientation == orientation) + { + return; + } + bool rotatePartial = true; _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Window*>(&window)); @@ -1207,17 +1119,13 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation) } } -#if defined(MULTI_WINDOW) _Window* pWindow = const_cast<_Window*>(&window); if (pWindow->IsLayoutChangable() == true) { rotatePartial = false; } -#endif Evas_Object* pWinObj = pLayer->GetElmWin(); - - Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); int rootW = 0; @@ -1272,791 +1180,224 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation) } } -_EflLayer* -_EcoreEvas::GetEflLayer(const _Window& window) const +void +_EcoreEvas::SetWindowOrientationEnabled(const _Window& window, bool enable) { - _RootVisualElement* pRootVisualElement = null; - -#if !defined(MULTI_WINDOW) - if (!window.IsSystemWindow()) - { - return null; - } - - pRootVisualElement = (&window)->GetRootVisualElement(); - SysTryReturn(NID_UI, pRootVisualElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#else - pRootVisualElement = window.GetRootVisualElement(); - if (!pRootVisualElement) - { - SysLog(NID_UI, "The root visual element is null."); - return null; - } -#endif - - _EflLayer* pEflLayer = static_cast<_EflLayer*>(pRootVisualElement->GetNativeLayer()); - if (!pEflLayer) - { - SysLog(NID_UI, "The efl layer is null."); - return null; - } - - return pEflLayer; -} - -bool -_EcoreEvas::GetFloatingMode(void) const -{ - SysTryReturn(NID_UI, __pForegroundWindow, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Eina_Bool ret = elm_win_floating_mode_get(__pForegroundWindow); - - SetLastResult(E_SUCCESS); - - return (ret ? true : false); -} - -bool -_EcoreEvas::GetFloatingMode(const _Window& window) const -{ - _EflLayer* pLayer = GetEflLayer(window); - SysTryReturn(NID_UI, pLayer, false, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); - - Evas_Object* pWinObj = pLayer->GetElmWin(); - SysTryReturn(NID_UI, pWinObj, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Eina_Bool ret = elm_win_floating_mode_get(pWinObj); - - SetLastResult(E_SUCCESS); - - return (ret ? true : false); -} - -void -_EcoreEvas::AddActiveWindowEventListener(const _IActiveWindowEventListener& listener) -{ - result r = E_SUCCESS; - - if (__pActiveWindowEvent == null) - { - __pActiveWindowEvent = _ActiveWindowEvent::CreateInstanceN(); - - r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - } - - r = __pActiveWindowEvent->AddListener(listener); - SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - __count++; - - Ecore_X_Window* pRoots = null; - int num = 0; - - pRoots = ecore_x_window_root_list(&num); - - for (int i = 0; i < num; i++) - { - Display* pDisplay = XOpenDisplay(NULL); - XSelectInput(pDisplay, pRoots[i], PropertyChangeMask); - } - - if (!__pWindowPropertyChanged) - { - __pWindowPropertyChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, OnPropertyChanged, (void*) this); - SysTryReturnVoidResult(NID_UI, __pWindowPropertyChanged, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - } - - SetLastResult(E_SUCCESS); -} - -void -_EcoreEvas::RemoveActiveWindowEventListener(const _IActiveWindowEventListener& listener) -{ - SysTryReturnVoidResult(NID_UI, __pActiveWindowEvent, E_OBJ_NOT_FOUND, "The specified listener doesn't exist in the event listener list."); - - result r = __pActiveWindowEvent->RemoveListener(listener); - SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - __count--; - - if (__count == 0) - { - ecore_event_handler_del(__pWindowPropertyChanged); - __pWindowPropertyChanged = null; - } - - SetLastResult(E_SUCCESS); -} - -void -_EcoreEvas::FireActiveWindowEvent(unsigned int xid, int pid, char* pAppName) -{ - if (!__pActiveWindowEvent) + _EflLayer* pLayer = GetEflLayer(window); + if (!pLayer) { return; } - IEventArg* pArg = _ActiveWindowEvent::CreateActiveWindowEventArgN(xid, pid, pAppName); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, pArg, r, "[%s] Propagating.", GetErrorMessage(r)); - - __pActiveWindowEvent->Fire(*pArg); -} - -unsigned int -_EcoreEvas::GetActiveWindow(void) -{ - Ecore_X_Window* pRoots = null; - int num = 0; - - pRoots = ecore_x_window_root_list(&num); - Ecore_X_Atom activeAtom = ecore_x_atom_get("_NET_ACTIVE_WINDOW"); - - Ecore_X_Window activeWin = 0; - ecore_x_window_prop_window_get(pRoots[0], activeAtom, &activeWin, 1); - - free(pRoots); - - return activeWin; -} - -int -_EcoreEvas::GetProcessId(unsigned int window) -{ - int pid = 0; - Eina_Bool ret = ecore_x_netwm_pid_get(window, &pid); - - if (ret != EINA_TRUE) - { - return 0; - } - - return pid; -} - -void -_EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner) -{ - ecore_x_icccm_transient_for_unset(ownee); - ecore_x_icccm_transient_for_set(ownee, owner); -} - -void -_EcoreEvas::ActivateWindow(const _Window& window) -{ -#if !defined(MULTI_WINDOW) - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, r, "[%s] Propagating.", GetErrorMessage(r)); -#else - _EflLayer* pLayer = GetEflLayer(window); - SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); - Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#endif - - ecore_evas_activate(pEcoreEvas); -} - -void -_EcoreEvas::SetRenderBackend(_RenderBackend backend) -{ -#if defined(MULTI_WINDOW) - switch (backend) - { - case _RENDER_BACKEND_SW: - elm_config_preferred_engine_set("software_x11"); - break; - case _RENDER_BACKEND_GL: - elm_config_preferred_engine_set("opengl_x11"); - break; - case _RENDER_BACKEND_DEFAULT: - // fall through - default: - elm_config_preferred_engine_set(NULL); - break; - } -#endif -} - -_RenderBackend -_EcoreEvas::GetRenderBackend(void) -{ - _RenderBackend backend = _RENDER_BACKEND_DEFAULT; - - const char* pEngine = elm_config_preferred_engine_get(); - - if (pEngine == NULL) - { - backend = _RENDER_BACKEND_DEFAULT; - } - else if (strcmp(pEngine, "software_x11") == 0) - { - backend = _RENDER_BACKEND_SW; - } - else if (strcmp(pEngine, "opengl_x11") == 0) + if (!pEcoreEvas) { - backend = _RENDER_BACKEND_GL; + return; } - - return backend; -} - -#if !defined(MULTI_WINDOW) -result -_EcoreEvas::CopyClip(_ClipFormat format, const char* pChar) -{ - SysTryReturn(NID_UI, IsValidClipFormat(format), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The data type is invalid."); - SysTryReturn(NID_UI, pChar, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The data is invalid."); - - Ecore_X_Atom dataType = 0; - - switch (format) + + Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + if (win == 0) { - case _CLIP_FORMAT_TEXT: - dataType = ecore_x_atom_get("UTF8_STRING"); - break; - case _CLIP_FORMAT_IMAGE: - dataType = ecore_x_atom_get("text/uri"); - break; - case _CLIP_FORMAT_HTML: - dataType = ecore_x_atom_get("text/html;charset=utf-8"); - break; - default: - break; + return; } - SetCbhmItem(GetXWindow(), dataType, (char*)pChar); - - return E_SUCCESS; -} - -bool -_EcoreEvas::RetrieveClipN(int index, int* format, char** pData) -{ - Ecore_X_Atom dataType = 0; - - GetCbhmItem(index, &dataType, pData); - - if ((dataType == ecore_x_atom_get("UTF8_STRING")) || (dataType == ecore_x_atom_get("application/x-elementary-markup"))) - { - *format = _CLIP_FORMAT_TEXT; - } - else if (dataType == ecore_x_atom_get("text/uri")) - { - *format = _CLIP_FORMAT_IMAGE; - } - else if (dataType == ecore_x_atom_get("text/html;charset=utf-8")) + if (__atomRotateAuto == 0) { - *format = _CLIP_FORMAT_HTML; + __atomRotateAuto = ecore_x_atom_get(ATOM_ROTATE_AUTO); } - if (*pData == null) + unsigned int supportRotation = (unsigned int)enable; + if (enable) { - return false; - } - - return true; -} - -int -_EcoreEvas::GetClipCount(void) const -{ - int count = GetCbhmItemCount(); - - return count; -} - -void -_EcoreEvas::OpenClipboard(unsigned long clipFormats) -{ - Ecore_X_Window window = GetXWindow(); - SysLog(NID_UI, "[Clipboard] window = 0x%x", window); - - ecore_x_selection_secondary_set(window, "", 1); - - if (_CLIP_FORMAT_IMAGE & clipFormats) - { - SendCbhmMessage(window, ATOM_CBHM_CLIPBOARD_SHOW_ALL); - } - else - { - SendCbhmMessage(window, ATOM_CBHM_CLIPBOARD_SHOW); - } - - __openClipboard = true; -} - -void -_EcoreEvas::CloseClipboard(void) -{ - __openClipboard = false; - SendCbhmMessage(GetXWindow(), ATOM_CBHM_CLIPBOARD_HIDE); -} - -bool -_EcoreEvas::IsClipboardOpened(void) -{ - return __openClipboard; -} - -result -_EcoreEvas::SetEventPropagation(const _Control& control, bool enable) -{ - // Get _EflNode of a control. - _EflNode* pEflNode = dynamic_cast<_EflNode*>(control.GetVisualElement()->GetNativeNode()); - SysTryReturn(NID_UI, pEflNode, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Get a evas object. - Evas_Object* pEvasObject = (Evas_Object*) pEflNode->GetGroupContainer(); - SysTryReturn(NID_UI, pEvasObject, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Set the propagation. - evas_object_propagate_events_set(pEvasObject, (enable ? EINA_TRUE : EINA_FALSE)); - - return E_SUCCESS; -} - -result -_EcoreEvas::SetFocus(const _Control& control, bool focus) -{ - // Get _EflNode of a control. - _EflNode* pEflNode = dynamic_cast<_EflNode*>(control.GetVisualElement()->GetNativeNode()); - SysTryReturn(NID_UI, pEflNode, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Get a evas object. - Evas_Object* pEvasObject = (Evas_Object*) pEflNode->GetGroupContainer(); - SysTryReturn(NID_UI, pEvasObject, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Set the focus. - evas_object_focus_set(pEvasObject, (focus ? EINA_TRUE : EINA_FALSE)); - - return E_SUCCESS; -} - -result -_EcoreEvas::SetIndicatorShowState(bool showState) -{ - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); - - if (showState) - { - Ecore_X_Illume_Indicator_State state = ecore_x_e_illume_indicator_state_get(window); - - bool showState = true; - if (state == ECORE_X_ILLUME_INDICATOR_STATE_OFF) - { - showState = false; - } - - ecore_x_e_illume_indicator_state_set(window, ECORE_X_ILLUME_INDICATOR_STATE_ON); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - if (pTouchManager && showState == false) - { - pTouchManager->ResetTouchInfo(); - } + SysLog(NID_UI, "ROTATE SYNC: atomRotateAuto = %d, supportRotation = %d, Window(0x%x) <- X(0x%x) ON", + __atomRotateAuto, supportRotation, &window, window.GetNativeHandle()); } else { - ecore_x_e_illume_indicator_state_set(window, ECORE_X_ILLUME_INDICATOR_STATE_OFF); - } - - return E_SUCCESS; -} - -void -_EcoreEvas::SetFrame(const _Control& control) -{ - __pFrame = const_cast<_Control*>(&control); -} - -bool -_EcoreEvas::GetIndicatorShowState(void) const -{ - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); - - // Get the state. - Ecore_X_Illume_Indicator_State state = ecore_x_e_illume_indicator_state_get(window); - - // Convert. - bool showState = true; - if (state == ECORE_X_ILLUME_INDICATOR_STATE_ON) - { - showState = true; + SysLog(NID_UI, "ROTATE SYNC: atomRotateAuto = %d, supportRotation = %d, Window(0x%x) <- X(0x%x) OFF", + __atomRotateAuto, supportRotation, &window, window.GetNativeHandle()); } - else if (state == ECORE_X_ILLUME_INDICATOR_STATE_OFF) - { - showState = false; - } - - return showState; -} - -Rectangle -_EcoreEvas::GetIndicatorBounds(void) const -{ - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, Rectangle(0, 0, 0, 0), E_SYSTEM, "[E_SYSTEM] A system error occurred."); - // Get a root window. - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); - Ecore_X_Window rootWindow = (Ecore_X_Window) ecore_x_window_root_get(window); - - // Get the bounds of a indicator. - int x = 0; - int y = 0; - int width = 0; - int height = 0; - bool ret = false; - ret = ecore_x_e_illume_indicator_geometry_get(rootWindow, &x, &y, &width, &height); - SysTryReturn(NID_UI, ret == true, Rectangle(0, 0, 0, 0), E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - SetLastResult(E_SUCCESS); - - return Rectangle(x, y, width, height); + ecore_x_window_prop_card32_set(win, __atomRotateAuto, &supportRotation, 1); } -result -_EcoreEvas::SetIndicatorOpacity(_IndicatorOpacity opacity) +_EflLayer* +_EcoreEvas::GetEflLayer(const _Window& window) const { - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + _RootVisualElement* pRootVisualElement = null; - // Convert. - Ecore_X_Illume_Indicator_Opacity_Mode mode = ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN; - switch (opacity) + pRootVisualElement = window.GetRootVisualElement(); + if (!pRootVisualElement) { - case _INDICATOR_OPACITY_UNKNOWN: - mode = ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN; - break; - case _INDICATOR_OPACITY_OPAQUE: - mode = ECORE_X_ILLUME_INDICATOR_OPAQUE; - break; - case _INDICATOR_OPACITY_TRANSLUCENT: - mode = ECORE_X_ILLUME_INDICATOR_TRANSLUCENT; - break; - case _INDICATOR_OPACITY_TRANSPARENT: - mode = ECORE_X_ILLUME_INDICATOR_TRANSPARENT; - break; - default: - SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] The specified data is not valid."); - return E_INVALID_ARG; + SysLog(NID_UI, "The root visual element is null."); + return null; } - // Set the opacity of a indicator. - ecore_x_e_illume_indicator_opacity_set(window, mode); - - return E_SUCCESS; -} - -_IndicatorOpacity -_EcoreEvas::GetIndicatorOpacity(void) const -{ - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, _INDICATOR_OPACITY_UNKNOWN, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Get the opacity of a indicator. - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); - Ecore_X_Illume_Indicator_Opacity_Mode mode = ecore_x_e_illume_indicator_opacity_get(window); - - // Convert. - _IndicatorOpacity opacity = _INDICATOR_OPACITY_UNKNOWN; - switch (mode) + _EflLayer* pEflLayer = static_cast<_EflLayer*>(pRootVisualElement->GetNativeLayer()); + if (!pEflLayer) { - case ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN: - opacity = _INDICATOR_OPACITY_UNKNOWN; - break; - case ECORE_X_ILLUME_INDICATOR_OPAQUE: - opacity = _INDICATOR_OPACITY_OPAQUE; - break; - case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT: - opacity = _INDICATOR_OPACITY_TRANSLUCENT; - break; - case ECORE_X_ILLUME_INDICATOR_TRANSPARENT: - opacity = _INDICATOR_OPACITY_TRANSPARENT; - break; - default: - SysLogException(NID_UI, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - return _INDICATOR_OPACITY_UNKNOWN; + SysLog(NID_UI, "The efl layer is null."); + return null; } - SetLastResult(E_SUCCESS); - - return opacity; -} - -result -_EcoreEvas::SetFloatingMode(bool enable) -{ - SysTryReturn(NID_UI, __pForegroundWindow, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - elm_win_floating_mode_set(__pForegroundWindow, (enable ? EINA_TRUE : EINA_FALSE)); - - return E_SUCCESS; -} - -Evas* -_EcoreEvas::GetEvas(void) const -{ - return __pEvas; -} - -Ecore_Evas* -_EcoreEvas::GetEcoreEvas(void) const -{ - Ecore_Evas* pEcoreEvas = ecore_evas_ecore_evas_get(__pEvas); - SysTryReturn(NID_UI, pEcoreEvas, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - SetLastResult(E_SUCCESS); - - return pEcoreEvas; -} - -Evas_Object* -_EcoreEvas::GetWindowObject(void) const -{ - return __pForegroundWindow; + return pEflLayer; } -Ecore_X_Window -_EcoreEvas::GetXWindow(void) const +bool +_EcoreEvas::GetFloatingMode(void) const { - Ecore_Evas* pEcore_Evas = GetEcoreEvas(); - result r = GetLastResult(); - SysTryReturn(NID_UI, pEcore_Evas, 0, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI, __pForegroundWindow, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(pEcore_Evas); + Eina_Bool ret = elm_win_floating_mode_get(__pForegroundWindow); SetLastResult(E_SUCCESS); - return window; -} - -void -_EcoreEvas::AllowSetWindowBounds(bool allow) -{ - __changeBounds = allow; -} - -void -_EcoreEvas::SetWindowLevel(_WindowLevel level) -{ - Ecore_X_Window window = GetXWindow(); - SysTryReturnVoidResult(NID_UI, window != 0, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - if (level == _WINDOW_LEVEL_NORMAL) - { - ecore_x_netwm_window_type_set(window, ECORE_X_WINDOW_TYPE_NORMAL); - } - else if (level == _WINDOW_LEVEL_NOTIFICATION_HIGH) - { - ecore_x_netwm_window_type_set(window, ECORE_X_WINDOW_TYPE_NOTIFICATION); - utilx_set_system_notification_level((Display*)ecore_x_display_get(), window, UTILX_NOTIFICATION_LEVEL_HIGH); - } - else if (level == _WINDOW_LEVEL_NOTIFICATION_MIDDLE) - { - ecore_x_netwm_window_type_set(window, ECORE_X_WINDOW_TYPE_NOTIFICATION); - utilx_set_system_notification_level((Display*)ecore_x_display_get(), window, UTILX_NOTIFICATION_LEVEL_NORMAL); - } - - SetLastResult(E_SUCCESS); + return (ret ? true : false); } -_WindowLevel -_EcoreEvas::GetWindowLevel(void) const +// [ToDo] Remove API +bool +_EcoreEvas::GetFloatingMode(const _Window& window) const { - Ecore_X_Window window = GetXWindow(); - SysTryReturn(NID_UI, window != 0, _WINDOW_LEVEL_UNKNOWN, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_X_Window_Type type = ECORE_X_WINDOW_TYPE_UNKNOWN; - ecore_x_netwm_window_type_get(window, &type); + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturn(NID_UI, pLayer, false, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); - _WindowLevel winLevel = _WINDOW_LEVEL_UNKNOWN; - if (type == ECORE_X_WINDOW_TYPE_NORMAL) - { - winLevel = _WINDOW_LEVEL_NORMAL; - } - else if (type == ECORE_X_WINDOW_TYPE_NOTIFICATION) - { - Utilx_Notification_Level notificationLevel = utilx_get_system_notification_level((Display*)ecore_x_display_get(), window); + Evas_Object* pWinObj = pLayer->GetElmWin(); + SysTryReturn(NID_UI, pWinObj, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - if (notificationLevel == UTILX_NOTIFICATION_LEVEL_HIGH) - { - winLevel = _WINDOW_LEVEL_NOTIFICATION_HIGH; - } - else if (notificationLevel == UTILX_NOTIFICATION_LEVEL_NORMAL) - { - winLevel = _WINDOW_LEVEL_NOTIFICATION_MIDDLE; - } - } + Eina_Bool ret = elm_win_floating_mode_get(pWinObj); SetLastResult(E_SUCCESS); - return winLevel; + return (ret ? true : false); } +// [ToDo] Remove API void -_EcoreEvas::SetWindowAlwaysOnTop(bool alwaysOnTop) +_EcoreEvas::AddActiveWindowEventListener(const _IActiveWindowEventListener& listener) { - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (alwaysOnTop == true) - { - ecore_evas_layer_set(pEcoreEvas, 5); - } - else - { - ecore_evas_layer_set(pEcoreEvas, 4); - } } +// [ToDo] Remove API void -_EcoreEvas::SetWindowAlwaysAtBottom(bool alwaysAtBottom) +_EcoreEvas::RemoveActiveWindowEventListener(const _IActiveWindowEventListener& listener) { - Ecore_Evas* pEcoreEvas = GetEcoreEvas(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (alwaysAtBottom == true) - { - ecore_evas_layer_set(pEcoreEvas, 3); - } - else - { - ecore_evas_layer_set(pEcoreEvas, 4); - } } -void -_EcoreEvas::SetWindowBounds(const Rectangle& bounds) +unsigned int +_EcoreEvas::GetActiveWindow(void) { - if (__changeBounds == false) - { - return; - } + Ecore_X_Window* pRoots = null; + int num = 0; - // Decide between full and partial. - bool partialScreen = false; + pRoots = ecore_x_window_root_list(&num); + Ecore_X_Atom activeAtom = ecore_x_atom_get("_NET_ACTIVE_WINDOW"); - if (GetFloatingMode() == true) - { - partialScreen = true; - } + Ecore_X_Window activeWin = 0; + ecore_x_window_prop_window_get(pRoots[0], activeAtom, &activeWin, 1); - _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Control*>(GetFrame())); - if (pFrame) - { - FrameShowMode showMode = pFrame->GetShowMode(); - if (showMode != FRAME_SHOW_MODE_FULL_SCREEN) - { - partialScreen = true; - } - } + free(pRoots); - int rootW = 0; - int rootH = 0; - ecore_x_window_size_get(ecore_x_window_root_get(GetXWindow()), &rootW, &rootH); + return activeWin; +} - int rotate = ecore_evas_rotation_get(GetEcoreEvas()); +int +_EcoreEvas::GetProcessId(unsigned int window) +{ + int pid = 0; + Eina_Bool ret = ecore_x_netwm_pid_get(window, &pid); - if (partialScreen == false) + if (ret != EINA_TRUE) { - // Resize full screen. - evas_object_move(__pForegroundWindow, 0, 0); - - if ((rotate == 0) || (rotate == 180)) - { - evas_object_resize(__pForegroundWindow, rootW, rootH); - } - else - { - evas_object_resize(__pForegroundWindow, rootH, rootW); - } + return 0; } - else - { - // Resize partial screen. - Evas_Object* pWinObject = GetWindowObject(); - SysTryReturnVoidResult(NID_UI, pWinObject, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - Rectangle winBounds = _CoordinateSystemUtils::Transform(bounds); + return pid; +} - int winX = winBounds.x; - int winY = winBounds.y; +void +_EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner) +{ + ecore_x_icccm_transient_for_unset(ownee); + ecore_x_icccm_transient_for_set(ownee, owner); +} - switch (rotate) - { - case 270: - winX = rootW - winBounds.y - winBounds.height; - winY = winBounds.x; - break; - case 90: - winX = winBounds.y; - winY = rootH - winBounds.x - winBounds.width; - break; - case 180: - winX = rootW - winBounds.x - winBounds.width; - winY = rootH - winBounds.y - winBounds.height; - break; - default: - break; - } +void +_EcoreEvas::ActivateWindow(const _Window& window) +{ + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); - evas_object_move(pWinObject, winX, winY); - evas_object_resize(pWinObject, winBounds.width, winBounds.height); + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - //SysLog(NID_UI, "The window is moved to (%d, %d) and is resized to (%d, %d) with %d degree by setting bounds." , winX, winY, winBounds.width, winBounds.height, rotate); - } + ecore_evas_activate(pEcoreEvas); - // [SLP] - Rectangle rectangle = GetIndicatorBounds(); + NativeWindowHandle currentWindow = window.GetNativeHandle(); + unsigned int activeWindow = GetActiveWindow(); + int pid = GetProcessId(activeWindow); + SysLog(NID_UI, "currentWindow = 0x%x, activeWindow = 0x%x, pid = %d", currentWindow, activeWindow, pid); SetLastResult(E_SUCCESS); } void -_EcoreEvas::SetWindowVisibleState(bool visibleState) +_EcoreEvas::MinimizeWindow(_Window& window) { - Evas_Object* pWindowObject = GetWindowObject(); - SysTryReturnVoidResult(NID_UI, pWindowObject, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); - if (visibleState) - { - evas_object_show(pWindowObject); - } - else - { - evas_object_hide(pWindowObject); - } + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + //ecore_evas_lower(pEcoreEvas); + ecore_evas_iconified_set(pEcoreEvas, EINA_TRUE); SetLastResult(E_SUCCESS); } -const _Control* -_EcoreEvas::GetFrame(void) const +void +_EcoreEvas::SetRenderBackend(_RenderBackend backend) { - return __pFrame; + switch (backend) + { + case _RENDER_BACKEND_SW: + elm_config_preferred_engine_set("software_x11"); + break; + case _RENDER_BACKEND_GL: + elm_config_preferred_engine_set("opengl_x11"); + break; + case _RENDER_BACKEND_DEFAULT: + // fall through + default: + elm_config_preferred_engine_set(NULL); + break; + } } -_RootVisualElement* -_EcoreEvas::GetRootVisualElement(void)const +_RenderBackend +_EcoreEvas::GetRenderBackend(void) { - return __pRootVE; + _RenderBackend backend = _RENDER_BACKEND_DEFAULT; + + const char* pEngine = elm_config_preferred_engine_get(); + + if (pEngine == NULL) + { + backend = _RENDER_BACKEND_DEFAULT; + } + else if (strcmp(pEngine, "software_x11") == 0) + { + backend = _RENDER_BACKEND_SW; + } + else if (strcmp(pEngine, "opengl_x11") == 0) + { + backend = _RENDER_BACKEND_GL; + } + + return backend; } -#else + result _EcoreEvas::CopyClip(_ClipFormat format, const char* pChar) { @@ -2307,6 +1648,7 @@ _EcoreEvas::GetIndicatorShowState(const _Window& window) const return showState; } +// [ToDo] Remove API Rectangle _EcoreEvas::GetIndicatorBounds(const _Window& window) const { @@ -2333,6 +1675,7 @@ _EcoreEvas::GetIndicatorBounds(const _Window& window) const return Rectangle(x, y, width, height); } +// [ToDo] Remove API result _EcoreEvas::SetIndicatorOpacity(const _Window& window, _IndicatorOpacity opacity) { @@ -2369,6 +1712,7 @@ _EcoreEvas::SetIndicatorOpacity(const _Window& window, _IndicatorOpacity opacity return E_SUCCESS; } +// [ToDo] Remove API _IndicatorOpacity _EcoreEvas::GetIndicatorOpacity(const _Window& window) const { @@ -2467,6 +1811,7 @@ _EcoreEvas::SetFloatingMode(const _Window& window, bool enable) return E_SUCCESS; } +// [ToDo] Remove API Evas* _EcoreEvas::GetEvas(void) const { @@ -2486,6 +1831,7 @@ _EcoreEvas::GetEvas(void) const return pLayer->GetEvas(); } +// [ToDo] Remove API Ecore_Evas* _EcoreEvas::GetEcoreEvas(void) const { @@ -2505,6 +1851,7 @@ _EcoreEvas::GetEcoreEvas(void) const return pLayer->GetEcoreEvas(); } +// [ToDo] Remove API Evas_Object* _EcoreEvas::GetWindowObject(void) const { @@ -2524,6 +1871,7 @@ _EcoreEvas::GetWindowObject(void) const return pLayer->GetElmWin(); } +// [ToDo] Remove API Ecore_X_Window _EcoreEvas::GetXWindow(void) const { @@ -2551,6 +1899,80 @@ _EcoreEvas::AllowSetWindowBounds(bool allow) __changeBounds = allow; } +bool +_EcoreEvas::IsWindowVisible(const _Window& window) +{ + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturn(NID_UI, pLayer, false, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); + + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + + int ret = ecore_x_window_visible_get(win); + if (ret == 1) + { + return true; + } + else + { + return false; + } +} + +void +_EcoreEvas::SetQuickPanelScrollEnabled(const _Window& window, bool enable) +{ + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); + + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + Ecore_X_Atom atomPanelScrollable = ecore_x_atom_get("_E_MOVE_PANEL_SCROLLABLE_STATE"); + + unsigned int val[3]; + ecore_x_window_prop_card32_get(win, atomPanelScrollable, val, 3); + + if (enable) + { + val[1] = 1; + } + else + { + val[1] = 0; + } + + ecore_x_window_prop_card32_set(win, atomPanelScrollable, val, 3); +} + +bool +_EcoreEvas::IsQuickPanelScrollEnabled(const _Window& window) +{ + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturn(NID_UI, pLayer, false, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); + + Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, false, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + Ecore_X_Atom atomPanelScrollable = ecore_x_atom_get("_E_MOVE_PANEL_SCROLLABLE_STATE"); + + unsigned int val[3]; + ecore_x_window_prop_card32_get(win, atomPanelScrollable, val, 3); + + if (val[1] == 0) + { + return false; + } + else + { + return true; + } +} + void _EcoreEvas::SetWindowLevel(const _Window& window, _WindowLevel level) { @@ -2561,6 +1983,7 @@ _EcoreEvas::SetWindowLevel(const _Window& window, _WindowLevel level) SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); + ecore_x_icccm_transient_for_unset(win); if (level == _WINDOW_LEVEL_NORMAL) { @@ -2669,7 +2092,7 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds) SysLog(NID_UI, "The window is moved to (%d, %d) and is resized to (%d, %d) with %d degree by setting bounds." , winX, winY, winBounds.width, winBounds.height, rotate); // [SLP] - Rectangle rectangle = GetIndicatorBounds(window); + //Rectangle rectangle = GetIndicatorBounds(window); SetLastResult(E_SUCCESS); } @@ -2685,15 +2108,6 @@ _EcoreEvas::SetWindowVisibleState(const _Window& window, bool visibleState) pLayer->SetShowState(visibleState); -// if (visibleState) -// { -// evas_object_show(pWinObj); -// } -// else -// { -// evas_object_hide(pWinObj); -// } - SetLastResult(E_SUCCESS); } @@ -2734,6 +2148,7 @@ _EcoreEvas::GetWindowRotation(const _Window& window) return rotation; } +// [ToDo] Remove API const _Control* _EcoreEvas::GetFrame(void) const { @@ -2741,20 +2156,21 @@ _EcoreEvas::GetFrame(void) const return __pFrame; } +// [ToDo] Remove API _RootVisualElement* _EcoreEvas::GetRootVisualElement(void)const { SysLog(NID_UI, "Do not use."); - return __pRootVE; + return null; } +// [ToDo] Remove API void _EcoreEvas::SetFrame(const _Control& control) { SysLog(NID_UI, "Do not use."); __pFrame = const_cast<_Control*>(&control); } -#endif bool _EcoreEvas::GetSelectedCbhmItem(Ecore_X_Atom* pDataType, char** pBuffer) const @@ -2792,6 +2208,7 @@ _EcoreEvas::GetSelectedCbhmItem(Ecore_X_Atom* pDataType, char** pBuffer) const return false; } + bool _EcoreEvas::IsAccessibilityScreenReaderActivated(void) { @@ -2834,60 +2251,6 @@ void* _GetEvasHandle(void) } result -_EcoreEvas::CreateWindow(void) -{ - // Create a win object. - _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); - SysTryReturn(NID_UI, pDisplayManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - __pLayer = _NativeLayer::CreateInstanceN(); - SysTryReturn(NID_UI, __pLayer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - __pRootVE = __pLayer->GetRootVisualElement(); - - SysTryReturn(NID_UI, __pRootVE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - _EflLayer* pLayer = static_cast<_EflLayer*>(__pRootVE->GetNativeLayer()); - SysTryReturn(NID_UI, pLayer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - __pForegroundWindow = pLayer->GetElmWin(); - - int width = 0; - int height = 0; - Ecore_Evas* pEcoreEvas = null; - Ecore_X_Window window = 0; - - // Get the evas. - Evas* pEvas = pLayer->GetEvas(); - SysTryCatch(NID_UI, pEvas, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - // Get the ecore evas. - pEcoreEvas = pLayer->GetEcoreEvas(); - SysTryCatch(NID_UI, pEcoreEvas, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - window = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); - SysTryCatch(NID_UI, window != 0, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - __pEvas = pEvas; - - // Set properties. - ecore_x_window_size_get(ecore_x_window_root_get(window), &width, &height); - - pLayer->SetBounds(FloatRectangle(0.0f, 0.0f, (float)width, (float)height)); - __pRootVE->SetBounds(FloatRectangle(0.0f, 0.0f, (float)width, (float)height)); - - _CanvasImpl::SetFrameInfoCallback(_GetEcoreEvasHandle, _GetEvasHandle); - - SetLastResult(E_SUCCESS); - - return E_SUCCESS; - -CATCH: - evas_object_del(__pForegroundWindow); - - return E_SYSTEM; -} - -result _EcoreEvas::InitializeAtomList(void) { __atomList[_ATOM_TARGETS].pName = "TARGETS"; @@ -3377,24 +2740,28 @@ extern "C" { #endif +// [ToDo] Remove API _OSP_EXPORT_ void _AddActiveWindowEventListener(const _IActiveWindowEventListener& listener) { GetEcoreEvasMgr()->GetEcoreEvas()->AddActiveWindowEventListener(listener); } +// [ToDo] Remove API _OSP_EXPORT_ void _RemoveActiveWindowEventListener(const _IActiveWindowEventListener& listener) { GetEcoreEvasMgr()->GetEcoreEvas()->RemoveActiveWindowEventListener(listener); } +// [ToDo] Remove API _OSP_EXPORT_ unsigned int _GetActiveWindow(void) { return GetEcoreEvasMgr()->GetEcoreEvas()->GetActiveWindow(); } +// [ToDo] Remove API _OSP_EXPORT_ int _GetProcessId(unsigned int window) { diff --git a/src/ui/FUi_EcoreEvasMgr.cpp b/src/ui/FUi_EcoreEvasMgr.cpp index 83ad130..595509f 100644 --- a/src/ui/FUi_EcoreEvasMgr.cpp +++ b/src/ui/FUi_EcoreEvasMgr.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EcoreEvasMgr.cpp * @brief This is the implementation file for the _EcoreEvasMgr class. */ + #include #include #include diff --git a/src/ui/FUi_EflUiEventManager.cpp b/src/ui/FUi_EflUiEventManager.cpp index c03dc81..4863564 100644 --- a/src/ui/FUi_EflUiEventManager.cpp +++ b/src/ui/FUi_EflUiEventManager.cpp @@ -44,10 +44,8 @@ #include "FUi_TouchManager.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_ControlVisualElement.h" -#if defined(MULTI_WINDOW) #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_EflLayer.h" -#endif using namespace std; using namespace Tizen::Ui; @@ -130,77 +128,112 @@ struct _EvasConvertKeys const _EvasConvertKeys keyTable[] = { - { _KEY_SIDE_UP, "XF86AudioRaiseVolume" }, - { _KEY_SIDE_DOWN, "XF86AudioLowerVolume" }, - { _KEY_END, "XF86Stop" }, - { _KEY_ENTER, "Return" }, + { _KEY_ESC, "Escape" }, + { _KEY_GRAVE, "grave" }, + { _KEY_1, "1" }, + { _KEY_2, "2" }, + { _KEY_3, "3" }, + { _KEY_4, "4" }, + { _KEY_5, "5" }, + { _KEY_6, "6" }, + { _KEY_7, "7" }, + { _KEY_8, "8" }, + { _KEY_9, "9" }, + { _KEY_0, "0" }, + { _KEY_MINUS, "minus" }, + { _KEY_EQUAL, "equal" }, + { _KEY_BACKSLASH, "backslash" }, { _KEY_BACKSPACE, "BackSpace" }, - { _KEY_NUM_LEFT, "KP_Left"}, - { _KEY_NUM_UP, "KP_Up"}, - { _KEY_NUM_DOWN, "KP_Down"}, - { _KEY_NUM_RIGHT, "KP_Right"}, + { _KEY_TAB, "Tab" }, + { _KEY_Q, "q" }, + { _KEY_W, "w" }, + { _KEY_E, "e" }, + { _KEY_R, "r" }, + { _KEY_T, "t" }, + { _KEY_Y, "y" }, + { _KEY_U, "u" }, + { _KEY_I, "i" }, + { _KEY_O, "o" }, + { _KEY_P, "p" }, + { _KEY_LBRACKET, "bracketleft" }, + { _KEY_RBRACKET, "bracketright" }, + { _KEY_ENTER, "Return" }, + { _KEY_CAPSLOCK, "Caps_Lock" }, + { _KEY_A, "a" }, + { _KEY_S, "s" }, + { _KEY_D, "d" }, + { _KEY_F, "f" }, + { _KEY_G, "g" }, + { _KEY_H, "h" }, + { _KEY_J, "j" }, + { _KEY_K, "k" }, + { _KEY_L, "l" }, + { _KEY_SEMICOLON, "semicolon" }, + { _KEY_APOSTROPHE, "apostrophe" }, + { _KEY_SHIFT_L, "Shift_L" }, + { _KEY_Z, "z" }, + { _KEY_X, "x" }, + { _KEY_C, "c" }, + { _KEY_V, "v" }, + { _KEY_B, "b" }, + { _KEY_N, "n" }, + { _KEY_M, "m" }, + { _KEY_COMMA, "comma" }, + { _KEY_DOT, "period" }, + { _KEY_SLASH, "slash" }, + { _KEY_SHIFT_R, "Shift_R" }, + { _KEY_CTRL_L, "Control_L" }, + { _KEY_LALT, "Alt_L" }, + { _KEY_SPACE, "space" }, + { _KEY_RALT, "Alt_R" }, + { _KEY_CTRL_R, "Control_R" }, + { _KEY_FN_1, "F1" }, + { _KEY_FN_2, "F2" }, + { _KEY_FN_3, "F3" }, + { _KEY_FN_4, "F4" }, + { _KEY_FN_5, "F5" }, + { _KEY_FN_6, "F6" }, + { _KEY_FN_7, "F7" }, + { _KEY_FN_8, "F8" }, + { _KEY_FN_9, "F9" }, + { _KEY_FN_10, "F10" }, + { _KEY_FN_11, "F11" }, + { _KEY_FN_12, "F12" }, + { _KEY_NUM_LOCK, "Num_Lock" }, + { _KEY_NUMPAD_DIVIDE, "KP_Divide" }, + { _KEY_NUMPAD_MULTIPLY, "KP_Multiply" }, + { _KEY_NUMPAD_SUBTRACT, "KP_Subtract" }, + { _KEY_NUMPAD_7, "KP_Home" }, + { _KEY_NUMPAD_8, "KP_Up" }, + { _KEY_NUMPAD_9, "KP_Prior" }, + { _KEY_NUMPAD_4, "KP_Left" }, + { _KEY_NUMPAD_5, "KP_Begin" }, + { _KEY_NUMPAD_6, "KP_Right" }, + { _KEY_NUMPAD_ADD, "KP_Add" }, + { _KEY_NUMPAD_1, "KP_End" }, + { _KEY_NUMPAD_2, "KP_Down" }, + { _KEY_NUMPAD_3, "KP_Next" }, + { _KEY_NUMPAD_0, "KP_Insert" }, + { _KEY_NUMPAD_DOT, "KP_Delete" }, + { _KEY_NUMPAD_ENTER, "KP_Enter" }, + { _KEY_PRINT, "Print" }, + { _KEY_SCROLL_LOCK, "Scroll_Lock" }, + { _KEY_PAUSEBREAK, "Pause" }, + { _KEY_INSERT, "Insert" }, + { _KEY_HOME_BUTTON, "Home" }, + { _KEY_PAGE_UP, "Prior" }, + { _KEY_DELETE, "Delete" }, + { _KEY_END_BUTTON, "End" }, + { _KEY_PAGE_DOWN, "Next" }, + { _KEY_UP, "Up" }, { _KEY_LEFT, "Left" }, - { _KEY_UP, "Up"}, - { _KEY_DOWN, "Down"}, - { _KEY_RIGHT, "Right"}, - { _KEY_0, "0"}, - { _KEY_1, "1"}, - { _KEY_2, "2"}, - { _KEY_3, "3"}, - { _KEY_4, "4"}, - { _KEY_5, "5"}, - { _KEY_6, "6"}, - { _KEY_7, "7"}, - { _KEY_8, "8"}, - { _KEY_9, "9"}, - { _KEY_A, "a"}, - { _KEY_B, "b"}, - { _KEY_C, "c"}, - { _KEY_D, "d"}, - { _KEY_E, "e"}, - { _KEY_F, "f"}, - { _KEY_G, "g"}, - { _KEY_H, "h"}, - { _KEY_I, "i"}, - { _KEY_J, "j"}, - { _KEY_K, "k"}, - { _KEY_L, "l"}, - { _KEY_M, "m"}, - { _KEY_N, "n"}, - { _KEY_O, "o"}, - { _KEY_P, "p"}, - { _KEY_Q, "q"}, - { _KEY_R, "r"}, - { _KEY_S, "s"}, - { _KEY_T, "t"}, - { _KEY_U, "u"}, - { _KEY_V, "v"}, - { _KEY_W, "w"}, - { _KEY_X, "x"}, - { _KEY_Y, "y"}, - { _KEY_Z, "z"}, - { _KEY_COMMA, "comma"}, - { _KEY_CAPSLOCK, "Caps_Lock"}, - { _KEY_ALT, "Alt_L"}, - { _KEY_ALT, "Alt_R"}, - { _KEY_SPACE, "space"}, - { _KEY_FN_1, "F1"}, - { _KEY_FN_2, "F2"}, - { _KEY_FN_3, "F3"}, - { _KEY_FN_4, "F4"}, - { _KEY_FN_5, "F5"}, - { _KEY_CLEAR, "BackSpace"}, - { _KEY_POWER_HOLD, "XF86PowerOff"}, - { _KEY_DELETE, "Delete"}, - { _KEY_DELETE, "KP_Delete"}, - { _KEY_CTRL_L, "XK_Control_L"}, - { _KEY_CTRL_L, "Control_L"}, - { _KEY_CTRL_R, "XK_Control_R"}, - { _KEY_CTRL_R, "Control_R"}, - { _KEY_SHIFT_L, "XK_Shift_L"}, - { _KEY_SHIFT_L, "Shift_L"}, - { _KEY_SHIFT_R, "XK_Shift_R"}, - { _KEY_SHIFT_R, "Shift_R"}, + { _KEY_DOWN, "Down" }, + { _KEY_RIGHT, "Right" }, + + //{ _KEY_SIDE_UP, "XF86AudioRaiseVolume" }, + //{ _KEY_SIDE_DOWN, "XF86AudioLowerVolume" }, + //{ _KEY_POWER_HOLD, "XF86PowerOff" }, + { _KEY_STOP, "XF86Stop" } }; class _KeyEvent @@ -479,9 +512,7 @@ public: if (!pRootControl) { r = GetPosition(status, x, y, current); -#if defined(MULTI_WINDOW) SysTryReturnVoidResult(NID_UI, r != E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] A system error occurred."); -#endif SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred."); } else @@ -509,14 +540,14 @@ public: } else { - _Control* pControl = GetTarget(current.x, current.y, pRootControl); + _Control* pControl = pTouchManager->GetChangedTouchableTarget(); if (pControl == null) { ClearLastResult(); } else { - if (pControl != null && pControl->GetChangingEventTarget() == true) + if (pControl->GetChangingEventTarget() == true && pControl->GetVisibleState() == true) { r = __pTouchEventManager->AddControl(pointId, pControl->GetHandle()); SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred."); @@ -596,11 +627,7 @@ private: else { _Window* pWindow = null; -#if !defined(MULTI_WINDOW) - pWindow = pControlManager->GetCurrentFrame(); -#else pWindow = pControlManager->GetTouchedWindow(); -#endif SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); Rectangle winBounds = pWindow->GetBounds(); @@ -608,11 +635,7 @@ private: ptf.x = static_cast(x - winBounds.x); ptf.y = static_cast(y - winBounds.y); -#if !defined(MULTI_WINDOW) - pRootControlElement = dynamic_cast <_ControlVisualElement*>(pControlManager->GetRoot().GetVisualElement()); -#else pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement()); -#endif } SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); @@ -633,16 +656,6 @@ private: _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#if !defined(MULTI_WINDOW) - _EcoreEvasMgr* pEcoreEvasMgr = GetEcoreEvasMgr(); - SysTryReturn(NID_UI, pEcoreEvasMgr, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - _EcoreEvas* pEcoreEvas = pEcoreEvasMgr->GetEcoreEvas(); - SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - Ecore_Evas* pEE = pEcoreEvas->GetEcoreEvas(); - SysTryReturn(NID_UI, pEE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#else _Window* pWindow = pControlManager->GetTouchedWindow(); SysTryReturn(NID_UI, pWindow, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] A system error occurred."); @@ -654,7 +667,6 @@ private: Ecore_Evas* pEE = pLayer->GetEcoreEvas(); SysTryReturn(NID_UI, pEE, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#endif const int PORTRAIT = 0; const int LANDSCAPE = 270; @@ -739,6 +751,7 @@ OnKeyPressed(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) //SysLog(NID_UI, "OnKeyPressed(%s, %d)", pEv->keyname, pEv->modifiers); _KeyEvent event(KEY_PRESSED, _KeyEvent::GetKeyCode(pEv->keyname), _KeyEvent::GetKeyModifier(pEv->modifiers), pEv); + SysLog(NID_UI, "KeyName = %s, KeyCode = %d, KeyModifier = %x", pEv->keyname, _KeyEvent::GetKeyCode(pEv->keyname), _KeyEvent::GetKeyModifier(pEv->modifiers)); event.Send(); SetLastResult(E_SUCCESS); @@ -754,6 +767,7 @@ OnKeyReleased(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) //SysLog(NID_UI, "OnKeyReleased(%s, %d)", pEv->keyname, pEv->modifiers); _KeyEvent event(KEY_RELEASED, _KeyEvent::GetKeyCode(pEv->keyname), _KeyEvent::GetKeyModifier(pEv->modifiers), pEv); + SysLog(NID_UI, "KeyName = %s, KeyCode = %d, KeyModifier = %x", pEv->keyname, _KeyEvent::GetKeyCode(pEv->keyname), _KeyEvent::GetKeyModifier(pEv->modifiers)); event.Send(); SetLastResult(E_SUCCESS); @@ -767,12 +781,10 @@ OnTouchPressed(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) Ecore_Event_Mouse_Button* pEv = static_cast (pEventInfo); SysTryReturn(NID_UI, pEv, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); -#if defined(MULTI_WINDOW) _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred."); pControlManager->SetTouchedWindow((unsigned int)pEv->window); -#endif isPressed = true; @@ -827,7 +839,7 @@ OnTouchMoved(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) Ecore_Event_Mouse_Move* pEv = static_cast (pEventInfo); SysTryReturn(NID_UI, pEv, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); - //SysLog(NID_UI, "OnTouchMoved - x(%d), y(%d), deviceId(%d)", pEv->root.x, pEv->root.y, pEv->multi.device); + SysLog(NID_UI, "OnTouchMoved - x(%d), y(%d), deviceId(%d)", pEv->root.x, pEv->root.y, pEv->multi.device); _TouchEvent event(pEv->multi.device, _TOUCH_MOVED, pEv->root.x, pEv->root.y, pEv->timestamp, null); result r = GetLastResult(); @@ -927,14 +939,6 @@ OnWindowFocusIn(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) _Window* pWindow = pControlManager->GetWindow(i); if (pWindow) { -#if !defined(MULTI_WINDOW) - pFocusedControl = pWindow->GetFocused(); - if (pFocusedControl) - { - pFocusedControl->SetFocused(); - break; - } -#else NativeWindowHandle nativeWindowHandle = pWindow->GetNativeHandle(); if (pEv->win == nativeWindowHandle) { @@ -945,7 +949,6 @@ OnWindowFocusIn(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) break; } } -#endif } } @@ -963,13 +966,6 @@ OnWindowFocusOut(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#if !defined(MULTI_WINDOW) - _Control* pFocusedControl = pControlManager->GetFocusedControl(); - if (pFocusedControl) - { - pControlManager->TakeFocusFromControl(*pFocusedControl); - } -#else _Control* pFocusedControl = pControlManager->GetFocusedControl(); if (pFocusedControl) { @@ -983,7 +979,6 @@ OnWindowFocusOut(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo) } } } -#endif return ECORE_CALLBACK_PASS_ON; } diff --git a/src/ui/FUi_EflUiEventManager.h b/src/ui/FUi_EflUiEventManager.h index 9d56af7..382678a 100644 --- a/src/ui/FUi_EflUiEventManager.h +++ b/src/ui/FUi_EflUiEventManager.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EflUiEventManager.h * @brief This is the header file for the _EflUiEventManager class. * * This header file contains the declarations of the _EflUiEventManager class. @n */ + #ifndef _FUI_INTERNAL_EFL_UI_EVENT_MANAGER_H_ #define _FUI_INTERNAL_EFL_UI_EVENT_MANAGER_H_ diff --git a/src/ui/FUi_EflWindow.cpp b/src/ui/FUi_EflWindow.cpp index 1d6c858..49e69da 100644 --- a/src/ui/FUi_EflWindow.cpp +++ b/src/ui/FUi_EflWindow.cpp @@ -14,10 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EflWindow.cpp * @brief This is the implementation file for the _EflWindow class. */ + #include #include #include "FUi_EflWindow.h" diff --git a/src/ui/FUi_EflWindow.h b/src/ui/FUi_EflWindow.h index fe618f2..854e500 100644 --- a/src/ui/FUi_EflWindow.h +++ b/src/ui/FUi_EflWindow.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EflWindow.h * @brief This is the header file for the _EflWindow class. * * This header file contains the declarations of the %_EflWindow class. */ + #ifndef _FUI_INTERNAL_EFL_WINDOW_H_ #define _FUI_INTERNAL_EFL_WINDOW_H_ diff --git a/src/ui/FUi_ErrorMessages.cpp b/src/ui/FUi_ErrorMessages.cpp old mode 100644 new mode 100755 diff --git a/src/ui/FUi_FingerInfo.cpp b/src/ui/FUi_FingerInfo.cpp index 6afc611..bbd6f66 100644 --- a/src/ui/FUi_FingerInfo.cpp +++ b/src/ui/FUi_FingerInfo.cpp @@ -63,7 +63,7 @@ _FingerInfo::SetPointId(unsigned long pointId) } void -_FingerInfo::SetPoint(const Point& screenPoint, const Point& point) +_FingerInfo::SetPoint(const FloatPoint& screenPoint, const FloatPoint& point) { __screenPoint = screenPoint; __point = point; @@ -75,13 +75,13 @@ _FingerInfo::GetPointId(void) const return __pointId; } -Point +FloatPoint _FingerInfo::GetPoint(void) const { return __point; } -Point +FloatPoint _FingerInfo::GetScreenPoint(void) const { return __screenPoint; @@ -100,12 +100,12 @@ _FingerInfo::GetStatus(void) const } void -_FingerInfo::SetStartPoint(const Point& point) +_FingerInfo::SetStartPoint(const FloatPoint& point) { __startPoint = point; } -Point +FloatPoint _FingerInfo::GetStartPoint(void) const { return __startPoint; diff --git a/src/ui/FUi_GridLayoutImpl.cpp b/src/ui/FUi_GridLayoutImpl.cpp old mode 100644 new mode 100755 index d081c95..6339490 --- a/src/ui/FUi_GridLayoutImpl.cpp +++ b/src/ui/FUi_GridLayoutImpl.cpp @@ -22,6 +22,7 @@ */ #include "FUi_GridLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -104,13 +105,13 @@ _GridLayoutImpl::GetCore(void) const _GridLayoutImpl* _GridLayoutImpl::GetInstance(const GridLayout& layout) { - return static_cast(_LayoutImpl::GetInstance(layout)); + return static_cast (_LayoutImpl::GetInstance(layout)); } _GridLayoutImpl* _GridLayoutImpl::GetInstance(GridLayout& layout) { - return static_cast<_GridLayoutImpl*>(_LayoutImpl::GetInstance(layout)); + return static_cast <_GridLayoutImpl*>(_LayoutImpl::GetInstance(layout)); } result @@ -240,7 +241,7 @@ CATCH: } result -_GridLayoutImpl::SetColumnSpacing(int columnIndex, int space) +_GridLayoutImpl::SetColumnSpacing(int columnIndex, float space) { ClearLastResult(); @@ -360,7 +361,7 @@ CATCH: } result -_GridLayoutImpl::SetRowSpacing(int rowIndex, int space) +_GridLayoutImpl::SetRowSpacing(int rowIndex, float space) { ClearLastResult(); diff --git a/src/ui/FUi_GridLayoutImpl.h b/src/ui/FUi_GridLayoutImpl.h old mode 100644 new mode 100755 index c55d4ca..219bd59 --- a/src/ui/FUi_GridLayoutImpl.h +++ b/src/ui/FUi_GridLayoutImpl.h @@ -180,17 +180,17 @@ public: */ result SetAllColumnsShrinkable(bool shrinkable); - /** + /* * Sets the space before the specified column index. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] columnIndex The column index * @param[in] space The space - * @exception E_SUCCESS The method was successful. + * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result SetColumnSpacing(int columnIndex, int space); + result SetColumnSpacing(int columnIndex, float space); /** * Sets the stretching ability of the specified row. @@ -257,17 +257,17 @@ public: */ result SetAllRowsShrinkable(bool shrinkable); - /** + /* * Sets the space before the specified column index. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] rowIndex The row index * @param[in] space The space - * @exception E_SUCCESS The method was successful. + * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result SetRowSpacing(int rowIndex, int space); + result SetRowSpacing(int rowIndex, float space); /** * Adds the control at the specified position. diff --git a/src/ui/FUi_HorizontalBoxLayoutImpl.cpp b/src/ui/FUi_HorizontalBoxLayoutImpl.cpp old mode 100644 new mode 100755 index 7a87288..1868aaf --- a/src/ui/FUi_HorizontalBoxLayoutImpl.cpp +++ b/src/ui/FUi_HorizontalBoxLayoutImpl.cpp @@ -22,6 +22,7 @@ */ #include "FUi_HorizontalBoxLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -118,7 +119,7 @@ _HorizontalBoxLayoutImpl::SetVerticalAlignment(_ControlImpl& control, LayoutVert } result -_HorizontalBoxLayoutImpl::SetSpacing(_ControlImpl& control, int space) +_HorizontalBoxLayoutImpl::SetSpacing(_ControlImpl& control, float space) { ClearLastResult(); @@ -130,15 +131,15 @@ _HorizontalBoxLayoutImpl::SetSpacing(_ControlImpl& control, int space) } result -_HorizontalBoxLayoutImpl::SetVerticalMargin(_ControlImpl& control, int top, int bottom) +_HorizontalBoxLayoutImpl::SetVerticalMargin(_ControlImpl& control, float top, float bottom) { - result r = SetMargin(control, 0, 0, top, bottom); + result r = SetMargin(control, 0.0f, 0.0f, top, bottom); return r; } result -_HorizontalBoxLayoutImpl::SetWidth(_ControlImpl& control, int width) +_HorizontalBoxLayoutImpl::SetWidth(_ControlImpl& control, float width) { ClearLastResult(); @@ -164,7 +165,7 @@ _HorizontalBoxLayoutImpl::SetItemHorizontalFitPolicy(_ControlImpl& control, FitP } result -_HorizontalBoxLayoutImpl::SetHeight(_ControlImpl& control, int height) +_HorizontalBoxLayoutImpl::SetHeight(_ControlImpl& control, float height) { ClearLastResult(); @@ -261,13 +262,13 @@ _HorizontalBoxLayoutImpl::GetCore(void) const _HorizontalBoxLayoutImpl* _HorizontalBoxLayoutImpl::GetInstance(const HorizontalBoxLayout& layout) { - return static_cast(_LayoutImpl::GetInstance(layout)); + return static_cast (_LayoutImpl::GetInstance(layout)); } _HorizontalBoxLayoutImpl* _HorizontalBoxLayoutImpl::GetInstance(HorizontalBoxLayout& layout) { - return static_cast<_HorizontalBoxLayoutImpl*>(_LayoutImpl::GetInstance(layout)); + return static_cast <_HorizontalBoxLayoutImpl*>(_LayoutImpl::GetInstance(layout)); } }} // Tizen::Ui diff --git a/src/ui/FUi_HorizontalBoxLayoutImpl.h b/src/ui/FUi_HorizontalBoxLayoutImpl.h old mode 100644 new mode 100755 index 9bafec5..7abb1b9 --- a/src/ui/FUi_HorizontalBoxLayoutImpl.h +++ b/src/ui/FUi_HorizontalBoxLayoutImpl.h @@ -138,10 +138,10 @@ public: */ result SetVerticalAlignment(_ControlImpl& control, LayoutVerticalAlignment vertAlign); - /** + /* * Sets the space between the specified control and its predecessor. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the space is set * @param[in] space The space @@ -149,12 +149,12 @@ public: * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetSpacing(_ControlImpl& control, int space); + result SetSpacing(_ControlImpl& control, float space); - /** + /* * Sets the vertical margins of the specified control. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the margins are set * @param[in] top The top margin @@ -162,12 +162,12 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetVerticalMargin(_ControlImpl& control, int top, int bottom); + result SetVerticalMargin(_ControlImpl& control, float top, float bottom); - /** + /* * Sets the width of the specified control with the fixed length. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the width is set * @param[in] virWidth This is not used. @@ -175,7 +175,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetWidth(_ControlImpl& control, int width); + result SetWidth(_ControlImpl& control, float width); /** * Sets the width of the specified control with the fitting policy. @@ -189,10 +189,10 @@ public: */ result SetItemVerticalFitPolicy(_ControlImpl& control, FitPolicy policy); - /** + /* * Sets the height of the specified control with fixed length. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the height is set * @param[in] virHeight This is not used. @@ -200,7 +200,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetHeight(_ControlImpl& control, int height); + result SetHeight(_ControlImpl& control, float height); /** * Sets the height of the specified control with the fitting policy. diff --git a/src/ui/FUi_InputConnectionImpl.cpp b/src/ui/FUi_InputConnectionImpl.cpp old mode 100644 new mode 100755 index e3a4d3a..eec8e2e --- a/src/ui/FUi_InputConnectionImpl.cpp +++ b/src/ui/FUi_InputConnectionImpl.cpp @@ -35,11 +35,9 @@ #include "FUi_UiEventManager.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_VisualElement.h" -#if defined(MULTI_WINDOW) #include "FUi_Window.h" #include "FUiAnim_EflLayer.h" #include "FUiAnim_RootVisualElement.h" -#endif using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -62,6 +60,7 @@ OnInputPanelShowStateEvent(void* pData, Ecore_IMF_Context* pContext, int value) _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); InputConnection* pInputConnection = pImpl->GetInputConnection(); result r = E_SUCCESS; @@ -86,8 +85,14 @@ OnInputPanelShowStateEvent(void* pData, Ecore_IMF_Context* pContext, int value) r = pImpl->SetInputPanelShowState(inputPanelState); SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); - pListener->OnInputConnectionPanelShowStateChanged(*pInputConnection, inputPanelState); - + if (pListener) + { + pListener->OnInputConnectionPanelShowStateChanged(*pInputConnection, inputPanelState); + } + if (pListenerF) + { + pListenerF->OnInputConnectionPanelShowStateChanged(*pInputConnection, inputPanelState); + } SetLastResult(E_SUCCESS); return; @@ -101,6 +106,7 @@ OnInputPanelLanguageEvent(void* pData, Ecore_IMF_Context* pContext, int value) _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); InputConnection* pInputConnection = pImpl->GetInputConnection(); char* pLocale = null; @@ -110,8 +116,14 @@ OnInputPanelLanguageEvent(void* pData, Ecore_IMF_Context* pContext, int value) tempBuffer.SubString(LANGUAGE_CODE_START, LANGUAGE_CODE_MAX, language); LanguageCode newLanguageCode = Locale::TwoLetterLanguageCodeStringToLanguageCode(language); - pListener->OnInputConnectionPanelLanguageChanged(*pInputConnection, newLanguageCode); - + if (pListener) + { + pListener->OnInputConnectionPanelLanguageChanged(*pInputConnection, newLanguageCode); + } + if (pListenerF) + { + pListenerF->OnInputConnectionPanelLanguageChanged(*pInputConnection, newLanguageCode); + } if (pLocale) { free(pLocale); @@ -130,13 +142,21 @@ OnInputPanelSizeChangedEvent(void* pData, Ecore_IMF_Context* pContext, int value _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); InputConnection* pInputConnection = pImpl->GetInputConnection(); Rectangle bounds = pImpl->GetInputPanelBounds(); SysLog(NID_UI_CTRL, "[InputConnection] OnInputPanelSizeChangedEvent is called.[ctx=0x%x][x = %d, y = %d, width = %d, height = %d]\n", pContext, bounds.x, bounds.y, bounds.width, bounds.height); - pListener->OnInputConnectionPanelBoundsChanged(*pInputConnection, bounds); + if (pListener) + { + pListener->OnInputConnectionPanelBoundsChanged(*pInputConnection, bounds); + } + if (pListenerF) + { + pListenerF->OnInputConnectionPanelBoundsChanged(*pInputConnection, _CoordinateSystemUtils::ConvertToFloat(bounds)); + } SetLastResult(E_SUCCESS); @@ -151,10 +171,17 @@ OnInputPanelPredictionModeEvent(void* pData, Ecore_IMF_Context* pContext, int va _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); InputConnection* pInputConnection = pImpl->GetInputConnection(); - pListener->OnInputConnectionTextPredictionShowStateChanged(*pInputConnection, static_cast(value)); - + if (pListener) + { + pListener->OnInputConnectionTextPredictionShowStateChanged(*pInputConnection, static_cast(value)); + } + if (pListenerF) + { + pListener->OnInputConnectionTextPredictionShowStateChanged(*pInputConnection, static_cast(value)); + } SetLastResult(E_SUCCESS); return; @@ -168,12 +195,19 @@ OnInputPanelPredictionSizeChangedEvent(void* pData, Ecore_IMF_Context* pContext, _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); InputConnection* pInputConnection = pImpl->GetInputConnection(); Rectangle bounds = pImpl->GetPredictionBounds(); - pListener->OnInputConnectionTextPredictionBoundsChanged(*pInputConnection, bounds); - + if (pListener) + { + pListener->OnInputConnectionTextPredictionBoundsChanged(*pInputConnection, bounds); + } + if (pListener) + { + pListenerF->OnInputConnectionTextPredictionBoundsChanged(*pInputConnection, _CoordinateSystemUtils::ConvertToFloat(bounds)); + } SetLastResult(E_SUCCESS); return; @@ -229,10 +263,19 @@ OnCommitTextEcoreEvent(void* pData, Ecore_IMF_Context* pContext, void* pEventInf _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); String commitText(static_cast(pEventInfo)); InputConnection* pInputConnection = pImpl->GetInputConnection(); - pListener->OnInputConnectionTextCommitted(*pInputConnection, commitText); + + if (pListener) + { + pListener->OnInputConnectionTextCommitted(*pInputConnection, commitText); + } + if (pListenerF) + { + pListenerF->OnInputConnectionTextCommitted(*pInputConnection, commitText); + } SetLastResult(E_SUCCESS); @@ -247,6 +290,7 @@ OnComposeTextEcoreEvent(void* pData, Ecore_IMF_Context* pContext, void* pEventIn _InputConnectionImpl* pImpl = static_cast<_InputConnectionImpl*>(pData); IInputConnectionEventListener* pListener = pImpl->GetInputConnectionListener(); + IInputConnectionEventListenerF* pListenerF = pImpl->GetInputConnectionListenerF(); int cursorPosition = 0; char* pText = null; @@ -258,7 +302,15 @@ OnComposeTextEcoreEvent(void* pData, Ecore_IMF_Context* pContext, void* pEventIn } InputConnection* pInputConnection = pImpl->GetInputConnection(); - pListener->OnInputConnectionComposingTextChanged(*pInputConnection, composingText, cursorPosition); + + if (pListener) + { + pListener->OnInputConnectionComposingTextChanged(*pInputConnection, composingText, cursorPosition); + } + if (pListenerF) + { + pListenerF->OnInputConnectionComposingTextChanged(*pInputConnection, composingText, cursorPosition); + } SetLastResult(E_SUCCESS); @@ -300,6 +352,7 @@ _InputConnectionImpl::_InputConnectionImpl(InputConnection* pInputConnection) , __controlHandle() , __IsBounded(false) , __pListener(null) + , __pListenerF(null) , __pProvider(null) , __pInputConnection(pInputConnection) , __inputPanelAction(INPUT_PANEL_ACTION_ENTER) @@ -315,6 +368,7 @@ _InputConnectionImpl::~_InputConnectionImpl(void) { __pInputConnection = null; __pListener = null; + __pListenerF = null; __pProvider = null; if (__pContext) { @@ -348,6 +402,7 @@ _InputConnectionImpl::Initialize(const _Control& control, const IInputConnection __controlHandle = control.GetHandle(); __pListener = const_cast(&listener); + __pListenerF = null; __pProvider = const_cast(&provider); ecore_imf_init(); @@ -358,14 +413,32 @@ _InputConnectionImpl::Initialize(const _Control& control, const IInputConnection __pContext = (Ecore_IMF_Context*)ecore_imf_context_add(pId); SysTryReturnResult(NID_UI, __pContext, E_SYSTEM, "A system error occurred."); -#if !defined(MULTI_WINDOW) - if (GetEcoreEvasMgr()->GetEcoreEvas()) - { - ecore_imf_context_client_window_set(__pContext, (void*)ecore_evas_window_get(GetEcoreEvasMgr()->GetEcoreEvas()->GetEcoreEvas())); - ecore_imf_context_client_canvas_set(__pContext, GetEcoreEvasMgr()->GetEcoreEvas()->GetEvas()); - ecore_imf_context_input_panel_enabled_set(__pContext, EINA_FALSE); - } -#endif + AddInputPanelCallback(); + AddEcoreEventCallback(); + AddEvasObjectEventCallback(); + + return r; + +} + +result +_InputConnectionImpl::Initialize(const _Control& control, const IInputConnectionEventListenerF& listener, const IInputConnectionProvider& provider) +{ + result r = E_SUCCESS; + + __controlHandle = control.GetHandle(); + + __pListener = null; + __pListenerF = const_cast(&listener); + __pProvider = const_cast(&provider); + + ecore_imf_init(); + const char* pId = ecore_imf_context_default_id_get(); + SysTryReturnResult(NID_UI, pId != null, E_SYSTEM, "A system error occurred."); + + + __pContext = (Ecore_IMF_Context*)ecore_imf_context_add(pId); + SysTryReturnResult(NID_UI, __pContext, E_SYSTEM, "A system error occurred."); AddInputPanelCallback(); AddEcoreEventCallback(); @@ -382,7 +455,6 @@ _InputConnectionImpl::BindInputMethod(void) SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); -#if defined(MULTI_WINDOW) _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle); _Window* pWindow = pControl->GetRootWindow(); @@ -398,7 +470,6 @@ _InputConnectionImpl::BindInputMethod(void) ecore_imf_context_input_panel_enabled_set(__pContext, EINA_FALSE); } } -#endif ecore_imf_context_focus_in(__pContext); __IsBounded = true; @@ -793,6 +864,37 @@ _InputConnectionImpl::SetCursorBounds(const Rectangle& rect) return r; } +result +_InputConnectionImpl::SetCursorBounds(const FloatRectangle& rect) +{ + result r = E_SUCCESS; + + SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); + + SysTryReturnResult(NID_UI, (rect.width > 0)&&(rect.height > 0), E_INVALID_ARG, "The input parameter is invalid."); + SysTryReturnResult(NID_UI, __IsBounded, E_INVALID_STATE, "This is not a bind state"); + + + FloatRectangle cursorRectangle; + cursorRectangle = rect; + + const _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle); + + if (pControl) + { + FloatRectangle absoluteControlRectangle; + absoluteControlRectangle = pControl->GetAbsoluteBoundsF(); + cursorRectangle.x += absoluteControlRectangle.x; + cursorRectangle.y += absoluteControlRectangle.y; + } + + FloatRectangle physicalFloatRect = _CoordinateSystemUtils::Transform(cursorRectangle); + Rectangle physicalRect = _CoordinateSystemUtils::ConvertToInteger(physicalFloatRect); + + ecore_imf_context_cursor_location_set(__pContext, physicalRect.x, physicalRect.y, physicalRect.width, physicalRect.height); + return r; +} + Rectangle _InputConnectionImpl::GetInputPanelBounds(void) const { @@ -809,6 +911,28 @@ _InputConnectionImpl::GetInputPanelBounds(void) const return Rectangle(x, y, w, h); } +FloatRectangle +_InputConnectionImpl::GetInputPanelBoundsF(void) const +{ + ClearLastResult(); + + SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); + + int x = 0; + int y = 0; + int w = 0; + int h = 0; + + ecore_imf_context_input_panel_geometry_get(__pContext, &x, &y, &w, &h); + FloatRectangle inputPanelFloatRect; + inputPanelFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); + inputPanelFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); + inputPanelFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); + inputPanelFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); + + return inputPanelFloatRect; +} + Rectangle _InputConnectionImpl::GetPredictionBounds(void) const { @@ -825,6 +949,28 @@ _InputConnectionImpl::GetPredictionBounds(void) const return Rectangle(x, y, w, h); } +FloatRectangle +_InputConnectionImpl::GetPredictionBoundsF(void) const +{ + ClearLastResult(); + + SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); + + int x = 0; + int y = 0; + int w = 0; + int h = 0; + + ecore_imf_context_candidate_panel_geometry_get(__pContext, &x, &y, &w, &h); + FloatRectangle inputPredictionFloatRect; + inputPredictionFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); + inputPredictionFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); + inputPredictionFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); + inputPredictionFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); + + return inputPredictionFloatRect; +} + result _InputConnectionImpl::SetTextPredictionEnabled(bool enable) { @@ -925,6 +1071,28 @@ _InputConnectionImpl::GetInputPanelLanguage(void) const return Locale::TwoLetterLanguageCodeStringToLanguageCode(language); } +void +_InputConnectionImpl::SendOpaqueCommand(const String& command) +{ + SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); + + char* pCommand = null; + int length = 0; + + length = wcstombs(0, static_cast(command.GetPointer()), 0); + SysTryReturnVoidResult(NID_UI, length != -1, E_OUT_OF_MEMORY, "A system error occurred."); + + pCommand = (char*)malloc(length+1); + SysTryReturnVoidResult(NID_UI, pCommand, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + + length = wcstombs(pCommand, static_cast(command.GetPointer()), length); + pCommand[length] = null; + + ecore_imf_context_input_panel_imdata_set(__pContext, pCommand, length); + + free(pCommand); +} + InputConnection* _InputConnectionImpl::GetInputConnection(void) const { @@ -937,6 +1105,12 @@ _InputConnectionImpl::GetInputConnectionListener(void) const return __pListener; } +IInputConnectionEventListenerF* +_InputConnectionImpl::GetInputConnectionListenerF(void) const +{ + return __pListenerF; +} + IInputConnectionProvider* _InputConnectionImpl::GetInputConnectionProvider(void) const { diff --git a/src/ui/FUi_InputConnectionImpl.h b/src/ui/FUi_InputConnectionImpl.h old mode 100644 new mode 100755 index fcb7507..ef1fa1d --- a/src/ui/FUi_InputConnectionImpl.h +++ b/src/ui/FUi_InputConnectionImpl.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "FUi_Control.h" @@ -50,6 +51,7 @@ public: static _InputConnectionImpl* CreateInputConnectionImplN(InputConnection* pInputConnection); result Initialize(const Tizen::Ui::_Control& control, const IInputConnectionEventListener& listener, const IInputConnectionProvider& provider); + result Initialize(const Tizen::Ui::_Control& control, const IInputConnectionEventListenerF& listener, const IInputConnectionProvider& provider); result BindInputMethod(void); result UnbindInputMethod(void); result ShowInputPanel(void); @@ -67,8 +69,11 @@ public: bool IsInputPanelActionEnabled(void) const; result SetCursorPosition(int position); result SetCursorBounds(const Tizen::Graphics::Rectangle& rect); + result SetCursorBounds(const Tizen::Graphics::FloatRectangle& rect); Tizen::Graphics::Rectangle GetInputPanelBounds(void) const; + Tizen::Graphics::FloatRectangle GetInputPanelBoundsF(void) const; Tizen::Graphics::Rectangle GetPredictionBounds(void) const; + Tizen::Graphics::FloatRectangle GetPredictionBoundsF(void) const; result SetTextPredictionEnabled(bool enable); bool IsTextPredictionEnabled(void) const; result SetCapsLockEnabled(bool enable); @@ -78,9 +83,11 @@ public: Tizen::Locales::LanguageCode GetInputPanelLanguage(void) const; InputConnection* GetInputConnection(void) const; IInputConnectionEventListener* GetInputConnectionListener(void) const; + IInputConnectionEventListenerF* GetInputConnectionListenerF(void) const; IInputConnectionProvider* GetInputConnectionProvider(void) const; bool CheckContextEvent(Ecore_IMF_Event_Type type, void* pEventInfo); int CheckUSBKeyboardStatus(void); + void SendOpaqueCommand (const Tizen::Base::String& command); static _InputConnectionImpl* GetInstance(InputConnection& inputConnection); static const _InputConnectionImpl* GetInstance(const InputConnection& inputConnection); @@ -110,6 +117,7 @@ private: _ControlHandle __controlHandle; bool __IsBounded; IInputConnectionEventListener* __pListener; + IInputConnectionEventListenerF* __pListenerF; IInputConnectionProvider* __pProvider; InputConnection* __pInputConnection; InputPanelAction __inputPanelAction; diff --git a/src/ui/FUi_KeyEventInfoImpl.cpp b/src/ui/FUi_KeyEventInfoImpl.cpp new file mode 100644 index 0000000..a2596f1 --- /dev/null +++ b/src/ui/FUi_KeyEventInfoImpl.cpp @@ -0,0 +1,88 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** +* @file FUi_KeyEventInfoImpl.cpp +* @brief This is the implementation for the _KeyEventInfoImpl class. +* @version 2.0 +*/ + +#include +#include +#include +#include +#include "FUi_KeyEventInfoImpl.h" +#include "FUi_UiKeyEvent.h" + +using namespace Tizen::Graphics; + +namespace Tizen { namespace Ui +{ + +_KeyEventInfoImpl* +_KeyEventInfoImpl::CreateInstanceN(KeyEventInfo* pPublic) +{ + ClearLastResult(); + + _KeyEventInfoImpl* pImpl = new (std::nothrow) _KeyEventInfoImpl(pPublic); + SysTryReturn(NID_UI, pImpl, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + return pImpl; +} + +_KeyEventInfoImpl::_KeyEventInfoImpl(KeyEventInfo* pPublic) + : __pPublic(pPublic) + , __keyCode(KEY_INVALID) + , __keyModifier(KEY_MODIFIER_NONE) +{ +} + +_KeyEventInfoImpl::~_KeyEventInfoImpl(void) +{ +} + +void +_KeyEventInfoImpl::SetKeyEventInfo(KeyCode keyCode, int keyModifiers) +{ + __keyCode = keyCode; + __keyModifier = keyModifiers; +} + +void +_KeyEventInfoImpl::SetKeyCode(KeyCode keyCode) +{ + __keyCode = keyCode; +} + +KeyCode +_KeyEventInfoImpl::GetKeyCode(void) const +{ + return __keyCode; +} + +void +_KeyEventInfoImpl::SetKeyModifier(int keyModifiers) +{ + __keyModifier = keyModifiers; +} + +int +_KeyEventInfoImpl::GetKeyModifier(void) const +{ + return __keyModifier; +} + +} } // Tizen::Ui diff --git a/src/ui/FUi_KeyEventManager.cpp b/src/ui/FUi_KeyEventManager.cpp index 48c1d96..ee1ac6c 100644 --- a/src/ui/FUi_KeyEventManager.cpp +++ b/src/ui/FUi_KeyEventManager.cpp @@ -215,7 +215,7 @@ _KeyEventManager::Initialize(void) { pthread_once(&once_block, InitializeInstance); } - } +} _KeyEventManager* _KeyEventManager::GetInstance(void) @@ -230,9 +230,9 @@ _KeyEventManager::InitializeInstance(void) if (__pInstance == null) { - __pInstance = new (std::nothrow) _KeyEventManager; - SysTryReturnVoidResult(NID_UI, __pInstance != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -} + __pInstance = new (std::nothrow) _KeyEventManager; + SysTryReturnVoidResult(NID_UI, __pInstance != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + } } void diff --git a/src/ui/FUi_KeyEventManagerImpl.cpp b/src/ui/FUi_KeyEventManagerImpl.cpp index c852a5a..332f5f8 100644 --- a/src/ui/FUi_KeyEventManagerImpl.cpp +++ b/src/ui/FUi_KeyEventManagerImpl.cpp @@ -190,7 +190,7 @@ _KeyEventManagerImpl::InitializeInstance(void) __pInstance = new (std::nothrow) _KeyEventManagerImpl; SysTryReturnVoidResult(NID_UI, __pInstance != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); } - } +} void _KeyEventManagerImpl::ReleaseInstance(void) diff --git a/src/ui/FUi_LayoutImpl.cpp b/src/ui/FUi_LayoutImpl.cpp old mode 100644 new mode 100755 index 8c3b470..0b0f49a --- a/src/ui/FUi_LayoutImpl.cpp +++ b/src/ui/FUi_LayoutImpl.cpp @@ -319,6 +319,28 @@ _LayoutImpl::SetMargin(const _ControlImpl& item, int left, int right, int top, i } result +_LayoutImpl::SetMargin(const _ControlImpl& item, float left, float right, float top, float bottom) +{ + SysTryReturn(NID_UI, left >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The left margin is negative."); + SysTryReturn(NID_UI, right >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The right margin is negative."); + SysTryReturn(NID_UI, top >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The top margin is negative."); + SysTryReturn(NID_UI, bottom >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The bottom margin is negative."); + + _Layout::LayoutItem& layoutItem = item.GetLayoutContainer(); + + _Layout::ItemMargin itemMargin; + + itemMargin.left = static_cast (left); + itemMargin.right = static_cast (right); + itemMargin.top = static_cast (top); + itemMargin.bottom = static_cast (bottom); + + result r = _pCoreLayout->SetItemMargin(layoutItem, itemMargin); + + return r; +} + +result _LayoutImpl::GetMargin(const _ControlImpl& item, int& left, int& right, int& top, int& bottom) const { _Layout::LayoutItem& layoutItem = item.GetLayoutContainer(); @@ -337,6 +359,24 @@ _LayoutImpl::GetMargin(const _ControlImpl& item, int& left, int& right, int& top } result +_LayoutImpl::GetMargin(const _ControlImpl& item, float& left, float& right, float& top, float& bottom) const +{ + _Layout::LayoutItem& layoutItem = item.GetLayoutContainer(); + + _Layout::ItemMargin itemMargin; + + result r = _pCoreLayout->GetItemMargin(layoutItem, itemMargin); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + left = static_cast (itemMargin.left); + right = static_cast (itemMargin.right); + top = static_cast (itemMargin.top); + bottom = static_cast (itemMargin.bottom); + + return r; +} + +result _LayoutImpl::SetHorizontalFitPolicy(const _ControlImpl& item, const FitPolicy policy) { _Layout::LayoutItem& layoutItem = item.GetLayoutContainer(); diff --git a/src/ui/FUi_LayoutImpl.h b/src/ui/FUi_LayoutImpl.h old mode 100644 new mode 100755 index d22649b..5bac1c9 --- a/src/ui/FUi_LayoutImpl.h +++ b/src/ui/FUi_LayoutImpl.h @@ -173,6 +173,18 @@ protected: */ result SetMargin(const _ControlImpl& item, int left, int right, int top, int bottom); + /* + * Sets the margin of the specified item. + * + * @return An error code + * @param[in] item The item for which the margin is set + * @param[in] margin The margin + * @exception E_SUCCESS The method was successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @since 2.1 + */ + result SetMargin(const _ControlImpl& item, float left, float right, float top, float bottom); + /** * Gets the margin of the specified item. * @@ -185,6 +197,18 @@ protected: */ result GetMargin(const _ControlImpl& item, int& left, int& right, int& top, int& bottom) const; + /* + * Gets the margin of the specified item. + * + * @return An error code + * @param[in] item The item to get the margin + * @param[out] margin The margin + * @exception E_SUCCESS The method was successful. + * @exception E_INVALID_STATE This instance is in an invalid state. + * @since 2.1 + */ + result GetMargin(const _ControlImpl& item, float& left, float& right, float& top, float& bottom) const; + /** * Sets the width of the specified item with the match policy. * diff --git a/src/ui/FUi_Matrix3Df.cpp b/src/ui/FUi_Matrix3Df.cpp index cd66966..875a05f 100644 --- a/src/ui/FUi_Matrix3Df.cpp +++ b/src/ui/FUi_Matrix3Df.cpp @@ -16,7 +16,7 @@ // /** - * @file FUi_Matrix3Df.cpp + * @file FUi_Matrix3Df.h * @brief Header file of _Matrix3Df class * * This file contains declarations _Matrix3Df class. diff --git a/src/ui/FUi_ModalLoopManager.cpp b/src/ui/FUi_ModalLoopManager.cpp old mode 100644 new mode 100755 index 1b0a9a3..ebb47ff --- a/src/ui/FUi_ModalLoopManager.cpp +++ b/src/ui/FUi_ModalLoopManager.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ModalLoopManager.cpp * @brief This is the implementation file for the _ModalLoopManager class. diff --git a/src/ui/FUi_OrientationAgent.cpp b/src/ui/FUi_OrientationAgent.cpp index 3a979c2..3843f21 100644 --- a/src/ui/FUi_OrientationAgent.cpp +++ b/src/ui/FUi_OrientationAgent.cpp @@ -14,11 +14,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_OrientationAgent.cpp * @brief This is the implementation file for the _OrientationAgent class. */ + +#include #include +#include #include "FUi_OrientationAgent.h" #include "FUi_ControlManager.h" #include "FUi_ControlImplManager.h" @@ -28,16 +32,24 @@ #include "FUiCtrl_FormImpl.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_Frame.h" +#include "FUiCtrl_Form.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" +#include "FUi_ControlManager.h" +#include "FUi_UiNotificationEvent.h" +#include "FUi_UiEventManager.h" +using namespace std; using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Base::Runtime; using namespace Tizen::Ui::Controls; using namespace Tizen::Graphics; namespace Tizen { namespace Ui { +const String _REQUEST_ORIENTATION_EVENT = L"RequestOrientationEvent"; + _OrientationAgent* _OrientationAgent::CreateInstanceN(Control& publicControl) { @@ -142,6 +154,73 @@ _OrientationAgent::Update(bool draw) return; } +#if defined(ROTATION_SYNC) + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + if (!pEcoreEvas) + { + return; + } + + _Form* pForm = dynamic_cast<_Form*>(&(pImpl->GetCore())); + if (pForm) + { + _Control* pParent = pForm->GetParent(); + + if (pParent) + { + int index = pParent->GetChildIndex(*pForm); + int childCount = pParent->GetChildCount(); + + if (index == (childCount - 1)) + { + _Window* pWindow = pForm->GetRootWindow(); + if (pWindow) + { + if ((__mode == ORIENTATION_AUTOMATIC) || (__mode == ORIENTATION_AUTOMATIC_FOUR_DIRECTION)) + { + SysLog(NID_UI, "ROTATE SYNC: Form(0x%x) <- Parent(0x%x), X(0x%x) ON", pForm, pWindow, pWindow->GetNativeHandle()); + pEcoreEvas->SetWindowOrientationEnabled(*pWindow, true); + pWindow->SetOrientationEnabled(true); + } + else + { + SysLog(NID_UI, "ROTATE SYNC: Form(0x%x) <- Parent(0x%x), X(0x%x) OFF", pForm, pWindow, pWindow->GetNativeHandle()); + pEcoreEvas->SetWindowOrientationEnabled(*pWindow, false); + pWindow->SetOrientationEnabled(false); + } + } + } + } + } + else + { + _Frame* pFrame = dynamic_cast<_Frame*>(&(pImpl->GetCore())); + if (pFrame) + { + int childCount = pFrame->GetChildCount(); + if (childCount == 0) + { + _Window* pCurrentFrame = _ControlManager::GetInstance()->GetCurrentFrame(); + if (pCurrentFrame == pFrame) + { + if ((__mode == ORIENTATION_AUTOMATIC) || (__mode == ORIENTATION_AUTOMATIC_FOUR_DIRECTION)) + { + SysLog(NID_UI, "ROTATE SYNC: Frame(0x%x) <- X(0x%x) ON", pFrame, pFrame->GetNativeHandle()); + pEcoreEvas->SetWindowOrientationEnabled(*pFrame, true); + pFrame->SetOrientationEnabled(true); + } + else + { + SysLog(NID_UI, "ROTATE SYNC: Frame(0x%x) <- X(0x%x) OFF", pFrame, pFrame->GetNativeHandle()); + pEcoreEvas->SetWindowOrientationEnabled(*pFrame, false); + pFrame->SetOrientationEnabled(false); + } + } + } + } + } +#endif + OrientationStatus status = pImplManager->GetOrientationStatus(__mode); if (__updateStatus == true) @@ -156,11 +235,13 @@ _OrientationAgent::Update(bool draw) __status = status; +#if !defined(ROTATION_SYNC) _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); if (!pEcoreEvas) { return; } +#endif pEcoreEvas->AllowSetWindowBounds(false); FireEvent(status); @@ -182,12 +263,34 @@ _OrientationAgent::Update(bool draw) } // Despite not changing status, it needs to rotate screen. -#if !defined(MULTI_WINDOW) - pImplManager->RotateScreen(status); -#else _ControlImpl* pControlImpl = _ControlImpl::GetInstance(__publicControl); pImplManager->RotateScreen(pControlImpl, status); -#endif +} + +void +_OrientationAgent::RequestOrientationEvent(void) +{ + ClearLastResult(); + + _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl); + SysTryReturnVoidResult(NID_UI, pImpl, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + unique_ptr pEventArgs(new (std::nothrow) ArrayList()); + SysTryReturnVoidResult(NID_UI, pEventArgs, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + pEventArgs->Construct(); + + unique_ptr pString(new (std::nothrow) Tizen::Base::String(_REQUEST_ORIENTATION_EVENT)); + SysTryReturnVoidResult(NID_UI, pString, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + + pEventArgs->Add(*(pString.get())); + + _UiNotificationEvent event(pImpl->GetCore().GetHandle(), pEventArgs.get()); + + result r = _UiEventManager::GetInstance()->PostEvent(event); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + pString.release(); + pEventArgs.release(); } void @@ -200,6 +303,8 @@ _OrientationAgent::FireOrientationEvent(void) __firePublicEvent = true; + SysLog(NID_UI, "Fire the orientation event."); + if (__statusChanged) { IEventArg* pArg = _PublicOrientationEvent::CreateOrientationEventArgN(*__pPublicEvent->GetSource(), __status); diff --git a/src/ui/FUi_OrientationAgent.h b/src/ui/FUi_OrientationAgent.h index 0917e89..d5ab49b 100644 --- a/src/ui/FUi_OrientationAgent.h +++ b/src/ui/FUi_OrientationAgent.h @@ -14,19 +14,22 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_OrientationAgent.h * @brief This is the header file for the _OrientationAgent class. * * This header file contains the declarations of the %_OrientationAgent class. */ + #ifndef _FUI_INTERNAL_ORIENTATION_AGENT_H_ #define _FUI_INTERNAL_ORIENTATION_AGENT_H_ #include #include "FUi_Types.h" -namespace Tizen { namespace Ui { +namespace Tizen { namespace Ui +{ class _PublicOrientationEvent; @@ -41,10 +44,10 @@ public: Orientation GetMode(void) const; OrientationStatus GetStatus(void) const; - void SetMode(Orientation orientation); void Update(bool draw = false); + void RequestOrientationEvent(void); void FireOrientationEvent(void); private: diff --git a/src/ui/FUi_PropertyBase.cpp b/src/ui/FUi_PropertyBase.cpp index 9473b9c..4803c42 100644 --- a/src/ui/FUi_PropertyBase.cpp +++ b/src/ui/FUi_PropertyBase.cpp @@ -15,7 +15,7 @@ // limitations under the License. // /** - * @file FUi_PropertyBase.cpp + * @file FUI_PropertyBase.cpp * @brief This is the implementation file for _PropertyBase class. */ diff --git a/src/ui/FUi_PropertyUtils.cpp b/src/ui/FUi_PropertyUtils.cpp index 73951d8..792a7ff 100644 --- a/src/ui/FUi_PropertyUtils.cpp +++ b/src/ui/FUi_PropertyUtils.cpp @@ -15,7 +15,7 @@ // limitations under the License. // /** - * @file FUi_PropertyUtils.cpp + * @file FUI_PropertyUtils.cpp * @brief This is the implementation file for _PropertyUtils class. */ @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui /** * @class _StringComparer * @brief We implemented new custom string-comparer for performance. - * @since 2.0 + * @since 2.1 * */ diff --git a/src/ui/FUi_PublicOrientationEvent.cpp b/src/ui/FUi_PublicOrientationEvent.cpp index 3cecfa2..2ed7c47 100644 --- a/src/ui/FUi_PublicOrientationEvent.cpp +++ b/src/ui/FUi_PublicOrientationEvent.cpp @@ -14,11 +14,13 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_PublicOrientationEvent.cpp * @brief This is the implementation for the _PublicOrientationEvent class. * @version 1.0 */ + #include #include #include diff --git a/src/ui/FUi_RelativeLayoutImpl.cpp b/src/ui/FUi_RelativeLayoutImpl.cpp old mode 100644 new mode 100755 index 67d4f9e..48f46a9 --- a/src/ui/FUi_RelativeLayoutImpl.cpp +++ b/src/ui/FUi_RelativeLayoutImpl.cpp @@ -138,13 +138,13 @@ _RelativeLayoutImpl::GetCore(void) const _RelativeLayoutImpl* _RelativeLayoutImpl::GetInstance(const RelativeLayout& layout) { - return static_cast(_LayoutImpl::GetInstance(layout)); + return static_cast (_LayoutImpl::GetInstance(layout)); } _RelativeLayoutImpl* _RelativeLayoutImpl::GetInstance(RelativeLayout& layout) { - return static_cast<_RelativeLayoutImpl*>(_LayoutImpl::GetInstance(layout)); + return static_cast <_RelativeLayoutImpl*>(_LayoutImpl::GetInstance(layout)); } result @@ -260,7 +260,7 @@ _RelativeLayoutImpl::ResetRelation(_ControlImpl& control, RectangleEdgeType edge } result -_RelativeLayoutImpl::SetHeight(_ControlImpl& control, int height) +_RelativeLayoutImpl::SetHeight(_ControlImpl& control, float height) { ClearLastResult(); @@ -279,7 +279,7 @@ _RelativeLayoutImpl::SetHeight(_ControlImpl& control, int height) } result -_RelativeLayoutImpl::SetWidth(_ControlImpl& control, int width) +_RelativeLayoutImpl::SetWidth(_ControlImpl& control, float width) { ClearLastResult(); @@ -298,18 +298,12 @@ _RelativeLayoutImpl::SetWidth(_ControlImpl& control, int width) } result -_RelativeLayoutImpl::SetItemMargin(const _ControlImpl& item, int left, int right, int top, int bottom) +_RelativeLayoutImpl::SetItemMargin(const _ControlImpl& item, float left, float right, float top, float bottom) { return _LayoutImpl::SetMargin(item, left, right, top, bottom); } result -_RelativeLayoutImpl::GetItemMargin(const _ControlImpl& item, int& left, int& right, int& top, int& bottom) -{ - return _LayoutImpl::GetMargin(item, left, right, top, bottom); -} - -result _RelativeLayoutImpl::SetItemHorizontalFitPolicy(const _ControlImpl& item, const FitPolicy policy) { return _LayoutImpl::SetHorizontalFitPolicy(item, policy); diff --git a/src/ui/FUi_RelativeLayoutImpl.h b/src/ui/FUi_RelativeLayoutImpl.h old mode 100644 new mode 100755 index fc47be3..d879aef --- a/src/ui/FUi_RelativeLayoutImpl.h +++ b/src/ui/FUi_RelativeLayoutImpl.h @@ -171,34 +171,34 @@ public: */ result ResetRelation(_ControlImpl& control, RectangleEdgeType edgeType); - /** + /* * Sets the height of the specified control to the fixed size. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] childControl The control for which the height is set * @param[in] height The value of the height * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetHeight(_ControlImpl& control, int height); + result SetHeight(_ControlImpl& control, float height); - /** + /* * Sets the width of the specified control to the fixed size. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] childControl The control for which the width is set * @param[in] width The value of the width * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetWidth(_ControlImpl& control, int width); + result SetWidth(_ControlImpl& control, float width); - /** + /* * Sets the margins of the specified control. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] item The control for which the margins are set * @param[in] left The left margin @@ -208,22 +208,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetItemMargin(const _ControlImpl& item, int left, int right, int top, int bottom); - - /** - * Gets the margins of the specified control. - * - * @since 2.0 - * @return An error code - * @param[in] item The control for which the margins are set - * @param[out] left The left margin - * @param[out] right The right margin - * @param[out] top The top margin - * @param[out] bottom The bottom margin - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_STATE This instance is in an invalid state. - */ - result GetItemMargin(const _ControlImpl& item, int& left, int& right, int& top, int& bottom); + result SetItemMargin(const _ControlImpl& item, float left, float right, float top, float bottom); /** * Sets the width of the specified control as per the fitting policy. diff --git a/src/ui/FUi_ResourceManager.cpp b/src/ui/FUi_ResourceManager.cpp index 3b3874b..d7d4e52 100644 --- a/src/ui/FUi_ResourceManager.cpp +++ b/src/ui/FUi_ResourceManager.cpp @@ -16,6 +16,7 @@ // #include #include +#include #include #include #include @@ -27,15 +28,18 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceStringLoader.h" #include "FUi_ResourceConfigLoader.h" @@ -49,6 +53,7 @@ using namespace Tizen::Base::Collection; using namespace Tizen::Io; using namespace Tizen::Graphics; using namespace Tizen::Media; +using namespace Tizen::Ui::Controls; using namespace Tizen::Ui::_Resource; namespace @@ -106,6 +111,164 @@ MediaPixelFormat ConvertBitmapPixelFormatToMediaPixelFormat(BitmapPixelFormat fo } return out; } + +feedback_pattern_e Convert_ResourceFeedbackPatternTofeedback_pattern_e(Tizen::Ui::_ResourceFeedbackPattern pattern) +{ + feedback_pattern_e outPattern = FEEDBACK_PATTERN_TAP; + switch (pattern) + { + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_TAP: + outPattern = FEEDBACK_PATTERN_TAP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SIP: + outPattern = FEEDBACK_PATTERN_SIP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SIP_BACKSPACE: + outPattern = FEEDBACK_PATTERN_SIP_BACKSPACE; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_MAX_CHARACTER: + outPattern = FEEDBACK_PATTERN_MAX_CHARACTER; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY0: + outPattern = FEEDBACK_PATTERN_KEY0; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY1: + outPattern = FEEDBACK_PATTERN_KEY1; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY2: + outPattern = FEEDBACK_PATTERN_KEY2; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY3: + outPattern = FEEDBACK_PATTERN_KEY3; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY4: + outPattern = FEEDBACK_PATTERN_KEY4; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY5: + outPattern = FEEDBACK_PATTERN_KEY5; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY6: + outPattern = FEEDBACK_PATTERN_KEY6; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY7: + outPattern = FEEDBACK_PATTERN_KEY7; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY8: + outPattern = FEEDBACK_PATTERN_KEY8; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY9: + outPattern = FEEDBACK_PATTERN_KEY9; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY_STAR: + outPattern = FEEDBACK_PATTERN_KEY_STAR; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_KEY_SHARP: + outPattern = FEEDBACK_PATTERN_KEY_SHARP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_HOLD: + outPattern = FEEDBACK_PATTERN_HOLD; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_MULTI_TAP: + outPattern = FEEDBACK_PATTERN_MULTI_TAP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_HW_TAP: + outPattern = FEEDBACK_PATTERN_HW_TAP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_HW_HOLD: + outPattern = FEEDBACK_PATTERN_HW_HOLD; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_MESSAGE: + outPattern = FEEDBACK_PATTERN_MESSAGE; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_MESSAGE_ON_CALL: + outPattern = FEEDBACK_PATTERN_MESSAGE_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_EMAIL: + outPattern = FEEDBACK_PATTERN_EMAIL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_EMAIL_ON_CALL: + outPattern = FEEDBACK_PATTERN_EMAIL_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_WAKEUP: + outPattern = FEEDBACK_PATTERN_WAKEUP; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_WAKEUP_ON_CALL: + outPattern = FEEDBACK_PATTERN_WAKEUP_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SCHEDULE: + outPattern = FEEDBACK_PATTERN_SCHEDULE; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SCHEDULE_ON_CALL: + outPattern = FEEDBACK_PATTERN_SCHEDULE_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_TIMER: + outPattern = FEEDBACK_PATTERN_TIMER; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_TIMER_ON_CALL: + outPattern = FEEDBACK_PATTERN_TIMER_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_GENERAL: + outPattern = FEEDBACK_PATTERN_GENERAL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_GENERAL_ON_CALL: + outPattern = FEEDBACK_PATTERN_GENERAL_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_POWERON: + outPattern = FEEDBACK_PATTERN_POWERON; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_POWEROFF: + outPattern = FEEDBACK_PATTERN_POWEROFF; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_CHARGERCONN: + outPattern = FEEDBACK_PATTERN_CHARGERCONN; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_CHARGERCONN_ON_CALL: + outPattern = FEEDBACK_PATTERN_CHARGERCONN_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_FULLCHARGED: + outPattern = FEEDBACK_PATTERN_FULLCHARGED; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_FULLCHARGED_ON_CALL: + outPattern = FEEDBACK_PATTERN_FULLCHARGED_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_LOWBATT: + outPattern = FEEDBACK_PATTERN_LOWBATT; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_LOWBATT_ON_CALL: + outPattern = FEEDBACK_PATTERN_LOWBATT_ON_CALL; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_LOCK: + outPattern = FEEDBACK_PATTERN_LOCK; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_UNLOCK: + outPattern = FEEDBACK_PATTERN_UNLOCK; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_CALLCONNECT: + outPattern = FEEDBACK_PATTERN_CALLCONNECT; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_DISCALLCONNECT: + outPattern = FEEDBACK_PATTERN_DISCALLCONNECT; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_MINUTEMINDER: + outPattern = FEEDBACK_PATTERN_MINUTEMINDER; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_VIBRATION: + outPattern = FEEDBACK_PATTERN_VIBRATION; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SHUTTER: + outPattern = FEEDBACK_PATTERN_SHUTTER; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_LIST_REORDER: + outPattern = FEEDBACK_PATTERN_LIST_REORDER; + break; + case Tizen::Ui::_RESOURCE_FEEDBACK_PATTERN_SLIDER_SWEEP: + outPattern = FEEDBACK_PATTERN_SLIDER_SWEEP; + break; + default: + break; + } + return outPattern; +} } namespace Tizen { namespace Graphics @@ -116,17 +279,19 @@ _CreateCoordinateTransformer(_ICoordinateSystemTransformer*& pTransformer, int s namespace Tizen { namespace Ui { + +int _SCREEN_HEIGHT_ = 0; Color _GetDefaultBackgroundColor(void) { Color color; - _ResourceManager::GetInstance()->GetColor(L"DEFAULTCOLORTABLE::background", color); + GET_COLOR_CONFIG(BASIC::background, color); return color; } Color _GetDefaultForegroundColor(void) { Color color; - _ResourceManager::GetInstance()->GetColor(L"DEFAULTCOLORTABLE::foreground", color); + GET_COLOR_CONFIG(BASIC::foreground, color); return color; } @@ -140,9 +305,11 @@ _ResourceManager::GetInstance(void) if (pRsrcMgr == null) { pthread_once(&onceBlock, CreateInstance); + pRsrcMgr->DoPostInitialization(); } return pRsrcMgr; } + void _ResourceManager::CreateInstance(void) { @@ -163,6 +330,7 @@ _ResourceManager::_ResourceManager(void) , __systemTheme(L"") , __userTheme(L"") , __appliedUserTheme(false) + , __initializeFeedback(false) , __appBaseWidth(-1) , __appBaseHeight(-1) , __targetWidth(0) @@ -182,12 +350,12 @@ _ResourceManager::_ResourceManager(void) int appLogicalResolution = _CoordinateSystem::GetInstance()->GetLogicalResolutionInt(); - if (_CreateCoordinateTransformer(__pTransformer,DEFAULT_SCREEN_WIDTH, BASE_SCREEN_SIZE_NORMAL, Dimension(appLogicalResolution, appLogicalResolution), BASE_SCREEN_SIZE_NORMAL) != E_SUCCESS) + if (_CreateCoordinateTransformer(__pTransformer,DEFAULT_SCREEN_WIDTH, _CoordinateSystem::GetInstance()->GetLogicalBaseScreenSize(), + Dimension(appLogicalResolution, appLogicalResolution), _CoordinateSystem::GetInstance()->GetPhysicalBaseScreenSize()) != E_SUCCESS) { SysAssert(0); } - r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.dpi", __deviceDPI); SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] system error occurred"); @@ -226,7 +394,6 @@ _ResourceManager::_ResourceManager(void) __appBaseLandscapeMode.Append(appBaseHeight); __appBaseLandscapeMode.Append(L"x"); __appBaseLandscapeMode.Append(appBaseWidth); - int _width = 0; int _height = 0; r = Tizen::System::_SystemInfoImpl::GetSysInfo("http://tizen.org/feature/screen.width", _width); @@ -244,8 +411,10 @@ _ResourceManager::_ResourceManager(void) __targetLandscapeMode.Append(L"x"); __targetLandscapeMode.Append(_width); + Dimension dim = _CoordinateSystemUtils::InverseTransform(Dimension(_Screen::GetWidth(), _Screen::GetHeight())); + __logicalWidth = dim.width; + __logicalHeight = dim.height; LoadThemeInformation(__systemTheme, __userTheme); - // theme 2.0 __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT] = new (std::nothrow) MapContainer(); SysTryReturnVoidResult(NID_UI, __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT], E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); @@ -254,10 +423,8 @@ _ResourceManager::_ResourceManager(void) { SysAssert(0); } - __pStringLoader = new (std::nothrow) StringLoader(); SysTryReturnVoidResult(NID_UI, __pStringLoader, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - SetSystemColor(); } bool @@ -265,32 +432,43 @@ _ResourceManager::InitializeTheme(MapContainer& mapContainer) { bool r = false; String themeFile(L""); - mapContainer.CreateMap(RESOURCE_TYPE_SHAPE); mapContainer.CreateMap(RESOURCE_TYPE_FIXED_VALUE); mapContainer.CreateMap(RESOURCE_TYPE_DIMENSION); mapContainer.CreateMap(RESOURCE_TYPE_IMAGE); mapContainer.CreateMap(RESOURCE_TYPE_COLOR); + mapContainer.CreateMap(RESOURCE_TYPE_ANIMATION); mapContainer.SetResolution(__appBasePortraitMode); themeFile = String(L"/usr/share/osp/themes/"+__systemTheme + ".xml"); ConfigParser* pParser = new (std::nothrow) ConfigParser(); SysTryReturn(NID_UI, pParser, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); r = pParser->Parse(themeFile, mapContainer); - LoadConfig(__appBasePortraitMode, mapContainer); - + LoadConfig(__appBasePortraitMode, mapContainer, __appBaseWidth, __appBaseHeight); if (__userTheme.GetLength() > 0) { themeFile = String(_AppInfo::GetAppRootPath()+L"res/themes/" +__userTheme + L"/" +__userTheme + ".xml"); r = pParser->Parse(themeFile, mapContainer); } - delete pParser; return r; } void -_ResourceManager::LoadConfig(const String& resolution, MapContainer& mapContainer) +_ResourceManager::LoadConfig(const String& resolution, MapContainer& mapContainer, int width, int height) { + _ICoordinateSystemTransformer* pTransformer = _CoordinateSystem::GetTransformerN(__appBaseWidth, _CoordinateSystem::GetInstance()->GetLogicalBaseScreenSize(), + Dimension(width, height), BASE_SCREEN_SIZE_NORMAL); + + if (pTransformer) + { + _SCREEN_HEIGHT_ = pTransformer->Transform(__logicalHeight); + } + else + { + _SCREEN_HEIGHT_ = __logicalHeight; + } + + SysLog(NID_UI, "_SCREEN_HEIGHT_ : %d, resolution : %ls", _SCREEN_HEIGHT_, resolution.GetPointer()); int count = ConfigLoader::GetInstance()->GetInitFuncCount(); for (int i = 0; i < count; i++) { @@ -301,7 +479,19 @@ _ResourceManager::LoadConfig(const String& resolution, MapContainer& mapContaine func(mapContainer, resolution); } } + delete pTransformer; +} + +void +_ResourceManager::DoPostInitialization(void) +{ + if (_AppInfo::IsOspCompat()) + { + SysLog(NID_UI, "Compatibility symbols are loaded."); + SetSystemColor(); + } } + MapContainer* _ResourceManager::GetMapContainer(MapContainerType type) { @@ -324,7 +514,7 @@ _ResourceManager::GetMapContainer(MapContainerType type) pContainer->CreateMap(RESOURCE_TYPE_SHAPE); pContainer->CreateMap(RESOURCE_TYPE_DIMENSION); pContainer->CreateMap(RESOURCE_TYPE_FIXED_VALUE); - LoadConfig(__appBaseLandscapeMode, *pContainer); + LoadConfig(__appBaseLandscapeMode, *pContainer, __appBaseWidth, __appBaseHeight); __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE] = pContainer; } break; @@ -335,14 +525,23 @@ _ResourceManager::GetMapContainer(MapContainerType type) } else { - pContainer = new (std::nothrow) MapContainer(); - SysTryReturn(NID_UI, pContainer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pContainer->SetResolution(__defaultPortraitMode); - pContainer->CreateMap(RESOURCE_TYPE_SHAPE); - pContainer->CreateMap(RESOURCE_TYPE_DIMENSION); - pContainer->CreateMap(RESOURCE_TYPE_FIXED_VALUE); - LoadConfig(__defaultPortraitMode, *pContainer); - __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = pContainer; + if(__defaultPortraitMode == __appBasePortraitMode) + { + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]; + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE]; + pContainer = __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT]; + } + else + { + pContainer = new (std::nothrow) MapContainer(); + SysTryReturn(NID_UI, pContainer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); + pContainer->SetResolution(__defaultPortraitMode); + pContainer->CreateMap(RESOURCE_TYPE_SHAPE); + pContainer->CreateMap(RESOURCE_TYPE_DIMENSION); + pContainer->CreateMap(RESOURCE_TYPE_FIXED_VALUE); + LoadConfig(__defaultPortraitMode, *pContainer, DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT); + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = pContainer; + } } break; case MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE: @@ -352,14 +551,23 @@ _ResourceManager::GetMapContainer(MapContainerType type) } else { - pContainer = new (std::nothrow) MapContainer(); - SysTryReturn(NID_UI, pContainer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - pContainer->SetResolution(__defaultLandscapeMode); - pContainer->CreateMap(RESOURCE_TYPE_SHAPE); - pContainer->CreateMap(RESOURCE_TYPE_DIMENSION); - pContainer->CreateMap(RESOURCE_TYPE_FIXED_VALUE); - LoadConfig(__defaultLandscapeMode, *pContainer); - __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = pContainer; + if(__defaultPortraitMode == __appBasePortraitMode) + { + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]; + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE]; + pContainer = __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE]; + } + else + { + pContainer = new (std::nothrow) MapContainer(); + SysTryReturn(NID_UI, pContainer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); + pContainer->SetResolution(__defaultLandscapeMode); + pContainer->CreateMap(RESOURCE_TYPE_SHAPE); + pContainer->CreateMap(RESOURCE_TYPE_DIMENSION); + pContainer->CreateMap(RESOURCE_TYPE_FIXED_VALUE); + LoadConfig(__defaultLandscapeMode, *pContainer, DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT); + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = pContainer; + } } break; default: @@ -376,14 +584,31 @@ _ResourceManager::~_ResourceManager(void) __pTransformer = null; delete __pFallbackList; __pFallbackList = null; + bool deleteDefaultMap = true; + if (__pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT] == __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT]) + { + deleteDefaultMap = false; + } delete __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]; __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT] = null; delete __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE]; __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE] = null; - delete __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT]; - __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = null; - delete __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE]; - __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = null; + + if (deleteDefaultMap) + { + delete __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT]; + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT] = null; + delete __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE]; + __pMapContainer[MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE] = null; + } + + if (__initializeFeedback) + { + if(feedback_deinitialize() != FEEDBACK_ERROR_NONE) + { + SysAssert(0); + } + } } void _ResourceManager::ReloadTheme(Tizen::Base::String& themeName, bool userdefine) @@ -403,37 +628,31 @@ _ResourceManager::GetBitmapInternalN(const String& fileName, BitmapPixelFormat p { result r = E_SYSTEM; Bitmap* pTempBitmap = null; - pTempBitmap = new (std::nothrow) Bitmap; - SysTryReturn(NID_UI, pTempBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(r)); - - r = _BitmapImpl::GetInstance(*pTempBitmap)->Construct(fileName, pixelFormat); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - pBitmap = pTempBitmap; - return r; - -CATCH: - delete pTempBitmap; - return r; -} - -result -_ResourceManager::GetBitmapN(const String& bitmapId, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, Bitmap*& pBitmap) -{ - result r = E_SYSTEM; - String* pFileName = null; - r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetImageMap()->GetValue(bitmapId, pFileName); - if (r == E_SUCCESS) + int foundFolderWidth = 0; + String fullName = FindImagePath(fileName, foundFolderWidth); + if(foundFolderWidth == __targetWidth) + { + pTempBitmap = new (std::nothrow) Bitmap; + SysTryReturn(NID_UI, pTempBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(r)); + r = _BitmapImpl::GetInstance(*pTempBitmap)->Construct(fullName, pixelFormat); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + pBitmap = pTempBitmap; + return r; + } + else { - int foundFolderWidth = 0; - String fullName = FindImagePath(*pFileName, foundFolderWidth); - if(foundFolderWidth == __targetWidth) + if (_BitmapImpl::HasNinePatchedBitmapTag(fileName)) { - r = GetBitmapInternalN(fullName, pixelFormat, orientation, pBitmap); + pTempBitmap = new (std::nothrow) Bitmap; + SysTryReturn(NID_UI, pTempBitmap, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(r)); + r = _BitmapImpl::GetInstance(*pTempBitmap)->Construct(fullName, pixelFormat); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + pBitmap = pTempBitmap; + return r; } else { ByteBuffer* pImageBuffer = null; - Bitmap* pTempBitmap = null; int imageWidth = 0; int imageHeight = 0; MediaPixelFormat format = ConvertBitmapPixelFormatToMediaPixelFormat(pixelFormat); @@ -468,6 +687,22 @@ _ResourceManager::GetBitmapN(const String& bitmapId, BitmapPixelFormat pixelForm } } return r; +CATCH: + delete pTempBitmap; + return r; +} + +result +_ResourceManager::GetBitmapN(const String& bitmapId, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, Bitmap*& pBitmap) +{ + result r = E_SYSTEM; + String* pFileName = null; + r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetImageMap()->GetValue(bitmapId, pFileName); + if (r == E_SUCCESS) + { + r = GetBitmapInternalN(*pFileName, pixelFormat, orientation, pBitmap); + } + return r; } result @@ -495,7 +730,7 @@ _ResourceManager::GetDimension(const String& dimensionId, _ControlOrientation or result r = E_SUCCESS; Dimension dim(0, 0); - Dimension* pDimension = null; + FloatDimension* pDimension = null; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT)->GetDimensionMap()->GetValue(dimensionId, pDimension); @@ -514,7 +749,7 @@ _ResourceManager::GetDimension(const String& dimensionId, _ControlOrientation or } if (r == E_SUCCESS) { - dim = *pDimension; + dim.SetSize(pDimension->width, pDimension->height); } if (r != E_SUCCESS) @@ -526,57 +761,177 @@ _ResourceManager::GetDimension(const String& dimensionId, _ControlOrientation or { dimension = dim; } + + return r; +} + +result +_ResourceManager::GetDimension(const Tizen::Base::String& dimensionId, _ControlOrientation orientation, Tizen::Graphics::FloatDimension& dimension) +{ + result r = E_SUCCESS; + FloatDimension dim(0, 0); + + FloatDimension* pDimension = null; + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT)->GetDimensionMap()->GetValue(dimensionId, pDimension); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetDimensionMap()->GetValue(dimensionId, pDimension); + } + } else { - return E_SYSTEM; + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetDimensionMap()->GetValue(dimensionId, pDimension); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT)->GetDimensionMap()->GetValue(dimensionId, pDimension); + } + } + if (r == E_SUCCESS) + { + dim = *pDimension; + } + + if (r != E_SUCCESS) + { + r = GetDefaultShapeWithScaling(dimensionId, orientation, dim); + } + + if (r == E_SUCCESS) + { + dimension = dim; } return r; } result +_ResourceManager::GetAnimationN(const String& animationId, ArrayList*& pList) +{ + ResourceAnimationFrameList* pFrameList = null; + AnimationFrame* pFrame = null; + Bitmap* pBitmap = null; + + result r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetAnimationMap()->GetValue(animationId, pFrameList); + SysTryReturnResult(NID_UI, r == E_SUCCESS, E_SYSTEM,"System error is occured."); + + if (pFrameList == null) + { + return E_SYSTEM; + } + Tizen::Base::Collection::LinkedListT* pAnimationList = static_cast* >(pFrameList->GetAnimationList()); + if (pAnimationList == null) + { + return E_SYSTEM; + } + int count = pAnimationList->GetCount(); + if (count == 0) + { + return E_SYSTEM; + } + pList = new (std::nothrow) ArrayList(); + int i = 0; + for (; i < count ; i++) + { + ResourceAnimationFrame frame; + r = pAnimationList->GetAt(i, frame); + SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM,"System error is occured."); + r = GetBitmapInternalN(frame.__fileName, BITMAP_PIXEL_FORMAT_ARGB8888, _CONTROL_ORIENTATION_PORTRAIT, pBitmap); + SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM,"System error is occured."); + pFrame = new (std::nothrow) AnimationFrame(*pBitmap, frame.__duration); + pList->Add(pFrame); + delete pBitmap; + } + return E_SUCCESS; + +CATCH: + delete pBitmap; + delete pFrame; + delete pList; + pList = null; + return E_SYSTEM; +} +result _ResourceManager::GetShape(const String& shapeId, _ControlOrientation orientation, int& value) { result r = E_SUCCESS; - Integer integer(-1); + int outValue(-1); - Integer* pInteger = null; + Float* pFloat = null; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pInteger); + r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); } } else { - r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); if (r != E_SUCCESS) { - r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pInteger); + r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pFloat); } } if (r == E_SUCCESS) { - integer = *pInteger; + outValue = pFloat->ToInt(); } if (r != E_SUCCESS) { - r = GetDefaultShapeWithScaling(shapeId, orientation, integer); + r = GetDefaultShapeWithScaling(shapeId, orientation, outValue); } if (r == E_SUCCESS) { - value = integer.ToInt(); + value = outValue; + } + + return r; +} + +result +_ResourceManager::GetShape(const Tizen::Base::String& shapeId, _ControlOrientation orientation, float& value) +{ + result r = E_SUCCESS; + float outValue(-1); + + Float* pFloat = null; + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); + } } else { - return E_SYSTEM; + r = GetMapContainer(MAP_CONTAINER_TYPE_APP_BASE_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); + if (r != E_SUCCESS) + { + r = __pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT]->GetShapeMap()->GetValue(shapeId, pFloat); + } } + if (r == E_SUCCESS) + { + outValue = pFloat->ToFloat(); + } + + if (r != E_SUCCESS) + { + r = GetDefaultShapeWithScaling(shapeId, orientation, outValue); + } + + if (r == E_SUCCESS) + { + value = outValue; + } return r; } @@ -584,23 +939,22 @@ result _ResourceManager::GetFixedValue(const String& fixedValueId, _ControlOrientation orientation, int& value) { result r = E_SUCCESS; - Integer integer(-1); - Integer* pInteger = null; + Float* pFloat = null; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); } } else { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); } } @@ -608,34 +962,76 @@ _ResourceManager::GetFixedValue(const String& fixedValueId, _ControlOrientation { if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pFloat); } } else { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pFloat); } } } if (r == E_SUCCESS) { - integer = *pInteger; + value = pFloat->ToInt(); } - if (r == E_SUCCESS) + return r; +} + +result +_ResourceManager::GetFixedValue(const Tizen::Base::String& fixedValueId, _ControlOrientation orientation, float& value) +{ + result r = E_SUCCESS; + Float* pFloat = null; + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - value = integer.ToInt(); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); + if (r != E_SUCCESS) + { + + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); + } } else { - return E_SYSTEM; + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetFixedValueMap()->GetValue(fixedValueId, pFloat); + } + } + + if (r != E_SUCCESS) + { + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pFloat); + } + } + else + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(fixedValueId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(fixedValueId, pFloat); + } + } + } + + if (r == E_SUCCESS) + { + value = pFloat->ToFloat(); } return r; @@ -653,35 +1049,62 @@ _ResourceManager::IsCustomBitmap(const Tizen::Base::String& bitmapId) } result -_ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrientation orientation, Integer& integer) +_ResourceManager::PlayFeedback(_ResourceFeedbackPattern pattern) +{ + if (unlikely(__initializeFeedback == false)) + { + feedback_error_e error = (feedback_error_e)feedback_initialize(); + if(error != FEEDBACK_ERROR_NONE) + { + SysAssert(0); + } + __initializeFeedback = true; + } + feedback_pattern_e playPattern = Convert_ResourceFeedbackPatternTofeedback_pattern_e(pattern); + int r = feedback_play(playPattern); + if (r == FEEDBACK_ERROR_NONE) + { + SysLog(NID_UI, "It succeeded to play feedback."); + return E_SUCCESS; + } + else + { + SysLog(NID_UI, "It failed to play feedback."); + return E_SYSTEM; + } + return E_SUCCESS; +} + +result +_ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrientation orientation, int& integer) { result r = E_SUCCESS; - Integer* pInteger = null; + Float* pFloat = null; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); } } else { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); if (r != E_SUCCESS) { - r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pInteger); + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pFloat); } } if (r == E_SUCCESS) { - integer = *pInteger; + integer = pFloat->ToInt(); } if (r == E_SUCCESS) { - int temp = __pTransformer->Transform(integer.ToInt()); - if (temp == 0 && integer.ToInt() > 0) + int temp = __pTransformer->Transform(integer); + if (temp == 0 && integer > 0) { integer = 1; } @@ -694,11 +1117,73 @@ _ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrie } result +_ResourceManager::GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, Tizen::Graphics::FloatDimension& dimension) +{ + result r = E_SUCCESS; + FloatDimension dim(0,0); + FloatDimension* pDimension = null; + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetDimensionMap()->GetValue(shapeId, pDimension); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetDimensionMap()->GetValue(shapeId, pDimension); + } + } + else + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetDimensionMap()->GetValue(shapeId, pDimension); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetDimensionMap()->GetValue(shapeId, pDimension); + } + } + if (r == E_SUCCESS) + { + dimension = __pTransformer->Transform(*pDimension); + } + + return r; +} + +result +_ResourceManager::GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, float& outValue) +{ + result r = E_SUCCESS; + Float* pFloat = null; + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); + } + } + else + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE)->GetShapeMap()->GetValue(shapeId, pFloat); + if (r != E_SUCCESS) + { + r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetShapeMap()->GetValue(shapeId, pFloat); + } + } + + if (r == E_SUCCESS) + { + outValue = pFloat->ToFloat(); + outValue = __pTransformer->Transform(outValue); + } + + return r; +} + +result _ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrientation orientation, Dimension& dimension) { result r = E_SUCCESS; Dimension dim(0,0); - Dimension* pDimension = null; + FloatDimension* pDimension = null; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { r = GetMapContainer(MAP_CONTAINER_TYPE_DEFAULT_PORTRAIT)->GetDimensionMap()->GetValue(shapeId, pDimension); @@ -717,7 +1202,7 @@ _ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrie } if (r == E_SUCCESS) { - dim = *pDimension; + dim.SetSize(pDimension->width, pDimension->height); } if (r == E_SUCCESS) @@ -739,7 +1224,7 @@ _ResourceManager::GetDefaultShapeWithScaling(const String& shapeId, _ControlOrie result _ResourceManager::LoadThemeInformation(String& systemTheme, String& userTheme) { - AppId appId = _AppInfo::GetAppId(); + AppId appId = _AppInfo::GetPackageId(); IMap* pList = null; pList = _PackageManagerImpl::GetInstance()->GetUiThemeListN(appId); @@ -802,73 +1287,73 @@ _ResourceManager::SetSystemColor(void) pColor = GetSystemColor(L"TITLE_TEXT"); if (pColor != null) { - GetColor("HEADER::TITLE_TEXT_NORMAL", *pColor); + GET_COLOR_CONFIG(HEADER::TITLE_TEXT_NORMAL, *pColor); } pColor = GetSystemColor(L"BODY_TEXT"); if (pColor != null) { - GetColor("BUTTON::TEXT_NORMAL", *pColor); + GET_COLOR_CONFIG(BUTTON::TEXT_NORMAL, *pColor); } pColor = GetSystemColor(L"FOREGROUND"); if (pColor != null) { - GetColor("foreground", *pColor); + GET_COLOR_CONFIG(BASIC::foreground, *pColor); } pColor = GetSystemColor(L"BACKGROUND"); if (pColor != null) { - GetColor("background", *pColor); + GET_COLOR_CONFIG(BASIC::background, *pColor); } pColor = GetSystemColor(L"LIST_BACKGROUND"); if (pColor != null) { - GetColor("FORM::BG_NORMAL", *pColor); + GET_COLOR_CONFIG(FORM::BG_NORMAL, *pColor); } pColor = GetSystemColor(L"FORM_BACKGROUND"); if (pColor != null) { - GetColor("FORM::BG_NORMAL", *pColor); + GET_COLOR_CONFIG(FORM::BG_NORMAL, *pColor); } pColor = GetSystemColor(L"FORM_GROUP_BACKGROUND"); if (pColor != null) { - GetColor("DEFAULTCOLORTABLE::form_group_list_bg", *pColor); + GET_COLOR_CONFIG(PANEL::GROUPED_STYLE_BG_NORMAL, *pColor); } pColor = GetSystemColor(L"POPUP_BACKGROUND"); if (pColor != null) { - GetColor("POPUP::BG_NORMAL", *pColor); + GET_COLOR_CONFIG(POPUP::BG_NORMAL, *pColor); } pColor = GetSystemColor(L"GROUP_ITEM_TEXT"); if (pColor != null) { - GetColor("CHECKBUTTON::TEXT_NORMAL", *pColor); + GET_COLOR_CONFIG(CHECKBUTTON::TEXT_NORMAL, *pColor); } pColor = GetSystemColor(L"LIST_ITEM_TEXT"); if (pColor != null) { - GetColor("LISTVIEW::ITEM_TEXT_NORMAL", *pColor); + GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_NORMAL, *pColor); } pColor = GetSystemColor(L"LIST_ITEM_PRESSED_TEXT"); if (pColor != null) { - GetColor("LISTVIEW::ITEM_TEXT_PRESSED", *pColor); + GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_PRESSED, *pColor); } pColor = GetSystemColor(L"LIST_ITEM_HIGHLIGHTED_TEXT"); if (pColor != null) { - GetColor("LISTVIEW::ITEM_TEXT_HIGHLIGHTED", *pColor); + GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_HIGHLIGHTED, *pColor); } //fall through @@ -877,10 +1362,10 @@ CATCH: return; } bool -_ResourceManager::GetDensityDirectory(String directoryName, float scaleFactor) +_ResourceManager::GetDensityDirectory(const String& directoryName, float& scaleFactor) { - int denominator = 0; - int numerator = 0; + float denominator = 0.0; + float numerator = 0.0; if(!(directoryName.StartsWith(L"screen-density",0))) { return false; @@ -888,19 +1373,19 @@ _ResourceManager::GetDensityDirectory(String directoryName, float scaleFactor) if (__deviceDPI >= DPI_FOR_XHIGH) { - numerator = 9; + numerator = 9.0; } else if (__deviceDPI >= DPI_FOR_HIGH) { - numerator = 6; + numerator = 6.0; } else if (__deviceDPI >= DPI_FOR_MIDDLE) { - numerator = 4; + numerator = 4.0; } else if (__deviceDPI < DPI_FOR_MIDDLE && __deviceDPI > DPI_FOR_LOW) { - numerator = 3; + numerator = 3.0; } else { @@ -909,31 +1394,31 @@ _ResourceManager::GetDensityDirectory(String directoryName, float scaleFactor) if(directoryName.Contains(L"xhigh")) { - denominator = 9; + denominator = 9.0; } else if(directoryName.Contains(L"high")) { - denominator = 6; + denominator = 6.0; } else if(directoryName.Contains(L"middle")) { - denominator = 4; + denominator = 4.0; } else if(directoryName.Contains(L"low")) { - denominator = 3; + denominator = 3.0; } else { return false; } - scaleFactor = (float)((float)numerator / (float)denominator); + scaleFactor = numerator / denominator; return true; } bool -_ResourceManager::GetResolutionDirectory(String directoryName, float scaleFactor) +_ResourceManager::GetResolutionDirectory(const String& directoryName, float& scaleFactor) { if(!(directoryName.Contains(L"0"))) { @@ -949,12 +1434,14 @@ _ResourceManager::GetResolutionDirectory(String directoryName, float scaleFactor if(directoryName.SubString(0, index - 1, width)) { - int denominator = 0; - int numerator = 0; - if(Integer::Parse(width, denominator) == E_SUCCESS) + int denominatorInt = 0; + float denominator = 0; + float numerator = 0; + if(Integer::Parse(width, denominatorInt) == E_SUCCESS) { + denominator = (float)denominatorInt; numerator = __targetWidth; - scaleFactor = (float)((float)numerator / (float)denominator); + scaleFactor = numerator / denominator; return true; } } @@ -970,7 +1457,7 @@ _ResourceManager::FindImagePath(const String& fileName, int& foundFolderWidth) if(__userTheme.GetLength() > 0) { - String resDirectory = _AppInfo::GetAppRootPath() + L"res/theme/res"; + String resDirectory = _AppInfo::GetAppRootPath() + L"res/themes/"+__userTheme; if(__pFallbackList == null) { __pFallbackList = new (std::nothrow) ArrayListT; diff --git a/src/ui/FUi_SystemUtilImpl.cpp b/src/ui/FUi_SystemUtilImpl.cpp new file mode 100644 index 0000000..7a3860e --- /dev/null +++ b/src/ui/FUi_SystemUtilImpl.cpp @@ -0,0 +1,308 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include +#include +#include +#include + +//to avoid camera key code definition +#ifdef KEY_CAMERA +#undef KEY_CAMERA +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include "FUi_UiKeyEvent.h" + +using namespace Tizen::Security; +using namespace Tizen::Graphics; +using namespace Tizen::Base; + +namespace Tizen { namespace Ui +{ + +struct ConvertKeys +{ + _KeyCode code; + const char* pName; +}; + +const ConvertKeys KeyCodeMap[] = { + { _KEY_ESC, "Escape" }, + { _KEY_GRAVE, "grave" }, + { _KEY_1, "1" }, + { _KEY_2, "2" }, + { _KEY_3, "3" }, + { _KEY_4, "4" }, + { _KEY_5, "5" }, + { _KEY_6, "6" }, + { _KEY_7, "7" }, + { _KEY_8, "8" }, + { _KEY_9, "9" }, + { _KEY_0, "0" }, + { _KEY_MINUS, "minus" }, + { _KEY_EQUAL, "equal" }, + { _KEY_BACKSLASH, "backslash" }, + { _KEY_BACKSPACE, "BackSpace" }, + { _KEY_TAB, "Tab" }, + { _KEY_Q, "q" }, + { _KEY_W, "w" }, + { _KEY_E, "e" }, + { _KEY_R, "r" }, + { _KEY_T, "t" }, + { _KEY_Y, "y" }, + { _KEY_U, "u" }, + { _KEY_I, "i" }, + { _KEY_O, "o" }, + { _KEY_P, "p" }, + { _KEY_LBRACKET, "bracketleft" }, + { _KEY_RBRACKET, "bracketright" }, + { _KEY_ENTER, "Return" }, + { _KEY_CAPSLOCK, "Caps_Lock" }, + { _KEY_A, "a" }, + { _KEY_S, "s" }, + { _KEY_D, "d" }, + { _KEY_F, "f" }, + { _KEY_G, "g" }, + { _KEY_H, "h" }, + { _KEY_J, "j" }, + { _KEY_K, "k" }, + { _KEY_L, "l" }, + { _KEY_SEMICOLON, "semicolon" }, + { _KEY_APOSTROPHE, "apostrophe" }, + { _KEY_SHIFT_L, "Shift_L" }, + { _KEY_Z, "z" }, + { _KEY_X, "x" }, + { _KEY_C, "c" }, + { _KEY_V, "v" }, + { _KEY_B, "b" }, + { _KEY_N, "n" }, + { _KEY_M, "m" }, + { _KEY_COMMA, "comma" }, + { _KEY_DOT, "period" }, + { _KEY_SLASH, "slash" }, + { _KEY_SHIFT_R, "Shift_R" }, + { _KEY_CTRL_L, "Control_L" }, + { _KEY_LALT, "Alt_L" }, + { _KEY_SPACE, "space" }, + { _KEY_RALT, "Alt_R" }, + { _KEY_CTRL_R, "Control_R" }, + { _KEY_FN_1, "F1" }, + { _KEY_FN_2, "F2" }, + { _KEY_FN_3, "F3" }, + { _KEY_FN_4, "F4" }, + { _KEY_FN_5, "F5" }, + { _KEY_FN_6, "F6" }, + { _KEY_FN_7, "F7" }, + { _KEY_FN_8, "F8" }, + { _KEY_FN_9, "F9" }, + { _KEY_FN_10, "F10" }, + { _KEY_FN_11, "F11" }, + { _KEY_FN_12, "F12" }, + { _KEY_NUM_LOCK, "Num_Lock" }, + { _KEY_NUMPAD_DIVIDE, "KP_Divide" }, + { _KEY_NUMPAD_MULTIPLY, "KP_Multiply" }, + { _KEY_NUMPAD_SUBTRACT, "KP_Subtract" }, + { _KEY_NUMPAD_7, "KP_Home" }, + { _KEY_NUMPAD_8, "KP_Up" }, + { _KEY_NUMPAD_9, "KP_Prior" }, + { _KEY_NUMPAD_4, "KP_Left" }, + { _KEY_NUMPAD_5, "KP_Begin" }, + { _KEY_NUMPAD_6, "KP_Right" }, + { _KEY_NUMPAD_ADD, "KP_Add" }, + { _KEY_NUMPAD_1, "KP_End" }, + { _KEY_NUMPAD_2, "KP_Down" }, + { _KEY_NUMPAD_3, "KP_Next" }, + { _KEY_NUMPAD_0, "KP_Insert" }, + { _KEY_NUMPAD_DOT, "KP_Delete" }, + { _KEY_NUMPAD_ENTER, "KP_Enter" }, + { _KEY_PRINT, "Print" }, + { _KEY_SCROLL_LOCK, "Scroll_Lock" }, + { _KEY_PAUSEBREAK, "Pause" }, + { _KEY_INSERT, "Insert" }, + { _KEY_HOME_BUTTON, "Home" }, + { _KEY_PAGE_UP, "Prior" }, + { _KEY_DELETE, "Delete" }, + { _KEY_END_BUTTON, "End" }, + { _KEY_PAGE_DOWN, "Next" }, + { _KEY_UP, "Up" }, + { _KEY_LEFT, "Left" }, + { _KEY_DOWN, "Down" }, + { _KEY_RIGHT, "Right" }, + + //{ _KEY_SIDE_UP, "XF86AudioRaiseVolume" }, + //{ _KEY_SIDE_DOWN, "XF86AudioLowerVolume" }, + //{ _KEY_POWER_HOLD, "XF86PowerOff" }, + { _KEY_STOP, "XF86Stop" } +}; + +struct _DisplayDeleter +{ + void operator()(Display* pDisplay) + { + XCloseDisplay(pDisplay); + } +}; + +_SystemUtilImpl::_SystemUtilImpl(void) +{ +} + +_SystemUtilImpl::~_SystemUtilImpl(void) +{ +} + +result +_SystemUtilImpl::GenerateKeyEvent(Tizen::Ui::KeyEventType KeyEvent, Tizen::Ui::_KeyCode keyCode) +{ + result r = E_SUCCESS; + + Display* pDisplay = (Display*)ecore_x_display_get(); + SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!"); + + std::unique_ptr pDpy(XOpenDisplay(NULL)); + SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); + + int key = -1; + + for (unsigned int idx = 0; idx < sizeof(KeyCodeMap) / sizeof(ConvertKeys); ++idx) + { + if (KeyCodeMap[idx].code == keyCode) + { + KeySym keySym = XStringToKeysym(KeyCodeMap[idx].pName); + key = (int) XKeysymToKeycode(pDpy.get(), keySym); + break; + } + } + + if (key == -1) + { + SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Unsupported KeyCode argument."); + return E_INVALID_ARG; + } + + switch (KeyEvent) + { + case KEY_EVENT_TYPE_PRESSED: + XTestFakeKeyEvent(pDisplay, key, true, CurrentTime); + break; + + case KEY_EVENT_TYPE_RELEASED: + XTestFakeKeyEvent(pDisplay, key, false, CurrentTime); + break; + + default: + SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Invalid KeyEventType argument."); + return E_INVALID_ARG; + } + + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return r; +} + +result +_SystemUtilImpl::GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point) +{ + return GenerateTouchEvent(touchEvent, FloatPoint(const_cast(point).x, const_cast(point).y)); +} + +result +_SystemUtilImpl::GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::FloatPoint& point) +{ + result r = E_SUCCESS; + + Display* pDisplay = (Display*)ecore_x_display_get(); + SysTryReturnResult(NID_UI, pDisplay != null, E_SYSTEM, "[E_SYSTEM] pDisplay is invalid. something wrong!"); + + std::unique_ptr pDpy(XOpenDisplay(NULL)); + SysTryReturnResult(NID_UI, pDpy.get() != null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); + + int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get())); + int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get())); + + if (( point.x<0 || point.x>width) || (point.y<0 || point.y>height)) + { + SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Out of bounds x, y argument."); + return E_INVALID_ARG; + } + + int screenNumber = 0; //main screen + int button = 1; //left button + + switch (touchEvent) + { + case TOUCH_EVENT_TYPE_PRESSED: + XWarpPointer(pDisplay, None, XRootWindow(pDisplay, 0), 0, 0, 0, 0, point.x, point.y); + XTestFakeButtonEvent(pDisplay, button, true, CurrentTime); + break; + + case TOUCH_EVENT_TYPE_RELEASED: + XWarpPointer(pDisplay, None, XRootWindow(pDisplay, 0), 0, 0, 0, 0, point.x, point.y); + XTestFakeButtonEvent(pDisplay, button, false, CurrentTime); + break; + + case TOUCH_EVENT_TYPE_MOVED: + XTestFakeMotionEvent(pDisplay, screenNumber, point.x, point.y, CurrentTime); + break; + + default: + SysLogException(NID_UI, E_INVALID_ARG, "[E_INVALID_ARG] Invalid TouchEventType argument."); + return E_INVALID_ARG; + } + + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + return r; +} + +Tizen::Graphics::Bitmap* +_SystemUtilImpl::CaptureScreenN(void) +{ + result r = E_SUCCESS; + + std::unique_ptr pDpy(XOpenDisplay(NULL)); + SysTryReturn(NID_UI, pDpy, null, E_SYSTEM, "[E_SYSTEM] pDpy is invalid. something wrong!"); + + int width = DisplayWidth(pDpy.get(), DefaultScreen(pDpy.get())); + int height = DisplayHeight(pDpy.get(), DefaultScreen(pDpy.get())); + + void* pDump = utilx_create_screen_shot(pDpy.get(), width, height); + SysTryReturn(NID_UI, pDump, null, E_SYSTEM, "[E_SYSTEM] pDump is invalid. something wrong!"); + + std::unique_ptr pBuffer(new (std::nothrow) ByteBuffer()); + SysTryReturn(NID_UI, pBuffer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure."); + + r = pBuffer->Construct(static_cast(pDump), 0, width*height*4, width*height*4); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + Tizen::Graphics::Dimension dim(width, height); + std::unique_ptr pBitmap(new (std::nothrow) Bitmap()); + SysTryReturn(NID_UI, pBitmap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failure."); + + r = pBitmap->Construct(*pBuffer, dim, BITMAP_PIXEL_FORMAT_ARGB8888); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + utilx_release_screen_shot(); + + return pBitmap.release(); +} + +}} //Tizen::Ui diff --git a/src/ui/FUi_TouchEventInfoImpl.cpp b/src/ui/FUi_TouchEventInfoImpl.cpp index 24da2fb..f2edcc5 100644 --- a/src/ui/FUi_TouchEventInfoImpl.cpp +++ b/src/ui/FUi_TouchEventInfoImpl.cpp @@ -79,12 +79,24 @@ _TouchEventInfoImpl::GetPointId(void) const Point _TouchEventInfoImpl::GetStartPosition(void) const { + return Point(__startPosition.x, __startPosition.y); +} + +FloatPoint +_TouchEventInfoImpl::GetStartPositionF(void) const +{ return __startPosition; } Point _TouchEventInfoImpl::GetCurrentPosition(void) const { + return Point(__currentPosition.x, __currentPosition.y); +} + +FloatPoint +_TouchEventInfoImpl::GetCurrentPositionF(void) const +{ return __currentPosition; } diff --git a/src/ui/FUi_TouchFlickGestureDetector.cpp b/src/ui/FUi_TouchFlickGestureDetector.cpp index 0aab8ac..170bc87 100644 --- a/src/ui/FUi_TouchFlickGestureDetector.cpp +++ b/src/ui/FUi_TouchFlickGestureDetector.cpp @@ -554,6 +554,13 @@ _TouchFlickGestureDetector::GetDistance(int& x, int &y) const y = __yDistance; } +void +_TouchFlickGestureDetector::GetDistance(float& x, float &y) const +{ + x = __xDistance; + y = __yDistance; +} + int _TouchFlickGestureDetector::GetDuration(void) const { diff --git a/src/ui/FUi_TouchFlickGestureDetectorImpl.cpp b/src/ui/FUi_TouchFlickGestureDetectorImpl.cpp index 575a140..810f498 100644 --- a/src/ui/FUi_TouchFlickGestureDetectorImpl.cpp +++ b/src/ui/FUi_TouchFlickGestureDetectorImpl.cpp @@ -93,6 +93,14 @@ _TouchFlickGestureDetectorImpl::GetDistance(int &x, int &y) const return E_SUCCESS; } +result +_TouchFlickGestureDetectorImpl::GetDistance(float &x, float &y) const +{ + GetCore().GetDistance(x, y); + + return E_SUCCESS; +} + int _TouchFlickGestureDetectorImpl::GetDuration(void) const { diff --git a/src/ui/FUi_TouchGestureDetector.cpp b/src/ui/FUi_TouchGestureDetector.cpp index da4d81e..318aa07 100644 --- a/src/ui/FUi_TouchGestureDetector.cpp +++ b/src/ui/FUi_TouchGestureDetector.cpp @@ -1172,4 +1172,14 @@ _TouchGestureDetector::OnTouchCanceled(const _Control& source, const _TouchInfo& return false; } +void +_TouchGestureDetector::OnTouchGestureDetectorAdded(void) +{ +} + +void +_TouchGestureDetector::OnTouchGestureDetectorRemoved(void) +{ +} + }} // Tizen::Ui diff --git a/src/ui/FUi_TouchGestureTimerManager.cpp b/src/ui/FUi_TouchGestureTimerManager.cpp index 604b8ac..9d8c693 100644 --- a/src/ui/FUi_TouchGestureTimerManager.cpp +++ b/src/ui/FUi_TouchGestureTimerManager.cpp @@ -52,6 +52,7 @@ public: return; } __pManager->SetTimerState(false); + _TouchLongPressGestureDetector* pLongPressGesture = null; _TouchGestureDetector* pGestureDetector = __pManager->GetGestureDetector(); if (pGestureDetector) @@ -82,12 +83,14 @@ public: case _TOUCH_GESTURE_DETECTOR_TYPE_LONG_PRESS: { - _TouchLongPressGestureDetector* pLongPressGesture = dynamic_cast<_TouchLongPressGestureDetector*>(pGestureDetector); + pLongPressGesture = dynamic_cast<_TouchLongPressGestureDetector*>(pGestureDetector); if (pLongPressGesture && pLongPressGesture->IsGestureStarted()) { pLongPressGesture->SetGestureStart(false); + pLongPressGesture->EnableToDeleteTimer(false); + if (pLongPressGesture->IsPressed()) { pLongPressGesture->SetDetectorState(_TOUCH_GESTURE_DETECTOR_STATE_SUCCESS); @@ -111,6 +114,14 @@ public: { __pManager->SetTimerExpiredState(true); } + + if (pLongPressGesture) + { + if (pLongPressGesture->IsTouchCanceled()) + { + pLongPressGesture->ResetGestureTimerManager(); + } + } } void SetTouchGestureTimerManager(_TouchGestureTimerManager* pManager) diff --git a/src/ui/FUi_TouchLongPressGestureDetector.cpp b/src/ui/FUi_TouchLongPressGestureDetector.cpp index 53f96dc..570135f 100644 --- a/src/ui/FUi_TouchLongPressGestureDetector.cpp +++ b/src/ui/FUi_TouchLongPressGestureDetector.cpp @@ -22,6 +22,7 @@ * This file contains the implementation of %_TouchLongPressGestureDetector class. * */ +#include #include #include #include @@ -56,6 +57,8 @@ _TouchLongPressGestureDetector::_TouchLongPressGestureDetector(void) , __touchCount(DEFAULT_TOUCH_COUNT) , __maxPointId(DEFAULT_TOUCH_COUNT-1) , __pGestureTimerManager(null) + , __touchCanceled(false) + , __deleteTimer(true) , __pLongPressInfoList(null) { result r = GetLastResult(); @@ -64,6 +67,9 @@ _TouchLongPressGestureDetector::_TouchLongPressGestureDetector(void) __pLongPressInfoList = new (std::nothrow) ArrayListT<_LongPressInfo*>; SysTryReturnVoidResult(NID_UI, __pLongPressInfoList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + //fixme : check the elm_config_longpress_timeout_get api + __duration = 500;//static_cast(elm_config_longpress_timeout_get()); + for(int i=0; i < MAX_TOUCH_COUNT; i++) { _LongPressInfo* pLongPressInfo = new (std::nothrow) _LongPressInfo; @@ -102,6 +108,8 @@ _TouchLongPressGestureDetector::~_TouchLongPressGestureDetector(void) delete __pGestureTimerManager; __pGestureTimerManager = null; + + __touchCanceled = false; } } @@ -149,12 +157,27 @@ _TouchLongPressGestureDetector::SetMoveAllowance(int allowance) return E_SUCCESS; } +result +_TouchLongPressGestureDetector::SetMoveAllowance(float allowance) +{ + SysTryReturnResult(NID_UI, allowance > 0, E_INVALID_ARG, "[E_INVALID_ARG] Argument is less than 0"); + + __moveAllowance = allowance; + return E_SUCCESS; +} + int _TouchLongPressGestureDetector::GetMoveAllowance(void) const { return __moveAllowance; } +float +_TouchLongPressGestureDetector::GetMoveAllowanceF(void) const +{ + return __moveAllowance; +} + result _TouchLongPressGestureDetector::SetTouchCount(int count) { @@ -181,6 +204,12 @@ _TouchLongPressGestureDetector::GetTouchCount(void) const return __touchCount; } +void +_TouchLongPressGestureDetector::EnableToDeleteTimer(bool deleteTimer) +{ + __deleteTimer = deleteTimer; +} + bool _TouchLongPressGestureDetector::IsPressed(void) { @@ -206,6 +235,24 @@ _TouchLongPressGestureDetector::IsPressed(void) return allPressed; } +void +_TouchLongPressGestureDetector::ResetGestureTimerManager(void) +{ + if (__pGestureTimerManager) + { + delete __pGestureTimerManager; + __pGestureTimerManager = null; + } + __touchCanceled = false; + __deleteTimer = true; +} + +bool +_TouchLongPressGestureDetector::IsTouchCanceled(void) const +{ + return __touchCanceled; +} + bool _TouchLongPressGestureDetector::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { @@ -352,9 +399,17 @@ _TouchLongPressGestureDetector::OnTouchCanceled(const _Control& source, const _T if (__pGestureTimerManager != null && __pGestureTimerManager->IsTimerExpired() == false) { __pGestureTimerManager->CancelTimer(); + __touchCanceled = true; - delete __pGestureTimerManager; - __pGestureTimerManager = null; + if (__deleteTimer) + { + delete __pGestureTimerManager; + __pGestureTimerManager = null; + } + else + { + __touchCanceled = true; + } } return false; diff --git a/src/ui/FUi_TouchLongPressGestureDetectorImpl.cpp b/src/ui/FUi_TouchLongPressGestureDetectorImpl.cpp index f7dafe6..0d0e99b 100644 --- a/src/ui/FUi_TouchLongPressGestureDetectorImpl.cpp +++ b/src/ui/FUi_TouchLongPressGestureDetectorImpl.cpp @@ -112,6 +112,20 @@ _TouchLongPressGestureDetectorImpl::GetMoveAllowance(void) const } result +_TouchLongPressGestureDetectorImpl::SetMoveAllowance(float allowance) +{ + return GetCore().SetMoveAllowance(allowance); +} + +float +_TouchLongPressGestureDetectorImpl::GetMoveAllowanceF(void) const +{ + ClearLastResult(); + + return GetCore().GetMoveAllowanceF(); +} + +result _TouchLongPressGestureDetectorImpl::SetTouchCount(int count) { return GetCore().SetTouchCount(count); diff --git a/src/ui/FUi_TouchManager.cpp b/src/ui/FUi_TouchManager.cpp index 8389f70..e1b35b3 100644 --- a/src/ui/FUi_TouchManager.cpp +++ b/src/ui/FUi_TouchManager.cpp @@ -301,10 +301,10 @@ _MultiFingerInfo::GetCurrentPointId(void) const return __currentPointId; } -Point +FloatPoint _MultiFingerInfo::GetPosition(unsigned long id) const { - Point errorPoint(-1, -1); + FloatPoint errorPoint(-1, -1); IListT<_FingerInfo*>* pFingerList = __pFingerInfoMap->GetValuesN(); if (pFingerList) @@ -337,10 +337,10 @@ _MultiFingerInfo::GetPosition(unsigned long id) const return errorPoint; } -Point +FloatPoint _MultiFingerInfo::GetScreenPoint(unsigned long id) const { - Point errorPoint(-1, -1); + FloatPoint errorPoint(-1, -1); IListT<_FingerInfo*>* pFingerList = __pFingerInfoMap->GetValuesN(); if (pFingerList) @@ -373,10 +373,10 @@ _MultiFingerInfo::GetScreenPoint(unsigned long id) const return errorPoint; } -Point +FloatPoint _MultiFingerInfo::GetStartPoint(unsigned long id) const { - Point errorPoint(-1, -1); + FloatPoint errorPoint(-1, -1); IListT<_FingerInfo*>* pFingerList = __pFingerInfoMap->GetValuesN(); if (pFingerList) @@ -497,7 +497,7 @@ _MultiFingerInfo::InitializeFingerInfo(void) } result -_MultiFingerInfo::SetFingerInfo(unsigned long pointId, const Point& point, const Point& screenPoint, const _TouchStatus status) +_MultiFingerInfo::SetFingerInfo(unsigned long pointId, const FloatPoint& point, const FloatPoint& screenPoint, const _TouchStatus status) { _FingerInfo* pFingerInfo = null; @@ -586,6 +586,7 @@ _TouchManager::_TouchManager(void) , __captureAllowOutOfBounds(false) , __isSendingDelayedEvent(true) , __touchCanceledOnGestureSuccess(false) + , __changedTouchableTarget(null) { ClearLastResult(); @@ -641,7 +642,7 @@ _TouchManager::Initialize(void) { pthread_once(&once_block, InitializeInstance); } - + } _TouchManager* @@ -656,10 +657,10 @@ _TouchManager::InitializeInstance(void) ClearLastResult(); if (__pInstance == null) -{ - __pInstance = new (std::nothrow) _TouchManager; - SysTryReturnVoidResult(NID_UI, __pInstance != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -} + { + __pInstance = new (std::nothrow) _TouchManager; + SysTryReturnVoidResult(NID_UI, __pInstance != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + } } void @@ -673,10 +674,10 @@ _TouchManager::ReleaseInstance(void) } result -_TouchManager::AddPoint(unsigned long pointId, const Point& point, _TouchStatus status) +_TouchManager::AddPoint(unsigned long pointId, const FloatPoint& point, _TouchStatus status) { - Point screenPos(point.x, point.y); - Point controlPos(0, 0); + FloatPoint screenPos(point.x, point.y); + FloatPoint controlPos(0, 0); _Control* pControl = GetTouchControlSource(); if (pControl) @@ -697,7 +698,7 @@ _TouchManager::GetPointId(unsigned long deviceId) const return __pMultiFingerInfo->GetPointId(deviceId); } -Tizen::Graphics::Point +Tizen::Graphics::FloatPoint _TouchManager::GetStartPoint(unsigned long pointId) const { return __pMultiFingerInfo->GetStartPoint(pointId); @@ -715,13 +716,13 @@ _TouchManager::GeneratePointId(const unsigned long deviceId) const return __pMultiFingerInfo->GeneratePointId(deviceId); } -Point +FloatPoint _TouchManager::GetPosition(unsigned long id) const { return __pMultiFingerInfo->GetPosition(id); } -Point +FloatPoint _TouchManager::GetScreenPoint(unsigned long id) const { return __pMultiFingerInfo->GetScreenPoint(id); @@ -801,7 +802,7 @@ _TouchManager::SetTouchCanceled(bool canceled, bool onlyTouchEvent) { if (GetTouchControlSource() && GetTouchControlSource()->IsAttachedToMainTree()) { - Point currentPoint(0, 0); + FloatPoint currentPoint(0, 0); _TouchInfo touchInfo; if (GetTouchControlSource()->IsMultiTouchEnabled()) @@ -832,6 +833,41 @@ _TouchManager::SetTouchCanceled(bool canceled, bool onlyTouchEvent) } } +void +_TouchManager::SetTouchReleased(void) +{ + if (GetTouchControlSource() && GetTouchControlSource()->IsAttachedToMainTree()) + { + FloatPoint currentPoint(0, 0); + _TouchInfo touchInfo; + + if (GetTouchControlSource()->IsMultiTouchEnabled()) + { + currentPoint.x = GetScreenPoint(GetCurrentPointId()).x; + currentPoint.y = GetScreenPoint(GetCurrentPointId()).y; + + _TouchInfo multiTouchInfo(GetCurrentPointId(), _TOUCH_RELEASED, currentPoint, false, 0); + touchInfo = multiTouchInfo; + } + else + { + currentPoint.x = GetScreenPoint(SINGLE_POINT_ID).x; + currentPoint.y = GetScreenPoint(SINGLE_POINT_ID).y; + + _TouchInfo singleTouchInfo(SINGLE_POINT_ID, _TOUCH_RELEASED, currentPoint, false, 0); + touchInfo = singleTouchInfo; + } + + _UiTouchEvent event(GetTouchControlSource()->GetHandle(), touchInfo); + + _UiEventManager* pEventManager = _UiEventManager::GetInstance(); + SysTryReturnVoidResult(NID_UI, pEventManager, E_SYSTEM, "[E_SYSTEM] _UiEventManager does not exist."); + + pEventManager->SendEvent(event); + } + SetLastResult(E_SUCCESS); +} + bool _TouchManager::IsTouchCanceledOnGestureSuccess(void) const { @@ -882,22 +918,18 @@ _TouchManager::IsInTouchMoveAllowanceBounds(const _Control& source, const _Touch return true; } - Point tmpPoint = GetStartPoint(touchInfo.GetPointId()); + FloatPoint tmpPoint = GetStartPoint(touchInfo.GetPointId()); Rectangle absBounds = source.GetAbsoluteBounds(); - Point startPoint(tmpPoint.x - absBounds.x, tmpPoint.y - absBounds.y); - Point currentPoint = touchInfo.GetCurrentPosition(); + FloatPoint startPoint(tmpPoint.x - absBounds.x, tmpPoint.y - absBounds.y); + FloatPoint currentPoint = touchInfo.GetCurrentPosition(); //SysLog(NID_UI, "[Touch Test] tmpPoint(%d, %d) absBounds(%d, %d) startPoint(%d, %d) currentPoint(%d, %d)", // tmpPoint.x, tmpPoint.y, absBounds.x, absBounds.y, startPoint.x, startPoint.y, currentPoint.x, currentPoint.y); int distance = int(hypot(abs(startPoint.x-currentPoint.x), abs(startPoint.y-currentPoint.y))); - int touchMoveAllowanceBounds = 0; - int allowanceBoundsValue[] = {3, 25, 50}; - touchMoveAllowanceBounds = allowanceBoundsValue[source.GetTouchMoveAllowance()]; - - if (distance >= touchMoveAllowanceBounds) + if (distance >= source.GetTouchPressThresholdPixel()) { pFingerInfo->SetMoveReady(true); @@ -989,4 +1021,16 @@ _TouchManager::IsSendingDelayedEvent(void) const { return __isSendingDelayedEvent; } + +void +_TouchManager::SetChangedTouchableTarget(_Control* pTarget) +{ + __changedTouchableTarget = pTarget; +} + +_Control* +_TouchManager::GetChangedTouchableTarget(void) +{ + return __changedTouchableTarget; +} } } //Tizen::Ui diff --git a/src/ui/FUi_TouchPanningGestureDetector.cpp b/src/ui/FUi_TouchPanningGestureDetector.cpp index 74b489a..aa4a505 100644 --- a/src/ui/FUi_TouchPanningGestureDetector.cpp +++ b/src/ui/FUi_TouchPanningGestureDetector.cpp @@ -251,15 +251,15 @@ _TouchPanningGestureDetector::OnTouchMoved(const _Control& source, const _Touch if (pFingerInfo) { - Point currentPoint = pFingerInfo->GetPoint(); - Point controlPosition(0,0); + FloatPoint currentPoint = pFingerInfo->GetPoint(); + FloatPoint controlPosition(0,0); _Control* pControl = GetControl(); if (pControl) { - controlPosition.x = pControl->GetAbsoluteBounds().x; - controlPosition.y = pControl->GetAbsoluteBounds().y; + controlPosition.x = pControl->GetAbsoluteBoundsF().x; + controlPosition.y = pControl->GetAbsoluteBoundsF().y; } - Point startPoint = pFingerInfo->GetStartPoint(); + FloatPoint startPoint = pFingerInfo->GetStartPoint(); startPoint.x = startPoint.x - controlPosition.x; startPoint.y = startPoint.y - controlPosition.y; @@ -371,4 +371,21 @@ _TouchPanningGestureDetector::OnTouchCanceled(const _Control& source, const _Tou return false; } +void +_TouchPanningGestureDetector::OnTouchGestureDetectorAdded(void) +{ + __touchCount = DEFAULT_TOUCH_COUNT; + __fingerCount = 0; + __maxPointId = DEFAULT_TOUCH_COUNT-1; +} + +void +_TouchPanningGestureDetector::OnTouchGestureDetectorRemoved(void) +{ + if (__pTimer) + { + __pTimer->Cancel(); + } +} + }} // Tizen::Ui diff --git a/src/ui/FUi_TouchPinchGestureDetector.cpp b/src/ui/FUi_TouchPinchGestureDetector.cpp index 9e18aeb..3ec3bff 100644 --- a/src/ui/FUi_TouchPinchGestureDetector.cpp +++ b/src/ui/FUi_TouchPinchGestureDetector.cpp @@ -178,6 +178,12 @@ _TouchPinchGestureDetector::OnTouchCanceled(const _Control& source, const _Touch Point _TouchPinchGestureDetector::GetCenterPoint(void) const { + return Point(__centerPosition.x, __centerPosition.y); +} + +FloatPoint +_TouchPinchGestureDetector::GetCenterPointF(void) const +{ return __centerPosition; } @@ -187,6 +193,12 @@ _TouchPinchGestureDetector::GetScale(void) const return __scale; } +float +_TouchPinchGestureDetector::GetScaleF(void) const +{ + return __scale; +} + int _TouchPinchGestureDetector::MeasureArea(void) { @@ -218,7 +230,7 @@ _TouchPinchGestureDetector::MeasureArea(void) //SysLog(NID_UI, "pointId = %d, x = %d, y = %d", pFingerInfo->GetPointId(), pFingerInfo->GetPoint().x, pFingerInfo->GetPoint().y); - Tizen::Graphics::Point point = pFingerInfo->GetPoint(); + Tizen::Graphics::FloatPoint point = pFingerInfo->GetPoint(); if (initialized) { diff --git a/src/ui/FUi_TouchPinchGestureDetectorImpl.cpp b/src/ui/FUi_TouchPinchGestureDetectorImpl.cpp index cee9490..330929c 100644 --- a/src/ui/FUi_TouchPinchGestureDetectorImpl.cpp +++ b/src/ui/FUi_TouchPinchGestureDetectorImpl.cpp @@ -93,6 +93,14 @@ _TouchPinchGestureDetectorImpl::GetCenterPoint(void) const return GetCore().GetCenterPoint(); } +FloatPoint +_TouchPinchGestureDetectorImpl::GetCenterPointF(void) const +{ + ClearLastResult(); + + return GetCore().GetCenterPointF(); +} + int _TouchPinchGestureDetectorImpl::GetScale(void) const { @@ -101,4 +109,12 @@ _TouchPinchGestureDetectorImpl::GetScale(void) const return GetCore().GetScale(); } +float +_TouchPinchGestureDetectorImpl::GetScaleF(void) const +{ + ClearLastResult(); + + return GetCore().GetScaleF(); +} + } } //Tizen::Ui diff --git a/src/ui/FUi_TouchRotationGestureDetector.cpp b/src/ui/FUi_TouchRotationGestureDetector.cpp index fa9a42a..fef2c36 100644 --- a/src/ui/FUi_TouchRotationGestureDetector.cpp +++ b/src/ui/FUi_TouchRotationGestureDetector.cpp @@ -134,6 +134,12 @@ _TouchRotationGestureDetector::GetDistance(void) const return __distance; } +float +_TouchRotationGestureDetector::GetDistanceF(void) const +{ + return __distance; +} + bool _TouchRotationGestureDetector::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { @@ -393,4 +399,23 @@ _TouchRotationGestureDetector::OnTouchCanceled(const _Control& source, const _To return false; } +void +_TouchRotationGestureDetector::OnTouchGestureDetectorAdded(void) +{ + __firstMovedDirection = 0; + __secondMovedDirection = 0; + __fingerCount = 0; + __firstPointId = INVALID_POINT_ID; + __secondPointId = INVALID_POINT_ID; +} + +void +_TouchRotationGestureDetector::OnTouchGestureDetectorRemoved(void) +{ + if (__pTimer) + { + __pTimer->Cancel(); + } +} + }} // Tizen::Ui diff --git a/src/ui/FUi_TouchRotationGestureDetectorImpl.cpp b/src/ui/FUi_TouchRotationGestureDetectorImpl.cpp index 63a8a31..4736a74 100644 --- a/src/ui/FUi_TouchRotationGestureDetectorImpl.cpp +++ b/src/ui/FUi_TouchRotationGestureDetectorImpl.cpp @@ -100,4 +100,12 @@ _TouchRotationGestureDetectorImpl::GetDistance(void) const return GetCore().GetDistance(); } +float +_TouchRotationGestureDetectorImpl::GetDistanceF(void) const +{ + ClearLastResult(); + + return GetCore().GetDistance(); +} + }} // Tizen::Ui diff --git a/src/ui/FUi_TouchTapGestureDetector.cpp b/src/ui/FUi_TouchTapGestureDetector.cpp index 03b0277..7244240 100644 --- a/src/ui/FUi_TouchTapGestureDetector.cpp +++ b/src/ui/FUi_TouchTapGestureDetector.cpp @@ -211,6 +211,23 @@ _TouchTapGestureDetector::GetMoveAllowance(void) const return __oneTapMoveAllowance; } +result +_TouchTapGestureDetector::SetMoveAllowance(float allowance) +{ + SysTryReturnResult(NID_UI, allowance >= 0, E_INVALID_ARG, "[E_INVALID_ARG] Argument is less than 0"); + SysTryReturnResult(NID_UI, __touchCount == DEFAULT_TOUCH_COUNT, E_INVALID_CONDITION, "[E_INVALID_CONDITION] move allowance applies only for default(1) touch count."); + + __oneTapMoveAllowance = allowance; + + return E_SUCCESS; +} + +float +_TouchTapGestureDetector::GetMoveAllowanceF(void) const +{ + return __oneTapMoveAllowance; +} + bool _TouchTapGestureDetector::IsInBounds(void) { diff --git a/src/ui/FUi_TouchTapGestureDetectorImpl.cpp b/src/ui/FUi_TouchTapGestureDetectorImpl.cpp index 1c0a93e..aa88352 100644 --- a/src/ui/FUi_TouchTapGestureDetectorImpl.cpp +++ b/src/ui/FUi_TouchTapGestureDetectorImpl.cpp @@ -122,6 +122,18 @@ _TouchTapGestureDetectorImpl::GetMoveAllowance(void) const } result +_TouchTapGestureDetectorImpl::SetMoveAllowance(float allowance) +{ + return GetCore().SetMoveAllowance(allowance); +} + +float +_TouchTapGestureDetectorImpl::GetMoveAllowanceF(void) const +{ + return GetCore().GetMoveAllowanceF(); +} + +result _TouchTapGestureDetectorImpl::SetTouchCount(int count) { return GetCore().SetTouchCount(count); diff --git a/src/ui/FUi_UiBuilder.cpp b/src/ui/FUi_UiBuilder.cpp old mode 100644 new mode 100755 index 1e2b56b..0b7389a --- a/src/ui/FUi_UiBuilder.cpp +++ b/src/ui/FUi_UiBuilder.cpp @@ -198,7 +198,7 @@ _UiBuilder::Parse(void) _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturn(NID_UI, pControlManager != null, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Unable to get the control manager"); - Dimension screenSize = pControlManager->GetScreenSize(); + FloatDimension screenSize = pControlManager->GetScreenSizeF(); // find xml file with device deviceResolution @@ -310,12 +310,12 @@ _UiBuilder::Parse(void) _UiBuilderControlLayout* pUiBuilderControlLayoutLandscape; pUiBuilderControlLayoutPortrait = pUiBuilderControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT); - Rectangle rect = pUiBuilderControlLayoutPortrait->GetRect(); - Rectangle realBounds = __pTransform->Transform(rect); + FloatRectangle rect = pUiBuilderControlLayoutPortrait->GetRectF(); + FloatRectangle realBounds = __pTransform->Transform(rect); pUiBuilderControlLayoutPortrait->SetRect(realBounds.x, realBounds.y, realBounds.width, realBounds.height); pUiBuilderControlLayoutLandscape = pUiBuilderControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE); - rect = pUiBuilderControlLayoutLandscape->GetRect(); + rect = pUiBuilderControlLayoutLandscape->GetRectF(); realBounds = __pTransform->Transform(rect); pUiBuilderControlLayoutLandscape->SetRect(realBounds.x, realBounds.y, realBounds.width, realBounds.height); } @@ -446,15 +446,15 @@ _UiBuilder::SetLayoutOrientation(_UiBuilderControl* pUiBuilderControl, Tizen::Ui { _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl); _UiBuilderControlLayout* pLayout = null; - Rectangle rect; + FloatRectangle rect; pLayout = pUiBuilderControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT); - rect = pLayout->GetRect(); - pControlImpl->SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, rect); + rect = pLayout->GetRectF(); + pControlImpl->SetBuilderBoundsF(_CONTROL_ORIENTATION_PORTRAIT, rect); pLayout = pUiBuilderControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE); - rect = pLayout->GetRect(); - pControlImpl->SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, rect); + rect = pLayout->GetRectF(); + pControlImpl->SetBuilderBoundsF(_CONTROL_ORIENTATION_LANDSCAPE, rect); } _ICoordinateSystemTransformer* diff --git a/src/ui/FUi_UiBuilderControlLayout.cpp b/src/ui/FUi_UiBuilderControlLayout.cpp index b9a6358..abbaa0b 100644 --- a/src/ui/FUi_UiBuilderControlLayout.cpp +++ b/src/ui/FUi_UiBuilderControlLayout.cpp @@ -21,9 +21,10 @@ #include #include -#include +#include #include "FUi_UiBuilder.h" #include "FUi_UiBuilderControlLayout.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -32,7 +33,7 @@ using namespace Tizen::Ui; namespace Tizen { namespace Ui { _UiBuilderControlLayout::_UiBuilderControlLayout(void) - : _styleInformation(L"") + : __styleInformation(L"") { } @@ -43,58 +44,65 @@ _UiBuilderControlLayout::~_UiBuilderControlLayout(void) void _UiBuilderControlLayout::SetStyle(const Tizen::Base::String& style) { - _styleInformation = style; + __styleInformation = style; } void _UiBuilderControlLayout::SetRect(const Tizen::Base::String& x, const Tizen::Base::String& y, Tizen::Base::String& width, Tizen::Base::String& height) { - int intX = 0, intY = 0, intWidth = 0, intHeight = 0; + float floatX = 0.0f, floatY = 0.0f, floatWidth = 0.0f, floatHeight = 0.0f; if (x.IsEmpty() == false) { - Base::Integer::Parse(x, intX); + Base::Float::Parse(x, floatX); } if (y.IsEmpty() == false) { - Base::Integer::Parse(y, intY); + Base::Float::Parse(y, floatY); } if (width.IsEmpty() == false) { - Base::Integer::Parse(width, intWidth); + Base::Float::Parse(width, floatWidth); } if (height.IsEmpty() == false) { - Base::Integer::Parse(height, intHeight); + Base::Float::Parse(height, floatHeight); } - _rect.x = intX; - _rect.y = intY; - _rect.width = intWidth; - _rect.height = intHeight; + __floatRect.x = floatX; + __floatRect.y = floatY; + __floatRect.width = floatWidth; + __floatRect.height = floatHeight; } void -_UiBuilderControlLayout::SetRect(const int x, const int y, const int width, const int height) +_UiBuilderControlLayout::SetRect(const float x, const float y, const float width, const float height) { - _rect.x = x; - _rect.y = y; - _rect.width = width; - _rect.height = height; + __floatRect.x = x; + __floatRect.y = y; + __floatRect.width = width; + __floatRect.height = height; } String _UiBuilderControlLayout::GetStyle(void) const { - return _styleInformation; + return __styleInformation; } -Rectangle& +Rectangle _UiBuilderControlLayout::GetRect(void) const { - return const_cast(_rect); + return _CoordinateSystemUtils::ConvertToInteger(__floatRect); } +FloatRectangle +_UiBuilderControlLayout::GetRectF(void) const +{ + return __floatRect; +} + + void _UiBuilderControlLayout::SetLayoutElement(int index, const Tizen::Base::String& name, const Tizen::Base::String& value) { @@ -103,8 +111,8 @@ _UiBuilderControlLayout::SetLayoutElement(int index, const Tizen::Base::String& return; } - _layoutElement[index].SetName(name); - _layoutElement[index].SetValue(value); + __layoutElement[index].SetName(name); + __layoutElement[index].SetValue(value); } @@ -114,11 +122,11 @@ _UiBuilderControlLayout::GetLayoutElement(const Tizen::Base::String& layoutEleme int index = 0; while (layoutElementName.IsEmpty() == false && index < UIBUILDER_CONTROL_ELEMENT_NUMBER) { - if (layoutElementName.Equals(_layoutElement[index].GetName(), false)) + if (layoutElementName.Equals(__layoutElement[index].GetName(), false)) { - if (_layoutElement[index].GetValue().IsEmpty() == false) + if (__layoutElement[index].GetValue().IsEmpty() == false) { - outValue = _layoutElement[index].GetValue(); + outValue = __layoutElement[index].GetValue(); return true; } else diff --git a/src/ui/FUi_UiBuilderControlMaker.cpp b/src/ui/FUi_UiBuilderControlMaker.cpp index cc1e8f5..6a67bbf 100755 --- a/src/ui/FUi_UiBuilderControlMaker.cpp +++ b/src/ui/FUi_UiBuilderControlMaker.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,7 @@ #include #include "FUi_UiBuilderControlMaker.h" #include "FUi_UiBuilder.h" +#include "FUi_LayoutLayoutMaker.h" using namespace Tizen::Base; using namespace Tizen::Ui; @@ -41,9 +43,10 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { _UiBuilderControlMaker::_UiBuilderControlMaker(_UiBuilder* pUibuilder) - : __pUiBuilder(null) + : __pLayoutMaker(new(std::nothrow)_LayoutMaker(pUibuilder)) + , __pUiBuilder(pUibuilder) { - __pUiBuilder = pUibuilder; + SysTryReturnVoidResult(NID_UI, __pLayoutMaker != null, E_OUT_OF_MEMORY, "The memory is insufficient."); } _UiBuilderControlMaker::_UiBuilderControlMaker(void) : __pUiBuilder(null) @@ -80,14 +83,17 @@ _UiBuilderControlMaker::MakeControl(_UiBuilderControl* pUiBuilderControl) } AddControl(pUiBuilderControl, pControl); - SetLayoutProperty(pUiBuilderControl, pControl); - + result r = __pLayoutMaker->SetLayoutProperty(pUiBuilderControl, pControl); + if (r != E_SUCCESS) + { + return E_OPERATION_FAILED; + } } return E_SUCCESS; } } - return E_OPERATION_FAILED; + return E_OPERATION_FAILED; } void @@ -264,16 +270,12 @@ _UiBuilderControlMaker::ConvertSlideShowAnimation(const Tizen::Base::String& ani Tizen::Graphics::Bitmap* _UiBuilderControlMaker::LoadBitmapN(const Tizen::Base::String& imagePath) { - UiApp* pUiApp = UiApp::GetInstance(); - if (pUiApp != null) - { - AppResource* pAppResource = UiApp::GetInstance()->GetAppResource(); - if (pAppResource != null) - { - Tizen::Graphics::Bitmap* pBitmap = pAppResource->GetBitmapN(imagePath); - return pBitmap; - } - } + AppResource* pAppResource = Tizen::App::App::GetInstance()->GetAppResource(); + if (pAppResource != null) + { + Tizen::Graphics::Bitmap* pBitmap = pAppResource->GetBitmapN(imagePath); + return pBitmap; + } return null; } @@ -323,1510 +325,78 @@ _UiBuilderControlMaker::GetProperty(_UiBuilderControl* pControl, _UiBuilderContr return; } -bool -_UiBuilderControlMaker::GetLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const +void +_UiBuilderControlMaker::AddControl(_UiBuilderControl* pUiBuilderControl, Tizen::Ui::Control* pControl) { - if (pControlProperty == null) - { - return false; - } + Tizen::Base::String panePosition; + Tizen::Ui::Container* pContainer = GetContainer(); + Tizen::Ui::Control* pFindControl = null; - Tizen::Base::String layoutType(L""); - if (pControlProperty->GetLayoutElement( L"type", layoutType)) + //Find Container + if (pContainer->GetName().Equals(pUiBuilderControl->GetParentWin())) { - - if (layoutType.Equals(L"NONE", false)) - { - returnType = UIBUILDER_LAYOUT_NONE; - } - else if (layoutType.Equals(L"LAYOUT_GRID", false)) - { - returnType = UIBUILDER_LAYOUT_GRID; - } - else if (layoutType.Equals(L"LAYOUT_HORIZONTAL_BOX", false)) - { - returnType = UIBUILDER_LAYOUT_HORIZONTAL_BOX; - } - else if (layoutType.Equals(L"LAYOUT_VERTICAL_BOX", false)) - { - returnType = UIBUILDER_LAYOUT_VERTICAL_BOX; - } - else if (layoutType.Equals(L"LAYOUT_RELATIVE", false)) - { - returnType = UIBUILDER_LAYOUT_RELATIVE; - } - else - { - returnType = UIBUILDER_LAYOUT_NONE; - return false; - } + pFindControl = pContainer; } else { - returnType = UIBUILDER_LAYOUT_NONE; + pFindControl = pContainer->GetControl(Tizen::Base::String(pUiBuilderControl->GetParentWin()), true); } - return true; -} - -bool -_UiBuilderControlMaker::GetParentLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const -{ - if (pControlProperty == null) + //Add SplitPanel child + if (pUiBuilderControl->GetElement(L"controlPosition", panePosition)) { - return false; - } - Tizen::Base::String parentLayoutType(L""); - if (pControlProperty->GetLayoutElement(L"parentType", parentLayoutType)) - { - if (parentLayoutType.Equals(L"NONE", false)) - { - returnType = UIBUILDER_LAYOUT_NONE; - } - else if (parentLayoutType.Equals(L"LAYOUT_GRID", false)) - { - returnType = UIBUILDER_LAYOUT_GRID; - } - else if (parentLayoutType.Equals(L"LAYOUT_HORIZONTAL_BOX", false)) - { - returnType = UIBUILDER_LAYOUT_HORIZONTAL_BOX; - } - else if (parentLayoutType.Equals(L"LAYOUT_VERTICAL_BOX", false)) - { - returnType = UIBUILDER_LAYOUT_VERTICAL_BOX; - } - else if (parentLayoutType.Equals(L"LAYOUT_RELATIVE", false)) - { - returnType = UIBUILDER_LAYOUT_RELATIVE; - } - else + Tizen::Ui::Controls::SplitPanel *pSplitPanel = dynamic_cast(pFindControl); + if (pSplitPanel) { - returnType = UIBUILDER_LAYOUT_NONE; - return false; + if(panePosition.Equals(L"first", false)) + { + pSplitPanel->SetPane(pControl, SPLIT_PANEL_PANE_ORDER_FIRST); + } + else + { + pSplitPanel->SetPane(pControl, SPLIT_PANEL_PANE_ORDER_SECOND); + } } } - else - { - returnType = UIBUILDER_LAYOUT_NONE; - } - return true; -} - -result -_UiBuilderControlMaker::GetGridLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const -{ - if (pControlProperty == null) - { - return E_SYSTEM; - } - - result r = E_SUCCESS; - Tizen::Base::String gridLayoutValue(L""); - GridLayout* pGridLayout = null; - int maxColumn = 0; - int maxRow = 0; - - pGridLayout = new (std::nothrow) GridLayout; - if (!pGridLayout) - { - SysLog(NID_UI, "Unable to create layout"); - r = E_SYSTEM; - goto CATCH; - } - if (pControlProperty->GetLayoutElement(L"maxColumn", gridLayoutValue)) - { - Integer::Parse(gridLayoutValue, maxColumn); - } - if (pControlProperty->GetLayoutElement(L"maxRow", gridLayoutValue)) - { - Integer::Parse(gridLayoutValue, maxRow); - } + //Add Container chid + Tizen::Ui::Container* pParent = dynamic_cast(pFindControl); - r = pGridLayout->Construct(maxRow, maxColumn); - if (E_SUCCESS != r) + if (pParent != null) { - SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); - delete pGridLayout; - pGridLayout = null; + pParent->AddControl(*pControl); } - -CATCH: - pLayout = pGridLayout; - - return r; } -result -_UiBuilderControlMaker::GetHorizontalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +Tizen::Ui::Container* +_UiBuilderControlMaker::GetContainer(void) const { - if (pControlProperty == null) - { - return E_SYSTEM; - } - result r = E_SUCCESS; - - Tizen::Base::String horizontalBoxLayoutValue(L""); - - HorizontalBoxLayout* pHboxLayout = null; - HorizontalDirection direction; - - pHboxLayout = new (std::nothrow) HorizontalBoxLayout; - if (!pHboxLayout) - { - SysLog(NID_UI, "[E_SYSTEM] Unable to create layout"); - r = E_SYSTEM; - goto CATCH; - } - - if (pControlProperty->GetLayoutElement(L"horizontalDirection", horizontalBoxLayoutValue)) - { - if (horizontalBoxLayoutValue.Equals(L"HORIZONTAL_DIRECTION_LEFTWARD", false)) - { - direction = HORIZONTAL_DIRECTION_LEFTWARD; - } - else - { - direction = HORIZONTAL_DIRECTION_RIGHTWARD; - } - } - else - { - direction = HORIZONTAL_DIRECTION_RIGHTWARD; - } - - r = pHboxLayout->Construct(direction); - if (E_SUCCESS != r) - { - SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); - delete pHboxLayout; - pHboxLayout = null; - } - -CATCH: - pLayout = pHboxLayout; - - return r; + return __pUiBuilder->GetContainer(); } -result -_UiBuilderControlMaker::GetVerticalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +void +_UiBuilderControlMaker::SetLayoutOrientation(_UiBuilderControl* pUiBuilderCOntrol, Tizen::Ui::Control* pControl) { - if (pControlProperty == null) - { - return E_SYSTEM; - } - result r = E_SUCCESS; - -Tizen::Base::String verticalBoxLayoutValue(L""); - - VerticalBoxLayout* pVboxLayout = null; - VerticalDirection direction; - - pVboxLayout = new (std::nothrow) VerticalBoxLayout; - if (!pVboxLayout) - { - SysLog(NID_UI, "[E_SYSTEM] Unable to create layout"); - r = E_SYSTEM; - goto CATCH; - } - - if (pControlProperty->GetLayoutElement(L"verticalDirection", verticalBoxLayoutValue)) - { - if (verticalBoxLayoutValue.Equals(L"VERTICAL_DIRECTION_UPWARD", false)) - { - direction = VERTICAL_DIRECTION_UPWARD; - } - else - { - direction = VERTICAL_DIRECTION_DOWNWARD; - } - } - else - { - direction = VERTICAL_DIRECTION_DOWNWARD; - } - - r = pVboxLayout->Construct(direction); - if (E_SUCCESS != r) - { - SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); - delete pVboxLayout; - pVboxLayout = null; - } - -CATCH: - pLayout = pVboxLayout; - - return r; + __pUiBuilder->SetLayoutOrientation(pUiBuilderCOntrol, pControl); } -result -_UiBuilderControlMaker::GetRelativeLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +void +_UiBuilderControlMaker::SetUiBuilderRotateState(_UiBuilderScreenRotate rotate) { - if (pControlProperty == null) - { - return E_SYSTEM; - } - result r = E_SUCCESS; - - RelativeLayout* pRelLayout = null; - - pRelLayout = new (std::nothrow) RelativeLayout; - if (!pRelLayout) - { - SysLog(NID_UI, "Unable to create layout"); - r = E_SYSTEM; - goto CATCH; - } - - if (E_SUCCESS != pRelLayout->Construct()) - { - SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); - delete pRelLayout; - pRelLayout = null; - } -CATCH: - pLayout = pRelLayout; - - return r; + return __pUiBuilder->SetUiBuilderRotateState(rotate); } -result -_UiBuilderControlMaker::GetLayoutN(_UiBuilderControl* pUiBuilderControl, Layout*& pPortraitLayout, Layout*& pLandscapeLayout) const +_UiBuilderScreenRotate +_UiBuilderControlMaker::GetUiBuilderRotateState(void) { - result r = E_SUCCESS; - - _UiBuilderControlLayout* pControlProperty = null; - - Layout* pLayout = null; - Layout* pLayoutPortrait = null; - Layout* pLayoutLandscape = null; - - for (int i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++) - { - _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - pControlProperty = pUiBuilderControl->GetAttribute(i); - if (pControlProperty == null) - { - SysLog(NID_UI, "Unable to set layout property"); - return E_SYSTEM; - } - if (GetLayoutType(pControlProperty, layoutType) == false) - { - return E_SYSTEM; - } - - switch (layoutType) - { - case UIBUILDER_LAYOUT_GRID: - r = GetGridLayoutN(pControlProperty, pLayout); - break; - - case UIBUILDER_LAYOUT_HORIZONTAL_BOX: - r = GetHorizontalBoxLayoutN(pControlProperty, pLayout); - break; - - case UIBUILDER_LAYOUT_VERTICAL_BOX: - r = GetVerticalBoxLayoutN(pControlProperty, pLayout); - break; - - case UIBUILDER_LAYOUT_RELATIVE: - r = GetRelativeLayoutN(pControlProperty, pLayout); - break; - - default: - SysLog(NID_UI, "Unknown Layout type = %d", layoutType); - break; - } - if (r != E_SUCCESS) - { - SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); - return r; - } - if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) - { - pLayoutPortrait = pLayout; - } - else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) - { - pLayoutLandscape = pLayout; - } - } - if ((pLayoutPortrait == null) && (pLayoutLandscape != null)) - { - pLayoutPortrait = pLayoutLandscape; - } - else if ((pLayoutPortrait != null) && (pLayoutLandscape == null)) - { - pLayoutLandscape = pLayoutPortrait; - } - - pPortraitLayout = pLayoutPortrait; - pLandscapeLayout = pLayoutLandscape; - - return r; + return __pUiBuilder->GetUiBuilderRotateState(); } -result -_UiBuilderControlMaker::SetGridLayoutContainerProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty) const -{ - result r = E_SUCCESS; - - if ((null == pLayout) || (null == pControlProperty)) - { - return E_SYSTEM; - } - - GridLayout& layout = *pLayout; - UiBuilderGridLayoutContainer layoutParam; - Tizen::Base::String gridLayoutContainerPropertyValue(L""); - - layoutParam.maxColumn = 0; - layoutParam.maxRow = 0; - if (pControlProperty->GetLayoutElement(L"maxColumn", gridLayoutContainerPropertyValue)) - { - Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.maxColumn); - } - - if (pControlProperty->GetLayoutElement(L"maxRow", gridLayoutContainerPropertyValue)) - { - Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.maxRow); - } - - String headerColumn = "column"; - String headerRow = "row"; - String tempString; - - for (int i = 1; i <= layoutParam.maxColumn; i++) - { - tempString = headerColumn; - tempString.Append(i); - tempString.Append("Collapsed"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.columnCollapsed = true; - } - else - { - layoutParam.columnCollapsed = false; - } - r = layout.SetColumnCollapsed(i - 1, layoutParam.columnCollapsed); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerColumn; - tempString.Append(i); - tempString.Append("Shrinkable"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.columnShrinkable = true; - } - else - { - layoutParam.columnShrinkable = false; - } - r = layout.SetColumnShrinkable(i - 1, layoutParam.columnShrinkable); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerColumn; - tempString.Append(i); - tempString.Append("Stretchable"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.columnStretchable = true; - } - else - { - layoutParam.columnStretchable = false; - } - r = layout.SetColumnStretchable(i - 1, layoutParam.columnStretchable); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerColumn; - tempString.Append(i); - tempString.Append("Spacing"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.columnSpacing); - r = layout.SetColumnSpacing(i - 1, layoutParam.columnSpacing); - if (IsFailed(r)) - { - goto CATCH; - } - } - - } - for (int i = 1; i <= layoutParam.maxRow; i++) - { - - tempString = headerRow; - tempString.Append(i); - tempString.Append("Collapsed"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.rowCollapsed = true; - } - else - { - layoutParam.rowCollapsed = false; - } - r = layout.SetRowCollapsed(i - 1, layoutParam.rowCollapsed); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerRow; - tempString.Append(i); - tempString.Append("Shrinkable"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.rowShrinkable = true; - } - else - { - layoutParam.rowShrinkable = false; - } - r = layout.SetRowShrinkable(i - 1, layoutParam.rowShrinkable); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerRow; - tempString.Append(i); - tempString.Append("Stretchable"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - if (gridLayoutContainerPropertyValue.Equals(L"true", false)) - { - layoutParam.rowStretchable = true; - } - else - { - layoutParam.rowStretchable = false; - } - r = layout.SetRowStretchable(i - 1, layoutParam.rowStretchable); - if (IsFailed(r)) - { - goto CATCH; - } - } - - tempString = headerRow; - tempString.Append(i); - tempString.Append("Spacing"); - - if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) - { - Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.rowSpacing); - r = layout.SetRowSpacing(i - 1, layoutParam.rowSpacing); - if (IsFailed(r)) - { - goto CATCH; - } - } - - } -CATCH: - - return r; -} - -void -_UiBuilderControlMaker::SetGridLayoutControlProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) -{ - if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) - { - return ; - } - - GridLayout& layout = *pLayout; - Control& control = *pControl; - UiBuilderGridLayoutControl layoutParam; - Tizen::Base::String gridLayoutValue(L""); - bool alignmentSet = false; - - if (pControlProperty->GetLayoutElement(L"horizontalAlignment", gridLayoutValue)) - { - alignmentSet = true; - if (gridLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_CENTER", false)) - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_CENTER; - } - else if (gridLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_RIGHT", false)) - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_RIGHT; - } - else - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; - } - } - else - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; - } - - if (pControlProperty->GetLayoutElement(L"verticalAlignment", gridLayoutValue)) - { - alignmentSet = true; - if (gridLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_MIDDLE", false)) - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_MIDDLE; - } - else if (gridLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_BOTTOM", false)) - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_BOTTOM; - } - else - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; - } - } - else - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; - } - if (alignmentSet) - { - layout.SetAlignment(control, layoutParam.horizontalAlignment, layoutParam.verticalAlignment); - } - - _ICoordinateSystemTransformer* pTransform = GetTransformer(); - bool marginSet = false; - layoutParam.marginLeft = 0; - layoutParam.marginRight = 0; - layoutParam.marginTop = 0; - layoutParam.marginBottom = 0; - if (pControlProperty->GetLayoutElement(L"marginLeft", gridLayoutValue)) - { - marginSet = true; - Integer::Parse(gridLayoutValue, layoutParam.marginLeft); - if (pTransform) - { - - layoutParam.marginLeft = pTransform->Transform(layoutParam.marginLeft); - } - } - if (pControlProperty->GetLayoutElement(L"marginRight", gridLayoutValue)) - { - marginSet = true; - Integer::Parse(gridLayoutValue, layoutParam.marginRight); - if (pTransform) - { - - layoutParam.marginRight = pTransform->Transform(layoutParam.marginRight); - } - } - if (pControlProperty->GetLayoutElement(L"marginTop", gridLayoutValue)) - { - marginSet = true; - Integer::Parse(gridLayoutValue, layoutParam.marginTop); - if (pTransform) - { - - layoutParam.marginTop = pTransform->Transform(layoutParam.marginTop); - } - } - if (pControlProperty->GetLayoutElement(L"marginBottom", gridLayoutValue)) - { - marginSet = true; - Integer::Parse(gridLayoutValue, layoutParam.marginBottom); - if (pTransform) - { - - layoutParam.marginBottom = pTransform->Transform(layoutParam.marginBottom); - } - } - if (marginSet) - { - layout.SetMargin(control, layoutParam.marginLeft, layoutParam.marginRight, layoutParam.marginTop, layoutParam.marginBottom); - } - - bool positionSet = false; - layoutParam.positionRow = 0; - layoutParam.positionColumn = 0; - layoutParam.positionRowSpan = 0; - layoutParam.positionColumnSpan = 0; - if (pControlProperty->GetLayoutElement(L"positionRow", gridLayoutValue)) - { - positionSet = true; - Integer::Parse(gridLayoutValue, layoutParam.positionRow); - } - if (pControlProperty->GetLayoutElement(L"positionColumn", gridLayoutValue)) - { - positionSet = true; - Integer::Parse(gridLayoutValue, layoutParam.positionColumn); - } - if (pControlProperty->GetLayoutElement(L"positionRowSpan", gridLayoutValue)) - { - positionSet = true; - Integer::Parse(gridLayoutValue, layoutParam.positionRowSpan); - } - if (pControlProperty->GetLayoutElement(L"positionColumnSpan", gridLayoutValue)) - { - positionSet = true; - Integer::Parse(gridLayoutValue, layoutParam.positionColumnSpan); - } - if (positionSet) - { - layout.SetPosition(control, layoutParam.positionRow, layoutParam.positionColumn, layoutParam.positionRowSpan, layoutParam.positionColumnSpan); - } -} - -void -_UiBuilderControlMaker::SetHorizontalBoxLayoutProperty(HorizontalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) -{ - if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) - { - return ; - } - - HorizontalBoxLayout& layout = *pLayout; - Control& control = *pControl; - UiBuilderHorizontalBoxLayoutControl layoutParam; - Tizen::Base::String horizontalBoxLayoutValue(L""); - _ICoordinateSystemTransformer* pTransform = GetTransformer(); - - if (pControlProperty->GetLayoutElement(L"height", horizontalBoxLayoutValue)) - { - Integer::Parse(horizontalBoxLayoutValue, layoutParam.height); - if (pTransform) - { - - layoutParam.height = pTransform->Transform(layoutParam.height); - } - layout.SetHeight(control, layoutParam.height); - } - else - { - layoutParam.height = 0; - } - - if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", horizontalBoxLayoutValue)) - { - if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - else if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; - } - layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - - if (pControlProperty->GetLayoutElement(L"verticalAlignment", horizontalBoxLayoutValue)) - { - if (horizontalBoxLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_MIDDLE", false)) - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_MIDDLE; - } - else if (horizontalBoxLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_BOTTOM", false)) - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_BOTTOM; - } - else - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; - } - - layout.SetVerticalAlignment(control, layoutParam.verticalAlignment); - } - else - { - layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; - } - - bool marginSet = false; - layoutParam.verticalTopMargin = 0; - layoutParam.verticalBottomMargin = 0; - if (pControlProperty->GetLayoutElement(L"verticalTopMargin", horizontalBoxLayoutValue)) - { - marginSet = true; - Integer::Parse(horizontalBoxLayoutValue, layoutParam.verticalTopMargin); - if (pTransform) - { - - layoutParam.verticalTopMargin = pTransform->Transform(layoutParam.verticalTopMargin); - } - } - if (pControlProperty->GetLayoutElement(L"verticalBottomMargin", horizontalBoxLayoutValue)) - { - marginSet = true; - Integer::Parse(horizontalBoxLayoutValue, layoutParam.verticalBottomMargin); - if (pTransform) - { - - layoutParam.verticalBottomMargin = pTransform->Transform(layoutParam.verticalBottomMargin); - } - } - if (marginSet) - { - layout.SetVerticalMargin(control, layoutParam.verticalTopMargin, layoutParam.verticalBottomMargin); - } - - if (pControlProperty->GetLayoutElement(L"spacing", horizontalBoxLayoutValue)) - { - Integer::Parse(horizontalBoxLayoutValue, layoutParam.spacing); - if (pTransform) - { - - layoutParam.spacing = pTransform->Transform(layoutParam.spacing); - } - layout.SetSpacing(control, layoutParam.spacing); - } - else - { - layoutParam.spacing = 0; - } - - if (pControlProperty->GetLayoutElement(L"weight", horizontalBoxLayoutValue)) - { - Float::Parse(horizontalBoxLayoutValue, layoutParam.weight); - layout.SetWeight(control, layoutParam.weight); - } - else - { - layoutParam.weight = 0; - } - - if (pControlProperty->GetLayoutElement(L"width", horizontalBoxLayoutValue)) - { - Integer::Parse(horizontalBoxLayoutValue, layoutParam.width); - if (pTransform) - { - - layoutParam.width = pTransform->Transform(layoutParam.width); - } - layout.SetWidth(control, layoutParam.width); - } - else - { - layoutParam.width = 0; - } - - if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", horizontalBoxLayoutValue)) - { - if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; - } - else if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; - } - layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; - } -} - -void -_UiBuilderControlMaker::SetVerticalBoxLayoutProperty(VerticalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) -{ - if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) - { - return ; - } - - VerticalBoxLayout& layout = *pLayout; - Control& control = *pControl; - UiBuilderVerticalBoxLayoutControl layoutParam; - Tizen::Base::String verticalBoxLayoutValue(L""); - _ICoordinateSystemTransformer* pTransform = GetTransformer(); - - if (pControlProperty->GetLayoutElement(L"height", verticalBoxLayoutValue)) - { - Integer::Parse(verticalBoxLayoutValue, layoutParam.height); - if (pTransform) - { - - layoutParam.height = pTransform->Transform(layoutParam.height); - } - layout.SetHeight(control, layoutParam.height); - } - else - { - layoutParam.height = 0; - } - - if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", verticalBoxLayoutValue)) - { - if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - else if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; - } - layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - - if (pControlProperty->GetLayoutElement(L"horizontalAlignment", verticalBoxLayoutValue)) - { - if (verticalBoxLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_CENTER", false)) - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_CENTER; - } - else if (verticalBoxLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_RIGHT", false)) - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_RIGHT; - } - else - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; - } - - layout.SetHorizontalAlignment(control, layoutParam.horizontalAlignment); - } - else - { - layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; - } - - bool marginSet = false; - layoutParam.horizontalLeftMargin = 0; - layoutParam.horizontalRightMargin = 0; - if (pControlProperty->GetLayoutElement(L"horizontalLeftMargin", verticalBoxLayoutValue)) - { - marginSet = true; - Integer::Parse(verticalBoxLayoutValue, layoutParam.horizontalLeftMargin); - if (pTransform) - { - layoutParam.horizontalLeftMargin = pTransform->Transform(layoutParam.horizontalLeftMargin); - } - } - if (pControlProperty->GetLayoutElement(L"horizontalRightMargin", verticalBoxLayoutValue)) - { - marginSet = true; - Integer::Parse(verticalBoxLayoutValue, layoutParam.horizontalRightMargin); - if (pTransform) - { - layoutParam.horizontalRightMargin = pTransform->Transform(layoutParam.horizontalRightMargin); - } - } - if (marginSet) - { - layout.SetHorizontalMargin(control, layoutParam.horizontalLeftMargin, layoutParam.horizontalRightMargin); - } - - if (pControlProperty->GetLayoutElement(L"spacing", verticalBoxLayoutValue)) - { - Integer::Parse(verticalBoxLayoutValue, layoutParam.spacing); - if (pTransform) - { - layoutParam.spacing = pTransform->Transform(layoutParam.spacing); - - } - layout.SetSpacing(control, layoutParam.spacing); - } - else - { - layoutParam.spacing = 0; - } - - if (pControlProperty->GetLayoutElement(L"weight", verticalBoxLayoutValue)) - { - Float::Parse(verticalBoxLayoutValue, layoutParam.weight); - layout.SetWeight(control, layoutParam.weight); - } - else - { - layoutParam.weight = 0; - } - - if (pControlProperty->GetLayoutElement(L"width", verticalBoxLayoutValue)) - { - Integer::Parse(verticalBoxLayoutValue, layoutParam.width); - if (pTransform) - { - layoutParam.width = pTransform->Transform(layoutParam.width); - - } - layout.SetWidth(control, layoutParam.width); - } - else - { - layoutParam.width = 0; - } - - if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", verticalBoxLayoutValue)) - { - if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; - } - else if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; - } - - layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; - } -} - -void -_UiBuilderControlMaker::SetRelativeLayoutProperty(RelativeLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) -{ - if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) - { - return; - } - - RelativeLayout& layout = *pLayout; - Control& control = *pControl; - UiBuilderRelativeLayout layoutParam; - Tizen::Base::String relativeLayoutValue(L""); - Tizen::Graphics::Rectangle rect = pControlProperty->GetRect(); - - if (pControlProperty->GetLayoutElement(L"bottomRelation", relativeLayoutValue)) - { - if (GetContainer()->GetName().Equals(relativeLayoutValue)) - { - layoutParam.pBottomRelation = GetContainer(); - } - else - { - layoutParam.pBottomRelation = GetContainer()->GetControl(relativeLayoutValue, true); - } - } - else - { - layoutParam.pBottomRelation = null; - } - - if (layoutParam.pBottomRelation) - { - if (pControlProperty->GetLayoutElement(L"bottomRelationType", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM", false)) - { - layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM; - } - else - { - layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_TOP; - } - layout.SetRelation(control, *(layoutParam.pBottomRelation), layoutParam.bottomRelationType); - } - else - { - layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM; - } - } - - if (pControlProperty->GetLayoutElement(L"leftRelation", relativeLayoutValue)) - { - if (GetContainer()->GetName().Equals(relativeLayoutValue)) - { - layoutParam.pLeftRelation = GetContainer(); - } - else - { - layoutParam.pLeftRelation = GetContainer()->GetControl(relativeLayoutValue, true); - } - } - else - { - layoutParam.pLeftRelation = null; - } - - if (layoutParam.pLeftRelation) - { - if (pControlProperty->GetLayoutElement(L"leftRelationType", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_LEFT_TO_LEFT", false)) - { - layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_LEFT; - } - else - { - layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_RIGHT; - } - layout.SetRelation(control, *(layoutParam.pLeftRelation), layoutParam.leftRelationType); - } - else - { - layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_LEFT; - } - } - - if (pControlProperty->GetLayoutElement(L"rightRelation", relativeLayoutValue)) - { - if (GetContainer()->GetName().Equals(relativeLayoutValue)) - { - layoutParam.pRightRelation = GetContainer(); - } - else - { - layoutParam.pRightRelation = GetContainer()->GetControl(relativeLayoutValue, true); - } - } - else - { - layoutParam.pRightRelation = null; - } - - if (layoutParam.pRightRelation) - { - if (pControlProperty->GetLayoutElement(L"rightRelationType", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_RIGHT_TO_RIGHT", false)) - { - layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_RIGHT; - } - else - { - layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_LEFT; - } - layout.SetRelation(control, *(layoutParam.pRightRelation), layoutParam.rightRelationType); - } - else - { - layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_RIGHT; - } - } - - if (pControlProperty->GetLayoutElement(L"topRelation", relativeLayoutValue)) - { - if (GetContainer()->GetName().Equals(relativeLayoutValue)) - { - layoutParam.pTopRelation = GetContainer(); - } - else - { - layoutParam.pTopRelation = GetContainer()->GetControl(relativeLayoutValue, true); - } - } - else - { - layoutParam.pTopRelation = null; - } - - if (layoutParam.pTopRelation) - { - if (pControlProperty->GetLayoutElement(L"topRelationType", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_TOP_TO_TOP", false)) - { - layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_TOP; - } - else - { - layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_BOTTOM; - } - layout.SetRelation(control, *(layoutParam.pTopRelation), layoutParam.topRelationType); - } - else - { - layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_TOP; - } - } - - if (pControlProperty->GetLayoutElement(L"centerHorizontal", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"true", false)) - { - layoutParam.centerHorizontal = true; - layout.SetCenterAligned(control, CENTER_ALIGN_HORIZONTAL); - } - else - { - layoutParam.centerHorizontal = false; - } - } - else - { - layoutParam.centerHorizontal = false; - } - - if (pControlProperty->GetLayoutElement(L"centerVertical", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"true", false)) - { - layoutParam.centerVertical = true; - layout.SetCenterAligned(control, CENTER_ALIGN_VERTICAL); - } - else - { - layoutParam.centerVertical = false; - } - } - else - { - layoutParam.centerVertical = false; - } - - - if (pControlProperty->GetLayoutElement(L"height", relativeLayoutValue)) - { - layoutParam.height = rect.height; - layout.SetHeight(control, layoutParam.height); - } - else - { - layoutParam.height = 0; - } - - if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - else if (relativeLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; - } - layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); - } - else - { - layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; - } - - if (pControlProperty->GetLayoutElement(L"width", relativeLayoutValue)) - { - layoutParam.width = rect.width; - layout.SetWidth(control, layoutParam.width); - } - else - { - layoutParam.width = 0; - } - - if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", relativeLayoutValue)) - { - if (relativeLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; - } - else if (relativeLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) - { - layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; - } - layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); - } - else - { - layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; - } - - bool marginSet = false; - layoutParam.marginLeft = 0; - layoutParam.marginRight = 0; - layoutParam.marginTop = 0; - layoutParam.marginBottom = 0; - - Tizen::Graphics::_ICoordinateSystemTransformer* pTransform = GetTransformer(); - - if (pControlProperty->GetLayoutElement(L"marginLeft", relativeLayoutValue)) - { - marginSet = true; - Integer::Parse(relativeLayoutValue, layoutParam.marginLeft); - if (pTransform) - { - - layoutParam.marginLeft = pTransform->Transform(layoutParam.marginLeft); - } - } - if (pControlProperty->GetLayoutElement(L"marginRight", relativeLayoutValue)) - { - marginSet = true; - Integer::Parse(relativeLayoutValue, layoutParam.marginRight); - if (pTransform) - { - - layoutParam.marginRight = pTransform->Transform(layoutParam.marginRight); - } - } - if (pControlProperty->GetLayoutElement(L"marginTop", relativeLayoutValue)) - { - marginSet = true; - Integer::Parse(relativeLayoutValue, layoutParam.marginTop); - if (pTransform) - { - - layoutParam.marginTop = pTransform->Transform(layoutParam.marginTop); - } - } - if (pControlProperty->GetLayoutElement(L"marginBottom", relativeLayoutValue)) - { - marginSet = true; - Integer::Parse(relativeLayoutValue, layoutParam.marginBottom); - if (pTransform) - { - - layoutParam.marginBottom = pTransform->Transform(layoutParam.marginBottom); - } - } - if (marginSet) - { - layout.SetMargin(control, layoutParam.marginLeft, layoutParam.marginRight, layoutParam.marginTop, layoutParam.marginBottom); - } -} - -void -_UiBuilderControlMaker::SetLayoutProperty(_UiBuilderControl* pUiBuilderControl, Control* pControl) -{ - int i = 0; - _UiBuilderControlLayout* pControlProperty = null; - - Container* pContainer = null; - if (GetContainer()->GetName().Equals(Tizen::Base::String(pUiBuilderControl->GetParentWin()))) - { - pContainer = static_cast(GetContainer()); - } - else - { - pContainer = dynamic_cast(static_cast(GetContainer())->GetControl(pUiBuilderControl->GetParentWin(), true)); - } - - SysTryReturnVoidResult(NID_UI, pContainer != null, GetLastResult(), "Failed to get Container"); - - for (i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++) - { - _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - pControlProperty = pUiBuilderControl->GetAttribute(i); - GetParentLayoutType(pControlProperty, layoutType); - switch (layoutType) - { - case UIBUILDER_LAYOUT_NONE: - break; - - case UIBUILDER_LAYOUT_GRID: - { - GridLayout* pLayout = null; - if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) - { - pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); - } - else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) - { - pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); - } - - if (pLayout) - { - SetGridLayoutControlProperty(pLayout, pControlProperty, pControl); - delete pLayout; - } - break; - } - - case UIBUILDER_LAYOUT_HORIZONTAL_BOX: - { - HorizontalBoxLayout* pLayout = null; - if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) - { - pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); - } - else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) - { - pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); - } - if (pLayout) - { - SetHorizontalBoxLayoutProperty(pLayout, pControlProperty, pControl); - delete pLayout; - } - break; - } - - case UIBUILDER_LAYOUT_VERTICAL_BOX: - { - VerticalBoxLayout* pLayout = null; - if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) - { - pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); - } - else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) - { - pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); - } - if (pLayout) - { - SetVerticalBoxLayoutProperty(pLayout, pControlProperty, pControl); - delete pLayout; - } - break; - } - - case UIBUILDER_LAYOUT_RELATIVE: - { - RelativeLayout* pLayout = null; - if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) - { - pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); - } - else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) - { - pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); - } - if (pLayout) - { - SetRelativeLayoutProperty(pLayout, pControlProperty, pControl); - delete pLayout; - } - break; - } - - default: - SysLog(NID_UI, "Unknown Layout type = %d", layoutType); - break; - } - - } -} - -void -_UiBuilderControlMaker::AddControl(_UiBuilderControl* pUiBuilderControl, Tizen::Ui::Control* pControl) -{ - Tizen::Base::String panePosition; - Tizen::Ui::Container* pContainer = GetContainer(); - Tizen::Ui::Control* pFindControl = null; - - - //Find Container - if (pContainer->GetName().Equals(pUiBuilderControl->GetParentWin())) - { - pFindControl = pContainer; - } - else - { - pFindControl = pContainer->GetControl(Tizen::Base::String(pUiBuilderControl->GetParentWin()), true); - } - - - //Add SplitPanel child - if (pUiBuilderControl->GetElement(L"controlPosition", panePosition)) - { - - Tizen::Ui::Controls::SplitPanel *pSplitPanel = dynamic_cast(pFindControl); - if (pSplitPanel) - { - if(panePosition.Equals(L"first", false)) - { - pSplitPanel->SetPane(pControl, SPLIT_PANEL_PANE_ORDER_FIRST); - } - else - { - pSplitPanel->SetPane(pControl, SPLIT_PANEL_PANE_ORDER_SECOND); - } - } - } - - //Add Container chid - Tizen::Ui::Container* pParent = dynamic_cast(pFindControl); - - if (pParent != null) - { - pParent->AddControl(*pControl); - } -} - -Tizen::Ui::Container* -_UiBuilderControlMaker::GetContainer(void) const -{ - return __pUiBuilder->GetContainer(); -} - -void -_UiBuilderControlMaker::SetLayoutOrientation(_UiBuilderControl* pUiBuilderCOntrol, Tizen::Ui::Control* pControl) -{ - __pUiBuilder->SetLayoutOrientation(pUiBuilderCOntrol, pControl); -} - -void -_UiBuilderControlMaker::SetUiBuilderRotateState(_UiBuilderScreenRotate rotate) -{ - return __pUiBuilder->SetUiBuilderRotateState(rotate); -} - -_UiBuilderScreenRotate -_UiBuilderControlMaker::GetUiBuilderRotateState(void) -{ - return __pUiBuilder->GetUiBuilderRotateState(); -} - -Tizen::Graphics::_ICoordinateSystemTransformer* -_UiBuilderControlMaker::GetTransformer(void) const +Tizen::Graphics::_ICoordinateSystemTransformer* +_UiBuilderControlMaker::GetTransformer(void) const { return __pUiBuilder->GetTransformer(); } - } } // Tizen::Ui diff --git a/src/ui/FUi_UiEvent.cpp b/src/ui/FUi_UiEvent.cpp old mode 100644 new mode 100755 index 42d25e6..13143f2 --- a/src/ui/FUi_UiEvent.cpp +++ b/src/ui/FUi_UiEvent.cpp @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -106,7 +106,7 @@ _UiEvent::GetRouteType(void) const result _UiEvent::ProcessPreviewEvent(const _Control& control, bool& isFiltered) { - if (!IsEventReceivable(control)) + if (!IsEventEnabled(control)) { return E_SUCCESS; } @@ -117,7 +117,7 @@ _UiEvent::ProcessPreviewEvent(const _Control& control, bool& isFiltered) result _UiEvent::ProcessEvent(const _Control& control, bool& isFiltered) { - if (!IsEventReceivable(control)) + if (!IsEventEnabled(control)) { return E_SUCCESS; } @@ -131,7 +131,7 @@ _UiEvent::ProcessEvent(const _Control& control, bool& isFiltered) const _Control* pTarget = GetControl(GetDestination()); SysTryReturn(NID_UI, pTarget, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); - if (IsEventReceivable(*pTarget) && (pTarget != &control)) + if (IsEventEnabled(*pTarget) && (pTarget != &control)) { r = OnEventHandled(control); } @@ -156,7 +156,7 @@ _UiEvent::GetControl(const _UiObjectHandle& handle) const } bool -_UiEvent::IsEventReceivable(const _Control& control) const +_UiEvent::IsEventEnabled(const _Control& control) const { if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) { diff --git a/src/ui/FUi_UiEventManager.cpp b/src/ui/FUi_UiEventManager.cpp index 45869e8..22e7cd3 100644 --- a/src/ui/FUi_UiEventManager.cpp +++ b/src/ui/FUi_UiEventManager.cpp @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -38,9 +38,7 @@ #include "FUiAnim_ControlVisualElement.h" #include "FUi_UiKeyEvent.h" #include "FUi_KeyEventManager.h" -#if defined(MULTI_WINDOW) #include "FUi_Window.h" -#endif using namespace std; using namespace Tizen::Base; @@ -636,13 +634,8 @@ _UiEventManager::GetTarget(int x, int y) const { Tizen::Graphics::FloatPoint ptf((float) x, (float) y); -#if !defined(MULTI_WINDOW) - _ControlVisualElement* pRootControlElement = - dynamic_cast <_ControlVisualElement*>(_ControlManager::GetInstance()->GetRoot().GetVisualElement()); -#else _ControlVisualElement* pRootControlElement = dynamic_cast <_ControlVisualElement*>(_ControlManager::GetInstance()->GetTopVisibleWindowAt(Point(x, y))->GetVisualElement()); -#endif SysTryReturn(NID_UI, pRootControlElement, _UiObjectHandle(), E_SYSTEM, "[E_SYSTEM] System error occurred."); _ControlVisualElement* pControlVisualElement = pRootControlElement->GetControlChildAtPoint(ptf); diff --git a/src/ui/FUi_UiFocusEvent.cpp b/src/ui/FUi_UiFocusEvent.cpp index 275da4f..b87613e 100644 --- a/src/ui/FUi_UiFocusEvent.cpp +++ b/src/ui/FUi_UiFocusEvent.cpp @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/FUi_UiKeyEvent.cpp b/src/ui/FUi_UiKeyEvent.cpp old mode 100644 new mode 100755 index bf81c4d..85ad689 --- a/src/ui/FUi_UiKeyEvent.cpp +++ b/src/ui/FUi_UiKeyEvent.cpp @@ -21,6 +21,7 @@ #include #include +#include #include "FUi_UiKeyEvent.h" #include "FUi_IKeyEventListener.h" #include "FUi_IKeyEventPreviewer.h" @@ -195,16 +196,27 @@ _UiKeyEvent::GetKeyModifier(void) const return __keyInfo.GetKeyModifier(); } -result -_UiKeyEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltered) +bool +_UiKeyEvent::IsEventEnabled(const _Control& control) const { - result r = E_SUCCESS; + if (!_UiEvent::IsEventEnabled(control)) + { + return false; + } - if (!control.IsInputEnabled()) + if (!control.IsInputEventEnabled()) { - return E_SUCCESS; + return false; } + return true; +} + +result +_UiKeyEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltered) +{ + result r = E_SUCCESS; + _IKeyEventPreviewer* pKeyEventPreviewer = control.GetEventPreviewer<_UI_EVENT_KEY, _IKeyEventPreviewer*>(); SysTryReturn(NID_UI, pKeyEventPreviewer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); diff --git a/src/ui/FUi_UiManagerIpcMessages.cpp b/src/ui/FUi_UiManagerIpcMessages.cpp new file mode 100644 index 0000000..8d4d90a --- /dev/null +++ b/src/ui/FUi_UiManagerIpcMessages.cpp @@ -0,0 +1,46 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_UiManagerIpcMessages.cpp + * @brief This file contains IPC message class generated by macros. + */ + +#define IPC_MESSAGE_IMPL +#include "FUi_UiManagerIpcMessages.h" + +// Generate constructors. +#include "ipc/struct_constructor_macros.h" +#include "FUi_UiManagerIpcMessages.h" + +// Generate destructors. +#include "ipc/struct_destructor_macros.h" +#include "FUi_UiManagerIpcMessages.h" + +// Generate param traits write methods. +#include "ipc/param_traits_write_macros.h" +namespace IPC +{ +#include "FUi_UiManagerIpcMessages.h" +} // namespace IPC + +// Generate param traits read methods. +#include "ipc/param_traits_read_macros.h" +namespace IPC +{ +#include "FUi_UiManagerIpcMessages.h" +} // namespace IPC diff --git a/src/ui/FUi_UiManagerProxy.cpp b/src/ui/FUi_UiManagerProxy.cpp new file mode 100644 index 0000000..7ed3921 --- /dev/null +++ b/src/ui/FUi_UiManagerProxy.cpp @@ -0,0 +1,71 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_UiManagerProxy.cpp + * @brief This is the implementation for the _UiManagerProxy class. + */ + +#include +#include "FUi_UiManagerIpcMessages.h" +#include "FUi_UiManagerProxy.h" + +using namespace std; +using namespace Tizen::Io; + +namespace Tizen { namespace Ui +{ + +_UiManagerProxy::_UiManagerProxy(void) +{ +} + +_UiManagerProxy::~_UiManagerProxy(void) +{ +} + +result +_UiManagerProxy::Construct(void) +{ + unique_ptr<_IpcClient> pIpcClient(new (std::nothrow) _IpcClient()); + SysTryReturnResult(NID_UI, pIpcClient, E_OUT_OF_MEMORY, "Memory is insufficient."); + + result r = pIpcClient->Construct(L"osp.ui.ipcserver.uimanager"); + SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "Propagating."); + + __pIpcClient = move(pIpcClient); + + return E_SUCCESS; +} + +result +_UiManagerProxy::SetZOrderGroup(unsigned int window, int windowZOrderGroup) +{ + SysTryReturnResult(NID_UI, __pIpcClient, E_INVALID_STATE, "This has not been constructed as yet."); + + result r = E_SUCCESS; + unique_ptr pMsg(new (std::nothrow) UiManager_SetZOrderGroup(window, windowZOrderGroup, &r)); + SysTryReturnResult(NID_UI, pMsg, E_OUT_OF_MEMORY, "Memory is insufficient."); + + SysLog(NID_UI, "IPC message(0x%x, %d) is sent.", window, windowZOrderGroup); + __pIpcClient->SendRequest(*pMsg.get()); + SysTryReturnResult(NID_UI, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + + return E_SUCCESS; +} + +}} // Tizen::Ui diff --git a/src/ui/FUi_UiManagerProxy.h b/src/ui/FUi_UiManagerProxy.h new file mode 100644 index 0000000..11c98f7 --- /dev/null +++ b/src/ui/FUi_UiManagerProxy.h @@ -0,0 +1,62 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_UiManagerProxy.h + * @brief This is the header file of the _UiManagerProxy class. + */ + +#ifndef _FUI_INTERNAL_UI_MANAGER_PROXY_H_ +#define _FUI_INTERNAL_UI_MANAGER_PROXY_H_ + +#include + +namespace Tizen { namespace Io +{ +class _IpcClient; +}} // Tizen::Io + +namespace Tizen { namespace Ui +{ + +/** + * @class _UiManagerProxy + * @brief + * @since 2.1 + */ +class _UiManagerProxy + : public Tizen::Base::Object +{ +public: + _UiManagerProxy(void); + virtual ~_UiManagerProxy(void); + + result Construct(void); + + result SetZOrderGroup(unsigned int window, int windowZOrderGroup); + +private: + _UiManagerProxy(const _UiManagerProxy& rhs); + _UiManagerProxy& operator =(const _UiManagerProxy& rhs); + +private: + std::unique_ptr __pIpcClient; +}; // _UiManagerProxy + +}} // Tizen::Ui + +#endif // _FUI_INTERNAL_UI_MANAGER_PROXY_H_ \ No newline at end of file diff --git a/src/ui/FUi_UiNotificationEvent.cpp b/src/ui/FUi_UiNotificationEvent.cpp old mode 100644 new mode 100755 index b24c3e4..44c2a64 --- a/src/ui/FUi_UiNotificationEvent.cpp +++ b/src/ui/FUi_UiNotificationEvent.cpp @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -77,7 +77,7 @@ _UiNotificationEvent::GetEventType(void) const } bool -_UiNotificationEvent::IsEventReceivable(const _Control& control) const +_UiNotificationEvent::IsEventEnabled(const _Control& control) const { return true; } diff --git a/src/ui/FUi_UiTouchEvent.cpp b/src/ui/FUi_UiTouchEvent.cpp index 70153f5..650c30f 100644 --- a/src/ui/FUi_UiTouchEvent.cpp +++ b/src/ui/FUi_UiTouchEvent.cpp @@ -32,6 +32,13 @@ #include "FUi_ITouchGestureDelegate.h" #include "FUi_ControlImpl.h" #include "FUi_TouchEventArg.h" +#include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" + +extern "C" { +extern void _UiPrintControl(const Tizen::Ui::_Control& control, bool printChildren); +} + using namespace std::tr1; using namespace Tizen::Base::Collection; @@ -51,6 +58,15 @@ _TouchInfo::_TouchInfo(void) _TouchInfo::_TouchInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::Point& current, const bool isFlick, long long timeStamp) : __pointId(pointId) , __touchStatus(status) + , __isFlicked(isFlick) + , __timeStamp(timeStamp) +{ + __currentPosition = _CoordinateSystemUtils::ConvertToFloat(current); +} + +_TouchInfo::_TouchInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::FloatPoint& current, const bool isFlick, long long timeStamp) + : __pointId(pointId) + , __touchStatus(status) , __currentPosition(current) , __isFlicked(isFlick) , __timeStamp(timeStamp) @@ -91,7 +107,7 @@ _TouchInfo::GetTouchStatus(void) const return __touchStatus; } -Tizen::Graphics::Point +Tizen::Graphics::FloatPoint _TouchInfo::GetCurrentPosition(void) const { return __currentPosition; @@ -120,6 +136,16 @@ _TouchInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Grap { __pointId = pointId; __touchStatus = status; + __currentPosition = _CoordinateSystemUtils::ConvertToFloat(current); + __isFlicked = isFlick; + __timeStamp = timeStamp; +} + +void +_TouchInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::FloatPoint& current, bool isFlick, long long timeStamp) +{ + __pointId = pointId; + __touchStatus = status; __currentPosition = current; __isFlicked = isFlick; __timeStamp = timeStamp; @@ -128,7 +154,7 @@ _TouchInfo::SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Grap _UiTouchEvent::_UiTouchEvent(const _UiObjectHandle& destination, const _TouchInfo& touchInfo, _UiEventRouteType routeType, const _UiObjectHandle& source) : _UiEvent(destination, source, routeType) , __touchInfo(touchInfo) - , __pForcedGestureList(new (std::nothrow) LinkedListT<_Control*>) + , __pForcedControlList(new (std::nothrow) LinkedListT<_Control*>) { } @@ -139,7 +165,7 @@ _UiTouchEvent::~_UiTouchEvent(void) _UiTouchEvent::_UiTouchEvent(const _UiTouchEvent& rhs) : _UiEvent(rhs) , __touchInfo(rhs.__touchInfo) - , __pForcedGestureList(rhs.__pForcedGestureList) + , __pForcedControlList(rhs.__pForcedControlList) { } @@ -151,7 +177,7 @@ _UiTouchEvent::operator =(const _UiTouchEvent& rhs) if (this != &rhs) { __touchInfo = rhs.__touchInfo; - __pForcedGestureList = rhs.__pForcedGestureList; + __pForcedControlList = rhs.__pForcedControlList; } return *this; @@ -175,6 +201,22 @@ _UiTouchEvent::GetEventType(void) const return _UI_EVENT_TOUCH; } +bool +_UiTouchEvent::IsEventEnabled(const _Control& control) const +{ + if (!_UiEvent::IsEventEnabled(control)) + { + return false; + } + + if (!control.IsInputEventEnabled()) + { + return false; + } + + return true; +} + result _UiTouchEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltered) { @@ -183,11 +225,6 @@ _UiTouchEvent::OnPreviewEventProcessing(const _Control& control, bool& isFiltere const _TouchInfo* pTouchInfo = GetTouchInfo(); SysTryReturn(NID_UI, pTouchInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); - if (!control.IsInputEnabled() && pTouchInfo->GetTouchStatus() != _TOUCH_CANCELED) - { - return E_SUCCESS; - } - if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered) { _ITouchEventPreviewer* pTouchEventPreviewer = control.GetEventPreviewer<_UI_EVENT_TOUCH, _ITouchEventPreviewer*>(); @@ -209,18 +246,13 @@ _UiTouchEvent::OnEventProcessing(const _Control& control, bool& isFiltered) const _TouchInfo* pTouchInfo = GetTouchInfo(); SysTryReturn(NID_UI, pTouchInfo, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); - if (!control.IsInputEnabled() && pTouchInfo->GetTouchStatus() != _TOUCH_CANCELED) - { - return E_SUCCESS; - } - if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered) { ProcessGesture(control, isFiltered); } else if (isFiltered) { - doesControlExist = __pForcedGestureList->Contains(const_cast<_Control*>(&control)); + doesControlExist = __pForcedControlList->Contains(const_cast<_Control*>(&control)); if (doesControlExist) { @@ -234,12 +266,15 @@ _UiTouchEvent::OnEventProcessing(const _Control& control, bool& isFiltered) } } - if ((!ExistGlobalGesture() || GetAccessibilityEvent()) && !isFiltered) + if (!ExistGlobalGesture() || GetAccessibilityEvent()) { - _ITouchEventListener* pTouchEventListener = control.GetPropagatedTouchEventListener(); - SysTryReturn(NID_UI, pTouchEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); + if(!isFiltered || doesControlExist) + { + _ITouchEventListener* pTouchEventListener = control.GetPropagatedTouchEventListener(); + SysTryReturn(NID_UI, pTouchEventListener, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred."); - r = FireListener(pTouchEventListener, &control, true, isFiltered); + r = FireListener(pTouchEventListener, &control, true, isFiltered); + } } return r; @@ -310,7 +345,7 @@ _UiTouchEvent::FireListener(const _ITouchEventListener* pListener, const _Contro pTouchManager->ResetTouchInfo(); return E_SUCCESS; - + } if (ResetTouchInfo(pTarget, *pTouchInfo) == E_SUCCESS) @@ -319,7 +354,7 @@ _UiTouchEvent::FireListener(const _ITouchEventListener* pListener, const _Contro return E_SYSTEM; } - Point point(0, 0); + FloatPoint point(0, 0); if (pControl) { @@ -368,12 +403,12 @@ _UiTouchEvent::FireListener(const _ITouchEventListener* pListener, const _Contro if (pData) { _ControlImpl* pTargetImpl = static_cast<_ControlImpl*>(pData); - if (pTargetImpl) - { - pTargetImpl->GenerateTouchEvent(touchInfo); - } + if (pTargetImpl) + { + pTargetImpl->GenerateTouchEvent(touchInfo); } } + } break; case _TOUCH_CANCELED: @@ -384,6 +419,16 @@ _UiTouchEvent::FireListener(const _ITouchEventListener* pListener, const _Contro r = E_SYSTEM; } + if (isFiltered) + { + if (pControl) + { + SysLog(NID_UI, "Event Consumed : isFiltered is True : pTouchEventListener %x", pControl); + //_UiPrintControl(*pControl, false); + } + SysLog(NID_UI, "Event Consumed : isFiltered is True : pTarget %x", pTarget); + } + return r; } @@ -400,7 +445,7 @@ _UiTouchEvent::FirePreviewListener(const _ITouchEventPreviewer* pListener, const const _Control* pTarget = GetControl(GetDestination()); - Point point = GetRelativePoint(*pControl, pTouchInfo->GetCurrentPosition()); + FloatPoint point = GetRelativePoint(*pControl, pTouchInfo->GetCurrentPosition()); _TouchInfo touchInfo(pTouchInfo->GetPointId(), pTouchInfo->GetTouchStatus(), point, false, pTouchInfo->GetTimeStamp()); @@ -441,7 +486,7 @@ _UiTouchEvent::FirePreviewListener(const _ITouchEventPreviewer* pListener, const // if (isFiltered) if (eventDelivery == _UI_TOUCH_EVENT_DELIVERY_FORCED_YES) { - __pForcedGestureList->Add(const_cast<_Control*>(pControl)); + __pForcedControlList->Add(const_cast<_Control*>(pControl)); } } else @@ -490,11 +535,11 @@ _UiTouchEvent::ProcessGesture(const _Control& control, bool& isFiltered) return E_SUCCESS; } -Point -_UiTouchEvent::GetRelativePoint(const _Control& control, const Point& point) const +FloatPoint +_UiTouchEvent::GetRelativePoint(const _Control& control, const FloatPoint& point) const { - Point relativePoint(point); - Rectangle absRect = control.GetAbsoluteBounds(); + FloatPoint relativePoint(point); + FloatRectangle absRect = control.GetAbsoluteBoundsF(); relativePoint.x -= absRect.x; relativePoint.y -= absRect.y; diff --git a/src/ui/FUi_VariantImpl.cpp b/src/ui/FUi_VariantImpl.cpp index 323dbc3..3cd1bf8 100644 --- a/src/ui/FUi_VariantImpl.cpp +++ b/src/ui/FUi_VariantImpl.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include "FUi_VariantImpl.h" @@ -191,6 +193,20 @@ _VariantImpl::Clear(void) break; } + case VARIANT_TYPE_FLOAT_POINT3: + { + delete __data.pFloatPoint3; + __data.pFloatPoint3 = null; + break; + } + + case VARIANT_TYPE_FLOAT_VECTOR4: + { + delete __data.pFloatVector4; + __data.pFloatVector4 = null; + break; + } + default: break; } @@ -285,6 +301,14 @@ _VariantImpl::Copy(const Variant& rhs) __data.pFloatMatrix4 = new (std::nothrow) FloatMatrix4(*pImpl->__data.pFloatMatrix4); break; + case VARIANT_TYPE_FLOAT_POINT3: + __data.pFloatPoint3 = new (std::nothrow) FloatPoint3(*pImpl->__data.pFloatPoint3); + break; + + case VARIANT_TYPE_FLOAT_VECTOR4: + __data.pFloatVector4 = new (std::nothrow) FloatVector4(*pImpl->__data.pFloatVector4); + break; + default: break; } diff --git a/src/ui/FUi_VerticalBoxLayoutImpl.cpp b/src/ui/FUi_VerticalBoxLayoutImpl.cpp old mode 100644 new mode 100755 index 1d2885a..c06ff39 --- a/src/ui/FUi_VerticalBoxLayoutImpl.cpp +++ b/src/ui/FUi_VerticalBoxLayoutImpl.cpp @@ -22,6 +22,7 @@ */ #include "FUi_VerticalBoxLayoutImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { @@ -117,7 +118,7 @@ _VerticalBoxLayoutImpl::SetHorizontalAlignment(_ControlImpl& control, LayoutHori } result -_VerticalBoxLayoutImpl::SetSpacing(_ControlImpl& control, int space) +_VerticalBoxLayoutImpl::SetSpacing(_ControlImpl& control, float space) { ClearLastResult(); @@ -129,15 +130,15 @@ _VerticalBoxLayoutImpl::SetSpacing(_ControlImpl& control, int space) } result -_VerticalBoxLayoutImpl::SetHorizontalMargin(_ControlImpl& control, int left, int right) +_VerticalBoxLayoutImpl::SetHorizontalMargin(_ControlImpl& control, float left, float right) { - result r = SetMargin(control, left, right, 0, 0); + result r = SetMargin(control, left, right, 0.0f, 0.0f); return r; } result -_VerticalBoxLayoutImpl::SetWidth(_ControlImpl& control, int width) +_VerticalBoxLayoutImpl::SetWidth(_ControlImpl& control, float width) { ClearLastResult(); @@ -164,7 +165,7 @@ _VerticalBoxLayoutImpl::SetItemHorizontalFitPolicy(_ControlImpl& control, FitPol } result -_VerticalBoxLayoutImpl::SetHeight(_ControlImpl& control, int height) +_VerticalBoxLayoutImpl::SetHeight(_ControlImpl& control, float height) { ClearLastResult(); @@ -262,13 +263,13 @@ _VerticalBoxLayoutImpl::GetCore(void) const _VerticalBoxLayoutImpl* _VerticalBoxLayoutImpl::GetInstance(const VerticalBoxLayout& layout) { - return static_cast(_LayoutImpl::GetInstance(layout)); + return static_cast (_LayoutImpl::GetInstance(layout)); } _VerticalBoxLayoutImpl* _VerticalBoxLayoutImpl::GetInstance(VerticalBoxLayout& layout) { - return static_cast<_VerticalBoxLayoutImpl*>(_LayoutImpl::GetInstance(layout)); + return static_cast <_VerticalBoxLayoutImpl*>(_LayoutImpl::GetInstance(layout)); } }} // Tizen::Ui diff --git a/src/ui/FUi_VerticalBoxLayoutImpl.h b/src/ui/FUi_VerticalBoxLayoutImpl.h old mode 100644 new mode 100755 index de016c5..0879234 --- a/src/ui/FUi_VerticalBoxLayoutImpl.h +++ b/src/ui/FUi_VerticalBoxLayoutImpl.h @@ -138,10 +138,10 @@ public: */ result SetHorizontalAlignment(_ControlImpl& control, LayoutHorizontalAlignment horAlign); - /** + /* * Sets the space between the specified control and its predecessor. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the space is set * @param[in] space The space @@ -149,12 +149,12 @@ public: * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetSpacing(_ControlImpl& control, int space); + result SetSpacing(_ControlImpl& control, float space); - /** + /* * Sets the horizontal margins of the specified control. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the margins are set * @param[in] top The top margin @@ -162,12 +162,12 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetHorizontalMargin(_ControlImpl& control, int left, int right); + result SetHorizontalMargin(_ControlImpl& control, float left, float right); - /** + /* * Sets the width of the specified control with the fixed length. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the width is set * @param[in] virWidth This is not used. @@ -175,7 +175,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetWidth(_ControlImpl& control, int width); + result SetWidth(_ControlImpl& control, float width); /** * Sets the width of the specified control with the fitting policy. @@ -189,10 +189,10 @@ public: */ result SetItemHorizontalFitPolicy(_ControlImpl& control, FitPolicy policy); - /** + /* * Sets the height of the specified control with fixed length. * - * @since 2.0 + * @since 2.1 * @return An error code * @param[in] control The control for which the height is set * @param[in] virHeight This is not used. @@ -200,7 +200,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetHeight(_ControlImpl& control, int height); + result SetHeight(_ControlImpl& control, float height); /** * Sets the height of the specified control with the fitting policy. diff --git a/src/ui/FUi_Window.cpp b/src/ui/FUi_Window.cpp index bd482ee..ff1f784 100644 --- a/src/ui/FUi_Window.cpp +++ b/src/ui/FUi_Window.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Window.cpp * @brief This is the implementation file for the _Window class. @@ -31,10 +32,8 @@ #include "FUiAnim_VisualElement.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" -#if defined(MULTI_WINDOW) #include "FUiAnim_DisplayManager.h" #include "FUiAnim_EflLayer.h" -#endif using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -50,19 +49,15 @@ _Window::CreateWindowN(void) _Window* pWindow = new (std::nothrow) _Window; SysTryReturn(NID_UI, pWindow, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); -#if defined(MULTI_WINDOW) result r = E_SUCCESS; -#endif if (IsFailed(GetLastResult())) { goto CATCH; } -#if defined(MULTI_WINDOW) r = pWindow->CreateRootVisualElement(); SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif pWindow->AcquireHandle(); @@ -85,11 +80,12 @@ _Window::~_Window(void) __pDisplayContext = null; } -#if defined(MULTI_WINDOW) - if(__pLayer) { -// Detach. + //_EflLayer* pLayer = static_cast<_EflLayer*>(__pLayer); + //Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas()); + //SysLog(NID_UI, "[Multi_Window] destroy x window(0x%x)", win); + if(__pRootVisualElement) { __pRootVisualElement->DetachChild(*GetVisualElement()); @@ -97,10 +93,8 @@ _Window::~_Window(void) delete __pLayer; __pLayer = NULL; } - __pRootVisualElement =NULL; - -#endif + __pRootVisualElement =NULL; } _IWindowDelegate& @@ -121,15 +115,14 @@ _Window::GetDescription(void) const String description = _Control::GetDescription(); String descriptionTemp(L""); - descriptionTemp.Format(LOG_LEN_MAX, L"_Window: owner(0x%x) delegate(0x%x) activated(%d) destroying(%d) displayContext(0x%x)", - __pOwner, __pWindowDelegate, __activated, __destroying, __pDisplayContext); + descriptionTemp.Format(LOG_LEN_MAX, L"_Window: xid(0x%x) owner(0x%x) delegate(0x%x) activated(%d) destroying(%d) displayContext(0x%x)", + GetNativeHandle(), __pOwner, __pWindowDelegate, __activated, __destroying, __pDisplayContext); description.Append(descriptionTemp); return description; } -#if defined(MULTI_WINDOW) void _Window::SetRootVisualElement(const Tizen::Ui::Animations::_RootVisualElement& rootVisualElement) { @@ -137,7 +130,14 @@ _Window::SetRootVisualElement(const Tizen::Ui::Animations::_RootVisualElement& r __pRootVisualElement = pRootVE; } -#endif + +void +_Window::SetLayer(const Tizen::Ui::Animations::_NativeLayer& layer) +{ + _NativeLayer* pLayer = const_cast<_NativeLayer*>(&layer); + + __pLayer = pLayer; +} bool _Window::IsActivatedOnOpen(void) const @@ -215,6 +215,20 @@ _Window::SetOwner(_Control* pOwner) { ClearLastResult(); + if (pOwner) + { + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + if (pEcoreEvas) + { + if (__transient == true) + { + pEcoreEvas->SetOwner(*this, *pOwner); + } + + __transient = true; + } + } + if (pOwner == __pOwner) { return; @@ -223,28 +237,27 @@ _Window::SetOwner(_Control* pOwner) if (__pOwner) { __pOwner->DetachOwnee(*this); - __pOwner = null; } if (pOwner) { pOwner->AttachOwnee(*this); - __pOwner = pOwner; - -#if defined(MULTI_WINDOW) - GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner); -#endif } + GetWindowDelegate().OnOwnerChanged(__pOwner); + __pOwner = pOwner; } -#if defined(MULTI_WINDOW) result _Window::CreateRootVisualElement(void) { result r = CreateLayer(); SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - __pLayer = GetRootVisualElement()->GetNativeLayer(); +#if defined(ROTATION_SYNC) + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysAssert(pEcoreEvas); + pEcoreEvas->SetWindowOrientationEnabled(*this, false); +#endif // Get visual element. _VisualElement* pVisualElement = GetVisualElement(); @@ -282,9 +295,11 @@ _Window::CreateLayer(void) __pRootVisualElement->SetName(L"Root"); + //Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas()); + //SysLog(NID_UI, "[Multi_Window] create x window(0x%x)", win); + return E_SUCCESS; } -#endif bool _Window::IsFocusableDescendant(const _Control* pFocus) const @@ -292,7 +307,6 @@ _Window::IsFocusableDescendant(const _Control* pFocus) const return true; } -#if defined(MULTI_WINDOW) void _Window::SetActivationEnabled(bool enable) { @@ -317,23 +331,29 @@ _Window::IsActivationEnabled(void) return enable; } -_RootVisualElement* -_Window::GetRootVisualElement(void) const +#if defined(ROTATION_SYNC) +void +_Window::SetOrientationEnabled(bool enable) { - return __pRootVisualElement; + __orientationEnabled = enable; +} + +bool +_Window::IsOrientationEnabled(void) +{ + return __orientationEnabled; } -#else +#endif + _RootVisualElement* _Window::GetRootVisualElement(void) const { return __pRootVisualElement; } -#endif NativeWindowHandle _Window::GetNativeHandle(void) const { -#if defined(MULTI_WINDOW) _RootVisualElement* pRootVE = GetRootVisualElement(); SysAssert(pRootVE); @@ -342,12 +362,6 @@ _Window::GetNativeHandle(void) const Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas(); Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas); -#else - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysAssert(pEcoreEvas); - - Ecore_X_Window win = pEcoreEvas->GetXWindow(); -#endif return win; } @@ -429,25 +443,12 @@ _Window::OnDeactivated(void) SysLog(NID_UI, "frameActivated(%d)", isFrameActivated); } -#if !defined(MULTI_WINDOW) - void -_Window::OnVisibleStateChanged(void) +_Window::OnOwnerChanged(_Control* pOldOwner) { - bool visibleState = GetVisibleState(); - if (visibleState == true) - { - Open(false); - } - else - { - Close(); - } -} -#endif +} -#if defined(MULTI_WINDOW) result _Window::OnBoundsChanging(const Rectangle& bounds) { @@ -504,7 +505,6 @@ _Window::IsLayoutChangable(void) const { return false; } -#endif void _Window::OnChangeLayout(_ControlOrientation orientation) @@ -547,28 +547,17 @@ _Window::GetDisplayContext(void) const result _Window::SetZOrderGroup(int windowZOrderGroup) { + __transient = false; + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysAssert(pEcoreEvas); + bool visible = pEcoreEvas->IsWindowVisible(*this); + bool activationEnabled = pEcoreEvas->IsWindowActivationEnabled(*this); - _WindowLevel windowLevel = _WINDOW_LEVEL_NORMAL; - switch (windowZOrderGroup) + if ((visible == true) && (activationEnabled == true)) { - case WINDOW_Z_ORDER_GROUP_HIGHEST: - windowLevel = _WINDOW_LEVEL_NOTIFICATION_HIGH; - break; - case WINDOW_Z_ORDER_GROUP_HIGH: - windowLevel = _WINDOW_LEVEL_NOTIFICATION_MIDDLE; - break; - default: - break; + pEcoreEvas->ActivateWindow(*this); } -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetWindowLevel(windowLevel); -#else - pEcoreEvas->SetWindowLevel(*GetRootWindow(), windowLevel); -#endif - return E_SUCCESS; } @@ -584,18 +573,14 @@ _Window::_Window() , __systemWindow(false) , __isOpened(false) , __isInitialized(false) +#if defined(ROTATION_SYNC) + , __orientationEnabled(false) +#endif + , __transient(true) { SetControlDelegate(*this); SetWindowDelegate(*this); SetClipToParent(false); // [ToDo] exception check. -#if !defined(MULTI_WINDOW) - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysAssert(pEcoreEvas); - __pRootVisualElement = pEcoreEvas->GetRootVisualElement(); - SysAssert(__pRootVisualElement); - __pLayer = __pRootVisualElement->GetNativeLayer(); - SysAssert(__pLayer); -#endif } void diff --git a/src/ui/FUi_WindowImpl.cpp b/src/ui/FUi_WindowImpl.cpp old mode 100644 new mode 100755 index 7570237..0f2a50b --- a/src/ui/FUi_WindowImpl.cpp +++ b/src/ui/FUi_WindowImpl.cpp @@ -25,6 +25,7 @@ #include "FUi_WindowImpl.h" #include "FUi_Window.h" #include "FUi_ErrorMessages.h" +#include "FUi_UiManagerProxy.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -109,6 +110,12 @@ public: __core.OnDeactivated(); } + virtual void OnOwnerChanged(_Control* pOldOwner) + { + __impl.OnOwnerChanged(pOldOwner); + __core.OnOwnerChanged(pOldOwner); + } + private: WindowImplDelegate(const WindowImplDelegate& rhs); WindowImplDelegate& operator =(const WindowImplDelegate& rhs); @@ -160,6 +167,28 @@ _WindowImpl::CreateWindowImplN(Window* pPublic, const Rectangle& bounds, return pImpl; } +_WindowImpl* +_WindowImpl::CreateWindowImplN(Window* pPublic, const FloatRectangle& bounds, + const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, + bool resizable, bool movable) +{ + result r = E_SUCCESS; + + _Window* pCore = _Window::CreateWindowN(); + SysTryReturn(NID_UI, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + + _WindowImpl* pImpl = + new (std::nothrow) _WindowImpl(pPublic, pCore, bounds, + pPublicPortraitLayout, pPublicLandscapeLayout, + resizable, movable); + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + ClearLastResult(); + + return pImpl; +} + _WindowImpl::~_WindowImpl(void) { _WindowImpl::GetCore().ResetWindowDelegate(); @@ -239,14 +268,12 @@ _WindowImpl::OnDeactivated(void) } -#if !defined(MULTI_WINDOW) void -_WindowImpl::Rotate(_ControlRotation rotation) +_WindowImpl::OnOwnerChanged(_Control* pOldOwner) { } -#else result _WindowImpl::OnBoundsChanging(const Rectangle& bounds) { @@ -268,7 +295,6 @@ _WindowImpl::OnRotated(_ControlRotation rotation) { } -#endif result _WindowImpl::Open(bool drawAndShow) @@ -304,13 +330,31 @@ _WindowImpl::GetDisplayContext(void) const result _WindowImpl::SetZOrderGroup(WindowZOrderGroup windowZOrderGroup) { + _UiManagerProxy uiManagerProxy; + result r = uiManagerProxy.Construct(); + SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "Propagating."); + + NativeWindowHandle handle = GetCore().GetNativeHandle(); + r = uiManagerProxy.SetZOrderGroup(handle, static_cast(windowZOrderGroup)); + SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "Propagating."); + return GetCore().SetZOrderGroup(windowZOrderGroup); } -_Control* +Control* _WindowImpl::GetOwner(void) const { - return GetCore().GetOwner(); + _Control* pOwner = GetCore().GetOwner(); + if (pOwner) + { + _ControlImpl* pImpl = static_cast<_ControlImpl*>(pOwner->GetUserData()); + if (pImpl) + { + return (&pImpl->GetPublic()); + } + } + + return null; } void @@ -328,6 +372,22 @@ _WindowImpl::GetNativeHandle(void) const return GetCore().GetNativeHandle(); } +result +_WindowImpl::Destroy(void) +{ + result r = E_SUCCESS; + + Control* pOwner = GetOwner(); + if (pOwner) + { + _ControlImpl* pImpl = _ControlImpl::GetInstance(*pOwner); + pImpl->GetCore().DetachOwnee(GetCore()); + } + + delete &GetPublic(); + return r; +} + void _WindowImpl::Initialize(Window* pPublic, _Window* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout) { @@ -384,4 +444,27 @@ _WindowImpl::_WindowImpl(Window* pPublic, _Window* pCore, const Rectangle& bound pCore->SetMovable(movable); } +_WindowImpl::_WindowImpl(Window* pPublic, _Window* pCore, const FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable) + : _ContainerImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout) +{ + result r = E_SUCCESS; + + Initialize(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout); + + r = GetLastResult(); + if (IsFailed(r)) + { + return; + } + + bool allOrNone = (pPublicPortraitLayout && pPublicLandscapeLayout) || (!pPublicPortraitLayout && !pPublicLandscapeLayout); + SysAssert(allOrNone); + + r = SetBounds(bounds); + SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + pCore->SetResizable(resizable); + pCore->SetMovable(movable); +} + }} //Tizen::Ui diff --git a/src/ui/animations/FUiAnimAnimationBase.cpp b/src/ui/animations/FUiAnimAnimationBase.cpp index d29385c..7de1f8e 100644 --- a/src/ui/animations/FUiAnimAnimationBase.cpp +++ b/src/ui/animations/FUiAnimAnimationBase.cpp @@ -63,7 +63,7 @@ AnimationBase::AnimationBase(const AnimationBase& animationBase) result r = E_SUCCESS; - _pAnimationBaseImpl = new (std::nothrow) _AnimationBaseImpl(this); + _pAnimationBaseImpl = new (std::nothrow) _AnimationBaseImpl(); SysTryReturnVoidResult(NID_UI_ANIM, (_pAnimationBaseImpl != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); r = _pAnimationBaseImpl->Construct(); @@ -103,7 +103,7 @@ AnimationBase::AnimationBase(long duration, AnimationInterpolatorType interpolat result r = E_SUCCESS; - _pAnimationBaseImpl = new (std::nothrow) _AnimationBaseImpl(this); + _pAnimationBaseImpl = new (std::nothrow) _AnimationBaseImpl(); SysTryReturnVoidResult(NID_UI_ANIM, (_pAnimationBaseImpl != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); r = _pAnimationBaseImpl->Construct(); diff --git a/src/ui/animations/FUiAnimFrameAnimator.cpp b/src/ui/animations/FUiAnimFrameAnimator.cpp index 2e14065..33f7812 100644 --- a/src/ui/animations/FUiAnimFrameAnimator.cpp +++ b/src/ui/animations/FUiAnimFrameAnimator.cpp @@ -122,6 +122,13 @@ FrameAnimator::SetCurrentForm(const Form& form) return r; } +result +FrameAnimator::SetCurrentForm(Form *pForm) +{ + SysTryReturnResult(NID_UI_ANIM, pForm != null, E_INVALID_ARG, "pForm is null."); + return SetCurrentForm(*pForm); +} + void FrameAnimator::SetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation animation, long duration, AnimationInterpolatorType interpolator) { @@ -131,7 +138,7 @@ FrameAnimator::SetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation a } else { - SysLog(NID_UI_ANIM, "[E_INVALID_ARG] Invalid argument(s) is used. duration =%d", duration); + SysLog(NID_UI_ANIM, "Invalid argument(s) is used. duration =%d", duration); } if (animation >= FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_LEFT @@ -141,7 +148,7 @@ FrameAnimator::SetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation a } else { - SysLog(NID_UI_ANIM, "[E_INVALID_ARG] Invalid argument(s) is used. Effect type is invalid."); + SysLog(NID_UI_ANIM, "Invalid argument(s) is used. The type of form transition animation is invalid. [%d]", animation); } if (interpolator >= ANIMATION_INTERPOLATOR_LINEAR @@ -151,7 +158,7 @@ FrameAnimator::SetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation a } else { - SysLog(NID_UI_ANIM, "[E_INVALID_ARG] Invalid argument(s) is used. Interpolator type is invalid."); + SysLog(NID_UI_ANIM, "Invalid argument(s) is used. The type of interpolator is invalid [%d].", interpolator); } } diff --git a/src/ui/animations/FUiAnimVisualElement.cpp b/src/ui/animations/FUiAnimVisualElement.cpp index d0914f1..57e61d0 100644 --- a/src/ui/animations/FUiAnimVisualElement.cpp +++ b/src/ui/animations/FUiAnimVisualElement.cpp @@ -42,6 +42,13 @@ #define CHECK_PARAMETER_CONSTRUCTED(element) \ SysAssertf((element)._pVisualElementImpl && (element)._pVisualElementImpl->__pSharedData, "Not yet constructed! Construct() should be called before use."); +#define CHECK_PRESENTATION_INSTANCE(pElement) \ + if ((pElement && pElement->_pVisualElementImpl == pElement->_pVisualElementImpl->__pPresentation)) { return; } + +#define CHECK_PRESENTATION_INSTANCE_RETURN(pElement, ret) \ + if ((pElement && pElement->_pVisualElementImpl == pElement->_pVisualElementImpl->__pPresentation)) { return ret; } + + namespace Tizen { namespace Ui { namespace Animations { @@ -168,6 +175,7 @@ result VisualElement::SetProperty(const Tizen::Base::String& property, const Variant& value) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->InvokeOnSetPropertyRequested(property, value); } @@ -190,6 +198,7 @@ result VisualElement::SetZOrderGroup(int zOrderGroup) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); SysTryReturnResult(NID_UI_ANIM, zOrderGroup >= Z_ORDER_GROUP_LOWEST, E_OUT_OF_RANGE, "zOrderGroup is less than Z_ORDER_GROUP_LOWEST"); SysTryReturnResult(NID_UI_ANIM, zOrderGroup <= Z_ORDER_GROUP_HIGHEST, E_OUT_OF_RANGE, "zOrderGroup is greater than Z_ORDER_GROUP_HIGHEST"); @@ -217,6 +226,7 @@ void VisualElement::SetRedrawOnResizeEnabled(bool enabled) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetRedrawOnResizeEnabled(enabled); } @@ -233,6 +243,7 @@ result VisualElement::SetBounds(const FloatRectangle& bounds) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetBounds(bounds); } @@ -249,6 +260,7 @@ void VisualElement::SetZPosition(float zPosition) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetZPosition(zPosition); } @@ -273,6 +285,7 @@ void VisualElement::SetShowState(bool show) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetShowState(show); } @@ -289,6 +302,7 @@ void VisualElement::SetOpacity(float opacity) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetOpacity(opacity); } @@ -305,6 +319,7 @@ result VisualElement::SetTransformMatrix(const Tizen::Graphics::FloatMatrix4& transform) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetTransformMatrix(transform); } @@ -321,6 +336,7 @@ result VisualElement::SetChildrenTransformMatrix(const Tizen::Graphics::FloatMatrix4& transform) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetChildrenTransformMatrix(transform); } @@ -337,6 +353,7 @@ void VisualElement::SetAnchor(const FloatPoint& anchor) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetAnchor(anchor); } @@ -353,6 +370,7 @@ void VisualElement::SetAnchorZ(float anchorZ) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetAnchorZ(anchorZ); @@ -395,27 +413,42 @@ VisualElement::GetChildrenCount(void) const } bool -VisualElement::IsChildOf(const VisualElement& element) const +VisualElement::IsChildOf(const VisualElement& other) const { CHECK_CONSTRUCTED; - CHECK_PARAMETER_CONSTRUCTED(element); + CHECK_PARAMETER_CONSTRUCTED(other); - return _pVisualElementImpl->IsChildOf(*element._pVisualElementImpl); + return _pVisualElementImpl->IsChildOf(*other._pVisualElementImpl); +} +bool +VisualElement::IsChildOf(const VisualElement* pOther) const +{ + SysTryReturnResult(NID_UI_ANIM, pOther != null, E_INVALID_ARG, "pOther is null"); + return IsChildOf(*pOther); } result VisualElement::AttachChild(const VisualElement& child) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); CHECK_PARAMETER_CONSTRUCTED(child); return _pVisualElementImpl->AddChild(*child._pVisualElementImpl); } result +VisualElement::AttachChild(VisualElement* pChild) +{ + SysTryReturnResult(NID_UI_ANIM, pChild != null, E_INVALID_ARG, "pChild is null"); + return AttachChild(*pChild); +} + +result VisualElement::InsertChild(const VisualElement& child, const VisualElement* pReference, bool above) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); CHECK_PARAMETER_CONSTRUCTED(child); _VisualElementImpl* pRefInternal = null; @@ -429,9 +462,18 @@ VisualElement::InsertChild(const VisualElement& child, const VisualElement* pRef } result +VisualElement::InsertChild(VisualElement* pChild, const VisualElement* pReference, bool above) +{ + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); + SysTryReturnResult(NID_UI_ANIM, pChild != null, E_INVALID_ARG, "pChild is null"); + return InsertChild(*pChild, pReference, above); +} + +result VisualElement::DetachChild(const VisualElement& child) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); CHECK_PARAMETER_CONSTRUCTED(child); _VisualElementImpl* pInternal = null; @@ -442,9 +484,18 @@ VisualElement::DetachChild(const VisualElement& child) } result +VisualElement::DetachChild(VisualElement* pChild) +{ + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); + SysTryReturnResult(NID_UI_ANIM, pChild != null, E_INVALID_ARG, "pChild is null"); + return DetachChild(*pChild); +} + +result VisualElement::ChangeZOrder(const VisualElement* pReference, bool above) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); _VisualElementImpl* pRefInternal = null; if (pReference) @@ -460,6 +511,7 @@ result VisualElement::SetAnimationProvider(IVisualElementAnimationProvider* pProvider) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetAnimationProvider(pProvider); } @@ -477,6 +529,7 @@ result VisualElement::SetContentProvider(IVisualElementContentProvider* pProvider) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetContentProvider(pProvider); } @@ -489,11 +542,11 @@ VisualElement::GetContentProvider(void) const return _pVisualElementImpl->GetContentProvider(); } - result VisualElement::SetVisualElementEventListener(IVisualElementEventListener* pListener) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetVisualElementEventListener(pListener); } @@ -506,7 +559,6 @@ VisualElement::GetVisualElementEventListener(void) const return _pVisualElementImpl->GetVisualElementEventListener(); } - Tizen::Base::String VisualElement::GetName(void) const { @@ -519,6 +571,7 @@ void VisualElement::SetName(const Tizen::Base::String& name) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetName(name); } @@ -527,6 +580,7 @@ void VisualElement::SetUserData(void* pUserData) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetUserData(pUserData); } @@ -543,6 +597,7 @@ result VisualElement::SetSurface(VisualElementSurface* pSurface) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetSurface(pSurface); } @@ -559,6 +614,7 @@ result VisualElement::SetRenderOperation(RenderOperation renderOperation) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetRenderOperation(renderOperation); } @@ -589,6 +645,7 @@ result VisualElement::InvalidateRectangle(const FloatRectangle* pRectangle) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->InvalidateRectangle(pRectangle); } @@ -605,6 +662,7 @@ result VisualElement::Draw(void) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->Draw(); } @@ -625,6 +683,15 @@ VisualElement::GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const return _pVisualElementImpl->GetCanvasN(bounds); } +Tizen::Graphics::Canvas* +VisualElement::GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const +{ + CHECK_CONSTRUCTED; + + return _pVisualElementImpl->GetCanvasN(bounds); + +} + VisualElement* VisualElement::GetChildAt(const FloatPoint& point) const { @@ -651,6 +718,7 @@ void VisualElement::SetClipChildrenEnabled(bool clipChildren) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetClipChildrenEnabled(clipChildren); } @@ -687,10 +755,21 @@ VisualElement::ConvertCoordinates(FloatRectangle& rectangle, const VisualElement return _pVisualElementImpl->ConvertCoordinates(rectangle, pFrom); } +FloatPoint3 +VisualElement::TransformVectorFromOrigin(const Tizen::Graphics::FloatPoint3& originPoint, const VisualElement* pOriginVisualElement) const +{ + CHECK_CONSTRUCTED; + + CHECK_PARAMETER_CONSTRUCTED(*pOriginVisualElement); + + return _pVisualElementImpl->TransformVectorFromOrigin(originPoint, pOriginVisualElement->_pVisualElementImpl); +} + result VisualElement::SetContentBounds(const FloatRectangle& contentBounds) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetContentBounds(contentBounds); } @@ -708,6 +787,7 @@ result VisualElement::AddAnimation(const VisualElementAnimation& animation) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->AddAnimation(null, const_cast< VisualElementAnimation& >(animation)); } @@ -716,6 +796,7 @@ result VisualElement::AddAnimation(const Tizen::Base::String& keyName, const VisualElementAnimation& animation) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->AddAnimation(&keyName, const_cast< VisualElementAnimation& >(animation)); } @@ -725,6 +806,7 @@ result VisualElement::RemoveAnimation(const Tizen::Base::String& keyName) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->RemoveAnimation(keyName); } @@ -741,6 +823,7 @@ void VisualElement::RemoveAllAnimations(void) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->RemoveAllAnimations(); } @@ -787,6 +870,7 @@ void VisualElement::SetImplicitAnimationEnabled(bool enable) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE(this); _pVisualElementImpl->SetImplicitAnimationEnabled(enable); } @@ -844,6 +928,7 @@ result VisualElement::SetFlushNeeded(void) { CHECK_CONSTRUCTED; + CHECK_PRESENTATION_INSTANCE_RETURN(this, E_SUCCESS); return _pVisualElementImpl->SetFlushNeeded(); } diff --git a/src/ui/animations/FUiAnimVisualElementSurface.cpp b/src/ui/animations/FUiAnimVisualElementSurface.cpp index 4c061cd..f34f201 100644 --- a/src/ui/animations/FUiAnimVisualElementSurface.cpp +++ b/src/ui/animations/FUiAnimVisualElementSurface.cpp @@ -95,6 +95,23 @@ VisualElementSurface::Construct(const DisplayContext& displayContext, const Dime SysTryReturnResult(NID_UI_ANIM, size.width >= 0 && size.height >= 0, E_OUT_OF_RANGE, "Can't create the canvas which size is less than zero."); + FloatDimension sizeF(size.width, size.height); + unique_ptr<_VisualElementSurfaceImpl> pImpl(_VisualElementSurfaceImpl::CreateInstanceN(displayContext, sizeF)); + result r = GetLastResult(); + SysTryReturnResult(NID_UI_ANIM, pImpl, r, "Propagating."); + + __pVisualElementSurfaceImpl = pImpl.release(); + + return E_SUCCESS; +} + +result +VisualElementSurface::Construct(const DisplayContext& displayContext, const FloatDimension& size) +{ + CHECK_NOT_CONSTRUCTED; + + SysTryReturnResult(NID_UI_ANIM, size.width >= 0.0f && size.height >= 0.0f, E_OUT_OF_RANGE, "Can't create the canvas which size is less than zero."); + unique_ptr<_VisualElementSurfaceImpl> pImpl(_VisualElementSurfaceImpl::CreateInstanceN(displayContext, size)); result r = GetLastResult(); SysTryReturnResult(NID_UI_ANIM, pImpl, r, "Propagating."); @@ -121,7 +138,16 @@ VisualElementSurface::GetSize(void) const { CHECK_CONSTRUCTED; - return __pVisualElementSurfaceImpl->GetSize(); + FloatDimension sizeF = __pVisualElementSurfaceImpl->GetSizeF(); + return Dimension(static_cast(sizeF.width), static_cast(sizeF.height)); +} + +Tizen::Graphics::FloatDimension +VisualElementSurface::GetSizeF(void) const +{ + CHECK_CONSTRUCTED; + + return __pVisualElementSurfaceImpl->GetSizeF(); } bool diff --git a/src/ui/animations/FUiAnim_AnimationBaseImpl.cpp b/src/ui/animations/FUiAnim_AnimationBaseImpl.cpp index 590015d..ff4c19c 100644 --- a/src/ui/animations/FUiAnim_AnimationBaseImpl.cpp +++ b/src/ui/animations/FUiAnim_AnimationBaseImpl.cpp @@ -52,7 +52,7 @@ using namespace Tizen::Base::Collection; namespace Tizen { namespace Ui { namespace Animations { -_AnimationBaseImpl::_AnimationBaseImpl(AnimationBase* pAnimationBase) +_AnimationBaseImpl::_AnimationBaseImpl() : controlPointTime1(0.0) , controlPointValue1(0.0) , controlPointTime2(0.0) @@ -66,7 +66,6 @@ _AnimationBaseImpl::_AnimationBaseImpl(AnimationBase* pAnimationBase) , autoReverse(false) , scaleRatio(1.0f) , holdEnd(true) - , __pAnimationBase(pAnimationBase) { } @@ -238,7 +237,6 @@ _AnimationBaseImpl::GetActualProgressValue(long currentTime) SysTryReturn(NID_UI_ANIM, pTimingFunction, -1.0f, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Timing function is null."); - long duration = __pAnimationBase->GetDuration(); float dur = (1.0f / (float) duration) * ((float) currentTime); float actualProgress = pTimingFunction->CalculateProgress( static_cast< float >(dur)); diff --git a/src/ui/animations/FUiAnim_AnimationBaseImpl.h b/src/ui/animations/FUiAnim_AnimationBaseImpl.h index 4e0542b..45dfd53 100644 --- a/src/ui/animations/FUiAnim_AnimationBaseImpl.h +++ b/src/ui/animations/FUiAnim_AnimationBaseImpl.h @@ -34,15 +34,6 @@ namespace Tizen { namespace Ui { namespace Animations { - -/** - * @class _AnimationBaseImpl - * @brief This is the header file for the _AnimationBaseImpl class. - * @since 2.0 - * - * This header file contains the declarations of the _AnimationBaseImpl class. @n - * - */ class _AnimationBaseImpl : public Tizen::Base::Object { @@ -50,135 +41,44 @@ public: /** * Default constructor for %_AnimationBaseImpl class. */ - _AnimationBaseImpl(AnimationBase* pAnimationBase); + _AnimationBaseImpl(); /** * Destructor for %_AnimationBaseImpl class. */ ~_AnimationBaseImpl(void); - /** - * Initializes this instance of Animation with the specified parameters. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM Failed to construct. - */ result Construct(void); result RemoveKeyFrame(long time); result RemoveKeyFrameAt(int index); result RemoveAllKeyFrames(void); - /** - * Compares the timeline values of two Animation instances - */ bool CompareTimingValues(const AnimationBase& animBase); - - /** - * Calculates actual progress based on timing function - */ float GetActualProgressValue(long currentTime); - /** - * The List composing keyframe values - */ Tizen::Base::Collection::HashMapT< long, Tizen::Base::Object* > keyFrameList; - /** - * The Bezier Control point - Time1 - */ float controlPointTime1; - - /** - * The Bezier Control point - value 1 - */ float controlPointValue1; - - /** - * The Bezier Control point - Time 2 - */ float controlPointTime2; - - /** - * The Bezier Control point - value 2 - */ float controlPointValue2; - /** - * The Interpolator type - */ AnimationInterpolatorType interpolator; - - /** - * The Animation name - */ Tizen::Base::String animName; - /** - * The duration of animation in milliseconds - */ long duration; - - /** - * Offset in milliseconds after the start of the animation - */ long offset; - - /** - * The delay in milliseconds before animaiton start - */ long delay; - - /** - * Number of times the animation has to be repeated - */ long repeatCount; - - /** - * AutoReverse the animation after completing the animation - */ bool autoReverse; - - /** - * Sclae ratio of the animation duration - */ float scaleRatio; - - /** - * Hold the animation end values or not - */ bool holdEnd; private: - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This is the assignment operator for this class. - // - // @since 2.0 - // _AnimationBaseImpl& operator =(const _AnimationBaseImpl&); - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This is the copy constructor for this class. - // - // @since 2.0 - // _AnimationBaseImpl(const _AnimationBaseImpl& rhs); - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // @since 2.0 - // - Tizen::Ui::Animations::AnimationBase* __pAnimationBase; }; // _AnimationBaseImpl }}} // Tizen::Ui::Animations diff --git a/src/ui/animations/FUiAnim_AnimationGroupImpl.h b/src/ui/animations/FUiAnim_AnimationGroupImpl.h index 09da083..bb988ac 100644 --- a/src/ui/animations/FUiAnim_AnimationGroupImpl.h +++ b/src/ui/animations/FUiAnim_AnimationGroupImpl.h @@ -34,67 +34,18 @@ namespace Tizen { namespace Ui { namespace Animations { -/** - * @class _AnimationGroupImpl - * @brief This is the header file for the _AnimationGroupImpl class. - * @since 2.0 - * - * This header file contains the declarations of the _AnimationGroupImpl class. @n - * - */ class _AnimationGroupImpl : public Tizen::Base::Object { public: - /** - * This is the destructor for this class. - * - * @since 2.0 - */ ~_AnimationGroupImpl(void); - - /** - * This is the constructor for this class. - * - * @since 2.0 - */ _AnimationGroupImpl(AnimationGroup* pAnimationGroup); - /** - * Initializes this instance of _AnimationGroupImpl with the specified parameters. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM Failed to construct. - */ result Construct(void); - - /** - * Frees the resources allocated by this _AnimationGroupImpl instance. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM Failed to free the resource possessed by this instance. - */ result Dispose(void); - /** - * Returns a copy of %AnimationBase object. - * - * @return An error code - * @param[in] animTarget Property to be animated. - * @param[in] animationBase An object of type %AnimationBase whose copy is to be created - * @param[out] res Error code - * @exception null If the passed argument is invalid. - */ AnimationBase* CloneAnimation(AnimationTargetType animTarget, AnimationBase& animationBase, result& res); - - /** - * Structure Used For Storing Animations - */ struct AnimationStore { AnimationTargetType animTarget; @@ -106,46 +57,17 @@ public: } ~AnimationStore(void) { - } bool operator ==(const AnimationStore& animStore) const; bool operator !=(const AnimationStore& animStore) const; }; - /** - * The List maintaining the animations - */ Tizen::Base::Collection::ArrayListT< AnimationStore > animationList; private: - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This is the assignment operator for this class. - // - // @since 2.0 - // _AnimationGroupImpl& operator =(const _AnimationGroupImpl&); - - // - // This method is for internal use only. Using this method can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // This is the copy constructor for this class. - // - // @since 2.0 - // _AnimationGroupImpl(const _AnimationGroupImpl& animationBaseImpl); - - // - // This variable is for internal use only. Using this variable can cause behavioral, security-related, - // and consistency-related issues in the application. - // - // @since 2.0 - // Tizen::Ui::Animations::AnimationGroup* __pAnimationGroup; - }; // _AnimationGroupImpl }}} // Tizen::Ui::Animations diff --git a/src/ui/animations/FUiAnim_AnimationGroupNode.cpp b/src/ui/animations/FUiAnim_AnimationGroupNode.cpp new file mode 100644 index 0000000..91c1716 --- /dev/null +++ b/src/ui/animations/FUiAnim_AnimationGroupNode.cpp @@ -0,0 +1,276 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiAnim_AnimationGroupNode.cpp + * @brief This file contains implementation of _AnimationGroupNode class + * + * This file contains implementation _AnimationGroupNode class. + */ + +#include + +#include +#include +//#include + +#include "FUiAnim_AnimationGroupNode.h" + +#include "FUiAnim_Debug.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +//#define VE_DEBUG_ANIMATION + +namespace Tizen { namespace Ui { namespace Animations +{ + +_AnimationGroupNode::_AnimationGroupNode(VisualElement& target, const Tizen::Base::String* pName, VisualElementAnimation& animation) + : _TransactionNode() + , __target(target) + , __animation(animation) + , __deleteAnimation(false) + , __baseTime(0) + , __adjustedBaseTime(0) + , __currentRepeatCount(1) + , __totalDuration(0) + , __progress(0.0f) +{ + if (pName != null) + { + __name = *pName; + } + + _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(animation); + + result r = CopyAnimationValue(*pAnimationImpl); + SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to copy the animation value.", GetErrorMessage(r)); + + // __pAnimation->GetRepeatCount() == 0 infinite + __totalDuration = __animation.GetDelay() + (__animation.GetDuration() * __animation.GetRepeatCount()) - __animation.GetOffset(); + + if (GetDuration() == 0) + { + SetDuration(1); + SetRepeatCount(1); + } + +#ifdef VE_DEBUG_MODULE + __tick = 0; +#endif +} + +_AnimationGroupNode::~_AnimationGroupNode(void) +{ + if (__deleteAnimation == true) + { + delete &__animation; + } +} + +VisualElementAnimation& +_AnimationGroupNode::GetAnimation(void) const +{ + return __animation; +} + +bool +_AnimationGroupNode::IsEqual(VisualElement& target, const Tizen::Base::String& keyName) const +{ + return (&__target == &target && __name == keyName); +} + +void +_AnimationGroupNode::SetBaseTime(unsigned int baseTime) +{ + __baseTime = baseTime; + __adjustedBaseTime = __baseTime; + + if (__status == _STATUS_END) + { + __status = _STATUS_READY; + } +} + +void +_AnimationGroupNode::Commit(void) +{ + __isCommitted = true; + + if (dynamic_cast< _AnimationGroupNode* > (__pParent) == null) + { + __deleteAnimation = true; + } +} + +bool +_AnimationGroupNode::IsRemovable(void) const +{ + return (__pParent->IsRemovable() && __currentRepeatCount == GetRepeatCount()); +} + +void +_AnimationGroupNode::CalculateProgress(unsigned int currentTime) +{ + long oldRepeatCount = 0; + long repeatCount = 0; + long delay = 0; + long duration = 0; + long offset = 0; + + // Set current Time +#ifdef VE_DEBUG_MODULE + if (_VeDebug::IsDebugEnabled()) + { + __tick += 16; + } +#endif + + switch(__status) + { + case _STATUS_FINISHING: + __status = _STATUS_FINISH; + return; + + case _STATUS_FINISH: + __status = _STATUS_END; + return; + + case _STATUS_END: + return; + + default: + // nothing to do + break; + } + + if (GetScaleRatio() > 0.f) + { + currentTime = (unsigned int) ((currentTime - __baseTime) / GetScaleRatio()); // Apply time scale value + } + + delay = GetDelay(); + + if (currentTime < (unsigned int)(delay)) + { + return; + } + + offset = __animation.GetOffset(); + repeatCount = __animation.GetRepeatCount(); + duration = __animation.GetDuration(); + if (duration == 0) + { + duration = 1; + repeatCount = 1; + } + + oldRepeatCount = __currentRepeatCount; + __currentRepeatCount = ((currentTime - delay + offset) / duration) + 1; + + __progress = static_cast< float >(currentTime - (delay + duration * (__currentRepeatCount - 1) - offset)) / static_cast< float >(duration); + + if (__status == _STATUS_READY) + { + __status = _STATUS_START; + __adjustedBaseTime = delay - offset; // __currentRepeatCount is always 1 + + SetChildrenBaseTime(__baseTime + __adjustedBaseTime, false); + } + else if (repeatCount > 0 && currentTime >= __totalDuration) // infinite loop if repeatCount == 0 + { + __currentRepeatCount = repeatCount; + __progress = 1.0f; + + __status = _STATUS_FINISHING; + } + else if (__currentRepeatCount > oldRepeatCount) + { + __status = _STATUS_REPEAT; + __adjustedBaseTime = delay + duration * (__currentRepeatCount - 1) - offset; + + SetChildrenBaseTime(__baseTime + __adjustedBaseTime, false); + } + else + { + __status = _STATUS_RUNNING; + } +} + +void +_AnimationGroupNode::NotifyTransactionStarted(void) +{ + if (__isCommitted == false || (__status != _STATUS_START && __status != _STATUS_REPEAT)) + { + return; + } + + _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); + + IVisualElementAnimationStatusEventListener* pListener = pAnimationImpl->GetStatusEventListener(); + + if (pListener == null) + { + return; + } + + switch (__status) + { + case _STATUS_START: + pListener->OnVisualElementAnimationStarted(__animation, __name, pAnimationImpl->GetEventTarget()); + break; + + case _STATUS_REPEAT: + pListener->OnVisualElementAnimationRepeated(__animation, __name, pAnimationImpl->GetEventTarget(), __currentRepeatCount); + break; + + default: + break; + } +} + +void +_AnimationGroupNode::NotifyTransactionFinished(bool completed) +{ + if (__isCommitted == false || __status == _STATUS_END) + { + return; + } + +#if 0 + if (__status != _STATUS_FINISH) + { + __status = _STATUS_FINISH; + } +#endif + + _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); + + IVisualElementAnimationStatusEventListener* pListener = pAnimationImpl->GetStatusEventListener(); + + if (pListener == null) + { + return; + } + + pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), completed); +} + + +}}} // Tizen::Ui::Animations + diff --git a/src/ui/animations/FUiAnim_AnimationGroupNode.h b/src/ui/animations/FUiAnim_AnimationGroupNode.h new file mode 100644 index 0000000..78c8d5f --- /dev/null +++ b/src/ui/animations/FUiAnim_AnimationGroupNode.h @@ -0,0 +1,83 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiAnim_AnimationGroupNode.h + * @brief This is the header file for the _AnimationGroupNode class. + * + * This header file contains the declarations of the _AnimationGroupNode class. + */ + +#ifndef _FUI_ANIM_INTERNAL_ANIMATION_GROUP_NODE_H_ +#define _FUI_ANIM_INTERNAL_ANIMATION_GROUP_NODE_H_ + +#include + +#include "FUiAnim_TransactionNode.h" + +#include "FUiAnim_Debug.h" + +namespace Tizen { namespace Ui { namespace Animations +{ + +class _AnimationGroupNode + : public _TransactionNode +{ +public: + _AnimationGroupNode(VisualElement& target, const Tizen::Base::String* pName, VisualElementAnimation& animation); + virtual ~_AnimationGroupNode(void); + + VisualElementAnimation& GetAnimation(void) const; + bool IsEqual(VisualElement& target, const Tizen::Base::String& keyName) const; + + virtual void SetBaseTime(unsigned int baseTime); + + virtual void Commit(void); + + virtual bool IsRemovable(void) const; + + virtual void NotifyTransactionStarted(void); + virtual void NotifyTransactionFinished(bool completed); + +private: + _AnimationGroupNode(void); + _AnimationGroupNode(const _AnimationGroupNode& rhs); + _AnimationGroupNode& operator =(const _AnimationGroupNode& rhs); + + virtual void CalculateProgress(unsigned int currentTime); + + VisualElement& __target; + Tizen::Base::String __name; + VisualElementAnimation& __animation; + bool __deleteAnimation; + + unsigned int __baseTime; + unsigned int __adjustedBaseTime; + long __currentRepeatCount; + + unsigned int __totalDuration; + float __progress; + +#ifdef VE_DEBUG_MODULE + unsigned int __tick; +#endif +}; // _AnimationGroupNode + +}}} // Tizen::Ui::Animations + +#endif // _FUI_ANIM_INTERNAL_ANIMATION_GROUP_NODE_H_ + diff --git a/src/ui/animations/FUiAnim_AnimationImpl.cpp b/src/ui/animations/FUiAnim_AnimationImpl.cpp deleted file mode 100644 index 711e5da..0000000 --- a/src/ui/animations/FUiAnim_AnimationImpl.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUiAnim_AnimationImpl.cpp - * @brief This file contains implementation of _AnimationImpl class - * - * This file contains implementation _AnimationImpl class. - */ - - -#include -#include "FUiAnim_AnimationImpl.h" - - -namespace Tizen { namespace Ui { namespace Animations -{ - - - -_AnimationImpl::_AnimationImpl(void) -{ - -} -_AnimationImpl::~_AnimationImpl(void) -{ - -} - -_Animation& -_AnimationImpl::GetCore(void) -{ - return __core; -} - - -}}} diff --git a/src/ui/animations/FUiAnim_AnimationManager.cpp b/src/ui/animations/FUiAnim_AnimationManager.cpp index 7d86f03..4e86dd1 100644 --- a/src/ui/animations/FUiAnim_AnimationManager.cpp +++ b/src/ui/animations/FUiAnim_AnimationManager.cpp @@ -38,6 +38,7 @@ #include "FUiAnim_VisualElementImpl.h" #include "FUiAnim_VisualElementAnimationImpl.h" #include "FUiAnim_TransactionNode.h" +#include "FUiAnim_AnimationGroupNode.h" #include "FUiAnim_VisualElementAnimationVariantInterpolator.h" #include "FUiAnim_AnimationManager.h" @@ -65,29 +66,22 @@ public: struct timeval tv; gettimeofday(&tv, null); end_time = (long long)tv.tv_sec * 1000000LL + (long long)tv.tv_usec / 1LL; - -// Tizen::Ui::Animations::_AnimationManager* pAnimationManager = Tizen::Ui::Animations::_AnimationManager::GetInstance(); -// Tizen::Ui::Animations::_RootVisualElement* pRoot = (Tizen::Ui::Animations::_RootVisualElement*)pAnimationManager->GetRoot()->GetPresentation(); } - public: long long start_time; const char* tagName; }; #endif - static const double fpsLimitInterval = 1.0 / 55.0; Ecore_Animator* pAnimator = null; - Eina_Bool __AnimatorCallback(void* pData) { #ifndef VE_VSYNC_UPDATE pAnimationManager->ProcessAnimationTick(); -// pManager->PreRender(); #endif return EINA_TRUE; @@ -103,6 +97,7 @@ __SigProcUser(void* pData, int type, void* pEvent) _VeDebug::DumpVeTree(0, 0); _VeDebug::DumpEvasTree(0, 0); _VeDebug::DumpAllEvas(); + return ECORE_CALLBACK_PASS_ON; } #endif @@ -181,6 +176,7 @@ _AnimationManager::_AnimationManager(void) , __pDefaultTimingFunction(null) , __pDefaultInterpolator(null) { + __committedList.Construct(); } _AnimationManager::~_AnimationManager(void) @@ -233,10 +229,9 @@ _AnimationManager::Release(void) if (pAnimator) { ecore_animator_del(pAnimator); + pAnimator = null; } - pAnimator = null; - delete __pRootTransaction; __pRootTransaction = null; @@ -269,9 +264,6 @@ _AnimationManager::Construct(void) __pRootTransaction->Commit(); //root is always committed. - __pCurrentTransaction = __pRootTransaction; - __pCurrentTransactionExceptGroup = __pRootTransaction; - __pDefaultTransactionEventListener = new (std::nothrow) _TransactionEventListener(); SysTryCatch(NID_UI_ANIM, __pDefaultTransactionEventListener != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create default transaction event listener."); @@ -287,24 +279,18 @@ _AnimationManager::Construct(void) return E_SUCCESS; CATCH: - delete __pDefaultInterpolator; - delete __pDefaultTimingFunction; - delete __pDefaultTransactionEventListener; delete __pRootTransaction; + delete __pDefaultTransactionEventListener; + delete __pDefaultTimingFunction; + delete __pDefaultInterpolator; return r; } - -#ifdef VE_DEBUG -static long __RenderCount = 0; //Need? -#endif - void _AnimationManager::SetAnimatorEnabled(bool animating) { #ifdef VE_VSYNC_UPDATE - __isAnimating = animating; if (likely(animating)) @@ -334,7 +320,7 @@ _AnimationManager::SetAnimatorEnabled(bool animating) result _AnimationManager::AddAnimation(VisualElement& target, const Tizen::Base::String* pKeyName, VisualElementAnimation& animation) { - SysTryReturnResult(NID_UI_ANIM, (__pCurrentTransaction != null), E_SYSTEM, "A system error has been occurred. Current transaction is null."); + SysTryReturnResult(NID_UI_ANIM, (CreateCurrentTransactionIfNeeded() == true), E_SYSTEM, "A system error has been occurred. Current transaction is null."); if (pKeyName != null && pKeyName->IsEmpty() == false) { @@ -357,7 +343,7 @@ _AnimationManager::AddAnimation(VisualElement& target, const Tizen::Base::String r = __pCurrentTransaction->AddAnimation(target, pKeyName, animation); SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Failed to add animation."); - if (__pCurrentTransaction == __pRootTransaction && __isAnimating == false) + if (__pCurrentTransaction->IsCommitted() && __isAnimating == false) { SetAnimatorEnabled(true); } @@ -368,46 +354,131 @@ _AnimationManager::AddAnimation(VisualElement& target, const Tizen::Base::String result _AnimationManager::RemoveAnimation(VisualElement& target, const Tizen::Base::String& keyName) { + result r = E_SUCCESS; + + if (__pCurrentTransaction) + { + r = __pCurrentTransaction->RemoveChildrenAnimation(target, keyName); + + if (r == E_SUCCESS) + { + return r; + } + } + + if (__committedList.IsEmpty() == false) + { + int committedCount = __committedList.GetCount(); + + _TransactionNode* pNode = null; + + for(int index = 0; index < committedCount; index++) + { + pNode = __committedList.GetNodeAt(index); + + r = pNode->RemoveChildrenAnimation(target, keyName); + + if (r == E_SUCCESS) + { + return r; + } + } + } + return __pRootTransaction->RemoveChildrenAnimation(target, keyName); } void _AnimationManager::RemoveAnimationForProperty(VisualElement& target, const Tizen::Base::String& property) { + if (__pCurrentTransaction) + { + __pCurrentTransaction->RemoveChildrenAnimationByProperty(target, property); + } + + if (__committedList.IsEmpty() == false) + { + int committedCount = __committedList.GetCount(); + + _TransactionNode* pNode = null; + + for(int index = 0; index < committedCount; index++) + { + pNode = __committedList.GetNodeAt(index); + + pNode->RemoveChildrenAnimationByProperty(target, property); + } + } + __pRootTransaction->RemoveChildrenAnimationByProperty(target, property); } void _AnimationManager::RemoveAllAnimations(VisualElement& target) { + if (__pCurrentTransaction) + { + __pCurrentTransaction->RemoveChildrenAllAnimations(target); + } + + if (__committedList.IsEmpty() == false) + { + int committedCount = __committedList.GetCount(); + + _TransactionNode* pNode = null; + + for(int index = 0; index < committedCount; index++) + { + pNode = __committedList.GetNodeAt(index); + + pNode->RemoveChildrenAllAnimations(target); + } + } + __pRootTransaction->RemoveChildrenAllAnimations(target); } -VisualElementAnimation* -_AnimationManager::GetAnimationN(VisualElement& target, const Tizen::Base::String& keyName) const +const VisualElementAnimation* +_AnimationManager::GetAnimation(VisualElement& target, const Tizen::Base::String& keyName) const { - VisualElementAnimation* pAnimation = const_cast< VisualElementAnimation* >(__pRootTransaction->GetChildrenAnimation(target, keyName)); + const VisualElementAnimation* pAnimation = null; - if (pAnimation != null) + if (__pCurrentTransaction) { - SetLastResult(E_SUCCESS); - return pAnimation->CloneN(); + pAnimation = __pCurrentTransaction->GetChildrenAnimation(target, keyName); + + if (pAnimation) + { + return pAnimation; + } } - SetLastResult(E_OBJ_NOT_FOUND); - return null; -} + if (__committedList.IsEmpty() == false) + { + int committedCount = __committedList.GetCount(); -bool -_AnimationManager::DoesAnimationExist(VisualElement& target, const Tizen::Base::String& keyName) const -{ - return (__pRootTransaction->GetChildrenAnimation(target, keyName) != null); + _TransactionNode* pNode = null; + + for(int index = 0; index < committedCount; index++) + { + pNode = __committedList.GetNodeAt(index); + + pAnimation = pNode->GetChildrenAnimation(target, keyName); + + if (pAnimation) + { + return pAnimation; + } + } + } + + return __pRootTransaction->GetChildrenAnimation(target, keyName); } VisualElementAnimation* -_AnimationManager::GetAnimationForPropertyN(VisualElement& target, const Tizen::Base::String& property) const +_AnimationManager::GetAnimationN(VisualElement& target, const Tizen::Base::String& keyName) const { - VisualElementAnimation* pAnimation = const_cast< VisualElementAnimation* >(__pRootTransaction->GetChildrenAnimationByProperty(target, property)); + VisualElementAnimation* pAnimation = const_cast< VisualElementAnimation* >(GetAnimation(target, keyName)); if (pAnimation != null) { @@ -419,19 +490,38 @@ _AnimationManager::GetAnimationForPropertyN(VisualElement& target, const Tizen:: return null; } +bool +_AnimationManager::DoesAnimationExist(VisualElement& target, const Tizen::Base::String& keyName) const +{ + return (GetAnimation(target, keyName) != null); +} + int _AnimationManager::BeginTransaction(void) { - SysTryReturn(NID_UI_ANIM, (__pCurrentTransaction != null), -1, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Current transaction is null."); + CommitCurrentTransactionIfNeeded(); - _TransactionNode* pNode = new (std::nothrow) _TransactionNode(*__pCurrentTransaction); - SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create _TransactionNode."); + _TransactionNode* pNode = null; - result r = GetLastResult(); - SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), , r, "[%s] Failed to create _TransactionNode instance.", GetErrorMessage(r)); + if (__pCurrentTransaction == null) + { + pNode = new (std::nothrow) _TransactionNode(); + SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create _TransactionNode."); - r = __pCurrentTransaction->AddChild(*pNode); - SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), , r, "[%s] Failed to add child.", GetErrorMessage(r)); + result r = GetLastResult(); + SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), , r, "[%s] Failed to create _TransactionNode instance.", GetErrorMessage(r)); + } + else + { + pNode = new (std::nothrow) _TransactionNode(*__pCurrentTransaction); + SysTryReturn(NID_UI_ANIM, (pNode != null), -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create _TransactionNode."); + + result r = GetLastResult(); + SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), , r, "[%s] Failed to create _TransactionNode instance.", GetErrorMessage(r)); + + r = __pCurrentTransaction->AddChild(*pNode); + SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), , r, "[%s] Failed to add child.", GetErrorMessage(r)); + } __pCurrentTransaction = pNode; __pCurrentTransactionExceptGroup = pNode; @@ -449,11 +539,11 @@ CATCH: int _AnimationManager::BeginGroupTransaction(VisualElement& target, const Tizen::Base::String* pKeyName, VisualElementAnimation& animation) { - SysTryReturn(NID_UI_ANIM, (__pCurrentTransaction != null), -1, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Current transaction is null."); + SysTryReturn(NID_UI_ANIM, (CreateCurrentTransactionIfNeeded() == true), -1, E_SYSTEM, "A system error has been occurred. Current transaction is null."); if (pKeyName != null && pKeyName->IsEmpty() == false) { - SysTryReturn(NID_UI_ANIM, (DoesAnimationExist(target, *pKeyName) == false), 0, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Animation with keyName exists."); + SysTryReturn(NID_UI_ANIM, (DoesAnimationExist(target, *pKeyName) == false), -1, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Animation with keyName exists."); } _AnimationGroupNode* pNode = new (std::nothrow) _AnimationGroupNode(target, pKeyName, animation); @@ -480,24 +570,33 @@ result _AnimationManager::CommitTransaction(void) { SysTryReturnResult(NID_UI_ANIM, __pCurrentTransaction != null, E_SYSTEM, "A system error has been occurred. Current transaction is null."); - SysTryReturnResult(NID_UI_ANIM, __pCurrentTransaction != __pRootTransaction, E_INVALID_OPERATION, "Transaction isn't opened."); _TransactionNode* pParentTransaction = __pCurrentTransaction->GetParent(); if (__pCurrentTransaction->IsEmpty()) { - pParentTransaction->RemoveChild(*__pCurrentTransaction); + if (pParentTransaction) + { + pParentTransaction->RemoveChild(*__pCurrentTransaction); + } + else + { + delete __pCurrentTransaction; + } } else { - if (pParentTransaction == __pRootTransaction && __pRootTransaction->IsEmpty() == false) + __pCurrentTransaction->Commit(); + + if (pParentTransaction == null) { - __pCurrentTransaction->SetChildrenBaseTime(_AnimationTime::GetTime()); + __committedList.Add(__pCurrentTransaction); - SetAnimatorEnabled(true); + if (__isAnimating == false) + { + SetAnimatorEnabled(true); + } } - - __pCurrentTransaction->Commit(); } __pCurrentTransaction = pParentTransaction; @@ -513,52 +612,93 @@ _AnimationManager::CommitTransaction(void) result _AnimationManager::DiscardTransaction(void) { - SysTryReturnResult(NID_UI_ANIM, (__pCurrentTransaction != __pRootTransaction), E_INVALID_OPERATION, "Transaction isn't opened."); - - _TransactionNode* pLastChild = __pRootTransaction->GetLastChild(); - SysTryReturnResult(NID_UI_ANIM, pLastChild != null, E_SYSTEM, "A system error has been occurred. Last child is null."); + SysTryReturnResult(NID_UI_ANIM, (__pCurrentTransaction != null && __pCurrentTransaction->IsCommitted() == false), E_INVALID_OPERATION, "Transaction isn't opened."); - __pRootTransaction->RemoveChild(*pLastChild); + delete __pCurrentTransaction; - __pCurrentTransaction = __pRootTransaction; - __pCurrentTransactionExceptGroup = __pRootTransaction; + __pCurrentTransaction = null; + __pCurrentTransactionExceptGroup = null; return E_SUCCESS; } result -_AnimationManager::StopTransaction(int transactionId) +_AnimationManager::DiscardTransaction(int transactionId) { - _TransactionNode* pChild = __pRootTransaction->GetChild(transactionId); + SysTryReturnResult(NID_UI_ANIM, (__pCurrentTransaction != null), E_INVALID_OPERATION, "Transaction isn't opened."); - if (pChild != null && pChild->IsCommitted(true) == true) + if (__pCurrentTransaction->GetId() == transactionId) { - __pRootTransaction->RemoveChild(transactionId); + _TransactionNode* pParentTransaction = __pCurrentTransaction->GetParent(); - return E_SUCCESS; + if (pParentTransaction) + { + pParentTransaction->RemoveChild(*__pCurrentTransaction); + } + else + { + delete __pCurrentTransaction; + } + + __pCurrentTransaction = pParentTransaction; + + if (dynamic_cast< _AnimationGroupNode* > (pParentTransaction) == null) + { + __pCurrentTransactionExceptGroup = pParentTransaction; + } } - return E_INVALID_ARG; + __pCurrentTransaction->RemoveChild(transactionId); + + return E_SUCCESS; } result -_AnimationManager::CancelTransaction(int transactionId) +_AnimationManager::StopTransaction(int transactionId) { - if (__pCurrentTransaction->GetId() == transactionId) + _TransactionNode* pChild = null; + + if (__committedList.IsEmpty() == false) { - _TransactionNode* pParentTransaction = __pCurrentTransaction->GetParent(); + int committedCount = __committedList.GetCount(); - __pCurrentTransaction = pParentTransaction; + _TransactionNode* pNode = null; - if (dynamic_cast< _AnimationGroupNode* > (pParentTransaction) == null) + for (int index = 0; index < committedCount; index++) { - __pCurrentTransactionExceptGroup = pParentTransaction; + pNode = __committedList.GetNodeAt(index); + + if (pNode->GetId() == transactionId) + { + __committedList.RemoveAt(index); + + pNode->RemoveAll(); + delete pNode; + + return E_SUCCESS; + } + + pChild = pNode->GetChild(transactionId); + + if (pChild != null) + { + pNode->RemoveChild(transactionId); + + return E_SUCCESS; + } } } - __pRootTransaction->RemoveChild(transactionId); + pChild = __pRootTransaction->GetChild(transactionId); - return E_SUCCESS; + if (pChild != null) + { + __pRootTransaction->RemoveChild(transactionId); + + return E_SUCCESS; + } + + return E_INVALID_ARG; } bool @@ -577,17 +717,17 @@ _AnimationManager::IsTransactionRunning(int transactionId) const bool _AnimationManager::IsImplicitAnimationEnabled(void) const { - return __pCurrentTransactionExceptGroup->IsImplicitAnimationEnabled(); + if (__pCurrentTransactionExceptGroup) + { + return __pCurrentTransactionExceptGroup->IsImplicitAnimationEnabled(); + } + + return true; } _TransactionNode* _AnimationManager::GetCurrentTransaction(bool withGroup) const { - if (__pCurrentTransaction == __pRootTransaction) - { - return null; - } - if (withGroup == false) { return __pCurrentTransactionExceptGroup; @@ -596,6 +736,34 @@ _AnimationManager::GetCurrentTransaction(bool withGroup) const return __pCurrentTransaction; } +bool +_AnimationManager::CreateCurrentTransactionIfNeeded(void) +{ + if (__pCurrentTransaction != null) + { + return true; + } + + int transactionId = BeginTransaction(); + SysTryReturn(NID_UI_ANIM, (transactionId >= 0), false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed. Failed to create _TransactionNode."); + + __pCurrentTransaction->SetDefaultEventListener(null); + + __pCurrentTransaction->Commit(); // default transaction is always committed. + + return true; +} + +void +_AnimationManager::CommitCurrentTransactionIfNeeded() +{ + // if current transaction is default transaction, only status of default transaction is committed, so must process to commit transaction. + if (__pCurrentTransaction != null && __pCurrentTransaction->IsCommitted(true)) + { + CommitTransaction(); + } +} + void _AnimationManager::SetTransactionEventListener(const IAnimationTransactionEventListener* pListener) { @@ -603,6 +771,38 @@ _AnimationManager::SetTransactionEventListener(const IAnimationTransactionEventL } void +_AnimationManager::ProcessCommittedTransaction(void) +{ + if (__committedList.IsEmpty()) + { + return; + } + + int committedCount = __committedList.GetCount(); + + _TransactionNode* pNode = null; + + for(int index = 0; index < committedCount; index++) + { + pNode = __committedList.GetNodeAt(index); + + if (pNode->IsEmpty()) + { + delete pNode; + } + else + { + pNode->DrawTargets(); + pNode->SetChildrenBaseTime(_AnimationTime::GetTime()); + + __pRootTransaction->AddChild(*pNode); + } + } + + __committedList.RemoveAll(); +} + +void _AnimationManager::ProcessAnimationTick(void) { if (unlikely(__isInAnimationTick)) @@ -612,10 +812,13 @@ _AnimationManager::ProcessAnimationTick(void) __isInAnimationTick = true; + CommitCurrentTransactionIfNeeded(); + ProcessCommittedTransaction(); + // process transactions; __pRootTransaction->ProcessAnimationTick(_AnimationTime::GetTime()); - if (likely(__pRootTransaction->IsEmpty() == true)) + if (likely(__pRootTransaction->IsEmpty() && __committedList.IsEmpty())) { SetAnimatorEnabled(false); } diff --git a/src/ui/animations/FUiAnim_AnimationManager.h b/src/ui/animations/FUiAnim_AnimationManager.h index ef890e7..21c36b3 100644 --- a/src/ui/animations/FUiAnim_AnimationManager.h +++ b/src/ui/animations/FUiAnim_AnimationManager.h @@ -58,25 +58,20 @@ public: bool DoesAnimationExist(VisualElement& target, const Tizen::Base::String& keyName) const; bool DoesAnimationExistForProperty(VisualElement& target, const Tizen::Base::String& keyName) const; VisualElementAnimation* GetAnimationN(VisualElement& target, const Tizen::Base::String& keyName) const; - VisualElementAnimation* GetAnimationForPropertyN(VisualElement& target, const Tizen::Base::String& property) const; //for transaction int BeginTransaction(void); int BeginGroupTransaction(VisualElement& target, const Tizen::Base::String* pKeyName, VisualElementAnimation& animation); result CommitTransaction(void); result DiscardTransaction(void); + result DiscardTransaction(int transactionId); result StopTransaction(int transactionId); - result CancelTransaction(int transactionId); bool IsTransactionRunning(int transactionId) const; - bool IsImplicitAnimationEnabled(void) const; // OnCurrentTransaction + bool IsImplicitAnimationEnabled(void) const; _TransactionNode* GetCurrentTransaction(bool withGroup = true) const; void SetTransactionEventListener(const IAnimationTransactionEventListener* pListener); void ProcessAnimationTick(void); - bool IsAnimating(void) const - { - return __isAnimating; - } private: _AnimationManager(void); @@ -90,6 +85,12 @@ private: void SetAnimatorEnabled(bool animating); + bool CreateCurrentTransactionIfNeeded(void); + void CommitCurrentTransactionIfNeeded(void); + void ProcessCommittedTransaction(void); + + const VisualElementAnimation* GetAnimation(VisualElement& target, const Tizen::Base::String& keyName) const; + private: static _AnimationManager* __pInstance; @@ -100,6 +101,48 @@ private: _TransactionNode* __pCurrentTransaction; _TransactionNode* __pCurrentTransactionExceptGroup; + class CommittedListT : public Tizen::Base::Collection::ArrayListT<_TransactionNode*> + { + public: + _TransactionNode* GetNodeAt(int index) const + { + _TransactionNode* pChild = null; + + if (likely(GetAt(index, pChild) == E_SUCCESS)) + { + return pChild; + } + + return null; + } + + bool IsEmpty() const + { + return (GetCount() <= 0); + } + +/* + void RemoveAllChildren(void) + { + _TransactionNode* pChild = null; + + int childrenCount = GetCount(); + + for (int index = 0; index < childrenCount; index++) + { + if (likely(GetAt(index, pChild) == E_SUCCESS)) + { + delete pChild; + } + } + + RemoveAll(); + }*/ + }; + + CommittedListT __committedList; +// Tizen::Base::Collection::ArrayListT<_TransactionNode*> __committedList; + IAnimationTransactionEventListener* __pDefaultTransactionEventListener; const IVisualElementAnimationTimingFunction* __pDefaultTimingFunction; const IVisualElementAnimationValueInterpolator* __pDefaultInterpolator; diff --git a/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp b/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp index 25b229e..a787b96 100644 --- a/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp +++ b/src/ui/animations/FUiAnim_ControlAnimatorImpl.cpp @@ -16,7 +16,7 @@ // /** - * @file FUiAnim_ControlAnimatorImpl.cpp + * @file FUiAnimControlAnimatorImpl.cpp * @brief This file contains implementation of _ControlAnimatorImpl class * * This file contains implementation _ControlAnimatorImpl class. @@ -70,26 +70,46 @@ using namespace Tizen::Ui::Controls; namespace Tizen { namespace Ui { namespace Animations { -///INIT_SYSCLASSTYPE(_ControlAnimatorImpl); +bool +_ControlAnimatorImpl::ActiveAnimation::operator ==(const _ControlAnimatorImpl::ActiveAnimation& rhs) const +{ + if ((animTarget == rhs.animTarget) && (pAnimationBase == rhs.pAnimationBase)) + { + return true; + } + + return false; +} + +bool +_ControlAnimatorImpl::ActiveAnimation::operator !=(const _ControlAnimatorImpl::ActiveAnimation& rhs) const +{ + if ((animTarget != rhs.animTarget) || (pAnimationBase != rhs.pAnimationBase)) + { + return true; + } + + return false; +} _ControlAnimatorImpl::_ControlAnimatorImpl(ControlAnimator* pControlAnimator) : __pActiveAnimationList(null) , __pControl(null) , __pControlImpl(null) + , __pControlAnimator(pControlAnimator) + , __pVisualElement(null) , __animatorStatus(ANIMATOR_STATUS_STOPPED) , __logicalBoundsHolder(0, 0, 0, 0) , __showStateHolder(true) - , __targetCount(0) , __prevAnimationBoundsHolder(0, 0, 0, 0) + , __presentationBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __targetCount(0) , __sequentialGroupAnimation(false) - , __sequelDelay(0) - , __pControlAnimator(pControlAnimator) - , __pVisualElement(null) + , __sequetialGroupAnimationDelay(0) , __pAnimStatusEventListener(null) , __pAnimDetailedEventListener(null) - , __animId(0) + , __animationId(0) , __groupName(0) - , __presentationBounds(0.0f, 0.0f, 0.0f, 0.0f) { for (int animTarget = 0; animTarget < ANIMATION_TARGET_MAX; animTarget++) { @@ -103,31 +123,6 @@ _ControlAnimatorImpl::_ControlAnimatorImpl(ControlAnimator* pControlAnimator) } } -result -_ControlAnimatorImpl::Construct(const Control& source) -{ - result r = E_SUCCESS; - - SysAssertf((__pControl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); - - __pControl = const_cast< Control* >(&source); - __pActiveAnimationList = new (std::nothrow) ArrayListT< ActiveAnimation >(); - SysTryCatch(NID_UI_ANIM, __pActiveAnimationList != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = __pActiveAnimationList->Construct(); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to construct _ControlAnimatorImpl instance."); - - __pControlImpl = _ControlImpl::GetInstance(*__pControl); - __pVisualElement = __pControlImpl->GetCore().GetVisualElement(); - - return r; - -CATCH: - Dispose(); - - return r; -} - _ControlAnimatorImpl::~_ControlAnimatorImpl() { result r = E_SUCCESS; @@ -156,6 +151,32 @@ _ControlAnimatorImpl::~_ControlAnimatorImpl() } result +_ControlAnimatorImpl::Construct(const Control& source) +{ + result r = E_SUCCESS; + + SysAssertf((__pControl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + __pControl = const_cast< Control* >(&source); + __pActiveAnimationList = new (std::nothrow) ArrayListT< ActiveAnimation >(); + SysTryReturnResult(NID_UI_ANIM, __pActiveAnimationList != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + r = __pActiveAnimationList->Construct(); + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] Failed to construct _ControlAnimatorImpl instance."); + + Dispose(); + return E_SYSTEM; + } + + __pControlImpl = _ControlImpl::GetInstance(*__pControl); + __pVisualElement = __pControlImpl->GetCore().GetVisualElement(); + + return E_SUCCESS; +} + +result _ControlAnimatorImpl::Dispose(void) { result r = E_SUCCESS; @@ -178,25 +199,9 @@ _ControlAnimatorImpl::Dispose(void) } bool -_ControlAnimatorImpl::ActiveAnimation::operator ==(const _ControlAnimatorImpl::ActiveAnimation& rhs) const -{ - if ((animTarget == rhs.animTarget) && (pAnimationBase == rhs.pAnimationBase)) - { - return true; - } - - return false; -} - -bool -_ControlAnimatorImpl::ActiveAnimation::operator !=(const _ControlAnimatorImpl::ActiveAnimation& rhs) const +_ControlAnimatorImpl::IsAnimationSupported(void) const { - if ((animTarget != rhs.animTarget) || (pAnimationBase != rhs.pAnimationBase)) - { - return true; - } - - return false; + return _VisualElementAnimationImpl::IsAnimationSupported(); } result @@ -208,7 +213,8 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase const IVisualElementAnimationTimingFunction* pTimingFunction = null; BezierTimingFunction* pBezierTimingFunction = null; - SysTryReturnResult(NID_UI_ANIM, (animTarget > ANIMATION_TARGET_NONE && animTarget < ANIMATION_TARGET_MAX), E_INVALID_OPERATION, "Invalid Argument is used. animTarget is invalid."); + SysTryReturnResult(NID_UI_ANIM, (animTarget > ANIMATION_TARGET_NONE && animTarget < ANIMATION_TARGET_MAX), E_INVALID_ARG, "Invalid argument(s) is used. animTarget is invalid."); + SysTryReturnResult(NID_UI_ANIM, (!(__isAnimationTargetAnimating[animTarget])), E_INVALID_OPERATION, "Same AnimationTargetType is being animated."); switch (pAnimationBase->GetInterpolatorType()) { @@ -570,7 +576,7 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase if (__sequentialGroupAnimation) { - pBaseAnimation->SetDelay(pAnimationBase->GetDelay() + __sequelDelay); + pBaseAnimation->SetDelay(pAnimationBase->GetDelay() + __sequetialGroupAnimationDelay); } if (pAnimationBase->GetKeyFrameCount() > 0) @@ -578,14 +584,14 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase r = SetKeyFrameAnimation(animTarget, pAnimationBase, pTimingFunction, pBaseAnimation); } - animIdentifier.Append(__animId); + animIdentifier.Append(__animationId); if (_AnimationManager::GetInstance()->GetCurrentTransaction() != null) { animIdentifier.Append(TRANSACTION); } - __animId++; + __animationId++; if (pAnimationGroup == null) { @@ -611,6 +617,7 @@ _ControlAnimatorImpl::SetAnimation(AnimationTargetType animTarget, AnimationBase SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation could not be added to playlist."); } + delete pAnimation; return r; CATCH: @@ -624,474 +631,976 @@ CATCH: } result -_ControlAnimatorImpl::SetCustomImplicitAnimationParams(ControlAnimatorTriggerType triggerType, AnimationBase& animationBase, Rectangle& bounds, bool showState, bool lastTargetOccurence) +_ControlAnimatorImpl::SetKeyFrameAnimation(AnimationTargetType animTarget, AnimationBase* pAnimationBase, const IVisualElementAnimationTimingFunction* pTimingFunction, VisualElementAnimation* pAnimation) { + long keyTime = 0; result r = E_SUCCESS; - AnimationBase* pAnimationBase = const_cast< AnimationBase* >(&animationBase); + VisualElementValueAnimation* pPropertyAnimation = dynamic_cast< VisualElementValueAnimation* >(pAnimation); + SysTryReturnResult(NID_UI_ANIM, (pPropertyAnimation != null), E_INVALID_ARG, "Invalid argument(s) is used. VisualElementAnimation is null."); - if ((__targetCount == 1) || ((__targetCount > 1) && lastTargetOccurence)) + switch (animTarget) { - pAnimationBase->SetHoldEndEnabled(true); - pAnimationBase->SetAutoReverseEnabled(false); - } - if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) + case ANIMATION_TARGET_SIZE: { - Point newPosition = Point(bounds.x, bounds.y); - Point currentPosition = __pControl->GetPosition(); - - PointAnimation* pPointAnim = null; + DimensionAnimation* pDimensionAnim = null; RectangleAnimation* pRectangleAnim = null; - pPointAnim = dynamic_cast< PointAnimation* >(pAnimationBase); + pDimensionAnim = dynamic_cast< DimensionAnimation* >(pAnimationBase); pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + SysTryReturnResult(NID_UI_ANIM, ((pDimensionAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - if (pPointAnim) + Dimension controlSize; + float anchorX = 0.0f; + float anchorY = 0.0f; + + controlSize = __pControl->GetSize(); + + if (pDimensionAnim) { - if (__targetCount == 1) - { - pPointAnim->SetStartValue(currentPosition); - pPointAnim->SetEndValue(newPosition); - } - else //__targetCount > 1 + Dimension dimValue(0, 0); + + pDimensionAnim->GetAnchor(anchorX, anchorY); + + for (int index = 0; index < pDimensionAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pPointAnim->SetEndValue(newPosition)) : (pPointAnim->SetStartValue(currentPosition)); + pDimensionAnim->GetKeyFrameAt(index, keyTime, dimValue); + + if (keyTime < pDimensionAnim->GetDuration()) + { + FloatRectangle modelBounds = __pVisualElement->GetBounds(); + FloatRectangle presentationBounds = const_cast((__pVisualElement)->AcquirePresentationInstance())->GetBounds(); + __pVisualElement->ReleasePresentationInstance(); + + float currentAnchorX = presentationBounds.width * anchorX; + float currentAnchorY = presentationBounds.height * anchorY; + float endAnchorX = dimValue.width * anchorX; + float endAnchorY = dimValue.height * anchorY; + + float endX = modelBounds.x + (currentAnchorX - endAnchorX); + float endY = modelBounds.y + (currentAnchorY - endAnchorY); + + Variant keyValue(FloatRectangle(endX, endY, static_cast< float >(dimValue.width), static_cast< float >(dimValue.height))); + + r = pPropertyAnimation->AddKeyFrame(keyTime / static_cast< float >(pDimensionAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } } - pAnimationBase = pPointAnim; } else //if (pRectangleAnim) { - Rectangle newRectangle = Rectangle(bounds.x, bounds.y, bounds.width, bounds.height); - Rectangle currentRectangle = Rectangle(__pControl->GetBounds()); + Rectangle dimValue(0, 0, 0, 0); - if (__targetCount == 1) - { - pRectangleAnim->SetStartValue(currentRectangle); - pRectangleAnim->SetEndValue(newRectangle); - } - else //__targetCount > 1 + pRectangleAnim->GetAnchor(anchorX, anchorY); + + for (int index = 0; index < pRectangleAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pRectangleAnim->SetEndValue(newRectangle)) : (pRectangleAnim->SetStartValue(currentRectangle)); + pRectangleAnim->GetKeyFrameAt(index, keyTime, dimValue); + + if (keyTime < pRectangleAnim->GetDuration()) + { + FloatRectangle modelBounds = __pVisualElement->GetBounds(); + FloatRectangle presentationBounds = const_cast((__pVisualElement)->AcquirePresentationInstance())->GetBounds(); + __pVisualElement->ReleasePresentationInstance(); + + float currentAnchorX = presentationBounds.width * anchorX; + float currentAnchorY = presentationBounds.height * anchorY; + float endAnchorX = dimValue.width * anchorX; + float endAnchorY = dimValue.height * anchorY; + + float endX = modelBounds.x + (currentAnchorX - endAnchorX); + float endY = modelBounds.y + (currentAnchorY - endAnchorY); + + Variant keyValue(FloatRectangle(endX, endY, static_cast< float >(dimValue.width), static_cast< float >(dimValue.height))); + r = pPropertyAnimation->AddKeyFrame(keyTime / static_cast< float >(pRectangleAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } } - pAnimationBase = pRectangleAnim; } } - else if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) - { - Dimension newSize = Dimension(bounds.width, bounds.height); - Dimension currentSize = __pControl->GetSize(); + break; - DimensionAnimation* pDimensionAnim = null; + case ANIMATION_TARGET_POSITION: + { + PointAnimation* pPointAnim = null; RectangleAnimation* pRectangleAnim = null; - pDimensionAnim = dynamic_cast< DimensionAnimation* >(pAnimationBase); + pPointAnim = dynamic_cast< PointAnimation* >(pAnimationBase); pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, ((pDimensionAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - if (pDimensionAnim) + Point controlPos; + Rectangle clientBounds = __pControlImpl->GetParent()->GetClientBounds(); + FloatRectangle modelBounds = __pVisualElement->GetBounds(); + + controlPos = __pControl->GetPosition(); + + if (pPointAnim) { - if (__targetCount == 1) - { - pDimensionAnim->SetStartValue(currentSize); - pDimensionAnim->SetEndValue(newSize); - } - else //__targetCount > 1 + Point pointValue(0, 0); + Point prevPointValue = controlPos; + + for (int index = 0; index < pPointAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pDimensionAnim->SetEndValue(newSize)) : (pDimensionAnim->SetStartValue(currentSize)); + pPointAnim->GetKeyFrameAt(index, keyTime, pointValue); + + + if (keyTime < pPointAnim->GetDuration()) + { + float absPointX = (static_cast< float >(clientBounds.x) + static_cast< float >(pointValue.x)); + float absPointY = (static_cast< float >(clientBounds.y) + static_cast< float >(pointValue.y)); + + Variant keyValue(FloatPoint(absPointX, absPointY)); + + r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pPointAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } + } - pAnimationBase = pDimensionAnim; } else //if (pRectangleAnim) { - Rectangle newRectangle = Rectangle(bounds.x, bounds.y, bounds.width, bounds.height); - Rectangle currentRectangle = Rectangle(__pControl->GetBounds()); + Rectangle pointValue(0, 0, 0, 0); + Rectangle prevPointValue = Rectangle(controlPos.x, controlPos.y, 0, 0); - if (__targetCount == 1) - { - pRectangleAnim->SetStartValue(currentRectangle); - pRectangleAnim->SetEndValue(newRectangle); - } - else //__targetCount > 1 + for (int index = 0; index < pRectangleAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pRectangleAnim->SetEndValue(newRectangle)) : (pRectangleAnim->SetStartValue(currentRectangle)); - } - pAnimationBase = pRectangleAnim; - } + pRectangleAnim->GetKeyFrameAt(index, keyTime, pointValue); + + if (keyTime < pRectangleAnim->GetDuration()) + { + float absPointX = (static_cast< float >(clientBounds.x) + static_cast< float >(pointValue.x)); + float absPointY = (static_cast< float >(clientBounds.y) + static_cast< float >(pointValue.y)); + + Variant keyValue(FloatPoint(absPointX, absPointY)); + + r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pRectangleAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } + } + } } - if (triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE) + break; + + case ANIMATION_TARGET_ALPHA: { - FloatAnimation* pFloatAnim = null; IntegerAnimation* pIntegerAnim = null; + FloatAnimation* pFloatAnim = null; - pFloatAnim = dynamic_cast< FloatAnimation* >(pAnimationBase); pIntegerAnim = dynamic_cast< IntegerAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, ((pFloatAnim) || (pIntegerAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - float newShowState = 0.0f; - float currentShowState = 0.0f; - int inewShowState = 0; - int icurrentShowState = 0; + pFloatAnim = dynamic_cast< FloatAnimation* >(pAnimationBase); + SysTryReturnResult(NID_UI_ANIM, (pIntegerAnim || pFloatAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - if (pFloatAnim) - { - newShowState = ((showState) ? (1.0f) : (0.0f)); - currentShowState = ((showState) ? (0.0f) : (1.0f)); - } - else //if (pIntegerAnim) + if (pIntegerAnim) { - inewShowState = ((showState) ? (1) : (0)); - icurrentShowState = ((showState) ? (0) : (1)); - } + int alphaIntValue = 0; - if (pFloatAnim) - { - if (__targetCount == 1) - { - pFloatAnim->SetStartValue(currentShowState); - pFloatAnim->SetEndValue(newShowState); - } - else //__targetCount > 1 + for (int index = 0; index < pIntegerAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pFloatAnim->SetEndValue(newShowState)) : (pFloatAnim->SetStartValue(currentShowState)); + pIntegerAnim->GetKeyFrameAt(index, keyTime, alphaIntValue); + + if (keyTime < pIntegerAnim->GetDuration()) + { + Variant keyValue(static_cast< float >(alphaIntValue)); + + r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pIntegerAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + + } } - pAnimationBase = pFloatAnim; } - else //if (pIntegerAnim) + else //if (pFloatAnim) { - if (__targetCount == 1) - { - pIntegerAnim->SetStartValue(icurrentShowState); - pIntegerAnim->SetEndValue(inewShowState); - } - else //__targetCount > 1 + float alphaFltValue = 0.0; + + for (int index = 0; index < pFloatAnim->GetKeyFrameCount(); index++) { - (lastTargetOccurence) ? (pIntegerAnim->SetEndValue(inewShowState)) : (pIntegerAnim->SetStartValue(icurrentShowState)); + pFloatAnim->GetKeyFrameAt(index, keyTime, alphaFltValue); + + if (keyTime < pFloatAnim->GetDuration()) + { + Variant keyValue(static_cast< float >(alphaFltValue)); + + r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pFloatAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } } - pAnimationBase = pIntegerAnim; } } - return r; -} + break; -result -_ControlAnimatorImpl::StartCustomImplicitAnimation(ControlAnimatorTriggerType triggerType, int x, int y, int width, int height, bool showState) -{ - result r = E_SUCCESS; - SysTryReturnResult(NID_UI_ANIM, (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE || - triggerType == ANIMATION_TRIGGER_SIZE_CHANGE || - triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE), E_INVALID_ARG, "Invalid argument(s) is used. Trigger type is invalid."); + case ANIMATION_TARGET_ROTATION: + { + RotateAnimation* pRotateAnim = null; - long delay = 0; - long totalDelay = 0; - long groupDuration = 0; + pRotateAnim = dynamic_cast< RotateAnimation* >(pAnimationBase); + SysTryReturnResult(NID_UI_ANIM, (pRotateAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - AnimationTargetType equivalentAnimTarget = ANIMATION_TARGET_NONE; + float rotateFltValue = 0; - VisualElementAnimationGroup* pAnimationGroup = null; + for (int index = 0; index < pRotateAnim->GetKeyFrameCount(); index++) + { + pRotateAnim->GetKeyFrameAt(index, keyTime, rotateFltValue); - __sequelDelay = 0; - pAnimationGroup = new (std::nothrow) VisualElementAnimationGroup(); - SysTryReturnResult(NID_UI_ANIM, (pAnimationGroup != null), E_OUT_OF_MEMORY, "Memory allocation failed."); + if (keyTime < pRotateAnim->GetDuration()) + { + Variant keyValue(rotateFltValue); - if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) - { - equivalentAnimTarget = ANIMATION_TARGET_POSITION; + r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pRotateAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + } + } } - else if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) + break; + + default: { - equivalentAnimTarget = ANIMATION_TARGET_SIZE; + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); + return E_SYSTEM; } - else - { - equivalentAnimTarget = ANIMATION_TARGET_ALPHA; + break; } + return E_SUCCESS; +} + +result +_ControlAnimatorImpl::SetGroupAnimation(AnimationGroup* pAnimGrp) +{ + result r = E_SUCCESS; ParallelAnimationGroup* pParallelAnimGrp = null; SequentialAnimationGroup* pSequentialAnimGrp = null; + AnimationTargetType animTargetArray[ANIMATION_TARGET_MAX] = + { + ANIMATION_TARGET_ROTATION, + ANIMATION_TARGET_SIZE, + ANIMATION_TARGET_POSITION, + ANIMATION_TARGET_ALPHA + }; + bool setLogicalBnds = false; + bool setShowStateInternal = false; + long delay = 0; + long duration = 0; + long totalDelay = 0; + long groupDuration = 0; + VisualElementAnimationGroup* pAnimationGroup = null; String animIdentifier; + int activeAnimationCount = GetActiveAnimationListCount(); - __targetCount = 0; + pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(pAnimGrp); + pSequentialAnimGrp = dynamic_cast< SequentialAnimationGroup* >(pAnimGrp); + SysTryReturnResult(NID_UI_ANIM, ((pParallelAnimGrp) || (pSequentialAnimGrp)), E_INVALID_ARG, "Invalid argument(s) is used. AnimationGroup argument is invalid."); + + __sequetialGroupAnimationDelay = 0; + pAnimationGroup = new (std::nothrow) VisualElementAnimationGroup(); + SysTryReturnResult(NID_UI_ANIM, (pAnimationGroup != null), E_OUT_OF_MEMORY, "Memory allocation failed."); + + animIdentifier.Append(__animationId); animIdentifier.Append(GROUP); - animIdentifier.Append(__animId); - __animId++; + __animationId++; __groupName.Clear(); __groupName = animIdentifier; - if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_SEQUENTIAL) + if (pParallelAnimGrp) { - pSequentialAnimGrp = dynamic_cast< SequentialAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); - if (pSequentialAnimGrp) + for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) { - for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + AnimationTargetType animTarget = animTargetArray[target]; + AnimationBase* pAnimationBase = null; + pAnimationBase = pParallelAnimGrp->GetAnimationN(animTarget); + + if (pAnimationBase != null) { - AnimationTargetType animTgt = ANIMATION_TARGET_NONE; + long duration = pAnimationBase->GetDuration(); - animTgt = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); - if (animTgt > ANIMATION_TARGET_NONE && animTgt < ANIMATION_TARGET_MAX) + if (pAnimationBase->IsAutoReverseEnabled()) { - if (__isAnimationTargetAnimating[animTgt]) - { - SysLogException(NID_UI_ANIM, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Same AnimationTargetType is being animated."); - delete pAnimationGroup; - return E_INVALID_OPERATION; - } + duration = duration * 2; } - } - for (int index = pSequentialAnimGrp->GetAnimationCount() - 1; index >= 0; index--) - { - if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) + duration = (duration * pAnimationBase->GetRepeatCount() * pAnimationBase->GetScaleRatio()) + ((pAnimationBase->GetDelay() - pAnimationBase->GetOffset()) * pAnimationBase->GetScaleRatio()); + + if (duration > groupDuration) { - __targetCount++; + groupDuration = duration; } - } - //Overwrite last Animation in AnimationGroup and check for IsAnimatable - bool verified = false; - for (int count = pSequentialAnimGrp->GetAnimationCount() - 1; count >= 0; count--) - { - AnimationTargetType animTgt = ANIMATION_TARGET_NONE; - animTgt = pSequentialAnimGrp->GetAnimationTargetTypeAt(count); - if (animTgt == equivalentAnimTarget) + if (IsAnimationSupported() == false) { - bool animatable = false; - AnimationBase* pAnimBase = null; - pAnimBase = pSequentialAnimGrp->GetAnimationAtN(count); + r = SetControlProperty(animTarget, *pAnimationBase); + delete pAnimationBase; - if (pAnimBase) + SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store animation values."); + } + else + { + if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_POSITION) || + pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_SIZE)) { - Rectangle rect(x, y, width, height); + __logicalBoundsHolder = __pControl->GetBounds(); + setLogicalBnds = true; + } + else if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_ALPHA)) + { + __showStateHolder = __pControl->GetShowState(); + setShowStateInternal = true; + } - r = SetCustomImplicitAnimationParams(triggerType, *pAnimBase, rect, showState, true); + r = SetAnimation(animTarget, *pAnimationBase, ANIMATION_TRIGGER_USER, pAnimationGroup); - //Comment: Only the last associated TGT_TYPE is checked for IsAnimatable as the rest is checked in ControlAnimator::SetAnimation(). - animatable = IsAnimatable(animTgt, rect, pAnimBase); - delete pAnimBase; - verified = true; + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start animation."); + goto CATCH; } - if ((!animatable) || (r != E_SUCCESS)) + __isAnimationTargetAnimating[animTarget] = true; + + if (animTarget == ANIMATION_TARGET_POSITION || animTarget == ANIMATION_TARGET_SIZE) { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set custom implicit animation."); - delete pAnimationGroup; - return E_INVALID_ARG; + SetControlLogicalBounds(animTarget, *pAnimationBase); } - - if (verified) + else if (animTarget == ANIMATION_TARGET_ALPHA) { - break; + SetControlShowState(animTarget, *pAnimationBase); } } } + } + } + else + { + __prevAnimationBoundsHolder = __pControl->GetBounds(); - int firstOccurence = -1; - int lastOccurence = -1; - - for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) - { - if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) - { - firstOccurence = index; - break; - } - } + for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + { + AnimationTargetType animTarget = ANIMATION_TARGET_MAX; + AnimationBase* pAnimationBase = null; + pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); + animTarget = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); - for (int index = pSequentialAnimGrp->GetAnimationCount() - 1; index >= 0; index--) + if (pAnimationBase != null) { - if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) + if (IsAnimationSupported() == false) { - lastOccurence = index; - break; + r = SetControlProperty(animTarget, *pAnimationBase); + delete pAnimationBase; + + SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store animation values."); } - } + else + { + if ((pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_POSITION) || + (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_SIZE)) + { + __logicalBoundsHolder = __pControl->GetBounds(); + setLogicalBnds = true; + } - if (!(firstOccurence >= 0 && lastOccurence >= 0)) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start custom implicit animation."); - delete pAnimationGroup; - return E_SYSTEM; - } + if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_ALPHA) + { + __showStateHolder = __pControl->GetShowState(); + setShowStateInternal = true; + } - __prevAnimationBoundsHolder = __pControl->GetBounds(); - for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) - { - AnimationTargetType animTarget = ANIMATION_TARGET_MAX; - AnimationBase* pAnimationBase = null; - pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); - animTarget = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); - if (pAnimationBase) - { - if (animTarget == equivalentAnimTarget) + if (animTarget == ANIMATION_TARGET_SIZE) { - Rectangle rect(x, y, width, height); + r = SetPrevAnimationBoundsProperty(animTarget, *pAnimationBase); - if (firstOccurence == lastOccurence) // (or) __targetCount==1 - { - r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); - } - else - { - if (index == firstOccurence) - { - r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, false); - } - else if (index == lastOccurence) - { - r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); - } - } if (r != E_SUCCESS) { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store previous animation bounds."); delete pAnimationBase; - delete pAnimationGroup; - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); - return E_SYSTEM; + goto CATCH; } } - if (!IsAnimationSupported()) - { - if (animTarget == equivalentAnimTarget) - { - if (index == lastOccurence) - { - Rectangle rect(x, y, width, height); - - r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); - - if (r != E_SUCCESS) - { - delete pAnimationBase; - delete pAnimationGroup; - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); - - return E_SYSTEM; - } - - r = SetControlProperty(animTarget, *pAnimationBase); - - delete pAnimationBase; - delete pAnimationGroup; + __sequentialGroupAnimation = true; + //Add the animation to the group + r = SetAnimation(animTarget, *pAnimationBase, ANIMATION_TRIGGER_USER, pAnimationGroup); + __sequentialGroupAnimation = false; - if (r != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set control property."); - return E_SYSTEM; - } - else - { - return E_SUCCESS; - } - } - } + if (pAnimationBase->IsAutoReverseEnabled() == true) + { + duration = 2 * pAnimationBase->GetDuration(); } else { - __sequentialGroupAnimation = true; - r = SetAnimation(animTarget, *pAnimationBase, triggerType, pAnimationGroup); //check this group animation - __sequentialGroupAnimation = false; - - delay = pAnimationBase->GetDelay() + totalDelay; - totalDelay = delay + (pAnimationBase->GetDuration() * pAnimationBase->GetRepeatCount()); - totalDelay = totalDelay - (pAnimationBase->GetOffset()); - __sequelDelay = totalDelay; - groupDuration = groupDuration + __sequelDelay * pAnimationBase->GetScaleRatio(); - - if (r != E_SUCCESS) - { - delete pAnimationBase; - delete pAnimationGroup; - - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); + duration = pAnimationBase->GetDuration(); + } - return r; - } + delay = pAnimationBase->GetDelay(); + totalDelay = delay + duration * pAnimationBase->GetRepeatCount(); + totalDelay = totalDelay - (pAnimationBase->GetOffset()); + __sequetialGroupAnimationDelay = totalDelay; + groupDuration = groupDuration + __sequetialGroupAnimationDelay * pAnimationBase->GetScaleRatio(); - if (animTarget == ANIMATION_TARGET_SIZE) - { - if (SetPrevAnimationBoundsProperty(animTarget, *pAnimationBase) != E_SUCCESS) - { - delete pAnimationBase; - delete pAnimationGroup; + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start animation."); + goto CATCH; + } - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store previous animation bounds."); + __isAnimationTargetAnimating[animTarget] = true; - return E_SYSTEM; - } - } + if (animTarget == ANIMATION_TARGET_POSITION || animTarget == ANIMATION_TARGET_SIZE) + { + SetControlLogicalBounds(animTarget, *pAnimationBase); + } + else if (animTarget == ANIMATION_TARGET_ALPHA) + { + SetControlShowState(animTarget, *pAnimationBase); } } } } } - else if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL) + + if (setLogicalBnds) { - pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); - if (pParallelAnimGrp) - { - for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) - { + bool disable = false; + bool propagation = false; - AnimationTargetType animTgt = static_cast< AnimationTargetType >(target); + result r = DisableImplicitAnimation(disable); + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable implicit animation."); + //if (pParallelAnimGrp == null) + { + r = DisableVisualElementPropagation(propagation); + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable visual element propagation."); + } + r = __pControl->SetBounds(__logicalBoundsHolder); - if (pParallelAnimGrp->IsAnimationAdded(animTgt) && __isAnimationTargetAnimating[animTgt]) - { - SysLogException(NID_UI_ANIM, E_INVALID_OPERATION, " [E_INVALID_OPERATION] Same AnimationTargetType is being animated."); - delete pAnimationGroup; + if (propagation) + { + DisableVisualElementPropagation(propagation); + } + if (disable) + { + DisableImplicitAnimation(disable); + } - return E_INVALID_OPERATION; - } - } + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set bounds."); + } - __targetCount = 1; - for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) - { - AnimationTargetType animTgt = static_cast< AnimationTargetType >(target); - AnimationBase* pAnimBase = null; - pAnimBase = pParallelAnimGrp->GetAnimationN(animTgt); - if (pAnimBase != null) - { - bool animatable = false; - if (animTgt == equivalentAnimTarget) - { - Rectangle rect(x, y, width, height); + if (setShowStateInternal) + { + bool disable = false; + bool propagation = false; - r = SetCustomImplicitAnimationParams(triggerType, *pAnimBase, rect, showState); - //Comment: Only associated TGT_TYPE is checked for IsAnimatable as the rest is checked in ControlAnimator::SetAnimation(). - animatable = IsAnimatable(animTgt, rect, pAnimBase); - } + result r = DisableImplicitAnimation(disable); + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable implicit animation."); - delete pAnimBase; + r = DisableVisualElementPropagation(propagation); + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable visual element propagation."); - if (((animTgt == equivalentAnimTarget) && (!animatable)) || (r != E_SUCCESS)) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set custom implicit animation."); - delete pAnimationGroup; + r = __pControl->SetShowState(__showStateHolder); - return E_INVALID_ARG; - } - } - } + if (propagation) + { + DisableVisualElementPropagation(propagation); + } + if (disable) + { + DisableImplicitAnimation(disable); + } - AnimationTargetType animTargetArray[ANIMATION_TARGET_MAX] = - { - ANIMATION_TARGET_ROTATION, - ANIMATION_TARGET_SIZE, - ANIMATION_TARGET_POSITION, - ANIMATION_TARGET_ALPHA - }; + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set show state."); + } - for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) - { - AnimationTargetType _animTarget = animTargetArray[target]; - AnimationBase* pAnimationBase = null; - pAnimationBase = pParallelAnimGrp->GetAnimationN(_animTarget); - if (pAnimationBase) - { - long duration = pAnimationBase->GetDuration(); + // for layout + __pControlImpl->SetBoundsAndUpdateLayout(__pControlImpl->GetBounds()); + + pAnimationGroup->SetDuration(groupDuration); + r = __pVisualElement->AddAnimation(animIdentifier, *pAnimationGroup); + SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start group animation."); + + delete pAnimationGroup; + return r; + +CATCH: + //check clean up + delete pAnimationGroup; + + if (DestroyAnimation(activeAnimationCount) != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to deallocate memory."); + return E_SYSTEM; + } + + return r; +} + +result +_ControlAnimatorImpl::SetCustomImplicitAnimationParams(ControlAnimatorTriggerType triggerType, AnimationBase& animationBase, Rectangle& bounds, bool showState, bool lastTargetOccurence) +{ + result r = E_SUCCESS; + + AnimationBase* pAnimationBase = const_cast< AnimationBase* >(&animationBase); + + if ((__targetCount == 1) || ((__targetCount > 1) && lastTargetOccurence)) + { + pAnimationBase->SetHoldEndEnabled(true); + pAnimationBase->SetAutoReverseEnabled(false); + } + + if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) + { + Point newPosition = Point(bounds.x, bounds.y); + Point currentPosition = __pControl->GetPosition(); + + PointAnimation* pPointAnim = null; + RectangleAnimation* pRectangleAnim = null; + + pPointAnim = dynamic_cast< PointAnimation* >(pAnimationBase); + pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); + SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + if (pPointAnim) + { + if (__targetCount == 1) + { + pPointAnim->SetStartValue(currentPosition); + pPointAnim->SetEndValue(newPosition); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pPointAnim->SetEndValue(newPosition)) : (pPointAnim->SetStartValue(currentPosition)); + } + pAnimationBase = pPointAnim; + } + else //if (pRectangleAnim) + { + Rectangle newRectangle = Rectangle(bounds.x, bounds.y, bounds.width, bounds.height); + Rectangle currentRectangle = Rectangle(__pControl->GetBounds()); + + if (__targetCount == 1) + { + pRectangleAnim->SetStartValue(currentRectangle); + pRectangleAnim->SetEndValue(newRectangle); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pRectangleAnim->SetEndValue(newRectangle)) : (pRectangleAnim->SetStartValue(currentRectangle)); + } + pAnimationBase = pRectangleAnim; + } + } + else if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) + { + Dimension newSize = Dimension(bounds.width, bounds.height); + Dimension currentSize = __pControl->GetSize(); + + DimensionAnimation* pDimensionAnim = null; + RectangleAnimation* pRectangleAnim = null; + + pDimensionAnim = dynamic_cast< DimensionAnimation* >(pAnimationBase); + pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); + SysTryReturnResult(NID_UI_ANIM, ((pDimensionAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + if (pDimensionAnim) + { + if (__targetCount == 1) + { + pDimensionAnim->SetStartValue(currentSize); + pDimensionAnim->SetEndValue(newSize); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pDimensionAnim->SetEndValue(newSize)) : (pDimensionAnim->SetStartValue(currentSize)); + } + pAnimationBase = pDimensionAnim; + } + else //if (pRectangleAnim) + { + Rectangle newRectangle = Rectangle(bounds.x, bounds.y, bounds.width, bounds.height); + Rectangle currentRectangle = Rectangle(__pControl->GetBounds()); + + if (__targetCount == 1) + { + pRectangleAnim->SetStartValue(currentRectangle); + pRectangleAnim->SetEndValue(newRectangle); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pRectangleAnim->SetEndValue(newRectangle)) : (pRectangleAnim->SetStartValue(currentRectangle)); + } + pAnimationBase = pRectangleAnim; + } + } + if (triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE) + { + FloatAnimation* pFloatAnim = null; + IntegerAnimation* pIntegerAnim = null; + + pFloatAnim = dynamic_cast< FloatAnimation* >(pAnimationBase); + pIntegerAnim = dynamic_cast< IntegerAnimation* >(pAnimationBase); + SysTryReturnResult(NID_UI_ANIM, ((pFloatAnim) || (pIntegerAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + float newShowState = 0.0f; + float currentShowState = 0.0f; + int inewShowState = 0; + int icurrentShowState = 0; + + if (pFloatAnim) + { + newShowState = ((showState) ? (1.0f) : (0.0f)); + currentShowState = ((showState) ? (0.0f) : (1.0f)); + } + else //if (pIntegerAnim) + { + inewShowState = ((showState) ? (1) : (0)); + icurrentShowState = ((showState) ? (0) : (1)); + } + + if (pFloatAnim) + { + if (__targetCount == 1) + { + pFloatAnim->SetStartValue(currentShowState); + pFloatAnim->SetEndValue(newShowState); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pFloatAnim->SetEndValue(newShowState)) : (pFloatAnim->SetStartValue(currentShowState)); + } + pAnimationBase = pFloatAnim; + } + else //if (pIntegerAnim) + { + if (__targetCount == 1) + { + pIntegerAnim->SetStartValue(icurrentShowState); + pIntegerAnim->SetEndValue(inewShowState); + } + else //__targetCount > 1 + { + (lastTargetOccurence) ? (pIntegerAnim->SetEndValue(inewShowState)) : (pIntegerAnim->SetStartValue(icurrentShowState)); + } + pAnimationBase = pIntegerAnim; + } + } + return r; +} + +result +_ControlAnimatorImpl::StartCustomImplicitAnimation(ControlAnimatorTriggerType triggerType, int x, int y, int width, int height, bool showState) +{ + result r = E_SUCCESS; + SysTryReturnResult(NID_UI_ANIM, (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE || + triggerType == ANIMATION_TRIGGER_SIZE_CHANGE || + triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE), E_INVALID_ARG, "Invalid argument(s) is used. Trigger type is invalid."); + + long delay = 0; + long totalDelay = 0; + long groupDuration = 0; + + AnimationTargetType equivalentAnimTarget = ANIMATION_TARGET_NONE; + + VisualElementAnimationGroup* pAnimationGroup = null; + + __sequetialGroupAnimationDelay = 0; + pAnimationGroup = new (std::nothrow) VisualElementAnimationGroup(); + SysTryReturnResult(NID_UI_ANIM, (pAnimationGroup != null), E_OUT_OF_MEMORY, "Memory allocation failed."); + + if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) + { + equivalentAnimTarget = ANIMATION_TARGET_POSITION; + } + else if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) + { + equivalentAnimTarget = ANIMATION_TARGET_SIZE; + } + else + { + equivalentAnimTarget = ANIMATION_TARGET_ALPHA; + } + + ParallelAnimationGroup* pParallelAnimGrp = null; + SequentialAnimationGroup* pSequentialAnimGrp = null; + String animIdentifier; + + __targetCount = 0; + animIdentifier.Append(GROUP); + animIdentifier.Append(__animationId); + __animationId++; + __groupName.Clear(); + __groupName = animIdentifier; + + if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_SEQUENTIAL) + { + pSequentialAnimGrp = dynamic_cast< SequentialAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); + if (pSequentialAnimGrp) + { + for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + { + AnimationTargetType animTgt = ANIMATION_TARGET_NONE; + + animTgt = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); + if (animTgt > ANIMATION_TARGET_NONE && animTgt < ANIMATION_TARGET_MAX) + { + if (__isAnimationTargetAnimating[animTgt]) + { + SysLogException(NID_UI_ANIM, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Same AnimationTargetType is being animated."); + delete pAnimationGroup; + return E_INVALID_OPERATION; + } + } + } + + for (int index = pSequentialAnimGrp->GetAnimationCount() - 1; index >= 0; index--) + { + if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) + { + __targetCount++; + } + } + + //Overwrite last Animation in AnimationGroup and check for IsAnimatable + bool verified = false; + for (int count = pSequentialAnimGrp->GetAnimationCount() - 1; count >= 0; count--) + { + AnimationTargetType animTgt = ANIMATION_TARGET_NONE; + animTgt = pSequentialAnimGrp->GetAnimationTargetTypeAt(count); + if (animTgt == equivalentAnimTarget) + { + bool animatable = false; + AnimationBase* pAnimBase = null; + pAnimBase = pSequentialAnimGrp->GetAnimationAtN(count); + + if (pAnimBase) + { + Rectangle rect(x, y, width, height); + + r = SetCustomImplicitAnimationParams(triggerType, *pAnimBase, rect, showState, true); + + //Comment: Only the last associated TGT_TYPE is checked for IsAnimatable as the rest is checked in ControlAnimator::SetAnimation(). + animatable = IsAnimatable(animTgt, rect, pAnimBase); + delete pAnimBase; + verified = true; + } + + if ((!animatable) || (r != E_SUCCESS)) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set custom implicit animation."); + delete pAnimationGroup; + return E_INVALID_ARG; + } + + if (verified) + { + break; + } + } + } + + int firstOccurence = -1; + int lastOccurence = -1; + + for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + { + if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) + { + firstOccurence = index; + break; + } + } + + for (int index = pSequentialAnimGrp->GetAnimationCount() - 1; index >= 0; index--) + { + if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == equivalentAnimTarget) + { + lastOccurence = index; + break; + } + } + + if (!(firstOccurence >= 0 && lastOccurence >= 0)) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start custom implicit animation."); + delete pAnimationGroup; + return E_SYSTEM; + } + + __prevAnimationBoundsHolder = __pControl->GetBounds(); + for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + { + AnimationTargetType animTarget = ANIMATION_TARGET_MAX; + AnimationBase* pAnimationBase = null; + pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); + animTarget = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); + if (pAnimationBase) + { + if (animTarget == equivalentAnimTarget) + { + Rectangle rect(x, y, width, height); + + if (firstOccurence == lastOccurence) // (or) __targetCount==1 + { + r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); + } + else + { + if (index == firstOccurence) + { + r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, false); + } + else if (index == lastOccurence) + { + r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); + } + } + if (r != E_SUCCESS) + { + delete pAnimationBase; + delete pAnimationGroup; + + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); + return E_SYSTEM; + } + } + if (!IsAnimationSupported()) + { + if (animTarget == equivalentAnimTarget) + { + if (index == lastOccurence) + { + Rectangle rect(x, y, width, height); + + r = SetCustomImplicitAnimationParams(triggerType, *pAnimationBase, rect, showState, true); + + if (r != E_SUCCESS) + { + delete pAnimationBase; + delete pAnimationGroup; + + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); + + return E_SYSTEM; + } + + r = SetControlProperty(animTarget, *pAnimationBase); + + delete pAnimationBase; + delete pAnimationGroup; + + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set control property."); + return E_SYSTEM; + } + else + { + return E_SUCCESS; + } + } + } + } + else + { + __sequentialGroupAnimation = true; + r = SetAnimation(animTarget, *pAnimationBase, triggerType, pAnimationGroup); //check this group animation + __sequentialGroupAnimation = false; + + delay = pAnimationBase->GetDelay() + totalDelay; + totalDelay = delay + (pAnimationBase->GetDuration() * pAnimationBase->GetRepeatCount()); + totalDelay = totalDelay - (pAnimationBase->GetOffset()); + __sequetialGroupAnimationDelay = totalDelay; + groupDuration = groupDuration + __sequetialGroupAnimationDelay * pAnimationBase->GetScaleRatio(); + + if (r != E_SUCCESS) + { + delete pAnimationBase; + delete pAnimationGroup; + + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set parameters for custom implicit animation."); + + return r; + } + + if (animTarget == ANIMATION_TARGET_SIZE) + { + if (SetPrevAnimationBoundsProperty(animTarget, *pAnimationBase) != E_SUCCESS) + { + delete pAnimationBase; + delete pAnimationGroup; + + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store previous animation bounds."); + + return E_SYSTEM; + } + } + } + } + } + } + } + else if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL) + { + pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); + if (pParallelAnimGrp) + { + for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) + { + + AnimationTargetType animTgt = static_cast< AnimationTargetType >(target); + + if (pParallelAnimGrp->IsAnimationAdded(animTgt) && __isAnimationTargetAnimating[animTgt]) + { + SysLogException(NID_UI_ANIM, E_INVALID_OPERATION, " [E_INVALID_OPERATION] Same AnimationTargetType is being animated."); + delete pAnimationGroup; + + return E_INVALID_OPERATION; + } + } + + __targetCount = 1; + for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) + { + AnimationTargetType animTgt = static_cast< AnimationTargetType >(target); + AnimationBase* pAnimBase = null; + pAnimBase = pParallelAnimGrp->GetAnimationN(animTgt); + if (pAnimBase != null) + { + bool animatable = false; + if (animTgt == equivalentAnimTarget) + { + Rectangle rect(x, y, width, height); + + r = SetCustomImplicitAnimationParams(triggerType, *pAnimBase, rect, showState); + //Comment: Only associated TGT_TYPE is checked for IsAnimatable as the rest is checked in ControlAnimator::SetAnimation(). + animatable = IsAnimatable(animTgt, rect, pAnimBase); + } + + delete pAnimBase; + + if (((animTgt == equivalentAnimTarget) && (!animatable)) || (r != E_SUCCESS)) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set custom implicit animation."); + delete pAnimationGroup; + + return E_INVALID_ARG; + } + } + } + + AnimationTargetType animTargetArray[ANIMATION_TARGET_MAX] = + { + ANIMATION_TARGET_ROTATION, + ANIMATION_TARGET_SIZE, + ANIMATION_TARGET_POSITION, + ANIMATION_TARGET_ALPHA + }; + + for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) + { + AnimationTargetType _animTarget = animTargetArray[target]; + AnimationBase* pAnimationBase = null; + pAnimationBase = pParallelAnimGrp->GetAnimationN(_animTarget); + if (pAnimationBase) + { + long duration = pAnimationBase->GetDuration(); duration = (duration * (pAnimationBase->GetRepeatCount()) * (pAnimationBase->GetScaleRatio())) + (pAnimationBase->GetDelay()) - (pAnimationBase->GetOffset()* pAnimationBase->GetScaleRatio()); @@ -1239,7 +1748,6 @@ _ControlAnimatorImpl::AddActiveAnimation(AnimationTargetType animTarget, Animati activeAnim.animType = triggerType; activeAnim.animTarget = animTarget; activeAnim.pAnimationBase = (&animBase); - activeAnim.pAnimation = (&animNative); activeAnim.animName = animName; activeAnim.pBezierTimingFunction = pBezierTiming; @@ -1252,8 +1760,8 @@ _ControlAnimatorImpl::AddActiveAnimation(AnimationTargetType animTarget, Animati String _ControlAnimatorImpl::GetActiveAnimationAt(int index) const { - SysTryReturn(NID_UI_ANIM, (index > 0 && __pActiveAnimationList->GetCount() > 0 && index < __pActiveAnimationList->GetCount()), - null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Index (%d) is out of range.", index); + SysTryReturn(NID_UI_ANIM, (index >= 0 && index < __pActiveAnimationList->GetCount()), + String(), E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Index (%d) is out of range.", index); ActiveAnimation activeAnim; @@ -1261,21 +1769,15 @@ _ControlAnimatorImpl::GetActiveAnimationAt(int index) const { return activeAnim.animName; } - else - { - return null; - } + + return String(); } String _ControlAnimatorImpl::GetActiveAnimationAt(int index, ControlAnimatorTriggerType animTrigger) const { - if (!((__pActiveAnimationList->GetCount() > 0) && (index < __pActiveAnimationList->GetCount()) && (index >= 0))) - { - SysLog(NID_UI_ANIM, "[E_SYSTEM] A system error has been occurred. index (%d) is invalid.", index); - int empty = 0; - return String(empty); - } + SysTryReturn(NID_UI_ANIM, (index >= 0 && index < __pActiveAnimationList->GetCount()), + String(), E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Index (%d) is out of range.", index); ActiveAnimation activeAnim; @@ -1285,14 +1787,9 @@ _ControlAnimatorImpl::GetActiveAnimationAt(int index, ControlAnimatorTriggerType { return activeAnim.animName; } - - return null; - } - else - { - SysLog(NID_UI_ANIM, "[E_SYSTEM] A system error has been occurred. Failed to get from list for index = %d", index); - return null; } + + return String(); } int @@ -1310,8 +1807,10 @@ _ControlAnimatorImpl::GetActiveAnimationListCount(AnimationTargetType animTarget for (int count = __pActiveAnimationList->GetCount() - 1; count >= 0; count--) { ActiveAnimation activeAnim; + r = __pActiveAnimationList->GetAt(count, activeAnim); SysTryReturn(NID_UI_ANIM, (r == E_SUCCESS), -1, r, "[%s] Failed to retrieve active animation from list.", GetErrorMessage(r)); + if (activeAnim.animTarget == animTarget) { count++; @@ -1321,6 +1820,27 @@ _ControlAnimatorImpl::GetActiveAnimationListCount(AnimationTargetType animTarget return count; } +int +_ControlAnimatorImpl::GetActiveAnimationIndex(const String& animName) const +{ + result r = E_SUCCESS; + + for (int index = 0; index < __pActiveAnimationList->GetCount(); index++) + { + ActiveAnimation activeAnim; + + r = __pActiveAnimationList->GetAt(index, activeAnim); + SysTryReturn(NID_UI_ANIM, (r == E_SUCCESS), -1, r, "[%s] Failed to retrieve animation from the list.", GetErrorMessage(r)); + + if (activeAnim.animName == animName) + { + return index; + } + } + + return -1; +} + result _ControlAnimatorImpl::RemoveAnimationAt(int index) { @@ -1338,8 +1858,6 @@ _ControlAnimatorImpl::RemoveAnimationAt(int index) delete activeAnim.pAnimationBase; activeAnim.pAnimationBase = null; - delete activeAnim.pAnimation; - activeAnim.pAnimation = null; delete activeAnim.pBezierTimingFunction; activeAnim.pBezierTimingFunction = null; @@ -1403,259 +1921,48 @@ _ControlAnimatorImpl::DestroyAnimation(AnimationBase& animBase, AnimationTargetT } result -_ControlAnimatorImpl::SetControlProperty(AnimationTargetType animTarget, AnimationBase& animationBase) -{ - result r = E_SUCCESS; - - if (animationBase.IsHoldEndEnabled() == true) - { - switch (animTarget) - { - case ANIMATION_TARGET_SIZE: - { - DimensionAnimation* pDimAnim = null; - RectangleAnimation* pRectAnim = null; - - pDimAnim = dynamic_cast< DimensionAnimation* >(const_cast< AnimationBase* >(&animationBase)); - pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); - SysTryReturnResult(NID_UI_ANIM, ((pDimAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pDimAnim) - { - Dimension dimVal(0, 0); - - (animationBase.IsAutoReverseEnabled()) ? (dimVal = pDimAnim->GetStartValue()) : (dimVal = pDimAnim->GetEndValue()); - r = (__pControl)->SetSize(dimVal.width, dimVal.height); - } - else //if (pRectAnim) - { - Rectangle rectVal(0, 0, 0, 0); - - (animationBase.IsAutoReverseEnabled()) ? (rectVal = pRectAnim->GetStartValue()) : (rectVal = pRectAnim->GetEndValue()); - r = (__pControl)->SetSize(rectVal.width, rectVal.height); - } - } - break; - - case ANIMATION_TARGET_POSITION: - { - PointAnimation* pPointAnim = null; - RectangleAnimation* pRectAnim = null; - - pPointAnim = dynamic_cast< PointAnimation* >(const_cast< AnimationBase* >(&animationBase)); - pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); - SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pPointAnim) - { - Point val(0, 0); - - (animationBase.IsAutoReverseEnabled()) ? (val = pPointAnim->GetStartValue()) : (val = pPointAnim->GetEndValue()); - r = (__pControl)->SetPosition(val.x, val.y); - } - else //if (pRectAnim) - { - Rectangle rectVal(0, 0, 0, 0); - - (animationBase.IsAutoReverseEnabled()) ? (rectVal = pRectAnim->GetStartValue()) : (rectVal = pRectAnim->GetEndValue()); - r = (__pControl)->SetPosition(rectVal.x, rectVal.y); - } - } - break; - - case ANIMATION_TARGET_ALPHA: - { - FloatAnimation* pFloatAnim = null; - IntegerAnimation* pIntegerAnim = null; - - pFloatAnim = dynamic_cast< FloatAnimation* >(const_cast< AnimationBase* >(&animationBase)); - pIntegerAnim = dynamic_cast< IntegerAnimation* >(const_cast< AnimationBase* >(&animationBase)); - SysTryReturnResult(NID_UI_ANIM, ((pFloatAnim) || (pIntegerAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pFloatAnim) - { - float floatVal = 0.0f; - - (animationBase.IsAutoReverseEnabled()) ? (floatVal = pFloatAnim->GetStartValue()) : (floatVal = pFloatAnim->GetEndValue()); - - if (!(Float::Compare(floatVal, 1.0))) - { - r = __pControl->SetShowState(true); - } - else - { - r = __pControl->SetShowState(false); - } - - } - else //if (pIntegerAnim) - { - int intVal = 0; - - (animationBase.IsAutoReverseEnabled()) ? (intVal = pIntegerAnim->GetStartValue()) : (intVal = pIntegerAnim->GetEndValue()); - - if (intVal == 1) - { - r = __pControl->SetShowState(true); - } - else - { - r = __pControl->SetShowState(false); - } - } - } - break; - - case ANIMATION_TARGET_ROTATION: - { - //Comment: The Control's property will be the same even after the rotate animation is completed. - //So, no need to update the window property. - } - break; - - default: - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); - return E_SYSTEM; - } - break; - } - } - - if (IsAnimationSupported() == false) - { - _WindowImpl* pWindow = null; - pWindow = _ControlImplManager::GetInstance()->GetCurrentFrame(); - SysTryReturnResult(NID_UI_ANIM, (pWindow), E_SYSTEM, "A system error has been occurred. Failed to get current frame."); - - pWindow->GetPublic().Draw(); - __isAnimationTargetAnimating[animTarget] = false; - } - - return r; -} - -result -_ControlAnimatorImpl::SetControlShowState(AnimationTargetType animTarget, AnimationBase& animationBase) -{ - SysTryReturnResult(NID_UI_ANIM, (animTarget == ANIMATION_TARGET_ALPHA), E_SYSTEM, "animTarget is invalid."); - - if (animationBase.IsHoldEndEnabled() == true) - { - IntegerAnimation* pIntAnim = dynamic_cast< IntegerAnimation* >(const_cast< AnimationBase* >(&animationBase)); - FloatAnimation* pFloatAnim = dynamic_cast< FloatAnimation* >(const_cast< AnimationBase* >(&animationBase)); - - SysTryReturnResult(NID_UI_ANIM, (pIntAnim || pFloatAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pIntAnim) - { - int endVal = -1; - - if (animationBase.IsAutoReverseEnabled() == false) - { - endVal = static_cast< float >(pIntAnim->GetEndValue()); - __showStateHolder = ((endVal == 1) ? (true) : (false)); - } - } - else //if (pFloatAnim) - { - float endVal = -1.0f; - - if (animationBase.IsAutoReverseEnabled() == false) - { - endVal = (static_cast< float >(pFloatAnim->GetEndValue())); - __showStateHolder = (((!(Float::Compare(endVal, 1.0)))) ? (true) : (false)); - } - } - } - - if ((__pControl->GetShowState() == false) && ((animationBase.IsAutoReverseEnabled()) || (animationBase.IsHoldEndEnabled() == false))) - { - __pVisualElement->SetShowState(true); - __pVisualElement->Draw(); - __pVisualElement->SetShowState(false); - } - - return E_SUCCESS; -} - -result -_ControlAnimatorImpl::SetControlLogicalBounds(AnimationTargetType animTarget, AnimationBase& animationBase) +_ControlAnimatorImpl::StopAllAnimations(void) { result r = E_SUCCESS; - if (animationBase.IsHoldEndEnabled() == true) - { - switch (animTarget) - { - case ANIMATION_TARGET_SIZE: - { - DimensionAnimation* pDimAnim = dynamic_cast< DimensionAnimation* >(const_cast< AnimationBase* >(&animationBase)); - RectangleAnimation* pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); - SysTryReturnResult(NID_UI_ANIM, ((pDimAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pDimAnim) - { - Dimension dimVal(0, 0); - if (animationBase.IsAutoReverseEnabled() == false) - { - dimVal = pDimAnim->GetEndValue(); - __logicalBoundsHolder.width = dimVal.width; - __logicalBoundsHolder.height = dimVal.height; - } - } - else //if (pRectAnim) - { - Rectangle rectVal(0, 0, 0, 0); - if (animationBase.IsAutoReverseEnabled() == false) - { - rectVal = pRectAnim->GetEndValue(); - __logicalBoundsHolder.width = rectVal.width; - __logicalBoundsHolder.height = rectVal.height; - } - } - } - break; + __pVisualElement->RemoveAllAnimations(); - case ANIMATION_TARGET_POSITION: - { - PointAnimation* pPointAnim = dynamic_cast< PointAnimation* >(const_cast< AnimationBase* >(&animationBase)); - RectangleAnimation* pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); - SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + return r; +} - if (pPointAnim) +result +_ControlAnimatorImpl::StopAnimation(ControlAnimatorTriggerType animTrigger) +{ + SysTryReturnResult(NID_UI_ANIM, (GetActiveAnimationListCount() > 0), E_SUCCESS, "No active animation."); + + result r = E_SUCCESS; + + for (int index = GetActiveAnimationListCount() - 1; index >= 0; index--) + { + String animName; + + animName = GetActiveAnimationAt(index, animTrigger); + if (animName.IsEmpty() == false) + { + int startIndex = 0; + int indexOfGroup = 0; + if ((animName.IndexOf(GROUP, startIndex, indexOfGroup)) == E_SUCCESS) { - Point val(0, 0); + String groupName; + r = animName.SubString(indexOfGroup, groupName); + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Group name is not found."); - if (animationBase.IsAutoReverseEnabled() == false) - { - val = pPointAnim->GetEndValue(); - __logicalBoundsHolder.x = val.x; - __logicalBoundsHolder.y = val.y; - } + r = __pVisualElement->RemoveAnimation(groupName); } else { - Rectangle rectVal(0, 0, 0, 0); - - if (animationBase.IsAutoReverseEnabled() == false) - { - rectVal = pRectAnim->GetEndValue(); - __logicalBoundsHolder.x = rectVal.x; - __logicalBoundsHolder.y = rectVal.y; - } + r = __pVisualElement->RemoveAnimation(animName); } - } - break; - default: - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); - return E_SYSTEM; - } - break; + SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Animation is either running or already removed."); } } + return r; } @@ -1915,7 +2222,7 @@ _ControlAnimatorImpl::IsAnimatable(AnimationTargetType animTarget, Rectangle& bo if (pControlBase) { - __pControlImpl->OnBoundsChanging(endBounds); //check this this API has been changed in 2.0 + __pControlImpl->OnBoundsChanging(endBounds); //check this this API has been changed in 2.1 } //Comment. No limit on positive & negative "x" & "y" for the movable %Control's position property animatable = true; @@ -2036,329 +2343,282 @@ _ControlAnimatorImpl::IsAnimatable(AnimationTargetType animTarget, Rectangle& bo return animatable; } -bool -_ControlAnimatorImpl::IsAnimationSupported(void) const +result +_ControlAnimatorImpl::DisableImplicitAnimation(bool& state) { - return _VisualElementAnimationImpl::IsAnimationSupported(); + bool enable = __pVisualElement->IsImplicitAnimationEnabled(); + __pVisualElement->SetImplicitAnimationEnabled(state); + state = enable; + + return E_SUCCESS; } -void -_ControlAnimatorImpl::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +result +_ControlAnimatorImpl::DisableVisualElementPropagation(bool& state) { - ActiveAnimation activeAnim; - int index = -1; - String animName(0); - - if (keyName.IsEmpty() == true) - { - String* pUserData = (String*) (animation.GetUserData()); - if (pUserData != null) - { - animName = *pUserData; - } - } - else - { - animName = keyName; - } + bool propagate = _VisualElementImpl::GetInstance(*__pVisualElement)->GetPropertyPropagationEnabled(); + result r = _VisualElementImpl::GetInstance(*__pVisualElement)->SetPropertyPropagationEnabled(state); + state = propagate; - index = GetActiveAnimationIndex(animName); + return r; +} - if (index == -1) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); - return; - } +result +_ControlAnimatorImpl::SetControlProperty(AnimationTargetType animTarget, AnimationBase& animationBase) +{ + result r = E_SUCCESS; - if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) + if (animationBase.IsHoldEndEnabled() == true) { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); - return; - } - - __isAnimationTargetAnimating[activeAnim.animTarget] = true; + switch (animTarget) + { + case ANIMATION_TARGET_SIZE: + { + DimensionAnimation* pDimAnim = null; + RectangleAnimation* pRectAnim = null; - int startIndex = 0; - int indexOf = 0; + pDimAnim = dynamic_cast< DimensionAnimation* >(const_cast< AnimationBase* >(&animationBase)); + pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); + SysTryReturnResult(NID_UI_ANIM, ((pDimAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) - { - //Calling simple listeners registered in this control animator - if (__pAnimStatusEventListener) - { - IControlAnimatorEventListener* pCaEventListener = null; - for (int count = (__pAnimStatusEventListener->GetCount() - 1); count >= 0; count--) + if (pDimAnim) { - __pAnimStatusEventListener->GetAt(count, pCaEventListener); - if (pCaEventListener) - { - pCaEventListener->OnControlAnimationStarted(*__pControlAnimator, *__pControl); - } - } - } - - //calling detailed event listerners registered in this control animator - if (__pAnimDetailedEventListener) - { - IControlAnimatorDetailedEventListener* pDetailedEventListener = null; + Dimension dimVal(0, 0); - for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) + (animationBase.IsAutoReverseEnabled()) ? (dimVal = pDimAnim->GetStartValue()) : (dimVal = pDimAnim->GetEndValue()); + r = (__pControl)->SetSize(dimVal.width, dimVal.height); + } + else //if (pRectAnim) { - __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); + Rectangle rectVal(0, 0, 0, 0); - if (pDetailedEventListener) - { - pDetailedEventListener->OnControlAnimationStarted(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); - } + (animationBase.IsAutoReverseEnabled()) ? (rectVal = pRectAnim->GetStartValue()) : (rectVal = pRectAnim->GetEndValue()); + r = (__pControl)->SetSize(rectVal.width, rectVal.height); } } - } -} - -void -_ControlAnimatorImpl::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) -{ - ActiveAnimation activeAnim; - int index = -1; - String animName(0); - - if (keyName.IsEmpty() == true) - { - String* pUserData = (String*) (animation.GetUserData()); + break; - if (pUserData != null) + case ANIMATION_TARGET_POSITION: { - animName = *pUserData; - } - } - else - { - animName = keyName; - } - - index = GetActiveAnimationIndex(animName); - if (index == -1) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); - return; - } - - if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); - return; - } + PointAnimation* pPointAnim = null; + RectangleAnimation* pRectAnim = null; - int startIndex = 0; - int indexOf = 0; + pPointAnim = dynamic_cast< PointAnimation* >(const_cast< AnimationBase* >(&animationBase)); + pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); + SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) - { - if (__pAnimDetailedEventListener) - { - IControlAnimatorDetailedEventListener* pDetailedEventListener = null; + if (pPointAnim) + { + Point val(0, 0); - for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) + (animationBase.IsAutoReverseEnabled()) ? (val = pPointAnim->GetStartValue()) : (val = pPointAnim->GetEndValue()); + r = (__pControl)->SetPosition(val.x, val.y); + } + else //if (pRectAnim) { - __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); + Rectangle rectVal(0, 0, 0, 0); - if (pDetailedEventListener) - { - pDetailedEventListener->OnControlAnimationRepeated(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase, currentRepeatCount); - } + (animationBase.IsAutoReverseEnabled()) ? (rectVal = pRectAnim->GetStartValue()) : (rectVal = pRectAnim->GetEndValue()); + r = (__pControl)->SetPosition(rectVal.x, rectVal.y); } } - } -} - -void -_ControlAnimatorImpl::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) -{ - String animName(0); - - if (keyName.IsEmpty() == true) - { - String* pUserData = (String*) (animation.GetUserData()); + break; - if (pUserData != null) + case ANIMATION_TARGET_ALPHA: { - animName = *pUserData; - delete pUserData; - pUserData = null; - } - } - else - { - animName = keyName; - } - - _VisualElementImpl* pPresentationImpl = _VisualElementImpl::GetInstance(*const_cast(__pVisualElement->AcquirePresentationInstance())); - - if (pPresentationImpl == null) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Screen is not updated with end values."); - } - else - { - VisualElementValueAnimation* pValueAnimation = dynamic_cast< VisualElementValueAnimation* >(const_cast< VisualElementAnimation* >(&animation)); - VisualElementPropertyAnimation* pAnimation = dynamic_cast< VisualElementPropertyAnimation* >(const_cast< VisualElementAnimation* >(&animation)); + FloatAnimation* pFloatAnim = null; + IntegerAnimation* pIntegerAnim = null; - if (completedNormally == false || (pValueAnimation && pValueAnimation->IsEndValueApplied() == false)) - { - if (pAnimation) + pFloatAnim = dynamic_cast< FloatAnimation* >(const_cast< AnimationBase* >(&animationBase)); + pIntegerAnim = dynamic_cast< IntegerAnimation* >(const_cast< AnimationBase* >(&animationBase)); + SysTryReturnResult(NID_UI_ANIM, ((pFloatAnim) || (pIntegerAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + if (pFloatAnim) { - String propName = pAnimation->GetPropertyName(); + float floatVal = 0.0f; - int startIndex = 0; - int indexOf = 0; - result r = E_SUCCESS; + (animationBase.IsAutoReverseEnabled()) ? (floatVal = pFloatAnim->GetStartValue()) : (floatVal = pFloatAnim->GetEndValue()); - if ((propName.IndexOf(VeSubPropBoundsPosition, startIndex, indexOf)) == E_SUCCESS) - { - r = pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); - } - else if ((propName.IndexOf(VePropBounds, startIndex, indexOf)) == E_SUCCESS) + if (!(Float::Compare(floatVal, 1.0))) { - r = pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); + r = __pControl->SetShowState(true); } - else if ((propName.IndexOf(VeSubPropTransformRotationZ, startIndex, indexOf)) == E_SUCCESS) + else { - r = pPresentationImpl->SetProperty(VePropTransform, __pVisualElement->GetTransformMatrix()); + r = __pControl->SetShowState(false); } - else if ((propName.IndexOf(VePrivPropShowOpacity, startIndex, indexOf)) == E_SUCCESS) + + } + else //if (pIntegerAnim) + { + int intVal = 0; + + (animationBase.IsAutoReverseEnabled()) ? (intVal = pIntegerAnim->GetStartValue()) : (intVal = pIntegerAnim->GetEndValue()); + + if (intVal == 1) { - r = pPresentationImpl->SetProperty(VePropShowState, __pVisualElement->GetShowState()); + r = __pControl->SetShowState(true); } - - if (r != E_SUCCESS) + else { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Screen is not updated with end values."); + r = __pControl->SetShowState(false); } } - else if (pValueAnimation) - { - pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); - } } - } - - __pVisualElement->ReleasePresentationInstance(); - - ActiveAnimation activeAnim; - int index = -1; + break; - index = GetActiveAnimationIndex(animName); + case ANIMATION_TARGET_ROTATION: + { + //Comment: The Control's property will be the same even after the rotate animation is completed. + //So, no need to update the window property. + } + break; - if (index == -1) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); - return; + default: + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); + return E_SYSTEM; + } + break; + } } - if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) + if (IsAnimationSupported() == false) { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); - return; + _WindowImpl* pWindow = null; + pWindow = _ControlImplManager::GetInstance()->GetCurrentFrame(); + SysTryReturnResult(NID_UI_ANIM, (pWindow), E_SYSTEM, "A system error has been occurred. Failed to get current frame."); + + pWindow->GetPublic().Draw(); + __isAnimationTargetAnimating[animTarget] = false; } - int startIndex = 0; - int indexOf = 0; + return r; +} - __isAnimationTargetAnimating[activeAnim.animTarget] = false; +result +_ControlAnimatorImpl::SetControlShowState(AnimationTargetType animTarget, AnimationBase& animationBase) +{ + SysTryReturnResult(NID_UI_ANIM, (animTarget == ANIMATION_TARGET_ALPHA), E_SYSTEM, "animTarget is invalid."); - if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) + if (animationBase.IsHoldEndEnabled() == true) { - if (__pAnimStatusEventListener) + IntegerAnimation* pIntAnim = dynamic_cast< IntegerAnimation* >(const_cast< AnimationBase* >(&animationBase)); + FloatAnimation* pFloatAnim = dynamic_cast< FloatAnimation* >(const_cast< AnimationBase* >(&animationBase)); + + SysTryReturnResult(NID_UI_ANIM, (pIntAnim || pFloatAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + if (pIntAnim) { - IControlAnimatorEventListener* pCaEventListener = null; + int endVal = -1; - for (int count = (__pAnimStatusEventListener->GetCount() - 1); count >= 0; count--) + if (animationBase.IsAutoReverseEnabled() == false) { - __pAnimStatusEventListener->GetAt(count, pCaEventListener); - if (pCaEventListener) - { - if (completedNormally) - { - pCaEventListener->OnControlAnimationFinished(*__pControlAnimator, *__pControl); - } - else - { - pCaEventListener->OnControlAnimationStopped(*__pControlAnimator, *__pControl); - } - } + endVal = static_cast< float >(pIntAnim->GetEndValue()); + __showStateHolder = ((endVal == 1) ? (true) : (false)); } } - - //Calling detailed event listeners - if (__pAnimDetailedEventListener) + else //if (pFloatAnim) { - IControlAnimatorDetailedEventListener* pDetailedEventListener = null; + float endVal = -1.0f; - for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) + if (animationBase.IsAutoReverseEnabled() == false) { - __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); - - if (pDetailedEventListener) - { - if (completedNormally) - { - pDetailedEventListener->OnControlAnimationFinished(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); - } - else - { - pDetailedEventListener->OnControlAnimationStopped(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); - } - } + endVal = (static_cast< float >(pFloatAnim->GetEndValue())); + __showStateHolder = (((!(Float::Compare(endVal, 1.0)))) ? (true) : (false)); } } } - RemoveAnimationAt(index); -} - -result -_ControlAnimatorImpl::StopAllAnimations(void) -{ - result r = E_SUCCESS; - __pVisualElement->RemoveAllAnimations(); + //TODO : remove + if ((__pControl->GetShowState() == false) && ((animationBase.IsAutoReverseEnabled()) || (animationBase.IsHoldEndEnabled() == false))) + { + __pVisualElement->SetShowState(true); + __pVisualElement->Draw(); + __pVisualElement->SetShowState(false); + } - return r; + return E_SUCCESS; } result -_ControlAnimatorImpl::StopAnimation(ControlAnimatorTriggerType animTrigger) +_ControlAnimatorImpl::SetControlLogicalBounds(AnimationTargetType animTarget, AnimationBase& animationBase) { - SysTryReturnResult(NID_UI_ANIM, (GetActiveAnimationListCount() > 0), E_SUCCESS, "No active animation."); - result r = E_SUCCESS; - for (int index = GetActiveAnimationListCount() - 1; index >= 0; index--) + if (animationBase.IsHoldEndEnabled() == true) { - String animName; + switch (animTarget) + { + case ANIMATION_TARGET_SIZE: + { + DimensionAnimation* pDimAnim = dynamic_cast< DimensionAnimation* >(const_cast< AnimationBase* >(&animationBase)); + RectangleAnimation* pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); + SysTryReturnResult(NID_UI_ANIM, ((pDimAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - animName = GetActiveAnimationAt(index, animTrigger); - if (!(animName.IsEmpty())) + if (pDimAnim) + { + Dimension dimVal(0, 0); + if (animationBase.IsAutoReverseEnabled() == false) + { + dimVal = pDimAnim->GetEndValue(); + __logicalBoundsHolder.width = dimVal.width; + __logicalBoundsHolder.height = dimVal.height; + } + } + else //if (pRectAnim) + { + Rectangle rectVal(0, 0, 0, 0); + if (animationBase.IsAutoReverseEnabled() == false) + { + rectVal = pRectAnim->GetEndValue(); + __logicalBoundsHolder.width = rectVal.width; + __logicalBoundsHolder.height = rectVal.height; + } + } + } + break; + + case ANIMATION_TARGET_POSITION: { - int startIndex = 0; - int indexOfGroup = 0; - if ((animName.IndexOf(GROUP, startIndex, indexOfGroup)) == E_SUCCESS) + PointAnimation* pPointAnim = dynamic_cast< PointAnimation* >(const_cast< AnimationBase* >(&animationBase)); + RectangleAnimation* pRectAnim = dynamic_cast< RectangleAnimation* >(const_cast< AnimationBase* >(&animationBase)); + SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); + + if (pPointAnim) { - String groupName; - r = animName.SubString(indexOfGroup, groupName); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Group name is not found."); + Point val(0, 0); - r = __pVisualElement->RemoveAnimation(groupName); + if (animationBase.IsAutoReverseEnabled() == false) + { + val = pPointAnim->GetEndValue(); + __logicalBoundsHolder.x = val.x; + __logicalBoundsHolder.y = val.y; + } } else { - r = __pVisualElement->RemoveAnimation(animName); + Rectangle rectVal(0, 0, 0, 0); + + if (animationBase.IsAutoReverseEnabled() == false) + { + rectVal = pRectAnim->GetEndValue(); + __logicalBoundsHolder.x = rectVal.x; + __logicalBoundsHolder.y = rectVal.y; + } } + } + break; - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Animation is either running or already removed."); + default: + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); + return E_SYSTEM; + } + break; } } - return r; } @@ -2415,36 +2675,15 @@ _ControlAnimatorImpl::AddControlAnimatorDetailedEventListener(const IControlAnim result _ControlAnimatorImpl::RemoveControlAnimatorDetailedEventListener(const IControlAnimatorDetailedEventListener& listener) -{ - result r = E_SYSTEM; - - if (__pAnimDetailedEventListener) - { - return __pAnimDetailedEventListener->Remove((const_cast< IControlAnimatorDetailedEventListener* >(&listener))); - } - - return r; -} - -int -_ControlAnimatorImpl::GetActiveAnimationIndex(const String& animName) const -{ - result r = E_SUCCESS; - - for (int index = 0; index < __pActiveAnimationList->GetCount(); index++) - { - ActiveAnimation activeAnim; - - r = __pActiveAnimationList->GetAt(index, activeAnim); - SysTryReturn(NID_UI_ANIM, (r == E_SUCCESS), -1, r, "[%s] Failed to retrieve animation from the list.", GetErrorMessage(r)); - - if (activeAnim.animName == animName) - { - return index; - } +{ + result r = E_SYSTEM; + + if (__pAnimDetailedEventListener) + { + return __pAnimDetailedEventListener->Remove((const_cast< IControlAnimatorDetailedEventListener* >(&listener))); } - return -1; + return r; } result @@ -2509,603 +2748,356 @@ _ControlAnimatorImpl::SetAnimationTargetStatus(ControlAnimatorTriggerType trigge AnimationTargetType _animTarget = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); SysTryReturnResult(NID_UI_ANIM, ((_animTarget > ANIMATION_TARGET_NONE) && (_animTarget < ANIMATION_TARGET_MAX)), E_INVALID_ARG, "Invalid argument(s) is used. animTarget is invalid."); + __isAnimationTargetAnimating[_animTarget] = true; if (_animTarget == ANIMATION_TARGET_POSITION || _animTarget == ANIMATION_TARGET_SIZE || _animTarget == ANIMATION_TARGET_ALPHA) { AnimationBase* pAnimationBase = null; - pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); - if (pAnimationBase) - { - if (_animTarget == ANIMATION_TARGET_ALPHA) - { - SetControlShowState(_animTarget, *pAnimationBase); - } - else - { - SetControlLogicalBounds(_animTarget, *pAnimationBase); - } - - delete pAnimationBase; - } - } - } - } - } - else if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL) - { - pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); - if (pParallelAnimGrp) - { - for (int index = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); index < (static_cast< int >(ANIMATION_TARGET_MAX)); index++) - { - AnimationTargetType _animTarget = static_cast< AnimationTargetType >(index); - AnimationBase* pAnimBase = null; - - pAnimBase = pParallelAnimGrp->GetAnimationN(_animTarget); - if (pAnimBase != null) - { - SysTryReturnResult(NID_UI_ANIM, ((_animTarget > ANIMATION_TARGET_NONE) && (_animTarget < ANIMATION_TARGET_MAX)), - E_INVALID_ARG, "Invalid argument(s) is used. animTarget is invalid."); - __isAnimationTargetAnimating[_animTarget] = true; - - if (_animTarget == ANIMATION_TARGET_POSITION || _animTarget == ANIMATION_TARGET_SIZE) - { - SetControlLogicalBounds(_animTarget, *pAnimBase); - } - else if (_animTarget == ANIMATION_TARGET_ALPHA) - { - SetControlShowState(_animTarget, *pAnimBase); - } - - delete pAnimBase; - } - } - } - } - //Set Target status playing in case of platform defined Implicit animations - else - { - if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) - { - __isAnimationTargetAnimating[ANIMATION_TARGET_POSITION] = true; - } - - if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) - { - __isAnimationTargetAnimating[ANIMATION_TARGET_SIZE] = true; - } - - if (triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE) - { - __isAnimationTargetAnimating[ANIMATION_TARGET_ALPHA] = true; - } - } - - return r; -} - -result -_ControlAnimatorImpl::SetKeyFrameAnimation(AnimationTargetType animTarget, AnimationBase* pAnimationBase, const IVisualElementAnimationTimingFunction* pTimingFunction, VisualElementAnimation* pAnimation) -{ - long keyTime = 0; - result r = E_SUCCESS; - - VisualElementValueAnimation* pPropertyAnimation = dynamic_cast< VisualElementValueAnimation* >(pAnimation); - SysTryReturnResult(NID_UI_ANIM, (pPropertyAnimation != null), E_INVALID_ARG, "Invalid argument(s) is used. VisualElementAnimation is null."); - - switch (animTarget) - { - - case ANIMATION_TARGET_SIZE: - { - DimensionAnimation* pDimensionAnim = null; - RectangleAnimation* pRectangleAnim = null; - - pDimensionAnim = dynamic_cast< DimensionAnimation* >(pAnimationBase); - pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, ((pDimensionAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - Dimension controlSize; - float anchorX = 0.0f; - float anchorY = 0.0f; - - controlSize = __pControl->GetSize(); - - if (pDimensionAnim) - { - Dimension dimValue(0, 0); - - pDimensionAnim->GetAnchor(anchorX, anchorY); - - for (int index = 0; index < pDimensionAnim->GetKeyFrameCount(); index++) - { - pDimensionAnim->GetKeyFrameAt(index, keyTime, dimValue); - - if (keyTime < pDimensionAnim->GetDuration()) - { - FloatRectangle modelBounds = __pVisualElement->GetBounds(); - FloatRectangle presentationBounds = const_cast((__pVisualElement)->AcquirePresentationInstance())->GetBounds(); - __pVisualElement->ReleasePresentationInstance(); - - float currentAnchorX = presentationBounds.width * anchorX; - float currentAnchorY = presentationBounds.height * anchorY; - float endAnchorX = dimValue.width * anchorX; - float endAnchorY = dimValue.height * anchorY; - - float endX = modelBounds.x + (currentAnchorX - endAnchorX); - float endY = modelBounds.y + (currentAnchorY - endAnchorY); - - Variant keyValue(FloatRectangle(endX, endY, static_cast< float >(dimValue.width), static_cast< float >(dimValue.height))); - - r = pPropertyAnimation->AddKeyFrame(keyTime / static_cast< float >(pDimensionAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); - } - } - } - else //if (pRectangleAnim) - { - Rectangle dimValue(0, 0, 0, 0); - - pRectangleAnim->GetAnchor(anchorX, anchorY); - - for (int index = 0; index < pRectangleAnim->GetKeyFrameCount(); index++) - { - pRectangleAnim->GetKeyFrameAt(index, keyTime, dimValue); - - if (keyTime < pRectangleAnim->GetDuration()) - { - FloatRectangle modelBounds = __pVisualElement->GetBounds(); - FloatRectangle presentationBounds = const_cast((__pVisualElement)->AcquirePresentationInstance())->GetBounds(); - __pVisualElement->ReleasePresentationInstance(); - - float currentAnchorX = presentationBounds.width * anchorX; - float currentAnchorY = presentationBounds.height * anchorY; - float endAnchorX = dimValue.width * anchorX; - float endAnchorY = dimValue.height * anchorY; - - float endX = modelBounds.x + (currentAnchorX - endAnchorX); - float endY = modelBounds.y + (currentAnchorY - endAnchorY); - - Variant keyValue(FloatRectangle(endX, endY, static_cast< float >(dimValue.width), static_cast< float >(dimValue.height))); - r = pPropertyAnimation->AddKeyFrame(keyTime / static_cast< float >(pRectangleAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); - } - } - } - } - break; - - case ANIMATION_TARGET_POSITION: - { - PointAnimation* pPointAnim = null; - RectangleAnimation* pRectangleAnim = null; - - pPointAnim = dynamic_cast< PointAnimation* >(pAnimationBase); - pRectangleAnim = dynamic_cast< RectangleAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, ((pPointAnim) || (pRectangleAnim)), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - Point controlPos; - Rectangle clientBounds = __pControlImpl->GetParent()->GetClientBounds(); - FloatRectangle modelBounds = __pVisualElement->GetBounds(); - - controlPos = __pControl->GetPosition(); - - if (pPointAnim) - { - Point pointValue(0, 0); - Point prevPointValue = controlPos; - - for (int index = 0; index < pPointAnim->GetKeyFrameCount(); index++) - { - pPointAnim->GetKeyFrameAt(index, keyTime, pointValue); - - - if (keyTime < pPointAnim->GetDuration()) - { - float absPointX = (static_cast< float >(clientBounds.x) + static_cast< float >(pointValue.x)); - float absPointY = (static_cast< float >(clientBounds.y) + static_cast< float >(pointValue.y)); - - Variant keyValue(FloatPoint(absPointX, absPointY)); - - r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pPointAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); - } - - } - } - else //if (pRectangleAnim) - { - Rectangle pointValue(0, 0, 0, 0); - Rectangle prevPointValue = Rectangle(controlPos.x, controlPos.y, 0, 0); - - for (int index = 0; index < pRectangleAnim->GetKeyFrameCount(); index++) - { - pRectangleAnim->GetKeyFrameAt(index, keyTime, pointValue); - - if (keyTime < pRectangleAnim->GetDuration()) - { - float absPointX = (static_cast< float >(clientBounds.x) + static_cast< float >(pointValue.x)); - float absPointY = (static_cast< float >(clientBounds.y) + static_cast< float >(pointValue.y)); - - Variant keyValue(FloatPoint(absPointX, absPointY)); - - r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pRectangleAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); - } - } - } - } - break; - - case ANIMATION_TARGET_ALPHA: - { - IntegerAnimation* pIntegerAnim = null; - FloatAnimation* pFloatAnim = null; - - pIntegerAnim = dynamic_cast< IntegerAnimation* >(pAnimationBase); - pFloatAnim = dynamic_cast< FloatAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, (pIntegerAnim || pFloatAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - if (pIntegerAnim) - { - int alphaIntValue = 0; - - for (int index = 0; index < pIntegerAnim->GetKeyFrameCount(); index++) - { - pIntegerAnim->GetKeyFrameAt(index, keyTime, alphaIntValue); - - if (keyTime < pIntegerAnim->GetDuration()) - { - Variant keyValue(static_cast< float >(alphaIntValue)); - - r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pIntegerAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); + if (pAnimationBase) + { + if (_animTarget == ANIMATION_TARGET_ALPHA) + { + SetControlShowState(_animTarget, *pAnimationBase); + } + else + { + SetControlLogicalBounds(_animTarget, *pAnimationBase); + } + delete pAnimationBase; + } } } } - else //if (pFloatAnim) + } + else if (__propertyAnimationGroupType[triggerType - 1] == PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL) + { + pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(__pPropertyAnimationGroupList[triggerType - 1]); + if (pParallelAnimGrp) { - float alphaFltValue = 0.0; - - for (int index = 0; index < pFloatAnim->GetKeyFrameCount(); index++) + for (int index = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); index < (static_cast< int >(ANIMATION_TARGET_MAX)); index++) { - pFloatAnim->GetKeyFrameAt(index, keyTime, alphaFltValue); + AnimationTargetType _animTarget = static_cast< AnimationTargetType >(index); + AnimationBase* pAnimBase = null; - if (keyTime < pFloatAnim->GetDuration()) + pAnimBase = pParallelAnimGrp->GetAnimationN(_animTarget); + if (pAnimBase != null) { - Variant keyValue(static_cast< float >(alphaFltValue)); + SysTryReturnResult(NID_UI_ANIM, ((_animTarget > ANIMATION_TARGET_NONE) && (_animTarget < ANIMATION_TARGET_MAX)), + E_INVALID_ARG, "Invalid argument(s) is used. animTarget is invalid."); + __isAnimationTargetAnimating[_animTarget] = true; - r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pFloatAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); + if (_animTarget == ANIMATION_TARGET_POSITION || _animTarget == ANIMATION_TARGET_SIZE) + { + SetControlLogicalBounds(_animTarget, *pAnimBase); + } + else if (_animTarget == ANIMATION_TARGET_ALPHA) + { + SetControlShowState(_animTarget, *pAnimBase); + } + + delete pAnimBase; } } } } - break; - - case ANIMATION_TARGET_ROTATION: + //Set Target status playing in case of platform defined Implicit animations + else { - RotateAnimation* pRotateAnim = null; - - pRotateAnim = dynamic_cast< RotateAnimation* >(pAnimationBase); - SysTryReturnResult(NID_UI_ANIM, (pRotateAnim), E_INVALID_ARG, "Invalid argument(s) is used. Animation is invalid."); - - float rotateFltValue = 0; - - for (int index = 0; index < pRotateAnim->GetKeyFrameCount(); index++) + if (triggerType == ANIMATION_TRIGGER_POSITION_CHANGE) { - pRotateAnim->GetKeyFrameAt(index, keyTime, rotateFltValue); + __isAnimationTargetAnimating[ANIMATION_TARGET_POSITION] = true; + } - if (keyTime < pRotateAnim->GetDuration()) - { - Variant keyValue(rotateFltValue); + if (triggerType == ANIMATION_TRIGGER_SIZE_CHANGE) + { + __isAnimationTargetAnimating[ANIMATION_TARGET_SIZE] = true; + } - r = pPropertyAnimation->AddKeyFrame(static_cast< float >(keyTime) / static_cast< float >(pRotateAnim->GetDuration()), keyValue, const_cast< IVisualElementAnimationTimingFunction* >(pTimingFunction)); - SysTryReturnResult(NID_UI_ANIM, (r == E_SUCCESS), E_SYSTEM, "A system error has been occurred. Failed to add key frame."); - } + if (triggerType == ANIMATION_TRIGGER_SHOW_STATE_CHANGE) + { + __isAnimationTargetAnimating[ANIMATION_TARGET_ALPHA] = true; } } - break; - default: + return r; +} + +void +_ControlAnimatorImpl::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ + ActiveAnimation activeAnim; + int index = -1; + String animName(0); + + if (keyName.IsEmpty() == true) { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. animTarget is invalid."); - return E_SYSTEM; + String* pUserData = (String*) (animation.GetUserData()); + if (pUserData != null) + { + animName = *pUserData; + } } - break; + else + { + animName = keyName; } - return E_SUCCESS; -} + index = GetActiveAnimationIndex(animName); -result -_ControlAnimatorImpl::SetGroupAnimation(AnimationGroup* pAnimGrp) -{ - result r = E_SUCCESS; - ParallelAnimationGroup* pParallelAnimGrp = null; - SequentialAnimationGroup* pSequentialAnimGrp = null; - AnimationTargetType animTargetArray[ANIMATION_TARGET_MAX] = + if (index == -1) { - ANIMATION_TARGET_ROTATION, - ANIMATION_TARGET_SIZE, - ANIMATION_TARGET_POSITION, - ANIMATION_TARGET_ALPHA - }; - bool setLogicalBnds = false; - bool setShowStateInternal = false; - long delay = 0; - long duration = 0; - long totalDelay = 0; - long groupDuration = 0; - VisualElementAnimationGroup* pAnimationGroup = null; - String animIdentifier; - int activeAnimationCount = GetActiveAnimationListCount(); + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); + return; + } - pParallelAnimGrp = dynamic_cast< ParallelAnimationGroup* >(pAnimGrp); - pSequentialAnimGrp = dynamic_cast< SequentialAnimationGroup* >(pAnimGrp); - SysTryReturnResult(NID_UI_ANIM, ((pParallelAnimGrp) || (pSequentialAnimGrp)), E_INVALID_ARG, "Invalid argument(s) is used. AnimationGroup argument is invalid."); + if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); + return; + } - __sequelDelay = 0; - pAnimationGroup = new (std::nothrow) VisualElementAnimationGroup(); - SysTryReturnResult(NID_UI_ANIM, (pAnimationGroup != null), E_OUT_OF_MEMORY, "Memory allocation failed."); + __isAnimationTargetAnimating[activeAnim.animTarget] = true; - animIdentifier.Append(__animId); - animIdentifier.Append(GROUP); - __animId++; - __groupName.Clear(); - __groupName = animIdentifier; + int startIndex = 0; + int indexOf = 0; - if (pParallelAnimGrp) + if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) { - for (int target = (static_cast< int >(ANIMATION_TARGET_NONE) + 1); target < (static_cast< int >(ANIMATION_TARGET_MAX)); target++) + //Calling simple listeners registered in this control animator + if (__pAnimStatusEventListener) { - AnimationTargetType animTarget = animTargetArray[target]; - AnimationBase* pAnimationBase = null; - pAnimationBase = pParallelAnimGrp->GetAnimationN(animTarget); - - if (pAnimationBase != null) + IControlAnimatorEventListener* pEventListener = null; + for (int count = (__pAnimStatusEventListener->GetCount() - 1); count >= 0; count--) { - long duration = pAnimationBase->GetDuration(); - - if (pAnimationBase->IsAutoReverseEnabled()) - { - duration = duration * 2; - } - - duration = (duration * pAnimationBase->GetRepeatCount() * pAnimationBase->GetScaleRatio()) + ((pAnimationBase->GetDelay() - pAnimationBase->GetOffset()) * pAnimationBase->GetScaleRatio()); - - if (duration > groupDuration) - { - groupDuration = duration; - } - - if (IsAnimationSupported() == false) - { - r = SetControlProperty(animTarget, *pAnimationBase); - delete pAnimationBase; - - SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store animation values."); - } - else + __pAnimStatusEventListener->GetAt(count, pEventListener); + if (pEventListener) { - if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_POSITION) || - pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_SIZE)) - { - __logicalBoundsHolder = __pControl->GetBounds(); - setLogicalBnds = true; - } - else if (pParallelAnimGrp->IsAnimationAdded(ANIMATION_TARGET_ALPHA)) - { - __showStateHolder = __pControl->GetShowState(); - setShowStateInternal = true; - } - - r = SetAnimation(animTarget, *pAnimationBase, ANIMATION_TRIGGER_USER, pAnimationGroup); - - if (r != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start animation."); - goto CATCH; - } - - __isAnimationTargetAnimating[animTarget] = true; - - if (animTarget == ANIMATION_TARGET_POSITION || animTarget == ANIMATION_TARGET_SIZE) - { - SetControlLogicalBounds(animTarget, *pAnimationBase); - } - else if (animTarget == ANIMATION_TARGET_ALPHA) - { - SetControlShowState(animTarget, *pAnimationBase); - } + pEventListener->OnControlAnimationStarted(*__pControlAnimator, *__pControl); } } } - } - else - { - __prevAnimationBoundsHolder = __pControl->GetBounds(); - for (int index = 0; index < pSequentialAnimGrp->GetAnimationCount(); index++) + //calling detailed event listerners registered in this control animator + if (__pAnimDetailedEventListener) { - AnimationTargetType animTarget = ANIMATION_TARGET_MAX; - AnimationBase* pAnimationBase = null; - pAnimationBase = pSequentialAnimGrp->GetAnimationAtN(index); - animTarget = pSequentialAnimGrp->GetAnimationTargetTypeAt(index); + IControlAnimatorDetailedEventListener* pDetailedEventListener = null; - if (pAnimationBase != null) + for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) { - if (IsAnimationSupported() == false) - { - r = SetControlProperty(animTarget, *pAnimationBase); - delete pAnimationBase; + __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); - SysTryCatch(NID_UI_ANIM, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store animation values."); - } - else + if (pDetailedEventListener) { - if ((pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_POSITION) || - (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_SIZE)) - { - __logicalBoundsHolder = __pControl->GetBounds(); - setLogicalBnds = true; - } - - if (pSequentialAnimGrp->GetAnimationTargetTypeAt(index) == ANIMATION_TARGET_ALPHA) - { - __showStateHolder = __pControl->GetShowState(); - setShowStateInternal = true; - } + pDetailedEventListener->OnControlAnimationStarted(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); + } + } + } + } +} - if (animTarget == ANIMATION_TARGET_SIZE) - { - r = SetPrevAnimationBoundsProperty(animTarget, *pAnimationBase); +void +_ControlAnimatorImpl::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ + ActiveAnimation activeAnim; + int index = -1; + String animName(0); - if (r != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to store previous animation bounds."); - delete pAnimationBase; + if (keyName.IsEmpty() == true) + { + String* pUserData = (String*) (animation.GetUserData()); - goto CATCH; - } - } + if (pUserData != null) + { + animName = *pUserData; + } + } + else + { + animName = keyName; + } - __sequentialGroupAnimation = true; - //Add the animation to the group - r = SetAnimation(animTarget, *pAnimationBase, ANIMATION_TRIGGER_USER, pAnimationGroup); - __sequentialGroupAnimation = false; + index = GetActiveAnimationIndex(animName); + if (index == -1) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); + return; + } - if (pAnimationBase->IsAutoReverseEnabled() == true) - { - duration = 2 * pAnimationBase->GetDuration(); - } - else - { - duration = pAnimationBase->GetDuration(); - } + if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); + return; + } - delay = pAnimationBase->GetDelay(); - totalDelay = delay + duration * pAnimationBase->GetRepeatCount(); - totalDelay = totalDelay - (pAnimationBase->GetOffset()); - __sequelDelay = totalDelay; - groupDuration = groupDuration + __sequelDelay * pAnimationBase->GetScaleRatio(); + int startIndex = 0; + int indexOf = 0; - if (r != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start animation."); - goto CATCH; - } + if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) + { + if (__pAnimDetailedEventListener) + { + IControlAnimatorDetailedEventListener* pDetailedEventListener = null; - __isAnimationTargetAnimating[animTarget] = true; + for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) + { + __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); - if (animTarget == ANIMATION_TARGET_POSITION || animTarget == ANIMATION_TARGET_SIZE) - { - SetControlLogicalBounds(animTarget, *pAnimationBase); - } - else if (animTarget == ANIMATION_TARGET_ALPHA) - { - SetControlShowState(animTarget, *pAnimationBase); - } + if (pDetailedEventListener) + { + pDetailedEventListener->OnControlAnimationRepeated(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase, currentRepeatCount); } } } } +} - if (setLogicalBnds) +void +_ControlAnimatorImpl::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + String animName(0); + + if (keyName.IsEmpty() == true) { - bool disable = false; - bool propagation = false; + String* pUserData = (String*) (animation.GetUserData()); - result r = DisableImplicitAnimation(disable); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable implicit animation."); - //if (pParallelAnimGrp == null) + if (pUserData != null) { - r = DisableVisualElementPropagation(propagation); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable visual element propagation."); + animName = *pUserData; + delete pUserData; + pUserData = null; } - r = __pControl->SetBounds(__logicalBoundsHolder); + } + else + { + animName = keyName; + } - if (propagation) - { - DisableVisualElementPropagation(propagation); - } - if (disable) - { - DisableImplicitAnimation(disable); - } + _VisualElementImpl* pPresentationImpl = _VisualElementImpl::GetInstance(*const_cast(__pVisualElement->AcquirePresentationInstance())); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set bounds."); + if (pPresentationImpl == null) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Screen is not updated with end values."); } - - if (setShowStateInternal) + else { - bool disable = false; - bool propagation = false; + VisualElementValueAnimation* pValueAnimation = dynamic_cast< VisualElementValueAnimation* >(const_cast< VisualElementAnimation* >(&animation)); + VisualElementPropertyAnimation* pAnimation = dynamic_cast< VisualElementPropertyAnimation* >(const_cast< VisualElementAnimation* >(&animation)); - result r = DisableImplicitAnimation(disable); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable implicit animation."); + if (completedNormally == false || (pValueAnimation && pValueAnimation->IsEndValueApplied() == false)) + { + if (pAnimation) + { + String propName = pAnimation->GetPropertyName(); - r = DisableVisualElementPropagation(propagation); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to disable/enable visual element propagation."); + int startIndex = 0; + int indexOf = 0; + result r = E_SUCCESS; - r = __pControl->SetShowState(__showStateHolder); + if ((propName.IndexOf(VeSubPropBoundsPosition, startIndex, indexOf)) == E_SUCCESS) + { + r = pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); + } + else if ((propName.IndexOf(VePropBounds, startIndex, indexOf)) == E_SUCCESS) + { + r = pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); + } + else if ((propName.IndexOf(VeSubPropTransformRotationZ, startIndex, indexOf)) == E_SUCCESS) + { + r = pPresentationImpl->SetProperty(VePropTransform, __pVisualElement->GetTransformMatrix()); + } + else if ((propName.IndexOf(VePrivPropShowOpacity, startIndex, indexOf)) == E_SUCCESS) + { + r = pPresentationImpl->SetProperty(VePropShowState, __pVisualElement->GetShowState()); + } - if (propagation) - { - DisableVisualElementPropagation(propagation); - } - if (disable) - { - DisableImplicitAnimation(disable); + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Screen is not updated with end values."); + } + } + else if (pValueAnimation) + { + pPresentationImpl->SetProperty(VePropBounds, __pVisualElement->GetBounds()); + } } - - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to set show state."); } - // for layout - __pControlImpl->SetBoundsAndUpdateLayout(__pControlImpl->GetBounds()); + __pVisualElement->ReleasePresentationInstance(); - pAnimationGroup->SetDuration(groupDuration); - r = __pVisualElement->AddAnimation(animIdentifier, *pAnimationGroup); - SysTryCatch(NID_UI_ANIM, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to start group animation."); + ActiveAnimation activeAnim; + int index = -1; - delete pAnimationGroup; - return r; + index = GetActiveAnimationIndex(animName); -CATCH: - //check clean up - delete pAnimationGroup; + if (index == -1) + { + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation name mismatch in the playlist."); + return; + } - if (DestroyAnimation(activeAnimationCount) != E_SUCCESS) + if (__pActiveAnimationList->GetAt(index, activeAnim) != E_SUCCESS) { - SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Failed to deallocate memory."); - return E_SYSTEM; + SysLogException(NID_UI_ANIM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Animation is not present in the playlist."); + return; } - return r; -} + int startIndex = 0; + int indexOf = 0; -result -_ControlAnimatorImpl::DisableImplicitAnimation(bool& state) -{ - bool enable = __pVisualElement->IsImplicitAnimationEnabled(); - __pVisualElement->SetImplicitAnimationEnabled(state); - state = enable; + __isAnimationTargetAnimating[activeAnim.animTarget] = false; - return E_SUCCESS; -} + if ((animName.IndexOf(TRANSACTION, startIndex, indexOf)) != E_SUCCESS) + { + if (__pAnimStatusEventListener) + { + IControlAnimatorEventListener* pCaEventListener = null; -result -_ControlAnimatorImpl::DisableVisualElementPropagation(bool& state) -{ - bool propagate = _VisualElementImpl::GetInstance(*__pVisualElement)->GetPropertyPropagationEnabled(); - result r = _VisualElementImpl::GetInstance(*__pVisualElement)->SetPropertyPropagationEnabled(state); - state = propagate; + for (int count = (__pAnimStatusEventListener->GetCount() - 1); count >= 0; count--) + { + __pAnimStatusEventListener->GetAt(count, pCaEventListener); + if (pCaEventListener) + { + if (completedNormally) + { + pCaEventListener->OnControlAnimationFinished(*__pControlAnimator, *__pControl); + } + else + { + pCaEventListener->OnControlAnimationStopped(*__pControlAnimator, *__pControl); + } + } + } + } - return r; + //Calling detailed event listeners + if (__pAnimDetailedEventListener) + { + IControlAnimatorDetailedEventListener* pDetailedEventListener = null; + + for (int count = (__pAnimDetailedEventListener->GetCount() - 1); count >= 0; count--) + { + __pAnimDetailedEventListener->GetAt(count, pDetailedEventListener); + + if (pDetailedEventListener) + { + if (completedNormally) + { + pDetailedEventListener->OnControlAnimationFinished(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); + } + else + { + pDetailedEventListener->OnControlAnimationStopped(*__pControlAnimator, *__pControl, activeAnim.animType, activeAnim.animTarget, activeAnim.pAnimationBase); + } + } + } + } + } + + RemoveAnimationAt(index); } void diff --git a/src/ui/animations/FUiAnim_ControlAnimatorImpl.h b/src/ui/animations/FUiAnim_ControlAnimatorImpl.h index afc7e3a..e898593 100644 --- a/src/ui/animations/FUiAnim_ControlAnimatorImpl.h +++ b/src/ui/animations/FUiAnim_ControlAnimatorImpl.h @@ -36,27 +36,10 @@ namespace Tizen { namespace Ui { namespace Animations { + class VisualElement; class BezierTimingFunction; -/** - * @enum AnimationFormPosition - * Defines the Form's position, either current or Next Form - * @since 2.0 - */ -enum AnimationFormPosition -{ - ANIMATION_FORM_POSITION_CURRENT_FORM = 0, /**< Current Form*/ - ANIMATION_FORM_POSITION_NEXT_FORM /**< Next Form */ -}; - -enum StoredPropertyAnimationGroupType -{ - PROPERTY_ANIMATION_GROUP_TYPE_NONE, - PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL, - PROPERTY_ANIMATION_GROUP_TYPE_SEQUENTIAL -}; - #define INTERPOLATOR_LINEAR L"Linear" #define INTERPOLATOR_EASEIN L"EaseIn" #define INTERPOLATOR_EASEOUT L"EaseOut" @@ -64,688 +47,171 @@ enum StoredPropertyAnimationGroupType #define INTERPOLATOR_DISCRETE L"Discrete" #define INTERPOLATOR_BEZIER L"Bezier" +enum StoredPropertyAnimationGroupType +{ + PROPERTY_ANIMATION_GROUP_TYPE_NONE, + PROPERTY_ANIMATION_GROUP_TYPE_PARALLEL, + PROPERTY_ANIMATION_GROUP_TYPE_SEQUENTIAL +}; -/** - * @class _ControlAnimatorImpl - * @brief This class defines the animation API for Control - * @since 2.0 - * - * The %_ControlAnimatorImpl class is used to control the animations operated on Tizen::UiControls - * - */ class _ControlAnimatorImpl : public Tizen::Base::Object , public Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener - , virtual public Tizen::Base::Runtime::IEventListener , public Tizen::Ui::Animations::IVisualElementAnimationTickEventListener + , virtual public Tizen::Base::Runtime::IEventListener { public: - /** - * Destructor for %_ControlAnimatorImpl class. - * - * @since 2.0 - */ + _ControlAnimatorImpl(ControlAnimator* pAnimator); ~_ControlAnimatorImpl(void); - /** - * Default constructor for %_ControlAnimatorImpl class. - * - * @since 2.0 - */ - _ControlAnimatorImpl(ControlAnimator* pAnimator); + _ControlAnimatorImpl(const _ControlAnimatorImpl& rhs); + _ControlAnimatorImpl& operator =(const _ControlAnimatorImpl& rhs); - /** - * Initializes this %_ControlAnimatorImpl class. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_STATE This instance has already been constructed. - * @exception E_OUT_OF_MEMORY Insufficient memory. - * @exception E_SYSTEM System error occurred. - */ result Construct(const Control& control); + result Dispose(void); - /** - * Adds the %Animation to the ActiveAnimation List. - * - * @since 2.0 - * @return An error code - * @param[in] animTarget %AnimationTarget - * @param[in] animBase An object of %AnimationBase - * @param[in] animNative An object of _Animation - * @param[in] triggerType Trigger type - * @param[in] animName Animation name (unique Id) - * @param[in] pBezierTiming Bezier timing function. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ - result AddActiveAnimation(AnimationTargetType animTarget, AnimationBase& animBase, Tizen::Ui::Animations::VisualElementAnimation& animNative, ControlAnimatorTriggerType triggerType, const Tizen::Base::String& animName, BezierTimingFunction* pBezierTiming); + bool IsAnimationSupported(void) const; - /** - * This is the copy constructor for this class. - * - * @since 2.0 - * @param[in] animator Object to be copied - */ - _ControlAnimatorImpl(const _ControlAnimatorImpl& rhs); + result SetAnimation(AnimationTargetType animTarget, AnimationBase& animationBase, ControlAnimatorTriggerType animType = ANIMATION_TRIGGER_USER, VisualElementAnimationGroup* pAnimGroup = null); + result SetKeyFrameAnimation(AnimationTargetType animTarget, AnimationBase* pAnimationBase, const IVisualElementAnimationTimingFunction* pTimingFunction, VisualElementAnimation* pAnimation); + result SetGroupAnimation(AnimationGroup* pAnimGrp); - /** - * Gets the %Animation Name from the ActiveAnimation List attached against specified %AnimationTarget. - * - * @since 2.0 - * @return Animation name - * @param[in] index Value at the index to be retrieved - */ - Tizen::Base::String GetActiveAnimationAt(int index) const; + result StartCustomImplicitAnimation(ControlAnimatorTriggerType triggerType, int x, int y, int width, int height, bool showState); + result SetCustomImplicitAnimationParams(ControlAnimatorTriggerType triggerType, AnimationBase& animationBase, Tizen::Graphics::Rectangle& bounds, bool showState, bool lastTargetOccurence = false); - /** - * Gets the %Animation from the ActiveAnimation List attached against specified %AnimationTarget. - * - * @since 2.0 - * @return Animation Name - * @param[in] index Value at the index to be retrieved - * @param[in] animTrigger %ControlAnimatorTriggerType - */ + result AddActiveAnimation(AnimationTargetType animTarget, AnimationBase& animBase, Tizen::Ui::Animations::VisualElementAnimation& animNative, ControlAnimatorTriggerType triggerType, const Tizen::Base::String& animName, BezierTimingFunction* pBezierTiming); + Tizen::Base::String GetActiveAnimationAt(int index) const; Tizen::Base::String GetActiveAnimationAt(int index, ControlAnimatorTriggerType animTrigger) const; - - /** - * Destroys the %Animation Name from the ActiveAnimation List after the specified %index - * - * @since 2.0 - * @return An error code - * @param[in] preActiveAnimationCount ActiveAnimationCount - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ - result DestroyAnimation(int preActiveAnimationCount); - - /** - * Destroys the %Animation from the ActiveAnimation List after the specified %index - * - * @since 2.0 - * @return An error code - * @param[in] animTarget AnimationTargetType - * @param[in] pAnimBase An object of %AnimationBase - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ - result DestroyAnimation(AnimationBase& animBase, AnimationTargetType animTarget); - - /** - * Gets the ActiveAnimation Count of type the ANimationTarget - * - * @since 2.0 - * @return Total number of ActiveAnimations added to the list - */ + int GetActiveAnimationIndex(const Tizen::Base::String& animName) const; int GetActiveAnimationListCount(AnimationTargetType animTarget) const; - - /** - * Gets the ActiveAnimation Count value - * - * @since 2.0 - * @return Total number of ActiveAnimations added to the list - */ int GetActiveAnimationListCount(void) const; - /** - * Removes the %Animation from the ActiveAnimation List at specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index Values at the index to be retrieved - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveAnimationAt(int index); - - /** - * Removes all the %Animation from the ActiveAnimation List. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveAllAnimations(void); - /** - * Sets an %Animation to a internal Layer. - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Property to be animated. - * @param[in] animationBase An object of type %AnimationBase. - * @param[in] animType ControlAnimatorTriggerType - * @param[in] pAnimGroup Animation Group object for sequence and parallel group animation - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified parameter is invalid. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. - * @exception E_SYSTEM A system error occurred. - * - */ - result SetAnimation(AnimationTargetType animTarget, AnimationBase& animationBase, ControlAnimatorTriggerType animType = ANIMATION_TRIGGER_USER, VisualElementAnimationGroup* pAnimGroup = null); + result DestroyAnimation(int preActiveAnimationCount); + result DestroyAnimation(AnimationBase& animBase, AnimationTargetType animTarget); - /** - * Returns a copy of %AnimationBase object. - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Property to be animated. - * @param[in] animationBase An object of type %AnimationBase whose copy is to be created - * @exception null If the passed argument is invalid. - */ - AnimationBase* CloneAnimation(AnimationTargetType animTarget, AnimationBase& animationBase); + result StopAllAnimations(void); + result StopAnimation(ControlAnimatorTriggerType animTrigger); - /** - * Sets the property of the object with specified input - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Enumeration of animation target type - * @param[in] animationBase An instance of %AnimationBase object - */ - result SetControlProperty(AnimationTargetType animTarget, AnimationBase& animationBase); + AnimationBase* CloneAnimation(AnimationTargetType animTarget, AnimationBase& animationBase); - /** - * Checks for the property change is valid on a control - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Enumeration of animation target type - * @param[in] rect Bounds of a %Control - * @param[in] pAnimationBase Animation base object - * @param[in] animTrigger Animation trigger type - * @remarks %This function returns whether property is changeable or not. @n - * If @c true, property can be changed. @n - * If @c false, property cannot be changed. - */ bool IsAnimatable(AnimationTargetType animTarget, Tizen::Graphics::Rectangle& rect, AnimationBase* pAnimationBase = null , ControlAnimatorTriggerType animTrigger = ANIMATION_TRIGGER_USER) const; - /** - * Starts the custom implicit %animation - * - * @since 2.0 - * @return An error code - * @param[in] animTrigger %AnimationTriggerType - * @param[in] x x position of control - * @param[in] y y position of control - * @param[in] width width of control - * @param[in] height height of control - * @param[in] showState showState of Control - * - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified parameter is invalid. - * @exception E_SYSTEM A system error occurred. - */ - result StartCustomImplicitAnimation(ControlAnimatorTriggerType triggerType, int x, int y, int width, int height, bool showState); - - /** - * Sets the Custom Implicit Animation parameters - * - * @since 2.0 - * @return An error code - * @param[in] triggerType %AnimationTriggerType - * @param[in] animationBase %AnimationBase object - * @param[in] bounds %Bounds of the %Control overwritten with corresponding new custom animation values - * @param[in] showState %showState of the %Control overwritten with corresponding new custom animation values - * @param[in] lastTargetOccurence variable to find whether the Animation attached against the equivalent AnimationTarget is the last one in the list or not - * - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified parameter is invalid. - * @exception E_SYSTEM A system error occurred. - */ - result SetCustomImplicitAnimationParams(ControlAnimatorTriggerType triggerType, AnimationBase& animationBase, Tizen::Graphics::Rectangle& bounds, bool showState, bool lastTargetOccurence = false); - /** - * returns whether animation supported by underlying platform or not - * - * @since 2.0 - * @return An error code - * @remarks %This function returns whether animation is supported or not. @n - * If @c true, animation supported. @n - * If @c false, animation not supported. - */ - bool IsAnimationSupported(void) const; - - /** - * Sets the property of the Control with specified input - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Enumeration of animation target type - * @param[in] animationBase An instance of %AnimationBase object - */ - result SetControlLogicalBounds(AnimationTargetType animTarget, AnimationBase& animationBase); - - /** - * Sets the property of the Control with specified input - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Enumeration of animation target type - * @param[in] animationBase An instance of %AnimationBase object - */ - result SetControlShowState(AnimationTargetType animTarget, AnimationBase& animationBase); - - /** - * This function will be called to Stop All Animations - * - * @since 2.0 - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified parameter is invalid. - * @exception E_SYSTEM A system error occurred. - */ - result StopAllAnimations(void); - - /** - * This function will be called to Stop an animation based on trigger type - * - * @since 2.0 - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified parameter is invalid. - * @exception E_SYSTEM A system error occurred. - */ - result StopAnimation(ControlAnimatorTriggerType animTrigger); - - /** - * Delete & frees the memory used by the object - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM Failed to free the resource possessed by this instance. - */ - result Dispose(void); - - /** - * Adds the Control animator event listener to the listeners list. - * - * @since 2.0 - * @return An error code - * @param[in] listener Control animator event listener - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result AddControlAnimatorEventListener(const IControlAnimatorEventListener& listener); - - - /** - * Removes the Control animator event listener from the listeners list. - * - * @since 2.0 - * @return An error code - * @param[in] listener Control animator event listener - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveControlAnimatorEventListener(const IControlAnimatorEventListener& listener); - /** - * Adds the Control detailed animator event listener to the listeners list. - * - * @since 2.0 - * @return An error code - * @param[in] listener Control animator event listener - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result AddControlAnimatorDetailedEventListener(const IControlAnimatorDetailedEventListener& listener); - - /** - * Removes the Detailed Control animator event listener from the listeners list. - * - * @since 2.0 - * @return An error code - * @param[in] listener Control animator event listener - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveControlAnimatorDetailedEventListener(const IControlAnimatorDetailedEventListener& listener); - /** - * Returns animation Index based on animation name. - * - * @since 2.0 - * @return Animation index in the active animation list - * @param[in] animName unique name of animation - */ - int GetActiveAnimationIndex(const Tizen::Base::String& animName) const; - /** - * Sets the Bounds property of the object with specified input - * - * @return An error code - * @param[in] animTarget Enumeration of animation target type - * @param[in] animationBase An instance of %AnimationBase object - */ result SetPrevAnimationBoundsProperty(AnimationTargetType animTarget, AnimationBase& animationBase); - /** - * Sets animation target status - * - * @since 2.0 - * @return An error code - * @param[in] triggerType Control animator trigger type - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result SetAnimationTargetStatus(ControlAnimatorTriggerType triggerType); - /** - * Sets animation target status - * - * @since 2.0 - * @return An error code - * @param[in] animTarget Control animator Target type - * @param[in] pAnimationBase Animation Base object - * @param[in] pTimingFunction Timing function ex: Linear - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ - result SetKeyFrameAnimation(AnimationTargetType animTarget, AnimationBase* pAnimationBase, const IVisualElementAnimationTimingFunction* pTimingFunction, VisualElementAnimation* pAnimation); - - /** - * Sets animation target status - * - * @since 2.0 - * @return An error code - * @param[in] animGroup Animation Group object. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ - result SetGroupAnimation(AnimationGroup* pAnimGrp); - - /** - * Disables / Enables Propagation of properties from model layer to presentation layer - * - * @since 2.0 - * @return An error code - * @param[in] state true or false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result DisableImplicitAnimation(bool& state); - - /** - * Disables / Enables Implicit animation at Visual element - * - * @since 2.0 - * @return An error code - * @param[in] state true or false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result DisableVisualElementPropagation(bool& state); - /** - * Returns the stored logical bounds. - * - * @since 2.0 - * @return Logical bounds - */ + result SetControlProperty(AnimationTargetType animTarget, AnimationBase& animationBase); + result SetControlLogicalBounds(AnimationTargetType animTarget, AnimationBase& animationBase); + result SetControlShowState(AnimationTargetType animTarget, AnimationBase& animationBase); + Tizen::Graphics::Rectangle GetLogicalBounds(void) const { return __logicalBoundsHolder; } - /** - * Sets logical bounds. - * - * @since 2.0 - * @return void - * @param[in] rectangle Logical bounds - */ void SetLogicalBounds(Tizen::Graphics::Rectangle rect) { __logicalBoundsHolder = rect; } - /** - * Returns the Animation type for a given trigger type - * - * @since 2.0 - * @param[in] triggerType trigger for animation - * Allowed values ANIMATION_TRIGGER_POSITION_CHANGE-1 to ANIMATION_TRIGGER_SHOW_STATE_CHANGE-1 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 [NONE (or) PARALLEL (or) SEQUENTIAL] - * - * @return Animation type [NONE (or) PARALLEL (or) SEQUENTIAL] - */ - StoredPropertyAnimationGroupType - GetStoredPropertyAnimationGroupType(int triggerType) const - { - return __propertyAnimationGroupType[triggerType]; - } - - /** - * Sets logical bounds. - * - * @since 2.0 - * @return void - * @param[in] triggerType - * Allowed values ANIMATION_TRIGGER_POSITION_CHANGE-1 to ANIMATION_TRIGGER_SHOW_STATE_CHANGE-1 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 - * @param[in] animationType Type of animation [NONE (or) PARALLEL (or) SEQUENTIAL] - */ - void - SetStoredPropertyAnimationGroupType(int triggerType, StoredPropertyAnimationGroupType groupType) - { - __propertyAnimationGroupType[triggerType] = groupType; - } - - /** - * Returns group of animations for a particular trigger type - * - * @since 2.0 - * @param[in] triggerType - * Allowed values ANIMATION_TRIGGER_POSITION_CHANGE-1 to ANIMATION_TRIGGER_SHOW_STATE_CHANGE-1 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 - * @return Returns group of animations for a particular trigger type - */ - AnimationGroup* - GetPropertyGroupList(int triggerType) const + bool GetShowState(void) const { - return __pPropertyAnimationGroupList[triggerType]; + return __showStateHolder; } - /** - * Sets animation group to a trigger type - * - * @since 2.0 - * @param[in] triggerType - * - * Allowed values ANIMATION_TRIGGER_POSITION_CHANGE-1 to ANIMATION_TRIGGER_SHOW_STATE_CHANGE-1 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 - * @return void - */ void - SetPropertyGroupList(int triggerType, AnimationGroup* animGroup) + SetShowState(bool showState) { - __pPropertyAnimationGroupList[triggerType] = animGroup; + __showStateHolder = showState; } - /** - * Returns the show state of control - * - * @since 2.0 - * @return Returns the show state of control - */ - bool GetShowState(void) const + Control& + GetControl(void) const { - return __showStateHolder; + return *__pControl; } - /** - * Stores show state - * - * @since 2.0 - * @return void - * @param[in] showState Show state - */ void - SetShowState(bool showState) + SetControl(Control& control) { - __showStateHolder = showState; + __pControl = &control; } - /** - * Returns the state of control animator (playing/stopped) - * - * @since 2.0 - * @return State of control animator (playing/stopped) - */ AnimatorStatus GetAnimatorStatus(void) const { return __animatorStatus; } - /** - * Stores whether a target is animating or not - * - * @since 2.0 - * @return void - * @param[in] animatorStatus State of control animator (playing/stopped) - */ void SetAnimatorStatus(AnimatorStatus animatorStatus) { __animatorStatus = animatorStatus; } - /** - * Stores whether a target is animating or not - * - * @since 2.0 - * @return void - * @param[in] target Target type - * @param[in] animating or not animating - */ void SetAnimationTargetAnimating(int target, bool animating) { __isAnimationTargetAnimating[target] = animating; } - /** - * Returns the whether the animation target is animating - * - * @since 2.0 - * @return Animation target is currently animating or not - */ bool IsAnimationTargetAnimating(int target) const { return __isAnimationTargetAnimating[target]; } - /** - * Returns reference to control - * - * @since 2.0 - * @return Reference to control - */ - Control& - GetControl(void) const + StoredPropertyAnimationGroupType + GetStoredPropertyAnimationGroupType(int triggerType) const { - return *__pControl; + return __propertyAnimationGroupType[triggerType]; } - /** - * Stores control pointer - * - * @since 2.0 - * @return void - * @param[in] control Reference to the control - */ void - SetControl(Control& control) + SetStoredPropertyAnimationGroupType(int triggerType, StoredPropertyAnimationGroupType groupType) { - __pControl = &control; + // triggerType is ControlAnimatorTriggerType - 1 + __propertyAnimationGroupType[triggerType] = groupType; } - /** - * This function will be called when the animation is started. - * - * @since 2.0 - * @param[in] target UIObject that animation is applied to. - * @param[in] animation Animation that is started. - */ - void OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const Tizen::Base::String& keyName, VisualElement& target); + AnimationGroup* + GetPropertyGroupList(int triggerType) const + { + return __pPropertyAnimationGroupList[triggerType]; + } - /** - * This function will be called when the animation is repeated. - * - * @since 2.0 - * @param[in] target UIObject that animation is applied to. - * @param[in] animation Animation that is repeated. - * @param[in] currentRepeatCount repeat count - */ - void OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const Tizen::Base::String& keyName, VisualElement& target, long currentRepeatCount); + void + SetPropertyGroupList(int triggerType, AnimationGroup* animGroup) + { + __pPropertyAnimationGroupList[triggerType] = animGroup; + } - /** - * This function will be called when the animation is stopped. - * - * @since 2.0 - * @param[in] target UIObject that animation is applied to. - * @param[in] animation Animation that is stopped. - * @param[in] completed Whether animation is completed normally or canceled in the middle of running. - */ + void OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const Tizen::Base::String& keyName, VisualElement& target); + void OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const Tizen::Base::String& keyName, VisualElement& target, long currentRepeatCount); void OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const Tizen::Base::String& keyName, VisualElement& target, bool completedNormally); - /** - * This function will be called when the animation is stopped. - * - * @since 2.0 - * @param[in] animation Visual Element animation. - * @param[in] keyName Animation name. - * @param[in] currentValue Current value of animation. - */ void OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, const Tizen::Ui::Variant& currentValue); - /** - * This is the assignment operator implementation for this class. @n - * - * @since 2.0 - */ - _ControlAnimatorImpl& operator =(const _ControlAnimatorImpl& rhs); - private: - /** - * Structure used for storing Active Animations - * - * @since 2.0 - * @enum struct - * - */ struct ActiveAnimation { ControlAnimatorTriggerType animType; AnimationTargetType animTarget; AnimationBase* pAnimationBase; - VisualElementAnimation* pAnimation; Tizen::Base::String animName; Tizen::Ui::Animations::BezierTimingFunction* pBezierTimingFunction; @@ -754,167 +220,51 @@ private: animTarget = ANIMATION_TARGET_NONE; animType = ANIMATION_TRIGGER_USER; pAnimationBase = null; - pAnimation = null; animName = Tizen::Base::String(""); pBezierTimingFunction = null; } ~ActiveAnimation(void) { - } bool operator ==(const ActiveAnimation& rhs) const; bool operator !=(const ActiveAnimation& rhs) const; }; - /** - * The List maintaining the Active Animations - * - * @since 2.0 - */ + Tizen::Base::Collection::ArrayListT< ActiveAnimation >* __pActiveAnimationList; - /** - * This is the object of control. - * - * @since 2.0 - */ - //TODO: @remark: This object need not be deleted in ControlAnimator scope + //@remark: This object need not be deleted in ControlAnimator scope Tizen::Ui::Control* __pControl; - - /** - * This is the object _ControlImpl. - * - * @since 2.0 - */ - //TODO: @remark: This object need not be deleted in ControlAnimator scope Tizen::Ui::_ControlImpl* __pControlImpl; - /** - * The animation status (play / stopped) - * - * @since 2.0 - */ - AnimatorStatus __animatorStatus; - - /** - * PROPERTY_GROUP_TYPE_NONE if the __pPropertyAnimationGroupList is not populated with user defined custom defined implicit animations - * - * @since 2.0 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 [NONE (or) PARALLEL (or) SEQUENTIAL] - */ - StoredPropertyAnimationGroupType __propertyAnimationGroupType[ANIMATION_TRIGGER_SHOW_STATE_CHANGE]; + Tizen::Ui::Animations::ControlAnimator* __pControlAnimator; + Tizen::Ui::Animations::VisualElement* __pVisualElement; - /** - * This is the object of AnimationGroup. - * - * @since 2.0 - * ANIMATION_TRIGGER_POSITION_CHANGE = 1, //Stored at index 0 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SIZE_CHANGE = 2, //Stored at index 1 [NONE (or) PARALLEL (or) SEQUENTIAL] - * ANIMATION_TRIGGER_SHOW_STATE_CHANGE = 3, //Stored at index 2 [NONE (or) PARALLEL (or) SEQUENTIAL] - * - * @remarks The array size should be changed if anything is added to ControlAnimationTriggerType. - */ - Tizen::Ui::Animations::AnimationGroup* __pPropertyAnimationGroupList[ANIMATION_TRIGGER_SHOW_STATE_CHANGE]; - /** - * Array of bool to keep track whether an %AnimationTarget is being animated or not. - * - * @since 2.0 - * ANIMATION_TARGET_SIZE at index - 0 - * ANIMATION_TARGET_POSITION at index - 1 - * ANIMATION_TARGET_ALPHA at index - 2 - * ANIMATION_TARGET_ORIENTATION at index - 3 - */ - bool __isAnimationTargetAnimating[ANIMATION_TARGET_MAX]; + AnimatorStatus __animatorStatus; - /** - * LogicalBounds Holder - * - * @since 2.0 - */ Tizen::Graphics::Rectangle __logicalBoundsHolder; - - /** - * showState Holder - * - * @since 2.0 - */ bool __showStateHolder; - /** - * Holder for number of animations of same TargetType in AnimationGroupSequential - * - * @since 2.0 - */ - int __targetCount; - - /** - * LogicalBounds Holder - * - * @since 2.0 - */ Tizen::Graphics::Rectangle __prevAnimationBoundsHolder; + Tizen::Graphics::FloatRectangle __presentationBounds; - /** - * sequentialGroupAnimation or parallel Animation group - * - * @since 2.0 - */ - bool __sequentialGroupAnimation; - - /** - * sequentialGroupAnimation delay - * - * @since 2.0 - */ - float __sequelDelay; + bool __isAnimationTargetAnimating[ANIMATION_TARGET_MAX]; + StoredPropertyAnimationGroupType __propertyAnimationGroupType[ANIMATION_TRIGGER_SHOW_STATE_CHANGE]; + Tizen::Ui::Animations::AnimationGroup* __pPropertyAnimationGroupList[ANIMATION_TRIGGER_SHOW_STATE_CHANGE]; - /** - * This is object of ControlAnimator class - * - * @since 2.0 - */ - Tizen::Ui::Animations::ControlAnimator* __pControlAnimator; + // Holder for number of animations of same TargetType in AnimationGroupSequential + int __targetCount; - /** - * This is object of ControlAnimator class - * - * @since 2.0 - */ - Tizen::Ui::Animations::VisualElement* __pVisualElement; + // sequentialGroupAnimation or parallel Animation group + bool __sequentialGroupAnimation; + float __sequetialGroupAnimationDelay; - /** - * This is the list controlanimator event listeners - * - * @since 2.0 - */ Tizen::Base::Collection::LinkedListT< IControlAnimatorEventListener* >* __pAnimStatusEventListener; - - /** - * This is the list controlanimator event listeners - * - * @since 2.0 - */ Tizen::Base::Collection::LinkedListT< IControlAnimatorDetailedEventListener* >* __pAnimDetailedEventListener; - /** - * This is Id or each animation - * - * @since 2.0 - */ - int __animId; - /** - * This is name for group animation - * - * @since 2.0 - */ + // This is Id or each animation + int __animationId; + Tizen::Base::String __groupName; - /** - * This is to hold presentation bounds - * - * @since 2.0 - */ - Tizen::Graphics::FloatRectangle __presentationBounds; friend class Tizen::Ui::Control; }; // _ControlAnimatorImpl diff --git a/src/ui/animations/FUiAnim_Debug.cpp b/src/ui/animations/FUiAnim_Debug.cpp index 414f42a..8e32cc5 100644 --- a/src/ui/animations/FUiAnim_Debug.cpp +++ b/src/ui/animations/FUiAnim_Debug.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #ifndef VE_SIMULATOR #include @@ -63,6 +65,7 @@ using namespace Tizen::Base; +using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Animations { @@ -90,6 +93,298 @@ _VeDebug::IsDebugEnabled(void) return __veDebugEnabled; } +static int oldDepth = 0; +void +_VeDebug::DumpVisualElementLayout(_VisualElementImpl* pElement, FILE* pFile) +{ + static int count = 0; + int depth = 0; + int nativeVisible = -1; + _VisualElementImpl* pDepth = null; + _VisualElementImpl* pModel = null; + _VisualElementImpl* pPresentation = null; + char logMessage[LOG_LEN_MAX] = {0, }; + char endTag[256] = {0, }; + + if (!pElement) + { + return; + } + + depth = -1; + pDepth = pElement; + while (pDepth) + { + depth++; + pDepth = pDepth->__pParent; + } + + while (oldDepth >= depth) + { + if (count > 0) + { + char indent[128] = {0, }; + snprintf(indent, 64, "%*s", (depth+(oldDepth-depth))*4, " "); + strcat(endTag, indent); + strcat(endTag, "\n"); + oldDepth--; + } + else + { + break; + } + } + + if (pElement->GetModel() == pElement) + { + pModel = pElement; + pPresentation = pElement->GetPresentation(); + } + else + { + pModel = pElement->GetModel(); + pPresentation = pElement; + } + + if (pElement && pElement->__pSharedData->pNativeNode) + { + VisualElementSurface* pSurface = dynamic_cast< VisualElementSurface* >(pElement->__pSharedData->pNativeNode->GetSurface()); + if (pSurface && _VisualElementSurfaceImpl::GetInstance(*pSurface)) + { + nativeVisible = evas_object_visible_get(reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*pSurface)->GetNativeHandle())); + } + } + + + Tizen::Base::String name = pElement->GetSharedData().name; + +#ifndef VE_SIMULATOR + Tizen::Ui::_Control* pControl = null; + Tizen::Ui::_ControlImpl* pCtrlImpl = null; + + pControl = dynamic_cast< Tizen::Ui::_Control* >(static_cast< Tizen::Ui::_Control* >(pElement->GetUserData())); + if (pControl) + { + pCtrlImpl = dynamic_cast< Tizen::Ui::_ControlImpl* >(static_cast< Tizen::Ui::_ControlImpl* >(pControl->GetUserData())); + if (pCtrlImpl) + { + name = name + L", " + pCtrlImpl->GetPublicClassName(); + } + + Tizen::Ui::Controls::_Label* pLabel = null; + Tizen::Ui::Controls::_Edit* pEdit = null; + Tizen::Ui::Controls::_Button* pButton = null; + Tizen::Ui::Controls::_Popup* pPopup = null; + Tizen::Ui::Controls::Form* pForm = null; + Tizen::Ui::Controls::Header* pHeader = null; + Tizen::Ui::_Window* pWindow = null; + + pLabel = dynamic_cast< Tizen::Ui::Controls::_Label* >(pControl); + if (pLabel) + { + name = name + L", '" + pLabel->GetText() + L"'"; + } + + pEdit = dynamic_cast< Tizen::Ui::Controls::_Edit* >(pControl); + if (pEdit) + { + name = name + L", '" + pEdit->GetText() + L"'"; + } + + pButton = dynamic_cast< Tizen::Ui::Controls::_Button* >(pControl); + if (pButton) + { + name = name + L", '" + pButton->GetText() + L"'"; + } + + pPopup = dynamic_cast< Tizen::Ui::Controls::_Popup* >(pControl); + if (pPopup) + { + name = name + L", '" + pPopup->GetTitleText() + L"'"; + } + + pWindow = dynamic_cast< Tizen::Ui::_Window* >(pControl); + if (pWindow) + { + name = name + L", '_Window'"; + } + + pForm = dynamic_cast< Tizen::Ui::Controls::Form* >(pControl); + if (pForm) + { + name = name + L", '" + pForm->GetTitleText() + L"'"; + } + + pHeader = dynamic_cast< Tizen::Ui::Controls::Header* >(pControl); + if (pHeader) + { + name = name + L", '" + pHeader->GetTitleText() + L"'"; + } + } +#endif + + if (pElement && pElement->__pSharedData->pNativeNode) + { + _EflNode* pNativeNode = dynamic_cast< _EflNode* >(pElement->__pSharedData->pNativeNode); + if (pNativeNode) + { + Evas_Object* pEvasObject = null; + + if (pNativeNode->GetSurface() && _VisualElementSurfaceImpl::GetInstance(*pNativeNode->GetSurface())) + { + pEvasObject = reinterpret_cast< Evas_Object* >(_VisualElementSurfaceImpl::GetInstance(*pNativeNode->GetSurface())->GetNativeHandle()); + } + else + { + pEvasObject = pNativeNode->__pRectangleObject; + } + + if (pEvasObject) + { + Dimension imageSize; + Rectangle absolute; + Rectangle relative; + Rectangle filled; + int red = 0; + int green = 0; + int blue = 0; + int alpha = 0; + unsigned int rgb = 0; + const char* eoType = evas_object_type_get(pEvasObject); + char style1[LOG_LEN_MAX] = {0, }; + char title1[LOG_LEN_MAX] = {0, }; + char style[LOG_LEN_MAX] = {0, }; + char title[LOG_LEN_MAX] = {0, }; + + if (!pElement->GetName().IsEmpty()) + { + ByteBuffer* pByteBuffer(Tizen::Base::Utility::StringUtil::StringToUtf8N(pElement->GetName())); + evas_object_name_set(pEvasObject, (const char*)pByteBuffer->GetPointer()); + delete pByteBuffer; + } + + evas_object_geometry_get(pEvasObject, &absolute.x, &absolute.y, &absolute.width, &absolute.height); + + FloatRectangle realBounds = pElement->__bounds; + _VisualElementCoordinateSystem::ConvertDimensionToPhysical(realBounds.width, realBounds.height); + _VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.width, realBounds.height, relative.width, relative.height); + _VisualElementCoordinateSystem::ConvertPointToPhysical(realBounds.x, realBounds.y); + _VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.x, realBounds.y, relative.x, relative.y); + + bool showState = pElement->GetShowState(); + bool visible = pElement->IsVisible(); + bool evasVisible = evas_object_visible_get(pEvasObject); + + if (!strcmp(eoType, "image")) + { + char filename[LOG_LEN_MAX/4] = {0, }; + char savePath[LOG_LEN_MAX/2] = {0, }; + Evas_Object* pEvasObjectImage = pEvasObject; + Evas_Object* pSource = evas_object_image_source_get(pEvasObject); + if (pSource) + { + pEvasObjectImage = pSource; + } + evas_object_image_size_get(pEvasObjectImage, &imageSize.width, &imageSize.height); + evas_object_image_fill_get(pEvasObject, &filled.x, &filled.y, &filled.width, &filled.height); + + if (name.GetLength() > 0) + { + sprintf(filename, "VE_%d_%ls_%08x.png", count, pElement->GetName().GetPointer(), (unsigned int)pElement->GetPresentation()); + } + else + { + sprintf(filename, "VE_%d_%08x.png", count, (unsigned int)pElement->GetPresentation()); + } + + // save the image file + strncpy(savePath, "/tmp/", 5); + strncat(savePath, filename, strlen(filename)); + evas_object_image_save(pEvasObjectImage, savePath, NULL, "quality=100 compress=9"); + + snprintf(style1, LOG_LEN_MAX, "background-image:url(%s); ", filename); + snprintf(title1, LOG_LEN_MAX, "%s\nImage: w=%d h=%d\nEvas Absolute Bounds: x=%d y=%d w=%d h=%d\nVE Relative Bounds: x=%d y=%d w=%d h=%d\nFilled Bounds: x=%d y=%d w=%d h=%d\n", + filename, relative.width, relative.height, absolute.x, absolute.y, absolute.width, absolute.height, relative.x, relative.y, relative.width, relative.height, filled.x, filled.y, filled.width, filled.height); + } + else + { + evas_object_color_get(pEvasObject, &red, &green, &blue, &alpha); + rgb = (((red << 16) & 0x00ff0000) | ((green << 8) & 0x0000ff00) | (blue & 0x000000ff)); + if (alpha) + { + snprintf(style1, LOG_LEN_MAX, "background-color:#%06x; ", rgb); + } + else + { + //snprintf(style1, LOG_LEN_MAX, "pointer-events: none; "); + } + snprintf(title1, LOG_LEN_MAX, "No Surface\nColor: #%06x Alpha: %02x\nEvas Absolute Bounds: x=%d y=%d w=%d h=%d\nVE Relative Bounds: x=%d y=%d w=%d h=%d\n", rgb, alpha, absolute.x, absolute.y, absolute.width, absolute.height, relative.x, relative.y, relative.width, relative.height); + } + + snprintf(title, LOG_LEN_MAX, "%s\nname=%ls\nshow=%s visible=%s evas=%s\nmodel=%#x\npresentation=%#x\nparent=%#x\nevas_object=%#x\nclip-source=%#x", + title1, name.GetPointer(), showState ? "true" : "false", visible ? "true" : "false", evasVisible ? "show" : "hide", (unsigned int)pModel, (unsigned int)pPresentation, (unsigned int)pElement->GetParent(), (unsigned int)pEvasObject, (unsigned int)pElement->GetClipSource()); + snprintf(style, LOG_LEN_MAX, "%sopacity:%.2f; position:absolute; left:%dpx; top:%dpx; width:%dpx; height:%dpx; border:1px dotted #aaaaaa; z-index:%d; display:%s;%s", + style1, (pElement->__opacity), relative.x, relative.y, relative.width, relative.height, depth, (showState ? "block" : "none"), (pElement->__isClipChildren ? " overflow:hidden;" : "")); + + snprintf(logMessage, LOG_LEN_MAX, "%s%*s
\n", endTag, depth*4, " ", (unsigned int)pElement, style, title); + fputs(logMessage,pFile); + } + } + } + + count++; + oldDepth = depth; +} + +void +_VeDebug::DumpVeLayout(_VisualElementImpl* pElement, int indent, FILE* pFile) +{ + if (!pElement) + { + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); + if (pDisplayManager != null && pDisplayManager->GetRoot(0)) + { + pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0)); + } + } + + bool prevDebugEnabled = IsDebugEnabled(); + SetDebugEnabled(true); + + if (pElement) + { + if (indent == 0) + { + } + + DumpVisualElementLayout(pElement, pFile); + + int count = pElement->__children.GetCount(); + for (int i = 0; i < count; i++) + { + _VeDebug::DumpVeLayout(pElement->__children.GetChildAt(i), indent + 3, pFile); + } + + if (indent == 0) + { + char endTag[LOG_LEN_MAX] = {0, }; + while (oldDepth >= 0) + { + char indent[128] = {0, }; + snprintf(indent, 64, "%*s", oldDepth*4, " "); + strcat(endTag, indent); + strcat(endTag, "
\n"); + oldDepth--; + } + fputs(endTag, pFile); + } + } + + SetDebugEnabled(prevDebugEnabled); + + return; +} + void _VeDebug::DumpVisualElement(_VisualElementImpl* pElement, const char* func, int line, const char* fmt, ...) { @@ -1168,6 +1463,91 @@ _VeDebug::ReflushAll(_VisualElementImpl* pElement, int depth) extern "C" _OSP_EXPORT_ void +DumpVeLayout(void) +{ + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); + + FILE* pFile = fopen("/tmp/layout.html", "w"); + fprintf(pFile, "\n"); + fprintf(pFile, "
Model
\n"); + fprintf(pFile, "
\n"); + // Model + for (int i = 0; i < pDisplayManager->GetRootCount(); i++) + { + Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(i)); + if (pVisualElementImpl) + { + Tizen::Ui::Animations::_VeDebug::DumpVeLayout(pVisualElementImpl, 0, pFile); + } + } + fprintf(pFile, "
\n"); + fprintf(pFile, "
Presentation
\n"); + fprintf(pFile, "
\n"); + + // Presentation + for (int i = 0; i < pDisplayManager->GetRootCount(); i++) + { + Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = const_cast(Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(i)->AcquirePresentationInstance())); + if (pVisualElementImpl) + { + Tizen::Ui::Animations::_VeDebug::DumpVeLayout(pVisualElementImpl, 0, pFile); + } + pDisplayManager->GetRoot(i)->ReleasePresentationInstance(); + } + fprintf(pFile, "
\n"); + + fprintf(pFile, "\n"); + fprintf(pFile, "\n"); + fprintf(pFile, "\n"); + fclose(pFile); +} + +extern "C" _OSP_EXPORT_ void DumpVeTree(void) { Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); diff --git a/src/ui/animations/FUiAnim_Debug.h b/src/ui/animations/FUiAnim_Debug.h index 2fd972e..93356c7 100644 --- a/src/ui/animations/FUiAnim_Debug.h +++ b/src/ui/animations/FUiAnim_Debug.h @@ -131,8 +131,10 @@ class _VisualElementImpl; class _VeDebug { public: + static void DumpVisualElementLayout(_VisualElementImpl* pElement, FILE* pFile); static void DumpVisualElement(_VisualElementImpl* pElement, const char* func, int line, const char* fmt, ...); static void PrintVeTree(_VisualElementImpl* pElement = 0, int depth = 0, unsigned int remainedChild = 0); + static void DumpVeLayout(_VisualElementImpl* pElement, int indent, FILE* pFile); static void DumpVeTree(_VisualElementImpl* pElement = 0, int indent = 0); static void DumpVeImage(_VisualElementImpl* pElement = 0, const char* pathPrefix = 0); static void DumpAllVeImages(_VisualElementImpl* pElement = 0, const char* pathPrefix = 0); diff --git a/src/ui/animations/FUiAnim_DimensionAnimationImpl.h b/src/ui/animations/FUiAnim_DimensionAnimationImpl.h index ca73f97..bdbeae1 100644 --- a/src/ui/animations/FUiAnim_DimensionAnimationImpl.h +++ b/src/ui/animations/FUiAnim_DimensionAnimationImpl.h @@ -33,81 +33,23 @@ namespace Tizen { namespace Ui { namespace Animations class _DimensionAnimationImpl : public Tizen::Base::Object { - public: - /** - * Destructor for %_DimensionAnimationImpl class. - */ - ~_DimensionAnimationImpl(void); - - /** - * Default constructor for %_DimensionAnimationImpl class. - */ _DimensionAnimationImpl(DimensionAnimation* pDimensionAnimation); + ~_DimensionAnimationImpl(void); - /** - * To copy Dimension animation object - * - * @since 2.0 - * @return An error code - * @param[in] dimensionAnimation Dimension animation object - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result CopyDimensionAnimationValue(const DimensionAnimation& dimensionAnimation); - /** - * Gets the animated value for the current time. - * - * @since 2.0 - * @return An error code - * @param[in] actualProgress The current time value of the animation @n - * The value should be between @c 0 and 1 - * @param[out] animatedValue The animated value for the current time passed as the input parameter - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has not been properly constructed. - * @exception E_SYSTEM A system error has occurred. - * - */ result GetAnimatedValue(float actualProgress, Tizen::Graphics::Dimension& animatedValue) const; - /** - * The Anchor X value for scaling - */ float anchorX; - - /** - * The Anchor Y value for scaling - */ float anchorY; - /** - * The start value of the animation - */ Tizen::Graphics::Dimension startValue; - - /** - * The end value of the animation - */ Tizen::Graphics::Dimension endValue; - private: - /** - * Private copy constructor. - */ _DimensionAnimationImpl(const DimensionAnimation& rhs); - - /** - * Private assignment operator. - */ _DimensionAnimationImpl& operator =(const _DimensionAnimationImpl& rhs); - - /** - * This is object of DimensionAnimation class - */ DimensionAnimation* __pDimensionAnimation; }; // _DimensionAnimationImpl diff --git a/src/ui/animations/FUiAnim_DisplayManager.cpp b/src/ui/animations/FUiAnim_DisplayManager.cpp index 1274c41..910881b 100644 --- a/src/ui/animations/FUiAnim_DisplayManager.cpp +++ b/src/ui/animations/FUiAnim_DisplayManager.cpp @@ -245,10 +245,10 @@ _DisplayManager::Render(_RootVisualElement& root) unlikely(pPresentationRoot->GetNeedsContentUpdate())) { root.SetNeedsContentUpdate(false); - root.Draw(); + pRootModelImpl->Draw(); pPresentationRoot->SetNeedsContentUpdate(false); - pPresentationRoot->Draw(); + pRootPresentationImpl->Draw(); updated = true; } @@ -274,7 +274,11 @@ _DisplayManager::PostRender(_RootVisualElement& root) { _VisualElementImpl* pRootPresentationImpl = _VisualElementImpl::GetInstance(*pPresentationRoot); +#ifdef OLD if (likely((pRootPresentationImpl->__childrenNeedsUpdateProps & ~_VisualElementImpl::HIERARCHY_PROPERTY_CONTENT) != 0) || +#else + if (likely(pRootPresentationImpl->__childrenNeedsUpdateProps) || +#endif likely(pRootPresentationImpl->__pSharedData->NeedNativeReconfigure()) || unlikely(root.GetNeedsContentUpdate()) || unlikely(pPresentationRoot->GetNeedsContentUpdate())) diff --git a/src/ui/animations/FUiAnim_EflLayer.cpp b/src/ui/animations/FUiAnim_EflLayer.cpp index 9503cf1..5ab7676 100755 --- a/src/ui/animations/FUiAnim_EflLayer.cpp +++ b/src/ui/animations/FUiAnim_EflLayer.cpp @@ -44,7 +44,7 @@ using namespace Tizen::Graphics; using namespace Tizen::Ui; using namespace Tizen::Ui::Animations; -#define _NEED_DAMAGE_HANDER_ +//#define _NEED_DAMAGE_HANDER_ //#define PRINT printf #define PRINT(...) @@ -593,7 +593,9 @@ _EflLayer::Flush(void) PRINT("evas_object_hide(%p) \n", this); } +#ifdef _NEED_DAMAGE_HANDER_ _isVisibilityChangeInProgress = true; +#endif _needShowStateChangeRequest = false; } diff --git a/src/ui/animations/FUiAnim_EflNode.cpp b/src/ui/animations/FUiAnim_EflNode.cpp index aa28d3c..8625a25 100644 --- a/src/ui/animations/FUiAnim_EflNode.cpp +++ b/src/ui/animations/FUiAnim_EflNode.cpp @@ -886,7 +886,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen // create new surface if (unlikely(createNewObject)) { - unique_ptr pNewSharedSurface(new (std::nothrow) VisualElementSurface(*pSurface)); SysTryReturnResult(NID_UI_ANIM, pNewSharedSurface, E_OUT_OF_MEMORY, "Memory allocation failed."); @@ -905,7 +904,7 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen } else { - unique_ptr pNewSurface(_VisualElementSurfaceImpl::CreateSurfaceN((Handle)__pLayer, Dimension(1, 1))); + unique_ptr pNewSurface(_VisualElementSurfaceImpl::CreateSurfaceN((Handle)__pLayer, FloatDimension(1.0f, 1.0f))); SysTryReturnResult(NID_UI_ANIM, pNewSurface, E_OUT_OF_MEMORY, "Memory allocation failed."); if (__pSurface) @@ -955,6 +954,7 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen if (pEflVisualElementSurfaceImpl && pEflVisualElementSurfaceImpl->__pBuffer != null) { evas_object_image_source_set(pImageObject, pImageObjectNew); + evas_object_image_source_visible_set(pImageObject, EINA_FALSE); } //evas_object_pass_events_set(pImageObject, EINA_TRUE); @@ -1080,7 +1080,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen // Do not use to MakeIntegralDimension. All information about coordinates(position/size) are calculated with same(point) way. _VisualElementCoordinateSystem::MakeIntegralPoint(__realBounds.width, __realBounds.height, newW, newH); - float clipX = 0.0f; float clipY = 0.0f; float clipW = 0.0f; @@ -1498,7 +1497,9 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen contentBoundsAdjusted.height ); - //NormalizeUniformRectangle(contentBoundsAdjusted, surfaceSize.width, surfaceSize.height); + // Added to resolve the problem that the left edge part is shown repeatedly to the right edge. + contentBoundsAdjusted.width += ceil(static_cast< float >(newW) / contentBounds.width - contentBoundsAdjusted.width); + contentBoundsAdjusted.height += ceil(static_cast< float >(newH) / contentBounds.height - contentBoundsAdjusted.height); if (likely(contentBoundsAdjusted.width > 0) && likely(contentBoundsAdjusted.height > 0)) { diff --git a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp index 2d08bdf..329daf5 100644 --- a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp +++ b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp @@ -30,7 +30,7 @@ #include #include -#include "FUi_CoordinateSystemUtils.h" +#include "FUiAnim_VisualElementCoordinateSystem.h" #include "FUi_EcoreEvas.h" #include "FUi_EcoreEvasMgr.h" #include "FUiAnim_EflNode.h" @@ -44,7 +44,7 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Animations { -_EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, const Dimension& size) +_EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, const FloatDimension& size) : _VisualElementSurfaceImpl(size) , __pEvasImage(null) , __pBuffer(null) @@ -58,7 +58,19 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c evas_object_image_alpha_set(__pEvasImage, EINA_TRUE); - Dimension outputSize = _CoordinateSystemUtils::Transform(size); + Dimension outputSize; + _VisualElementCoordinateSystem::ConvertDimensionToPhysicalIntegral(size.width, size.height, outputSize.width, outputSize.height); + + if (size.width > 0.0f && outputSize.width == 0) + { + outputSize.width = 1; + } + + if (size.height > 0.0f && outputSize.height == 0) + { + outputSize.height = 1; + } + SysTryCatch(NID_UI_ANIM, outputSize.width >= 0 && outputSize.height >= 0, , E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. size(%d:%d)", outputSize.width, outputSize.height); // Todo : Temporary code(HW limitation) @@ -74,13 +86,7 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c evas_object_resize(__pEvasImage, outputSize.width, outputSize.height); evas_object_image_data_set(__pEvasImage, reinterpret_cast(__pBuffer)); - -#if 1 // Todo : Temporary code(regarding the visibility of evas source object) evas_object_show(__pEvasImage); - evas_object_move(__pEvasImage, -999999, -999999); -#else - evas_object_hide(__pEvasImage); -#endif return; CATCH: diff --git a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h index 60d8288..9193e9b 100644 --- a/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h +++ b/src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.h @@ -42,7 +42,7 @@ class _EflVisualElementSurfaceImpl : public _VisualElementSurfaceImpl { public: - _EflVisualElementSurfaceImpl(const Handle layer, const Tizen::Graphics::Dimension& size); + _EflVisualElementSurfaceImpl(const Handle layer, const Tizen::Graphics::FloatDimension& size); _EflVisualElementSurfaceImpl(const Handle layer, const Handle object, const Tizen::Graphics::Dimension& size); virtual ~_EflVisualElementSurfaceImpl(void); diff --git a/src/ui/animations/FUiAnim_FloatAnimationImpl.h b/src/ui/animations/FUiAnim_FloatAnimationImpl.h index 37ac3bd..122333c 100644 --- a/src/ui/animations/FUiAnim_FloatAnimationImpl.h +++ b/src/ui/animations/FUiAnim_FloatAnimationImpl.h @@ -35,70 +35,19 @@ class _FloatAnimationImpl { public: - /** - * Destructor for %_FloatAnimationImpl class. - */ - ~_FloatAnimationImpl(void); - - /** - * Default constructor for %_FloatAnimationImpl class. - */ _FloatAnimationImpl(FloatAnimation* pFloat); + ~_FloatAnimationImpl(void); - /** - * To copy float animation object - * - * @since 2.0 - * @return An error code - * @param[in] floatAnimation Float animation object - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result CopyFloatAnimationValue(const FloatAnimation& floatAnimation); - /** - * Gets the animated value for the current time. - * - * @since 2.0 - * @return An error code - * @param[in] actualProgress The current time value of the animation @n - * The value should be between @c 0 and 1 - * @param[out] animatedValue The animated value for the current time passed as the input parameter - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has not been properly constructed. - * @exception E_SYSTEM A system error has occurred. - * - */ result GetAnimatedValue(float actualProgress, float& animatedValue) const; - /** - * The start value of the animation - */ Tizen::Base::Float startValue; - - /** - * The end value of the animation - */ Tizen::Base::Float endValue; - private: - /** - * Private copy constructor. - */ _FloatAnimationImpl(const _FloatAnimationImpl& rhs); - - /** - * Private assignment operator. - */ _FloatAnimationImpl& operator =(const _FloatAnimationImpl& rhs); - - /** - * This is object of FloatAnimation class - * - */ FloatAnimation* __pFloatAnimation; }; //_FloatAnimationImpl diff --git a/src/ui/animations/FUiAnim_FrameAnimatorImpl.cpp b/src/ui/animations/FUiAnim_FrameAnimatorImpl.cpp index 0e59d61..eecb1dc 100644 --- a/src/ui/animations/FUiAnim_FrameAnimatorImpl.cpp +++ b/src/ui/animations/FUiAnim_FrameAnimatorImpl.cpp @@ -776,7 +776,7 @@ _FrameAnimatorImpl::AddFrameActiveAnimation(VisualElement* _pVisualElement, Fram Tizen::Ui::Animations::VisualElementPropertyAnimation* _FrameAnimatorImpl::GetFrameActiveAnimationAt(int index) { - SysTryReturn(NID_UI_ANIM, (index < __frameActiveAnimationList.GetCount() && (index >= 0)), + SysTryReturn(NID_UI_ANIM, (index >= 0 && index < __frameActiveAnimationList.GetCount()), null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Index (%d) is out of range."); FrameActiveAnimation frameActiveAnim; @@ -790,7 +790,8 @@ result _FrameAnimatorImpl::RemoveAnimationAt(int index) { result r = E_SUCCESS; - SysTryReturnResult(NID_UI_ANIM, (index >= 0 && index < __frameActiveAnimationList.GetCount()), E_OUT_OF_RANGE, "Index (%d) is out of range.", index); + SysTryReturnResult(NID_UI_ANIM, (index >= 0 && index < __frameActiveAnimationList.GetCount()), + E_OUT_OF_RANGE, "Index (%d) is out of range.", index); FrameActiveAnimation frameActiveAnim; diff --git a/src/ui/animations/FUiAnim_FrameAnimatorImpl.h b/src/ui/animations/FUiAnim_FrameAnimatorImpl.h index 20e5c17..c66966e 100644 --- a/src/ui/animations/FUiAnim_FrameAnimatorImpl.h +++ b/src/ui/animations/FUiAnim_FrameAnimatorImpl.h @@ -35,263 +35,76 @@ namespace Tizen { namespace Ui { namespace Animations { -/** - * @class _FrameAnimatorImpl - * @brief This class defines the animation API for Container::Frame - * @since 2.0 - * - * The %_FrameAnimatorImpl class is used to control the animations operated on Tizen::Ui::Controls::Container::Frame - * - */ class _FrameAnimatorImpl : public Tizen::Base::Object , public IAnimationTransactionEventListener , virtual public Tizen::Base::Runtime::IEventListener { public: - /** - * Destructor for %_FrameAnimatorImpl class. - * - * @since 2.0 - */ - ~_FrameAnimatorImpl(void); - - /** - * Default constructor for %_FrameAnimatorImpl class. - * - * @since 2.0 - */ _FrameAnimatorImpl(FrameAnimator* pFrameAnimator); + ~_FrameAnimatorImpl(void); - /** - * Initializes this %_FrameAnimatorImpl class. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_MEMORY Insufficient memory. - */ result Construct(const Tizen::Ui::Controls::Frame& source); - /** - * Adds framestatusevent listener to list. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM System error occurred. - */ result AddFrameAnimatorEventListener(IFrameAnimatorEventListener& listener); - - /** - * Removes framestatusevent listener from list. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM System error occurred. - * @exception E_OBJ_NOT_FOUND Listener object not found in list. - */ result RemoveFrameAnimatorEventListener(IFrameAnimatorEventListener& listener); - /** - * Stops all the animations that are currently playing and jumps to the final frame of the animation. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - */ result StopAllAnimations(void); - /** - * Adds the control at the end of the list maintained by the container with animation. - * - * @since 2.0 - * - * @return An error code - * @param[in] control The control to be added to the container - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid. @n - * The specified @c control is an instance of Window, or this control's parent container. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @exception E_MAX_EXCEEDED The number of child controls has exceeded the maximum limit. - * @exception E_SYSTEM A system error has occurred. - * @remarks When the control is added, it is placed at the top of the drawing stack maintained by the container.@n - * This means the last control added is drawn last - * @remarks A control becomes displayable only after it has been added to a displayable container. Some methods may not work normally if the methods - * of the control are called before adding the control to a container. After the control is added to a %Container, the OnInitializing() - * method of the control are called before adding the control to a container. After the control is added to a Container, the - * OnInitializing() method of the control is invoked for the initialization of the control such as creating and adding child controls. - * @see Tizen::Ui::Control::OnInitializing() - * @see Tizen::Ui::Control::OnTerminating() - */ result AddControl(const Tizen::Ui::Control& control); - - /** - * Sets the current form with animation. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has already been constructed. - * @exception E_OUT_OF_MEMORY Insufficient memory. - * @exception E_SYSTEM System error occurred. - */ result SetCurrentForm(const Tizen::Ui::Controls::Form& form); - - /** - * returns whether animation supported by underlying platform or not - * - * @since 2.0 - * - * @return An error code - * @remarks %This function returns whether animation is supported or not. @n - * If @c true, animation supported. @n - * If @c false, animation not supported. - */ bool IsAnimationSupported(void) const; - - /** - * This Callback is called when an animation is started. - * - * @since 2.0 - */ virtual void OnAnimationTransactionStarted(int transactionId); - - - /** - * This Callback is called when an animation ends. - * - * @since 2.0 - */ virtual void OnAnimationTransactionStopped(int transactionId); - - - /** - * This Callback is called when an animation ends. - * - * @since 2.0 - */ virtual void OnAnimationTransactionFinished(int transactionId); - - /** - * This Callback is called when an animation is started. - * - * @since 2.0 - */ void OnFrameAnimationStarted(void); - - - /** - * This Callback is called when an animation ends. - * - * @since 2.0 - */ void OnFrameAnimationStopped(bool completed); - - /** - * Returns frame animator status. - * - * @since 2.0 - * - * @return AnimatorStatus for the frameanimator. - */ AnimatorStatus GetFrameAnimatorStatus(void) const { return __frameAnimatorStatus; } - /** - * Returns frame animator FrameAnimatorFormTransitionAnimation. - * - * @since 2.0 - * - * @return FrameAnimatorFormTransitionAnimation for the frameanimator. - */ FrameAnimatorFormTransitionAnimation GetAnimationEffectType(void) const { return __animationEffectType; } - /** - * Sets frame animator FrameAnimatorFormTransitionAnimation. - * - * @since 2.0 - */ void SetAnimationEffectType(FrameAnimatorFormTransitionAnimation animationEffectType) { __animationEffectType = animationEffectType; } - /** - * Returns frame animator animation duration. - * - * @since 2.0 - * - * @return long duration for the frameanimator. - */ long GetDuration(void) const { return __duration; } - /** - * Sets frame animator animation duration. - * - * @since 2.0 - */ void SetDuration(long duration) { __duration = duration; } - /** - * Returns frame animator AnimInterpolatorType. - * - * @since 2.0 - * - * @return AnimInterpolatorType for the frameanimator. - */ AnimationInterpolatorType GetAnimInterpolatorType(void) const { return __animInterpolatorType; } - /** - * Sets frame animator AnimInterpolatorType. - * - * @since 2.0 - */ void SetAnimInterpolatorType(AnimationInterpolatorType animInterpolatorType) { __animInterpolatorType = animInterpolatorType; } - /** - * Returns frame animator bezier control points. - * - * @since 2.0 - * - * @return A float type value. - */ void GetFormTransitionBezierControlPoints(float& firstTime, float& firstValue, float& secondTime, float& secondValue) const { @@ -301,13 +114,6 @@ public: secondValue = __secondBezierControlPointsValue; } - /** - * Sets frame animator bezier control points. - * - * @since 2.0 - * - * @return A float type value. - */ void SetFormTransitionBezierControlPoints(float firstTime, float firstValue, float secondTime, float secondValue) { @@ -321,123 +127,21 @@ public: static const _FrameAnimatorImpl* GetInstance(const FrameAnimator& frameAnimator); private: - /** - * This is the copy constructor for this class. @n - * - * @since 2.0 - */ _FrameAnimatorImpl(const _FrameAnimatorImpl& rhs); - - /** - * This is the assignment operator implementation for this class. @n - * - * @since 2.0 - */ _FrameAnimatorImpl& operator =(const _FrameAnimatorImpl& rhs); - /** - * Delete & frees the memory used by the object. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM Failed to free the resource possessed by this instance. - */ result Dispose(void); - /** - * Starts the Layer animation. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has already been constructed. - * @exception E_OUT_OF_MEMORY Insufficient memory. - * @exception E_SYSTEM System error occurred. - */ result StartLayerAnimation(VisualElement* pLayer, AnimationTargetType animTarget, Variant startValue, Variant endValue, Tizen::Base::String animName); - - - /** - * Adds the %Animation to the ActiveAnimation List. - * - * @since 2.0 - * - * @return An error code - * @param[in] formAnimation %FrameAnimatorFormTransitionAnimation - * @param[in] propAnimation An object of VisualElementPropertyAnimation - * @param[in] animName Unique animation name - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result AddFrameActiveAnimation(VisualElement* _pVisualElement, FrameAnimatorFormTransitionAnimation _formAnimation, VisualElementPropertyAnimation* _pPropertyAnimation, IVisualElementAnimationTimingFunction* _pTimingFunction, Tizen::Base::String _animName); - /** - * Gets the %Animation from the FrameActiveAnimation List attached against specified index - * - * @since 2.0 - * - * @return An error code - * @param[in] index Value at the index to be retrieved - * @param[out] propAnimation An object of VisualElementPropertyAnimation - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ VisualElementPropertyAnimation* GetFrameActiveAnimationAt(int index); - - /** - * Removes the %Animation from the FrameActiveAnimation List at specified index. - * - * @since 2.0 - * - * @return An error code - * @param[in] index Values at the index to be removed. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveAnimationAt(int index); - - /** - * Removes all the %Animation from the FrameActiveAnimation List. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result RemoveAllAnimations(bool deleteAnimation); - /** - * Searches the Frame's children list, for the given form, if present returns true else false. - * - * @since 2.0 - * - * @return bool True if form is still in the children list, else false. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ bool IsFormPresent(Tizen::Ui::Controls::Form& pPrevForm) const; - /** - * Removes all the %Animation from the FrameActiveAnimation List. - * - * @since 2.0 - * - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result ChangeCurrentForm(Tizen::Ui::Controls::Form* pCurrentForm, Tizen::Ui::Controls::Form& nextForm); result SetAnimations(void); diff --git a/src/ui/animations/FUiAnim_IntegerAnimationImpl.h b/src/ui/animations/FUiAnim_IntegerAnimationImpl.h index e9ea9ed..2a854a9 100644 --- a/src/ui/animations/FUiAnim_IntegerAnimationImpl.h +++ b/src/ui/animations/FUiAnim_IntegerAnimationImpl.h @@ -34,72 +34,20 @@ namespace Tizen { namespace Ui { namespace Animations class _IntegerAnimationImpl : public Tizen::Base::Object { - public: - /** - * Destructor for %_IntegerAnimationImpl class. - */ - ~_IntegerAnimationImpl(void); - - /** - * Default constructor for %_IntegerAnimationImpl class. - */ _IntegerAnimationImpl(IntegerAnimation* pInt); + ~_IntegerAnimationImpl(void); - /** - * To copy Integer animation object - * - * @since 2.0 - * @return An error code - * @param[in] integerAnimation Dimension animation object - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result CopyIntegerAnimationValue(const IntegerAnimation& integerAnimation); - /** - * Gets the animated value for the current time. - * - * @since 2.0 - * @return An error code - * @param[in] actualProgress The current time value of the animation @n - * The value should be between @c 0 and 1 - * @param[out] animatedValue The animated value for the current time passed as the input parameter - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has not been properly constructed. - * @exception E_SYSTEM A system error has occurred. - * - */ result GetAnimatedValue(float actualProgress, int& animatedValue) const; - /** - * The start value of the animation - */ Tizen::Base::Integer startValue; - - /** - * The end value of the animation - */ Tizen::Base::Integer endValue; - private: - /** - * Private copy constructor. - */ _IntegerAnimationImpl(const _IntegerAnimationImpl& rhs); - - /** - * Private assignment operator. - */ _IntegerAnimationImpl& operator =(const _IntegerAnimationImpl& rhs); - - /** - * This is object of IntegerAnimation class - * - */ IntegerAnimation* __pIntegerAnimation; }; //_IntegerAnimationImpl diff --git a/src/ui/animations/FUiAnim_PointAnimationImpl.h b/src/ui/animations/FUiAnim_PointAnimationImpl.h index 33b77fd..3e1a08f 100644 --- a/src/ui/animations/FUiAnim_PointAnimationImpl.h +++ b/src/ui/animations/FUiAnim_PointAnimationImpl.h @@ -36,69 +36,19 @@ class _PointAnimationImpl { public: - /** - * Destructor for %_PointAnimationImpl class. - */ - ~_PointAnimationImpl(void); - - /** - * Default constructor for %_PointAnimationImpl class. - */ _PointAnimationImpl(PointAnimation* pPoint); + ~_PointAnimationImpl(void); - /** - * To copy float animation object - * - * @since 2.0 - * @return An error code - * @param[in] pointAnimation Point animation object - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result CopyPointAnimationValue(const PointAnimation& pointAnimation); - /** - * Gets the animated value for the current time. - * - * @since 2.0 - * @return An error code - * @param[in] actualProgress The current time value of the animation @n - * The value should be between @c 0 and 1 - * @param[out] animatedValue The animated value for the current time passed as the input parameter - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has not been properly constructed. - * @exception E_SYSTEM A system error has occurred. - * - */ result GetAnimatedValue(float actualProgress, Tizen::Graphics::Point& animatedValue) const; - /** - * The start value of the animation - */ Tizen::Graphics::Point startValue; - - /** - * The end value of the animation - */ Tizen::Graphics::Point endValue; - private: - /** - * Private copy constructor. - */ _PointAnimationImpl(const _PointAnimationImpl& rhs); - - /** - * Private assignment operator. - */ _PointAnimationImpl& operator =(const _PointAnimationImpl& rhs); - - /** - * This is object of PointAnimation class - */ PointAnimation* __pPointAnimation; }; // _PointAnimationImpl diff --git a/src/ui/animations/FUiAnim_RectangleAnimationImpl.h b/src/ui/animations/FUiAnim_RectangleAnimationImpl.h index e77baf3..b91e81d 100644 --- a/src/ui/animations/FUiAnim_RectangleAnimationImpl.h +++ b/src/ui/animations/FUiAnim_RectangleAnimationImpl.h @@ -36,78 +36,22 @@ class _RectangleAnimationImpl { public: - /** - * Destructor for %_RectangleAnimationImpl class. - */ - ~_RectangleAnimationImpl(void); - - /** - * Default constructor for %_RectangleAnimationImpl class. - */ _RectangleAnimationImpl(RectangleAnimation* pRectangle); + ~_RectangleAnimationImpl(void); - /** - * To copy Point animation object - * - * @since 2.0 - * @return An error code - * @param[in] rectangleAnimation Rectangle animation object - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @exception E_INVALID_ARG A specified input parameter is invalid. - */ result CopyRectangleAnimationValue(const RectangleAnimation& rectangleAnimation); - /** - * Gets the animated value for the current time. - * - * @since 2.0 - * @return An error code - * @param[in] actualProgress The current time value of the animation @n - * The value should be between @c 0 and 1 - * @param[out] animatedValue The animated value for the current time passed as the input parameter - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. - * @exception E_INVALID_STATE This instance has not been properly constructed. - * @exception E_SYSTEM A system error has occurred. - * - */ result GetAnimatedValue(float actualProgress, Tizen::Graphics::Rectangle& animatedValue) const; - /** - * The Anchor X value for scaling - */ float anchorX; - - /** - * The Anchor Y value for scaling - */ float anchorY; - /** - * The start value of the animation - */ Tizen::Graphics::Rectangle startValue; - - /** - * The end value of the animation - */ Tizen::Graphics::Rectangle endValue; private: - /** - * Private copy constructor. - */ _RectangleAnimationImpl(const _RectangleAnimationImpl& rhs); - - /** - * Private assignment operator. - */ _RectangleAnimationImpl& operator =(const _RectangleAnimationImpl& rhs); - - /** - * This is object of RectangleAnimation class - */ RectangleAnimation* __pRectangleAnimation; }; // _RectangleAnimationImpl diff --git a/src/ui/animations/FUiAnim_RotateAnimationImpl.h b/src/ui/animations/FUiAnim_RotateAnimationImpl.h index 365300b..ac33599 100644 --- a/src/ui/animations/FUiAnim_RotateAnimationImpl.h +++ b/src/ui/animations/FUiAnim_RotateAnimationImpl.h @@ -36,40 +36,15 @@ class _RotateAnimationImpl { public: - /** - * Destructor for %_RotateAnimationImpl class. - */ - ~_RotateAnimationImpl(void); - - /** - * Default constructor for %_RotateAnimationImpl class. - */ _RotateAnimationImpl(RotateAnimation* pRotate); + ~_RotateAnimationImpl(void); - /** - * The Anchor X value for scaling - */ float anchorX; - - /** - * The Anchor Y value for scaling - */ float anchorY; private: - /** - * Private copy constructor. - */ _RotateAnimationImpl(const _RotateAnimationImpl& rhs); - - /** - * Private assignment operator. - */ _RotateAnimationImpl& operator =(const _RotateAnimationImpl& rhs); - - /** - * This is object of RotateAnimation class - */ Tizen::Ui::Animations::RotateAnimation* __pRotateAnimation; }; // _RotateAnimationImpl diff --git a/src/ui/animations/FUiAnim_TransactionNode.cpp b/src/ui/animations/FUiAnim_TransactionNode.cpp index a42dbe9..93d39ab 100644 --- a/src/ui/animations/FUiAnim_TransactionNode.cpp +++ b/src/ui/animations/FUiAnim_TransactionNode.cpp @@ -33,10 +33,14 @@ #include "FUi_Math.h" #include "FUi_EcoreEvas.h" + +#include "FUiAnim_VisualElementImpl.h" + #include "FUiAnim_VisualElementValueAnimationImpl.h" #include "FUiAnim_VisualElementAnimationKeyFrame.h" #include "FUiAnim_TransactionNode.h" -#include "FUiAnim_Debug.h" +#include "FUiAnim_AnimationGroupNode.h" + using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -46,9 +50,6 @@ using namespace Tizen::Base::Collection; namespace Tizen { namespace Ui { namespace Animations { -#define TN_CAST(_T) static_cast< _TransactionNode* >(_T) -#define TN_CONST_CAST(_T) static_cast< _TransactionNode* >(const_cast< Object* >(_T)) - #define AD_CAST(_AD) static_cast< _AnimationData* >(_AD) #define AD_CONST_CAST(_AD) static_cast< _AnimationData* >(const_cast< Object* >(_AD)) @@ -99,10 +100,6 @@ _AnimationData::_AnimationData(VisualElement& target, const Tizen::Base::String* long repeatCount = __animation.IsAutoReverseEnabled() ? __animation.GetRepeatCount() * 2 : __animation.GetRepeatCount(); __totalDuration = __animation.GetDelay() + (__animation.GetDuration() * repeatCount - __animation.GetOffset()); - -#ifdef VE_DEBUG_MODULE - __tick = 0; -#endif } _AnimationData::~_AnimationData(void) @@ -147,13 +144,6 @@ _AnimationData::SetBaseTime(unsigned int baseTime) __forward = true; } -#ifdef VE_DEBUG_MODULE - if (_VeDebug::IsDebugEnabled()) - { - __tick = baseTime; - } -#endif - return E_SUCCESS; } @@ -189,25 +179,22 @@ _AnimationData::CalculateValueByTime(unsigned int currentTime) long duration = 0; long offset = 0; - // Set current Time -#ifdef VE_DEBUG_MODULE - if (_VeDebug::IsDebugEnabled()) - { - currentTime = __tick; - __tick += 16; - } -#endif - - if (__status == _STATUS_END) + switch(__status) { + case _STATUS_FINISHING: + __status = _STATUS_FINISH; return Variant(); - } - if (__status == _STATUS_STOP) - { + case _STATUS_FINISH: __status = _STATUS_END; + return Variant(); - return CalculateValue(); + case _STATUS_END: + return Variant(); + + default: + // nothing to do + break; } // Clac progress @@ -291,7 +278,7 @@ _AnimationData::CalculateValueByTime(unsigned int currentTime) __forward = true; __progress = (__animation.IsAutoReverseEnabled() ? 0.0f : 1.0f); - __status = _STATUS_STOP; + __status = _STATUS_FINISHING; } else if (__currentRepeatCount > oldRepeatCount) { @@ -502,24 +489,18 @@ _AnimationData::CalculateValue(void) } void -_AnimationData::NotifyAnimationStatus(bool completed) +_AnimationData::NotifyAnimationStarted(void) { - if (__status == _STATUS_END) - { - return; - } - - IVisualElementAnimationStatusEventListener* pListener = _VisualElementAnimationImpl::GetInstance(__animation)->GetStatusEventListener(); - if (pListener == null) + if (__status != _STATUS_START && __status != _STATUS_REPEAT) { return; } _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); - if (completed == false) + IVisualElementAnimationStatusEventListener* pListener = pAnimationImpl->GetStatusEventListener(); + if (pListener == null) { - pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), false); return; } @@ -533,10 +514,6 @@ _AnimationData::NotifyAnimationStatus(bool completed) pListener->OnVisualElementAnimationRepeated(__animation, __name, pAnimationImpl->GetEventTarget(), __currentRepeatCount); break; - case _AnimationData::_STATUS_STOP: - pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), true); - break; - default: break; } @@ -550,19 +527,19 @@ _AnimationData::NotifyAnimationFinished(bool completed) return; } - if (__status != _STATUS_STOP) + if (__status != _STATUS_FINISH) { - __status = _STATUS_STOP; + __status = _STATUS_FINISH; } - IVisualElementAnimationStatusEventListener* pListener = _VisualElementAnimationImpl::GetInstance(__animation)->GetStatusEventListener(); + _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); + + IVisualElementAnimationStatusEventListener* pListener = pAnimationImpl->GetStatusEventListener(); if (pListener == null) { return; } - _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); - pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), completed); } @@ -605,9 +582,6 @@ _TransactionNode::_TransactionNode(void) , __isReservedRemove(false) , __isInAnimationTick(false) , __status(_STATUS_READY) - , __baseTime(0) - , __adjustedBaseTime(0) - , __currentRepeatCount(1) { ClearLastResult(); @@ -634,9 +608,6 @@ _TransactionNode::_TransactionNode(const _TransactionNode& node) , __isReservedRemove(false) , __isInAnimationTick(false) , __status(_STATUS_READY) - , __baseTime(0) - , __adjustedBaseTime(0) - , __currentRepeatCount(1) { ClearLastResult(); @@ -657,7 +628,7 @@ _TransactionNode::_TransactionNode(const _TransactionNode& node) _TransactionNode::~_TransactionNode(void) { - __children.RemoveAll(true); + __children.RemoveAllChildren(); __pendingAnimations.RemoveAll(true); @@ -753,7 +724,7 @@ _TransactionNode::GetChild(int transactionId) const for (int index = 0; index < childrenCount; index++) { - pChild = TN_CONST_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->GetId() == transactionId) { @@ -778,13 +749,13 @@ _TransactionNode::GetLastChild(void) const SysTryReturn(NID_UI_ANIM, index >= 0, null, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This node has no child."); - return TN_CONST_CAST(__children.GetAt(index)); + return __children.GetChildAt(index); } result _TransactionNode::AddChild(_TransactionNode& child) { - result r = __children.Add(child); + result r = __children.Add(&child); SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Propagating."); child.SetParent(*this); @@ -808,7 +779,7 @@ _TransactionNode::RemoveChild(int transactionId) for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->GetId() == transactionId) { @@ -816,10 +787,6 @@ _TransactionNode::RemoveChild(int transactionId) { pChild->RemoveAll(); - pChild->ReservedRemove(); - - pChild->NotifyTransactionStatus(false); - RemoveChild(*pChild); } break; @@ -838,42 +805,42 @@ _TransactionNode::RemoveChild(_TransactionNode& child) } else { - result r = __children.Remove(child, true); + result r = __children.Remove(&child); + delete &child; SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to remove child.", GetErrorMessage(r)); } } void -_TransactionNode::RemoveAll(void) //TODO: rename RemoveAll() +_TransactionNode::RemoveAll(void) { + ReservedRemove(true); + _TransactionNode* pChild = null; int childrenCount = GetChildrenCount(); for (int index = childrenCount-1; index >= 0; index--) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->IsReservedRemove() == false) { pChild->RemoveAll(); - pChild->ReservedRemove(true); - - pChild->NotifyTransactionStatus(false); - RemoveChild(*pChild); } } RemoveAllAnimations(); + + NotifyTransactionFinished(false); } int _TransactionNode::GetAnimationCount(void) const { - //TODO: make exactly return __animations.GetCount(); } @@ -947,7 +914,6 @@ _TransactionNode::AddAnimationData(_AnimationData& animationData) __animations.Add(pTarget, pAnimationList); } - // base time for root animationData.SetBaseTime(_AnimationTime::GetTime()); animationData.SetPendingMode(_AnimationData::_PENDING_MODE_NONE); @@ -1111,17 +1077,25 @@ _TransactionNode::RemoveChildrenAnimation(VisualElement& target, const String& k for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pGroup = dynamic_cast< _AnimationGroupNode* >(pChild); if (pGroup != null && pGroup->IsEqual(target, keyName)) { - pChild->NotifyTransactionStatus(false); + if (pChild->IsReservedRemove() == false) + { + pChild->RemoveAll(); - RemoveChild(*pChild); - return E_SUCCESS; + RemoveChild(*pChild); + return E_SUCCESS; + } + else + { + return E_OBJ_NOT_FOUND; + } } - else if (pChild->RemoveChildrenAnimation(target, keyName) == E_SUCCESS) + + if (pChild->RemoveChildrenAnimation(target, keyName) == E_SUCCESS) { return E_SUCCESS; } @@ -1200,7 +1174,7 @@ _TransactionNode::RemoveChildrenAnimationByProperty(VisualElement& target, const for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pChild->RemoveChildrenAnimationByProperty(target, property); } @@ -1231,8 +1205,6 @@ _TransactionNode::RemoveAllAnimations(void) } delete pKeyList; - - __animations.RemoveAll(); } void @@ -1284,13 +1256,15 @@ _TransactionNode::RemoveChildrenAllAnimations(VisualElement& target) for (int index = childrenCount-1; index >= 0; index--) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pChild->RemoveChildrenAllAnimations(target); if (pChild->IsReservedRemove() == false && pChild->IsCommitted() == true && pChild->IsEmpty() == true) { - pChild->NotifyTransactionStatus(false); + pChild->ReservedRemove(); + + pChild->NotifyTransactionFinished(false); RemoveChild(*pChild); } @@ -1363,7 +1337,7 @@ _TransactionNode::GetChildrenAnimation(VisualElement& target, const String& keyN for (int index = 0; index < childrenCount; index++) { - pChild = TN_CONST_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pGroup = dynamic_cast< _AnimationGroupNode* >(pChild); if (pGroup != null && pGroup->IsEqual(target, keyName)) @@ -1451,7 +1425,7 @@ _TransactionNode::GetChildrenAnimationByProperty(VisualElement& target, const St for (int index = 0; index < childrenCount; index++) { - pChild = TN_CONST_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pAnimation = pChild->GetChildrenAnimationByProperty(target, property); @@ -1465,20 +1439,17 @@ _TransactionNode::GetChildrenAnimationByProperty(VisualElement& target, const St } void -_TransactionNode::SetBaseTime(unsigned int baseTime) +_TransactionNode::DrawTargets(void) { - if (GetAnimationCount() <= 0) - { - return; - } - IMapEnumeratorT* pMapEnum = __animations.GetMapEnumeratorN(); + VisualElement* pTarget = null; ArrayList* pAnimationList = null; - _AnimationData* pAnimationData = null; + //TODO: Check dep. while (pMapEnum->MoveNext() == E_SUCCESS) { + pMapEnum->GetKey(pTarget); pMapEnum->GetValue(pAnimationList); if (pAnimationList == null) @@ -1486,13 +1457,16 @@ _TransactionNode::SetBaseTime(unsigned int baseTime) continue; } - int animationCount = pAnimationList->GetCount(); + _VisualElementImpl* pPresentationImpl = _VisualElementImpl::GetInstance(*pTarget); - for (int index = 0; index < animationCount; index++) + if (pPresentationImpl) { - pAnimationData = AD_CAST(pAnimationList->GetAt(index)); + _VisualElementImpl* pModelImpl = pPresentationImpl->__pModel; - pAnimationData->SetBaseTime(baseTime); + if (pModelImpl) + { + pModelImpl->DrawForAnimation(); + } } } @@ -1500,21 +1474,49 @@ _TransactionNode::SetBaseTime(unsigned int baseTime) } void +_TransactionNode::SetBaseTime(unsigned int baseTime) +{ +} + +void _TransactionNode::SetChildrenBaseTime(unsigned int baseTime, bool self) { if (self == true) { - __baseTime = baseTime; - __adjustedBaseTime = __baseTime; + SetBaseTime(baseTime); + } + + // Animations + if (GetAnimationCount() > 0) + { + IMapEnumeratorT* pMapEnum = __animations.GetMapEnumeratorN(); - if (__status == _STATUS_END) + ArrayList* pAnimationList = null; + _AnimationData* pAnimationData = null; + + while (pMapEnum->MoveNext() == E_SUCCESS) { - __status = _STATUS_READY; + pMapEnum->GetValue(pAnimationList); + + if (pAnimationList == null) + { + continue; + } + + int animationCount = pAnimationList->GetCount(); + + for (int index = 0; index < animationCount; index++) + { + pAnimationData = AD_CAST(pAnimationList->GetAt(index)); + + pAnimationData->SetBaseTime(baseTime); + } } - } - SetBaseTime(baseTime); + delete pMapEnum; + } + // Children int childrenCount = GetChildrenCount(); if (childrenCount <= 0) @@ -1526,7 +1528,7 @@ _TransactionNode::SetChildrenBaseTime(unsigned int baseTime, bool self) for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); pChild->SetChildrenBaseTime(baseTime, true); } @@ -1570,7 +1572,7 @@ _TransactionNode::IsEmpty(void) const bool _TransactionNode::IsRunning(void) const { - return (__status > _STATUS_READY && __status < _STATUS_STOP); + return (__status > _STATUS_READY && __status < _STATUS_FINISH); } void @@ -1610,7 +1612,7 @@ _TransactionNode::IsInAnimationTick(void) for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->IsInAnimationTick() == true) { @@ -1635,9 +1637,9 @@ _TransactionNode::CalculateProgress(unsigned int currentTime) } void -_TransactionNode::NotifyTransactionStatus(bool completed) +_TransactionNode::NotifyTransactionStarted(void) { - if (__isCommitted == false) + if (__isCommitted == false || __status != _STATUS_START) { return; } @@ -1652,24 +1654,34 @@ _TransactionNode::NotifyTransactionStatus(bool completed) return; } - if (completed == false) + pListener->OnAnimationTransactionStarted(__id); +} + +void +_TransactionNode::NotifyTransactionFinished(bool completed) +{ + if (__isCommitted == false) { - pListener->OnAnimationTransactionStopped(__id); return; } - switch (__status) + IAnimationTransactionEventListener* pListener = null; + + pListener = (__pListener != null) ? __pListener : __pDefaultListener; + + // root transaction doesn't has default listener + if (pListener == null) { - case _STATUS_START: - pListener->OnAnimationTransactionStarted(__id); - break; + return; + } - case _STATUS_STOP: + if (completed == false) + { + pListener->OnAnimationTransactionStopped(__id); + } + else + { pListener->OnAnimationTransactionFinished(__id); - break; - - default: - break; } } @@ -1734,7 +1746,7 @@ _TransactionNode::RemoveAnimationByDuplicatedProperty(_AnimationData& animationD for (int index = 0; index < childrenCount; index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->RemoveAnimationByDuplicatedProperty(animationData)) { @@ -1759,9 +1771,10 @@ _TransactionNode::ProcessPendingAnimations(void) } _AnimationData* pAnimationData = null; + int pendingAnimationCount = __pendingAnimations.GetCount(); - for (int index = 0; index < pendingAnimationCount; index++) + for (int index = pendingAnimationCount - 1; index >= 0; index--) { pAnimationData = AD_CAST(__pendingAnimations.GetAt(index)); @@ -1774,19 +1787,20 @@ _TransactionNode::ProcessPendingAnimations(void) delete pAnimationData; } - break; + __pendingAnimations.RemoveAt(index, false); + break; case _AnimationData::_PENDING_MODE_REMOVE: RemoveAnimationData(*pAnimationData); + + __pendingAnimations.RemoveAt(index, false); break; default: break; } } - - __pendingAnimations.RemoveAll(false); } void @@ -1797,10 +1811,13 @@ _TransactionNode::ProcessAnimationTick(unsigned int tick) return; } + //TODO: Remove because set base time when starts +#if 0 if (__baseTime > tick) // this node is added in animation tick { return; } +#endif CalculateProgress(tick); @@ -1809,10 +1826,7 @@ _TransactionNode::ProcessAnimationTick(unsigned int tick) return; } - if (__status != _STATUS_STOP) - { - NotifyTransactionStatus(true); - } + NotifyTransactionStarted(); if (IsReservedRemove() == true) { @@ -1820,12 +1834,13 @@ _TransactionNode::ProcessAnimationTick(unsigned int tick) } OnAnimationTick(tick); + ProcessPendingAnimations(); _TransactionNode* pChild = null; for (int index = 0; index < GetChildrenCount(); index++) { - pChild = TN_CAST(__children.GetAt(index)); + pChild = __children.GetChildAt(index); if (pChild->IsReservedRemove()) { @@ -1837,11 +1852,11 @@ _TransactionNode::ProcessAnimationTick(unsigned int tick) pChild->ProcessAnimationTick(tick); - if (pChild->__status == _STATUS_STOP) + if (__status == _STATUS_FINISH || pChild->__status == _STATUS_FINISH) { pChild->ReservedRemove(); - pChild->NotifyTransactionStatus(true); + pChild->NotifyTransactionFinished(true); if (pChild->IsRemovable()) // only nested group { @@ -1857,7 +1872,7 @@ _TransactionNode::ProcessAnimationTick(unsigned int tick) if (IsEmpty() == true) { - __status = _STATUS_STOP; + __status = _STATUS_FINISH; } } @@ -1894,19 +1909,6 @@ _TransactionNode::OnAnimationTick(unsigned int tick) { pAnimationData = AD_CAST(pAnimationList->GetAt(index)); - // Send finish notification - if (pAnimationData->GetStatus() == _AnimationData::_STATUS_STOP) - { - SetAnimationDataAsPending(*pAnimationData, true, true); - - //TODO: refactoring for group - if (IsRemovable() == false) - { - pAnimationData->SetPendingMode(_AnimationData::_PENDING_MODE_NONE); - __pendingAnimations.Remove(*pAnimationData, false); - } - } - if (pAnimationData->IsRemoved()) { continue; @@ -1921,221 +1923,27 @@ _TransactionNode::OnAnimationTick(unsigned int tick) } // Send start, repeat notification - if (pAnimationData->GetStatus() != _AnimationData::_STATUS_STOP) - { - pAnimationData->NotifyAnimationStatus(true); - } + pAnimationData->NotifyAnimationStarted(); pAnimationData->OnTickOccurred(*pTarget, currentValue); + + if (__status == _STATUS_FINISH || pAnimationData->GetStatus() == _AnimationData::_STATUS_FINISH) + { + SetAnimationDataAsPending(*pAnimationData, true, true); + + //TODO: refactoring for group + if (IsRemovable() == false) + { + pAnimationData->SetPendingMode(_AnimationData::_PENDING_MODE_NONE); + __pendingAnimations.Remove(*pAnimationData, false); + } + } } } delete pMapEnum; __isInAnimationTick = false; - - ProcessPendingAnimations(); -} - -_AnimationGroupNode::_AnimationGroupNode(VisualElement& target, const Tizen::Base::String* pName, VisualElementAnimation& animation) - : _TransactionNode() - , __target(target) - , __animation(animation) - , __deleteAnimation(false) - , __totalDuration(0) - , __progress(0.0f) -{ - if (pName != null) - { - __name = *pName; - } - - _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(animation); - - result r = CopyAnimationValue(*pAnimationImpl); - SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to copy the animation value.", GetErrorMessage(r)); - - // __pAnimation->GetRepeatCount() == 0 infinite - __totalDuration = __animation.GetDelay() + (__animation.GetDuration() * __animation.GetRepeatCount()) - __animation.GetOffset(); - - if (GetDuration() == 0) - { - SetDuration(1); - SetRepeatCount(1); - } - -#ifdef VE_DEBUG_MODULE - __tick = 0; -#endif -} - -_AnimationGroupNode::~_AnimationGroupNode(void) -{ - if (__deleteAnimation == true) - { - delete &__animation; - } -} - -VisualElementAnimation& -_AnimationGroupNode::GetAnimation(void) const -{ - return __animation; -} - -bool -_AnimationGroupNode::IsEqual(VisualElement& target, const Tizen::Base::String& keyName) const -{ - return (&__target == &target && __name == keyName); -} - -void -_AnimationGroupNode::Commit(void) -{ - __isCommitted = true; - - if (dynamic_cast< _AnimationGroupNode* > (__pParent) == null) - { - __deleteAnimation = true; - } -} - -bool -_AnimationGroupNode::IsRemovable(void) const -{ - return (__pParent->IsRemovable() && __currentRepeatCount == GetRepeatCount()); -} - -void -_AnimationGroupNode::CalculateProgress(unsigned int currentTime) -{ - long oldRepeatCount = 0; - long repeatCount = 0; - long delay = 0; - long duration = 0; - long offset = 0; - - // Set current Time -#ifdef VE_DEBUG_MODULE - if (_VeDebug::IsDebugEnabled()) - { - __tick += 16; - } -#endif - - if (__status == _STATUS_END) - { - return; - } - - if (__status == _STATUS_STOP) - { - __status = _STATUS_END; - - return; - } - - if (GetScaleRatio() > 0.f) - { - currentTime = (unsigned int) ((currentTime - __baseTime) / GetScaleRatio()); // Apply time scale value - } - - delay = GetDelay(); - - if (currentTime < (unsigned int)(delay)) - { - // Not started - __currentRepeatCount = 1; - __progress = -1.0f; - - return; - } - - offset = __animation.GetOffset(); - repeatCount = __animation.GetRepeatCount(); - duration = __animation.GetDuration(); - if (duration == 0) - { - duration = 1; - repeatCount = 1; - } - - oldRepeatCount = __currentRepeatCount; - __currentRepeatCount = ((currentTime - delay + offset) / duration) + 1; - - __progress = static_cast< float >(currentTime - (delay + duration * (__currentRepeatCount - 1) - offset)) / static_cast< float >(duration); - - if (__status == _STATUS_READY) - { - __status = _STATUS_START; - __adjustedBaseTime = delay - offset; // __currentRepeatCount is always 1 - - SetChildrenBaseTime(__baseTime + __adjustedBaseTime, false); - } - else if (repeatCount > 0 && currentTime >= __totalDuration) // infinite loop if repeatCount == 0 - { - __currentRepeatCount = repeatCount; - __progress = 1.0f; - - __status = _STATUS_STOP; - } - else if (__currentRepeatCount > oldRepeatCount) - { - __status = _STATUS_REPEAT; - __adjustedBaseTime = delay + duration * (__currentRepeatCount - 1) - offset; - - SetChildrenBaseTime(__baseTime + __adjustedBaseTime, false); - } - else - { - __status = _STATUS_RUNNING; - } -} - -void -_AnimationGroupNode::NotifyTransactionStatus(bool completed) -{ - if (__status == _STATUS_END) - { - return; - } - if (__isCommitted == false) - { - return; - } - - _VisualElementAnimationImpl* pAnimationImpl = _VisualElementAnimationImpl::GetInstance(__animation); - - IVisualElementAnimationStatusEventListener* pListener = pAnimationImpl->GetStatusEventListener(); - - if (pListener == null) - { - return; - } - - if (completed == false) - { - pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), false); - return; - } - - switch (__status) - { - case _STATUS_START: - pListener->OnVisualElementAnimationStarted(__animation, __name, pAnimationImpl->GetEventTarget()); - break; - - case _STATUS_REPEAT: - pListener->OnVisualElementAnimationRepeated(__animation, __name, pAnimationImpl->GetEventTarget(), __currentRepeatCount); - break; - - case _STATUS_STOP: - pListener->OnVisualElementAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), true); - break; - - default: - break; - } } diff --git a/src/ui/animations/FUiAnim_TransactionNode.h b/src/ui/animations/FUiAnim_TransactionNode.h index b073664..3dd56c0 100644 --- a/src/ui/animations/FUiAnim_TransactionNode.h +++ b/src/ui/animations/FUiAnim_TransactionNode.h @@ -26,14 +26,13 @@ #define _FUI_ANIM_INTERNAL_TRANSACTION_NODE_H_ #include -#include +#include #include #include "FUiAnim_VisualElementAnimationImpl.h" -#include "FUiAnim_Debug.h" - #include "FUiAnim_VariantEx.h" +#include "FUiAnim_Debug.h" namespace Tizen { namespace Ui { namespace Animations { @@ -56,7 +55,8 @@ public: _STATUS_START, _STATUS_RUNNING, _STATUS_REPEAT, - _STATUS_STOP, + _STATUS_FINISHING, + _STATUS_FINISH, _STATUS_END }; @@ -90,7 +90,7 @@ public: Variant CalculateValueByTime(unsigned int currentTime); - void NotifyAnimationStatus(bool completed); + void NotifyAnimationStarted(void); void NotifyAnimationFinished(bool completed); void OnTickOccurred(VisualElement& target, const Tizen::Ui::Variant& currentValue); @@ -121,10 +121,6 @@ private: _AnimationStatus __status; _PendingMode __pendingMode; - -#ifdef VE_DEBUG_MODULE - unsigned int __tick; -#endif }; // _AnimationData class _TransactionNode @@ -137,7 +133,8 @@ public: _STATUS_START, _STATUS_RUNNING, _STATUS_REPEAT, - _STATUS_STOP, + _STATUS_FINISHING, + _STATUS_FINISH, _STATUS_END }; @@ -168,6 +165,8 @@ public: void RemoveChild(int transactionId); void RemoveChild(_TransactionNode& child); + void RemoveAll(void); + int GetAnimationCount(void) const; result AddAnimation(VisualElement& target, const Tizen::Base::String* pKeyName, VisualElementAnimation& animation); result RemoveChildrenAnimation(VisualElement& target, const Tizen::Base::String& keyName); @@ -177,7 +176,10 @@ public: const VisualElementAnimation* GetChildrenAnimation(VisualElement& target, const Tizen::Base::String& keyName) const; const VisualElementAnimation* GetChildrenAnimationByProperty(VisualElement& target, const Tizen::Base::String& property) const; + void DrawTargets(void); + void SetChildrenBaseTime(unsigned int baseTime, bool self = true); + virtual void SetBaseTime(unsigned int baseTime); virtual void Commit(void); bool IsCommitted(bool ancestors = false) const; @@ -187,15 +189,14 @@ public: bool IsRunning(void) const; virtual bool IsRemovable(void) const; - virtual void NotifyTransactionStatus(bool completed); + virtual void NotifyTransactionStarted(void); + virtual void NotifyTransactionFinished(bool completed); void ProcessAnimationTick(unsigned int tick); private: _TransactionNode& operator =(const _TransactionNode& rhs); - void RemoveAll(void); - result AddAnimationData(_AnimationData& animationData); void RemoveAnimationData(_AnimationData& animationData); result SetAnimationDataAsPending(_AnimationData& animationData, bool remove, bool completed = false); @@ -211,8 +212,6 @@ private: const VisualElementAnimation* GetAnimation(VisualElement& target, const Tizen::Base::String& property) const; const VisualElementAnimation* GetAnimationByProperty(VisualElement& target, const Tizen::Base::String& property) const; - void SetBaseTime(unsigned int baseTime); - void ReservedRemove(bool remove = true); bool IsReservedRemove(void) const; @@ -241,51 +240,45 @@ protected: _TransactionStatus __status; - unsigned int __baseTime; - unsigned int __adjustedBaseTime; - long __currentRepeatCount; + class ChildrenListT : public Tizen::Base::Collection::ArrayListT<_TransactionNode*> + { + public: + _TransactionNode* GetChildAt(int index) const + { + _TransactionNode* pChild = null; + + if (likely(GetAt(index, pChild) == E_SUCCESS)) + { + return pChild; + } + + return null; + } + + void RemoveAllChildren(void) + { + _TransactionNode* pChild = null; + + int childrenCount = GetCount(); + + for (int index = 0; index < childrenCount; index++) + { + if (likely(GetAt(index, pChild) == E_SUCCESS)) + { + delete pChild; + } + } + + RemoveAll(); + } + }; + + ChildrenListT __children; - Tizen::Base::Collection::ArrayList __children; Tizen::Base::Collection::ArrayList __pendingAnimations; Tizen::Base::Collection::HashMapT __animations; }; // _TransactionNode -class _AnimationGroupNode - : public _TransactionNode -{ -public: - _AnimationGroupNode(VisualElement& target, const Tizen::Base::String* pName, VisualElementAnimation& animation); - virtual ~_AnimationGroupNode(void); - - VisualElementAnimation& GetAnimation(void) const; - bool IsEqual(VisualElement& target, const Tizen::Base::String& keyName) const; - - virtual void Commit(void); - - virtual bool IsRemovable(void) const; - - virtual void NotifyTransactionStatus(bool completed); - -private: - _AnimationGroupNode(void); - _AnimationGroupNode(const _AnimationGroupNode& rhs); - _AnimationGroupNode& operator =(const _AnimationGroupNode& rhs); - - virtual void CalculateProgress(unsigned int currentTime); - - VisualElement& __target; - Tizen::Base::String __name; - VisualElementAnimation& __animation; - bool __deleteAnimation; - - unsigned int __totalDuration; - float __progress; - -#ifdef VE_DEBUG_MODULE - unsigned int __tick; -#endif -}; // _AnimationGroupNode - }}} // Tizen::Ui::Animations #endif // _FUI_ANIM_INTERNAL_TRANSACTION_NODE_H_ diff --git a/src/ui/animations/FUiAnim_VisualElementAnimationKeyFrame.h b/src/ui/animations/FUiAnim_VisualElementAnimationKeyFrame.h index 462d940..4f6e70f 100644 --- a/src/ui/animations/FUiAnim_VisualElementAnimationKeyFrame.h +++ b/src/ui/animations/FUiAnim_VisualElementAnimationKeyFrame.h @@ -42,52 +42,13 @@ class _VisualElementAnimationKeyFrameInfo : public Tizen::Base::Object { public: - - // - // This is the default constructor for this class. - // _VisualElementAnimationKeyFrameInfo(float time, const Variant& value, const IVisualElementAnimationTimingFunction* pTimingFunction); - - // - // This is the destructor for this class. - // virtual ~_VisualElementAnimationKeyFrameInfo(void); - - // - // Equals Function. - // virtual bool Equals(const Tizen::Base::Object& obj) const; - /** - * Gets time of the keyframe. - * - * @since 2.0 - * @return Time of the keyframe - */ float GetTime(void) const; - - /** - * Gets animation value of the keyframe. - * - * @since 2.0 - * @return Animation value of the keyframe - */ Variant GetValue(void) const; - - /** - * Gets animation extended value of the keyframe. - * - * @since 2.0 - * @return Animation value of the keyframe - */ _VariantEx GetValueEx(void) const; - - /** - * Gets timing function of the keyframe. - * - * @since 2.0 - * @return Timing function of the keyframe - */ const IVisualElementAnimationTimingFunction* GetTimingFunction(void) const; private: @@ -113,70 +74,17 @@ class _VisualElementAnimationKeyFrame : public Tizen::Base::Object { public: - - // - // This is the default constructor for this class. - // _VisualElementAnimationKeyFrame(void); - - // - // This is the destructor for this class. - // virtual ~_VisualElementAnimationKeyFrame(void); - - // - // Equals Function. - // virtual bool Equals(const Tizen::Base::Object& obj) const; - /** - * Gets the copied instance of the class. - * - * @since 2.0 - * @return The copied instance - */ _VisualElementAnimationKeyFrame* CloneN(void) const; - /** - * Gets the count of key frame - * - * @since 2.0 - */ int GetCount(void) const; - /** - * Add key frame infomation for animation. - * - * @since 2.0 - * @return An error code - * @param[in] time specific time value. This must be in 0.0~1.0 and can't be 0.0 & 1.0. - * @param[in] value key frame value. - * @param[in] timingFunction timing function instance that is used in keyframe segment. - */ result AddKeyFrame(float time, const Tizen::Ui::Variant& value, const IVisualElementAnimationTimingFunction* pTimingFunction); - - /** - * Remove key frame infomation for animation. - * - * @since 2.0 - * @return An error code - * @param[in] time specific time value. All information(KeyValue, timingFunction) with time will be removed. - */ result RemoveKeyFrame(float time); - - /** - * Remove all key frame infomation for animation. - * - * @since 2.0 - * @return An error code - */ void RemoveAllKeyFrames(void); - - /* - * Get the key frame information at the spectified index. - * - * @since 2.0 - */ _VisualElementAnimationKeyFrameInfo* GetKeyFrameInfoAt(int index) const; private: diff --git a/src/ui/animations/FUiAnim_VisualElementAnimationTiming.h b/src/ui/animations/FUiAnim_VisualElementAnimationTiming.h index e74db36..eb3e298 100644 --- a/src/ui/animations/FUiAnim_VisualElementAnimationTiming.h +++ b/src/ui/animations/FUiAnim_VisualElementAnimationTiming.h @@ -42,123 +42,28 @@ class _VisualElementAnimationTiming : public Tizen::Base::Object { public: - - // - // This is the default constructor for this class. - // _VisualElementAnimationTiming(void); - - // - // This is the destructor for this class. - // virtual ~_VisualElementAnimationTiming(void); - /** - * Gets the duration of the animation. - * - * @since 2.0 - * @return The duration of the animation in ms - */ long GetDuration(void) const; - - /** - * Sets the duration of the animation in ms. - * - * @since 2.0 - * @param[in] duration The duration of the animation in ms - */ void SetDuration(long duration); - /** - * Gets the time offset of the animation. - * - * @since 2.0 - * @return The time offset of the animation in ms - */ long GetOffset(void) const; - - /** - * Sets the time offset of the animation in ms. - * - * @since 2.0 - * @param[in] timeOffset The time offset of the animation in mss - */ void SetOffset(long offset); - /** - * Gets the time delay of the animation. - * - * @since 2.0 - * @return The time delay of the animation in ms - */ long GetDelay(void) const; - - /** - * Sets the time delay of the animation in ms. - * - * @since 2.0 - * @param[in] timeDelay The start time of the animation in ms - */ void SetDelay(long delay); - /** - * Gets the repeat count of the animation. - * - * @since 2.0 - * @return The repeat count of the animation - */ long GetRepeatCount(void) const; - - /** - * Sets the repeat count of the animation. - * - * @since 2.0 - * @param[in] repeatCount The repeat count of the animation - * @remarks If repeatCount is 0, the animation will be repeated infinitely. - */ void SetRepeatCount(long repeatCount); - /** - * Gets the time scale value of the animation. - * - * @since 2.0 - * @return The time scale value of the animation - */ float GetScaleRatio(void) const; - - /** - * Sets the time scale value of the animation. - * - * @since 2.0 - * @param[in] scale The time scale of the animation - * @remarks If this value is 2.0, then the animation speed is 2 times fast. - */ void SetScaleRatio(float scale); - /** - * Checks whether the animation plays backwards after it finishes playing forwards. - * - * @since 2.0 - * @return @c true if the animation plays backwards after it finishes playing forwards @n - * @c false, otherwise - */ bool IsAutoReverseEnabled(void) const; - - /** - * Sets the flag to play backwards after the animation finishes playing forwards. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable auto reverse @n - * @c false, otherwise - */ void SetAutoReverseEnabled(bool enable); private: - /** - * This is the default constructor for this class. - * - * @param[in] rhs A pointer to the Object instance which contains this instance. - */ _VisualElementAnimationTiming(const _VisualElementAnimationTiming& rhs); _VisualElementAnimationTiming& operator =(const _VisualElementAnimationTiming& rhs); diff --git a/src/ui/animations/FUiAnim_VisualElementAnimationVariantInterpolator.cpp b/src/ui/animations/FUiAnim_VisualElementAnimationVariantInterpolator.cpp index f74398b..aa30523 100644 --- a/src/ui/animations/FUiAnim_VisualElementAnimationVariantInterpolator.cpp +++ b/src/ui/animations/FUiAnim_VisualElementAnimationVariantInterpolator.cpp @@ -25,15 +25,22 @@ #include #include -#include -#include -#include #include -#include #include -#include + +#include #include +#include +#include + +#include +#include +#include + +#include + + #include "FUiAnim_VariantEx.h" #include "FUiAnim_VisualElementAnimationVariantInterpolator.h" @@ -83,22 +90,28 @@ _VisualElementAnimationVariantInterpolator::Interpolate(float progress, const Ti } break; - case VARIANT_TYPE_LONG: + case VARIANT_TYPE_UINT: { - long start = startValue.ToLong(); - long end = endValue.ToLong(); + unsigned int start = startValue.ToUInt(); + unsigned int end = endValue.ToUInt(); - - value = static_cast< long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); + value = static_cast< unsigned int >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); } break; - case VARIANT_TYPE_LONGLONG: + case VARIANT_TYPE_BOOL: { - long long start = startValue.ToLongLong(); - long long end = endValue.ToLongLong(); + bool start = startValue.ToBool(); + bool end = endValue.ToBool(); - value = static_cast< long long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); + if (progress > 0.0f) + { + value = end; + } + else + { + value = start; + } } break; @@ -120,34 +133,72 @@ _VisualElementAnimationVariantInterpolator::Interpolate(float progress, const Ti } break; - case VARIANT_TYPE_RECTANGLE: + case VARIANT_TYPE_LONG: { - const Tizen::Graphics::Rectangle& start = startValue.ToRectangle(); - const Tizen::Graphics::Rectangle& end = endValue.ToRectangle(); - Tizen::Graphics::Rectangle rect; + long start = startValue.ToLong(); + long end = endValue.ToLong(); - rect.x = static_cast< int >(static_cast< float >(start.x) * (1.0f - progress) + static_cast< float >(end.x) * progress); - rect.y = static_cast< int >(static_cast< float >(start.y) * (1.0f - progress) + static_cast< float >(end.y) * progress); - rect.width = static_cast< int >(static_cast< float >(start.width) * (1.0f - progress) + static_cast< float >(end.width) * progress); - rect.height = static_cast< int >(static_cast< float >(start.height) * (1.0f - progress) + static_cast< float >(end.height) * progress); - value = rect; + value = static_cast< long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); } break; - case VARIANT_TYPE_FLOAT_RECTANGLE: + case VARIANT_TYPE_ULONG: { - const Tizen::Graphics::FloatRectangle& start = startValue.ToFloatRectangle(); - const Tizen::Graphics::FloatRectangle& end = endValue.ToFloatRectangle(); + unsigned long start = startValue.ToULong(); + unsigned long end = endValue.ToULong(); - float left = start.x * (1.0f - progress) + end.x * progress; - float top = start.y * (1.0f - progress) + end.y * progress; - float width = start.width * (1.0f - progress) + end.width * progress; - float height = start.height * (1.0f - progress) + end.height * progress; + value = static_cast< unsigned long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); + } + break; - value = Variant(Tizen::Graphics::FloatRectangle(left, top, width, height)); + case VARIANT_TYPE_LONGLONG: + { + long long start = startValue.ToLongLong(); + long long end = endValue.ToLongLong(); + + value = static_cast< long long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); + } + break; + + case VARIANT_TYPE_ULONGLONG: + { + long long start = startValue.ToULongLong(); + long long end = endValue.ToULongLong(); + + value = static_cast< unsigned long long >(static_cast< float >(start) * (1.0f - progress) + static_cast< float >(end) * progress); + } + break; + + case VARIANT_TYPE_COLOR: + { + const Tizen::Graphics::Color& start = startValue.ToColor(); + const Tizen::Graphics::Color& end = endValue.ToColor(); + + byte r = static_cast< byte >(static_cast< float >(start.GetRed()) * (1.0f - progress) + static_cast< float >(end.GetRed()) * progress); + byte g = static_cast< byte >(static_cast< float >(start.GetGreen()) * (1.0f - progress) + static_cast< float >(end.GetGreen()) * progress); + byte b = static_cast< byte >(static_cast< float >(start.GetBlue()) * (1.0f - progress) + static_cast< float >(end.GetBlue()) * progress); + byte a = static_cast< byte >(static_cast< float >(start.GetAlpha()) * (1.0f - progress) + static_cast< float >(end.GetAlpha()) * progress); + + value = Variant(Tizen::Graphics::Color(r, g, b, a)); + } + break; + +#if 0 + case VARIANT_TYPE_FLOAT_COLOR: + { + const _Colorf& startValue = start.ToColorf(); + const _Colorf& endValue = end.ToColorf(); + + float r = startValue.Red() * (1.0f - progress) + endValue.Red() * progress; + float g = startValue.Green() * (1.0f - progress) + endValue.Green() * progress; + float b = startValue.Blue() * (1.0f - progress) + endValue.Blue() * progress; + float a = startValue.Alpha() * (1.0f - progress) + endValue.Alpha() * progress; + + value = Variant(_Colorf(r, g, b, a)); } break; +#endif case VARIANT_TYPE_POINT: { @@ -174,6 +225,35 @@ _VisualElementAnimationVariantInterpolator::Interpolate(float progress, const Ti } break; + case VARIANT_TYPE_RECTANGLE: + { + const Tizen::Graphics::Rectangle& start = startValue.ToRectangle(); + const Tizen::Graphics::Rectangle& end = endValue.ToRectangle(); + Tizen::Graphics::Rectangle rect; + + rect.x = static_cast< int >(static_cast< float >(start.x) * (1.0f - progress) + static_cast< float >(end.x) * progress); + rect.y = static_cast< int >(static_cast< float >(start.y) * (1.0f - progress) + static_cast< float >(end.y) * progress); + rect.width = static_cast< int >(static_cast< float >(start.width) * (1.0f - progress) + static_cast< float >(end.width) * progress); + rect.height = static_cast< int >(static_cast< float >(start.height) * (1.0f - progress) + static_cast< float >(end.height) * progress); + + value = rect; + } + break; + + case VARIANT_TYPE_FLOAT_RECTANGLE: + { + const Tizen::Graphics::FloatRectangle& start = startValue.ToFloatRectangle(); + const Tizen::Graphics::FloatRectangle& end = endValue.ToFloatRectangle(); + + float left = start.x * (1.0f - progress) + end.x * progress; + float top = start.y * (1.0f - progress) + end.y * progress; + float width = start.width * (1.0f - progress) + end.width * progress; + float height = start.height * (1.0f - progress) + end.height * progress; + + value = Variant(Tizen::Graphics::FloatRectangle(left, top, width, height)); + } + break; + case VARIANT_TYPE_DIMENSION: { const Tizen::Graphics::Dimension& start = startValue.ToDimension(); @@ -200,36 +280,6 @@ _VisualElementAnimationVariantInterpolator::Interpolate(float progress, const Ti } break; - case VARIANT_TYPE_COLOR: - { - const Tizen::Graphics::Color& start = startValue.ToColor(); - const Tizen::Graphics::Color& end = endValue.ToColor(); - - byte r = static_cast< byte >(static_cast< float >(start.GetRed()) * (1.0f - progress) + static_cast< float >(end.GetRed()) * progress); - byte g = static_cast< byte >(static_cast< float >(start.GetGreen()) * (1.0f - progress) + static_cast< float >(end.GetGreen()) * progress); - byte b = static_cast< byte >(static_cast< float >(start.GetBlue()) * (1.0f - progress) + static_cast< float >(end.GetBlue()) * progress); - byte a = static_cast< byte >(static_cast< float >(start.GetAlpha()) * (1.0f - progress) + static_cast< float >(end.GetAlpha()) * progress); - - value = Variant(Tizen::Graphics::Color(r, g, b, a)); - } - break; - -#if 0 - case VARIANT_TYPE_COLORF: - { - const _Colorf& startValue = start.ToColorf(); - const _Colorf& endValue = end.ToColorf(); - - float r = startValue.Red() * (1.0f - progress) + endValue.Red() * progress; - float g = startValue.Green() * (1.0f - progress) + endValue.Green() * progress; - float b = startValue.Blue() * (1.0f - progress) + endValue.Blue() * progress; - float a = startValue.Alpha() * (1.0f - progress) + endValue.Alpha() * progress; - - value = Variant(_Colorf(r, g, b, a)); - } - break; -#endif - case VARIANT_TYPE_FLOAT_MATRIX4: { const Tizen::Graphics::FloatMatrix4& start = startValue.ToFloatMatrix4(); @@ -249,24 +299,33 @@ _VisualElementAnimationVariantInterpolator::Interpolate(float progress, const Ti } break; - case VARIANT_TYPE_BOOL: + case VARIANT_TYPE_FLOAT_POINT3: { - bool start = startValue.ToBool(); - bool end = endValue.ToBool(); + const Tizen::Graphics::FloatPoint3& start = startValue.ToFloatPoint3(); + const Tizen::Graphics::FloatPoint3& end = endValue.ToFloatPoint3(); - if (progress > 0.0f) - { - value = end; - } - else - { - value = start; - } + float x = start.x * (1.0f - progress) + end.x * progress; + float y = start.y * (1.0f - progress) + end.y * progress; + float z = start.z * (1.0f - progress) + end.z * progress; + + value = Variant(Tizen::Graphics::FloatPoint3(x, y, z)); + } + break; + + case VARIANT_TYPE_FLOAT_VECTOR4: + { + const Tizen::Graphics::FloatVector4& start = startValue.ToFloatVector4(); + const Tizen::Graphics::FloatVector4& end = endValue.ToFloatVector4(); + + float x = start.x * (1.0f - progress) + end.x * progress; + float y = start.y * (1.0f - progress) + end.y * progress; + float z = start.z * (1.0f - progress) + end.z * progress; + float w = start.w * (1.0f - progress) + end.w * progress; + + value = Variant(Tizen::Graphics::FloatVector4(x, y, z, w)); } break; - case VARIANT_TYPE_NONE: - case VARIANT_TYPE_STRING: default: SysLogException(NID_UI_ANIM, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Variant type is invalid."); return E_INVALID_ARG; diff --git a/src/ui/animations/FUiAnim_VisualElementCanvas.cpp b/src/ui/animations/FUiAnim_VisualElementCanvas.cpp index f219c2b..c3fb3c9 100644 --- a/src/ui/animations/FUiAnim_VisualElementCanvas.cpp +++ b/src/ui/animations/FUiAnim_VisualElementCanvas.cpp @@ -31,10 +31,10 @@ #include #include "FUi_CoordinateSystemUtils.h" +#include "FUiAnim_VisualElementCoordinateSystem.h" #include "FUiAnim_VisualElementCanvas.h" #include "FUiAnim_VisualElementSurfaceImpl.h" - namespace Tizen { namespace Ui { namespace Animations { @@ -93,5 +93,17 @@ _VisualElementCanvas::Construct(const VisualElementSurface& surface, const Tizen return r; } +result +_VisualElementCanvas::Construct(const VisualElementSurface& surface, const Tizen::Graphics::FloatRectangle& rectangle) +{ + Tizen::Graphics::_CanvasImpl* pCanvasImpl = Tizen::Graphics::_CanvasImpl::GetInstance(*this); + + SysTryReturnResult(NID_UI, pCanvasImpl, E_OUT_OF_MEMORY, "Memory allocation failed."); + SysTryReturnResult(NID_UI, _VisualElementSurfaceImpl::GetInstance(surface), E_SYSTEM, "A system error has been occurred. Invalid surface."); + + Handle window = _VisualElementSurfaceImpl::GetInstance(surface)->GetNativeHandle(); + + return pCanvasImpl->Construct(window, rectangle); +} }}} diff --git a/src/ui/animations/FUiAnim_VisualElementImpl.cpp b/src/ui/animations/FUiAnim_VisualElementImpl.cpp index 570b969..b75cc98 100644 --- a/src/ui/animations/FUiAnim_VisualElementImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementImpl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -193,8 +194,13 @@ _VisualElementImpl::_VisualElementImpl(VisualElement& element) , __decomposedTransform() , __childrenTransform() , __decomposedChildrenTransform() +#ifdef OLD , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT) , __invalidatedProps(HIERARCHY_PROPERTY_MASK& ~HIERARCHY_PROPERTY_CONTENT) +#else + , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK) + , __invalidatedProps(HIERARCHY_PROPERTY_MASK) +#endif , __matrixFromTopValid(false) , __matrixFromTopInvertible(true) , __matrixToSuperValid(false) @@ -219,6 +225,8 @@ _VisualElementImpl::_VisualElementImpl(VisualElement& element) , __renderOperation(VisualElement::RENDER_OPERATION_BLEND) , __pBoundsChangedCallback(null) , __pBoundsChangedCallbackData(null) + , __pDestroyedCallback(null) + , __pDestroyedCallbackData(null) { ClearLastResult(); @@ -249,8 +257,13 @@ _VisualElementImpl::_VisualElementImpl(VisualElement& presentation, _VisualEleme , __decomposedTransform(modelImpl.__decomposedTransform) , __childrenTransform(modelImpl.__childrenTransform) , __decomposedChildrenTransform(modelImpl.__decomposedChildrenTransform) +#ifdef OLD , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT) , __invalidatedProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT) +#else + , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK) + , __invalidatedProps(HIERARCHY_PROPERTY_MASK) +#endif , __matrixFromTopValid(false) , __matrixFromTopInvertible(true) , __matrixToSuperValid(false) @@ -275,6 +288,8 @@ _VisualElementImpl::_VisualElementImpl(VisualElement& presentation, _VisualEleme , __renderOperation(modelImpl.__renderOperation) , __pBoundsChangedCallback(modelImpl.__pBoundsChangedCallback) , __pBoundsChangedCallbackData(modelImpl.__pBoundsChangedCallbackData) + , __pDestroyedCallback(modelImpl.__pDestroyedCallback) + , __pDestroyedCallbackData(modelImpl.__pDestroyedCallbackData) { ClearLastResult(); @@ -301,6 +316,11 @@ _VisualElementImpl::~_VisualElementImpl(void) // remove public instance __pPublicInstance = null; + if (__pDestroyedCallback != null) + { + __pDestroyedCallback(__pDestroyedCallbackData); + } + // Remove property observer finally // if (IsPropertyChangeEventListenerAdded()) @@ -535,7 +555,7 @@ _VisualElementImpl::CreateImplicitAnimationIfNeeded( const String& property, { // remove sub property for(int i = 0 ; pSubProperties[i] != NULL ; i++) { - pAnimationManager->RemoveAnimationForProperty(*__pPublicInstance, *pSubProperties[i]); + pAnimationManager->RemoveAnimationForProperty(*__pPublicInstance, *pSubProperties[i]); } } if (unlikely(pAnimation)) @@ -838,7 +858,6 @@ _VisualElementImpl::ResetSurfaceIfNeeded(void) __needRecreateSurface = false; - if (unlikely(HAVE_SURFACE(this)) && unlikely(GetSharedData().fixedSurfaceSize)) { return; @@ -856,7 +875,6 @@ _VisualElementImpl::ResetSurfaceIfNeeded(void) pPresentation = this; } - if (likely(IsSurfaceNeeded())) { if (GetRoot()) @@ -870,9 +888,7 @@ _VisualElementImpl::ResetSurfaceIfNeeded(void) float surfaceWidth = __bounds.width; float surfaceHeight = __bounds.height; - AdjustSizeForSurface(surfaceWidth, surfaceHeight); - - if (likely(GetSharedData().CreateSurface(Dimension(static_cast< int >(surfaceWidth), static_cast< int >(surfaceHeight)), *pRoot->GetNativeLayer()) == E_SUCCESS)) + if (likely(GetSharedData().CreateSurface(FloatDimension(surfaceWidth, surfaceHeight), *pRoot->GetNativeLayer()) == E_SUCCESS)) { if (unlikely(!HAVE_SURFACE(this))) { @@ -994,12 +1010,16 @@ _VisualElementImpl::SetSurfaceChanged(void) { if(__pPresentation) { +#ifdef OLD __pPresentation->InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false); +#endif } } else { +#ifdef OLD InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false); +#endif } } @@ -1179,7 +1199,6 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds) if (likely(boundsAdjusted != __bounds)) { - float newWidth = boundsAdjusted.Width(); if (unlikely(newWidth < 0.0f)) { @@ -1192,7 +1211,6 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds) newHeight = 0.0f; } - if (unlikely(newWidth != __bounds.width) || unlikely(newHeight != __bounds.height)) { sizeChanged = true; @@ -1203,34 +1221,37 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds) float alignedWidth = newWidth; float alignedHeight = newHeight; - AdjustSizeForSurface(alignedWidth, alignedHeight); - __needRecreateSurface = true; + + _VisualElementCoordinateSystem::ConvertDimensionToPhysicalIntegral(alignedWidth, alignedHeight); + if (likely(GetSharedData().pSurface)) { - Dimension surfaceSize(GetSharedData().pSurface->GetSize()); - if (likely(static_cast< int >(alignedWidth) == surfaceSize.width) && likely(static_cast< int >(alignedHeight) == surfaceSize.height)) + FloatDimension surfaceSize(GetSharedData().pSurface->GetSizeF()); + + _VisualElementCoordinateSystem::ConvertDimensionToPhysicalIntegral(surfaceSize.width, surfaceSize.height); + if (likely(alignedWidth == surfaceSize.width) && likely(alignedHeight == surfaceSize.height)) + { __needRecreateSurface = false; + } } - _VisualElementCoordinateSystem::ConvertDimensionToPhysicalIntegral(alignedWidth, alignedHeight); _VisualElementCoordinateSystem::ConvertDimensionToLogical(alignedWidth, alignedHeight); if (newWidth > 0.0f && alignedWidth == 0.0f) { - alignedWidth = 1.0f / _VisualElementCoordinateSystem::scaleFactorX; + _VisualElementCoordinateSystem::MakeLogicalWidthForPhysicalOne(alignedWidth); } if (newHeight > 0.0f && alignedHeight == 0.0f) { - alignedHeight = 1.0f / _VisualElementCoordinateSystem::scaleFactorY; + _VisualElementCoordinateSystem::MakeLogicalHeightForPhysicalOne(alignedHeight); } __alignedSize.width = alignedWidth; __alignedSize.height = alignedHeight; } - // TODO: Need to optimize dirty rectangle. // invalidate with previous bounds @@ -1283,7 +1304,7 @@ _VisualElementImpl::SetBoundsI(const FloatRectangle& bounds) if(__pBoundsChangedCallback && sizeChanged == true) { - (*__pBoundsChangedCallback)(__pBoundsChangedCallbackData); + (*__pBoundsChangedCallback)(__pBoundsChangedCallbackData); } } @@ -1393,7 +1414,7 @@ _VisualElementImpl::SetZPositionI(float zPosition) { float currentValue = __pPresentation->__zPosition; - if(CreateImplicitAnimationIfNeeded(*pVePropZPosition, __zPosition, currentValue, NULL) == false) + if(CreateImplicitAnimationIfNeeded(*pVePropZPosition, __zPosition, currentValue, NULL) == false) { __pPresentation->SetZPositionProperty(__zPosition); } @@ -1503,10 +1524,7 @@ _VisualElementImpl::SetZOrderGroupProperty(const Variant& v) { SysTryReturn(NID_UI_ANIM, v.GetType() == VARIANT_TYPE_INT, E_INVALID_ARG, E_INVALID_ARG, STR_ERROR_INVALID_VARIANT_ARG_TYPE); - return SetZOrderGroupI(v.ToInt()); - - return E_SUCCESS; } bool @@ -1638,8 +1656,7 @@ _VisualElementImpl::SetShowOpacityI(float showOpacity) const String& property = *pVePropShowState; _AnimationManager* pAnimationManager = _AnimationManager::GetInstance(); - if (likely(GetRoot()) && likely(GetSharedData().needSurface) - && (unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled))) + if (likely(GetRoot()) && (unlikely(pAnimationManager->IsImplicitAnimationEnabled() && __isImplicitAnimationEnabled))) { // WARNING: // For performance, following must be done only when oldValue != newValue. @@ -1689,12 +1706,14 @@ _VisualElementImpl::SetShowOpacityI(float showOpacity) // WARNING: // Remove previous animation even when trying to change the property without animation. pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property); + pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity); needPresentationUpdate = true; } } else { pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property); + pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity); needPresentationUpdate = true; } @@ -3635,17 +3654,23 @@ _VisualElementImpl::SetSurfaceOpaqueProperty(const Variant& v) Canvas* _VisualElementImpl::GetCanvasN(void) { - return GetCanvasN(Rectangle(0, 0, __bounds.width, __bounds.height)); + return GetCanvasN(FloatRectangle(0.0f, 0.0f, __bounds.width, __bounds.height)); } Canvas* _VisualElementImpl::GetCanvasN(const Rectangle& bounds) { + return GetCanvasN(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); +} + +Canvas* +_VisualElementImpl::GetCanvasN(const FloatRectangle& bounds) +{ SysTryReturn(NID_UI_ANIM, !GetSharedData().fixedSurfaceSize, null, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Canvas can't be instantiated for fixed-size user surface."); - SysTryReturn(NID_UI_ANIM, bounds.width >= 0 && bounds.height >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Canvas size is out of range. size = (%f, %f)", bounds.width, bounds.height); + SysTryReturn(NID_UI_ANIM, bounds.width >= 0.0f && bounds.height >= 0.0f, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Canvas size is out of range. size = (%f, %f)", bounds.width, bounds.height); SysTryReturn(NID_UI_ANIM, __imageFilePath.IsEmpty(), null, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Can't get canvas for surface which is from image file."); - SysTryReturn(NID_UI_ANIM, GetRoot(), null, E_INVALID_STATE, "[E_INVALID_STATE] VisualElement is not attached to main tree."); - + SysTryReturn(NID_UI_ANIM, GetRoot(), null, E_INVALID_STATE, "[E_INVALID_STATE] VisualElement is not attached to main tree."); + SysTryReturn(NID_UI_ANIM, IS_MODEL(this), null, E_INVALID_OPERATION, "VisualElement is not Model object."); // WARNING: WARNING: WARNING: // If need-redraw and surface is set by user, VE do *NOT* allow GetCanvasN @@ -3662,36 +3687,37 @@ _VisualElementImpl::GetCanvasN(const Rectangle& bounds) // Forcefully create surface if GetCanvasN is called. // Without followings, surface may not be created if size of bounds == 0 (the initial size) if (!HAVE_SURFACE(this)) + { __needRecreateSurface = true; + } pRenderTarget->RebuildHierarchyProps(0, true, true); + #if 1 SysTryReturn(NID_UI_ANIM, pRenderTarget->GetSharedData().pNativeNode->GetSurface(), null, E_SYSTEM, "[E_INVALID_STATE] Target VisualElement's surface is not constructed."); #else SysTryReturn(NID_UI_ANIM, pRenderTarget->GetSharedData().pSurface, null, E_SYSTEM, "[E_INVALID_STATE] Target VisualElement's surface is not constructed."); #endif - FloatRectangle canvasBounds; FloatRectangle clipBounds; // TODO: FIXME: // Use surface size, not bounds !!! - int canvasX, canvasY, canvasW, canvasH; + float canvasX, canvasY, canvasW, canvasH; - if (bounds.width == 0 || bounds.height == 0) + if (bounds.width == 0.0f || bounds.height == 0.0f) { float surfaceWidth = __bounds.width; float surfaceHeight = __bounds.height; - AdjustSizeForSurface(surfaceWidth, surfaceHeight); - SysTryReturn(NID_UI_ANIM, bounds.x >= 0.0f && bounds.y >= 0.0f && bounds.x <= int(surfaceWidth) && bounds.y <= int(surfaceHeight), null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Bounds is out of range."); + SysTryReturn(NID_UI_ANIM, bounds.x >= 0.0f && bounds.y >= 0.0f && bounds.x <= surfaceWidth && bounds.y <= surfaceHeight, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Bounds is out of range."); canvasX = bounds.x; canvasY = bounds.y; - canvasW = 0; - canvasH = 0; + canvasW = 0.0f; + canvasH = 0.0f; } else { @@ -3709,9 +3735,12 @@ _VisualElementImpl::GetCanvasN(const Rectangle& bounds) pRenderTarget->__pPresentation->ConvertCoordinates(canvasBounds, this->__pPresentation); canvasBounds = canvasBounds.GetIntersection(pRenderTarget->GetDrawableRect()); - SysTryReturn(NID_UI_ANIM, canvasBounds.width > 0 && canvasBounds.height > 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Bounds is out of range."); - _VisualElementCoordinateSystem::MakeIntegralPoint(canvasBounds.x, canvasBounds.y, canvasX, canvasY); - _VisualElementCoordinateSystem::MakeIntegralDimension(canvasBounds.width, canvasBounds.height, canvasW, canvasH); + SysTryReturn(NID_UI_ANIM, canvasBounds.width > 0.0f && canvasBounds.height > 0.0f, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Bounds is out of range."); + + canvasX = canvasBounds.x; + canvasY = canvasBounds.y; + canvasW = canvasBounds.width; + canvasH = canvasBounds.height; } // WARNING: @@ -3720,7 +3749,7 @@ _VisualElementImpl::GetCanvasN(const Rectangle& bounds) unique_ptr<_VisualElementCanvas> pCanvas(new (std::nothrow) _VisualElementCanvas); - result r = pCanvas->Construct(*pRenderTarget->GetSharedData().pNativeNode->GetSurface(), Rectangle(canvasX, canvasY, canvasW, canvasH)); + result r = pCanvas->Construct(*pRenderTarget->GetSharedData().pNativeNode->GetSurface(), FloatRectangle(canvasX, canvasY, canvasW, canvasH)); SysTryReturn(NID_UI_ANIM, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] VisualElement is not constructed."); pRenderTarget->SetFlushNeeded(); @@ -3962,6 +3991,8 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement int indexReference = -1; int indexInsert = -1; + bool sameParent = false; + // If not constructed well, disallow attaching ! if (IsChildOf(child) || this == &child || &child == pReference || (pReference && pReference->__pParent != this)) @@ -4037,6 +4068,8 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement if (child.__pParent == this) //case 1: move to the same parent. (just changed order ) { + sameParent = true; + indexChild = GetChildIndex(child); SysTryReturn(NID_UI_ANIM, indexChild >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The child(%p) isn't managed by this instance.", &child); @@ -4072,7 +4105,7 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement // Setting implicit animation to the child. if (!IS_PRESENTATION(this) && _AnimationManager::GetInstance()->IsImplicitAnimationEnabled() && child.__isImplicitAnimationEnabled) { - RemoveAnimation(*pVePropActionAttach); + child.RemoveAnimation(*pVePropActionAttach); #if defined(SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION) VisualElementAnimation* pAnimation = child.InvokeCreateAnimationForProperty(*pVePropActionAttach); @@ -4098,8 +4131,11 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement if (!IS_PRESENTATION(this)) { - VE_DELEGATE(this, InvokeOnChildAttaching, child); - VE_DELEGATE(&child, InvokeOnAttaching, *this); + if(!sameParent) + { + VE_DELEGATE(this, InvokeOnChildAttaching, child); + VE_DELEGATE(&child, InvokeOnAttaching, *this); + } } __children.InsertAt(&child, indexInsert); // need addref -> jobs -> release ... @@ -4111,8 +4147,6 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement //__InvalidateHierarchyProps(child.__childrenNeedsUpdateProps, false, true); InvalidateHierarchyProps(child.__childrenNeedsUpdateProps, true, false); - //SetRootNeedsContentUpdate(); - // WARNING: // When no surface, it is needed to invalidated. // @@ -4129,6 +4163,19 @@ _VisualElementImpl::ChangeZOrder(_VisualElementImpl& child, const _VisualElement if (!IS_PRESENTATION(this)) { child.UpdatePresentationWhenZOrderChanged(pReference, above); + + if(!sameParent) // when child was moved to same parent, don't have to detach and attach to parent. + { + if (child.GetSharedData().pEventListener != null) + { + child.InvokeOnAttached(); + } + + if (GetSharedData().pEventListener != null) + { + InvokeOnChildAttached(child); + } + } } else { @@ -4187,45 +4234,10 @@ _VisualElementImpl::UpdatePresentationWhenZOrderChanged(const _VisualElementImpl if (likely(__pParent->__pPresentation) && likely(__pPresentation)) { __pParent->__pPresentation->ChangeZOrder(*__pPresentation, pReferencePresenter, above, _zOrderGroup); - - if (GetSharedData().pEventListener != null) - { - InvokeOnAttached(); - } - - if (__pParent->GetSharedData().pEventListener != null) - { - __pParent->InvokeOnChildAttached(*this); - } } } -void -_VisualElementImpl::UpdatePresentationWhenChildRemoved(_VisualElementImpl& child, bool deallocate) -{ - if(!IS_MODEL(this)) - { - return; - } - if (likely(__pPresentation) && likely(child.GetPresentation())) - { - __pPresentation->RemoveChild(*child.GetPresentation(), deallocate); - } - - // IMPORTANT! When destroying, don't have to invoke OnDetached and OnDetaching after invoked OnDestructing. - // call OnDestructing -> call OnDetaching it is ambiguous operation - // it is called by RemoveFromParent() method, so pChild is destroying currently. - if (!child.__isDestroying && child.GetSharedData().pEventListener != null) - { - child.InvokeOnDetached(*this); - } - - if (GetSharedData().pEventListener != null) - { - InvokeOnChildDetached(child); - } -} result _VisualElementImpl::RemoveChildWithoutReconfiguring(int indexChild, bool invalidate) @@ -4235,19 +4247,6 @@ _VisualElementImpl::RemoveChildWithoutReconfiguring(int indexChild, bool invalid _VisualElementImpl* pChild = __children.GetChildAt(indexChild); SysTryReturnResult(NID_UI_ANIM, pChild, E_OBJ_NOT_FOUND, "There is no VisualElement at %d th index.", indexChild); - if (!IS_PRESENTATION(this)) - { - - VE_DELEGATE(this, InvokeOnChildDetaching, *pChild); - - // IMPORTANT! When destroying, don't have to invoke OnDetached and OnDetaching after invoked OnDestructing. - // call OnDestructing -> call OnDetaching it is ambiguous operation - // it is called by RemoveFromParent() method, so pChild is destroying currently. - if (!pChild->__isDestroying) - { - VE_DELEGATE(pChild, InvokeOnDetaching); - } - } //SysLog(NID_UI_ANIM, "Remove child %p(%d)", pChild, indexChild); __children.RemoveAt(indexChild); @@ -4395,9 +4394,20 @@ _VisualElementImpl::RemoveChild(_VisualElementImpl& child, bool deallocate) int indexChild = GetChildIndex(child); SysTryReturnResult(NID_UI_ANIM, indexChild >= 0, E_OBJ_NOT_FOUND, "child is not a child of this instance."); - if (unlikely(indexChild < 0)) - return E_OBJ_NOT_FOUND; + if (!IS_PRESENTATION(this)) + { + + VE_DELEGATE(this, InvokeOnChildDetaching, child); + + // IMPORTANT! When destroying, don't have to invoke OnDetached and OnDetaching after invoked OnDestructing. + // call OnDestructing -> call OnDetaching it is ambiguous operation + // it is called by RemoveFromParent() method, so pChild is destroying currently. + if (!child.__isDestroying) + { + VE_DELEGATE(&child, InvokeOnDetaching); + } + } result r = RemoveChildWithoutReconfiguring(indexChild, true); if (unlikely(r != E_SUCCESS)) @@ -4421,7 +4431,24 @@ _VisualElementImpl::RemoveChild(_VisualElementImpl& child, bool deallocate) // if (!IS_PRESENTATION(this)) { - UpdatePresentationWhenChildRemoved(child,deallocate); + + if (likely(__pPresentation) && likely(child.GetPresentation())) + { + __pPresentation->RemoveChild(*child.GetPresentation(), deallocate); + } + + // IMPORTANT! When destroying, don't have to invoke OnDetached and OnDetaching after invoked OnDestructing. + // call OnDestructing -> call OnDetaching it is ambiguous operation + // it is called by RemoveFromParent() method, so pChild is destroying currently. + if (!child.__isDestroying && child.GetSharedData().pEventListener != null) + { + child.InvokeOnDetached(*this); + } + + if (GetSharedData().pEventListener != null) + { + InvokeOnChildDetached(child); + } } // TODO: @@ -4505,7 +4532,6 @@ _VisualElementImpl::SetName(const Tizen::Base::String& name) return r; } - Variant _VisualElementImpl::GetNameProperty(void) const { @@ -4637,7 +4663,7 @@ _VisualElementImpl::GetDrawableRect(void) const #endif if (HAVE_SURFACE(this) && GetSharedData().fixedSurfaceSize) { - return FloatRectangle(0.0f, 0.0f, static_cast< float >(GetSharedData().pSurface->GetSize().width), static_cast< float >(GetSharedData().pSurface->GetSize().height)); + return FloatRectangle(0.0f, 0.0f, GetSharedData().pSurface->GetSizeF().width, GetSharedData().pSurface->GetSizeF().height); } return FloatRectangle(0.0f, 0.0f, __bounds.width, __bounds.height); @@ -4732,7 +4758,6 @@ _VisualElementImpl::GetMatrixToSuper(void) const if (unlikely(__matrixToSuperValid)) return __matrixToSuper; - _VisualElementImpl* pThis = const_cast< _VisualElementImpl* >(this); pThis->__matrixToSuperValid = true; @@ -5181,10 +5206,12 @@ _VisualElementImpl::RebuildHierarchyProps(int props, bool checkSurface, bool rec return; } +#ifdef OLD if (unlikely(props & HIERARCHY_PROPERTY_SURFACE) && unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_SURFACE))) { SetPropsValidaty(HIERARCHY_PROPERTY_SURFACE, 0); } +#endif if (likely(props & HIERARCHY_PROPERTY_CONTENTBOUNDS) && likely(IsPropsInvalidated(HIERARCHY_PROPERTY_CONTENTBOUNDS))) { @@ -5239,7 +5266,11 @@ _VisualElementImpl::UpdateHierarchyProps(void) { // WARNING: // HIERARCHY_PROPERTY_CONTENT is not handled here, but in drawing logic. +#ifdef OLD const int mask = HIERARCHY_PROPERTY_MASK & (~HIERARCHY_PROPERTY_CONTENT); +#else + const int mask = HIERARCHY_PROPERTY_MASK; +#endif if (unlikely((__childrenNeedsUpdateProps & mask) == 0)) return; @@ -5302,7 +5333,7 @@ _VisualElementImpl::SetFlushNeeded(void) if (likely(pRenderTarget && pRenderTarget->GetSharedData().pNativeNode)) { - pRenderTarget->__pPresentation->ConvertCoordinates(rect, this->__pPresentation); + pRenderTarget->ConvertCoordinates(rect, this); pRenderTarget->GetSharedData().pNativeNode->SetFlushNeeded(); } } @@ -5341,7 +5372,6 @@ _VisualElementImpl::InvalidateRectangleI(const FloatRectangle* pRectangle) return E_SUCCESS; } - FloatRectangle invRect; if (unlikely(pRectangle)) @@ -5386,7 +5416,16 @@ _VisualElementImpl::InvalidateRectangleI(const FloatRectangle* pRectangle) GetSharedData().invalidatedRegion = invRect; +#ifdef OLD InvalidateHierarchyProps(HIERARCHY_PROPERTY_CONTENT, false, false); +#else + _VisualElementImpl* pElement = this; + while (pElement) + { + pElement->GetSharedData().childrenInvalidated = true; + pElement = pElement->GetParent(); + } +#endif SetRootNeedsContentUpdate(); return E_SUCCESS; @@ -5447,12 +5486,15 @@ _VisualElementImpl::Draw(void) // if (IS_PRESENTATION(this)) // __UpdateHierarchyProps(); +#ifdef OLD if (unlikely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0)) +#else + if (unlikely(GetSharedData().childrenInvalidated)) +#endif { // if (unlikely(!IS_PRESENTATION(this))) // __UpdateHierarchyProps(); - // // Drawing must be done from first opaque. // But, because we assume all VE's are transparent, all drawings are done from root !!! @@ -5485,10 +5527,92 @@ _VisualElementImpl::Draw(void) return E_SUCCESS; } +result +_VisualElementImpl::DrawForAnimation(void) +{ + if (!IS_ATTACHED(this)) + { + return E_SUCCESS; + } + +#ifdef OLD + if (unlikely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0)) +#else + if (unlikely(GetSharedData().childrenInvalidated)) +#endif + { + _VisualElementImpl* pRenderTarget = GetRenderTarget(); + pRenderTarget->DrawRectangle(GetSharedData().invalidatedRegion); + +#ifdef OLD + if (likely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0)) +#else + if (likely(GetSharedData().childrenInvalidated == false)) +#endif + { + return E_SUCCESS; + } + + _VisualElementImpl* pChild = null; + bool childrenNeedUpdate = false; + int count = __children.GetCount(); + for (int i = 0; i < count; i++) + { + pChild = __children.GetChildAt(i); +#ifdef OLD + if (!pChild || (pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0) +#else + if (!pChild || (pChild->GetSharedData().childrenInvalidated == false)) +#endif + { + continue; + } + + pChild->DrawForAnimation(); + +#ifdef OLD + if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0) +#else + if ((pChild->GetSharedData().childrenInvalidated)) +#endif + { + childrenNeedUpdate = true; + } + } + + // update 'needUpdate' flag regarding children only if no invalidated-region + if (GetSharedData().invalidatedRegion.IsEmpty()) + { +#ifdef OLD + SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0); + if (childrenNeedUpdate) + { + __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT; + } + else + { + __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT; + } +#else + if (childrenNeedUpdate) + { + GetSharedData().childrenInvalidated = true; + } +#endif + } + } + + return E_SUCCESS; +} + void _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) { - if ((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0 || unlikely(!IsVisibleI())) +#ifdef OLD + if (unlikely(!IsVisibleI()) || (__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0) +#else + if (unlikely(!IsVisibleI()) || GetSharedData().childrenInvalidated == false) +#endif { return; } @@ -5517,7 +5641,11 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) // needUpdate flag may be 'true' after drawring invalidated region. // This means that some children still need to be updated ! // +#ifdef OLD if (likely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0)) +#else + if (likely(GetSharedData().childrenInvalidated == false)) +#endif { return; } @@ -5538,12 +5666,11 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) for (int i = 0; i < count; i++) { pChild = __children.GetChildAt(i); - if (!pChild) - { - continue; - } - - if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0) +#ifdef OLD + if (!pChild || (pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0) +#else + if (!pChild || pChild->GetSharedData().childrenInvalidated == false) +#endif { continue; } @@ -5554,7 +5681,7 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) // Children with empty invalidated region will ignore re-drawing. updateRect = drawRect; - pChild->__pPresentation->ConvertCoordinates(updateRect, this->__pPresentation); + pChild->ConvertCoordinates(updateRect, this); if (likely(NEED_SURFACE(pChild))) { @@ -5569,7 +5696,11 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) pChild->DrawRectangleIfNeeded(updateRect); } +#ifdef OLD if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0) +#else + if (pChild->GetSharedData().childrenInvalidated) +#endif { childrenNeedUpdate = true; } @@ -5578,15 +5709,22 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) // update 'needUpdate' flag regarding children only if no invalidated-region if (GetSharedData().invalidatedRegion.IsEmpty()) { - SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0); - if (childrenNeedUpdate) - { - __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT; - } - else - { - __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT; - } +#ifdef OLD + SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0); + if (childrenNeedUpdate) + { + __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT; + } + else + { + __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT; + } +#else + if (childrenNeedUpdate) + { + GetSharedData().childrenInvalidated = true; + } +#endif } } @@ -5594,7 +5732,7 @@ _VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect) void _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect) { - if (unlikely(!GetRootPublic()) || unlikely(!IsVisibleI()) || unlikely(drawRect.IsEmpty())) + if (unlikely(!GetRootPublic()) || unlikely(drawRect.IsEmpty())) { return; } @@ -5658,8 +5796,12 @@ _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect) // GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, 0.0f, 0.0f); // SetEmpty() +#ifdef OLD SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0); __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT; +#else + GetSharedData().childrenInvalidated = false; +#endif } @@ -5716,7 +5858,7 @@ _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect) if (likely(!NEED_SURFACE(pChild))) { drawRectVisible = drawRect; - pChild->__pPresentation->ConvertCoordinates(drawRectVisible, this->__pPresentation); + pChild->ConvertCoordinates(drawRectVisible, this); childBounds = pChild->__pPresentation->__bounds; childBounds.SetPosition(0.0f, 0.0f); @@ -5726,7 +5868,11 @@ _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect) pChild->DrawRectangle(drawRectVisible); } +#ifdef OLD if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0) +#else + if (pChild->GetSharedData().childrenInvalidated) +#endif { childrenNeedUpdate = true; } @@ -5738,7 +5884,11 @@ _VisualElementImpl::DrawRectangle(const FloatRectangle& drawRect) // if (childrenNeedUpdate) { +#ifdef OLD __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT; +#else + GetSharedData().childrenInvalidated = true; +#endif } } @@ -6024,7 +6174,6 @@ _VisualElementImpl::ConvertCoordinates(FloatPoint& point, const _VisualElementIm SysTryReturnResult(NID_UI_ANIM, pFromRoot, E_INVALID_ARG, "Invalid argument(s) is used. This VisualElement is not attached to main tree."); } - const FloatMatrix4& toTopMatrix = (pFromElement ? pFromElement->GetMatrixToTop() : pFromRoot->GetMatrixToTop()); _MatrixUtilTransform(toTopMatrix, &x, &y, &z); @@ -6032,9 +6181,8 @@ _VisualElementImpl::ConvertCoordinates(FloatPoint& point, const _VisualElementIm { const FloatMatrix4& fromTopMatrix = GetMatrixFromTop(); - if (!__matrixFromTopInvertible) - return E_INVALID_OPERATION; - + SysTryReturnResult(NID_UI_ANIM, __matrixFromTopInvertible, E_INVALID_OPERATION, "The matrix for this conversion is singular which has zero determinant."); + SysTryReturnResult(NID_UI_ANIM, fromTopMatrix.matrix[2][2] != 0, E_INVALID_OPERATION, "It is failed to calculate z of world-coordinate mapped x-y plane of depth==0"); // WARNING: // We should calculate z of world-coordinate mapped x-y plane of depth==0 in VE coordinate ! @@ -6043,7 +6191,6 @@ _VisualElementImpl::ConvertCoordinates(FloatPoint& point, const _VisualElementIm _MatrixUtilTransform(fromTopMatrix, &x, &y, &z); } - point.SetPosition(x, y); // z is omitted return E_SUCCESS; @@ -6086,8 +6233,8 @@ _VisualElementImpl::ConvertCoordinates(FloatRectangle& rectangle, const _VisualE { const FloatMatrix4& fromTopMatrix = GetMatrixFromTop(); - if (!__matrixFromTopInvertible) - return E_INVALID_OPERATION; + SysTryReturnResult(NID_UI_ANIM, __matrixFromTopInvertible, E_INVALID_OPERATION, "The matrix for this conversion is singular which has zero determinant."); + SysTryReturnResult(NID_UI_ANIM, fromTopMatrix.matrix[2][2] != 0, E_INVALID_OPERATION, "It is failed to calculate z of world-coordinate mapped x-y plane of depth==0"); for (int i = 0; i < 4; i++) { @@ -6127,7 +6274,6 @@ _VisualElementImpl::ConvertCoordinates(float* x, float* y, float* z, int count, SysTryReturnResult(NID_UI_ANIM, pFromRoot, E_INVALID_ARG, "Invalid argument(s) is used. This VisualElement is not attached to main tree."); } - bool isUpwardConvertOnly = (pFromElement && pFromElement->IsChildOf(*this)); const FloatMatrix4& toTopMatrix = (isUpwardConvertOnly ? pFromElement->CalcMatrixToBase(*this) : pFromElement ? pFromElement->GetMatrixToTop() : pFromRoot->GetMatrixToTop()); @@ -6141,8 +6287,8 @@ _VisualElementImpl::ConvertCoordinates(float* x, float* y, float* z, int count, { const FloatMatrix4& fromTopMatrix = GetMatrixFromTop(); - if (!__matrixFromTopInvertible) - return E_INVALID_OPERATION; + SysTryReturnResult(NID_UI_ANIM, __matrixFromTopInvertible, E_INVALID_OPERATION, "The matrix for this conversion is singular which has zero determinant."); + SysTryReturnResult(NID_UI_ANIM, fromTopMatrix.matrix[2][2] != 0, E_INVALID_OPERATION, "It is failed to calculate z of world-coordinate mapped x-y plane of depth==0"); for (int i = 0; i < count; i++) { @@ -6156,6 +6302,41 @@ _VisualElementImpl::ConvertCoordinates(float* x, float* y, float* z, int count, return E_SUCCESS; } +FloatPoint3 +_VisualElementImpl::TransformVectorFromOrigin(const Tizen::Graphics::FloatPoint3& originPoint, const _VisualElementImpl* pOriginVisualElement) const +{ + ClearLastResult(); + + if (unlikely(this == pOriginVisualElement)) + { + return FloatPoint3(originPoint); + } + + float x = originPoint.x; + float y = originPoint.y; + float z = originPoint.z; + + _VisualElementImpl* pOriginRoot = pOriginVisualElement->GetRoot(); + + SysTryReturn(NID_UI_ANIM, GetRoot() == pOriginRoot, FloatPoint3(), E_INVALID_ARG, "Invalid argument(s) is used. This VisualElement and originVisualElement is not belong to the same tree."); + SysTryReturn(NID_UI_ANIM, pOriginRoot || pOriginVisualElement->IsChildOf(*this) || IsChildOf(*pOriginVisualElement), + FloatPoint3(), E_INVALID_ARG, "Invalid argument(s) is used. This VisualElement(%p) and originVisualElement(%p) is not related.", this, pOriginVisualElement); + + const FloatMatrix4& toTopMatrix = pOriginVisualElement->GetMatrixToTop(); + _MatrixUtilTransform(toTopMatrix, &x, &y, &z); + + if (this != pOriginRoot) + { + const FloatMatrix4& fromTopMatrix = GetMatrixFromTop(); + + SysTryReturn(NID_UI_ANIM, __matrixFromTopInvertible, FloatPoint3(), E_INVALID_OPERATION, "The matrix for this conversion is singular which has zero determinant."); + + _MatrixUtilTransform(fromTopMatrix, &x, &y, &z); + } + + return FloatPoint3(x, y, z); +} + result _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDest, _VisualElementImpl& reference, const FloatRectangle& clipRect, bool withChilren, int depth) { @@ -6181,7 +6362,6 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes drawRect.x -= bounds.x; drawRect.y -= bounds.y; //--> 0 - -20 = 20 : 20 - 20 = 0 - bounds = tempRect; if (!drawRect.IsEmpty()) @@ -6312,8 +6492,6 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes return E_SUCCESS; } - - result _VisualElementImpl::Capture(Canvas& outputCanvas, const FloatRectangle& rectDest, bool withChildren) { @@ -6535,7 +6713,7 @@ CATCH: if (transactionID > 0) { - pAnimationManager->CancelTransaction(transactionID); + pAnimationManager->DiscardTransaction(transactionID); } return r; @@ -6569,16 +6747,6 @@ _VisualElementImpl::GetAnimationN(const Tizen::Base::String& keyName) const return _AnimationManager::GetInstance()->GetAnimationN(*pPresentation, keyName); } -VisualElementAnimation* -_VisualElementImpl::GetAnimationForPropertyN(const Tizen::Base::String& property) const -{ - VisualElement* pPresentation = __pPresentation->__pPublicInstance; - - ClearLastResult(); - - return _AnimationManager::GetInstance()->GetAnimationForPropertyN(*pPresentation, property); -} - bool _VisualElementImpl::CheckIfAnimatable(const String& property) const { @@ -6762,6 +6930,13 @@ _VisualElementImpl::SetBoundsChangedCallback(BoundsChangedCallback pCallback, vo __pBoundsChangedCallbackData = pData; } +void +_VisualElementImpl::SetDestroyedCallback(DestroyedCallback pCallback, void* pData) +{ + __pDestroyedCallback = pCallback; + __pDestroyedCallbackData = pData; +} + // delegate--------------------------------------------------------------------------------- diff --git a/src/ui/animations/FUiAnim_VisualElementSharedData.cpp b/src/ui/animations/FUiAnim_VisualElementSharedData.cpp index e827715..c4d8da8 100644 --- a/src/ui/animations/FUiAnim_VisualElementSharedData.cpp +++ b/src/ui/animations/FUiAnim_VisualElementSharedData.cpp @@ -40,11 +40,11 @@ namespace Tizen { namespace Ui { namespace Animations _VisualElementSharedData::_VisualElementSharedData(void) : invalidatedNativeProps(-1) + , childrenInvalidated(false) , surfaceChanged(false) , pNativeNode(null) , pSurface(null) , invalidatedRegion(0.0f, 0.0f, 0.0f, 0.0f) - , drawOnPresentation(false) , needSurface(true) , redrawOnResize(false) , isSurfaceOpaque(true) @@ -129,7 +129,7 @@ _VisualElementSharedData::LockInvalidate(bool lock) } result -_VisualElementSharedData::CreateSurface(const Tizen::Graphics::Dimension& size, _NativeLayer& layer) +_VisualElementSharedData::CreateSurface(const Tizen::Graphics::FloatDimension& size, _NativeLayer& layer) { unique_ptr pNewSurface(_VisualElementSurfaceImpl::CreateSurfaceN((const Handle)&layer, size)); SysTryReturnResult(NID_UI, pNewSurface, E_OUT_OF_MEMORY, "Memory allocation failed."); diff --git a/src/ui/animations/FUiAnim_VisualElementSurfaceImpl.cpp b/src/ui/animations/FUiAnim_VisualElementSurfaceImpl.cpp index cc5fec7..2a99665 100644 --- a/src/ui/animations/FUiAnim_VisualElementSurfaceImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementSurfaceImpl.cpp @@ -42,7 +42,7 @@ namespace Tizen { namespace Ui { namespace Animations { VisualElementSurface* -_VisualElementSurfaceImpl::CreateSurfaceN(const Handle handle, const Tizen::Graphics::Dimension& size) +_VisualElementSurfaceImpl::CreateSurfaceN(const Handle handle, const FloatDimension& size) { SysTryReturn(NID_UI_ANIM, size.width >= 0 && size.height >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Surface size is out of range. size = (%d, %d)", size.width, size.height); SysTryReturn(NID_UI_ANIM, handle != 0, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The handle is invalid."); @@ -58,7 +58,7 @@ _VisualElementSurfaceImpl::CreateSurfaceN(const Handle handle, const Tizen::Grap } VisualElementSurface* -_VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(const DisplayContext& displayContext, const Handle handle, const Tizen::Graphics::Dimension& size) +_VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(const DisplayContext& displayContext, const Handle handle, const Dimension& size) { SysTryReturn(NID_UI_ANIM, size.width >= 0 && size.height >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Surface size is out of range. size = (%d, %d)", size.width, size.height); SysTryReturn(NID_UI_ANIM, handle != 0, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The handle is invalid."); @@ -83,7 +83,7 @@ _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(const DisplayContex } _VisualElementSurfaceImpl* -_VisualElementSurfaceImpl::CreateInstanceN(const DisplayContext& displayContext, const Tizen::Graphics::Dimension& size) +_VisualElementSurfaceImpl::CreateInstanceN(const DisplayContext& displayContext, const FloatDimension& size) { SysTryReturn(NID_UI_ANIM, size.width >= 0 && size.height >= 0, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Surface size is out of range. size = (%d, %d)", size.width, size.height); @@ -109,6 +109,13 @@ _VisualElementSurfaceImpl::_VisualElementSurfaceImpl(const Dimension& size) : __refCount(1) , __logicalSize(size) { + +} + +_VisualElementSurfaceImpl::_VisualElementSurfaceImpl(const FloatDimension& size) + : __refCount(1) + , __logicalSizeF(size) +{ } result diff --git a/src/ui/controls/FUiCtrlAnimation.cpp b/src/ui/controls/FUiCtrlAnimation.cpp old mode 100644 new mode 100755 index 1e563fd..21bff1e --- a/src/ui/controls/FUiCtrlAnimation.cpp +++ b/src/ui/controls/FUiCtrlAnimation.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlAnimation.cpp * @brief This is the implementation file for Animation class. @@ -71,6 +72,40 @@ CATCH: return r; } +result +Animation::Construct(const FloatRectangle& rectangle, const IList& animationFrames) +{ + result r = E_SUCCESS; + + _AnimationImpl* pAnimationImpl = _AnimationImpl::GetInstance(*this); + + SysAssertf((pAnimationImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + pAnimationImpl = _AnimationImpl::CreateAnimationImplN(this); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pAnimationImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pAnimationImpl; + + r = Control::SetBounds(rectangle.x, rectangle.y, rectangle.width, rectangle.height); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pAnimationImpl->SetAnimationFrames(animationFrames); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pAnimationImpl->SetImageCount(animationFrames.GetCount()); + + return E_SUCCESS; + +CATCH: + delete pAnimationImpl; + pAnimationImpl = null; + + _pControlImpl = null; + + return r; +} + void Animation::AddAnimationEventListener(IAnimationEventListener& listener) { diff --git a/src/ui/controls/FUiCtrlAnimationFrame.cpp b/src/ui/controls/FUiCtrlAnimationFrame.cpp index 3d54ab2..062fd6a 100644 --- a/src/ui/controls/FUiCtrlAnimationFrame.cpp +++ b/src/ui/controls/FUiCtrlAnimationFrame.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlAnimationFrame.cpp * @brief This is the implementation file for AnimationFrame class. diff --git a/src/ui/controls/FUiCtrlButton.cpp b/src/ui/controls/FUiCtrlButton.cpp index 1b169c8..83486e3 100644 --- a/src/ui/controls/FUiCtrlButton.cpp +++ b/src/ui/controls/FUiCtrlButton.cpp @@ -60,6 +60,27 @@ Button::Construct(const Rectangle& rect, const String& text) return E_SUCCESS; } +result +Button::Construct(const FloatRectangle& rect, const String& text) +{ + result r = E_SUCCESS; + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + + SysAssertf(pButtonImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pButtonImpl = _ButtonImpl::CreateButtonImplN(this, rect); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pButtonImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pButtonImpl->SetText(text); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + _pControlImpl = pButtonImpl; + + return E_SUCCESS; +} + void Button::AddActionEventListener(IActionEventListener& listener) { @@ -275,13 +296,13 @@ Button::SetNormalBitmap(const Point& position, const Bitmap& bitmap) } void -Button::SetPressedBitmap(const Point& position, const Bitmap& bitmap) +Button::SetNormalBitmap(const FloatPoint& position, const Bitmap& bitmap) { _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); SysAssertf(pButtonImpl != null, "Not yet constructed. Construct() should be called before use."); - pButtonImpl->SetPressedBitmap(position, bitmap); + pButtonImpl->SetNormalBitmap(position, bitmap); return; } @@ -299,6 +320,66 @@ Button::SetDisabledBitmap(const Point& position, const Bitmap& bitmap) } void +Button::SetDisabledBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetDisabledBitmap(position, bitmap); + + return; +} + +void +Button::SetPressedBitmap(const Point& position, const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetPressedBitmap(position, bitmap); + + return; +} + +void +Button::SetPressedBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetPressedBitmap(position, bitmap); + + return; +} + +void +Button::SetHighlightedBitmap(const Point& position, const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetHighlightedBitmap(position, bitmap); + + return; +} + +void +Button::SetHighlightedBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetHighlightedBitmap(position, bitmap); + + return; +} + +void Button::SetNormalBackgroundBitmap(const Bitmap& bitmap) { _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); @@ -311,6 +392,18 @@ Button::SetNormalBackgroundBitmap(const Bitmap& bitmap) } void +Button::SetDisabledBackgroundBitmap(const Bitmap& bitmap) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pButtonImpl->SetDisabledBackgroundBitmap(bitmap); + + return; +} + +void Button::SetPressedBackgroundBitmap(const Bitmap& bitmap) { _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); @@ -367,6 +460,16 @@ Button::GetTextSize(void) const return pButtonImpl->GetTextSize(); } +float +Button::GetTextSizeF(void) const +{ + const _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pButtonImpl->GetTextSizeF(); +} + result Button::SetTextSize(int size) { @@ -379,4 +482,18 @@ Button::SetTextSize(int size) return r; } + +result +Button::SetTextSize(float size) +{ + _ButtonImpl* pButtonImpl = _ButtonImpl::GetInstance(*this); + SysAssertf(pButtonImpl != null, + "Not yet constructed. Construct() should be called before use."); + + result r = pButtonImpl->SetTextSize(size); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlCheckButton.cpp b/src/ui/controls/FUiCtrlCheckButton.cpp index 2ed9021..f8fc5ce 100644 --- a/src/ui/controls/FUiCtrlCheckButton.cpp +++ b/src/ui/controls/FUiCtrlCheckButton.cpp @@ -75,6 +75,8 @@ CheckButton::Construct(const Rectangle& rect, CheckButtonStyle style, Background break; case CHECK_BUTTON_STYLE_ONOFF_SLIDING: + // fall through + case CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER: checkMinWidth = PROPERTY_CHECKBUTTON_MIN_WIDTH_ONOFF_SLIDING; break; @@ -127,6 +129,82 @@ CheckButton::Construct(const Rectangle& rect, CheckButtonStyle style, Background return E_SUCCESS; } +result +CheckButton::Construct(const FloatRectangle& rect, CheckButtonStyle style, BackgroundStyle backgroundStyle, + bool showTitle, const String& text, GroupStyle groupStyle) +{ + switch (style) + { + case CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER: + // fall through + case CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER: + // fall through + case CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER: + checkMinWidth = PROPERTY_CHECKBUTTON_MIN_WIDTH_WITH_DIVIDER; + break; + + case CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON: + // fall through + case CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON: + checkMinWidth = PROPERTY_CHECKBUTTON_MIN_WIDTH_WITH_DETAILED; + break; + + case CHECK_BUTTON_STYLE_ONOFF_SLIDING: + // fall through + case CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER: + checkMinWidth = PROPERTY_CHECKBUTTON_MIN_WIDTH_ONOFF_SLIDING; + break; + + default: //CHECK_BUTTON_STYLE_MARK , CHECK_BUTTON_STYLE_ONOFF, CHECK_BUTTON_STYLE_RADIO + checkMinWidth = showTitle ? PROPERTY_CHECKBUTTON_MIN_WIDTH_WITH_TITLE : PROPERTY_CHECKBUTTON_MIN_WIDTH; + } + + checkMinHeight = showTitle ? PROPERTY_CHECKBUTTON_MIN_HEIGHT_WITH_TITLE : PROPERTY_CHECKBUTTON_MIN_HEIGHT; + + SysTryReturn(NID_UI_CTRL, (rect.width >= checkMinWidth && rect.width <= CONTROL_MAXIMUM_LENGTH_LIMIT), + E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The width error occurred"); + + SysTryReturn(NID_UI_CTRL, (rect.height >= checkMinHeight && rect.height <= CONTROL_MAXIMUM_LENGTH_LIMIT), + E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The height error occurred"); + + SysTryReturn(NID_UI_CTRL, !(backgroundStyle == BACKGROUND_STYLE_NONE && groupStyle != GROUP_STYLE_NONE), + E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Unable to set group style."); + + result r = E_SUCCESS; + _CheckButtonImpl* pCheckButtonImpl = _CheckButtonImpl::GetInstance(*this); + + SysAssertf(pCheckButtonImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pCheckButtonImpl = _CheckButtonImpl::CreateCheckButtonImplN(this, rect); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pCheckButtonImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + + r = pCheckButtonImpl->SetCheckButtonStyle(style); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + r = pCheckButtonImpl->SetBackgroundStyle(backgroundStyle); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + r = pCheckButtonImpl->SetShowTitle(showTitle); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + r = pCheckButtonImpl->SetText(text); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + r = pCheckButtonImpl->SetGroupStyle(groupStyle); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + r = pCheckButtonImpl->SetMinimumSize(Dimension(checkMinWidth, checkMinHeight)); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + _pControlImpl = pCheckButtonImpl; + + return E_SUCCESS; +} + + void CheckButton::SetSelected(bool select) { diff --git a/src/ui/controls/FUiCtrlColorPicker.cpp b/src/ui/controls/FUiCtrlColorPicker.cpp old mode 100644 new mode 100755 index 0e0f6eb..f90d8bc --- a/src/ui/controls/FUiCtrlColorPicker.cpp +++ b/src/ui/controls/FUiCtrlColorPicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlColorPicker.cpp * @brief This is the implementation file for the %ColorPicker class. @@ -59,6 +60,29 @@ CATCH: return r; } +result +ColorPicker::Construct(const FloatPoint& point) +{ + SysAssertf((_ColorPickerImpl::GetInstance(*this) == null), + "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class"); + + _ColorPickerImpl* pImpl = _ColorPickerImpl::CreateColorPickerImplN(*this); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, (pImpl != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + r = SetPosition(point); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete pImpl; + pImpl = null; + + return r; +} + Color ColorPicker::GetColor(void) const { diff --git a/src/ui/controls/FUiCtrlContextMenu.cpp b/src/ui/controls/FUiCtrlContextMenu.cpp index f1c586a..d7b070e 100644 --- a/src/ui/controls/FUiCtrlContextMenu.cpp +++ b/src/ui/controls/FUiCtrlContextMenu.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_ContextMenuImpl.h" using namespace Tizen::App; @@ -52,6 +53,16 @@ ContextMenu::Construct(const Tizen::Graphics::Point& point, ContextMenuStyle sty } result +ContextMenu::Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style) +{ + result r = E_SUCCESS; + + r = Construct(point, style, CONTEXT_MENU_ANCHOR_DIRECTION_AUTO); + + return r; +} + +result ContextMenu::Construct(const Tizen::Graphics::Point& point, ContextMenuStyle style, ContextMenuAnchorDirection direction) { _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this); @@ -61,6 +72,26 @@ ContextMenu::Construct(const Tizen::Graphics::Point& point, ContextMenuStyle sty result r = E_SUCCESS; // Create a ContextMenu Impl + FloatPoint floatPoint = _CoordinateSystemUtils::ConvertToFloat(point); + pImpl = _ContextMenuImpl::CreateContextMenuImplN(this, floatPoint, style, direction); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + return r; +} + +result +ContextMenu::Construct(const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction) +{ + _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this); + SysAssertf(pImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + result r = E_SUCCESS; + + // Create a ContextMenu Impl pImpl = _ContextMenuImpl::CreateContextMenuImplN(this, point, style, direction); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -502,6 +533,20 @@ ContextMenu::SetAnchorPosition(const Tizen::Graphics::Point& position) SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); result r = E_SUCCESS; + FloatPoint floatPosition = _CoordinateSystemUtils::ConvertToFloat(position); + r = pImpl->SetAnchorPosition(floatPosition.x, floatPosition.y); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +ContextMenu::SetAnchorPosition(const Tizen::Graphics::FloatPoint& position) +{ + _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = E_SUCCESS; r = pImpl->SetAnchorPosition(position.x, position.y); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -514,13 +559,25 @@ ContextMenu::GetAnchorPosition(void) const const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - Tizen::Graphics::Point position = pImpl->GetAnchorPosition(); + Tizen::Graphics::FloatPoint position = pImpl->GetAnchorPosition(); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::Point(0, 0), r, "[%s] Propagating.", GetErrorMessage(r)); - return position; + return _CoordinateSystemUtils::ConvertToInteger(position); } +Tizen::Graphics::FloatPoint +ContextMenu::GetAnchorPositionF(void) const +{ + const _ContextMenuImpl* pImpl = _ContextMenuImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + Tizen::Graphics::FloatPoint position = pImpl->GetAnchorPosition(); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Tizen::Graphics::FloatPoint(0.0f, 0.0f), r, "[%s] Propagating.", GetErrorMessage(r)); + + return position; +} Tizen::Graphics::Color ContextMenu::GetColor(void) const diff --git a/src/ui/controls/FUiCtrlCustomItem.cpp b/src/ui/controls/FUiCtrlCustomItem.cpp index 9a593b4..f081aa2 100644 --- a/src/ui/controls/FUiCtrlCustomItem.cpp +++ b/src/ui/controls/FUiCtrlCustomItem.cpp @@ -25,6 +25,7 @@ #include #include #include "FUiCtrl_CustomItemImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -43,6 +44,12 @@ CustomItem::~CustomItem(void) result CustomItem::Construct(const Dimension& itemSize, ListAnnexStyle style) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +CustomItem::Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style) +{ result r = E_SUCCESS; _CustomItemImpl* pCustomImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); @@ -55,6 +62,7 @@ CustomItem::Construct(const Dimension& itemSize, ListAnnexStyle style) _pImpl = pCustomImpl; return r; + } result @@ -63,7 +71,17 @@ CustomItem::AddElement(const Rectangle& rect, int elementId, const EnrichedText& _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(_CoordinateSystemUtils::ConvertToFloat(rect), elementId, text); +} + +result +CustomItem::AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const EnrichedText& text) +{ + _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(rect, elementId, text); + } result @@ -72,6 +90,15 @@ CustomItem::AddElement(const Rectangle& rect, int elementId, const String& text, _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(_CoordinateSystemUtils::ConvertToFloat(rect), elementId, text, textSliding); +} + +result +CustomItem::AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const String& text, bool textSliding) +{ + _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(rect, elementId, text, textSliding); } @@ -82,6 +109,17 @@ CustomItem::AddElement(const Rectangle& rect, int elementId, const String& text, _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(_CoordinateSystemUtils::ConvertToFloat(rect), elementId, text, textSize, normalTextColor, + pressedTextColor, highlightedTextColor, textSliding); +} + +result +CustomItem::AddElement(const FloatRectangle& rect, int elementId, const String& text, float textSize, + const Color& normalTextColor, const Color& pressedTextColor, const Color& highlightedTextColor, bool textSliding) +{ + _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(rect, elementId, text, textSize, normalTextColor, pressedTextColor, highlightedTextColor, textSliding); } @@ -93,6 +131,16 @@ CustomItem::AddElement(const Rectangle& rect, int elementId, const Bitmap& norma _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(_CoordinateSystemUtils::ConvertToFloat(rect), elementId, normalBitmap, pPressedBitmap, pHighlightedbitmap); +} + +result +CustomItem::AddElement(const FloatRectangle& rect, int elementId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, + const Bitmap* pHighlightedbitmap) +{ + _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(rect, elementId, normalBitmap, pPressedBitmap, pHighlightedbitmap); } @@ -102,6 +150,15 @@ CustomItem::AddElement(const Rectangle& rect, int elementId, const ICustomElemen _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(_CoordinateSystemUtils::ConvertToFloat(rect), elementId, element); +} + +result +CustomItem::AddElement(const FloatRectangle& rect, int elementId, const ICustomElement& element) +{ + _CustomItemImpl* pImpl = static_cast<_CustomItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->AddElement(rect, elementId, element); } diff --git a/src/ui/controls/FUiCtrlDatePicker.cpp b/src/ui/controls/FUiCtrlDatePicker.cpp index 6b1c83c..6cadd14 100644 --- a/src/ui/controls/FUiCtrlDatePicker.cpp +++ b/src/ui/controls/FUiCtrlDatePicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlDatePicker.cpp * @brief This is the implementation file for the DatePicker class. diff --git a/src/ui/controls/FUiCtrlDateTimePicker.cpp b/src/ui/controls/FUiCtrlDateTimePicker.cpp index 4de0388..42eb8ed 100644 --- a/src/ui/controls/FUiCtrlDateTimePicker.cpp +++ b/src/ui/controls/FUiCtrlDateTimePicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlDateTimePicker.cpp * @brief This is the implementation file for the DateTimePicker class. diff --git a/src/ui/controls/FUiCtrlEditArea.cpp b/src/ui/controls/FUiCtrlEditArea.cpp old mode 100644 new mode 100755 index acb0df4..ddb4bf7 --- a/src/ui/controls/FUiCtrlEditArea.cpp +++ b/src/ui/controls/FUiCtrlEditArea.cpp @@ -71,6 +71,34 @@ CATCH: return r; } +result +EditArea::Construct(const FloatRectangle& rect, InputStyle inputStyle, int limitLength) +{ + result r = E_SUCCESS; + + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pEditAreaImpl = _EditAreaImpl::CreateEditAreaImplN(this, rect); + SysTryReturn(NID_UI_CTRL, pEditAreaImpl != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _pControlImpl = pEditAreaImpl; + + r = SetBounds(rect.x, rect.y, rect.width, rect.height); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pEditAreaImpl->Initialize(inputStyle, limitLength); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete pEditAreaImpl; + _pControlImpl = null; + + return r; +} + HorizontalAlignment EditArea::GetTextAlignment(void) const { @@ -134,6 +162,15 @@ EditArea::GetLineSpacing(void) const return pEditAreaImpl->GetLineSpacing(); } +float +EditArea::GetLineSpacingF(void) const +{ + const _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->GetLineSpacingF(); +} + result EditArea::SetLineSpacing(int multiplier, int extra) { @@ -143,6 +180,15 @@ EditArea::SetLineSpacing(int multiplier, int extra) return pEditAreaImpl->SetLineSpacing(multiplier, extra); } +result +EditArea::SetLineSpacing(int multiplier, float extra) +{ + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->SetLineSpacing(multiplier, extra); +} + int EditArea::GetMargin(EditMarginType marginType) const { @@ -152,6 +198,15 @@ EditArea::GetMargin(EditMarginType marginType) const return pEditAreaImpl->GetMargin(marginType); } +float +EditArea::GetMarginF(EditMarginType marginType) const +{ + const _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->GetMarginF(marginType); +} + result EditArea::SetMargin(EditMarginType marginType, int margin) { @@ -162,6 +217,15 @@ EditArea::SetMargin(EditMarginType marginType, int margin) } result +EditArea::SetMargin(EditMarginType marginType, float margin) +{ + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->SetMargin(marginType, margin); +} + +result EditArea::SetKeypadActionEnabled(bool enable) { _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); @@ -270,6 +334,15 @@ EditArea::GetTextSize(void) const return pEditAreaImpl->GetTextSize(); } +float +EditArea::GetTextSizeF(void) const +{ + const _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->GetTextSizeF(); +} + result EditArea::SetTextSize(int size) { @@ -279,6 +352,15 @@ EditArea::SetTextSize(int size) return pEditAreaImpl->SetTextSize(size); } +result +EditArea::SetTextSize(float size) +{ + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditAreaImpl->SetTextSize(size); +} + Color EditArea::GetColor(EditStatus status) const { @@ -700,6 +782,8 @@ EditArea::SetKeypadEnabled(bool enable) SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); pEditAreaImpl->SetKeypadEnabled(enable); + + return; } bool @@ -855,4 +939,25 @@ EditArea::GetCurrentLanguage(LanguageCode& language) const return pEditAreaImpl->GetCurrentLanguage(language); } +void +EditArea::SetEditTextFilter(IEditTextFilter* pFilter) +{ + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + pEditAreaImpl->SetEditTextFilter(pFilter); + return; +} + +void +EditArea::SendOpaqueCommand (const String& command) +{ + _EditAreaImpl* pEditAreaImpl = _EditAreaImpl::GetInstance(*this); + SysAssertf(pEditAreaImpl != null, "Not yet constructed. Construct() should be called before use."); + + pEditAreaImpl->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlEditDate.cpp b/src/ui/controls/FUiCtrlEditDate.cpp index d4a4722..70229f6 100644 --- a/src/ui/controls/FUiCtrlEditDate.cpp +++ b/src/ui/controls/FUiCtrlEditDate.cpp @@ -55,6 +55,22 @@ EditDate::Construct(const Point& point, const String& title) return r; } +result +EditDate::Construct(const FloatPoint& point, const String& title) +{ + _EditDateImpl* pEditDateImpl = _EditDateImpl::GetInstance(*this); + SysAssertf((pEditDateImpl == null), + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pEditDateImpl = _EditDateImpl::CreateEditDateImplFN(this, point, title); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pEditDateImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pEditDateImpl; + + return r; +} + void EditDate::AddDateChangeEventListener(IDateChangeEventListener& listener) { diff --git a/src/ui/controls/FUiCtrlEditField.cpp b/src/ui/controls/FUiCtrlEditField.cpp old mode 100644 new mode 100755 index fc23de0..1a1e255 --- a/src/ui/controls/FUiCtrlEditField.cpp +++ b/src/ui/controls/FUiCtrlEditField.cpp @@ -87,6 +87,50 @@ CATCH: } result +EditField::Construct(const FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, bool showTitle, + int limitLength, + GroupStyle groupStyle) +{ + result r = E_SUCCESS; + + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + EditFieldTitleStyle titleStyle = EDIT_FIELD_TITLE_STYLE_NONE; + bool enableClear = false; + + if (showTitle == true) + { + titleStyle = EDIT_FIELD_TITLE_STYLE_TOP; + } + + pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle); + if (pEditFieldImpl == null) + { + r = GetLastResult(); + return r; + } + + _pControlImpl = pEditFieldImpl; + + r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle); + if (r != E_SUCCESS) + { + goto CATCH; + } + + SetBounds(rect.x, rect.y, rect.width, rect.height); + + return r; + +CATCH: + delete pEditFieldImpl; + _pControlImpl = null; + + return r; +} + +result EditField::Construct(const Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, EditFieldTitleStyle titleStyle, bool enableClear, int limitLength, GroupStyle groupStyle) @@ -126,6 +170,46 @@ CATCH: return r; } +result +EditField::Construct(const FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, + EditFieldTitleStyle titleStyle, bool enableClear, int limitLength, + GroupStyle groupStyle) +{ + result r = E_SUCCESS; + + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle); + if (pEditFieldImpl == null) + { + r = GetLastResult(); + return r; + } + + _pControlImpl = pEditFieldImpl; + + r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle); + if (r != E_SUCCESS) + { + goto CATCH; + } + + r = SetBounds(rect.x, rect.y, rect.width, rect.height); + if (r != E_SUCCESS) + { + goto CATCH; + } + + return r; + +CATCH: + delete pEditFieldImpl; + _pControlImpl = null; + + return r; +} + HorizontalAlignment EditField::GetTextAlignment(void) const { @@ -189,6 +273,15 @@ EditField::GetMargin(EditMarginType marginType) const return pEditFieldImpl->GetMargin(marginType); } +float +EditField::GetMarginF(EditMarginType marginType) const +{ + const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditFieldImpl->GetMarginF(marginType); +} + result EditField::SetMargin(EditMarginType marginType, int margin) { @@ -199,6 +292,15 @@ EditField::SetMargin(EditMarginType marginType, int margin) } result +EditField::SetMargin(EditMarginType marginType, float margin) +{ + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditFieldImpl->SetMargin(marginType, margin); +} + +result EditField::SetKeypadActionEnabled(bool enable) { _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); @@ -288,6 +390,15 @@ EditField::GetTextSize(void) const return pEditFieldImpl->GetTextSize(); } +float +EditField::GetTextSizeF(void) const +{ + const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditFieldImpl->GetTextSizeF(); +} + result EditField::SetTextSize(int size) { @@ -297,6 +408,15 @@ EditField::SetTextSize(int size) return pEditFieldImpl->SetTextSize(size); } +result +EditField::SetTextSize(float size) +{ + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pEditFieldImpl->SetTextSize(size); +} + Color EditField::GetColor(EditStatus status) const { @@ -693,6 +813,8 @@ EditField::SetKeypadEnabled(bool enable) SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); pEditFieldImpl->SetKeypadEnabled(enable); + + return; } bool @@ -893,4 +1015,26 @@ EditField::GetCurrentLanguage(LanguageCode& language) const return pEditFieldImpl->GetCurrentLanguage(language); } +void +EditField::SetEditTextFilter(IEditTextFilter* pFilter) +{ + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + pEditFieldImpl->SetEditTextFilter(pFilter); + + return; +} + +void +EditField::SendOpaqueCommand (const String& command) +{ + _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this); + SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use."); + + pEditFieldImpl->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlEditTime.cpp b/src/ui/controls/FUiCtrlEditTime.cpp index 7edfe95..32ebe10 100644 --- a/src/ui/controls/FUiCtrlEditTime.cpp +++ b/src/ui/controls/FUiCtrlEditTime.cpp @@ -55,6 +55,22 @@ EditTime::Construct(const Point& point, const String& title) return r; } +result +EditTime::Construct(const FloatPoint& point, const String& title) +{ + _EditTimeImpl* pEditTimeImpl = _EditTimeImpl::GetInstance(*this); + SysAssertf((pEditTimeImpl == null), + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pEditTimeImpl = _EditTimeImpl::CreateEditTimeImplFN(this, point, title); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pEditTimeImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pEditTimeImpl; + + return r; +} + void EditTime::AddTimeChangeEventListener(ITimeChangeEventListener& listener) { diff --git a/src/ui/controls/FUiCtrlExpandableEditArea.cpp b/src/ui/controls/FUiCtrlExpandableEditArea.cpp old mode 100644 new mode 100755 index 4173441..1dc4b06 --- a/src/ui/controls/FUiCtrlExpandableEditArea.cpp +++ b/src/ui/controls/FUiCtrlExpandableEditArea.cpp @@ -50,8 +50,8 @@ ExpandableEditArea::~ExpandableEditArea(void) result ExpandableEditArea::Construct(const Rectangle& rect, ExpandableEditAreaStyle style, - ExpandableEditAreaTitleStyle titleStyle, - int maxExpandableLines) + ExpandableEditAreaTitleStyle titleStyle, + int maxExpandableLines) { result r = E_SUCCESS; @@ -88,6 +88,46 @@ CATCH: return r; } + +result +ExpandableEditArea::Construct(const FloatRectangle& rect, ExpandableEditAreaStyle style, + ExpandableEditAreaTitleStyle titleStyle, + int maxExpandableLines) +{ + + result r = E_SUCCESS; + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + + SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + SysTryReturnResult(NID_UI_CTRL, (maxExpandableLines > 0), E_INVALID_ARG, "Invalid argument is used. maxExpandableLines is less than zero"); + SysTryReturnResult(NID_UI_CTRL, (maxExpandableLines <= MAX_EXPANDABLE_LINES), E_MAX_EXCEEDED, "maxExpandableLines exceeds the maximum limit."); + SysTryReturnResult(NID_UI_CTRL, !(style == EXPANDABLE_EDIT_AREA_STYLE_TOKEN && titleStyle == EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP), + E_UNSUPPORTED_OPTION, "The input option EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP is unsupported. The token style EXPANDABLE_EDIT_AREA_STYLE_TOKEN does not support the title style EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP"); + SysTryReturnResult(NID_UI_CTRL, + (rect.width >= MINIMUM_SIZE_VALUE && rect.width <= MAXIMUM_SIZE_VALUE && rect.height >= MINIMUM_SIZE_VALUE && rect.height <= MAXIMUM_SIZE_VALUE), E_INVALID_ARG, + "Invalid argument is used. The specified size(%d, %d) is outside range of min size(%d, %d) and max size(%d, %d) of ExpandableEditArea." + , rect.width, rect.height, MINIMUM_SIZE_VALUE, MINIMUM_SIZE_VALUE, MAXIMUM_SIZE_VALUE, MAXIMUM_SIZE_VALUE); + + pImpl = _ExpandableEditAreaImpl::CreateExpandableEditAreaImplFN(this, rect, style, titleStyle); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, pImpl != null, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + r = SetBounds(rect); + + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + r = pImpl->Construct(rect, style, titleStyle, maxExpandableLines); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + Control::Dispose(); + return r; +} + result ExpandableEditArea::AppendCharacter(const Character& character) { @@ -241,6 +281,16 @@ ExpandableEditArea::GetLineSpacing (void) const return pImpl->GetLineSpacing(); } +float +ExpandableEditArea::GetLineSpacingF(void) const +{ + + const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetLineSpacingF(); +} + result ExpandableEditArea::SetLineSpacing (int multiplier, int extra) { @@ -250,6 +300,14 @@ ExpandableEditArea::SetLineSpacing (int multiplier, int extra) return pImpl->SetLineSpacing(multiplier, extra); } +result +ExpandableEditArea::SetLineSpacing(int multiplier, float extra) +{ + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->SetLineSpacing(multiplier, extra); +} int ExpandableEditArea::GetMaxLineCount(void) const { @@ -277,6 +335,15 @@ ExpandableEditArea::GetTextSize(void) const return pImpl->GetTextSize(); } +float +ExpandableEditArea::GetTextSizeF(void) const +{ + const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetTextSizeF(); +} + result ExpandableEditArea::SetTextSize(int size) { @@ -286,6 +353,15 @@ ExpandableEditArea::SetTextSize(int size) return pImpl->SetTextSize(size); } +result +ExpandableEditArea::SetTextSize(float size) +{ + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->SetTextSize(size); +} + int ExpandableEditArea::GetMargin(EditMarginType marginType) const { @@ -295,6 +371,15 @@ ExpandableEditArea::GetMargin(EditMarginType marginType) const return pImpl->GetMargin(marginType); } +float +ExpandableEditArea::GetMarginF(EditMarginType marginType) const +{ + const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetMarginF(marginType); +} + result ExpandableEditArea::SetMargin(EditMarginType marginType, int margin) { @@ -305,6 +390,15 @@ ExpandableEditArea::SetMargin(EditMarginType marginType, int margin) } result +ExpandableEditArea::SetMargin(EditMarginType marginType, float margin) +{ + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->SetMargin(marginType, margin); +} + +result ExpandableEditArea::SetLowerCaseModeEnabled(bool enable) { _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); @@ -874,4 +968,26 @@ ExpandableEditArea::IsAutoShrinkModeEnabled(void) const return pImpl->IsAutoShrinkModeEnabled(); } +void +ExpandableEditArea::SetEditTextFilter(IEditTextFilter* pFilter) +{ + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetEditTextFilter(pFilter); + + return; +} + +void +ExpandableEditArea::SendOpaqueCommand(const String& command) +{ + _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlFooter.cpp b/src/ui/controls/FUiCtrlFooter.cpp index 4761543..4de0dba 100644 --- a/src/ui/controls/FUiCtrlFooter.cpp +++ b/src/ui/controls/FUiCtrlFooter.cpp @@ -536,4 +536,39 @@ Footer::GetButtonBounds(ButtonPosition position) const return pFooterImpl->GetButtonBounds(position); } +FloatRectangle +Footer::GetButtonBoundsF(ButtonPosition position) const +{ + ClearLastResult(); + + const _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); + + SysAssertf(pFooterImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pFooterImpl->GetButtonBoundsF(position); +} + +result +Footer::SetButtonBadgeIcon(ButtonPosition position, const Bitmap* pBadgeIcon) +{ + _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); + + SysAssertf(pFooterImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pFooterImpl->SetButtonBadgeIcon(position, pBadgeIcon); +} + +result +Footer::SetButtonNumberedBadgeIcon(ButtonPosition position, int number) +{ + _FooterImpl* pFooterImpl = _FooterImpl::GetInstance(*this); + + SysAssertf(pFooterImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pFooterImpl->SetButtonNumberedBadgeIcon(position, number); +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlForm.cpp b/src/ui/controls/FUiCtrlForm.cpp index 7fe93a4..c2af163 100644 --- a/src/ui/controls/FUiCtrlForm.cpp +++ b/src/ui/controls/FUiCtrlForm.cpp @@ -198,6 +198,16 @@ Form::GetClientAreaBounds(void) const return pImpl->GetClientBounds(); } +FloatRectangle +Form::GetClientAreaBoundsF(void) const +{ + const _FormImpl* pImpl = _FormImpl::GetInstance(*this); + SysAssertf(pImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetClientBoundsF(); +} + unsigned long Form::GetFormStyle(void) const { @@ -587,6 +597,16 @@ Form::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType) return pImpl->GetOverlayRegionN(rect, regionType); } +OverlayRegion* +Form::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionType) +{ + _FormImpl* pImpl = _FormImpl::GetInstance(*this); + SysAssertf(pImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetOverlayRegionN(rect, regionType); +} + Canvas* Form::GetClientAreaCanvasN(void) const { @@ -607,6 +627,17 @@ Form::TranslateToClientAreaPosition(const Point& position) const return pImpl->TranslateToClientAreaPosition(position); } +FloatPoint +Form::TranslateToClientAreaPosition(const FloatPoint& position) const +{ + const _FormImpl* pImpl = _FormImpl::GetInstance(*this); + SysAssertf(pImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pImpl->TranslateToClientAreaPosition(position); +} + + Point Form::TranslateFromClientAreaPosition(const Point& clientPosition) const { @@ -617,6 +648,16 @@ Form::TranslateFromClientAreaPosition(const Point& clientPosition) const return pImpl->TranslateFromClientAreaPosition(clientPosition); } +FloatPoint +Form::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const +{ + const _FormImpl* pImpl = _FormImpl::GetInstance(*this); + SysAssertf(pImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pImpl->TranslateFromClientAreaPosition(clientPosition); +} + void Form::SetFormBackEventListener(IFormBackEventListener* pFormBackEventListener) { diff --git a/src/ui/controls/FUiCtrlFrame.cpp b/src/ui/controls/FUiCtrlFrame.cpp index dc6153c..96dd9de 100644 --- a/src/ui/controls/FUiCtrlFrame.cpp +++ b/src/ui/controls/FUiCtrlFrame.cpp @@ -76,6 +76,25 @@ Frame::Construct(const Rectangle& rect) return r; } +result +Frame::Construct(const FloatRectangle& rect) +{ + SysAssertf(_FrameImpl::GetInstance(*this) == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + result r = E_SUCCESS; + + _FrameImpl* pImpl = _FrameImpl::CreateFrameImplN(this); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + pImpl->SetFloatingBounds(rect); + + return r; +} + void Frame::AddOrientationEventListener(IOrientationEventListener& listener) { @@ -144,6 +163,20 @@ Frame::SetCurrentForm(const Form& form) return E_SUCCESS; } +result +Frame::SetCurrentForm(Form* pForm) +{ + _FrameImpl* pImpl = _FrameImpl::GetInstance(*this); + SysAssertf(pImpl != null, + "Not yet constructed. Construct() should be called before use."); + + result r = pImpl->SetCurrentForm(_FormImpl::GetInstance(*pForm)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + + Color Frame::GetBackgroundColor(void) const { diff --git a/src/ui/controls/FUiCtrlGallery.cpp b/src/ui/controls/FUiCtrlGallery.cpp old mode 100644 new mode 100755 index aa3783c..5a55f6b --- a/src/ui/controls/FUiCtrlGallery.cpp +++ b/src/ui/controls/FUiCtrlGallery.cpp @@ -17,8 +17,6 @@ /** * @file FUiCtrlGallery.cpp * @brief This file contains implementation of Gallery class. - * - * This header file contains the declarations of the Gallery class and its helper classes. */ //Includes @@ -65,6 +63,30 @@ CATCH: } result +Gallery::Construct(const FloatRectangle& rect) +{ + SysAssertf(_GalleryImpl::GetInstance(*this) == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + _GalleryImpl* pGalleryImpl = _GalleryImpl::CreateGalleryImplN(this); + result r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred."); + + _pControlImpl = pGalleryImpl; + + r = Control::SetBounds(rect); + SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred."); + + return r; + +CATCH: + delete pGalleryImpl; + _pControlImpl = null; + return r; +} + +result Gallery::SetItemProvider(IGalleryItemProvider &provider) { _GalleryImpl* pGalleryImpl = _GalleryImpl::GetInstance(*this); diff --git a/src/ui/controls/FUiCtrlGalleryItem.cpp b/src/ui/controls/FUiCtrlGalleryItem.cpp index 8353f0c..1203b95 100644 --- a/src/ui/controls/FUiCtrlGalleryItem.cpp +++ b/src/ui/controls/FUiCtrlGalleryItem.cpp @@ -16,9 +16,7 @@ // /** * @file FUiCtrlGalleryItem.cpp - * @brief This is the header file for the GalleryItem class. - * - * This header file contains the declarations of the GalleryItem class and its helper classes. + * @brief This file contains implementation of GalleryItem class. */ //includes diff --git a/src/ui/controls/FUiCtrlGroupContainer.cpp b/src/ui/controls/FUiCtrlGroupContainer.cpp new file mode 100644 index 0000000..b25daed --- /dev/null +++ b/src/ui/controls/FUiCtrlGroupContainer.cpp @@ -0,0 +1,258 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrlGroupContainer.cpp + * @brief This is the implementation file for GroupContainer class. + */ + +#include +#include +#include +#include "FUiCtrl_GroupContainerImpl.h" + + +using namespace Tizen::Graphics; + +namespace Tizen { namespace Ui { namespace Controls +{ + +GroupContainer::GroupContainer(void) +{ + +} + +GroupContainer::~GroupContainer(void) +{ + +} + +result +GroupContainer::Construct(const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth) +{ + result r = E_SUCCESS; + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + pGroupContainerImpl = _GroupContainerImpl::CreateGroupContainerImplN(this, rect, rowCount, columnCount, lineWidth); + + r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + pGroupContainerImpl->Initialize(); + r = GetLastResult(); + _pControlImpl = pGroupContainerImpl; + + return r; +} + +result +GroupContainer::AddControlAt(Control& control, int rowIndex, int columnIndex) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->AddControlAt(control, rowIndex, columnIndex); +} + +const Control* +GroupContainer::GetControlAt(int rowIndex, int columnIndex) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed! Construct() should be called before use."); + + return pGroupContainerImpl->GetControlAt(rowIndex, columnIndex); +} + +Control* +GroupContainer::GetControlAt(int rowIndex, int columnIndex) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed! Construct() should be called before use."); + + return pGroupContainerImpl->GetControlAt(rowIndex, columnIndex); +} + +result +GroupContainer::RemoveControlAt(int rowIndex, int columnIndex) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed! Construct() should be called before use."); + + return pGroupContainerImpl->RemoveControlAt(rowIndex, columnIndex); +} + +result +GroupContainer::SetColumnWidth(int columnIndex, float width) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetColumnWidth(columnIndex, width); +} + +float +GroupContainer::GetColumnWidth(int columnIndex) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->GetColumnWidth(columnIndex); +} + +result +GroupContainer::SetRowHeight(int rowIndex, float height) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetRowHeight(rowIndex, height); +} + +float +GroupContainer::GetRowHeight(int rowIndex) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->GetRowHeight(rowIndex); +} + +result +GroupContainer::Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->Merge(rowStartIndex, columnStartIndex, rowCount, columnCount); +} + +result +GroupContainer::SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetChildResizingEnabled(rowIndex, columnIndex, enable); +} + +result +GroupContainer::SetMargin(int rowIndex, int columnIndex, float leftMargin, float topMargin, float rightMargin, float bottomMargin) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetMargin(rowIndex, columnIndex, leftMargin, topMargin, rightMargin, bottomMargin); +} + +result +GroupContainer::Split(int rowIndex, int columnIndex) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->Split(rowIndex, columnIndex); +} + +FloatRectangle +GroupContainer::GetBoundsAt(int rowIndex, int columnIndex) const +{ + const _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->GetBoundsAt(rowIndex, columnIndex); +} + +result +GroupContainer::SetColumnStretchable(int columnIndex, bool stretchable) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetColumnStretchable(columnIndex, stretchable); +} + +bool +GroupContainer::IsColumnStretchable(int columnIndex) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->IsColumnStretchable(columnIndex); +} + +result +GroupContainer::SetRowStretchable(int rowIndex, bool stretchable) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->SetRowStretchable(rowIndex, stretchable); +} + +bool +GroupContainer::IsRowStretchable(int rowIndex) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->IsRowStretchable(rowIndex); +} + + +Color +GroupContainer::GetBackgroundColor(void) const +{ + const _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->GetBackgroundColor(); +} + +void +GroupContainer::SetBackgroundColor(const Color& color) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed! Construct() should be called before use."); + + pGroupContainerImpl->SetBackgroundColor(color); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); +} + +Color +GroupContainer::GetLineColor(void) const +{ + _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this)); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pGroupContainerImpl->GetLineColor(); +} + +void +GroupContainer::SetLineColor(const Color& color) +{ + _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this); + SysAssertf(pGroupContainerImpl != null, "Not yet constructed! Construct() should be called before use."); + + pGroupContainerImpl->SetLineColor(color); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to set the line color."); +} + +}}} //Tizen::Ui::Controls + diff --git a/src/ui/controls/FUiCtrlGroupItem.cpp b/src/ui/controls/FUiCtrlGroupItem.cpp index 94b7be5..4c7b39e 100644 --- a/src/ui/controls/FUiCtrlGroupItem.cpp +++ b/src/ui/controls/FUiCtrlGroupItem.cpp @@ -25,6 +25,7 @@ #include #include #include "FUiCtrl_GroupItemImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -46,6 +47,12 @@ GroupItem::~GroupItem(void) result GroupItem::Construct(const Dimension& itemSize) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize)); +} + +result +GroupItem::Construct(const FloatDimension& itemSize) +{ result r = E_SUCCESS; _GroupItemImpl* pGroupItemImpl = _GroupItemImpl::GetInstance(*this); @@ -103,6 +110,12 @@ GroupItem::GetTextColor(void) const result GroupItem::SetTextSize(int size) { + return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +GroupItem::SetTextSize(float size) +{ SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use."); return _pImpl->SetTextSize(size); @@ -111,11 +124,18 @@ GroupItem::SetTextSize(int size) int GroupItem::GetTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +GroupItem::GetTextSizeF(void) const +{ SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use."); return _pImpl->GetTextSize(); } + result GroupItem::SetElement(const String& text, const Bitmap* pBitmap) { diff --git a/src/ui/controls/FUiCtrlGroupedListView.cpp b/src/ui/controls/FUiCtrlGroupedListView.cpp index d9f4fc0..aac1b35 100644 --- a/src/ui/controls/FUiCtrlGroupedListView.cpp +++ b/src/ui/controls/FUiCtrlGroupedListView.cpp @@ -25,6 +25,7 @@ #include #include #include "FUiCtrl_GroupedListViewImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -61,7 +62,7 @@ GroupedListView::Construct(const Rectangle& rect, GroupedListViewStyle style, bo _pControlImpl = pImpl; - r = Control::SetBounds(rect.x, rect.y, rect.width, rect.height); + r = Control::SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect)); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -84,7 +85,30 @@ GroupedListView::Construct(const Rectangle& rect, GroupedListViewStyle style, bo _pControlImpl = pImpl; - r = Control::SetBounds(rect.x, rect.y, rect.width, rect.height); + r = Control::SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect)); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + Control::Dispose(); + return r; +} + +result +GroupedListView::Construct(const FloatRectangle& rect, GroupedListViewStyle style, bool itemDivider, ListScrollStyle scrollStyle) +{ + result r = E_SUCCESS; + + SysAssertf((_GroupedListViewImpl::GetInstance(*this) == null), + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::CreateGroupedListViewImplN(this, style, itemDivider, scrollStyle); + SysTryReturn(NID_UI_CTRL, (pImpl != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _pControlImpl = pImpl; + + r = Control::SetBounds(rect); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -103,6 +127,15 @@ GroupedListView::SetItemProvider(IGroupedListViewItemProvider& provider) return pImpl->SetItemProvider(provider); } +result +GroupedListView::SetItemProvider(IGroupedListViewItemProviderF& provider) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->SetItemProvider(provider); +} + void GroupedListView::AddGroupedListViewItemEventListener(IGroupedListViewItemEventListener& listener) { @@ -154,6 +187,16 @@ GroupedListView::AddScrollEventListener(IScrollEventListener& listener) } void +GroupedListView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->AddScrollEventListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); +} + +void GroupedListView::RemoveScrollEventListener(IScrollEventListener& listener) { _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); @@ -164,6 +207,16 @@ GroupedListView::RemoveScrollEventListener(IScrollEventListener& listener) } void +GroupedListView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->RemoveScrollEventListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); +} + +void GroupedListView::AddUiLinkEventListener(IUiLinkEventListener& listener) { _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); @@ -340,11 +393,26 @@ GroupedListView::GetItemIndexFromPosition(int x, int y, int& groupIndex, int& it } result +GroupedListView::GetItemIndexFromPosition(float x, float y, int& groupIndex, int& itemIndex) const +{ + return GetItemIndexFromPosition(FloatPoint(x, y), groupIndex, itemIndex); +} + +result GroupedListView::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const { const _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex); +} + +result +GroupedListView::GetItemIndexFromPosition(const FloatPoint& position, int& groupIndex, int& itemIndex) const +{ + const _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(position, groupIndex, itemIndex); } @@ -355,11 +423,26 @@ GroupedListView::GetItemIndexFromPosition(int x, int y, int& groupIndex, int& it } result +GroupedListView::GetItemIndexFromPosition(float x, float y, int& groupIndex, int& itemIndex, int& elementId) const +{ + return GetItemIndexFromPosition(FloatPoint(x, y), groupIndex, itemIndex, elementId); +} + +result GroupedListView::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex, int& elementId) const { const _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex, elementId); +} + +result +GroupedListView::GetItemIndexFromPosition(const FloatPoint& position, int& groupIndex, int& itemIndex, int& elementId) const +{ + const _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(position, groupIndex, itemIndex, elementId); } @@ -501,6 +584,24 @@ GroupedListView::IsGroupExpanded(int groupIndex) const } result +GroupedListView::ExpandAllGroups(void) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->ExpandAllGroups(); +} + +result +GroupedListView::CollapseAllGroups(void) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->CollapseAllGroups(); +} + +result GroupedListView::BeginReorderingMode(void) { _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); @@ -527,4 +628,23 @@ GroupedListView::IsInReorderingMode(void) const return pImpl->IsInReorderingMode(); } +void +GroupedListView::SetScrollInputMode(ScrollInputMode mode) +{ + _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetScrollInputMode(mode); +} + +ScrollInputMode +GroupedListView::GetScrollInputMode(void) const +{ + const _GroupedListViewImpl* pImpl = _GroupedListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetScrollInputMode(); +} + + }}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlGroupedTableView.cpp b/src/ui/controls/FUiCtrlGroupedTableView.cpp old mode 100644 new mode 100755 index fbf079b..edf5b42 --- a/src/ui/controls/FUiCtrlGroupedTableView.cpp +++ b/src/ui/controls/FUiCtrlGroupedTableView.cpp @@ -25,8 +25,10 @@ #include #include #include +#include #include #include "FUiCtrl_TableViewImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -53,6 +55,32 @@ GroupedTableView::Construct(const Tizen::Graphics::Rectangle& rect, bool itemDiv _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, _CoordinateSystemUtils::ConvertToFloat(rect), TABLE_VIEW_STYLE_GROUPED, itemDivider, scrollStyle); + + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + r = SetBounds(rect); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating", GetErrorMessage(r)); + + return E_SUCCESS; + +CATCH: + Control::Dispose(); + + return r; +} + +result +GroupedTableView::Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle) +{ + result r = E_SUCCESS; + + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, rect, TABLE_VIEW_STYLE_GROUPED, itemDivider, scrollStyle); r = GetLastResult(); @@ -80,6 +108,14 @@ GroupedTableView::SetItemProvider(IGroupedTableViewItemProvider* pProvider) pImpl->SetGroupedStyleItemProvider(pProvider); } +void +GroupedTableView::SetItemProviderF(IGroupedTableViewItemProviderF* pProvider) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetGroupedStyleItemProviderF(pProvider); +} result GroupedTableView::AddGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener) @@ -135,6 +171,24 @@ GroupedTableView::RemoveScrollEventListener(IScrollEventListener& listener) return pImpl->RemoveScrollEventListener(listener); } +result +GroupedTableView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->AddScrollEventListener(listener); +} + +result +GroupedTableView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RemoveScrollEventListener(listener); +} + void GroupedTableView::SetCollapseByPinchGestureEnabled(bool enable) { @@ -240,6 +294,15 @@ GroupedTableView::RefreshItem(int groupIndex, int itemIndex, TableViewRefreshTyp return pImpl->RefreshTableView(groupIndex, itemIndex, type); } +result +GroupedTableView::RefreshAllItems(void) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RefreshAllItems(); +} + void GroupedTableView::UpdateTableView(void) { @@ -259,6 +322,15 @@ GroupedTableView::GetItemIndexFromPosition(const Tizen::Graphics::Point& positio } void +GroupedTableView::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->GetItemIndexFromPosition(position, groupIndex, itemIndex); +} + +void GroupedTableView::SetItemDividerColor(const Color& color) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); @@ -314,22 +386,22 @@ GroupedTableView::CollapseGroup(int groupIndex) return pImpl->CollapseGroup(groupIndex); } -void -GroupedTableView::ExpandAllGroup(void) +result +GroupedTableView::ExpandAllGroups(void) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - pImpl->ExpandAllGroup(); + return pImpl->ExpandAllGroup(); } -void -GroupedTableView::CollapseAllGroup(void) +result +GroupedTableView::CollapseAllGroups(void) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - pImpl->CollapseAllGroup(); + return pImpl->CollapseAllGroup(); } bool @@ -372,17 +444,47 @@ GroupedTableView::ScrollToItem(int groupIndex, int itemIndex, TableViewScrollIte } result -GroupedTableView::ScrollByPixel(int scrollDistance) +GroupedTableView::ScrollByPixel(int pixel) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pImpl->ScrollByPixel(_CoordinateSystemUtils::ConvertToFloat(pixel)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +GroupedTableView::ScrollByPixel(float pixel) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->ScrollByPixel(scrollDistance); + result r = pImpl->ScrollByPixel(pixel); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; } +int +GroupedTableView::GetCurrentScrollPosition(void) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return _CoordinateSystemUtils::ConvertToInteger(pImpl->GetCurrentScrollPosition()); +} + +float +GroupedTableView::GetCurrentScrollPositionF(void) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetCurrentScrollPosition(); +} + void GroupedTableView::SetScrollInputMode(ScrollInputMode mode) { @@ -428,15 +530,6 @@ GroupedTableView::GetScrollInputMode(void) const // return pImpl->IsInReorderingMode(); //} -int -GroupedTableView::GetCurrentScrollPosition(void) const -{ - const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); - SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - - return pImpl->GetCurrentScrollPosition(); -} - void GroupedTableView::SetScrollEnabled(bool enable) { diff --git a/src/ui/controls/FUiCtrlHeader.cpp b/src/ui/controls/FUiCtrlHeader.cpp index ff31c60..72a5509 100644 --- a/src/ui/controls/FUiCtrlHeader.cpp +++ b/src/ui/controls/FUiCtrlHeader.cpp @@ -707,6 +707,41 @@ Header::GetButtonBounds(ButtonPosition position) const return pHeaderImpl->GetButtonBounds(position); } +FloatRectangle +Header::GetButtonBoundsF(ButtonPosition position) const +{ + ClearLastResult(); + + const _HeaderImpl* pHeaderImpl = _HeaderImpl::GetInstance(*this); + + SysAssertf(pHeaderImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pHeaderImpl->GetButtonBoundsF(position); +} + +result +Header::SetTitleBadgeIcon(const Bitmap* pBadgeIcon) +{ + _HeaderImpl* pHeaderImpl = _HeaderImpl::GetInstance(*this); + + SysAssertf(pHeaderImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pHeaderImpl->SetTitleBadgeIcon(pBadgeIcon); +} + +result +Header::SetTitleNumberedBadgeIcon(int number) +{ + _HeaderImpl* pHeaderImpl = _HeaderImpl::GetInstance(*this); + + SysAssertf(pHeaderImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pHeaderImpl->SetTitleNumberedBadgeIcon(number); +} + Header::Header(void) { } diff --git a/src/ui/controls/FUiCtrlIGroupedListViewItemProviderF.cpp b/src/ui/controls/FUiCtrlIGroupedListViewItemProviderF.cpp new file mode 100644 index 0000000..a973972 --- /dev/null +++ b/src/ui/controls/FUiCtrlIGroupedListViewItemProviderF.cpp @@ -0,0 +1,36 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrlIGroupedListViewItemProviderF.cpp + * @brief This is the implementation file for IGroupedListViewItemProviderF class. + * + * This header file contains the implementation of IGroupedListViewItemProviderF class. + */ + +#include + +namespace Tizen { namespace Ui { namespace Controls +{ + +bool +IGroupedListViewItemProviderF::IsReorderable(int groupIndexFrom, int groupIndexTo) +{ + return true; +} + +}}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlIconListView.cpp b/src/ui/controls/FUiCtrlIconListView.cpp index a7c286a..9d291f0 100644 --- a/src/ui/controls/FUiCtrlIconListView.cpp +++ b/src/ui/controls/FUiCtrlIconListView.cpp @@ -25,6 +25,7 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_IconListViewImpl.h" using namespace Tizen::Base; @@ -66,6 +67,14 @@ result IconListView::Construct(const Rectangle& rect, const Dimension& itemBitmapSize, IconListViewStyle style, IconListViewScrollDirection scrollDirection, IconListViewScrollStyle scrollStyle) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(rect), _CoordinateSystemUtils::ConvertToFloat(itemBitmapSize), style, + scrollDirection, scrollStyle); +} + +result +IconListView::Construct(const FloatRectangle& rect, const FloatDimension& itemBitmapSize, IconListViewStyle style, + IconListViewScrollDirection scrollDirection, IconListViewScrollStyle scrollStyle) +{ // Check whether _pControlImpl has been set, that is, "already constructed" condition. SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); @@ -138,6 +147,16 @@ IconListView::AddScrollEventListener(IScrollEventListener& listener) } void +IconListView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. + SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + _IconListViewImpl* pImpl = _IconListViewImpl::GetInstance(*this); + pImpl->AddScrollEventListener(listener); +} + +void IconListView::RemoveScrollEventListener(IScrollEventListener& listener) { // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. @@ -147,6 +166,16 @@ IconListView::RemoveScrollEventListener(IScrollEventListener& listener) pImpl->RemoveScrollEventListener(listener); } +void +IconListView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. + SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + _IconListViewImpl* pImpl = _IconListViewImpl::GetInstance(*this); + pImpl->RemoveScrollEventListener(listener); +} + result IconListView::SetBackgroundBitmap(const Bitmap* pBitmap) { @@ -188,6 +217,12 @@ IconListView::GetBackgroundColor(void) const result IconListView::SetMargin(MarginType type, int value) { + return SetMargin(type, _CoordinateSystemUtils::ConvertToFloat(value)); +} + +result +IconListView::SetMargin(MarginType type, float value) +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -198,6 +233,12 @@ IconListView::SetMargin(MarginType type, int value) int IconListView::GetMargin(MarginType type) const { + return _CoordinateSystemUtils::ConvertToInteger(GetMarginF(type)); +} + +float +IconListView::GetMarginF(MarginType type) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -208,6 +249,12 @@ IconListView::GetMargin(MarginType type) const result IconListView::SetItemSpacing(int horizontalSpacing, int verticalSpacing) { + return SetItemSpacing(_CoordinateSystemUtils::ConvertToFloat(horizontalSpacing), _CoordinateSystemUtils::ConvertToFloat(verticalSpacing)); +} + +result +IconListView::SetItemSpacing(float horizontalSpacing, float verticalSpacing) +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -218,6 +265,12 @@ IconListView::SetItemSpacing(int horizontalSpacing, int verticalSpacing) int IconListView::GetItemHorizontalSpacing(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetItemHorizontalSpacingF()); +} + +float +IconListView::GetItemHorizontalSpacingF(void) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -228,6 +281,12 @@ IconListView::GetItemHorizontalSpacing(void) const int IconListView::GetItemVerticalSpacing(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetItemVerticalSpacingF()); +} + +float +IconListView::GetItemVerticalSpacingF(void) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -258,6 +317,12 @@ IconListView::IsItemChecked(int index) const int IconListView::GetItemIndexFromPosition(int x, int y) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y)); +} + +int +IconListView::GetItemIndexFromPosition(float x, float y) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -268,6 +333,12 @@ IconListView::GetItemIndexFromPosition(int x, int y) const int IconListView::GetItemIndexFromPosition(const Point& position) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position)); +} + +int +IconListView::GetItemIndexFromPosition(const FloatPoint& position) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -378,6 +449,12 @@ IconListView::GetItemTextColor(IconListViewItemDrawingStatus status) const result IconListView::SetItemTextSize(int size) { + return SetItemTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +IconListView::SetItemTextSize(float size) +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -388,6 +465,12 @@ IconListView::SetItemTextSize(int size) int IconListView::GetItemTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetItemTextSizeF()); +} + +float +IconListView::GetItemTextSizeF(void) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -395,6 +478,7 @@ IconListView::GetItemTextSize(void) const return pImpl->GetItemTextSize(); } + result IconListView::SetCheckBoxPosition(IconListViewCheckBoxPosition position) { @@ -468,6 +552,20 @@ IconListView::UpdateList(void) result IconListView::GetItemBitmapSize(int& width, int& height) const { + float floatWidth = 0.0f; + float floatHeight = 0.0f; + + result r = GetItemBitmapSize(floatWidth, floatHeight); + + width = _CoordinateSystemUtils::ConvertToInteger(floatWidth); + height = _CoordinateSystemUtils::ConvertToInteger(floatHeight); + + return r; +} + +result +IconListView::GetItemBitmapSize(float& width, float& height) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -478,6 +576,12 @@ IconListView::GetItemBitmapSize(int& width, int& height) const Dimension IconListView::GetItemBitmapSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetItemBitmapSizeF()); +} + +FloatDimension +IconListView::GetItemBitmapSizeF(void) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -488,6 +592,20 @@ IconListView::GetItemBitmapSize(void) const result IconListView::GetItemSize(int& width, int& height) const { + float floatWidth = 0.0f; + float floatHeight = 0.0f; + + result r = GetItemSize(floatWidth, floatHeight); + + width = _CoordinateSystemUtils::ConvertToInteger(floatWidth); + height = _CoordinateSystemUtils::ConvertToInteger(floatHeight); + + return r; +} + +result +IconListView::GetItemSize(float& width, float& height) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -498,6 +616,12 @@ IconListView::GetItemSize(int& width, int& height) const Dimension IconListView::GetItemSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetItemSizeF()); +} + +FloatDimension +IconListView::GetItemSizeF(void) const +{ // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -635,4 +759,39 @@ IconListView::IsInReorderingMode(void) const return pImpl->IsInReorderingMode(); } +void +IconListView::SetScrollInputMode(ScrollInputMode mode) +{ + // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. + SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + _IconListViewImpl* pImpl = _IconListViewImpl::GetInstance(*this); + pImpl->SetScrollInputMode(mode); +} + +ScrollInputMode +IconListView::GetScrollInputMode(void) const +{ + // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. + SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + const _IconListViewImpl* pImpl = _IconListViewImpl::GetInstance(*this); + return pImpl->GetScrollInputMode(); +} +result +IconListView::ScrollByPixel(int pixel) +{ + return ScrollByPixel(_CoordinateSystemUtils::ConvertToFloat(pixel)); +} + +result +IconListView::ScrollByPixel(float pixel) +{ + // Check whether _pControlImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition. + SysAssertf(_pControlImpl != null, "Not yet constructed. Construct() should be called before use."); + + _IconListViewImpl* pImpl = _IconListViewImpl::GetInstance(*this); + return pImpl->ScrollByPixel(pixel); +} + }}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlIconListViewItem.cpp b/src/ui/controls/FUiCtrlIconListViewItem.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrlKeypad.cpp b/src/ui/controls/FUiCtrlKeypad.cpp old mode 100644 new mode 100755 index 3ea448d..7d14923 --- a/src/ui/controls/FUiCtrlKeypad.cpp +++ b/src/ui/controls/FUiCtrlKeypad.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlKeypad.cpp * @brief This file contains implementation of Keypad class @@ -116,6 +117,8 @@ Keypad::AddTextEventListener(ITextEventListener& listener) _KeypadImpl* pKeypadImpl = _KeypadImpl::GetInstance(*this); SysAssertf(pKeypadImpl != null, "Not yet constructed. Construct() should be called before use."); pKeypadImpl->AddTextEventListener(listener); + + return; } void @@ -124,6 +127,8 @@ Keypad::RemoveTextEventListener(ITextEventListener& listener) _KeypadImpl* pKeypadImpl = _KeypadImpl::GetInstance(*this); SysAssertf(pKeypadImpl != null, "Not yet constructed. Construct() should be called before use."); pKeypadImpl->RemoveTextEventListener(listener); + + return; } String @@ -142,4 +147,26 @@ Keypad::SetText(String text) return pKeypadImpl->SetText(text); } +void +Keypad::SetEditTextFilter(IEditTextFilter* pFilter) +{ + _KeypadImpl* pKeypadImpl = _KeypadImpl::GetInstance(*this); + SysAssertf(pKeypadImpl != null, "Not yet constructed. Construct() should be called before use."); + + pKeypadImpl->SetEditTextFilter(pFilter); + + return; +} + +void +Keypad::SendOpaqueCommand (const Tizen::Base::String& command) +{ + _KeypadImpl* pKeypadImpl = _KeypadImpl::GetInstance(*this); + SysAssertf(pKeypadImpl != null, "Not yet constructed. Construct() should be called before use."); + + pKeypadImpl->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlLabel.cpp b/src/ui/controls/FUiCtrlLabel.cpp index 4448c7e..b905e4b 100644 --- a/src/ui/controls/FUiCtrlLabel.cpp +++ b/src/ui/controls/FUiCtrlLabel.cpp @@ -69,6 +69,33 @@ Label::Construct(const Rectangle& rect, const String& text) return E_SUCCESS; } +result +Label::Construct(const FloatRectangle& rect, const String& text) +{ + SysTryReturn(NID_UI_CTRL, (rect.width >= MINIMUM_VALUE && rect.width <= MAXIMUM_VALUE), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] The width error occurred"); + + SysTryReturn(NID_UI_CTRL, (rect.height >= MINIMUM_VALUE && rect.height <= MAXIMUM_VALUE), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] The height error occurred"); + + result r = E_SUCCESS; + _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + + SysAssertf(pLabelImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pLabelImpl = _LabelImpl::CreateLabelImplN(this, rect); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pLabelImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pLabelImpl->SetText(text); + SysAssert(r == E_SUCCESS); // [ToDo] Exception. Which exception can occur? + + _pControlImpl = pLabelImpl; + + return E_SUCCESS; +} + void Label::SetText(const String& text) { @@ -203,6 +230,18 @@ Label::SetTextConfig(int size, LabelTextStyle style) return; } +void +Label::SetTextConfig(float size, LabelTextStyle style) +{ + _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + SysAssertf(pLabelImpl != null, + "Not yet constructed. Construct() should be called before use."); + + pLabelImpl->SetTextConfig(size, style); + + return; +} + int Label::GetTextSize(void) const { @@ -213,6 +252,16 @@ Label::GetTextSize(void) const return pLabelImpl->GetTextSize(); } +float +Label::GetTextSizeF(void) const +{ + const _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + SysAssertf(pLabelImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pLabelImpl->GetTextSizeF(); +} + LabelTextStyle Label::GetTextStyle(void) const { @@ -236,6 +285,19 @@ Label::SetMargin(int topMargin, int leftMargin) return r; } +result +Label::SetMargin(float topMargin, float leftMargin) +{ + _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + SysAssertf(pLabelImpl != null, + "Not yet constructed. Construct() should be called before use."); + + result r = pLabelImpl->SetMargin(topMargin, leftMargin); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + int Label::GetTopMargin(void) const { @@ -246,6 +308,16 @@ Label::GetTopMargin(void) const return pLabelImpl->GetTopMargin(); } +float +Label::GetTopMarginF(void) const +{ + const _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + SysAssertf(pLabelImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pLabelImpl->GetTopMarginF(); +} + int Label::GetLeftMargin(void) const { @@ -256,4 +328,14 @@ Label::GetLeftMargin(void) const return pLabelImpl->GetLeftMargin(); } +float +Label::GetLeftMarginF(void) const +{ + const _LabelImpl* pLabelImpl = _LabelImpl::GetInstance(*this); + SysAssertf(pLabelImpl != null, + "Not yet constructed. Construct() should be called before use."); + + return pLabelImpl->GetLeftMarginF(); +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlListItemBase.cpp b/src/ui/controls/FUiCtrlListItemBase.cpp index 58232eb..d1bb77a 100644 --- a/src/ui/controls/FUiCtrlListItemBase.cpp +++ b/src/ui/controls/FUiCtrlListItemBase.cpp @@ -26,6 +26,7 @@ #include #include "FUiCtrl_ListContextItemImpl.h" #include "FUiCtrl_ListItemBaseImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -47,6 +48,12 @@ ListItemBase::~ListItemBase(void) result ListItemBase::Construct(const Dimension& itemSize, ListAnnexStyle style) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +ListItemBase::Construct(const FloatDimension& itemSize, ListAnnexStyle style) +{ result r = E_SUCCESS; _ListItemBaseImpl* pImpl = _ListItemBaseImpl::GetInstance(*this); @@ -120,6 +127,12 @@ ListItemBase::SetProgressValue(int value) result ListItemBase::SetProgressMargins(int leftMargin, int rightMargin) { + return SetProgressMargins(_CoordinateSystemUtils::ConvertToFloat(leftMargin), _CoordinateSystemUtils::ConvertToFloat(rightMargin)); +} + +result +ListItemBase::SetProgressMargins(float leftMargin, float rightMargin) +{ SysAssertf(_pImpl != null, "Not yet constructed. Construct() should be called before use."); return _pImpl->SetProgressMargins(leftMargin, rightMargin); @@ -128,6 +141,12 @@ ListItemBase::SetProgressMargins(int leftMargin, int rightMargin) int ListItemBase::GetAnnexWidth(ListAnnexStyle style) { + return _CoordinateSystemUtils::ConvertToInteger(GetAnnexWidthF(style)); +} + +float +ListItemBase::GetAnnexWidthF(ListAnnexStyle style) +{ return _ListItemBaseImpl::GetAnnexWidth(style); } diff --git a/src/ui/controls/FUiCtrlListView.cpp b/src/ui/controls/FUiCtrlListView.cpp index 8ca7b8c..e19c98e 100644 --- a/src/ui/controls/FUiCtrlListView.cpp +++ b/src/ui/controls/FUiCtrlListView.cpp @@ -25,6 +25,7 @@ #include #include #include "FUiCtrl_ListViewImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -60,7 +61,7 @@ ListView::Construct(const Rectangle& rect, bool itemDivider, bool fastScroll) SysTryReturn(NID_UI_CTRL, pImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); _pControlImpl = pImpl; - r = Control::SetBounds(rect.x, rect.y, rect.width, rect.height); + r = Control::SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect)); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -84,7 +85,31 @@ ListView::Construct(const Rectangle& rect, bool itemDivider, ListScrollStyle scr SysTryReturn(NID_UI_CTRL, pImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); _pControlImpl = pImpl; - r = Control::SetBounds(rect.x, rect.y, rect.width, rect.height); + r = Control::SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect)); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; + +CATCH: + Control::Dispose(); + + return r; +} + +result +ListView::Construct(const FloatRectangle& rect, bool itemDivider, ListScrollStyle scrollStyle) +{ + result r = E_SUCCESS; + + _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pImpl = _ListViewImpl::CreateListViewImplN(this, itemDivider, scrollStyle); + SysTryReturn(NID_UI_CTRL, pImpl != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + _pControlImpl = pImpl; + r = Control::SetBounds(rect); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -104,6 +129,15 @@ ListView::SetItemProvider(IListViewItemProvider& provider) return pImpl->SetItemProvider(provider); } +result +ListView::SetItemProvider(IListViewItemProviderF& provider) +{ + _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->SetItemProvider(provider); +} + void ListView::AddListViewItemEventListener(IListViewItemEventListener& listener) { @@ -155,6 +189,16 @@ ListView::AddScrollEventListener(IScrollEventListener& listener) } void +ListView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->AddScrollEventListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); +} + +void ListView::RemoveScrollEventListener(IScrollEventListener& listener) { _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); @@ -165,6 +209,16 @@ ListView::RemoveScrollEventListener(IScrollEventListener& listener) } void +ListView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->RemoveScrollEventListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); +} + +void ListView::AddUiLinkEventListener(IUiLinkEventListener& listener) { _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); @@ -332,11 +386,26 @@ ListView::GetItemIndexFromPosition(int x, int y) const } int +ListView::GetItemIndexFromPosition(float x, float y) const +{ + return GetItemIndexFromPosition(FloatPoint(x, y)); +} + +int ListView::GetItemIndexFromPosition(const Point& position) const { const _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position)); +} + +int +ListView::GetItemIndexFromPosition(const FloatPoint& position) const +{ + const _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(position); } @@ -347,11 +416,26 @@ ListView::GetItemIndexFromPosition(int x, int y, int& itemIndex, int& elementId) } result +ListView::GetItemIndexFromPosition(float x, float y, int& itemIndex, int& elementId) const +{ + return GetItemIndexFromPosition(FloatPoint(x, y), itemIndex, elementId); +} + +result ListView::GetItemIndexFromPosition(const Point& position, int& itemIndex, int& elementId) const { const _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), itemIndex, elementId); +} + +result +ListView::GetItemIndexFromPosition(const FloatPoint& position, int& itemIndex, int& elementId) const +{ + const _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetItemIndexFromPosition(position, itemIndex, elementId); } @@ -474,4 +558,22 @@ ListView::IsInReorderingMode(void) const return pImpl->IsInReorderingMode(); } +void +ListView::SetScrollInputMode(ScrollInputMode mode) +{ + _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetScrollInputMode(mode); +} + +ScrollInputMode +ListView::GetScrollInputMode(void) const +{ + const _ListViewImpl* pImpl = _ListViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetScrollInputMode(); +} + }}} // Controls diff --git a/src/ui/controls/FUiCtrlOptionMenu.cpp b/src/ui/controls/FUiCtrlOptionMenu.cpp index 70018dc..18313f4 100644 --- a/src/ui/controls/FUiCtrlOptionMenu.cpp +++ b/src/ui/controls/FUiCtrlOptionMenu.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlOptionMenu.cpp * @brief This is the implementation file for the OptionMenu class. diff --git a/src/ui/controls/FUiCtrlOverlayPanel.cpp b/src/ui/controls/FUiCtrlOverlayPanel.cpp index a83ab7c..bb8d92b 100644 --- a/src/ui/controls/FUiCtrlOverlayPanel.cpp +++ b/src/ui/controls/FUiCtrlOverlayPanel.cpp @@ -20,11 +20,14 @@ * * This cpp file contains the implementation of OverlayPanel class. @n */ -#include #include +#include + +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_OverlayPanelImpl.h" using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -54,6 +57,21 @@ OverlayPanel::Construct(const Rectangle& rect) return r; } +result +OverlayPanel::Construct(const FloatRectangle& rect) +{ + _OverlayPanelImpl* pOverlayPanelImpl = _OverlayPanelImpl::GetInstance(*this); + SysAssertf(pOverlayPanelImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pOverlayPanelImpl = _OverlayPanelImpl::CreateOverlayPanelImplN(this, rect); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pOverlayPanelImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pOverlayPanelImpl; + + return r; +} + void OverlayPanel::SetRendererRotation(OverlayPanel::Rotation rotation) { @@ -63,8 +81,6 @@ OverlayPanel::SetRendererRotation(OverlayPanel::Rotation rotation) pOverlayPanelImpl->SetRendererRotation(rotation); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - SetLastResult(E_SUCCESS); } void @@ -76,8 +92,17 @@ OverlayPanel::SetRendererSize(Dimension& dim) pOverlayPanelImpl->SetRendererSize(dim); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} - SetLastResult(E_SUCCESS); +void +OverlayPanel::SetRendererSize(FloatDimension& dim) +{ + _OverlayPanelImpl* pOverlayPanelImpl = _OverlayPanelImpl::GetInstance(*this); + SysAssertf(pOverlayPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + pOverlayPanelImpl->SetRendererSize(dim); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } void @@ -106,6 +131,18 @@ OverlayPanel::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuff } result +OverlayPanel::SetInputBuffer(const FloatDimension& destDim, const ByteBuffer& srcBuffer, const Dimension& srcDim, BufferPixelFormat srcFormat) +{ + _OverlayPanelImpl* pOverlayPanelImpl = _OverlayPanelImpl::GetInstance(*this); + SysAssertf(pOverlayPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pOverlayPanelImpl->SetInputBuffer(destDim, srcBuffer, srcDim, srcFormat); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result OverlayPanel::GetBackgroundBufferInfo(BufferInfo& info) const { const _OverlayPanelImpl* pOverlayPanelImpl = _OverlayPanelImpl::GetInstance(*this); diff --git a/src/ui/controls/FUiCtrlOverlayRegion.cpp b/src/ui/controls/FUiCtrlOverlayRegion.cpp index 268ea2f..eae43e2 100644 --- a/src/ui/controls/FUiCtrlOverlayRegion.cpp +++ b/src/ui/controls/FUiCtrlOverlayRegion.cpp @@ -30,13 +30,11 @@ #include "FUiCtrl_OverlayRegionImpl.h" #include "FUiCtrl_OverlayAgent.h" -#include "FUi_EcoreEvasMgr.h" -#include "FUi_EcoreEvas.h" - -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; +using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; namespace Tizen { namespace Ui { namespace Controls { @@ -44,7 +42,6 @@ namespace Tizen { namespace Ui { namespace Controls OverlayRegion::OverlayRegion(void) : __pOverlayRegionImpl(null) { - } OverlayRegion::~OverlayRegion(void) @@ -53,14 +50,18 @@ OverlayRegion::~OverlayRegion(void) __pOverlayRegionImpl = null; } -Tizen::Graphics::Rectangle +Rectangle OverlayRegion::GetBounds(void) const { - if (__pOverlayRegionImpl == null) - { - SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); - return Tizen::Graphics::Rectangle(); - } + SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); + + return _CoordinateSystemUtils::ConvertToInteger(__pOverlayRegionImpl->GetBounds()); +} + +FloatRectangle +OverlayRegion::GetBoundsF(void) const +{ + SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); return __pOverlayRegionImpl->GetBounds(); } @@ -69,6 +70,18 @@ void OverlayRegion::GetBounds(int& x, int& y, int& width, int& height) const { SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); + Rectangle rect = _CoordinateSystemUtils::ConvertToInteger(__pOverlayRegionImpl->GetBounds()); + + x = rect.x; + y = rect.y; + width = rect.width; + height = rect.height; +} + +void +OverlayRegion::GetBounds(float& x, float& y, float& width, float& height) const +{ + SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); __pOverlayRegionImpl->GetBounds(x, y, width, height); @@ -76,7 +89,7 @@ OverlayRegion::GetBounds(int& x, int& y, int& width, int& height) const } result -OverlayRegion::SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& sourceDim, Tizen::Ui::Controls::OverlayRegionBufferPixelFormat srcFormat) +OverlayRegion::SetInputBuffer(const ByteBuffer& srcBuffer, const Dimension& sourceDim, OverlayRegionBufferPixelFormat srcFormat) { SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -87,7 +100,7 @@ OverlayRegion::SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Ti } result -OverlayRegion::GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const +OverlayRegion::GetBackgroundBufferInfo(BufferInfo& info) const { SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); @@ -103,162 +116,56 @@ OverlayRegion::Show(void) SysAssertf(__pOverlayRegionImpl != null, "Not yet constructed. Construct() should be called before use."); result r = __pOverlayRegionImpl->Show(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } bool -OverlayRegion::EvaluateBounds(OverlayRegionEvaluationOption option, Tizen::Graphics::Rectangle& rect, bool& modified) +OverlayRegion::EvaluateBounds(OverlayRegionEvaluationOption option, Rectangle& rect, bool& modified) { - modified = false; + result r = E_SUCCESS; - if (rect.width <= 0 || rect.height <= 0) + switch (option) { - SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] input rect size is invalid."); - return false; - } - - Tizen::Graphics::Rectangle physicalRect(_CoordinateSystemUtils::Transform(rect)); - SysLog(NID_UI_CTRL, "org user rect width : %d Height : %d , org physicalRect[%d, %d]!", rect.width, rect.height, physicalRect.width, physicalRect.height); - - int deviceLcdWidth = 0; - int deviceLcdHeight = 0; - - SysTryReturn(NID_UI_CTRL, Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.width", deviceLcdWidth) == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] failed to get the value of ScreenWidth from SystemInfo."); - SysTryReturn(NID_UI_CTRL, Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/screen.height", deviceLcdHeight) == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] failed to get the value of ScreenHeight from SystemInfo."); - - const int widthUnit = GetWidthUnit(); - const int heightUnit = GetHeightUnit(); - - if (widthUnit == -1 || heightUnit == -1) + case OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN: { - SetLastResult(E_SYSTEM); - return false; + r = _OverlayAgent::EvaluateBounds(OVERLAY_AGENT_EVALUATION_OPTION_GREATER_THAN, rect, modified); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); + return true; } - - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - int rotation = ecore_evas_rotation_get(pEcoreEvas->GetEcoreEvas()); - - if (rotation == 90 || rotation == 270) + case OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN: { - int temp = deviceLcdWidth; - deviceLcdWidth = deviceLcdHeight; - deviceLcdHeight = temp; - - SysLog(NID_UI_CTRL, "rotate[%d] : deviceLcdWidth[%d], deviceLcdHeight[%d] is swapped", rotation, deviceLcdWidth, deviceLcdHeight); + r = _OverlayAgent::EvaluateBounds(OVERLAY_AGENT_EVALUATION_OPTION_LESS_THAN, rect, modified); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); + return true; } - - int maxW = deviceLcdWidth - (deviceLcdWidth % widthUnit); - int maxH = deviceLcdHeight - (deviceLcdHeight % heightUnit); - - int logicalMaxW = _CoordinateSystemUtils::InverseHorizontalTransform(maxW); - int logicalMaxH = _CoordinateSystemUtils::InverseVerticalTransform(maxH); - - SysLog(NID_UI_CTRL, "logicalMax[%d, %d], physicalMax[%d, %d]!", logicalMaxW, logicalMaxH, maxW, maxH); - - int dstMinWidth = _OverlayAgent::GetDstRectMinWidth(); - int dstMinHeight = _OverlayAgent::GetDstRectMinHeight(); - - SysLog(NID_UI_CTRL, "dstMinDimention[%d, %d]", dstMinWidth, dstMinHeight); - - int widthReminder = physicalRect.width % widthUnit; - int heightReminder = physicalRect.height % heightUnit; - - switch (option) - { - case OVERLAY_REGION_EVALUATION_OPTION_GREATER_THAN: - { - if (physicalRect.width > maxW || physicalRect.height > maxH) - { - modified = false; - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] the input rect size is already over physical maximun size."); - return false; - } - - if (rect.width > logicalMaxW || rect.height > logicalMaxH) - { - modified = false; - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] the input rect size is already over logical maximun size."); - return false; - } - - if (widthReminder != 0) - { - widthReminder -= widthUnit; - } - - if (heightReminder != 0) - { - heightReminder -= heightUnit; - } - - physicalRect.width -= widthReminder; - physicalRect.height -= heightReminder; - - if (physicalRect.width < dstMinWidth) - { - physicalRect.width = dstMinWidth; - } - - if (physicalRect.height < dstMinHeight) - { - physicalRect.height = dstMinHeight; - } - } - break; - case OVERLAY_REGION_EVALUATION_OPTION_LESS_THAN: - { - if (physicalRect.width < dstMinWidth || physicalRect.height < dstMinHeight) - { - modified = false; - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] the input rect size doesn't meet the minimun size."); - return false; - } - - if (physicalRect.width > maxW) - { - physicalRect.width = maxW + widthReminder; - SysLog(NID_UI_CTRL, "adjusted width [%d] [%d + %d = %d]!", physicalRect.width, maxW, widthReminder, maxW + widthReminder); - } - - if (physicalRect.height > maxH) - { - physicalRect.height = maxH + heightReminder; - SysLog(NID_UI_CTRL, "adjusted height [%d] [%d + %d = %d]!", physicalRect.height, maxH, heightReminder, maxH+ heightReminder); - } - - physicalRect.width -= widthReminder; - physicalRect.height -= heightReminder; - } - break; default: - modified = false; - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] option is invalid."); - return false; + break; } - Rectangle orgRrect(rect); + SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] The option which is input parameter is invalid."); + return false; +} - rect = _CoordinateSystemUtils::InverseTransform(physicalRect); +bool +OverlayRegion::EvaluateBounds(OverlayRegionEvaluationOption option, FloatRectangle& rect, bool& modified) +{ + Rectangle convertedRect = _CoordinateSystemUtils::ConvertToInteger(rect); + bool ret = EvaluateBounds(option, convertedRect, modified); - if (rect != orgRrect) + if(ret && modified) { - SysLog(NID_UI_CTRL, "org logical rect [%d, %d, %d, %d] changed to rect [%d, %d, %d, %d]", - orgRrect.x, orgRrect.y, orgRrect.width, orgRrect.height, rect.x, rect.y, rect.width, rect.height); - modified = true; + rect = _CoordinateSystemUtils::ConvertToFloat(convertedRect); } - SysLog(NID_UI_CTRL, "adjusted PhysicalRect [W %d, H %d]!", physicalRect.width, physicalRect.height); - - SetLastResult(E_SUCCESS); - return true; + return ret; } int OverlayRegion::GetWidthUnit(void) { - int widthUnit = _OverlayRegionImpl::GetWidthUnit(); + int widthUnit = _OverlayAgent::GetWidthUnit(); SysTryReturn(NID_UI_CTRL, widthUnit != -1, -1, E_SYSTEM, "[E_SYSTEM] can't get the width Unit"); return widthUnit; @@ -267,7 +174,7 @@ OverlayRegion::GetWidthUnit(void) int OverlayRegion::GetHeightUnit(void) { - int heightUnit = _OverlayRegionImpl::GetHeightUnit(); + int heightUnit = _OverlayAgent::GetHeightUnit(); SysTryReturn(NID_UI_CTRL, heightUnit != -1, -1, E_SYSTEM, "[E_SYSTEM] can't get the height Unit"); return heightUnit; @@ -276,44 +183,16 @@ OverlayRegion::GetHeightUnit(void) int OverlayRegion::GetMaxCount(void) { - int maxCount = _OverlayRegionImpl::GetMaxCount(); + int maxCount = _OverlayAgent::GetMaxCount(); SysTryReturn(NID_UI_CTRL, maxCount != -1, -1, E_SYSTEM, "[E_SYSTEM] can't get the maximum count value"); return maxCount; } -IListT< Tizen::Ui::Controls::OverlayRegionBufferPixelFormat >* +IListT* OverlayRegion::GetSupportedBufferPixelFormatListN(void) { - if (!_OverlayRegionImpl::overlayRegionPixelFomatList[0]) - { - result r = _OverlayRegionImpl::SetPixelFormatList(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - } - - Tizen::Base::Collection::ArrayListT* pFormatList = null; - - pFormatList = new (std::nothrow) ArrayListT(); - SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); - if (pFormatList->Construct() != E_SUCCESS) - { - SysLogException(NID_UI_CTRL, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - delete pFormatList; - return null; - } - - for (int i = 1; i < OVERLAY_REGION_BUFFER_PIXEL_FORMAT_MAX; i++) - { - if (_OverlayRegionImpl::overlayRegionPixelFomatList[i]) - { - pFormatList->Add(static_cast(i)); - } - } - - SysLog(NID_UI_CTRL, "format list count : %d", pFormatList->GetCount()); - - SetLastResult(E_SUCCESS); - return pFormatList; + return _OverlayRegionImpl::GetSupportedBufferPixelFormatListN(); } } } } // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlPanel.cpp b/src/ui/controls/FUiCtrlPanel.cpp index 7c990b8..6d7baab 100644 --- a/src/ui/controls/FUiCtrlPanel.cpp +++ b/src/ui/controls/FUiCtrlPanel.cpp @@ -25,6 +25,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_PanelImpl.h" #include "FUiCtrl_Panel.h" @@ -52,6 +53,31 @@ Panel::Construct(const Rectangle& rect, GroupStyle groupStyle) _PanelImpl* pImpl = _PanelImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + FloatRectangle floatRect = _CoordinateSystemUtils::ConvertToFloat(rect); + pImpl = _PanelImpl::CreatePanelImplN(this, floatRect, groupStyle); + result r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] A specified input parameter is invalid.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , r, "[%s] The memory is insufficient.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + _pControlImpl = pImpl; + + return r; + +CATCH: + delete pImpl; + + SetLastResult(r); + return r; + +} + +result +Panel::Construct(const FloatRectangle& rect, GroupStyle groupStyle) +{ + _PanelImpl* pImpl = _PanelImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _PanelImpl::CreatePanelImplN(this, rect, groupStyle); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] A specified input parameter is invalid.", GetErrorMessage(r)); @@ -98,6 +124,36 @@ Panel::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, co _PanelImpl* pImpl = _PanelImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + FloatRectangle floatRect = _CoordinateSystemUtils::ConvertToFloat(rect); + pImpl = _PanelImpl::CreatePanelImplN(this, floatRect, groupStyle, &(const_cast (portraitLayout)), &(const_cast (landscapeLayout))); + result r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] A specified input parameter is invalid.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , r, "[%s] The memory is insufficient.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + _pControlImpl = pImpl; + + return r; + +CATCH: + delete pImpl; + + SetLastResult(r); + return r; +} + +result +Panel::Construct(const Layout& layout, const FloatRectangle& rect, GroupStyle groupStyle) +{ + return Construct(layout, layout, rect, groupStyle); +} + +result +Panel::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, const FloatRectangle& rect, GroupStyle groupStyle) +{ + _PanelImpl* pImpl = _PanelImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _PanelImpl::CreatePanelImplN(this, rect, groupStyle, &(const_cast (portraitLayout)), &(const_cast (landscapeLayout))); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] A specified input parameter is invalid.", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrlPopup.cpp b/src/ui/controls/FUiCtrlPopup.cpp index 08d3fcc..a5ba5b1 100644 --- a/src/ui/controls/FUiCtrlPopup.cpp +++ b/src/ui/controls/FUiCtrlPopup.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_PopupImpl.h" @@ -50,6 +51,34 @@ Popup::Construct(bool hasTitle, const Tizen::Graphics::Dimension& dim) _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); SysAssertf(pPopupImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pPopupImpl = _PopupImpl::CreatePopupImplN(this, _CoordinateSystemUtils::ConvertToFloat(dim)); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pPopupImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + // Set _PopupImpl + _pControlImpl = pPopupImpl; + + r = pPopupImpl->Initialize(hasTitle, _CoordinateSystemUtils::ConvertToFloat(dim)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete pPopupImpl; + + _pControlImpl = null; + + return r; +} + +result +Popup::Construct(bool hasTitle, const Tizen::Graphics::FloatDimension& dim) +{ + result r = E_SUCCESS; + + _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); + SysAssertf(pPopupImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pPopupImpl = _PopupImpl::CreatePopupImplN(this, dim); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pPopupImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -93,6 +122,12 @@ Popup::Construct(const Tizen::Ui::Layout& layout, bool hasTitle, const Tizen::Gr } result +Popup::Construct(const Tizen::Ui::Layout& layout, bool hasTitle, const Tizen::Graphics::FloatDimension& dim) +{ + return Construct(layout, layout, hasTitle, dim); +} + +result Popup::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, bool hasTitle, const Tizen::Graphics::Dimension& dim) { @@ -101,6 +136,36 @@ Popup::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layou _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); SysAssertf(pPopupImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pPopupImpl = _PopupImpl::CreatePopupImplN(this, _CoordinateSystemUtils::ConvertToFloat(dim), + &(const_cast (portraitLayout)), + &(const_cast (landscapeLayout))); + + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pPopupImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + // Set _PopupImpl + _pControlImpl = pPopupImpl; + + r = pPopupImpl->Initialize(hasTitle, _CoordinateSystemUtils::ConvertToFloat(dim)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete pPopupImpl; + + return r; +} + +result +Popup::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, + bool hasTitle, const Tizen::Graphics::FloatDimension& dim) +{ + result r = E_SUCCESS; + + _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); + SysAssertf(pPopupImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pPopupImpl = _PopupImpl::CreatePopupImplN(this, dim, &(const_cast (portraitLayout)), &(const_cast (landscapeLayout))); @@ -146,6 +211,15 @@ Popup::GetClientAreaBounds(void) const const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return _CoordinateSystemUtils::ConvertToInteger(pPopupImpl->GetClientAreaBounds()); +} + +Tizen::Graphics::FloatRectangle +Popup::GetClientAreaBoundsF(void) const +{ + const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); + SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return pPopupImpl->GetClientAreaBounds(); } @@ -164,6 +238,15 @@ Popup::TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) con const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return _CoordinateSystemUtils::ConvertToInteger(pPopupImpl->TranslateToClientAreaPosition(_CoordinateSystemUtils::ConvertToFloat(position))); +} + +Tizen::Graphics::FloatPoint +Popup::TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const +{ + const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); + SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return pPopupImpl->TranslateToClientAreaPosition(position); } @@ -173,6 +256,15 @@ Popup::TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosit const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return _CoordinateSystemUtils::ConvertToInteger(pPopupImpl->TranslateFromClientAreaPosition(_CoordinateSystemUtils::ConvertToFloat(clientPosition))); +} + +Tizen::Graphics::FloatPoint +Popup::TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const +{ + const _PopupImpl* pPopupImpl = _PopupImpl::GetInstance(*this); + SysAssertf(pPopupImpl != null, "Not-yet constructed. Construct() should be called before use."); + return pPopupImpl->TranslateFromClientAreaPosition(clientPosition); } diff --git a/src/ui/controls/FUiCtrlProgress.cpp b/src/ui/controls/FUiCtrlProgress.cpp index 97bf337..f09cd7a 100644 --- a/src/ui/controls/FUiCtrlProgress.cpp +++ b/src/ui/controls/FUiCtrlProgress.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlProgress.cpp * @brief This is the implementation file for Progress class. @@ -67,6 +68,37 @@ CATCH: return r; } +result +Progress::Construct(const FloatRectangle& rect, int minValue, int maxValue) +{ + result r = E_SUCCESS; + + _ProgressImpl* pProgressImpl = _ProgressImpl::GetInstance(*this); + SysAssertf((pProgressImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + pProgressImpl = _ProgressImpl::CreateProgressImplFN(this, rect); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pProgressImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pProgressImpl; + + r = pProgressImpl->SetRange(minValue, maxValue); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pProgressImpl->SetValue(minValue); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; + +CATCH: + delete pProgressImpl; + pProgressImpl = null; + + _pControlImpl = null; + + return r; +} + void Progress::SetValue(int value) { @@ -136,4 +168,24 @@ Progress::GetBarColor(void) const return pProgressImpl->GetBarColor(); } +void +Progress::SetBarBackgroundColor(const Color& color) +{ + _ProgressImpl* pProgressImpl = _ProgressImpl::GetInstance(*this); + SysAssertf(pProgressImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pProgressImpl->SetBarBackgroundColor(color); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + return; +} + +Color +Progress::GetBarBackgroundColor(void) const +{ + const _ProgressImpl* pProgressImpl = _ProgressImpl::GetInstance(*this); + SysAssertf(pProgressImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pProgressImpl->GetBarBackgroundColor(); +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlProgressPopup.cpp b/src/ui/controls/FUiCtrlProgressPopup.cpp old mode 100644 new mode 100755 index 29097f2..85d1bff --- a/src/ui/controls/FUiCtrlProgressPopup.cpp +++ b/src/ui/controls/FUiCtrlProgressPopup.cpp @@ -45,7 +45,7 @@ ProgressPopup::~ProgressPopup(void) } result -ProgressPopup::Construct(bool cancelButton, bool translucent) +ProgressPopup::Construct(bool cancelButton, bool transparent) { result r = E_SUCCESS; @@ -59,7 +59,7 @@ ProgressPopup::Construct(bool cancelButton, bool translucent) //Set _ProgressPopupImpl _pControlImpl = pProgressPopupImpl; - r = pProgressPopupImpl->Initialize(cancelButton, translucent); + r = pProgressPopupImpl->Initialize(cancelButton, transparent); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); return r; diff --git a/src/ui/controls/FUiCtrlRadioGroup.cpp b/src/ui/controls/FUiCtrlRadioGroup.cpp index 7ef84fe..7930166 100644 --- a/src/ui/controls/FUiCtrlRadioGroup.cpp +++ b/src/ui/controls/FUiCtrlRadioGroup.cpp @@ -70,6 +70,14 @@ RadioGroup::Add(const CheckButton& checkButton) } result +RadioGroup::Add(CheckButton* pCheckButton) +{ + SysTryReturn(NID_UI_CTRL, pCheckButton, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); + + return Add(*pCheckButton); +} + +result RadioGroup::Remove(const CheckButton& checkButton) { _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this); @@ -81,6 +89,14 @@ RadioGroup::Remove(const CheckButton& checkButton) return E_SUCCESS; } +result +RadioGroup::Remove(CheckButton* pCheckButton) +{ + SysTryReturn(NID_UI_CTRL, pCheckButton, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); + + return Remove(*pCheckButton); +} + int RadioGroup::GetItemCount(void) const { @@ -103,6 +119,14 @@ RadioGroup::SetSelectedItem(const CheckButton& checkButton) return; } +void +RadioGroup::SetSelectedItem(CheckButton* pCheckButton) +{ + SysTryReturnVoidResult(NID_UI_CTRL, pCheckButton, E_INVALID_ARG, "[E_INVALID_ARG] The specified input parameter is invalid."); + + return SetSelectedItem(*pCheckButton); +} + const CheckButton* RadioGroup::GetSelectedItem(void) const { @@ -113,22 +137,4 @@ RadioGroup::GetSelectedItem(void) const return pRadioGroupImpl->GetSelectedItem(); } -result -RadioGroup::Draw(void) -{ - return E_UNSUPPORTED_OPERATION; -} - -result -RadioGroup::Show(void) -{ - return E_UNSUPPORTED_OPERATION; -} - -result -RadioGroup::SetFocus(void) -{ - return E_UNSUPPORTED_OPERATION; -} - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlScrollPanel.cpp b/src/ui/controls/FUiCtrlScrollPanel.cpp old mode 100644 new mode 100755 index b1b7550..feb2cd5 --- a/src/ui/controls/FUiCtrlScrollPanel.cpp +++ b/src/ui/controls/FUiCtrlScrollPanel.cpp @@ -24,6 +24,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_ScrollPanelImpl.h" @@ -53,12 +54,38 @@ ScrollPanel::Construct(const Rectangle& rect) } result +ScrollPanel::Construct(const Tizen::Graphics::FloatRectangle& rect) +{ + result r = Construct(rect, SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, true); + + return r; +} + +result +ScrollPanel::Construct(const Tizen::Base::String& resourceId) +{ + ClearLastResult(); + + // Parse UiBuilder XML file + unique_ptr<_UiBuilder> pBuilder(new _UiBuilder()); + SysTryReturn(NID_UI_CTRL, pBuilder, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); + result r = pBuilder->Construct(resourceId, this); + SysTryReturn(NID_UI_CTRL, r != E_OUT_OF_MEMORY, r, r, "[%s] The memory is insufficient.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = pBuilder->Parse(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result ScrollPanel::Construct(const Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) { _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); - pImpl = _ScrollPanelImpl::CreateScrollPanelImplN(this, rect, scrollDirection, autoResizingEnable); + FloatRectangle floatRect = _CoordinateSystemUtils::ConvertToFloat(rect); + pImpl = _ScrollPanelImpl::CreateScrollPanelImplN(this, floatRect, scrollDirection, autoResizingEnable); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] The given width or height is less than 0.", GetErrorMessage(r)); SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , r, "[%s] The memory is insufficient.", GetErrorMessage(r)); @@ -76,19 +103,25 @@ CATCH: } result -ScrollPanel::Construct(const Tizen::Base::String& resourceId) +ScrollPanel::Construct(const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) { - ClearLastResult(); + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); - // Parse UiBuilder XML file - unique_ptr<_UiBuilder> pBuilder(new _UiBuilder()); - SysTryReturn(NID_UI_CTRL, pBuilder, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); - result r = pBuilder->Construct(resourceId, this); - SysTryReturn(NID_UI_CTRL, r != E_OUT_OF_MEMORY, r, r, "[%s] The memory is insufficient.", GetErrorMessage(r)); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pBuilder->Parse(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + pImpl = _ScrollPanelImpl::CreateScrollPanelImplN(this, rect, scrollDirection, autoResizingEnable); + result r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] The given width or height is less than 0.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , r, "[%s] The memory is insufficient.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + _pControlImpl = pImpl; + + return r; +CATCH: + delete pImpl; + + SetLastResult(r); return r; } @@ -101,6 +134,14 @@ ScrollPanel::Construct(const Layout& layout, const Rectangle& rect) } result +ScrollPanel::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect) +{ + result r = Construct(layout, layout, rect, SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, true); + + return r; +} + +result ScrollPanel::Construct(const Layout& layout, const Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) { result r = Construct(layout, layout, rect, scrollDirection, autoResizingEnable); @@ -109,6 +150,14 @@ ScrollPanel::Construct(const Layout& layout, const Rectangle& rect, ScrollPanelS } result +ScrollPanel::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) +{ + result r = Construct(layout, layout, rect, scrollDirection, autoResizingEnable); + + return r; +} + +result ScrollPanel::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, const Rectangle& rect) { result r = Construct(portraitLayout, landscapeLayout, rect, SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, true); @@ -117,11 +166,44 @@ ScrollPanel::Construct(const Layout& portraitLayout, const Layout& landscapeLayo } result +ScrollPanel::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect) +{ + result r = Construct(portraitLayout, landscapeLayout, rect, SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, true); + + return r; +} + + +result ScrollPanel::Construct(const Layout& portraitLayout, const Layout& landscapeLayout, const Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) { _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + FloatRectangle floatRect = _CoordinateSystemUtils::ConvertToFloat(rect); + pImpl = _ScrollPanelImpl::CreateScrollPanelImplN(this, floatRect, scrollDirection, autoResizingEnable, &(const_cast (portraitLayout)), &(const_cast (landscapeLayout))); + result r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] portraitLayout or landscapeLayout is already bound to another container, or the given width or height is less than 0.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r != E_OUT_OF_MEMORY, , r, "[%s] The memory is insufficient.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + _pControlImpl = pImpl; + + return r; + +CATCH: + delete pImpl; + + SetLastResult(r); + return r; +} + +result +ScrollPanel::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _ScrollPanelImpl::CreateScrollPanelImplN(this, rect, scrollDirection, autoResizingEnable, &(const_cast (portraitLayout)), &(const_cast (landscapeLayout))); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r != E_INVALID_ARG, , r, "[%s] portraitLayout or landscapeLayout is already bound to another container, or the given width or height is less than 0.", GetErrorMessage(r)); @@ -149,6 +231,15 @@ ScrollPanel::AddScrollEventListener(IScrollEventListener& listener) } void +ScrollPanel::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + + pImpl->AddScrollEventListener(listener); +} + +void ScrollPanel::RemoveScrollEventListener(IScrollEventListener& listener) { _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); @@ -157,12 +248,31 @@ ScrollPanel::RemoveScrollEventListener(IScrollEventListener& listener) pImpl->RemoveScrollEventListener(listener); } +void +ScrollPanel::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + + pImpl->RemoveScrollEventListener(listener); +} + int ScrollPanel::GetScrollPosition(void) const { const _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + float position = pImpl->GetScrollPosition(); + return _CoordinateSystemUtils::ConvertToInteger(position); +} + +float +ScrollPanel::GetScrollPositionF(void) const +{ + const _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + return pImpl->GetScrollPosition(); } @@ -172,6 +282,16 @@ ScrollPanel::SetScrollPosition(int position) _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + float floatPosition = _CoordinateSystemUtils::ConvertToFloat(position); + pImpl->SetScrollPosition(floatPosition, false); +} + +void +ScrollPanel::SetScrollPosition(float position) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + pImpl->SetScrollPosition(position, false); } @@ -181,6 +301,16 @@ ScrollPanel::SetScrollPosition(int position, bool withAnimation) _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + float floatPosition = _CoordinateSystemUtils::ConvertToFloat(position); + pImpl->SetScrollPosition(floatPosition, withAnimation); +} + +void +ScrollPanel::SetScrollPosition(float position, bool withAnimation) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + pImpl->SetScrollPosition(position, withAnimation); } @@ -220,6 +350,16 @@ ScrollPanel::GetClientAreaBounds(void) const const _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + FloatRectangle floatRect = pImpl->GetClientAreaBounds(); + return _CoordinateSystemUtils::ConvertToInteger(floatRect); +} + +FloatRectangle +ScrollPanel::GetClientAreaBoundsF(void) const +{ + const _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + return pImpl->GetClientAreaBounds(); } @@ -229,6 +369,21 @@ ScrollPanel::SetClientAreaWidth(int width) _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + float floatWidth = _CoordinateSystemUtils::ConvertToFloat(width); + result r = pImpl->SetClientAreaWidth(floatWidth); + SysTryReturn(NID_UI_CTRL, r != E_INVALID_ARG, r, r, "[%s] width is less than the width of ScrollPanel.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r != E_INVALID_OPERATION, r, r, "[%s] The width of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is vertical.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + return r; +} + +result +ScrollPanel::SetClientAreaWidth(float width) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + result r = pImpl->SetClientAreaWidth(width); SysTryReturn(NID_UI_CTRL, r != E_INVALID_ARG, r, r, "[%s] width is less than the width of ScrollPanel.", GetErrorMessage(r)); SysTryReturn(NID_UI_CTRL, r != E_INVALID_OPERATION, r, r, "[%s] The width of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is vertical.", GetErrorMessage(r)); @@ -243,6 +398,21 @@ ScrollPanel::SetClientAreaHeight(int height) _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + float floatHeight = _CoordinateSystemUtils::ConvertToFloat(height); + result r = pImpl->SetClientAreaHeight(floatHeight); + SysTryReturn(NID_UI_CTRL, r != E_INVALID_ARG, r, r, "[%s] height is less than the height of ScrollPanel.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r != E_INVALID_OPERATION, r, r, "[%s] The height of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is horizontal.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM)); + + return r; +} + +result +ScrollPanel::SetClientAreaHeight(float height) +{ + _ScrollPanelImpl* pImpl = _ScrollPanelImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not-yet constructed! Construct() should be called before use."); + result r = pImpl->SetClientAreaHeight(height); SysTryReturn(NID_UI_CTRL, r != E_INVALID_ARG, r, r, "[%s] height is less than the height of ScrollPanel.", GetErrorMessage(r)); SysTryReturn(NID_UI_CTRL, r != E_INVALID_OPERATION, r, r, "[%s] The height of the client area cannot be set when auto resizing of the client area is off, or the scroll direction is horizontal.", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrlSearchBar.cpp b/src/ui/controls/FUiCtrlSearchBar.cpp old mode 100644 new mode 100755 index 0cae3a2..9a6504b --- a/src/ui/controls/FUiCtrlSearchBar.cpp +++ b/src/ui/controls/FUiCtrlSearchBar.cpp @@ -57,6 +57,23 @@ SearchBar::Construct(const Rectangle& rect, bool searchBarButton, KeypadAction k return r; } +result +SearchBar::Construct(const FloatRectangle& rect, bool searchBarButton, KeypadAction keypadAction) +{ + result r = E_SUCCESS; + + _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pSearchBarImpl = _SearchBarImpl::CreateSearchBarImplFN(this, rect, searchBarButton, keypadAction); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pSearchBarImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pSearchBarImpl; + + return r; +} + Control* SearchBar::GetContent(void) const { @@ -111,6 +128,15 @@ SearchBar::SetContentAreaSize(const Dimension& size) return pSearchBarImpl->SetContentAreaSize(size); } +result +SearchBar::SetContentAreaSize(const FloatDimension& size) +{ + _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use."); + + return pSearchBarImpl->SetContentAreaSize(size); +} + Dimension SearchBar::GetContentAreaSize(void) const { @@ -120,6 +146,15 @@ SearchBar::GetContentAreaSize(void) const return pSearchBarImpl->GetContentAreaSize(); } +FloatDimension +SearchBar::GetContentAreaSizeF(void) const +{ + const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use."); + + return pSearchBarImpl->GetContentAreaSizeF(); +} + SearchBarMode SearchBar::GetMode(void) const { @@ -363,6 +398,15 @@ SearchBar::GetSearchFieldTextSize(void) const return pSearchBarImpl->GetSearchFieldTextSize(); } +float +SearchBar::GetSearchFieldTextSizeF(void) const +{ + const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use."); + + return pSearchBarImpl->GetSearchFieldTextSizeF(); +} + result SearchBar::SetSearchFieldTextSize(int size) { @@ -373,6 +417,15 @@ SearchBar::SetSearchFieldTextSize(int size) } result +SearchBar::SetSearchFieldTextSize(float size) +{ + _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl, "Not yet constructed. Construct() should be called before use."); + + return pSearchBarImpl->SetSearchFieldTextSize(size); +} + +result SearchBar::GetBlockRange(int& start, int& end) const { const _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); @@ -752,4 +805,26 @@ SearchBar::RemoveLanguageEventListener(ILanguageEventListener& listener) return; } +void +SearchBar::SetEditTextFilter(IEditTextFilter* pFilter) +{ + _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use."); + + pSearchBarImpl->SetEditTextFilter(pFilter); + + return; +} + +void +SearchBar::SendOpaqueCommand (const String& command) +{ + _SearchBarImpl* pSearchBarImpl = _SearchBarImpl::GetInstance(*this); + SysAssertf(pSearchBarImpl != null, "Not yet constructed. Construct() should be called before use."); + + pSearchBarImpl->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlSectionTableView.cpp b/src/ui/controls/FUiCtrlSectionTableView.cpp old mode 100644 new mode 100755 index 2dda27b..867247a --- a/src/ui/controls/FUiCtrlSectionTableView.cpp +++ b/src/ui/controls/FUiCtrlSectionTableView.cpp @@ -25,8 +25,10 @@ #include #include #include +#include #include #include "FUiCtrl_TableViewImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -53,6 +55,32 @@ SectionTableView::Construct(const Tizen::Graphics::Rectangle& rect, bool itemDiv _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, _CoordinateSystemUtils::ConvertToFloat(rect), TABLE_VIEW_STYLE_SECTION, itemDivider, scrollStyle); + + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + r = SetBounds(rect); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating", GetErrorMessage(r)); + + return E_SUCCESS; + +CATCH: + Control::Dispose(); + + return r; +} + +result +SectionTableView::Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle) +{ + result r = E_SUCCESS; + + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, rect, TABLE_VIEW_STYLE_SECTION, itemDivider, scrollStyle); r = GetLastResult(); @@ -80,6 +108,14 @@ SectionTableView::SetItemProvider(ISectionTableViewItemProvider* pProvider) pImpl->SetSectionStyleItemProvider(pProvider); } +void +SectionTableView::SetItemProviderF(ISectionTableViewItemProviderF* pProvider) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetSectionStyleItemProviderF(pProvider); +} result SectionTableView::AddSectionTableViewItemEventListener(ISectionTableViewItemEventListener& listener) @@ -136,6 +172,24 @@ SectionTableView::RemoveScrollEventListener(IScrollEventListener& listener) } result +SectionTableView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->AddScrollEventListener(listener); +} + +result +SectionTableView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RemoveScrollEventListener(listener); +} + +result SectionTableView::SetFastScrollIndex(const String& text, bool useSearchIcon) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); @@ -226,6 +280,15 @@ SectionTableView::RefreshItem(int sectionIndex, int itemIndex, TableViewRefreshT return pImpl->RefreshTableView(sectionIndex, itemIndex, type); } +result +SectionTableView::RefreshAllItems(void) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RefreshAllItems(); +} + void SectionTableView::UpdateTableView(void) { @@ -244,6 +307,15 @@ SectionTableView::GetItemIndexFromPosition(const Tizen::Graphics::Point& positio return pImpl->GetItemIndexFromPosition(position, sectionIndex, itemIndex); } +result +SectionTableView::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& sectionIndex, int& itemIndex) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->GetItemIndexFromPosition(position, sectionIndex, itemIndex); +} + void SectionTableView::SetSectionColor(const Color& color) { @@ -331,12 +403,24 @@ SectionTableView::ScrollToItem(int sectionIndex, int itemIndex, TableViewScrollI } result -SectionTableView::ScrollByPixel(int scrollDistance) +SectionTableView::ScrollByPixel(int pixel) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->ScrollByPixel(scrollDistance); + result r = pImpl->ScrollByPixel(_CoordinateSystemUtils::ConvertToFloat(pixel)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +SectionTableView::ScrollByPixel(float pixel) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pImpl->ScrollByPixel(pixel); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -348,6 +432,15 @@ SectionTableView::GetCurrentScrollPosition(void) const const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return _CoordinateSystemUtils::ConvertToInteger(pImpl->GetCurrentScrollPosition()); +} + +float +SectionTableView::GetCurrentScrollPositionF(void) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetCurrentScrollPosition(); } diff --git a/src/ui/controls/FUiCtrlSimpleItem.cpp b/src/ui/controls/FUiCtrlSimpleItem.cpp index b574a37..1964f49 100644 --- a/src/ui/controls/FUiCtrlSimpleItem.cpp +++ b/src/ui/controls/FUiCtrlSimpleItem.cpp @@ -25,6 +25,7 @@ #include #include #include "FUiCtrl_SimpleItemImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -43,6 +44,12 @@ SimpleItem::~SimpleItem(void) result SimpleItem::Construct(const Dimension& itemSize, ListAnnexStyle style) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +SimpleItem::Construct(const FloatDimension& itemSize, ListAnnexStyle style) +{ result r = E_SUCCESS; _SimpleItemImpl* pSimpleImpl = static_cast<_SimpleItemImpl*>(_ListItemBaseImpl::GetInstance(*this)); diff --git a/src/ui/controls/FUiCtrlSlider.cpp b/src/ui/controls/FUiCtrlSlider.cpp index 0a0760c..eddffe5 100644 --- a/src/ui/controls/FUiCtrlSlider.cpp +++ b/src/ui/controls/FUiCtrlSlider.cpp @@ -73,6 +73,39 @@ CATCH: } result +Slider::Construct(const FloatRectangle& rect, BackgroundStyle backgroundStyle, bool showTitle, int minValue, int maxValue, GroupStyle groupStyle) +{ + result r = E_SUCCESS; + + _SliderImpl* pSliderImpl = _SliderImpl::GetInstance(*this); + SysAssertf((pSliderImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + int sliderStyle = 0; + if (showTitle == true) + { + sliderStyle |= SLIDER_STYLE_TITLE; + } + sliderStyle |= SLIDER_STYLE_BUBBLE; + + pSliderImpl = _SliderImpl::CreateSliderImplFN(this, rect, sliderStyle); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pSliderImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pSliderImpl->Initialize(minValue, maxValue, backgroundStyle, sliderStyle, groupStyle); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pSliderImpl; + + return r; + +CATCH: + delete pSliderImpl; + pSliderImpl = null; + + return r; +} + +result Slider::Construct(const Rectangle& rect, unsigned long sliderStyle, int minValue, int maxValue) { result r = E_SUCCESS; @@ -99,6 +132,32 @@ CATCH: } result +Slider::Construct(const FloatRectangle& rect, unsigned long sliderStyle, int minValue, int maxValue) +{ + result r = E_SUCCESS; + + _SliderImpl* pSliderImpl = _SliderImpl::GetInstance(*this); + SysAssertf((pSliderImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class."); + + pSliderImpl = _SliderImpl::CreateSliderImplFN(this, rect, sliderStyle); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pSliderImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pSliderImpl->Initialize(minValue, maxValue, BACKGROUND_STYLE_DEFAULT, sliderStyle, GROUP_STYLE_NONE); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pSliderImpl; + + return r; + +CATCH: + delete pSliderImpl; + pSliderImpl = null; + + return r; +} + +result Slider::SetRange(int minValue, int maxValue) { _SliderImpl* pSliderImpl = _SliderImpl::GetInstance(*this); @@ -282,6 +341,31 @@ Slider::GetBarColor(void) const return color; } +void +Slider::SetBarBackgroundColor(const Color& color) +{ + _SliderImpl* pSliderImpl = _SliderImpl::GetInstance(*this); + SysAssertf(pSliderImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pSliderImpl->SetBarBackgroundColor(color); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + return; +} + +Color +Slider::GetBarBackgroundColor(void) const +{ + const _SliderImpl* pSliderImpl = _SliderImpl::GetInstance(*this); + SysAssertf(pSliderImpl != null, "Not yet constructed. Construct() should be called before use."); + + Color color = pSliderImpl->GetBarBackgroundColor(); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(), r, "[%s] Propagating.", GetErrorMessage(r)); + + return color; +} + result Slider::SetColor(const Color& color) { diff --git a/src/ui/controls/FUiCtrlSplitPanel.cpp b/src/ui/controls/FUiCtrlSplitPanel.cpp index 7f0ccb8..788fc5d 100644 --- a/src/ui/controls/FUiCtrlSplitPanel.cpp +++ b/src/ui/controls/FUiCtrlSplitPanel.cpp @@ -67,6 +67,31 @@ CATCH: } result +SplitPanel::Construct(const Tizen::Graphics::FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection) +{ + result r = E_SUCCESS; + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + + SysAssertf(pSplitPanelImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pSplitPanelImpl = _SplitPanelImpl::CreateSplitPanelImplFN(this, rect, splitPanelDividerStyle, splitPanelDividerDirection); + SysTryReturnResult(NID_UI_CTRL, pSplitPanelImpl, GetLastResult(), "Propagating."); + + _pControlImpl = pSplitPanelImpl; + + r = pSplitPanelImpl->InitializeF(rect); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete pSplitPanelImpl; + _pControlImpl = null; + + return r; +} + +result SplitPanel::SetPane(Control* pControl, SplitPanelPaneOrder paneOrder) { _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); @@ -96,6 +121,15 @@ SplitPanel::SetDividerPosition(int position) return pSplitPanelImpl->SetDividerPosition(position); } +result +SplitPanel::SetDividerPosition(float position) +{ + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->SetDividerPosition(position); +} + int SplitPanel::GetDividerPosition(void) const { @@ -105,6 +139,15 @@ SplitPanel::GetDividerPosition(void) const return pSplitPanelImpl->GetDividerPosition(); } +float +SplitPanel::GetDividerPositionF(void) const +{ + const _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->GetDividerPositionF(); +} + result SplitPanel::SetMaximumDividerPosition(int position) { @@ -114,6 +157,15 @@ SplitPanel::SetMaximumDividerPosition(int position) return pSplitPanelImpl->SetMaximumDividerPosition(position); } +result +SplitPanel::SetMaximumDividerPosition(float position) +{ + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->SetMaximumDividerPosition(position); +} + int SplitPanel::GetMaximumDividerPosition(void) const { @@ -123,6 +175,15 @@ SplitPanel::GetMaximumDividerPosition(void) const return pSplitPanelImpl->GetMaximumDividerPosition(); } +float +SplitPanel::GetMaximumDividerPositionF(void) const +{ + const _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->GetMaximumDividerPositionF(); +} + result SplitPanel::SetMinimumDividerPosition(int position) { @@ -132,6 +193,15 @@ SplitPanel::SetMinimumDividerPosition(int position) return pSplitPanelImpl->SetMinimumDividerPosition(position); } +result +SplitPanel::SetMinimumDividerPosition(float position) +{ + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->SetMinimumDividerPosition(position); +} + int SplitPanel::GetMinimumDividerPosition(void) const { @@ -141,6 +211,15 @@ SplitPanel::GetMinimumDividerPosition(void) const return pSplitPanelImpl->GetMinimumDividerPosition(); } +float +SplitPanel::GetMinimumDividerPositionF(void) const +{ + const _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->GetMinimumDividerPositionF(); +} + result SplitPanel::MaximizePane(SplitPanelPaneOrder paneOrder) { @@ -178,6 +257,15 @@ SplitPanel::AddSplitPanelEventListener(ISplitPanelEventListener& listener) } result +SplitPanel::AddSplitPanelEventListener(ISplitPanelEventListenerF& listener) +{ + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->AddSplitPanelEventListener(listener); +} + +result SplitPanel::RemoveSplitPanelEventListener(ISplitPanelEventListener& listener) { _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); @@ -186,5 +274,14 @@ SplitPanel::RemoveSplitPanelEventListener(ISplitPanelEventListener& listener) return pSplitPanelImpl->RemoveSplitPanelEventListener(listener); } +result +SplitPanel::RemoveSplitPanelEventListener(ISplitPanelEventListenerF& listener) +{ + _SplitPanelImpl* pSplitPanelImpl = _SplitPanelImpl::GetInstance(*this); + SysAssertf(pSplitPanelImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pSplitPanelImpl->RemoveSplitPanelEventListener(listener); +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlTab.cpp b/src/ui/controls/FUiCtrlTab.cpp index 210368b..47bc932 100644 --- a/src/ui/controls/FUiCtrlTab.cpp +++ b/src/ui/controls/FUiCtrlTab.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlTab.cpp * @brief This is the implementation file for Tab class. diff --git a/src/ui/controls/FUiCtrlTabBar.cpp b/src/ui/controls/FUiCtrlTabBar.cpp index 2c2cbb7..7866262 100644 --- a/src/ui/controls/FUiCtrlTabBar.cpp +++ b/src/ui/controls/FUiCtrlTabBar.cpp @@ -22,6 +22,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_TabBarItemImpl.h" #include "FUiCtrl_TabBarImpl.h" @@ -48,7 +49,26 @@ TabBar::Construct(int x, int y, int width) SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); - pImpl = _TabBarImpl::CreateTabBarImplN(this, Rectangle(x, y, width, 0)); + float floatX = _CoordinateSystemUtils::ConvertToFloat(x); + float floatY = _CoordinateSystemUtils::ConvertToFloat(y); + float floatWidth = _CoordinateSystemUtils::ConvertToFloat(width); + pImpl = _TabBarImpl::CreateTabBarImplN(this, FloatRectangle(floatX, floatY, floatWidth, 0.0f)); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + return r; +} + +result +TabBar::Construct(float x, float y, float width) +{ + _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this); + SysAssertf(pImpl == null, + "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pImpl = _TabBarImpl::CreateTabBarImplN(this, FloatRectangle(x, y, width, 0.0f)); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -195,6 +215,15 @@ TabBar::SetWidth(int width) _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->SetWidth(_CoordinateSystemUtils::ConvertToFloat(width)); +} + +result +TabBar::SetWidth(float width) +{ + _TabBarImpl* pImpl = _TabBarImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->SetWidth(width); } diff --git a/src/ui/controls/FUiCtrlTableView.cpp b/src/ui/controls/FUiCtrlTableView.cpp old mode 100644 new mode 100755 index 2122a76..8f43945 --- a/src/ui/controls/FUiCtrlTableView.cpp +++ b/src/ui/controls/FUiCtrlTableView.cpp @@ -25,8 +25,10 @@ #include #include #include +#include #include #include "FUiCtrl_TableViewImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -53,6 +55,32 @@ TableView::Construct(const Tizen::Graphics::Rectangle& rect, bool itemDivider, T _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, _CoordinateSystemUtils::ConvertToFloat(rect), TABLE_VIEW_STYLE_SIMPLE, itemDivider, scrollStyle); + + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pImpl; + + r = SetBounds(rect); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating", GetErrorMessage(r)); + + return E_SUCCESS; + +CATCH: + Control::Dispose(); + + return r; +} + +result +TableView::Construct(const Tizen::Graphics::FloatRectangle& rect, bool itemDivider, TableViewScrollBarStyle scrollStyle) +{ + result r = E_SUCCESS; + + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + pImpl = _TableViewImpl::CreateTableViewImplN(this, rect, TABLE_VIEW_STYLE_SIMPLE, itemDivider, scrollStyle); r = GetLastResult(); @@ -80,6 +108,15 @@ TableView::SetItemProvider(ITableViewItemProvider* pProvider) pImpl->SetSimpleStyleItemProvider(pProvider); } +void +TableView::SetItemProviderF(ITableViewItemProviderF* pProvider) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + pImpl->SetSimpleStyleItemProviderF(pProvider); +} + result TableView::AddTableViewItemEventListener(ITableViewItemEventListener& listener) { @@ -135,6 +172,24 @@ TableView::RemoveScrollEventListener(IScrollEventListener& listener) } result +TableView::AddScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->AddScrollEventListener(listener); +} + +result +TableView::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RemoveScrollEventListener(listener); +} + +result TableView::SetFastScrollIndex(const String& text, bool useSearchIcon) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); @@ -235,6 +290,15 @@ TableView::RefreshItem(int itemIndex, TableViewRefreshType type) return pImpl->RefreshTableView(0, itemIndex, type); } +result +TableView::RefreshAllItems(void) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pImpl->RefreshAllItems(); +} + void TableView::UpdateTableView(void) { @@ -258,6 +322,21 @@ TableView::GetItemIndexFromPosition(const Point& position) const return itemIndex; } +int +TableView::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + int itemIndex = -1; + int groupIndex = -1; + + pImpl->GetItemIndexFromPosition(position, groupIndex, itemIndex); + + return itemIndex; +} + + void TableView::SetItemDividerColor(const Color& color) { @@ -324,12 +403,24 @@ TableView::IsInReorderingMode(void) const } result -TableView::ScrollByPixel(int scrollDistance) +TableView::ScrollByPixel(int pixel) { _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = pImpl->ScrollByPixel(scrollDistance); + result r = pImpl->ScrollByPixel(_CoordinateSystemUtils::ConvertToFloat(pixel)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +TableView::ScrollByPixel(float pixel) +{ + _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + + result r = pImpl->ScrollByPixel(pixel); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -341,9 +432,19 @@ TableView::GetCurrentScrollPosition(void) const const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return _CoordinateSystemUtils::ConvertToInteger(pImpl->GetCurrentScrollPosition()); +} + +float +TableView::GetCurrentScrollPositionF(void) const +{ + const _TableViewImpl* pImpl = _TableViewImpl::GetInstance(*this); + SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use."); + return pImpl->GetCurrentScrollPosition(); } + void TableView::SetScrollEnabled(bool enable) { diff --git a/src/ui/controls/FUiCtrlTableViewContextItem.cpp b/src/ui/controls/FUiCtrlTableViewContextItem.cpp index 8ac3a37..bf08ed8 100644 --- a/src/ui/controls/FUiCtrlTableViewContextItem.cpp +++ b/src/ui/controls/FUiCtrlTableViewContextItem.cpp @@ -24,6 +24,7 @@ #include #include "FUiCtrl_TableViewItemImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { namespace Controls { @@ -39,6 +40,12 @@ TableViewContextItem::~TableViewContextItem(void) result TableViewContextItem::Construct(const Tizen::Graphics::Dimension& itemSize) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize)); +} + +result +TableViewContextItem::Construct(const Tizen::Graphics::FloatDimension& itemSize) +{ result r = E_SUCCESS; _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); @@ -52,4 +59,5 @@ TableViewContextItem::Construct(const Tizen::Graphics::Dimension& itemSize) return r; } + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlTableViewGroupItem.cpp b/src/ui/controls/FUiCtrlTableViewGroupItem.cpp index e27e625..0e4763f 100644 --- a/src/ui/controls/FUiCtrlTableViewGroupItem.cpp +++ b/src/ui/controls/FUiCtrlTableViewGroupItem.cpp @@ -24,6 +24,7 @@ #include #include "FUiCtrl_TableViewItemImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -42,6 +43,24 @@ TableViewGroupItem::~TableViewGroupItem(void) result TableViewGroupItem::Construct(const Dimension& itemSize) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize)); +} + +result +TableViewGroupItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize) +{ + return Construct(layout, layout, _CoordinateSystemUtils::ConvertToFloat(itemSize)); +} + +result +TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize) +{ + return Construct(portraitLayout, landscapeLayout, _CoordinateSystemUtils::ConvertToFloat(itemSize)); +} + +result +TableViewGroupItem::Construct(const FloatDimension& itemSize) +{ result r = E_SUCCESS; _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); @@ -58,13 +77,13 @@ TableViewGroupItem::Construct(const Dimension& itemSize) } result -TableViewGroupItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize) +TableViewGroupItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize) { return Construct(layout, layout, itemSize); } result -TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize) +TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize) { result r = E_SUCCESS; @@ -81,4 +100,5 @@ TableViewGroupItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tiz return r; } + }}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrlTableViewItem.cpp b/src/ui/controls/FUiCtrlTableViewItem.cpp index c094f64..04bcd5a 100644 --- a/src/ui/controls/FUiCtrlTableViewItem.cpp +++ b/src/ui/controls/FUiCtrlTableViewItem.cpp @@ -26,6 +26,7 @@ #include #include "FUiCtrl_TableViewItemImpl.h" #include "FUiCtrl_ListItemBaseImpl.h" +#include "FUi_CoordinateSystemUtils.h" namespace Tizen { namespace Ui { namespace Controls { @@ -44,6 +45,24 @@ TableViewItem::~TableViewItem(void) result TableViewItem::Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style) { + return Construct(_CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +TableViewItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style) +{ + return Construct(layout, layout, _CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +TableViewItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style) +{ + return Construct(portraitLayout, landscapeLayout, _CoordinateSystemUtils::ConvertToFloat(itemSize), style); +} + +result +TableViewItem::Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style) +{ result r = E_SUCCESS; _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); @@ -58,13 +77,13 @@ TableViewItem::Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAn } result -TableViewItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style) +TableViewItem::Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style) { return Construct(layout, layout, itemSize, style); } result -TableViewItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style) +TableViewItem::Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style) { result r = E_SUCCESS; _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); @@ -97,6 +116,12 @@ TableViewItem::SetContextItem(const TableViewContextItem* pItem) int TableViewItem::GetAnnexWidth(TableViewAnnexStyle style) { + return _CoordinateSystemUtils::ConvertToInteger(_TableViewItemImpl::GetAnnexWidth(style)); +} + +float +TableViewItem::GetAnnexWidthF(TableViewAnnexStyle style) +{ return _TableViewItemImpl::GetAnnexWidth(style); } diff --git a/src/ui/controls/FUiCtrlTableViewSimpleGroupItem.cpp b/src/ui/controls/FUiCtrlTableViewSimpleGroupItem.cpp index ccb8e6c..a4f0c48 100644 --- a/src/ui/controls/FUiCtrlTableViewSimpleGroupItem.cpp +++ b/src/ui/controls/FUiCtrlTableViewSimpleGroupItem.cpp @@ -46,6 +46,12 @@ TableViewSimpleGroupItem::Construct(const Dimension& itemSize) } result +TableViewSimpleGroupItem::Construct(const FloatDimension& itemSize) +{ + return TableViewGroupItem::Construct(itemSize); +} + +result TableViewSimpleGroupItem::SetItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap) { _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); diff --git a/src/ui/controls/FUiCtrlTableViewSimpleItem.cpp b/src/ui/controls/FUiCtrlTableViewSimpleItem.cpp index 366a2b6..883d85a 100644 --- a/src/ui/controls/FUiCtrlTableViewSimpleItem.cpp +++ b/src/ui/controls/FUiCtrlTableViewSimpleItem.cpp @@ -50,6 +50,12 @@ TableViewSimpleItem::Construct(const Tizen::Graphics::Dimension& itemSize, Table } result +TableViewSimpleItem::Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style) +{ + return TableViewItem::Construct(itemSize, style); +} + +result TableViewSimpleItem::SetItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap) { _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*this); diff --git a/src/ui/controls/FUiCtrlTextBox.cpp b/src/ui/controls/FUiCtrlTextBox.cpp old mode 100644 new mode 100755 index 4e0cc3a..f3d2067 --- a/src/ui/controls/FUiCtrlTextBox.cpp +++ b/src/ui/controls/FUiCtrlTextBox.cpp @@ -62,6 +62,27 @@ TextBox::Construct(const Rectangle& rect, TextBoxBorder border) } result +TextBox::Construct(const FloatRectangle& rect, TextBoxBorder border) +{ + _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); + SysAssertf(pTextBoxImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); + + pTextBoxImpl = _TextBoxImpl::CreateTextBoxImplN(this); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pTextBoxImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + _pControlImpl = pTextBoxImpl; + + r = SetBounds(rect.x, rect.y, rect.width, rect.height); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pTextBoxImpl->Initialize(border); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result TextBox::SetAutoLinkMask(unsigned long autoLinks) { _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); @@ -198,6 +219,15 @@ TextBox::GetLineSpacing(void) const return pTextBoxImpl->GetLineSpacing(); } +float +TextBox::GetLineSpacingF(void) const +{ + const _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); + SysAssertf(pTextBoxImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pTextBoxImpl->GetLineSpacingF(); +} + result TextBox::SetLineSpacing(int multiplier, int extra) { @@ -207,6 +237,15 @@ TextBox::SetLineSpacing(int multiplier, int extra) return pTextBoxImpl->SetLineSpacing(multiplier, extra); } +result +TextBox::SetLineSpacing(int multiplier, float extra) +{ + _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); + SysAssertf(pTextBoxImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pTextBoxImpl->SetLineSpacing(multiplier, extra); +} + HorizontalAlignment TextBox::GetTextAlignment(void) const { @@ -234,6 +273,15 @@ TextBox::GetTextSize(void) const return pTextBoxImpl->GetTextSize(); } +float +TextBox::GetTextSizeF(void) const +{ + const _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); + SysAssertf(pTextBoxImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pTextBoxImpl->GetTextSizeF(); +} + result TextBox::SetTextSize(int size) { @@ -244,6 +292,15 @@ TextBox::SetTextSize(int size) } result +TextBox::SetTextSize(float size) +{ + _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); + SysAssertf(pTextBoxImpl != null, "Not yet constructed. Construct() should be called before use."); + + return pTextBoxImpl->SetTextSize(size); +} + +result TextBox::GetFontType(String& typefaceName, unsigned long& styleMask) const { const _TextBoxImpl* pTextBoxImpl = _TextBoxImpl::GetInstance(*this); diff --git a/src/ui/controls/FUiCtrlTimePicker.cpp b/src/ui/controls/FUiCtrlTimePicker.cpp index cedd61e..cb2248e 100644 --- a/src/ui/controls/FUiCtrlTimePicker.cpp +++ b/src/ui/controls/FUiCtrlTimePicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrlTimePicker.cpp * @brief This is the implementation file for the TimePicker class. diff --git a/src/ui/controls/FUiCtrl_AdjustmentEvent.cpp b/src/ui/controls/FUiCtrl_AdjustmentEvent.cpp index f759859..01a40ac 100644 --- a/src/ui/controls/FUiCtrl_AdjustmentEvent.cpp +++ b/src/ui/controls/FUiCtrl_AdjustmentEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AdjustmentEvent.cpp * @brief This is the implementation for the _AdjustmentEvent class. diff --git a/src/ui/controls/FUiCtrl_Animation.cpp b/src/ui/controls/FUiCtrl_Animation.cpp index 532f863..dc4eb55 100644 --- a/src/ui/controls/FUiCtrl_Animation.cpp +++ b/src/ui/controls/FUiCtrl_Animation.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Animation.cpp * @brief This is the implementation file for the _Animation class. @@ -146,8 +147,8 @@ _Animation::OnAttachedToMainTree(void) if (__pAccessibilityElement) { __pAccessibilityElement->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); - __pAccessibilityElement->SetLabel(L"Animation"); - __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); + __pAccessibilityElement->SetName(L"Animation"); + __pAccessibilityElement->SetTrait(L"Animation"); pContainer->AddElement(*__pAccessibilityElement); } } diff --git a/src/ui/controls/FUiCtrl_AnimationEvent.cpp b/src/ui/controls/FUiCtrl_AnimationEvent.cpp index 2bb86ab..945dcbb 100644 --- a/src/ui/controls/FUiCtrl_AnimationEvent.cpp +++ b/src/ui/controls/FUiCtrl_AnimationEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationEvent.cpp * @brief This is the implementation for the AnimationEvent class. diff --git a/src/ui/controls/FUiCtrl_AnimationImpl.cpp b/src/ui/controls/FUiCtrl_AnimationImpl.cpp index d45c86d..42c3381 100644 --- a/src/ui/controls/FUiCtrl_AnimationImpl.cpp +++ b/src/ui/controls/FUiCtrl_AnimationImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationImpl.cpp * @brief This is the implementation file for the _AnimationImpl class. diff --git a/src/ui/controls/FUiCtrl_AnimationModel.cpp b/src/ui/controls/FUiCtrl_AnimationModel.cpp index 6b375d2..e39a36b 100644 --- a/src/ui/controls/FUiCtrl_AnimationModel.cpp +++ b/src/ui/controls/FUiCtrl_AnimationModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationModel.cpp * @brief This is the implementation file for the _AnimationModel class. diff --git a/src/ui/controls/FUiCtrl_AnimationPresenter.cpp b/src/ui/controls/FUiCtrl_AnimationPresenter.cpp index a6082ed..66028b4 100644 --- a/src/ui/controls/FUiCtrl_AnimationPresenter.cpp +++ b/src/ui/controls/FUiCtrl_AnimationPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationPresenter.cpp * @brief This is the implementation file for the _AnimationPresenter class. @@ -346,7 +347,7 @@ _AnimationPresenter::Draw(void) { result r = E_SUCCESS; - Rectangle bounds = __pAnimation->GetBounds(); + FloatRectangle bounds = __pAnimation->GetBoundsF(); Color bgColor = __pAnimation->GetBackgroundColor(); Canvas* pCanvas = null; AnimationFrame* pFrame = null; @@ -368,11 +369,11 @@ _AnimationPresenter::Draw(void) if (pBitmap->IsNinePatchedBitmap()) { - r = pCanvas->DrawNinePatchedBitmap(bounds, *pBitmap); + r = pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBitmap); } else { - r = pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBitmap); + r = pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBitmap); } SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw the bitmap", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrl_Button.cpp b/src/ui/controls/FUiCtrl_Button.cpp index f62a29c..1ba2bf7 100644 --- a/src/ui/controls/FUiCtrl_Button.cpp +++ b/src/ui/controls/FUiCtrl_Button.cpp @@ -25,6 +25,7 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiCtrl_Button.h" @@ -49,16 +50,22 @@ _Button::_Button() , __horizontalAlignment(ALIGNMENT_CENTER) , __verticalAlignment(ALIGNMENT_MIDDLE) , __buttonStatus(_BUTTON_STATUS_NORMAL) + , __prevButtonStatus(_BUTTON_STATUS_NORMAL) , __buttonStyle(_BUTTON_STYLE_NORMAL) - , __textSize(0) + , __textSize(0.0f) , __textMaxLine(2) - , __parentMoveDistance(0) , __previousTouchArea(false) , __userDefinedText(false) - , __topMargin(0) - , __leftMargin(0) + , __leftMargin(0.0f) + , __topMargin(0.0f) + , __rightMargin(0.0f) + , __bottomMargin(0.0f) + , __leftTouchMargin(0.0f) + , __topTouchMargin(0.0f) + , __rightTouchMargin(0.0f) + , __bottomTouchMargin(0.0f) , __drawInner(false) - , __userDefinedTextArea(0,0,0,0) + , __userDefinedTextArea(0.0f, 0.0f, 0.0f, 0.0f) , __pTextElement(null) { result r = E_SUCCESS; @@ -82,6 +89,7 @@ _Button::_Button() for (int i = 0; i < NUMBER_OF_BUTTON_STATUS; i++) { __pBitmap[i] = null; + __pEffectBitmap[i] = null; __pToolbarItemBackgroundBitmap[i] = null; __pBackgroundBitmap[i] = null; __pBackgroundEffectBitmap[i] = null; @@ -103,8 +111,10 @@ _Button::_Button() GET_COLOR_CONFIG(BUTTON::TEXT_HIGHLIGHTED, __textColor[_BUTTON_STATUS_HIGHLIGHTED]); GET_COLOR_CONFIG(BUTTON::TEXT_PRESSED, __textColor[_BUTTON_STATUS_SELECTED]); - GET_SHAPE_CONFIG(BUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __topMargin); GET_SHAPE_CONFIG(BUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __leftMargin); + GET_SHAPE_CONFIG(BUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __topMargin); + GET_SHAPE_CONFIG(BUTTON::RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __rightMargin); + GET_SHAPE_CONFIG(BUTTON::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __bottomMargin); AddPropertyChangeEventListener(*this); @@ -113,8 +123,9 @@ _Button::_Button() if(pContainer) { pContainer->Activate(true); + InitializeAccessibilityElement(); } - + ClearLastResult(); return; @@ -161,6 +172,12 @@ _Button::~_Button(void) __pBitmap[i] = null; } + if (__pEffectBitmap[i]) + { + delete __pEffectBitmap[i]; + __pEffectBitmap[i] = null; + } + if (__pToolbarItemBackgroundBitmap[i]) { delete __pToolbarItemBackgroundBitmap[i]; @@ -214,8 +231,10 @@ _Button::OnDraw(void) result _Button::OnAttachedToMainTree(void) { - InitializeAccessibilityElement(); - + if(__pTextElement) + { + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + } return E_SUCCESS; } @@ -234,9 +253,9 @@ _Button::InitializeAccessibilityElement(void) __pTextElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, __pTextElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - __pTextElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); __pTextElement->SetLabel(GetText()); - __pTextElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); + __pTextElement->SetTrait(L"Button"); __pTextElement->SetName(L"ButtonText"); pContainer->AddElement(*__pTextElement); @@ -294,7 +313,7 @@ _Button::OnBoundsChanged(void) { if(__pTextElement) { - __pTextElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); } return; @@ -316,10 +335,18 @@ _Button::OnFontInfoRequested(unsigned long& style, int& size) return; } +void +_Button::OnFontInfoRequested(unsigned long& style, float& size) +{ + __pButtonPresenter->OnFontInfoRequested(style, size); + + return; +} + result _Button::SetText(const String& text) { - return SetProperty("text", Variant(text)); + return SetProperty(L"text", Variant(text)); } result @@ -341,7 +368,7 @@ _Button::SetPropertyText(const Variant& text) String _Button::GetText(void) const { - Variant text = GetProperty("text"); + Variant text = GetProperty(L"text"); return text.ToString(); } @@ -360,19 +387,19 @@ _Button::SetColor(_ButtonStatus status, const Color& color) switch (status) { case _BUTTON_STATUS_NORMAL: - r = SetProperty("normalColor", Variant(color)); + r = SetProperty(L"normalColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: - r = SetProperty("disabledColor", Variant(color)); + r = SetProperty(L"disabledColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: - r = SetProperty("pressedColor", Variant(color)); + r = SetProperty(L"pressedColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: - r = SetProperty("highlightedColor", Variant(color)); + r = SetProperty(L"highlightedColor", Variant(color)); break; default: - r = SetProperty("selectedColor", Variant(color)); + r = SetProperty(L"selectedColor", Variant(color)); } return r; @@ -426,19 +453,19 @@ _Button::GetColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalColor"); + color = GetProperty(L"normalColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledColor"); + color = GetProperty(L"disabledColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedColor"); - break;; + color = GetProperty(L"pressedColor"); + break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedColor"); + color = GetProperty(L"highlightedColor"); break; default: - color = GetProperty("selectedColor"); + color = GetProperty(L"selectedColor"); } return color.ToColor(); @@ -507,7 +534,7 @@ _Button::RemoveActionEventListener(const _IActionEventListener& listener) result _Button::SetActionId(int actionId) { - return SetProperty("actionId", Variant(actionId)); + return SetProperty(L"actionId", Variant(actionId)); } result @@ -521,7 +548,7 @@ _Button::SetPropertyActionId(const Variant& actionId) int _Button::GetActionId(void) const { - Variant actionId = GetProperty("actionId"); + Variant actionId = GetProperty(L"actionId"); return actionId.ToInt(); } @@ -568,19 +595,19 @@ _Button::SetTextColor(_ButtonStatus status, const Color& color) switch (status) { case _BUTTON_STATUS_NORMAL: - r = SetProperty("normalTextColor", Variant(color)); + r = SetProperty(L"normalTextColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: - r = SetProperty("disabledTextColor", Variant(color)); + r = SetProperty(L"disabledTextColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: - r = SetProperty("pressedTextColor", Variant(color)); + r = SetProperty(L"pressedTextColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: - r = SetProperty("highlightedTextColor", Variant(color)); + r = SetProperty(L"highlightedTextColor", Variant(color)); break; default: - r = SetProperty("selectedTextColor", Variant(color)); + r = SetProperty(L"selectedTextColor", Variant(color)); } return r; @@ -634,19 +661,19 @@ _Button::GetTextColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalTextColor"); + color = GetProperty(L"normalTextColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledTextColor"); + color = GetProperty(L"disabledTextColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedTextColor"); + color = GetProperty(L"pressedTextColor"); break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedTextColor"); + color = GetProperty(L"highlightedTextColor"); break; default: - color = GetProperty("selectedTextColor"); + color = GetProperty(L"selectedTextColor"); } return color.ToColor(); @@ -685,6 +712,14 @@ _Button::GetPropertySelectedTextColor(void) const result _Button::SetBitmap(_ButtonStatus status, const Point& position, const Bitmap& bitmap) { + FloatPoint floatPosition = _CoordinateSystemUtils::ConvertToFloat(position); + + return SetBitmap(status, floatPosition, bitmap); +} + +result +_Button::SetBitmap(_ButtonStatus status, const FloatPoint& position, const Bitmap& bitmap) +{ result r = E_SYSTEM; Bitmap* pClonedBitmap = _BitmapImpl::CloneN(bitmap); @@ -712,6 +747,68 @@ _Button::GetBitmap(_ButtonStatus status) const return __pBitmap[status]; } +Point +_Button::GetBitmapPosition(_ButtonStatus status) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetBitmapPositionF(status)); +} + +FloatPoint +_Button::GetBitmapPositionF(_ButtonStatus status) const +{ + return FloatPoint(__bitmapPosition[status].x + __leftTouchMargin, __bitmapPosition[status].y + __topTouchMargin); +} + +result +_Button::SetEffectBitmap(_ButtonStatus status, const Point& position, const Bitmap& bitmap) +{ + FloatPoint floatPosition = _CoordinateSystemUtils::ConvertToFloat(position); + + return SetEffectBitmap(status, floatPosition, bitmap); +} + +result +_Button::SetEffectBitmap(_ButtonStatus status, const FloatPoint& position, const Bitmap& bitmap) +{ + result r = E_SYSTEM; + + Bitmap* pClonedBitmap = _BitmapImpl::CloneN(bitmap); + + if (pClonedBitmap) + { + __effectBitmapPosition[status] = position; + + if (__pEffectBitmap[status] != null) + { + delete __pEffectBitmap[status]; + } + + __pEffectBitmap[status] = pClonedBitmap; + + r = E_SUCCESS; + } + + return r; +} + +Bitmap* +_Button::GetEffectBitmap(_ButtonStatus status) const +{ + return __pEffectBitmap[status]; +} + +Point +_Button::GetEffectBitmapPosition(_ButtonStatus status) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetEffectBitmapPositionF(status)); +} + +FloatPoint +_Button::GetEffectBitmapPositionF(_ButtonStatus status) const +{ + return FloatPoint(__effectBitmapPosition[status].x + __leftTouchMargin, __effectBitmapPosition[status].y + __topTouchMargin); +} + result _Button::SetToolbarItemBackgroundBitmap(_ButtonStatus status, const Bitmap& bitmap) { @@ -776,12 +873,6 @@ _Button::GetToolbarSelectedBitmap(void) const return __pToolbarSelectedBitmap; } -Point -_Button::GetBitmapPosition(_ButtonStatus status) const -{ - return __bitmapPosition[status]; -} - result _Button::SetBackgroundBitmap(_ButtonStatus status, const Bitmap& bitmap) { @@ -865,6 +956,7 @@ Bitmap* _Button::GetBackgroundEffectBitmap(_ButtonStatus status) const { result r = E_SYSTEM; + bool themeBackgroundBitmap = false; _Button* pButton = const_cast<_Button*>(this); @@ -873,19 +965,39 @@ _Button::GetBackgroundEffectBitmap(_ButtonStatus status) const switch(status) { case _BUTTON_STATUS_NORMAL: - r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_NORMAL]); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(BUTTON::BG_NORMAL); + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_NORMAL]); + } break; case _BUTTON_STATUS_DISABLED: - r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_DISABLED]); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(BUTTON::BG_DISABLED); + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_DISABLED]); + } break; case _BUTTON_STATUS_PRESSED: - r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_PRESSED]); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(BUTTON::BG_PRESSED); + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_PRESSED]); + } break; case _BUTTON_STATUS_HIGHLIGHTED: - r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_HIGHLIGHTED]); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(BUTTON::BG_HIGHLIGHTED); + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_HIGHLIGHTED]); + } break; default: - r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_SELECTED]); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(BUTTON::BG_PRESSED); + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(BUTTON::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButton->__pBackgroundEffectBitmap[_BUTTON_STATUS_SELECTED]); + } break; } SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -897,9 +1009,19 @@ _Button::GetBackgroundEffectBitmap(_ButtonStatus status) const result _Button::SetTextSize(int size, unsigned long fontStyle) { + float floatSize = _CoordinateSystemUtils::ConvertToFloat(size); + + __pButtonPresenter->SetTextSize(floatSize, fontStyle); + + return SetProperty(L"textSize", Variant(floatSize)); +} + +result +_Button::SetTextSize(float size, unsigned long fontStyle) +{ __pButtonPresenter->SetTextSize(size, fontStyle); - return SetProperty("textSize", Variant(size)); + return SetProperty(L"textSize", Variant(size)); } result @@ -907,9 +1029,9 @@ _Button::SetPropertyTextSize(const Variant& textSize) { result r = E_SUCCESS; - if (textSize.ToInt() > 0) + if (textSize.ToFloat() > 0.0f) { - __textSize = textSize.ToInt(); + __textSize = textSize.ToFloat(); } else { @@ -923,9 +1045,15 @@ _Button::SetPropertyTextSize(const Variant& textSize) int _Button::GetTextSize(void) const { - Variant size = GetProperty("textSize"); + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_Button::GetTextSizeF(void) const +{ + Variant size = GetProperty(L"textSize"); - return size.ToInt(); + return size.ToFloat(); } Variant @@ -955,6 +1083,7 @@ _Button::SetButtonStatus(_ButtonStatus buttonStatus, bool fire) if (__buttonStatus != buttonStatus) { + __prevButtonStatus = __buttonStatus; __buttonStatus = buttonStatus; } @@ -972,17 +1101,6 @@ _Button::SetButtonStatus(_ButtonStatus buttonStatus, bool fire) r = FireActionEvent(); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); } - if(__pTextElement) - { - if(buttonStatus == _BUTTON_STATUS_SELECTED ) - { - __pTextElement->SetStatus(L"Selected"); - } - else - { - __pTextElement->SetStatus(L""); - } - } return r; } @@ -999,6 +1117,19 @@ _Button::GetButtonStatus(void) const return status; } +_ButtonStatus +_Button::GetPrevButtonStatus(void) const +{ + _ButtonStatus status = __prevButtonStatus; + + if (!IsEnabled()) + { + status = _BUTTON_STATUS_DISABLED; + } + + return status; +} + result _Button::SetTextMaxLine(int textMaxLine) { @@ -1053,6 +1184,7 @@ _Button::IsTouchAreaChanged(bool currentButtonArea) if (__previousTouchArea != currentButtonArea) { __previousTouchArea = currentButtonArea; + return true; } else @@ -1080,7 +1212,16 @@ _Button::FireActionEvent(void) result _Button::SetUserDefinedTextArea(const Rectangle& bounds) { + FloatRectangle floatBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); + + return SetUserDefinedTextArea(floatBounds); +} + +result +_Button::SetUserDefinedTextArea(const FloatRectangle& bounds) +{ __userDefinedText = true; + __userDefinedTextArea = bounds; return E_SUCCESS; @@ -1089,6 +1230,12 @@ _Button::SetUserDefinedTextArea(const Rectangle& bounds) Rectangle _Button::GetUserDefinedTextArea(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetUserDefinedTextAreaF()); +} + +FloatRectangle +_Button::GetUserDefinedTextAreaF(void) const +{ return __userDefinedTextArea; } @@ -1099,105 +1246,168 @@ _Button::UserDefinedText(void) const } result -_Button::SetMargin(int topMargin, int leftMargin) +_Button::SetMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin) +{ + float floatLeftMargin = _CoordinateSystemUtils::ConvertToFloat(leftMargin); + float floatTopMargin = _CoordinateSystemUtils::ConvertToFloat(topMargin); + float floatRightMargin = _CoordinateSystemUtils::ConvertToFloat(rightMargin); + float floatBottomMargin = _CoordinateSystemUtils::ConvertToFloat(bottomMargin); + + return SetMargin(floatLeftMargin, floatTopMargin, floatRightMargin, floatBottomMargin); +} + +result +_Button::SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin) { - __topMargin = topMargin; __leftMargin = leftMargin; + __topMargin = topMargin; + __rightMargin = rightMargin; + __bottomMargin = bottomMargin; return E_SUCCESS; } int +_Button::GetLeftMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetLeftMarginF()); +} + +float +_Button::GetLeftMarginF(void) const +{ + return __leftMargin; +} + +int _Button::GetTopMargin(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTopMarginF()); +} + +float +_Button::GetTopMarginF(void) const +{ return __topMargin; } +int +_Button::GetRightMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetRightMarginF()); +} + +float +_Button::GetRightMarginF(void) const +{ + return __rightMargin; +} int -_Button::GetLeftMargin(void) const +_Button::GetBottomMargin(void) const { - return __leftMargin; + return _CoordinateSystemUtils::ConvertToInteger(GetBottomMarginF()); +} + +float +_Button::GetBottomMarginF(void) const +{ + return __bottomMargin; } Tizen::Graphics::Dimension _Button::GetContentSize(void) const { - return GetContentSizeInternal(); + return _CoordinateSystemUtils::ConvertToInteger(GetContentSizeInternalF()); } -Tizen::Graphics::Dimension -_Button::GetContentSizeInternal(void) const +Tizen::Graphics::FloatDimension +_Button::GetContentSizeF(void) const +{ + return GetContentSizeInternalF(); +} + +Tizen::Graphics::FloatDimension +_Button::GetContentSizeInternalF(void) const { for (int i = 0; i < NUMBER_OF_BUTTON_STATUS; i++) { if (__text.IsEmpty() && __pBitmap[i] == null && __isUserBackgroundBitmap[i] == false) { - return Dimension(GetBounds().width, GetBounds().height); + return FloatDimension(GetBoundsF().width, GetBoundsF().height); } } - Dimension dimension(0,0); - Rectangle contentRect(0,0,0,0); + FloatDimension dimension(0.0f, 0.0f); + FloatRectangle contentRect(0.0f, 0.0f, 0.0f, 0.0f); TextObject* pTextObject = __pButtonPresenter->GetTextObject(); TextObjectActionType previousActionType = pTextObject->GetAction(); TextObjectWrapType previousWrapType = pTextObject->GetWrap(); - Rectangle previousRect = pTextObject->GetBounds(); + FloatRectangle previousRect = pTextObject->GetBoundsF(); pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); pTextObject->Compose(); - dimension = pTextObject->GetTextExtent(0, pTextObject->GetTextLength()); + dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength()); - contentRect.width = _ControlManager::GetInstance()->GetScreenSize().width; + contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width; - if (dimension.width > contentRect.width - GetBounds().x) + if (dimension.width > contentRect.width - GetBoundsF().x) { - dimension.width = contentRect.width - GetBounds().x; + dimension.width = contentRect.width - GetBoundsF().x; - pTextObject->SetBounds(Rectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height)); + pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height)); pTextObject->Compose(); } - dimension.height = pTextObject->GetTotalHeight(); + dimension.height = pTextObject->GetTotalHeightF(); pTextObject->SetBounds(previousRect); pTextObject->SetAction(previousActionType); pTextObject->SetWrap(previousWrapType); pTextObject->Compose(); - dimension.width += __leftMargin * 4; - dimension.height += __topMargin * 4; + dimension.width += __leftMargin * 4 - __leftTouchMargin - __rightTouchMargin; + dimension.height += __topMargin * 4 - __topTouchMargin - __bottomTouchMargin; for (int i = 0; i < NUMBER_OF_BUTTON_STATUS; i++) { if (__pBitmap[i] != null || __isUserBackgroundBitmap[i] == true) { - dimension.width = GetBounds().width; - dimension.height = GetBounds().height; + dimension.width = GetBoundsF().width; + dimension.height = GetBoundsF().height; } } return dimension; } + int _Button::GetTextExtentSize(void) const { - int textExtentSize = 0; + return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentSizeF()); +} + +float +_Button::GetTextExtentSizeF(void) const +{ + float textExtentSize = 0.0f; TextObject* pTextObject = __pButtonPresenter->GetTextObject(); + Font* pFont = __pButtonPresenter->GetFont(); TextObjectActionType previousActionType = pTextObject->GetAction(); TextObjectWrapType previousWrapType = pTextObject->GetWrap(); - Rectangle previousRect = pTextObject->GetBounds(); + FloatRectangle previousRect = pTextObject->GetBoundsF(); pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); + pTextObject->SetFont(pFont, 0, pTextObject->GetTextLength()); pTextObject->Compose(); - textExtentSize = pTextObject->GetTextExtent(0, pTextObject->GetTextLength()).width; + textExtentSize = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength()).width; pTextObject->SetBounds(previousRect); pTextObject->SetAction(previousActionType); @@ -1207,4 +1417,74 @@ _Button::GetTextExtentSize(void) const return textExtentSize; } +result +_Button::SetTouchMargin(int leftTouchMargin, int topTouchMargin, int rightTouchMargin, int bottomTouchMargin) +{ + float floatLeftTouchMargin = _CoordinateSystemUtils::ConvertToFloat(leftTouchMargin); + float floatTopTouchMargin = _CoordinateSystemUtils::ConvertToFloat(topTouchMargin); + float floatRightTouchMargin = _CoordinateSystemUtils::ConvertToFloat(rightTouchMargin); + float floatBottomTouchMargin = _CoordinateSystemUtils::ConvertToFloat(bottomTouchMargin); + + return SetTouchMargin(floatLeftTouchMargin, floatTopTouchMargin, floatRightTouchMargin, floatBottomTouchMargin); +} + +result +_Button::SetTouchMargin(float leftTouchMargin, float topTouchMargin, float rightTouchMargin, float bottomTouchMargin) +{ + __leftTouchMargin = leftTouchMargin; + __topTouchMargin = topTouchMargin; + __rightTouchMargin = rightTouchMargin; + __bottomTouchMargin = bottomTouchMargin; + + return E_SUCCESS; +} + +int +_Button::GetLeftTouchMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetLeftTouchMarginF()); +} + +float +_Button::GetLeftTouchMarginF(void) const +{ + return __leftTouchMargin; +} + +int +_Button::GetTopTouchMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetTopTouchMarginF()); +} + +float +_Button::GetTopTouchMarginF(void) const +{ + return __topTouchMargin; +} + +int +_Button::GetRightTouchMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetRightTouchMarginF()); +} + +float +_Button::GetRightTouchMarginF(void) const +{ + return __rightTouchMargin; +} + +int +_Button::GetBottomTouchMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetBottomTouchMarginF()); +} + +float +_Button::GetBottomTouchMarginF(void) const +{ + return __bottomTouchMargin; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ButtonImpl.cpp b/src/ui/controls/FUiCtrl_ButtonImpl.cpp index bbbea5d..b62976f 100644 --- a/src/ui/controls/FUiCtrl_ButtonImpl.cpp +++ b/src/ui/controls/FUiCtrl_ButtonImpl.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" @@ -50,6 +52,20 @@ _ButtonImpl::ButtonSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientati return dimension; } +FloatDimension +_ButtonImpl::ButtonSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension dimension(0.0f, 0.0f); + + r = GET_DIMENSION_CONFIG(BUTTON::MIN_SIZE, orientation, dimension); + SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); + + SetLastResult(r); + + return dimension; +} + _ButtonImpl* _ButtonImpl::GetInstance(Button& button) { @@ -111,6 +127,35 @@ CATCH: return null; } +_ButtonImpl* +_ButtonImpl::CreateButtonImplN(Button* pControl, const FloatRectangle& bounds) +{ + result r = E_SUCCESS; + r = GET_SIZE_INFO(Button).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The given size is not valid."); + + _Button* pCore = _Button::CreateButtonN(); + SysTryReturn(NID_UI_CTRL, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _ButtonImpl* pImpl = new (std::nothrow) _ButtonImpl(pControl, pCore); + r = _ControlImpl::CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Button), bounds, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pCore->AddActionEventListener(*pImpl); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + ClearLastResult(); + + return pImpl; + +CATCH: + delete pImpl; + return null; +} + const Color _ButtonImpl::GetColorOnError(void) { @@ -350,6 +395,13 @@ _ButtonImpl::SetNormalBitmap(const Point& position, const Bitmap& bitmap) } result +_ButtonImpl::SetNormalBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + result r = GetCore().SetBitmap(_BUTTON_STATUS_NORMAL, position, bitmap); + SetLastResultReturn(r); +} + +result _ButtonImpl::SetDisabledBitmap(const Point& position, const Bitmap& bitmap) { result r = GetCore().SetBitmap(_BUTTON_STATUS_DISABLED, position, bitmap); @@ -357,6 +409,13 @@ _ButtonImpl::SetDisabledBitmap(const Point& position, const Bitmap& bitmap) } result +_ButtonImpl::SetDisabledBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + result r = GetCore().SetBitmap(_BUTTON_STATUS_DISABLED, position, bitmap); + SetLastResultReturn(r); +} + +result _ButtonImpl::SetPressedBitmap(const Point& position, const Bitmap& bitmap) { result r = GetCore().SetBitmap(_BUTTON_STATUS_PRESSED, position, bitmap); @@ -364,6 +423,27 @@ _ButtonImpl::SetPressedBitmap(const Point& position, const Bitmap& bitmap) } result +_ButtonImpl::SetPressedBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + result r = GetCore().SetBitmap(_BUTTON_STATUS_PRESSED, position, bitmap); + SetLastResultReturn(r); +} + +result +_ButtonImpl::SetHighlightedBitmap(const Point& position, const Bitmap& bitmap) +{ + result r = GetCore().SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, position, bitmap); + SetLastResultReturn(r); +} + +result +_ButtonImpl::SetHighlightedBitmap(const FloatPoint& position, const Bitmap& bitmap) +{ + result r = GetCore().SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, position, bitmap); + SetLastResultReturn(r); +} + +result _ButtonImpl::SetNormalBackgroundBitmap(const Bitmap& bitmap) { result r = GetCore().SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, bitmap); @@ -371,6 +451,13 @@ _ButtonImpl::SetNormalBackgroundBitmap(const Bitmap& bitmap) } result +_ButtonImpl::SetDisabledBackgroundBitmap(const Bitmap& bitmap) +{ + result r = GetCore().SetBackgroundBitmap(_BUTTON_STATUS_DISABLED, bitmap); + SetLastResultReturn(r); +} + +result _ButtonImpl::SetPressedBackgroundBitmap(const Bitmap& bitmap) { result r = GetCore().SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, bitmap); @@ -391,6 +478,13 @@ _ButtonImpl::SetTextSize(int size) SetLastResultReturn(r); } +result +_ButtonImpl::SetTextSize(float size) +{ + result r = GetCore().SetTextSize(size); + SetLastResultReturn(r); +} + int _ButtonImpl::GetTextSize(void) const { @@ -399,6 +493,14 @@ _ButtonImpl::GetTextSize(void) const return GetCore().GetTextSize(); } +float +_ButtonImpl::GetTextSizeF(void) const +{ + ClearLastResult(); + + return GetCore().GetTextSizeF(); +} + void _ButtonImpl::OnActionPerformed(const _Control& source, int actionId) { @@ -467,7 +569,13 @@ _ButtonImpl::OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touch Tizen::Graphics::Dimension _ButtonImpl::GetContentSize(void) const { - return GetCore().GetContentSizeInternal(); + return GetCore().GetContentSize(); +} + +Tizen::Graphics::FloatDimension +_ButtonImpl::GetContentSizeF(void) const +{ + return GetCore().GetContentSizeF(); } _ButtonStatus @@ -509,14 +617,6 @@ protected: virtual Control* Make(_UiBuilderControl* pControl) { result r = E_SYSTEM; - - AppResource* pAppResource = null; - UiApp* pUiApp = UiApp::GetInstance(); - if (pUiApp) - { - pAppResource = UiApp::GetInstance()->GetAppResource(); - } - _UiBuilderControlLayout* pControlProperty = null; Button* pButton = null; HorizontalAlignment horizontalAlignment; @@ -524,7 +624,6 @@ protected: Color color; int size = 0; int opacity = 0; - Rectangle rect; Rectangle buttonRect(0, 0, 0, 0); Tizen::Base::String elementString; @@ -596,8 +695,8 @@ protected: { Bitmap* pNormalBitmap = null; Point position; + pNormalBitmap = LoadBitmapN(elementString); - pNormalBitmap = pAppResource->GetBitmapN(elementString); if (pControl->GetElement(L"NormalBitmapX", elementString)) { Base::Integer::Parse(elementString, position.x); @@ -628,7 +727,7 @@ protected: Bitmap* pPressedBitmap = null; Point position; - pPressedBitmap = pAppResource->GetBitmapN(elementString); + pPressedBitmap = LoadBitmapN(elementString); if (pControl->GetElement(L"PressedBitmapX", elementString)) { Base::Integer::Parse(elementString, position.x); @@ -658,7 +757,7 @@ protected: { Bitmap* pDisabledBitmap = null; Point position; - pDisabledBitmap = pAppResource->GetBitmapN(elementString); + pDisabledBitmap = LoadBitmapN(elementString); if (pControl->GetElement(L"DisabledBitmapX", elementString)) { Base::Integer::Parse(elementString, position.x); @@ -687,7 +786,7 @@ protected: if (pControl->GetElement(L"NormalBGBitmapPath", elementString)) { Bitmap* pNormalBGBitmap = null; - pNormalBGBitmap = pAppResource->GetBitmapN(elementString); + pNormalBGBitmap = LoadBitmapN(elementString); if (pNormalBGBitmap != null) { pButton->SetNormalBackgroundBitmap(*pNormalBGBitmap); @@ -698,7 +797,7 @@ protected: if (pControl->GetElement(L"PressedBGBitmapPath", elementString)) { Bitmap* pPressedBGBitmap = null; - pPressedBGBitmap = pAppResource->GetBitmapN(elementString); + pPressedBGBitmap = LoadBitmapN(elementString); if (pPressedBGBitmap != null) { pButton->SetPressedBackgroundBitmap(*pPressedBGBitmap); @@ -709,7 +808,7 @@ protected: if (pControl->GetElement(L"HighlightedBGBitmapPath", elementString)) { Bitmap* pHighlightedBGBitmap = null; - pHighlightedBGBitmap = pAppResource->GetBitmapN(elementString); + pHighlightedBGBitmap = LoadBitmapN(elementString); if (pHighlightedBGBitmap != null) { pButton->SetHighlightedBackgroundBitmap(*pHighlightedBGBitmap); @@ -778,7 +877,20 @@ protected: pButton->SetTextSize(size); } - + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pButton->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"ButtonText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pButton; } private: diff --git a/src/ui/controls/FUiCtrl_ButtonItemImpl.cpp b/src/ui/controls/FUiCtrl_ButtonItemImpl.cpp index 32ea273..6364a76 100644 --- a/src/ui/controls/FUiCtrl_ButtonItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_ButtonItemImpl.cpp @@ -29,6 +29,7 @@ _ButtonItemImpl::_ButtonItemImpl(ButtonItem* pPublic) : __actionId(-1) , __itemStyle(BUTTON_ITEM_STYLE_TEXT) , __itemText(L"") + , __accessibilityHint(L"") { for (int i = 0; i < BUTTON_ITEM_MAX_STATE_COUNT; i++) { @@ -141,6 +142,9 @@ _ButtonItemImpl::SetBackgroundBitmap(ButtonItemStatus status, const Tizen::Graph result _ButtonItemImpl::SetIcon(ButtonItemStatus status, const Tizen::Graphics::Bitmap* pIcon) { + SysTryReturnResult(NID_UI_CTRL, __itemStyle == BUTTON_ITEM_STYLE_ICON, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] Unable to set the icon because the BUTTON_ITEM_STYLE_TEXT style does not support it."); + SysTryReturnResult(NID_UI_CTRL, (status >= 0 && status < BUTTON_ITEM_MAX_STATE_COUNT), E_INVALID_ARG, "[E_INVALID_ARG] status is invalid."); @@ -152,9 +156,18 @@ _ButtonItemImpl::SetIcon(ButtonItemStatus status, const Tizen::Graphics::Bitmap* result _ButtonItemImpl::SetText(const Tizen::Base::String& text) { + SysTryReturnResult(NID_UI_CTRL, __itemStyle == BUTTON_ITEM_STYLE_TEXT, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] Unable to set the text because the BUTTON_ITEM_STYLE_ICON style does not support it."); + __itemText = text; return E_SUCCESS; } +void +_ButtonItemImpl::SetAccessibilityHint(const Tizen::Base::String& hint) +{ + __accessibilityHint = hint; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp index 31fa047..9515a3a 100644 --- a/src/ui/controls/FUiCtrl_ButtonPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ButtonPresenter.cpp @@ -24,6 +24,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiAnim_VisualElement.h" @@ -47,7 +48,7 @@ _ButtonPresenter::_ButtonPresenter(void) , __pTextObject(null) , __pBase(null) , __fontStyle(0) - , __fontSize(0) + , __fontSize(0.0f) { } @@ -74,7 +75,9 @@ _ButtonPresenter::Construct(const _Button& button) __pButton = const_cast <_Button*>(&button); __fontStyle = FONT_STYLE_PLAIN; - __fontSize = __pButton->GetTextSize(); + + GET_SHAPE_CONFIG(BUTTON::DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, __fontSize); + __pFont = __pButton->GetFallbackFont(); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, __pFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -128,6 +131,16 @@ _ButtonPresenter::InitTextObject(void) { TextSimple* pSimpleText = null; + float leftMargin = __pButton->GetLeftMarginF(); + float topMargin = __pButton->GetTopMarginF(); + float rightMargin = __pButton->GetRightMarginF(); + float bottomMargin = __pButton->GetBottomMarginF(); + + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); + pSimpleText = new (std::nothrow) TextSimple(const_cast(__pButton->GetText().GetPointer()), __pButton->GetText().GetLength()); SysTryReturn(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); @@ -137,8 +150,9 @@ _ButtonPresenter::InitTextObject(void) __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); - __pTextObject->SetBounds(Rectangle(__pButton->GetLeftMargin(), __pButton->GetTopMargin(), - __pButton->GetBounds().width - __pButton->GetLeftMargin() * 2, __pButton->GetBounds().height - __pButton->GetTopMargin() * 2)); + __pTextObject->SetBounds(FloatRectangle(leftMargin + leftTouchMargin, topMargin + topTouchMargin, + __pButton->GetBoundsF().width - (leftMargin + rightMargin) - (leftTouchMargin + rightTouchMargin), + __pButton->GetBoundsF().height - (topMargin + bottomMargin) - (topTouchMargin + bottomTouchMargin))); __pTextObject->Compose(); return E_SUCCESS; @@ -156,6 +170,15 @@ void _ButtonPresenter::OnFontInfoRequested(unsigned long& style, int& size) { style = __fontStyle; + size = _CoordinateSystemUtils::ConvertToInteger(__fontSize); + + return; +} + +void +_ButtonPresenter::OnFontInfoRequested(unsigned long& style, float& size) +{ + style = __fontStyle; size = __fontSize; return; @@ -164,6 +187,14 @@ _ButtonPresenter::OnFontInfoRequested(unsigned long& style, int& size) void _ButtonPresenter::SetTextSize(int size, unsigned long fontStyle) { + float floatSize = _CoordinateSystemUtils::ConvertToFloat(size); + + return SetTextSize(floatSize, fontStyle); +} + +void +_ButtonPresenter::SetTextSize(float size, unsigned long fontStyle) +{ result r = E_SUCCESS; bool isStrikeOut = __pFont->IsStrikeOut(); @@ -183,6 +214,7 @@ _ButtonPresenter::SetTextSize(int size, unsigned long fontStyle) __fontSize = size; __pFont = __pButton->GetFallbackFont(); + r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, __pFont, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -195,6 +227,14 @@ _ButtonPresenter::SetTextSize(int size, unsigned long fontStyle) void _ButtonPresenter::SetFontInfo(unsigned long style, int size) { + float floatSize = _CoordinateSystemUtils::ConvertToFloat(size); + + return SetFontInfo(style, floatSize); +} + +void +_ButtonPresenter::SetFontInfo(unsigned long style, float size) +{ __fontStyle = style; __fontSize = size; @@ -207,10 +247,18 @@ _ButtonPresenter::GetTextObject(void) const return __pTextObject; } +Font* +_ButtonPresenter::GetFont(void) const +{ + return __pFont; +} + void _ButtonPresenter::Draw(void) { _ButtonStatus status = __pButton->GetButtonStatus(); + _ButtonStatus prevStatus = __pButton->GetPrevButtonStatus(); + Bitmap* pToolbarItemBackgroundBitmap = __pButton->GetToolbarItemBackgroundBitmap(status); if (pToolbarItemBackgroundBitmap) @@ -220,12 +268,23 @@ _ButtonPresenter::Draw(void) else { DrawBackground(); + + //Bitmap* pBackgroundBitmap = __pButton->GetBackgroundBitmap(status); + //if (pBackgroundBitmap) + //{ + // String imagePath = _BitmapImpl::GetInstance(*pBackgroundBitmap)->GetFileName(); + // if (imagePath.IsEmpty() == false && __pButton->GetText() == L"" && __pButton->GetBitmap(status) == null) + // { + // SysLog(NID_UI_CTRL, "Cannot get a canvas."); + // return; + // } + //} } DrawBitmap(); DrawText(); - if (status == _BUTTON_STATUS_SELECTED) + if (status == _BUTTON_STATUS_SELECTED || (status == _BUTTON_STATUS_PRESSED && prevStatus == _BUTTON_STATUS_SELECTED)) { DrawToolbarSelectedBitmap(); } @@ -241,8 +300,16 @@ _ButtonPresenter::DrawBackground(void) Bitmap* pReplacementColorBackgroundBitmap = null; Bitmap* pBackgroundBitmap = null; Bitmap* pBackgroundEffectBitmap = null; + //Color bgColor = __pButton->GetBackgroundColor(); + //String imagePath = L""; - Rectangle bounds(0, 0, __pButton->GetBounds().width, __pButton->GetBounds().height); + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); + + FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin) + , __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin)); _ButtonStatus status = __pButton->GetButtonStatus(); @@ -253,69 +320,88 @@ _ButtonPresenter::DrawBackground(void) if (pBackgroundBitmap) { - pCanvas = __pButton->GetCanvasN(); - if (pCanvas == null) - { - SysLog(NID_UI_CTRL, "Cannot get a canvas."); - return; - } - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); - pCanvas->Clear(); + //if (pBackgroundBitmap->IsNinePatchedBitmap() == false) + //{ + // imagePath = _BitmapImpl::GetInstance(*pBackgroundBitmap)->GetFileName(); + //} + + //if (imagePath.IsEmpty() == false && __pButton->GetText() == L"" && __pButton->GetBitmap(status) == null) + //{ + // __pBase->SetBackgroundColor(_Colorf( + // (float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255)); + // __pBase->SetImageSource(imagePath); + //} + //else + //{ + pCanvas = __pButton->GetCanvasN(); + if (pCanvas == null) + { + SysLog(NID_UI_CTRL, "Cannot get a canvas."); + return; + } + pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->Clear(); - if (pBackgroundBitmap->IsNinePatchedBitmap()) //ninepatch - { - if (pBackgroundEffectBitmap) + if (pBackgroundBitmap->IsNinePatchedBitmap()) // pBackgroundBitmap is 9 { - if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) + if (pBackgroundEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); - if (__pButton->IsUserBackgroundEffectBitmap(status)) + if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) // 9,9 { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + if (__pButton->IsUserBackgroundEffectBitmap(status)) + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + } } - } - else - { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); - if (__pButton->IsUserBackgroundEffectBitmap(status)) + else // 9,0 { - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + if (__pButton->IsUserBackgroundEffectBitmap(status)) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + } } } + else // 9, X + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap); + } } - else - { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); - } - } - else // not ninepatch - { - if (pBackgroundEffectBitmap) + else // pBackgroundBitmap is not 9 { - if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) + if (pBackgroundEffectBitmap) { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, Rectangle(0, 0, pBackgroundBitmap->GetWidth(), pBackgroundBitmap->GetHeight())); - if (__pButton->IsUserBackgroundEffectBitmap(status)) + if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) // 0, 9 { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + if (__pButton->IsUserBackgroundEffectBitmap(status)) + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); + } } - } - else - { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, Rectangle(0, 0, pBackgroundBitmap->GetWidth(), pBackgroundBitmap->GetHeight())); - if (__pButton->IsUserBackgroundEffectBitmap(status)) + else // 0, 0 { - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + if (__pButton->IsUserBackgroundEffectBitmap(status)) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); + } } } + else // 0, X + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF()))); + } } - else - { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, Rectangle(0, 0, pBackgroundBitmap->GetWidth(), pBackgroundBitmap->GetHeight())); - } - } + //} } - else + else // pBackgroundBitmap is null { pCanvas = __pButton->GetCanvasN(); if (pCanvas == null) @@ -328,18 +414,19 @@ _ButtonPresenter::DrawBackground(void) if (pBackgroundEffectBitmap) { - if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) + if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) // X, 9 { if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); } } - else + else // X, 0 { if (__pButton->IsUserBackgroundEffectBitmap(status)) { - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); } } } @@ -349,7 +436,7 @@ _ButtonPresenter::DrawBackground(void) } } } - else // nobody set bitmap (default bitmap draw) + else // nobody set bitmap (default bitmap draw) // if (__pButton->IsUserBackgroundBitmap(status)) { pCanvas = __pButton->GetCanvasN(); if (pCanvas == null) @@ -362,7 +449,7 @@ _ButtonPresenter::DrawBackground(void) if (status == _BUTTON_STATUS_DISABLED) { - pBackgroundBitmap = __pButton->GetBackgroundBitmap(_BUTTON_STATUS_DISABLED); + pBackgroundBitmap = __pButton->GetBackgroundBitmap(_BUTTON_STATUS_NORMAL); if(!__pButton->IsUserBackgroundBitmap(_BUTTON_STATUS_NORMAL)) { @@ -388,18 +475,19 @@ _ButtonPresenter::DrawBackground(void) { if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); } else { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); } } else { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); } } else @@ -408,21 +496,22 @@ _ButtonPresenter::DrawBackground(void) { if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, Rectangle(0, 0, pReplacementColorBackgroundBitmap->GetWidth(), - pReplacementColorBackgroundBitmap->GetHeight())); - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); } else { - pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, Rectangle(0, 0, pReplacementColorBackgroundBitmap->GetWidth(), - pReplacementColorBackgroundBitmap->GetHeight())); - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); } } else { - pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, Rectangle(0, 0, pReplacementColorBackgroundBitmap->GetWidth(), - pReplacementColorBackgroundBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF()))); } } } @@ -432,11 +521,12 @@ _ButtonPresenter::DrawBackground(void) { if (pBackgroundEffectBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap); } else { - pCanvas->DrawBitmap(bounds, *pBackgroundEffectBitmap, Rectangle(0, 0, pBackgroundEffectBitmap->GetWidth(), pBackgroundEffectBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBackgroundEffectBitmap->GetWidthF(), pBackgroundEffectBitmap->GetHeightF()))); } } else @@ -476,6 +566,11 @@ _ButtonPresenter::DrawBackground(void) void _ButtonPresenter::DrawToolbarItemBackground(void) { + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); + _ButtonStatus status = __pButton->GetButtonStatus(); Bitmap* pToolbarItemBackgroundBitmap = __pButton->GetToolbarItemBackgroundBitmap(status); @@ -492,15 +587,17 @@ _ButtonPresenter::DrawToolbarItemBackground(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle bounds(0, 0, __pButton->GetBounds().width, __pButton->GetBounds().height); + FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin), + __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin)); if (pToolbarItemBackgroundBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pToolbarItemBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarItemBackgroundBitmap); } else { - pCanvas->DrawBitmap(bounds, *pToolbarItemBackgroundBitmap, Rectangle(0, 0, pToolbarItemBackgroundBitmap->GetWidth(), pToolbarItemBackgroundBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarItemBackgroundBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pToolbarItemBackgroundBitmap->GetWidthF(), pToolbarItemBackgroundBitmap->GetHeightF()))); } delete pCanvas; @@ -519,7 +616,16 @@ _ButtonPresenter::DrawBitmap(void) Bitmap* pBitmap = __pButton->GetBitmap(status); Bitmap* pNormalBitmap = __pButton->GetBitmap(_BUTTON_STATUS_NORMAL); - Rectangle bounds(0, 0, __pButton->GetBounds().width, __pButton->GetBounds().height); + Bitmap* pEffectBitmap = __pButton->GetEffectBitmap(status); + Bitmap* pNormalEffectBitmap = __pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL); + + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); + + FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin), + __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin)); if (pBitmap) { @@ -531,14 +637,26 @@ _ButtonPresenter::DrawBitmap(void) return; } - if (__pButton->GetSize().width - __pButton->GetBitmapPosition(status).x < pBitmap->GetWidth() - || __pButton->GetSize().height - __pButton->GetBitmapPosition(status).y < pBitmap->GetHeight()) + if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(status).x - rightTouchMargin < pBitmap->GetWidthF() + || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(status).y - bottomTouchMargin < pBitmap->GetHeightF()) { - pCanvas->DrawBitmap(bounds, *pBitmap, Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pBitmap->GetWidthF(), pBitmap->GetHeightF()))); + + if (pEffectBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pEffectBitmap->GetWidthF(), pEffectBitmap->GetHeightF()))); + } } else { - pCanvas->DrawBitmap(__pButton->GetBitmapPosition(status), *pBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetBitmapPositionF(status)), *pBitmap); + + if (pEffectBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetEffectBitmapPositionF(status)), *pEffectBitmap); + } } } else if (pNormalBitmap) @@ -551,14 +669,26 @@ _ButtonPresenter::DrawBitmap(void) return; } - if (__pButton->GetSize().width - __pButton->GetBitmapPosition(_BUTTON_STATUS_NORMAL).x < pNormalBitmap->GetWidth() - || __pButton->GetSize().height - __pButton->GetBitmapPosition(_BUTTON_STATUS_NORMAL).y < pNormalBitmap->GetHeight()) + if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).x - rightTouchMargin < pNormalBitmap->GetWidthF() + || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).y - bottomTouchMargin < pNormalBitmap->GetHeightF()) { - pCanvas->DrawBitmap(bounds, *pNormalBitmap, Rectangle(0, 0, pNormalBitmap->GetWidth(), pNormalBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pNormalBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pNormalBitmap->GetWidthF(), pNormalBitmap->GetHeightF()))); + + if (pNormalEffectBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pNormalEffectBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pNormalEffectBitmap->GetWidthF(), pNormalEffectBitmap->GetHeightF()))); + } } else { - pCanvas->DrawBitmap(__pButton->GetBitmapPosition(_BUTTON_STATUS_NORMAL), *pNormalBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL)), *pNormalBitmap); + + if (pNormalEffectBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__pButton->GetEffectBitmapPositionF(_BUTTON_STATUS_NORMAL)), *pNormalEffectBitmap); + } } } @@ -574,9 +704,15 @@ _ButtonPresenter::DrawText(void) TextObjectAlignment horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER; TextObjectAlignment verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE; - int buttonTopMargin = __pButton->GetTopMargin(); - int buttonLeftMargin = __pButton->GetLeftMargin(); - int multilineFontSize = 0; + float leftMargin = __pButton->GetLeftMarginF(); + float topMargin = __pButton->GetTopMarginF(); + float rightMargin = __pButton->GetRightMarginF(); + float bottomMargin = __pButton->GetBottomMarginF(); + + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); Canvas* pCanvas = __pButton->GetCanvasN(); if (pCanvas == null) @@ -609,24 +745,28 @@ _ButtonPresenter::DrawText(void) verticalAlign = TEXT_OBJECT_ALIGNMENT_BOTTOM; } - __pTextObject->RemoveAll(); + __pTextObject->RemoveAll(true); pSimpleText = new (std::nothrow) TextSimple(const_cast(__pButton->GetText().GetPointer()), __pButton->GetText().GetLength()); __pTextObject->AppendElement(*pSimpleText); if (__pButton->UserDefinedText()) { - __pTextObject->SetBounds(__pButton->GetUserDefinedTextArea()); + __pTextObject->SetBounds(__pButton->GetUserDefinedTextAreaF()); } else { - __pTextObject->SetBounds(Rectangle(buttonLeftMargin, buttonTopMargin, - __pButton->GetBounds().width - buttonLeftMargin * 2, __pButton->GetBounds().height - buttonTopMargin * 2)); + __pTextObject->SetBounds(FloatRectangle(leftMargin + leftTouchMargin, topMargin + topTouchMargin, + __pButton->GetBoundsF().width - (leftMargin + rightMargin) - (leftTouchMargin + rightTouchMargin), + __pButton->GetBoundsF().height - (topMargin + bottomMargin) - (topTouchMargin + bottomTouchMargin))); } __pTextObject->SetAlignment(horizontalAlign | verticalAlign); __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); __pTextObject->Compose(); +#if 0 + int multilineFontSize = 0; + if (__pTextObject->GetTotalLineCount() >= 2) { GET_SHAPE_CONFIG(BUTTON::MULTILINE_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, multilineFontSize); @@ -640,6 +780,7 @@ _ButtonPresenter::DrawText(void) __pTextObject->Compose(); } } +#endif __pTextObject->SetForegroundColor(__pButton->GetTextColor(__pButton->GetButtonStatus()), 0, __pTextObject->GetTextLength()); __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); @@ -652,9 +793,14 @@ _ButtonPresenter::DrawText(void) void _ButtonPresenter::DrawToolbarSelectedBitmap(void) { - int selectedBitmapMargin = 0; - int selectedBitmapHeight = 0; - int segmentedHeight = 0; + float selectedBitmapMargin = 0.0f; + float selectedBitmapHeight = 0.0f; + float segmentedHeight = 0.0f; + + float leftTouchMargin = __pButton->GetLeftTouchMarginF(); + float topTouchMargin = __pButton->GetTopTouchMarginF(); + float rightTouchMargin = __pButton->GetRightTouchMarginF(); + float bottomTouchMargin = __pButton->GetBottomTouchMarginF(); GET_SHAPE_CONFIG(HEADER::HEADER_ITEM_SELECTED_BITMAP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, selectedBitmapMargin); GET_SHAPE_CONFIG(HEADER::HEADER_ITEM_SELECTED_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, selectedBitmapHeight); @@ -674,21 +820,23 @@ _ButtonPresenter::DrawToolbarSelectedBitmap(void) return; } - Rectangle bounds(selectedBitmapMargin, __pButton->GetBounds().height - (__pButton->GetBounds().height - segmentedHeight) / 2, - __pButton->GetBounds().width - selectedBitmapMargin * 2, selectedBitmapHeight); + FloatRectangle bounds(selectedBitmapMargin + leftTouchMargin, + __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin) - (__pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin) - segmentedHeight) / 2, + __pButton->GetBoundsF().width - selectedBitmapMargin * 2 - (leftTouchMargin + rightTouchMargin), selectedBitmapHeight); if (isDrawInner) { - bounds.y -= selectedBitmapHeight; + bounds.y -= (selectedBitmapHeight - bottomTouchMargin); } if (pToolbarSelectedBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pToolbarSelectedBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarSelectedBitmap); } else { - pCanvas->DrawBitmap(bounds, *pToolbarSelectedBitmap, Rectangle(0, 0, pToolbarSelectedBitmap->GetWidth(), pToolbarSelectedBitmap->GetHeight())); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pToolbarSelectedBitmap, + _CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, pToolbarSelectedBitmap->GetWidthF(), pToolbarSelectedBitmap->GetHeightF()))); } delete pCanvas; @@ -710,21 +858,21 @@ _ButtonPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touch return true; } + if (__pButton->GetButtonStyle() == _BUTTON_STYLE_SEGMENT) + { + return false; + } + __touchMoveHandled = false; - _ButtonStatus status = __pButton->GetButtonStatus(); + //_ButtonStatus status = __pButton->GetButtonStatus(); - if (status != _BUTTON_STATUS_SELECTED) - { + //if (status != _BUTTON_STATUS_SELECTED) + //{ __pButton->SetButtonStatus(_BUTTON_STATUS_PRESSED); - } + //} __pButton->Invalidate(); - if (__pButton->GetButtonStyle() == _BUTTON_STYLE_SEGMENT) - { - return false; - } - return true; } @@ -741,30 +889,32 @@ _ButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc return true; } - _ButtonStatus status = __pButton->GetButtonStatus(); - if (__pButton->GetButtonStyle() == _BUTTON_STYLE_SEGMENT) { return false; } + _ButtonStatus status = __pButton->GetButtonStatus(); + if (status == _BUTTON_STATUS_NORMAL) { return true; } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - touchPoint.x += source.GetClientBounds().x; - touchPoint.y += source.GetClientBounds().y; + touchPoint.x += source.GetClientBoundsF().x; + touchPoint.y += source.GetClientBoundsF().y; - Rectangle bounds = __pButton->GetClientBounds(); + FloatRectangle bounds = __pButton->GetClientBoundsF(); __pButton->SetButtonStatus(_BUTTON_STATUS_NORMAL); __pButton->Invalidate(); if (bounds.Contains(touchPoint)) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + __pButton->FireActionEvent(); } @@ -789,12 +939,12 @@ _ButtonPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin return false; } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - touchPoint.x += source.GetClientBounds().x; - touchPoint.y += source.GetClientBounds().y; + touchPoint.x += source.GetClientBoundsF().x; + touchPoint.y += source.GetClientBoundsF().y; - Rectangle bounds = __pButton->GetClientBounds(); + FloatRectangle bounds = __pButton->GetClientBoundsF(); bool isInButtonArea = bounds.Contains(touchPoint); _ButtonStatus oldStatus = __pButton->GetButtonStatus(); @@ -867,6 +1017,4 @@ _ButtonPresenter::IsEnabledStateChanged(void) return ret; } - - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_CheckButton.cpp b/src/ui/controls/FUiCtrl_CheckButton.cpp index 91810b3..b954394 100644 --- a/src/ui/controls/FUiCtrl_CheckButton.cpp +++ b/src/ui/controls/FUiCtrl_CheckButton.cpp @@ -24,6 +24,7 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiNotificationEvent.h" #include "FUi_UiEventManager.h" @@ -50,7 +51,8 @@ public: } virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} @@ -80,7 +82,8 @@ public: _AccessibilityManager::GetInstance()->ReadContent(L"unselected"); } } - else if (style == CHECK_BUTTON_STYLE_ONOFF || style == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || style == CHECK_BUTTON_STYLE_ONOFF_SLIDING) + else if (style == CHECK_BUTTON_STYLE_ONOFF || style == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER + || style == CHECK_BUTTON_STYLE_ONOFF_SLIDING || style == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { if(__pCheckButton->IsSelected()) { @@ -119,10 +122,12 @@ _CheckButton::_CheckButton(void) , __pOnOffBgNormalBitmap(null) , __pOnOffBgPressedBitmap(null) , __pOnOffBitmap(null) - , __pOnOffSlidingOnBitmap(null) - , __pOnOffSlidingOffBitmap(null) - , __pDimOnOffSlidingOnBitmap(null) - , __pDimOnOffSlidingOffBitmap(null) + , __pOnOffSlidingOnBgBitmap(null) + , __pOnOffSlidingOffBgBitmap(null) + , __pDimOnOffSlidingOnBgBitmap(null) + , __pDimOnOffSlidingOffBgBitmap(null) + , __pOnOffSlidingHandlerBitmap(null) + , __pDimOnOffSlidingHandlerBitmap(null) , __pCircleBitmap(null) , __pCircleNormalEffectBitmap(null) , __pCirclePressedEffectBitmap(null) @@ -141,9 +146,8 @@ _CheckButton::_CheckButton(void) , __pBackgroundBottomPressedEffectBitmap(null) , __horizontalAlignment(ALIGNMENT_LEFT) , __verticalAlignment(ALIGNMENT_MIDDLE) - , __textSize(0) - , __titleTextSize(0) - , __parentMoveDistance(0) + , __textSize(0.0f) + , __titleTextSize(0.0f) , __previousTouchArea(false) , __pRadioGroup(null) , __pButtonElement(null) @@ -191,6 +195,7 @@ _CheckButton::_CheckButton(void) pContainer->Activate(true); __pAccessibilityListener = new (std::nothrow) CheckButtonAccessibilityListener(this); pContainer->AddListener(*__pAccessibilityListener); + UpdateAccessibilityElement(); } ClearLastResult(); @@ -269,28 +274,40 @@ _CheckButton::~_CheckButton(void) __pOnOffBitmap = null; } - if (__pOnOffSlidingOnBitmap) + if (__pOnOffSlidingOnBgBitmap) { - delete __pOnOffSlidingOnBitmap; - __pOnOffSlidingOnBitmap = null; + delete __pOnOffSlidingOnBgBitmap; + __pOnOffSlidingOnBgBitmap = null; } - if (__pOnOffSlidingOffBitmap) + if (__pOnOffSlidingOffBgBitmap) { - delete __pOnOffSlidingOffBitmap; - __pOnOffSlidingOffBitmap = null; + delete __pOnOffSlidingOffBgBitmap; + __pOnOffSlidingOffBgBitmap = null; } - if (__pDimOnOffSlidingOnBitmap) + if (__pDimOnOffSlidingOnBgBitmap) { - delete __pDimOnOffSlidingOnBitmap; - __pDimOnOffSlidingOnBitmap = null; + delete __pDimOnOffSlidingOnBgBitmap; + __pDimOnOffSlidingOnBgBitmap = null; } - if (__pDimOnOffSlidingOffBitmap) + if (__pDimOnOffSlidingOffBgBitmap) { - delete __pDimOnOffSlidingOffBitmap; - __pDimOnOffSlidingOffBitmap = null; + delete __pDimOnOffSlidingOffBgBitmap; + __pDimOnOffSlidingOffBgBitmap = null; + } + + if (__pOnOffSlidingHandlerBitmap) + { + delete __pOnOffSlidingHandlerBitmap; + __pOnOffSlidingHandlerBitmap = null; + } + + if (__pDimOnOffSlidingHandlerBitmap) + { + delete __pDimOnOffSlidingHandlerBitmap; + __pDimOnOffSlidingHandlerBitmap = null; } if (__pCircleBitmap) @@ -432,8 +449,15 @@ _CheckButton::OnDraw(void) result _CheckButton::OnAttachedToMainTree(void) { - UpdateAccessibilityElement(); + if(__pButtonElement) + { + __pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + } + if(__pDetailButtonElement) + { + __pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF())); + } return E_SUCCESS; } @@ -446,8 +470,6 @@ _CheckButton::UpdateAccessibilityElement(void) } _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - CheckButtonStyle checkStyle = GetCheckButtonStyle(); - if(pContainer) { String label = L""; @@ -457,7 +479,8 @@ _CheckButton::UpdateAccessibilityElement(void) label.Append(L", "); } - if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) + if (__checkButtonStyle == CHECK_BUTTON_STYLE_MARK || __checkButtonStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER + || __checkButtonStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) { if (__pButtonElement == null) { @@ -465,12 +488,12 @@ _CheckButton::UpdateAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, __pButtonElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); pContainer->AddElement(*__pButtonElement); } - __pButtonElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); __pButtonElement->SetLabel(label + GetText()); __pButtonElement->SetTrait(L"Tickbox"); - __pButtonElement->SetName(L"CheckButton"); + __pButtonElement->SetName(L"CheckButtonText"); - if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) + if (__checkButtonStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) { if (__pDetailButtonElement == null) { @@ -478,13 +501,14 @@ _CheckButton::UpdateAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, __pDetailButtonElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); pContainer->AddElement(*__pDetailButtonElement); } - __pDetailButtonElement->SetBounds(__pCheckButtonPresenter->GetDetailedButtonBounds()); + __pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF())); __pDetailButtonElement->SetLabel(L"More"); __pDetailButtonElement->SetTrait(L"More Button"); - __pDetailButtonElement->SetName(L"MoreButton"); + __pDetailButtonElement->SetName(L"MoreButtonText"); } } - else if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) + else if (__checkButtonStyle == CHECK_BUTTON_STYLE_RADIO || __checkButtonStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER + || __checkButtonStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) { if (__pButtonElement == null) { @@ -492,12 +516,12 @@ _CheckButton::UpdateAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, __pButtonElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); pContainer->AddElement(*__pButtonElement); } - __pButtonElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); __pButtonElement->SetLabel(label + GetText()); __pButtonElement->SetTrait(L"Radio Button"); - __pButtonElement->SetName(L"RadioButton"); + __pButtonElement->SetName(L"CheckButtonText"); - if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) + if (__checkButtonStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) { if (__pDetailButtonElement == null) { @@ -505,13 +529,14 @@ _CheckButton::UpdateAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, __pDetailButtonElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); pContainer->AddElement(*__pDetailButtonElement); } - __pDetailButtonElement->SetBounds(__pCheckButtonPresenter->GetDetailedButtonBounds()); + __pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF())); __pDetailButtonElement->SetLabel(L"More"); __pDetailButtonElement->SetTrait(L"More Button"); - __pDetailButtonElement->SetName(L"MoreButton"); + __pDetailButtonElement->SetName(L"MoreButtonText"); } } - else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING) + else if (__checkButtonStyle == CHECK_BUTTON_STYLE_ONOFF || __checkButtonStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER + || __checkButtonStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || __checkButtonStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { if (__pButtonElement == null) { @@ -519,10 +544,10 @@ _CheckButton::UpdateAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, __pButtonElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); pContainer->AddElement(*__pButtonElement); } - __pButtonElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); __pButtonElement->SetLabel(label + GetText()); __pButtonElement->SetTrait(L"On off button"); - __pButtonElement->SetName(L"OnOffButton"); + __pButtonElement->SetName(L"CheckButtonText"); } UpdateAccessibilityCheckStatus(); } @@ -567,12 +592,12 @@ _CheckButton::OnBoundsChanged(void) { if(__pButtonElement) { - __pButtonElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); } if(__pDetailButtonElement) { - __pDetailButtonElement->SetBounds(__pCheckButtonPresenter->GetDetailedButtonBounds()); + __pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF())); } return; @@ -626,7 +651,7 @@ _CheckButton::SendTouchReleasedEvent(const _Control& control) result _CheckButton::SetSelected(bool select) { - return SetProperty("selected", Variant(select)); + return SetProperty(L"selected", Variant(select)); } result @@ -642,7 +667,7 @@ _CheckButton::SetPropertySelected(const Variant& selected) bool _CheckButton::IsSelected(void) const { - Variant selected = GetProperty("selected"); + Variant selected = GetProperty(L"selected"); return selected.ToBool(); } @@ -710,9 +735,9 @@ _CheckButton::SetActionId(int checkedActionId, int uncheckedActionId, int select { result r = E_SUCCESS; - r = SetProperty("checkedActionId", Variant(checkedActionId)); - r = SetProperty("uncheckedActionId", Variant(uncheckedActionId)); - r = SetProperty("selectedActionId", Variant(selectedActionId)); + r = SetProperty(L"checkedActionId", Variant(checkedActionId)); + r = SetProperty(L"uncheckedActionId", Variant(uncheckedActionId)); + r = SetProperty(L"selectedActionId", Variant(selectedActionId)); return r; } @@ -728,7 +753,7 @@ _CheckButton::SetPropertyCheckedActionId(const Variant& checkedActionId) int _CheckButton::GetCheckedActionId(void) const { - Variant checkedActionId = GetProperty("checkedActionId"); + Variant checkedActionId = GetProperty(L"checkedActionId"); return checkedActionId.ToInt(); } @@ -750,7 +775,7 @@ _CheckButton::SetPropertyUncheckedActionId(const Variant& uncheckedActionId) int _CheckButton::GetUncheckedActionId(void) const { - Variant uncheckedActionId = GetProperty("uncheckedActionId"); + Variant uncheckedActionId = GetProperty(L"uncheckedActionId"); return uncheckedActionId.ToInt(); } @@ -772,7 +797,7 @@ _CheckButton::SetPropertySelectedActionId(const Variant& selectedActionId) int _CheckButton::GetSelectedActionId(void) const { - Variant selectedActionId = GetProperty("selectedActionId"); + Variant selectedActionId = GetProperty(L"selectedActionId"); return selectedActionId.ToInt(); } @@ -788,21 +813,21 @@ _CheckButton::LoadDefaultBackgroundBitmap(void) { result r = E_SUCCESS; - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundNormalEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundPressedEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundNormalEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundPressedEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopNormalEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::TOP_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopPressedEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopNormalEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundTopPressedEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::CENTER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddleBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::CENTER_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddleNormalEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::CENTER_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddlePressedEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddleNormalEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundMiddlePressedEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomNormalEffectBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::BOTTOM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomPressedEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomNormalEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBackgroundBottomPressedEffectBitmap); r = GET_BITMAP_CONFIG_N(CHECKBUTTON::MARK_ICON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pMarkBgNormalBitmap); r = GET_BITMAP_CONFIG_N(CHECKBUTTON::MARK_ICON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pMarkBgPressedBitmap); @@ -812,10 +837,12 @@ _CheckButton::LoadDefaultBackgroundBitmap(void) r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_ICON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffBgPressedBitmap); r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ICON_ON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffSlidingOnBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ICON_OFF_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffSlidingOffBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ICON_ON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDimOnOffSlidingOnBitmap); - r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ICON_OFF_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDimOnOffSlidingOffBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffSlidingOnBgBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_OFF_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffSlidingOffBgBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_ON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDimOnOffSlidingOnBgBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_OFF_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDimOnOffSlidingOffBgBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_HANDLER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pOnOffSlidingHandlerBitmap); + r = GET_BITMAP_CONFIG_N(CHECKBUTTON::ONOFF_SLIDING_HANDLER_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDimOnOffSlidingHandlerBitmap); r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pCircleBitmap); r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pCircleNormalEffectBitmap); @@ -828,7 +855,7 @@ _CheckButton::LoadDefaultBackgroundBitmap(void) result _CheckButton::SetText(const String& text) { - return SetProperty("text", Variant(text)); + return SetProperty(L"text", Variant(text)); } result @@ -847,7 +874,7 @@ _CheckButton::SetPropertyText(const Variant& text) String _CheckButton::GetText(void) const { - Variant text = GetProperty("text"); + Variant text = GetProperty(L"text"); return text.ToString(); } @@ -861,7 +888,7 @@ _CheckButton::GetPropertyText(void) const result _CheckButton::SetTitleText(const String& title) { - return SetProperty("titleText", Variant(title)); + return SetProperty(L"titleText", Variant(title)); } result @@ -873,7 +900,7 @@ _CheckButton::SetPropertyTitleText(const Variant& title) { String label = __titleText; label.Append(L", "); - + __pButtonElement->SetLabel(label + GetText()); } return E_SUCCESS; @@ -882,7 +909,7 @@ _CheckButton::SetPropertyTitleText(const Variant& title) String _CheckButton::GetTitleText(void) const { - Variant title = GetProperty("titleText"); + Variant title = GetProperty(L"titleText"); return title.ToString(); } @@ -922,13 +949,13 @@ _CheckButton::GetTextVerticalAlignment(void) const result _CheckButton::SetTextColor(const Color& color) { - return SetProperty("normalTextColor", Variant(color)); + return SetProperty(L"normalTextColor", Variant(color)); } Color _CheckButton::GetTextColor(void) const { - Variant color = GetProperty("normalTextColor"); + Variant color = GetProperty(L"normalTextColor"); return color.ToColor(); } @@ -936,13 +963,13 @@ _CheckButton::GetTextColor(void) const result _CheckButton::SetDisabledTextColor(const Color& color) { - return SetProperty("disabledTextColor", Variant(color)); + return SetProperty(L"disabledTextColor", Variant(color)); } Color _CheckButton::GetDisabledTextColor(void) const { - Variant color = GetProperty("disabledTextColor"); + Variant color = GetProperty(L"disabledTextColor"); return color.ToColor(); } @@ -950,13 +977,13 @@ _CheckButton::GetDisabledTextColor(void) const result _CheckButton::SetPressedTextColor(const Color& color) { - return SetProperty("pressedTextColor", Variant(color)); + return SetProperty(L"pressedTextColor", Variant(color)); } Color _CheckButton::GetPressedTextColor(void) const { - Variant color = GetProperty("pressedTextColor"); + Variant color = GetProperty(L"pressedTextColor"); return color.ToColor(); } @@ -964,14 +991,14 @@ _CheckButton::GetPressedTextColor(void) const result _CheckButton::SetHighlightedTextColor(const Color& color) { - return SetProperty("highlightedTextColor", Variant(color)); + return SetProperty(L"highlightedTextColor", Variant(color)); } Color _CheckButton::GetHighlightedTextColor(void) const { - Variant color = GetProperty("highlightedTextColor"); + Variant color = GetProperty(L"highlightedTextColor"); return color.ToColor(); } @@ -1031,13 +1058,13 @@ _CheckButton::GetPropertyHighlightedTextColor(void) const result _CheckButton::SetTitleTextColor(const Color& color) { - return SetProperty("normalTitleTextColor", Variant(color)); + return SetProperty(L"normalTitleTextColor", Variant(color)); } Color _CheckButton::GetTitleTextColor(void) const { - Variant color = GetProperty("normalTitleTextColor"); + Variant color = GetProperty(L"normalTitleTextColor"); return color.ToColor(); } @@ -1045,13 +1072,13 @@ _CheckButton::GetTitleTextColor(void) const result _CheckButton::SetDisabledTitleTextColor(const Color& color) { - return SetProperty("disabledTitleTextColor", Variant(color)); + return SetProperty(L"disabledTitleTextColor", Variant(color)); } Color _CheckButton::GetDisabledTitleTextColor(void) const { - Variant color = GetProperty("disabledTitleTextColor"); + Variant color = GetProperty(L"disabledTitleTextColor"); return color.ToColor(); } @@ -1059,13 +1086,13 @@ _CheckButton::GetDisabledTitleTextColor(void) const result _CheckButton::SetPressedTitleTextColor(const Color& color) { - return SetProperty("pressedTitleTextColor", Variant(color)); + return SetProperty(L"pressedTitleTextColor", Variant(color)); } Color _CheckButton::GetPressedTitleTextColor(void) const { - Variant color = GetProperty("pressedTitleTextColor"); + Variant color = GetProperty(L"pressedTitleTextColor"); return color.ToColor(); } @@ -1073,13 +1100,13 @@ _CheckButton::GetPressedTitleTextColor(void) const result _CheckButton::SetHighlightedTitleTextColor(const Color& color) { - return SetProperty("highlightedTitleTextColor", Variant(color)); + return SetProperty(L"highlightedTitleTextColor", Variant(color)); } Color _CheckButton::GetHighlightedTitleTextColor(void) const { - Variant color = GetProperty("highlightedTitleTextColor"); + Variant color = GetProperty(L"highlightedTitleTextColor"); return color.ToColor(); } @@ -1144,16 +1171,16 @@ _CheckButton::SetColor(CheckButtonStatus status, const Color& color) switch (status) { case CHECK_BUTTON_STATUS_NORMAL: - r = SetProperty("normalColor", Variant(color)); + r = SetProperty(L"normalColor", Variant(color)); break; case CHECK_BUTTON_STATUS_DISABLED: - r = SetProperty("disabledColor", Variant(color)); + r = SetProperty(L"disabledColor", Variant(color)); break; case CHECK_BUTTON_STATUS_PRESSED: - r = SetProperty("pressedColor", Variant(color)); + r = SetProperty(L"pressedColor", Variant(color)); break; default: - r = SetProperty("highlightedColor", Variant(color)); + r = SetProperty(L"highlightedColor", Variant(color)); } return r; @@ -1195,16 +1222,16 @@ _CheckButton::GetColor(CheckButtonStatus status) const switch (status) { case CHECK_BUTTON_STATUS_NORMAL: - color = GetProperty("normalColor"); + color = GetProperty(L"normalColor"); break; case CHECK_BUTTON_STATUS_DISABLED: - color = GetProperty("disabledColor"); + color = GetProperty(L"disabledColor"); break; case CHECK_BUTTON_STATUS_PRESSED: - color = GetProperty("pressedColor"); + color = GetProperty(L"pressedColor"); break; default: - color = GetProperty("highlightedColor"); + color = GetProperty(L"highlightedColor"); } return color.ToColor(); @@ -1237,12 +1264,24 @@ _CheckButton::GetPropertyHighlightedColor(void) const int _CheckButton::GetTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_CheckButton::GetTextSizeF(void) const +{ return __textSize; } int _CheckButton::GetTitleTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTitleTextSizeF()); +} + +float +_CheckButton::GetTitleTextSizeF(void) const +{ return __titleTextSize; } @@ -1368,27 +1407,39 @@ _CheckButton::GetOnOffBitmap(void) const } Bitmap* -_CheckButton::GetOnOffSlidingOnBitmap(void) const +_CheckButton::GetOnOffSlidingOnBgBitmap(void) const +{ + return __pOnOffSlidingOnBgBitmap; +} + +Bitmap* +_CheckButton::GetOnOffSlidingOffBgBitmap(void) const +{ + return __pOnOffSlidingOffBgBitmap; +} + +Bitmap* +_CheckButton::GetDimOnOffSlidingOnBgBitmap(void) const { - return __pOnOffSlidingOnBitmap; + return __pDimOnOffSlidingOnBgBitmap; } Bitmap* -_CheckButton::GetOnOffSlidingOffBitmap(void) const +_CheckButton::GetDimOnOffSlidingOffBgBitmap(void) const { - return __pOnOffSlidingOffBitmap; + return __pDimOnOffSlidingOffBgBitmap; } Bitmap* -_CheckButton::GetDimOnOffSlidingOnBitmap(void) const +_CheckButton::GetOnOffSlidingHandlerBitmap(void) const { - return __pDimOnOffSlidingOnBitmap; + return __pOnOffSlidingHandlerBitmap; } Bitmap* -_CheckButton::GetDimOnOffSlidingOffBitmap(void) const +_CheckButton::GetDimOnOffSlidingHandlerBitmap(void) const { - return __pDimOnOffSlidingOffBitmap; + return __pDimOnOffSlidingHandlerBitmap; } Bitmap* diff --git a/src/ui/controls/FUiCtrl_CheckButtonImpl.cpp b/src/ui/controls/FUiCtrl_CheckButtonImpl.cpp index 0b2a415..d020997 100644 --- a/src/ui/controls/FUiCtrl_CheckButtonImpl.cpp +++ b/src/ui/controls/FUiCtrl_CheckButtonImpl.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" @@ -51,6 +53,20 @@ _CheckButtonImpl::CheckButtonSizeInfo::GetDefaultMinimumSize(_ControlOrientation return dimension; } +FloatDimension +_CheckButtonImpl::CheckButtonSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension dimension(0.0f, 0.0f); + + r = GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_SIZE, orientation, dimension); + SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); + + SetLastResult(r); + + return dimension; +} + _CheckButtonImpl* _CheckButtonImpl::GetInstance(CheckButton& checkButton) { @@ -112,6 +128,35 @@ CATCH: return null; } +_CheckButtonImpl* +_CheckButtonImpl::CreateCheckButtonImplN(CheckButton* pControl, const FloatRectangle& bounds) +{ + result r = E_SUCCESS; + r = GET_SIZE_INFO(CheckButton).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The given size is not valid."); + + _CheckButton* pCore = _CheckButton::CreateCheckButtonN(); + SysTryReturn(NID_UI_CTRL, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _CheckButtonImpl* pImpl = new (std::nothrow) _CheckButtonImpl(pControl, pCore); + r = _ControlImpl::CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(CheckButton), bounds, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pCore->AddActionEventListener(*pImpl); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + ClearLastResult(); + + return pImpl; + +CATCH: + delete pImpl; + return null; +} + Color _CheckButtonImpl::GetColorOnError(void) { @@ -664,6 +709,10 @@ protected: r = pCheck->Construct(rect, CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON, backgroundStyle, showTitle, checkText, groupStyle); isRadioStyle = true; } + else if (styleString.Equals(L"CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER", false)) + { + r = pCheck->Construct(rect, CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER, backgroundStyle, showTitle, checkText, groupStyle); + } else { r = pCheck->Construct(rect, CHECK_BUTTON_STYLE_MARK, backgroundStyle, showTitle, checkText, groupStyle); @@ -820,6 +869,30 @@ protected: ConvertStringToColor32(elementString, opacity, color); pCheck->SetColor(CHECK_BUTTON_STATUS_HIGHLIGHTED, color); } + if (pControl->GetElement(L"accessibilityHint1", elementString)) + { + AccessibilityContainer* pContainer = pCheck->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"CheckButtonText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + if (pControl->GetElement(L"accessibilityHint2", elementString)) + { + AccessibilityContainer* pContainer = pCheck->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"MoreButtonText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } #if 0 //-------safety for Minimum size------------------- tempRect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRect(); @@ -959,13 +1032,13 @@ private: _CheckButtonRegister::_CheckButtonRegister() { - _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); - pUiBuilderControlTableManager->RegisterControl(L"CheckButton", _CheckButtonMaker::GetInstance); + _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); + pUiBuilderControlTableManager->RegisterControl(L"CheckButton", _CheckButtonMaker::GetInstance); } _CheckButtonRegister::~_CheckButtonRegister() { - _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); - pUiBuilderControlTableManager->UnregisterControl(L"CheckButton"); + _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); + pUiBuilderControlTableManager->UnregisterControl(L"CheckButton"); } static _CheckButtonRegister CheckButtonRegisterToUiBuilder; }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp b/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp index 4c81869..3dc1e0d 100644 --- a/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp +++ b/src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiAnim_VisualElement.h" @@ -50,13 +51,13 @@ _CheckButtonPresenter::_CheckButtonPresenter(void) , __pTitleTextFont(null) , __pTextObject(null) , __pTitleTextObject(null) - , __titleTextBounds(Rectangle()) - , __textBounds(Rectangle()) - , __defaultButtonBounds(Rectangle()) - , __onOffSlidingButtonBounds(Rectangle()) - , __detailedButtonBounds(Rectangle()) + , __titleTextBounds(FloatRectangle()) + , __textBounds(FloatRectangle()) + , __defaultButtonBounds(FloatRectangle()) + , __onOffSlidingButtonBounds(FloatRectangle()) + , __detailedButtonBounds(FloatRectangle()) , __fontStyle(0) - , __fontSize(0) + , __fontSize(0.0f) , __pCheckAnimationTimer(null) , __ratio(10) { @@ -172,13 +173,22 @@ void _CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, int& size) { style = __fontStyle; + size = _CoordinateSystemUtils::ConvertToInteger(__fontSize); + + return; +} + +void +_CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, float& size) +{ + style = __fontStyle; size = __fontSize; return; } void -_CheckButtonPresenter::SetFontInfo(unsigned long style, int size) +_CheckButtonPresenter::SetFontInfo(unsigned long style, float size) { __fontStyle = style; __fontSize = size; @@ -215,7 +225,7 @@ _CheckButtonPresenter::DrawBackground(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle bounds(0, 0, __pCheckButton->GetBounds().width, __pCheckButton->GetBounds().height); + FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height); CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus(); BackgroundStyle backgroundStyle = __pCheckButton->GetBackgroundStyle(); @@ -234,18 +244,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_NORMAL)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); } } } @@ -265,18 +275,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_DISABLED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); } } } @@ -296,18 +306,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_PRESSED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); } if (pBackgroundPressedEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundPressedEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundPressedEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); } } } @@ -327,18 +337,18 @@ _CheckButtonPresenter::DrawBackground(void) __pCheckButton->GetColor(CHECK_BUTTON_STATUS_HIGHLIGHTED)); if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pReplacementColorBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pReplacementColorBackgroundBitmap); } if (pBackgroundNormalEffectBitmap) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundNormalEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBackgroundNormalEffectBitmap); } } else { if (pBackgroundBitmap) { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBackgroundBitmap); } } } @@ -392,7 +402,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pMarkBgNormalBitmap) { - pCanvas->DrawBitmap(Point(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pMarkBgNormalBitmap); } if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) @@ -402,15 +412,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); } if (pCircleNormalEffectBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCircleNormalEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); } } } @@ -420,7 +430,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pMarkBgPressedBitmap) { - pCanvas->DrawBitmap(Point(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgPressedBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pMarkBgPressedBitmap); } if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON) @@ -430,15 +440,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); } if (pCirclePressedEffectBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCirclePressedEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); } } } @@ -456,15 +466,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); } if (pCircleNormalEffectBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCircleNormalEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); } } } @@ -477,15 +487,15 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pReplacementColorBackgroundBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorBackgroundBitmap); } if (pCirclePressedEffectBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pCirclePressedEffectBitmap); } if (pReplacementColorTextBitmap) { - pCanvas->DrawBitmap(Point(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReplacementColorTextBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y)), *pReplacementColorTextBitmap); } } } @@ -500,7 +510,7 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffBgNormalBitmap) { - pCanvas->DrawBitmap(Point(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBgNormalBitmap); } } else if (checkStatus == CHECK_BUTTON_STATUS_PRESSED) @@ -509,34 +519,79 @@ _CheckButtonPresenter::DrawCheckBitmap(void) if (pOnOffBgPressedBitmap) { - pCanvas->DrawBitmap(Point(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgPressedBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBgPressedBitmap); } } if (__pCheckButton->IsSelected() && pOnOffBitmap) { - pCanvas->DrawBitmap(Point(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y)), *pOnOffBitmap); } } - else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING) + else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { + float handlerMargin = 0.0f; + float handlerWidth = 0.0f; + + GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, handlerMargin); + GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth); + if (__pCheckButton->IsSelected()) { - Bitmap* pOnOffSlidingOnBitmap = __pCheckButton->GetOnOffSlidingOnBitmap(); + Bitmap* pOnOffSlidingOnBitmap = __pCheckButton->GetOnOffSlidingOnBgBitmap(); + Bitmap* pOnOffSlidingHandlerBitmap = __pCheckButton->GetOnOffSlidingHandlerBitmap(); if (pOnOffSlidingOnBitmap) { - pCanvas->DrawBitmap(Point(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingOnBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y)), *pOnOffSlidingOnBitmap); + } + + if (pOnOffSlidingHandlerBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerMargin - handlerWidth, + __onOffSlidingButtonBounds.y - handlerMargin)), *pOnOffSlidingHandlerBitmap); } } else { - Bitmap* pOnOffSlidingOffBitmap = __pCheckButton->GetOnOffSlidingOffBitmap(); + Bitmap* pOnOffSlidingOffBitmap = __pCheckButton->GetOnOffSlidingOffBgBitmap(); + Bitmap* pOnOffSlidingHandlerBitmap = __pCheckButton->GetOnOffSlidingHandlerBitmap(); if (pOnOffSlidingOffBitmap) { - pCanvas->DrawBitmap(Point(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingOffBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y)), *pOnOffSlidingOffBitmap); + } + + if (pOnOffSlidingHandlerBitmap) + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x + handlerMargin, __onOffSlidingButtonBounds.y - handlerMargin)), *pOnOffSlidingHandlerBitmap); + } + } + + Bitmap* pDivider = null; + float dividerWidth = 0.0f; + float dividerTopMargin = 0.0f; + float dividerRightMargin = 0.0f; + + GET_BITMAP_CONFIG_N(HEADER::DIVIDER_LINE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDivider); + GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth); + GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin); + GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin); + + + if (pDivider && checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + if (pDivider->IsNinePatchedBitmap()) + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(__onOffSlidingButtonBounds.x - dividerRightMargin, dividerTopMargin, + dividerWidth, __pCheckButton->GetBoundsF().height - dividerTopMargin * 2)), *pDivider); + } + else + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin, dividerTopMargin)), *pDivider); } + + delete pDivider; } } @@ -568,11 +623,11 @@ _CheckButtonPresenter::DrawText(void) return; } - __pTextObject->RemoveAll(); + __pTextObject->RemoveAll(true); pSimpleText = new (std::nothrow) TextSimple(const_cast(__pCheckButton->GetText().GetPointer()), __pCheckButton->GetText().GetLength()); __pTextObject->AppendElement(*pSimpleText); - __pTitleTextObject->RemoveAll(); + __pTitleTextObject->RemoveAll(true); pSimpleTitleText = new (std::nothrow) TextSimple(const_cast(__pCheckButton->GetTitleText().GetPointer()), __pCheckButton->GetTitleText().GetLength()); __pTitleTextObject->AppendElement(*pSimpleTitleText); @@ -602,12 +657,12 @@ _CheckButtonPresenter::DrawText(void) __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - __pTextObject->SetBounds(GetTextBounds()); + __pTextObject->SetBounds(GetTextBoundsF()); __pTextObject->Compose(); __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - __pTitleTextObject->SetBounds(GetTitleTextBounds()); + __pTitleTextObject->SetBounds(GetTitleTextBoundsF()); __pTitleTextObject->Compose(); switch (__pCheckButton->GetTextHorizontalAlignment()) @@ -634,7 +689,7 @@ _CheckButtonPresenter::DrawText(void) verticalAlign = TEXT_OBJECT_ALIGNMENT_BOTTOM; } - __fontSize = __pCheckButton->GetTextSize(); + __fontSize = __pCheckButton->GetTextSizeF(); __pTextFont = __pCheckButton->GetFallbackFont(); r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, __pTextFont, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -643,7 +698,7 @@ _CheckButtonPresenter::DrawText(void) __pTextObject->SetFont(__pTextFont, 0, __pTextObject->GetTextLength()); __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); - __fontSize = __pCheckButton->GetTitleTextSize(); + __fontSize = __pCheckButton->GetTitleTextSizeF(); __pTitleTextFont = __pCheckButton->GetFallbackFont(); r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, __pTitleTextFont, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -686,11 +741,15 @@ _CheckButtonPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& bool _CheckButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - int checkButtonLeftMargin = 0; - int checkButtonDetailedBitmapWidth = 0; + float checkButtonLeftMargin = 0.0f; + float checkButtonDetailedBitmapWidth = 0.0f; + float checkButtonOnOffSlidingBitmapWidth = 0.0f; + float dividerRightMargin = 0.0f; GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin); GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth); + GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth); + GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin); if (&source != __pCheckButton) { @@ -714,25 +773,45 @@ _CheckButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) { StartCheckAnimationTimer(); - __ratio = 0; - } + __ratio = 0; + } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - touchPoint.x += source.GetClientBounds().x; - touchPoint.y += source.GetClientBounds().y; + touchPoint.x += source.GetClientBoundsF().x; + touchPoint.y += source.GetClientBoundsF().y; + + FloatRectangle bounds = __pCheckButton->GetClientBoundsF(); + FloatRectangle detailedBounds = __pCheckButton->GetClientBoundsF(); - Rectangle bounds = __pCheckButton->GetClientBounds(); - Rectangle detailedBounds = __pCheckButton->GetClientBounds(); - detailedBounds.width = detailedBounds.width - checkButtonLeftMargin - checkButtonDetailedBitmapWidth; __pCheckButton->SetCheckButtonStatus(CHECK_BUTTON_STATUS_NORMAL); __pCheckButton->Invalidate(); if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) { + detailedBounds.width = detailedBounds.width - checkButtonLeftMargin - checkButtonDetailedBitmapWidth; + if (detailedBounds.Contains(touchPoint)) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + + __pCheckButton->FireActionEvent(); + + if (__pCheckButton->GetRadioGroup() != null) + { + __pCheckButton->SendTouchReleasedEvent(*__pCheckButton); + } + } + } + else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + detailedBounds.width = detailedBounds.width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth - dividerRightMargin; + + if (!detailedBounds.Contains(touchPoint)) + { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + __pCheckButton->FireActionEvent(); if (__pCheckButton->GetRadioGroup() != null) @@ -745,6 +824,8 @@ _CheckButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& { if (bounds.Contains(touchPoint)) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + __pCheckButton->FireActionEvent(); if (__pCheckButton->GetRadioGroup() != null) @@ -770,12 +851,12 @@ _CheckButtonPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to return true; } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); - touchPoint.x += source.GetClientBounds().x; - touchPoint.y += source.GetClientBounds().y; + touchPoint.x += source.GetClientBoundsF().x; + touchPoint.y += source.GetClientBoundsF().y; - Rectangle bounds = __pCheckButton->GetClientBounds(); + FloatRectangle bounds = __pCheckButton->GetClientBoundsF(); bool isInCheckButtonArea = bounds.Contains(touchPoint); if (isInCheckButtonArea && (__touchMoveHandled != true)) @@ -840,30 +921,30 @@ _CheckButtonPresenter::IsEnabledStateChanged(void) result _CheckButtonPresenter::CalculateTitleTextBounds(void) { - int checkButtonLeftMargin = 0; - int checkButtonTopMargin = 0; - int checkButtonBitmapWidth = 0; - int checkButtonOnOffSlidingBitmappWidth = 0; - int checkButtonDetailedBitmapWidth = 0; - int checkButtonTitleTextHeight = 0; - int checkButtonTextHeight = 0; + float checkButtonLeftMargin = 0.0f; + float checkButtonTopMargin = 0.0f; + float checkButtonBitmapWidth = 0.0f; + float checkButtonOnOffSlidingBitmapWidth = 0.0f; + float checkButtonDetailedBitmapWidth = 0.0f; + float checkButtonTitleTextHeight = 0.0f; + float checkButtonTextHeight = 0.0f; GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin); GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin); GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth); - GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmappWidth); + GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth); GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth); GET_SHAPE_CONFIG(CHECKBUTTON::TITLE_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTitleTextHeight); GET_SHAPE_CONFIG(CHECKBUTTON::TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTextHeight); CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle(); - if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING) + if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { __titleTextBounds.x = checkButtonLeftMargin; __titleTextBounds.y = checkButtonTopMargin; - __titleTextBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmappWidth; - __titleTextBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - __textBounds.height; + __titleTextBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth; + __titleTextBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - __textBounds.height; } else { @@ -871,15 +952,15 @@ _CheckButtonPresenter::CalculateTitleTextBounds(void) { __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __titleTextBounds.y = checkButtonTopMargin; - __titleTextBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; - __titleTextBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - __textBounds.height; + __titleTextBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; + __titleTextBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - __textBounds.height; } else { __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __titleTextBounds.y = checkButtonTopMargin; - __titleTextBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; - __titleTextBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - __textBounds.height; + __titleTextBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; + __titleTextBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - __textBounds.height; } } @@ -889,13 +970,13 @@ _CheckButtonPresenter::CalculateTitleTextBounds(void) result _CheckButtonPresenter::CalculateTextBounds(void) { - int checkButtonLeftMargin = 0; - int checkButtonTopMargin = 0; - int checkButtonBitmapWidth = 0; - int checkButtonOnOffSlidingBitmapWidth = 0; - int checkButtonDetailedBitmapWidth = 0; - int checkButtonTitleTextHeight = 0; - int checkButtonTextHeight = 0; + float checkButtonLeftMargin = 0.0f; + float checkButtonTopMargin = 0.0f; + float checkButtonBitmapWidth = 0.0f; + float checkButtonOnOffSlidingBitmapWidth = 0.0f; + float checkButtonDetailedBitmapWidth = 0.0f; + float checkButtonTitleTextHeight = 0.0f; + float checkButtonTextHeight = 0.0f; GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin); GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin); @@ -908,21 +989,21 @@ _CheckButtonPresenter::CalculateTextBounds(void) CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle(); bool showTitle = __pCheckButton->GetShowTitle(); - if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING) + if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { if (showTitle) { __textBounds.x = checkButtonLeftMargin; __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; } else { __textBounds.x = checkButtonLeftMargin; __textBounds.y = checkButtonTopMargin; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2; } } else @@ -933,15 +1014,15 @@ _CheckButtonPresenter::CalculateTextBounds(void) { __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; } else { __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __textBounds.y = checkButtonTopMargin; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2; } } else @@ -950,15 +1031,15 @@ _CheckButtonPresenter::CalculateTextBounds(void) { __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight; } else { __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth; __textBounds.y = checkButtonTopMargin; - __textBounds.width = __pCheckButton->GetBounds().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; - __textBounds.height = __pCheckButton->GetBounds().height - checkButtonTopMargin * 2; + __textBounds.width = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth; + __textBounds.height = __pCheckButton->GetBoundsF().height - checkButtonTopMargin * 2; } } } @@ -969,13 +1050,13 @@ _CheckButtonPresenter::CalculateTextBounds(void) result _CheckButtonPresenter::CalculateButtonBounds(void) { - int checkButtonLeftMargin = 0; - int checkButtonBitmapWidth = 0; - int checkButtonBitmapHeight = 0; - int checkButtonOnOffSlidingBitmapWidth = 0; - int checkButtonOnOffSlidingBitmapHeight = 0; - int checkButtonDetaieldBitmapWidth = 0; - int checkButtonDetaieldBitmapHeight = 0; + float checkButtonLeftMargin = 0.0f; + float checkButtonBitmapWidth = 0.0f; + float checkButtonBitmapHeight = 0.0f; + float checkButtonOnOffSlidingBitmapWidth = 0.0f; + float checkButtonOnOffSlidingBitmapHeight = 0.0f; + float checkButtonDetaieldBitmapWidth = 0.0f; + float checkButtonDetaieldBitmapHeight = 0.0f; GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin); GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth); @@ -986,47 +1067,49 @@ _CheckButtonPresenter::CalculateButtonBounds(void) GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetaieldBitmapHeight); __defaultButtonBounds.x = checkButtonLeftMargin; - __defaultButtonBounds.y = (__pCheckButton->GetBounds().height - checkButtonBitmapHeight) / 2; + __defaultButtonBounds.y = (__pCheckButton->GetBoundsF().height - checkButtonBitmapHeight) / 2; __defaultButtonBounds.width = checkButtonBitmapWidth; __defaultButtonBounds.height = checkButtonBitmapHeight; - __onOffSlidingButtonBounds.x = __pCheckButton->GetBounds().width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth; - __onOffSlidingButtonBounds.y = (__pCheckButton->GetBounds().height - checkButtonOnOffSlidingBitmapHeight) / 2; + __onOffSlidingButtonBounds.x = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth; + __onOffSlidingButtonBounds.y = (__pCheckButton->GetBoundsF().height - checkButtonOnOffSlidingBitmapHeight) / 2; __onOffSlidingButtonBounds.width = checkButtonOnOffSlidingBitmapWidth; __onOffSlidingButtonBounds.height = checkButtonOnOffSlidingBitmapHeight; - __detailedButtonBounds.x = __pCheckButton->GetBounds().width - checkButtonLeftMargin - checkButtonDetaieldBitmapWidth; - __detailedButtonBounds.y = (__pCheckButton->GetBounds().height - checkButtonDetaieldBitmapHeight) / 2; + __detailedButtonBounds.x = __pCheckButton->GetBoundsF().width - checkButtonLeftMargin - checkButtonDetaieldBitmapWidth; + __detailedButtonBounds.y = (__pCheckButton->GetBoundsF().height - checkButtonDetaieldBitmapHeight) / 2; __detailedButtonBounds.width = checkButtonDetaieldBitmapWidth; __detailedButtonBounds.height = checkButtonDetaieldBitmapHeight; return E_SUCCESS; } -Rectangle -_CheckButtonPresenter::GetTitleTextBounds(void) const +FloatRectangle +_CheckButtonPresenter::GetTitleTextBoundsF(void) const { return __titleTextBounds; } -Rectangle -_CheckButtonPresenter::GetTextBounds(void) const +FloatRectangle +_CheckButtonPresenter::GetTextBoundsF(void) const { return __textBounds; } -Rectangle -_CheckButtonPresenter::GetDefaultButtonBounds(void) const +FloatRectangle +_CheckButtonPresenter::GetDefaultButtonBoundsF(void) const { return __defaultButtonBounds; } -Rectangle -_CheckButtonPresenter::GetOnOffSlidingButtonBounds(void) const + +FloatRectangle +_CheckButtonPresenter::GetOnOffSlidingButtonBoundsF(void) const { return __onOffSlidingButtonBounds; } -Rectangle -_CheckButtonPresenter::GetDetailedButtonBounds(void) const + +FloatRectangle +_CheckButtonPresenter::GetDetailedButtonBoundsF(void) const { return __detailedButtonBounds; } @@ -1097,23 +1180,23 @@ _CheckButtonPresenter::DrawMarkAnimation(void) } Bitmap* pMarkBitmap = __pCheckButton->GetMarkBitmap(); - //CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle(); + //CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle(); - //if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON + //if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON // || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON) { if (__pCheckButton->IsSelected() && pMarkBitmap) { - Rectangle sourceRect(0, 0, pMarkBitmap->GetWidth() * __ratio * 0.1, pMarkBitmap->GetHeight()); - Rectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkBitmap->GetWidth() * __ratio * 0.1, pMarkBitmap->GetHeight()); + FloatRectangle sourceRect(0.0f, 0.0f, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); + FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkBitmap->GetWidthF() * __ratio * 0.1, pMarkBitmap->GetHeightF()); - pCanvas->DrawBitmap(destRect, *pMarkBitmap, sourceRect); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(destRect), *pMarkBitmap, _CoordinateSystemUtils::ConvertToInteger(sourceRect)); } } delete pCanvas; return; - } +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ColorChangeEvent.cpp b/src/ui/controls/FUiCtrl_ColorChangeEvent.cpp index bf1f083..20627d8 100644 --- a/src/ui/controls/FUiCtrl_ColorChangeEvent.cpp +++ b/src/ui/controls/FUiCtrl_ColorChangeEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorChangeEvent.cpp * @brief This is the implementation for the _ColorChangeEvent class. diff --git a/src/ui/controls/FUiCtrl_ColorPicker.cpp b/src/ui/controls/FUiCtrl_ColorPicker.cpp old mode 100644 new mode 100755 index 096612c..5f765cb --- a/src/ui/controls/FUiCtrl_ColorPicker.cpp +++ b/src/ui/controls/FUiCtrl_ColorPicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPicker.cpp * @brief This file contains implementation of _ColorPicker class @@ -31,6 +32,7 @@ #include "FUi_AccessibilityElement.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Runtime; @@ -49,12 +51,6 @@ _ColorPicker::_ColorPicker(void) , __pHueHandler(null) , __pSaturationHandler(null) , __pLuminanceHandler(null) - , __pDecreaseHueButtonElement(null) - , __pIncreaseHueButtonElement(null) - , __pDecreaseSaturationButtonElement(null) - , __pIncreaseSaturationButtonElement(null) - , __pDecreaseLuminanceButtonElement(null) - , __pIncreaseLuminanceButtonElement(null) , __pHueBarElement(null) , __pSaturationBarElement(null) , __pLuminanceBarElement(null) @@ -87,36 +83,6 @@ _ColorPicker::~_ColorPicker(void) __pLuminanceHandler = null; } - if (__pDecreaseHueButtonElement) - { - __pDecreaseHueButtonElement->Activate(false); - __pDecreaseHueButtonElement = null; - } - if (__pIncreaseHueButtonElement) - { - __pIncreaseHueButtonElement->Activate(false); - __pIncreaseHueButtonElement = null; - } - if (__pDecreaseSaturationButtonElement) - { - __pDecreaseSaturationButtonElement->Activate(false); - __pDecreaseSaturationButtonElement = null; - } - if (__pIncreaseSaturationButtonElement) - { - __pIncreaseSaturationButtonElement->Activate(false); - __pIncreaseSaturationButtonElement = null; - } - if (__pDecreaseLuminanceButtonElement) - { - __pDecreaseLuminanceButtonElement->Activate(false); - __pDecreaseLuminanceButtonElement = null; - } - if (__pIncreaseLuminanceButtonElement) - { - __pIncreaseLuminanceButtonElement->Activate(false); - __pIncreaseLuminanceButtonElement = null; - } if (__pHueBarElement) { __pHueBarElement->Activate(false); @@ -349,7 +315,7 @@ _ColorPicker::OnAttachedToMainTree(void) { InitializeAccessibilityElement(); - __pColorPickerPresenter->LoadDrawingProperties(GetBounds()); + __pColorPickerPresenter->LoadDrawingProperties(GetBoundsF()); _VisualElement* pBase = GetVisualElement(); @@ -362,7 +328,7 @@ _ColorPicker::OnAttachedToMainTree(void) } SysTryReturnResult(NID_UI_CTRL, (__pHueHandler != null), E_SYSTEM, - "A system error has occurred. Failed to create hue handler."); + "A system error has occurred. Failed to create hue handler."); handlerType = SAT_HANDLER; @@ -372,7 +338,7 @@ _ColorPicker::OnAttachedToMainTree(void) } SysTryReturnResult(NID_UI_CTRL, (__pSaturationHandler != null), E_SYSTEM, - "A system error has occurred. Failed to create saturation handler."); + "A system error has occurred. Failed to create saturation handler."); handlerType = LUM_HANDLER; @@ -382,7 +348,7 @@ _ColorPicker::OnAttachedToMainTree(void) } SysTryReturnResult(NID_UI_CTRL, (__pLuminanceHandler != null), E_SYSTEM, - "A system error has occurred. Failed to create luminance handler."); + "A system error has occurred. Failed to create luminance handler."); return E_SUCCESS; } @@ -396,16 +362,16 @@ _ColorPicker::InitializeAccessibilityElement(void) } _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if (pContainer != null) - { - __pDecreaseHueButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseHueButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pDecreaseHueButtonElement->SetLabel(L"Decrease Hue value"); - __pDecreaseHueButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); + _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + FloatRectangle floatBounds = GetClientBoundsF(); + int blockHeight = 0; - pContainer->AddElement(*__pDecreaseHueButtonElement); + GET_SHAPE_CONFIG(COLORPICKER::BLOCK_HEIGHT, orientation, blockHeight); + Rectangle bounds = _CoordinateSystemUtils::ConvertToInteger(floatBounds); + bounds.height = blockHeight; + if (pContainer != null) + { __pHueBarElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, __pHueBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -414,71 +380,39 @@ _ColorPicker::InitializeAccessibilityElement(void) __pHueBarElement->SetLabel("Hue Slider"); __pHueBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); __pHueBarElement->SetHint(hintText); + __pHueBarElement->SetBounds(bounds); pContainer->AddElement(*__pHueBarElement); String hueValue; hueValue.Append(__pColorPickerPresenter->GetHue()); __pHueBarElement->SetValue(hueValue); - __pIncreaseHueButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseHueButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pIncreaseHueButtonElement->SetLabel(L"Increase Hue value"); - __pIncreaseHueButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pIncreaseHueButtonElement); - - __pDecreaseSaturationButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseSaturationButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pDecreaseSaturationButtonElement->SetLabel(L"Decrease Saturation value"); - __pDecreaseSaturationButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pDecreaseSaturationButtonElement); - __pSaturationBarElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, __pSaturationBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); __pSaturationBarElement->SetLabel("Saturation Slider"); __pSaturationBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); __pSaturationBarElement->SetHint(hintText); + __pSaturationBarElement->SetBounds(Rectangle(bounds.x, bounds.y + blockHeight, bounds.width, blockHeight)); pContainer->AddElement(*__pSaturationBarElement); String saturationValue; saturationValue.Append(__pColorPickerPresenter->GetSaturation()); __pSaturationBarElement->SetValue(saturationValue); - __pIncreaseSaturationButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseSaturationButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pIncreaseSaturationButtonElement->SetLabel(L"Increase Saturation value"); - __pIncreaseSaturationButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pIncreaseSaturationButtonElement); - - __pDecreaseLuminanceButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pDecreaseLuminanceButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pDecreaseLuminanceButtonElement->SetLabel(L"Decrease Luminance value"); - __pDecreaseLuminanceButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pDecreaseLuminanceButtonElement); - __pLuminanceBarElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, __pLuminanceBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); __pLuminanceBarElement->SetLabel("Luminance Slider"); __pLuminanceBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); __pLuminanceBarElement->SetHint(hintText); + __pLuminanceBarElement->SetBounds(Rectangle(bounds.x, bounds.y + 2 * blockHeight, bounds.width, blockHeight)); pContainer->AddElement(*__pLuminanceBarElement); String luminanceValue; luminanceValue.Append(__pColorPickerPresenter->GetLuminance()); __pLuminanceBarElement->SetValue(luminanceValue); - __pIncreaseLuminanceButtonElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pIncreaseLuminanceButtonElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pIncreaseLuminanceButtonElement->SetLabel(L"Increase Luminance value"); - __pIncreaseLuminanceButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pIncreaseLuminanceButtonElement); - pContainer->AddListener(*this); } return; @@ -487,7 +421,7 @@ _ColorPicker::InitializeAccessibilityElement(void) void _ColorPicker::OnBoundsChanged(void) { - __pColorPickerPresenter->LoadDrawingProperties(GetBounds()); + __pColorPickerPresenter->LoadDrawingProperties(GetBoundsF()); return; } @@ -532,7 +466,7 @@ _ColorPicker::FireColorChangeEvent(const Color& color) { IEventArg* pEventArg = _ColorChangeEvent::CreateColorChangeEventArgN(color); result r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, (pEventArg != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, (pEventArg != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); __pColorChangeEvent->Fire(*pEventArg); @@ -578,24 +512,6 @@ _ColorPicker::GetAccessibilityElement(int elementId) case LUM_BAR: pAccessibilityElement = __pLuminanceBarElement; break; - case HUE_ARROWLEFT: - pAccessibilityElement = __pDecreaseHueButtonElement; - break; - case HUE_ARROWRIGHT: - pAccessibilityElement = __pIncreaseHueButtonElement; - break; - case SAT_ARROWLEFT: - pAccessibilityElement = __pDecreaseSaturationButtonElement; - break; - case SAT_ARROWRIGHT: - pAccessibilityElement = __pIncreaseSaturationButtonElement; - break; - case LUM_ARROWLEFT: - pAccessibilityElement = __pDecreaseLuminanceButtonElement; - break; - case LUM_ARROWRIGHT: - pAccessibilityElement = __pIncreaseLuminanceButtonElement; - break; } return pAccessibilityElement; @@ -621,21 +537,22 @@ _ColorPicker::OnAccessibilityValueIncreased(const _AccessibilityContainer& contr if (elementLabel.Equals(L"Hue Slider", false)) { SetHue(GetHue() + 1); - string.Append(GetHue() + 1); + string.Append(GetHue()); } else if (elementLabel.Equals(L"Saturation Slider", false)) { SetSaturation(GetSaturation() + 1); - string.Append(GetSaturation() + 1); + string.Append(GetSaturation()); } else if (elementLabel.Equals(L"Luminance Slider", false)) { SetLuminance(GetLuminance() + 1); - string.Append(GetLuminance() + 1); + string.Append(GetLuminance()); } Invalidate(); _AccessibilityManager::GetInstance()->ReadContent(string); + FireColorChangeEvent(GetColor()); return true; } @@ -649,22 +566,24 @@ _ColorPicker::OnAccessibilityValueDecreased(const _AccessibilityContainer& contr if (elementLabel.Equals(L"Hue Slider", false)) { SetHue(GetHue() - 1); - string.Append(GetHue() - 1); + string.Append(GetHue()); } else if (elementLabel.Equals(L"Saturation Slider", false)) { SetSaturation(GetSaturation() - 1); - string.Append(GetSaturation() - 1); + string.Append(GetSaturation()); } else if (elementLabel.Equals(L"Luminance Slider", false)) { SetLuminance(GetLuminance() - 1); - string.Append(GetLuminance() - 1); + string.Append(GetLuminance()); } Invalidate(); _AccessibilityManager::GetInstance()->ReadContent(string); + FireColorChangeEvent(GetColor()); + return true; } diff --git a/src/ui/controls/FUiCtrl_ColorPickerImpl.cpp b/src/ui/controls/FUiCtrl_ColorPickerImpl.cpp index cecfae1..da516ed 100644 --- a/src/ui/controls/FUiCtrl_ColorPickerImpl.cpp +++ b/src/ui/controls/FUiCtrl_ColorPickerImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerImpl.cpp * @brief This file contains implementation of _ColorPickerImpl class @@ -293,8 +294,8 @@ protected: result r = E_SUCCESS; _UiBuilderControlLayout* pControlProperty = null; ColorPicker* pColorPicker = null; - Point point; - Rectangle rect; + FloatPoint point; + FloatRectangle rect; GetProperty(pControl, &pControlProperty); SysTryReturn(NID_UI_CTRL, (pControlProperty != null), null, E_SYSTEM, @@ -304,7 +305,7 @@ protected: SysTryReturn(NID_UI_CTRL, (pColorPicker != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); point.x = rect.x; point.y = rect.y; diff --git a/src/ui/controls/FUiCtrl_ColorPickerModel.cpp b/src/ui/controls/FUiCtrl_ColorPickerModel.cpp index d32d461..0ff88d0 100644 --- a/src/ui/controls/FUiCtrl_ColorPickerModel.cpp +++ b/src/ui/controls/FUiCtrl_ColorPickerModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerModel.cpp * @brief This file contains implementation of _ColorPickerModel class @@ -89,7 +90,7 @@ _ColorPickerModel::SetHue(double hueValue) { if (hueValue > MAX_HUE_VALUE) { - __hue = MAX_HUE_VALUE; + __hue = MAX_VALUE; } else if (hueValue < MIN_VALUE) { @@ -100,6 +101,8 @@ _ColorPickerModel::SetHue(double hueValue) __hue = hueValue; } CalulateColor(); + + return; } void @@ -118,6 +121,8 @@ _ColorPickerModel::SetSaturation(double saturationValue) __sat = saturationValue; } CalulateColor(); + + return; } void @@ -136,6 +141,8 @@ _ColorPickerModel::SetLuminance(double luminanceValue) __lum = luminanceValue; } CalulateColor(); + + return; } Color @@ -170,17 +177,25 @@ _ColorPickerModel::SetColor(const Color& color) __color = color; ConvertRGBToHSL(__color, __hue, __sat, __lum); + + return; } void _ColorPickerModel::CalulateColor(void) { ConvertHSLToRGB(__hue, __sat, __lum, __color); + + return; } void _ColorPickerModel::ConvertRGBToHSL(const Color& color, double& h, double& s, double& l) { + h = 0.0; + s = 0.0; + l = 0.0; + double normalizeR = (double)color.GetRed() / MAX_COLOR_DEGREE; double normalizeG = (double)color.GetGreen() / MAX_COLOR_DEGREE; double normalizeB = (double)color.GetBlue() / MAX_COLOR_DEGREE; @@ -189,12 +204,14 @@ _ColorPickerModel::ConvertRGBToHSL(const Color& color, double& h, double& s, dou double min = (normalizeR > normalizeG) ? ((normalizeG > normalizeB) ? normalizeB : normalizeG) : ((normalizeR > normalizeB) ? normalizeB : normalizeR); double diff = max - min; + + l = (min + max) / 2.0; + if (diff <= 0.0) { return; } - l = (min + max) / 2.0; s = diff / ((l <= STANDARD_LUMINANCE_VALUE) ? (max + min) : (2.0 - max - min)); if (normalizeR >= max) @@ -232,6 +249,8 @@ _ColorPickerModel::ConvertRGBToHSL(const Color& color, double& h, double& s, dou } h /= 6.0; + + return; } void @@ -249,6 +268,11 @@ _ColorPickerModel::ConvertHSLToRGB(double h, double s, double l, Color& color) v = (l <= STANDARD_LUMINANCE_VALUE) ? (l + l * s) : (l + s - l * s); + if (h > MAX_HUE_VALUE) + { + h = MAX_HUE_VALUE; + } + if (v > 0) { double m = l + l - v; @@ -311,6 +335,8 @@ _ColorPickerModel::ConvertHSLToRGB(double h, double s, double l, Color& color) (byte)(normalizeG * MAX_COLOR_DEGREE), // green (byte)(normalizeB * MAX_COLOR_DEGREE), // blue (byte)(MAX_COLOR_DEGREE)); // alpha + + return; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ColorPickerPresenter.cpp b/src/ui/controls/FUiCtrl_ColorPickerPresenter.cpp index 83efe2c..96451a6 100644 --- a/src/ui/controls/FUiCtrl_ColorPickerPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ColorPickerPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerPresenter.cpp * @brief This is the implementation file for the FUiCtrl_ColorPickerPresenter class. @@ -29,12 +30,14 @@ #include "FUi_AccessibilityElement.h" #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Ui; using namespace Tizen::Ui::Animations; +using namespace Tizen::Base::Utility; const int ARROW_MOVE_STEP = 5; const int SLIDE_ACTIVATION_TIME = 500; @@ -62,11 +65,11 @@ _ColorPickerPresenter::_ColorPickerPresenter(_ColorPicker& colorPicker) : __pColorPicker(&colorPicker) , __pColorPickerModel(null) , __eventType(HSL_NOT) - , __topMargin(0) - , __blockMargin(0) - , __blockHeight(0) - , __dividerMargin(0) - , __dividerWidth(0) + , __topMargin(0.0f) + , __blockMargin(0.0f) + , __blockHeight(0.0f) + , __dividerMargin(0.0f) + , __dividerWidth(0.0f) , __hueColor(0) , __saturationColor(0) , __pSlideTimer(null) @@ -77,9 +80,9 @@ _ColorPickerPresenter::_ColorPickerPresenter(_ColorPicker& colorPicker) , __pColorNormalReplacementBgBitmap(null) , __pColorPressedReplacementBgBitmap(null) , __pColorDisabledReplacementBgBitmap(null) - , __pColorNormalEffectReplacementBgBitmap(null) - , __pColorPressedEffectReplacementBgBitmap(null) - , __pColorDisabledEffectReplacementBgBitmap(null) + , __pNormalEffectBgBitmap(null) + , __pPressedEffectBgBitmap(null) + , __pDisabledEffectBgBitmap(null) , __pLeftArrowNormalBitmap(null) , __pLeftArrowPressedBitmap(null) , __pLeftArrowDisabledBitmap(null) @@ -129,14 +132,14 @@ _ColorPickerPresenter::~_ColorPickerPresenter(void) delete __pColorDisabledReplacementBgBitmap; __pColorDisabledReplacementBgBitmap = null; - delete __pColorNormalEffectReplacementBgBitmap; - __pColorNormalEffectReplacementBgBitmap = null; + delete __pNormalEffectBgBitmap; + __pNormalEffectBgBitmap = null; - delete __pColorPressedEffectReplacementBgBitmap; - __pColorPressedEffectReplacementBgBitmap = null; + delete __pPressedEffectBgBitmap; + __pPressedEffectBgBitmap = null; - delete __pColorDisabledEffectReplacementBgBitmap; - __pColorDisabledEffectReplacementBgBitmap = null; + delete __pDisabledEffectBgBitmap; + __pDisabledEffectBgBitmap = null; delete __pLeftArrowNormalBitmap; __pLeftArrowNormalBitmap = null; @@ -177,7 +180,7 @@ _ColorPickerPresenter::CreateInstanceN(_ColorPicker& colorPicker) { _ColorPickerPresenter* pColorPickerPresenter = new (std::nothrow) _ColorPickerPresenter(colorPicker); SysTryReturn(NID_UI_CTRL, (pColorPickerPresenter != null), null, E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] Memory allocation failed."); + "[E_OUT_OF_MEMORY] Memory allocation failed."); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -185,15 +188,16 @@ _ColorPickerPresenter::CreateInstanceN(_ColorPicker& colorPicker) pColorPickerPresenter->__pColorPickerModel = _ColorPickerModel::CreateInstanceN(); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, (pColorPickerPresenter->__pColorPickerModel != null), , r, - "[%s] Propagating.", GetErrorMessage(r)); - - r = pColorPickerPresenter->LoadResource(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to load the ColorPicker resources."); + "[%s] Propagating.", GetErrorMessage(r)); + // Set initial value. pColorPickerPresenter->__pColorPickerModel->SetHue(MIN_VALUE); pColorPickerPresenter->__pColorPickerModel->SetSaturation(MAX_VALUE); pColorPickerPresenter->__pColorPickerModel->SetLuminance(MIN_VALUE); + r = pColorPickerPresenter->LoadResource(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to load the ColorPicker resources."); + return pColorPickerPresenter; CATCH: delete pColorPickerPresenter; @@ -204,15 +208,15 @@ _VisualElement* _ColorPickerPresenter::CreateHandlerN(_VisualElement& rootElement, _ColorPickerComponentType handlerType) { Canvas* pCanvas = null; - int handlerWidth = 0; - int handlerHeight = 0; + float handlerWidth = 0.0f; + float handlerHeight = 0.0f; result r = E_SUCCESS; - Rectangle handlerBounds = __componentBounds[handlerType]; - Rectangle bounds = __pColorPicker->GetClientBounds(); + FloatRectangle handlerBounds = __componentBounds[handlerType]; + FloatRectangle bounds = __pColorPicker->GetClientBoundsF(); _VisualElement* pHandler = new (std::nothrow) _VisualElement; SysTryReturn(NID_UI_CTRL, (pHandler != null), null, E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] Memory allocation failed."); + "[E_OUT_OF_MEMORY] Memory allocation failed."); r = pHandler->Construct(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -238,7 +242,7 @@ _ColorPickerPresenter::CreateHandlerN(_VisualElement& rootElement, _ColorPickerC pCanvas->SetBackgroundColor(Color()); pCanvas->Clear(); - DrawResourceBitmap(*pCanvas, Rectangle(0, 0, handlerWidth, handlerHeight), __pHandlerBitmap); + DrawResourceBitmap(*pCanvas, FloatRectangle(0, 0, handlerWidth, handlerHeight), __pHandlerBitmap); delete pCanvas; @@ -288,19 +292,22 @@ _ColorPickerPresenter::GetColor(void) const int _ColorPickerPresenter::GetHue(void) const { - return __pColorPickerModel->GetHue() * MAX_VALUE_DEGREE; + int hueValue = Math::Round((double) __pColorPickerModel->GetHue() * MAX_VALUE_DEGREE); + return hueValue; } int _ColorPickerPresenter::GetSaturation(void) const { - return __pColorPickerModel->GetSaturation() * MAX_VALUE_DEGREE; + int saturationValue = Math::Round((double) __pColorPickerModel->GetSaturation() * MAX_VALUE_DEGREE); + return saturationValue; } int _ColorPickerPresenter::GetLuminance(void) const { - return __pColorPickerModel->GetLuminance() * MAX_VALUE_DEGREE; + int luminanceValue = Math::Round((double) __pColorPickerModel->GetLuminance() * MAX_VALUE_DEGREE); + return luminanceValue; } void @@ -330,7 +337,7 @@ result _ColorPickerPresenter::SetSaturation(int saturation) { SysTryReturn(NID_UI_CTRL, (saturation <= MAX_VALUE_DEGREE && saturation >= 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument(s) is used. Saturation value is invalid."); + "[E_INVALID_ARG] Invalid argument(s) is used. Saturation value is invalid."); __pColorPickerModel->SetSaturation((double)saturation / MAX_VALUE_DEGREE); SetHandlerPositionByRatio(SAT_HANDLER, __pColorPickerModel->GetSaturation()); @@ -342,7 +349,7 @@ result _ColorPickerPresenter::SetLuminance(int luminance) { SysTryReturn(NID_UI_CTRL, (luminance <= MAX_VALUE_DEGREE && luminance >= 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument(s) is used. Luminance value is invalid."); + "[E_INVALID_ARG] Invalid argument(s) is used. Luminance value is invalid."); __pColorPickerModel->SetLuminance((double)luminance / MAX_VALUE_DEGREE); SetHandlerPositionByRatio(LUM_HANDLER, __pColorPickerModel->GetLuminance()); @@ -351,15 +358,15 @@ _ColorPickerPresenter::SetLuminance(int luminance) } void -_ColorPickerPresenter::LoadDrawingProperties(const Rectangle& controlBounds) +_ColorPickerPresenter::LoadDrawingProperties(const FloatRectangle& controlBounds) { const int _BLOCK_COUNT = 3; - int arrowButtonLeftMargin = 0; - int arrowButtonTopMargin = 0; - int barTopMargin = 0; - int barLeftMargin = 0; - int sliderHeight = 0; - int sliderWidth = 0; + float arrowButtonLeftMargin = 0.0f; + float arrowButtonTopMargin = 0.0f; + float barTopMargin = 0.0f; + float barLeftMargin = 0.0f; + float sliderHeight = 0.0f; + float sliderWidth = 0.0f; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); @@ -373,27 +380,27 @@ _ColorPickerPresenter::LoadDrawingProperties(const Rectangle& controlBounds) GET_SHAPE_CONFIG(COLORPICKER::DIVIDER_MARGIN, orientation, __dividerMargin); GET_SHAPE_CONFIG(COLORPICKER::DIVIDER_WIDTH, orientation, __dividerWidth); - __topMargin = (controlBounds.height - (__blockMargin + __blockHeight) * _BLOCK_COUNT + __blockMargin) / 2; + __topMargin = (controlBounds.height - __blockHeight * _BLOCK_COUNT) / 2; if (__topMargin < 0) { __topMargin = 0; } - int arrowButtonWidth = 0; - int arrowButtonHeight = 0; + float arrowButtonWidth = 0.0f; + float arrowButtonHeight = 0.0f; GET_SHAPE_CONFIG(COLORPICKER::ARROW_BUTTON_WIDTH, orientation, arrowButtonWidth); GET_SHAPE_CONFIG(COLORPICKER::ARROW_BUTTON_HEIGHT, orientation, arrowButtonHeight); - int handlerWidth = 0; - int handlerHeight = 0; + float handlerWidth = 0.0f; + float handlerHeight = 0.0f; GET_SHAPE_CONFIG(COLORPICKER::HANDLER_WIDTH, orientation, handlerWidth); GET_SHAPE_CONFIG(COLORPICKER::HANDLER_HEIGHT, orientation, handlerHeight); - int btnStartY = arrowButtonTopMargin + __topMargin; - int barStartY = barTopMargin + __topMargin; + float btnStartY = arrowButtonTopMargin + __topMargin; + float barStartY = barTopMargin + __topMargin; GET_SHAPE_CONFIG(COLORPICKER::BAR_WIDTH, orientation, sliderWidth); @@ -403,66 +410,56 @@ _ColorPickerPresenter::LoadDrawingProperties(const Rectangle& controlBounds) __componentBounds[HUE_BAR].SetBounds(arrowButtonLeftMargin + arrowButtonWidth + barLeftMargin, barStartY, sliderWidth, sliderHeight); __componentBounds[HUE_ARROWRIGHT].SetBounds(__componentBounds[HUE_BAR].x + sliderWidth + barLeftMargin, btnStartY, - arrowButtonWidth, arrowButtonHeight); + arrowButtonWidth, arrowButtonHeight); - btnStartY += __blockHeight + __blockMargin; + btnStartY += __blockHeight; __componentBounds[SAT_ARROWLEFT].SetBounds(arrowButtonLeftMargin, btnStartY, arrowButtonWidth, arrowButtonHeight); - __componentBounds[SAT_BAR].SetBounds(arrowButtonLeftMargin + arrowButtonWidth + barLeftMargin, barStartY + __blockHeight + __blockMargin, - sliderWidth, sliderHeight); + __componentBounds[SAT_BAR].SetBounds(arrowButtonLeftMargin + arrowButtonWidth + barLeftMargin, barStartY + __blockHeight, + sliderWidth, sliderHeight); __componentBounds[SAT_ARROWRIGHT].SetBounds(__componentBounds[SAT_BAR].x + sliderWidth + barLeftMargin, btnStartY, - arrowButtonWidth, arrowButtonHeight); + arrowButtonWidth, arrowButtonHeight); - btnStartY += __blockHeight + __blockMargin; + btnStartY += __blockHeight; __componentBounds[LUM_ARROWLEFT].SetBounds(arrowButtonLeftMargin, btnStartY, arrowButtonWidth, arrowButtonHeight); - __componentBounds[LUM_BAR].SetBounds(arrowButtonLeftMargin + arrowButtonWidth + barLeftMargin, barStartY + (__blockHeight + __blockMargin) * 2, - sliderWidth, sliderHeight); + __componentBounds[LUM_BAR].SetBounds(arrowButtonLeftMargin + arrowButtonWidth + barLeftMargin, barStartY + __blockHeight * 2, + sliderWidth, sliderHeight); __componentBounds[LUM_ARROWRIGHT].SetBounds(__componentBounds[LUM_BAR].x + sliderWidth + barLeftMargin, btnStartY, - arrowButtonWidth, arrowButtonHeight); + arrowButtonWidth, arrowButtonHeight); - int differentialY = (handlerHeight - sliderHeight) / 2; + float differentialY = (handlerHeight - sliderHeight) / 2.0f; __componentBounds[HUE_HANDLER].SetBounds( - __componentBounds[HUE_BAR].x + (__componentBounds[HUE_BAR].width - handlerWidth) * __pColorPickerModel->GetHue(), - __componentBounds[HUE_BAR].y - differentialY, - handlerWidth, - handlerHeight); + __componentBounds[HUE_BAR].x + (__componentBounds[HUE_BAR].width - handlerWidth) * __pColorPickerModel->GetHue(), + __componentBounds[HUE_BAR].y - differentialY, + handlerWidth, + handlerHeight); __componentBounds[SAT_HANDLER].SetBounds( - __componentBounds[SAT_BAR].x + (__componentBounds[SAT_BAR].width - handlerWidth) * (MAX_VALUE - __pColorPickerModel->GetSaturation()), - __componentBounds[SAT_BAR].y - differentialY, - handlerWidth, - handlerHeight); + __componentBounds[SAT_BAR].x + (__componentBounds[SAT_BAR].width - handlerWidth) * (MAX_VALUE - __pColorPickerModel->GetSaturation()), + __componentBounds[SAT_BAR].y - differentialY, + handlerWidth, + handlerHeight); __componentBounds[LUM_HANDLER].SetBounds( - __componentBounds[LUM_BAR].x + (__componentBounds[LUM_BAR].width - handlerWidth) * __pColorPickerModel->GetLuminance(), - __componentBounds[LUM_BAR].y - differentialY, - handlerWidth, - handlerHeight); + __componentBounds[LUM_BAR].x + (__componentBounds[LUM_BAR].width - handlerWidth) * __pColorPickerModel->GetLuminance(), + __componentBounds[LUM_BAR].y - differentialY, + handlerWidth, + handlerHeight); - // Set bounds of AccessibilityElement - _AccessibilityElement* pElement = null; - for (int elementId = HUE_BAR; elementId <= LUM_ARROWRIGHT; elementId++) - { - pElement = __pColorPicker->GetAccessibilityElement(elementId); - if (pElement != null) - { - pElement->SetBounds(__componentBounds[elementId]); - pElement = null; - } - } return; } void _ColorPickerPresenter::OnChangeLayout(_ControlOrientation orientation) { - Dimension colorPickerSize; - result r = GET_DIMENSION_CONFIG(COLORPICKER::DEFAULT_SIZE, orientation, colorPickerSize); - if (r == E_SUCCESS && colorPickerSize != __pColorPicker->GetSize()) + FloatDimension colorPickerSize; + result r = GET_DIMENSION_CONFIG(COLORPICKER::DEFAULT_SIZE, orientation, colorPickerSize); + + if (r == E_SUCCESS && colorPickerSize != __pColorPicker->GetSizeF()) { __pColorPicker->SetResizable(true); __pColorPicker->SetSize(colorPickerSize); @@ -474,12 +471,12 @@ _ColorPickerPresenter::OnChangeLayout(_ControlOrientation orientation) bool _ColorPickerPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point = touchinfo.GetCurrentPosition(); __eventType = GetTouchActionType(point); if (__eventType >= HUE_ARROWLEFT && __eventType <= LUM_ARROWRIGHT) { - Rectangle buttonBounds = __componentBounds[__eventType]; + FloatRectangle buttonBounds = __componentBounds[__eventType]; Canvas* pCanvas = __pColorPicker->GetCanvasN(buttonBounds); if (pCanvas != null) { @@ -536,9 +533,14 @@ _ColorPickerPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& { __pSlideTimer->Cancel(); } + if(__eventType >= HUE_ARROWLEFT && __eventType <= LUM_ARROWRIGHT) + { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + } if (__eventType >= HUE_HANDLER && __eventType <= LUM_HANDLER) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); TouchHandler(touchinfo.GetCurrentPosition().x); __eventType = HSL_NOT; } @@ -581,9 +583,6 @@ _ColorPickerPresenter::LoadResource(void) Bitmap* pBgNormalBitmap = null; Bitmap* pBgPressedBitmap = null; Bitmap* pBgDisabledBitmap = null; - Bitmap* pBgEffectNormalBitmap = null; - Bitmap* pBgEffectPressedBitmap = null; - Bitmap* pBgEffectDisabledBitmap = null; Bitmap* pLeftArrowNormalBitmap = null; Bitmap* pLeftArrowPressedBitmap = null; Bitmap* pLeftArrowDisabledBitmap = null; @@ -642,13 +641,13 @@ _ColorPickerPresenter::LoadResource(void) r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBgDisabledBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBgEffectNormalBitmap); + r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pNormalEffectBgBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBgEffectPressedBitmap); + r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pPressedEffectBgBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBgEffectDisabledBitmap); + r = GET_BITMAP_CONFIG_N(COLORPICKER::ARROW_BUTTON_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDisabledEffectBgBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_BITMAP_CONFIG_N(COLORPICKER::LEFT_ARROW_BUTTON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pLeftArrowNormalBitmap); @@ -671,51 +670,39 @@ _ColorPickerPresenter::LoadResource(void) __pColorNormalReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgNormalColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pColorNormalReplacementBgBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pColorPressedReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgPressedColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pColorPressedReplacementBgBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pColorDisabledReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgDisabledColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pColorNormalEffectReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgEffectNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgNormalColor); - r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pColorPressedEffectReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgEffectPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgPressedColor); - r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pColorDisabledEffectReplacementBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgEffectDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgDisabledColor); - r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pColorDisabledReplacementBgBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pLeftArrowNormalBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pLeftArrowNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pLeftArrowNormalBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pLeftArrowPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pLeftArrowPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonPressedColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pLeftArrowPressedBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pLeftArrowDisabledBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pLeftArrowDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonDisabledColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pLeftArrowDisabledBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pRightArrowNormalBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pRightArrowNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pRightArrowNormalBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pRightArrowPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pRightArrowPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonPressedColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pRightArrowPressedBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); __pRightArrowDisabledBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pRightArrowDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonDisabledColor); r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, (__pRightArrowDisabledBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_BITMAP_CONFIG_N(COLORPICKER::HANDLER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -729,15 +716,6 @@ _ColorPickerPresenter::LoadResource(void) delete pBgDisabledBitmap; pBgDisabledBitmap = null; - delete pBgEffectNormalBitmap; - pBgEffectNormalBitmap = null; - - delete pBgEffectPressedBitmap; - pBgEffectPressedBitmap = null; - - delete pBgEffectDisabledBitmap; - pBgEffectDisabledBitmap = null; - delete pLeftArrowNormalBitmap; pLeftArrowNormalBitmap = null; @@ -780,15 +758,6 @@ CATCH: delete pBgDisabledBitmap; pBgDisabledBitmap = null; - delete pBgEffectNormalBitmap; - pBgEffectNormalBitmap = null; - - delete pBgEffectPressedBitmap; - pBgEffectPressedBitmap = null; - - delete pBgEffectDisabledBitmap; - pBgEffectDisabledBitmap = null; - delete pLeftArrowNormalBitmap; pLeftArrowNormalBitmap = null; @@ -816,14 +785,14 @@ CATCH: delete __pColorDisabledReplacementBgBitmap; __pColorDisabledReplacementBgBitmap = null; - delete __pColorNormalEffectReplacementBgBitmap; - __pColorNormalEffectReplacementBgBitmap = null; + delete __pNormalEffectBgBitmap; + __pNormalEffectBgBitmap = null; - delete __pColorPressedEffectReplacementBgBitmap; - __pColorPressedEffectReplacementBgBitmap = null; + delete __pPressedEffectBgBitmap; + __pPressedEffectBgBitmap = null; - delete __pColorDisabledEffectReplacementBgBitmap; - __pColorDisabledEffectReplacementBgBitmap = null; + delete __pDisabledEffectBgBitmap; + __pDisabledEffectBgBitmap = null; delete __pLeftArrowNormalBitmap; __pLeftArrowNormalBitmap = null; @@ -872,9 +841,10 @@ _ColorPickerPresenter::DrawLuminanceSlider(Canvas& canvas) { result r = E_SUCCESS; Bitmap* pColorReplacementBitmap = null; - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + canvas.Clear(__componentBounds[LUM_BAR]); + if (__pCustomBitmap != null && __pLuminanceSliderBgBitmap != null && orientation == _CONTROL_ORIENTATION_PORTRAIT) { pColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pCustomBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pColorPickerModel->GetSaturationColor()); @@ -922,6 +892,8 @@ _ColorPickerPresenter::DrawSaturationSlider(Canvas& canvas) Bitmap* pColorReplacementBitmap = null; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + canvas.Clear(__componentBounds[SAT_BAR]); + if (__pCustomBitmap != null && __pSaturationSliderBgBitmap != null && orientation == _CONTROL_ORIENTATION_PORTRAIT) { pColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pCustomBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pColorPickerModel->GetHueColor()); @@ -972,19 +944,34 @@ _ColorPickerPresenter::DrawLine(Canvas& canvas) result r = E_SUCCESS; Color foregroundColor = canvas.GetForegroundColor(); - Color lineColor; - r = GET_COLOR_CONFIG(COLORPICKER::DIVIDER_NORMAL, lineColor); + Color dividerTopHalfColor; + Color dividerBottomHalfColor; + + r = GET_COLOR_CONFIG(COLORPICKER::DIVIDER_TOP_HALF, dividerTopHalfColor); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - canvas.SetForegroundColor(lineColor); + r = GET_COLOR_CONFIG(COLORPICKER::DIVIDER_BOTTOM_HALF, dividerBottomHalfColor); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + + canvas.SetForegroundColor(dividerTopHalfColor); canvas.SetLineWidth(__blockMargin); - r = canvas.DrawLine(Point(__dividerMargin, __topMargin + __blockHeight), - Point(__dividerMargin + __dividerWidth, __topMargin + __blockHeight)); + r = canvas.DrawLine(FloatPoint(__dividerMargin, __topMargin + __blockHeight), + FloatPoint(__dividerMargin + __dividerWidth, __topMargin + __blockHeight)); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + + r = canvas.DrawLine(FloatPoint(__dividerMargin, __topMargin + __blockHeight * 2), + FloatPoint(__dividerMargin + __dividerWidth, __topMargin + __blockHeight * 2)); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - r = canvas.DrawLine(Point(__dividerMargin, __topMargin + __blockHeight * 2 + __blockMargin), - Point(__dividerMargin + __dividerWidth, __topMargin + __blockHeight * 2 + __blockMargin)); + canvas.SetForegroundColor(dividerBottomHalfColor); + + r = canvas.DrawLine(FloatPoint(__dividerMargin, __topMargin + __blockHeight + __blockMargin), + FloatPoint(__dividerMargin + __dividerWidth, __topMargin + __blockHeight + __blockMargin)); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + + r = canvas.DrawLine(FloatPoint(__dividerMargin, __topMargin + __blockHeight * 2 + __blockMargin), + FloatPoint(__dividerMargin + __dividerWidth, __topMargin + __blockHeight * 2 + __blockMargin)); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); canvas.SetForegroundColor(foregroundColor); @@ -993,14 +980,20 @@ _ColorPickerPresenter::DrawLine(Canvas& canvas) } result -_ColorPickerPresenter::DrawArrowButton(Canvas& canvas, const Rectangle& rcButton, bool isSelected, bool drawLeftButton) +_ColorPickerPresenter::DrawArrowButton(Canvas& canvas, const FloatRectangle& rcButton, bool isSelected, bool drawLeftButton) { result r = E_SUCCESS; + bool isCustomBitmap = false; if (__pColorPicker->IsEnabled() == false) { - r = DrawResourceBitmap(canvas, rcButton, __pColorDisabledEffectReplacementBgBitmap); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(COLORPICKER::ARROW_BUTTON_BG_DISABLED); + + if (isCustomBitmap == false) + { + r = DrawResourceBitmap(canvas, rcButton, __pDisabledEffectBgBitmap); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } r = DrawResourceBitmap(canvas, rcButton, __pColorDisabledReplacementBgBitmap); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1018,8 +1011,13 @@ _ColorPickerPresenter::DrawArrowButton(Canvas& canvas, const Rectangle& rcButton } else if (isSelected) { - r = DrawResourceBitmap(canvas, rcButton, __pColorPressedEffectReplacementBgBitmap); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(COLORPICKER::ARROW_BUTTON_BG_PRESSED); + + if (isCustomBitmap == false) + { + r = DrawResourceBitmap(canvas, rcButton, __pPressedEffectBgBitmap); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } r = DrawResourceBitmap(canvas, rcButton, __pColorPressedReplacementBgBitmap); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1037,8 +1035,13 @@ _ColorPickerPresenter::DrawArrowButton(Canvas& canvas, const Rectangle& rcButton } else { - r = DrawResourceBitmap(canvas, rcButton, __pColorNormalEffectReplacementBgBitmap); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(COLORPICKER::ARROW_BUTTON_BG_NORMAL); + + if (isCustomBitmap == false) + { + r = DrawResourceBitmap(canvas, rcButton, __pNormalEffectBgBitmap); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } r = DrawResourceBitmap(canvas, rcButton, __pColorNormalReplacementBgBitmap); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1097,8 +1100,8 @@ _ColorPickerPresenter::MoveHandler(_ColorPickerComponentType handlerType) SysTryReturnResult(NID_UI_CTRL, pHandler != null, E_SYSTEM, "A system error has occurred. Failed to get the handler."); - Rectangle bounds = __pColorPicker->GetClientBounds(); - Rectangle& handlerBounds = __componentBounds[handlerType]; + FloatRectangle bounds = __pColorPicker->GetClientBoundsF(); + FloatRectangle& handlerBounds = __componentBounds[handlerType]; pHandler->SetBounds(FloatRectangle(bounds.x + handlerBounds.x, bounds.y + handlerBounds.y, handlerBounds.width, handlerBounds.height)); return r; @@ -1151,18 +1154,18 @@ _ColorPickerPresenter::TouchButton(void) } result -_ColorPickerPresenter::TouchHandler(int x) +_ColorPickerPresenter::TouchHandler(float position) { result r = E_SUCCESS; switch (__eventType) { case HUE_HANDLER: - // fall through + // fall through case SAT_HANDLER: - // fall through + // fall through case LUM_HANDLER: - SetHandlerPosition(__eventType, x - __componentBounds[__eventType].width / 2); + SetHandlerPosition(__eventType, position - __componentBounds[__eventType].width / 2); MoveHandler(__eventType); ChangeColorFromCurrentHandlerPosition(__eventType); break; @@ -1176,19 +1179,19 @@ _ColorPickerPresenter::TouchHandler(int x) } result -_ColorPickerPresenter::SetHandlerPosition(_ColorPickerComponentType handlerType, int position) +_ColorPickerPresenter::SetHandlerPosition(_ColorPickerComponentType handlerType, float position) { result r = E_SUCCESS; switch (handlerType) { case HUE_HANDLER: - // fall through + // fall through case SAT_HANDLER: - // fall through + // fall through case LUM_HANDLER: { - Rectangle& barBounds = GetBarBoundsFromHandler(handlerType); + FloatRectangle& barBounds = GetBarBoundsFromHandler(handlerType); if (position < barBounds.x) { position = barBounds.x; @@ -1200,7 +1203,7 @@ _ColorPickerPresenter::SetHandlerPosition(_ColorPickerComponentType handlerType, __componentBounds[handlerType].x = position; } - break; + break; default: SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Handler event type is invalid."); r = E_SYSTEM; @@ -1214,7 +1217,7 @@ result _ColorPickerPresenter::SetHandlerPositionByRatio(_ColorPickerComponentType handlerType, double ratio) { result r = E_SUCCESS; - Rectangle& barBounds = GetBarBoundsFromHandler(handlerType); + FloatRectangle& barBounds = GetBarBoundsFromHandler(handlerType); switch (handlerType) { case HUE_HANDLER: @@ -1226,7 +1229,6 @@ _ColorPickerPresenter::SetHandlerPositionByRatio(_ColorPickerComponentType handl break; case LUM_HANDLER: - __componentBounds[handlerType].x = barBounds.x + (barBounds.width - __componentBounds[handlerType].width) * ratio; break; @@ -1311,7 +1313,7 @@ _ColorPickerPresenter::IsLeftButton(_ColorPickerComponentType buttonType) return (buttonType == HUE_ARROWLEFT || buttonType == SAT_ARROWLEFT || buttonType == LUM_ARROWLEFT); } -Rectangle& +FloatRectangle& _ColorPickerPresenter::GetBarBoundsFromHandler(_ColorPickerComponentType handlerType) { if (handlerType == HUE_HANDLER) @@ -1331,7 +1333,7 @@ _ColorPickerPresenter::GetBarBoundsFromHandler(_ColorPickerComponentType handler } _ColorPickerComponentType -_ColorPickerPresenter::GetTouchActionType(const Point& position) const +_ColorPickerPresenter::GetTouchActionType(const FloatPoint& position) const { if (__componentBounds[HUE_BAR].Contains(position) == true) { @@ -1358,7 +1360,7 @@ _ColorPickerPresenter::GetTouchActionType(const Point& position) const } result -_ColorPickerPresenter::DrawResourceBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pBitmap) +_ColorPickerPresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap) { result r = E_SUCCESS; diff --git a/src/ui/controls/FUiCtrl_ContextMenu.cpp b/src/ui/controls/FUiCtrl_ContextMenu.cpp index 091b5ea..cd6224d 100644 --- a/src/ui/controls/FUiCtrl_ContextMenu.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenu.cpp @@ -42,7 +42,7 @@ namespace Tizen { namespace Ui { namespace Controls IMPLEMENT_PROPERTY(_ContextMenu); -_ContextMenu::_ContextMenu(const Point& point, enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign) +_ContextMenu::_ContextMenu(const FloatPoint& point, enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign) : __pContextMenuPresenter(null) , __style(style) , __align(contextMenuAlign) @@ -51,9 +51,9 @@ _ContextMenu::_ContextMenu(const Point& point, enum ContextMenuCoreStyle style, , __isAttachedToMainTree(false) , __ownerInputEnableState(false) , __anchorPoint(point) - , __bodyRect(Rectangle(0, 0, 0, 0)) - , __arrowRect(Rectangle(0, 0, 0, 0)) - , __windowRect(Rectangle(0, 0, 0, 0)) + , __bodyRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __arrowRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __windowRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __pActionEvent(null) , __pBackgroundNormalBitmap(null) , __pBackgroundEffectBitmap(null) @@ -83,7 +83,7 @@ _ContextMenu::~_ContextMenu(void) _Control* pOwner = GetOwner(); if (__isAttachedToMainTree == true && pOwner != null) { - pOwner->SetInputEnableState(__ownerInputEnableState); + pOwner->SetInputEventEnableState(__ownerInputEnableState); } if (__pScrollPanel) { @@ -136,19 +136,17 @@ _ContextMenu::IsActivatedOnOpen(void) const } _ContextMenu* -_ContextMenu::CreateContextMenuN(const Point& point, enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign) +_ContextMenu::CreateContextMenuN(const FloatPoint& point, enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign) { _ContextMenu* pContextMenu = new (std::nothrow) _ContextMenu(point, style, contextMenuAlign); SysTryReturn(NID_UI_CTRL, pContextMenu != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = E_SUCCESS; -#if defined(MULTI_WINDOW) r = pContextMenu->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); pContextMenu->SetActivationEnabled(false); -#endif r = pContextMenu->Initialize(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Initialize.", GetErrorMessage(r)); @@ -157,6 +155,7 @@ _ContextMenu::CreateContextMenuN(const Point& point, enum ContextMenuCoreStyle s SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Install.", GetErrorMessage(r)); pContextMenu->AcquireHandle(); + pContextMenu->SetTouchPressThreshold(0.08f); if (pContextMenu->GetAccessibilityContainer() != null) { @@ -165,10 +164,10 @@ _ContextMenu::CreateContextMenuN(const Point& point, enum ContextMenuCoreStyle s if (style == CONTEXT_MENU_CORE_STYLE_LIST) { - int minWidth, minHeight; // for visible scrollbar when scrollable - GET_SHAPE_CONFIG(CONTEXTMENU::LIST_MIN_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, minWidth); + float minWidth, minHeight; // for visible scrollbar when scrollable + GET_SHAPE_CONFIG(CONTEXTMENU::LIST_MIN_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, minWidth); GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, minHeight); - pContextMenu->__pScrollPanel = _ScrollPanel::CreateScrollPanelN(Rectangle(0, 0, minWidth, minHeight), SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, false, false); + pContextMenu->__pScrollPanel = _ScrollPanel::CreateScrollPanelN(FloatRectangle(0.0f, 0.0f, minWidth, minHeight), SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, false, false); pContextMenu->AttachChild(*(pContextMenu->__pScrollPanel)); } @@ -223,7 +222,7 @@ _ContextMenu::Install(void) result _ContextMenu::Initialize(void) { - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); result r = E_SUCCESS; Color backgroundColor; @@ -231,11 +230,11 @@ _ContextMenu::Initialize(void) Color itemTextColor; Color itemTextSelectedColor; - r = SetBounds(Rectangle(0, 0, screen.width, screen.height)); + r = SetBounds(FloatRectangle(0.0f, 0.0f, screen.width, screen.height)); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "SetBounds failed."); - SetMovable(false); // To do Modify - SetResizable(false); // To do Modify + SetMovable(false); + SetResizable(false); GET_COLOR_CONFIG(CONTEXTMENU::BG_NORMAL, backgroundColor); GET_COLOR_CONFIG(CONTEXTMENU::ITEM_BG_PRESSED, backgroundSelectedColor); @@ -269,6 +268,10 @@ void _ContextMenu::OnDraw() { __pContextMenuPresenter->Draw(); + if(unlikely((_AccessibilityManager::IsActivated()))) + { + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); + } } result @@ -282,26 +285,20 @@ _ContextMenu::OnAttachedToMainTree(void) SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available."); _Form* pForm = pFrame->GetCurrentForm(); - if (pForm != null) - { - SetOwner(pForm); - } - else - { - SetOwner(pFrame); - } + pForm != null ? SetOwner(pForm) : SetOwner(pFrame); + + __layout = _ControlManager::GetInstance()->GetOrientation(); + GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, __layout, __showItemMaxCount); } _Control* pOwner = GetOwner(); if (pOwner != null && __isAttachedToMainTree == false) { __ownerInputEnableState = pOwner->GetInputEnableState(); - pOwner->SetInputEnableState(false); + pOwner->SetInputEventEnableState(false); } - __layout = _ControlManager::GetInstance()->GetOrientation(); AdjustDropPosition(); - GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, __layout, __showItemMaxCount); if (GetItemCount() <= 0) { @@ -327,6 +324,50 @@ _ContextMenu::OnAttachedToMainTree(void) __isAttachedToMainTree = true; + _VisualElement* pVisualElement = GetVisualElement(); + + FloatRectangle pBounds = pVisualElement->GetBounds(); + + float oldBoundsX = pBounds.x; + float oldBoundsY = pBounds.y; + float distanceX = 0.0f; + float distanceY = 0.0f; + + GET_SHAPE_CONFIG(CONTEXTMENU::APPEARING_ANIMATION_DISTANCE_X, __layout, distanceX); + GET_SHAPE_CONFIG(CONTEXTMENU::APPEARING_ANIMATION_DISTANCE_Y, __layout, distanceY); + + switch(GetDropPosition()) + { + case CONTEXT_MENU_CORE_DROP_POSITION_UP: + pBounds.y += distanceY; + break; + case CONTEXT_MENU_CORE_DROP_POSITION_DOWN: + pBounds.y -= distanceY; + break; + case CONTEXT_MENU_CORE_DROP_POSITION_LEFT: + pBounds.x += distanceX; + break; + case CONTEXT_MENU_CORE_DROP_POSITION_RIGHT: + pBounds.x -= distanceX; + break; + default: + break; + } + + pVisualElement->SetBounds(pBounds); + pVisualElement->SetOpacity(0.0f); + + bool enable = pVisualElement->IsImplicitAnimationEnabled(); + + pVisualElement->SetImplicitAnimationEnabled(true); + + pBounds.x = oldBoundsX; + pBounds.y = oldBoundsY; + pVisualElement->SetBounds(pBounds); + pVisualElement->SetOpacity(1.0f); + + pVisualElement->SetImplicitAnimationEnabled(enable); + return r; } @@ -340,7 +381,7 @@ _ContextMenu::OnDetachingFromMainTree(void) _Control* pOwner = GetOwner(); if (pOwner != null) { - pOwner->SetInputEnableState(__ownerInputEnableState); + pOwner->SetInputEventEnableState(__ownerInputEnableState); } __isAttachedToMainTree = false; @@ -472,7 +513,7 @@ _ContextMenu::GetItemActionIdAt(int index) const } result -_ContextMenu::SetAnchorPosition(int x, int y) +_ContextMenu::SetAnchorPosition(float x, float y) { __anchorPoint.x = x; __anchorPoint.y = y; @@ -486,49 +527,49 @@ _ContextMenu::SetAnchorPosition(int x, int y) return E_SUCCESS; } -Point +FloatPoint _ContextMenu::GetAnchorPosition(void) const { return __anchorPoint; } result -_ContextMenu::SetBodyRect(const Rectangle& rect) +_ContextMenu::SetBodyRect(const FloatRectangle& rect) { __bodyRect = rect; return E_SUCCESS; } -Rectangle +FloatRectangle _ContextMenu::GetBodyRect(void) const { return __bodyRect; } result -_ContextMenu::SetArrowRect(const Rectangle& rect) +_ContextMenu::SetArrowRect(const FloatRectangle& rect) { __arrowRect = rect; return E_SUCCESS; } -Rectangle +FloatRectangle _ContextMenu::GetArrowRect(void) const { return __arrowRect; } result -_ContextMenu::SetWindowRect(const Rectangle& rect) +_ContextMenu::SetWindowRect(const FloatRectangle& rect) { __windowRect = rect; return E_SUCCESS; } -Rectangle +FloatRectangle _ContextMenu::GetWindowRect(void) const { return __windowRect; @@ -1029,7 +1070,7 @@ _ContextMenu::GetDropPosition(void) const void _ContextMenu::AdjustDropPosition(void) { - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); if (__align == CONTEXT_MENU_CORE_ALIGN_UP) { @@ -1056,7 +1097,7 @@ _ContextMenu::AdjustDropPosition(void) if (screen.height > screen.width) { - if ((screen.height / 2) > __anchorPoint.y) + if ((screen.height / 2.0f) > __anchorPoint.y) { __dropPosition = CONTEXT_MENU_CORE_DROP_POSITION_DOWN; } @@ -1067,7 +1108,7 @@ _ContextMenu::AdjustDropPosition(void) } else { - if ((screen.width / 2) > __anchorPoint.x) + if ((screen.width / 2.0f) > __anchorPoint.x) { __dropPosition = CONTEXT_MENU_CORE_DROP_POSITION_RIGHT; } @@ -1132,7 +1173,7 @@ _ContextMenu::OnFontChanged(Tizen::Graphics::Font* pFont) } void -_ContextMenu::OnFontInfoRequested(unsigned long& style, int& size) +_ContextMenu::OnFontInfoRequested(unsigned long& style, float& size) { return __pContextMenuPresenter->OnFontInfoRequested(style, size); } @@ -1140,9 +1181,7 @@ _ContextMenu::OnFontInfoRequested(unsigned long& style, int& size) void _ContextMenu::OnVisibleStateChanged(void) { -#if defined(MULTI_WINDOW) _Window::OnVisibleStateChanged(); -#endif } void @@ -1204,7 +1243,7 @@ _ContextMenu::RemoveAllAccessibilityElement(void) } _ContextMenuItemInfo -_ContextMenu::GetItemFromPosition(const Point& position) const +_ContextMenu::GetItemFromPosition(const FloatPoint& position) const { return __pContextMenuPresenter->GetItemFromPosition(position); } diff --git a/src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp b/src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp index cc6a05d..a6ffc00 100644 --- a/src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp @@ -23,12 +23,14 @@ #include #include #include -#include "FUiCtrl_ContextMenuGridPresenter.h" -#include "FUiCtrl_IActionEventListener.h" -#include "FUiCtrl_ActionEvent.h" -#include "FUi_ResourceManager.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_ResourceManager.h" +#include "FUiCtrl_ActionEvent.h" +#include "FUiCtrl_IActionEventListener.h" + +#include "FUiCtrl_ContextMenuGridPresenter.h" using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -48,32 +50,32 @@ _ContextMenuGridPresenter::_ContextMenuGridPresenter(_ContextMenu* pContextMenu) , __pModel(null) , __pTextObject(null) , __pFont(null) - , __layoutSize(Dimension(0, 0)) + , __layoutSize(FloatDimension(0.0f, 0.0f)) , __touchOutRect(false) , __selectedIndex(-1) , __pressedIndex(-1) - , __maxWidth(0) - , __minWidth(0) - , __topMargin(0) - , __bottomMargin(0) - , __leftMargin(0) - , __rightMargin(0) - , __screenTopMargin(0) - , __screenBottomMargin(0) - , __screenLeftMargin(0) - , __screenRightMargin(0) - , __arrowMargin(0) - , __arrowWidth(0) - , __arrowHeight(0) - , __itemWidth(0) - , __itemHeight(0) - , __itemMaxWidth(0) - , __itemTextMargin(0) - , __itemGap(0) - , __itemBitmapWidth(0) - , __itemBitmapHeight(0) - , __itemFontSize(0) - , __dividerHeight(0) + , __maxWidth(0.0f) + , __minWidth(0.0f) + , __topMargin(0.0f) + , __bottomMargin(0.0f) + , __leftMargin(0.0f) + , __rightMargin(0.0f) + , __screenTopMargin(0.0f) + , __screenBottomMargin(0.0f) + , __screenLeftMargin(0.0f) + , __screenRightMargin(0.0f) + , __arrowMargin(0.0f) + , __arrowWidth(0.0f) + , __arrowHeight(0.0f) + , __itemWidth(0.0f) + , __itemHeight(0.0f) + , __itemMaxWidth(0.0f) + , __itemTextMargin(0.0f) + , __itemGap(0.0f) + , __itemBitmapWidth(0.0f) + , __itemBitmapHeight(0.0f) + , __itemFontSize(0.0f) + , __dividerHeight(0.0f) { } @@ -341,18 +343,18 @@ _ContextMenuGridPresenter::SetItemSize(_ContextMenuItem* pItem) if (itemType == CONTEXT_MENU_ITEM_DRAWING_TYPE_TEXT) { - int textMargin = __itemTextMargin; - int minWidth = __itemWidth; - int maxWidth = __itemMaxWidth; + float textMargin = __itemTextMargin; + float minWidth = __itemWidth; + float maxWidth = __itemMaxWidth; String text = pItem->GetText(); - textMargin = textMargin * 2; + textMargin = textMargin * 2.0f; minWidth = minWidth - textMargin; maxWidth = maxWidth - textMargin; - Dimension textArea(0, 0); - Dimension itemSize(0, 0); + FloatDimension textArea(0.0f, 0.0f); + FloatDimension itemSize(0.0f, 0.0f); __pFont->GetTextExtent(text, text.GetLength(), textArea); @@ -374,7 +376,7 @@ _ContextMenuGridPresenter::SetItemSize(_ContextMenuItem* pItem) } else if (itemType == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP) { - Dimension itemSize(__itemWidth, __itemHeight); + FloatDimension itemSize(__itemWidth, __itemHeight); pItem->SetSize(itemSize); } @@ -400,35 +402,33 @@ _ContextMenuGridPresenter::ApplyColorProperty(void) return E_SUCCESS; } - result _ContextMenuGridPresenter::CalculateRect(void) { - Tizen::Graphics::Rectangle windowRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // Window Rect is bodyRect + arrowRect - Tizen::Graphics::Rectangle bodyRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // ContextMenu rect except arrowRect - Tizen::Graphics::Rectangle arrowRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // Arrow rect of the ContextMenu + Tizen::Graphics::FloatRectangle windowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // Window Rect is bodyRect + arrowRect + Tizen::Graphics::FloatRectangle bodyRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu rect except arrowRect + Tizen::Graphics::FloatRectangle arrowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // Arrow rect of the ContextMenu - int bodyTopMargin = __topMargin; - int bodyBottomMargin = __bottomMargin; - int bodyLeftMargin = __leftMargin; - int bodyRightMargin = __rightMargin; + float bodyTopMargin = __topMargin; + float bodyBottomMargin = __bottomMargin; + float bodyLeftMargin = __leftMargin; + float bodyRightMargin = __rightMargin; - int screenTopMargin = __screenTopMargin; - int screenBottomMargin = __screenBottomMargin; - int screenLeftMargin = __screenLeftMargin; - int screenRightMargin = __screenRightMargin; - int arrowMargin = __arrowMargin; + float screenTopMargin = __screenTopMargin; + float screenBottomMargin = __screenBottomMargin; + float screenLeftMargin = __screenLeftMargin; + float screenRightMargin = __screenRightMargin; + float arrowMargin = __arrowMargin; - Point anchorPosition = __pContextMenu->GetAnchorPosition(); -// Point arrowPosition; + FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition(); - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE) { screen.SetSize(screen.height, screen.width); } - // calculate arrow area + // calculate arrow rect enum ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition(); if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_UP || dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN) // down, up Arrow { @@ -443,10 +443,10 @@ _ContextMenuGridPresenter::CalculateRect(void) // calculate body rect // calculate real drawing margin for contextmenu - int leftMargin = screenLeftMargin; - int rightMargin = screen.width - screenRightMargin; - int topMargin = screenTopMargin; - int bottomMargin = screen.height - screenBottomMargin; + float leftMargin = screenLeftMargin; + float rightMargin = screen.width - screenRightMargin; + float topMargin = screenTopMargin; + float bottomMargin = screen.height - screenBottomMargin; if (__pModel->GetItemCount() <= 0) { @@ -483,7 +483,7 @@ _ContextMenuGridPresenter::CalculateRect(void) } // Set body position x - bodyRect.x = anchorPosition.x - (bodyRect.width / 2); + bodyRect.x = anchorPosition.x - (bodyRect.width / 2.0f); // - Check left margin if (bodyRect.x <= leftMargin) { @@ -507,11 +507,11 @@ _ContextMenuGridPresenter::CalculateRect(void) windowRect.width = bodyRect.width; windowRect.height = bodyRect.height + arrowRect.height; - bodyRect.x = 0; + bodyRect.x = 0.0f; bodyRect.y = arrowMargin; // Set arrow position - arrowRect.x = anchorPosition.x - (arrowRect.width / 2) - windowRect.x; + arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x; arrowRect.y = bodyRect.height; } else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN) // up Arrow @@ -539,7 +539,7 @@ _ContextMenuGridPresenter::CalculateRect(void) } // Set body position x - bodyRect.x = anchorPosition.x - (bodyRect.width / 2); + bodyRect.x = anchorPosition.x - (bodyRect.width / 2.0f); // - Check left margin if (bodyRect.x <= leftMargin) { @@ -563,12 +563,12 @@ _ContextMenuGridPresenter::CalculateRect(void) windowRect.width = bodyRect.width; windowRect.height = bodyRect.height + arrowRect.height; - bodyRect.x = 0; + bodyRect.x = 0.0f; bodyRect.y = arrowRect.height - arrowMargin; // Set arrow position - arrowRect.x = anchorPosition.x - (arrowRect.width / 2) - windowRect.x; - arrowRect.y = 0; + arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x; + arrowRect.y = 0.0f; } else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_LEFT) // right Arrow { @@ -608,7 +608,7 @@ _ContextMenuGridPresenter::CalculateRect(void) } // Set body position y - bodyRect.y = anchorPosition.y - (bodyRect.height / 2); + bodyRect.y = anchorPosition.y - (bodyRect.height / 2.0f); // - check top margin if (bodyRect.y <= topMargin) { @@ -626,11 +626,11 @@ _ContextMenuGridPresenter::CalculateRect(void) windowRect.height = bodyRect.height; bodyRect.x = arrowMargin; - bodyRect.y = 0; + bodyRect.y = 0.0f; // Set arrow position arrowRect.x = bodyRect.width; - arrowRect.y = anchorPosition.y - (arrowRect.height / 2) - windowRect.y; + arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y; } else // left Arrow { @@ -687,23 +687,26 @@ _ContextMenuGridPresenter::CalculateRect(void) windowRect.height = bodyRect.height; bodyRect.x = arrowRect.width - arrowMargin; - bodyRect.y = 0; + bodyRect.y = 0.0f; // Set arrow position - arrowRect.x = 0; - arrowRect.y = anchorPosition.y - (arrowRect.height / 2) - windowRect.y; + arrowRect.x = 0.0f; + arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y; } __pContextMenu->SetBodyRect(bodyRect); __pContextMenu->SetArrowRect(arrowRect); __pContextMenu->SetWindowRect(windowRect); - __pContextMenu->SetMovable(true); // To do Modify a enabling - __pContextMenu->SetResizable(true); // To do Modify a enabling - __pContextMenu->SetMinimumSize(Dimension(0, 0)); // To do Modify - __pContextMenu->SetMaximumSize(screen); // To do Modify + + __pContextMenu->SetMovable(true); + __pContextMenu->SetResizable(true); + + __pContextMenu->SetMinimumSize(FloatDimension(0.0f, 0.0f)); + __pContextMenu->SetMaximumSize(screen); __pContextMenu->SetBounds(windowRect); - __pContextMenu->SetMovable(false); // To do Modify a enabling - __pContextMenu->SetResizable(false); // To do Modify a enabling + + __pContextMenu->SetMovable(false); + __pContextMenu->SetResizable(false); return E_SUCCESS; } @@ -741,7 +744,7 @@ void _ContextMenuGridPresenter::AdjustItemLayout(void) { int itemCount = __pModel->GetItemCount(); - Dimension layoutSize(0, 0); + FloatDimension layoutSize(0.0f, 0.0f); if (itemCount <= 0) { @@ -761,7 +764,7 @@ _ContextMenuGridPresenter::AdjustItemLayout(void) layoutSize = AdjustItemLayoutTabStyle(); } - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -777,13 +780,13 @@ _ContextMenuGridPresenter::AdjustItemLayout(void) __layoutSize = layoutSize; } -Tizen::Graphics::Dimension +Tizen::Graphics::FloatDimension _ContextMenuGridPresenter::AdjustItemLayoutIconStyle(void) { int countPerLine = 0; int itemCount = __pModel->GetItemCount(); - int itemWidth = __itemWidth + __itemGap; - int itemHeight = __itemHeight + __itemGap; + float itemWidth = __itemWidth + __itemGap; + float itemHeight = __itemHeight + __itemGap; if (itemCount <= MAX_COUNT_PER_LINE) { @@ -800,7 +803,7 @@ _ContextMenuGridPresenter::AdjustItemLayoutIconStyle(void) lineCount++; } - Dimension layoutSize(0, 0); + FloatDimension layoutSize(0.0f, 0.0f); layoutSize.width = countPerLine * __itemWidth + (countPerLine -1) * __itemGap; layoutSize.height = lineCount * __itemHeight + (lineCount - 1) *__itemGap; @@ -824,7 +827,7 @@ _ContextMenuGridPresenter::AdjustItemLayoutIconStyle(void) break; } - Rectangle drawRect(0, 0, __itemWidth, __itemHeight); + FloatRectangle drawRect(0.0f, 0.0f, __itemWidth, __itemHeight); drawRect.x = (i * itemWidth); drawRect.y = (line * itemHeight); @@ -844,23 +847,23 @@ _ContextMenuGridPresenter::AdjustItemLayoutIconStyle(void) } -Tizen::Graphics::Dimension +Tizen::Graphics::FloatDimension _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void) { - int lineWidthList[MAX_LINE_COUNT] = {0, }; int lineItemCountList[MAX_LINE_COUNT] = {0, }; + float lineWidthList[MAX_LINE_COUNT] = {0.0f, }; int itemCount = __pModel->GetItemCount(); - int maxWidth = __itemWidth; - int itemHeight = __itemHeight + __itemGap; + float maxWidth = __itemWidth; + float itemHeight = __itemHeight + __itemGap; int lineCount = 1; - int lineWidth = 0; + float lineWidth = 0.0f; int lineItemCount = 0; - int x = 0; - int y = 0; - int remainWidth; - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); - Point anchorPosition = __pContextMenu->GetAnchorPosition(); + float x = 0.0f; + float y = 0.0f; + float remainWidth = 0.0f; + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); + FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition(); ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition(); if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE) @@ -890,7 +893,7 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void) break; } - Dimension itemSize = pItem->GetSize(); + FloatDimension itemSize = pItem->GetSize(); if (lineWidth + itemSize.width > __maxWidth) { _ContextMenuItem* pPreviousItem = __pModel->GetItem(i - 1); @@ -899,15 +902,15 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void) pPreviousItem->SetDivider(false); } - x = 0; + x = 0.0f; y = y + itemHeight; - lineWidth = 0; + lineWidth = 0.0f; lineItemCount = 0; lineCount++; } - Rectangle drawRect(x, y, itemSize.width, itemSize.height); + FloatRectangle drawRect(x, y, itemSize.width, itemSize.height); pItem->SetDrawRect(drawRect); pItem->SetDivider(true); @@ -936,7 +939,7 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void) pItem->SetDivider(false); } - Dimension layoutSize(__itemWidth, __itemHeight); + FloatDimension layoutSize(__itemWidth, __itemHeight); layoutSize.width = maxWidth - __itemGap; layoutSize.height = lineCount * __itemHeight + (lineCount - 1) *__itemGap; @@ -969,7 +972,7 @@ _ContextMenuGridPresenter::AdjustItemLayoutTabStyle(void) break; } - Rectangle drawRect = pItem->GetDrawRect(); + FloatRectangle drawRect = pItem->GetDrawRect(); drawRect.width = drawRect.width + margin; drawRect.x = drawRect.x + (i * margin); @@ -1007,7 +1010,7 @@ _ContextMenuGridPresenter::AdjustItemPosition(void) break; } - Rectangle drawRect = pItem->GetDrawRect(); + FloatRectangle drawRect = pItem->GetDrawRect(); drawRect.x += x; drawRect.y += y; @@ -1045,7 +1048,7 @@ _ContextMenuGridPresenter::GetCountPerLine(int count, int min, int max) const } int -_ContextMenuGridPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const +_ContextMenuGridPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const { int index = -1; int itemCount = __pModel->GetItemCount(); @@ -1066,7 +1069,7 @@ _ContextMenuGridPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point break; } - Rectangle drawRect = pItem->GetDrawRect(); + FloatRectangle drawRect = pItem->GetDrawRect(); if (drawRect.Contains(point) == true) { @@ -1089,8 +1092,8 @@ _ContextMenuGridPresenter::Draw(void) // Clear canvas for drawing area of the ContextMenu. pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); - Tizen::Graphics::Rectangle bounds(__pContextMenu->GetWindowRect()); - pCanvas->Clear(Tizen::Graphics::Rectangle(0, 0, bounds.width, bounds.height)); + Tizen::Graphics::FloatRectangle bounds(__pContextMenu->GetWindowRect()); + pCanvas->Clear(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); r = DrawBackground(pCanvas); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw background."); @@ -1112,7 +1115,7 @@ _ContextMenuGridPresenter::DrawBackground(Canvas* pCanvas) result r = E_SUCCESS; - Tizen::Graphics::Rectangle bodyRect = __pContextMenu->GetBodyRect(); + Tizen::Graphics::FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); const Bitmap* pBackgroundNormalBitmap = __pContextMenu->GetBackgroundNormalBitmap(); const Bitmap* pBackgroundEffectBitmap = __pContextMenu->GetBackgroundEffectBitmap(); @@ -1124,14 +1127,14 @@ _ContextMenuGridPresenter::DrawBackground(Canvas* pCanvas) } else { - if (pBackgroundNormalBitmap != null) + if (pBackgroundEffectBitmap != null) { - r = pCanvas->DrawNinePatchedBitmap(bodyRect, *pBackgroundNormalBitmap); + r = DrawBitmap(*pCanvas, bodyRect, *pBackgroundEffectBitmap); } - if (pBackgroundEffectBitmap != null) + if (pBackgroundNormalBitmap != null) { - r = pCanvas->DrawNinePatchedBitmap(bodyRect, *pBackgroundEffectBitmap); + r = DrawBitmap(*pCanvas, bodyRect, *pBackgroundNormalBitmap); } } @@ -1145,21 +1148,21 @@ _ContextMenuGridPresenter::DrawArrow(Canvas* pCanvas) SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = E_SUCCESS; - Tizen::Graphics::Rectangle arrowRect = __pContextMenu->GetArrowRect(); + Tizen::Graphics::FloatRectangle arrowRect = __pContextMenu->GetArrowRect(); ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition(); const Bitmap* pArrowNormalBitmap = __pContextMenu->GetArrowNormalBitmap(dropPosition); const Bitmap* pEffectArrowBitmap = __pContextMenu->GetArrowEffectBitmap(dropPosition); + if (pEffectArrowBitmap != null) + { + r = DrawBitmap(*pCanvas, arrowRect, *pEffectArrowBitmap); + } if (pArrowNormalBitmap != null) { r = DrawBitmap(*pCanvas, arrowRect, *pArrowNormalBitmap); } - if (pEffectArrowBitmap != null) - { - r = DrawBitmap(*pCanvas, arrowRect, *pEffectArrowBitmap); - } return r; } @@ -1179,13 +1182,13 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) return E_SUCCESS; } - Rectangle bodyRect = __pContextMenu->GetBodyRect(); + FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); Color pressedColor = __pContextMenu->GetItemColor(CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED); - int bitmapLeftMargin = __itemBitmapWidth >> 1; - int bitmapTopMargin = __itemBitmapHeight >> 1; - int linePositionX = bodyRect.x + __leftMargin + __rightMargin; - int linePositionY = bodyRect.y + __topMargin; + float bitmapLeftMargin = __itemBitmapWidth / 2.0f; + float bitmapTopMargin = __itemBitmapHeight / 2.0f; + float linePositionX = bodyRect.x + __leftMargin + __rightMargin; + float linePositionY = bodyRect.y + __topMargin; _ContextMenuItem* pItem = null; @@ -1198,14 +1201,42 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) continue; } - Rectangle rect = pItem->GetDrawRect(); - ContextMenuItemDrawingType itemType = pItem->GetType(); + FloatRectangle rect = pItem->GetDrawRect(); + // divder + bool drawDivider = pItem->GetDivider(); + if (drawDivider == true) + { + float x = rect.x + rect.width; + float y = rect.y + __topMargin; + + FloatPoint point1(x, y); + FloatPoint point2(x, y + __dividerHeight); + + + DrawLine(pCanvas, point1, point2, true); + } + + // horizontal line + if (linePositionY != rect.y) + { + linePositionY = rect.y; + + float x = linePositionX + __layoutSize.width - __leftMargin - __rightMargin; + float y = linePositionY - __itemGap; + + FloatPoint point1(linePositionX, y); + FloatPoint point2(x, y); + + DrawLine(pCanvas, point1, point2, false); + } + + ContextMenuItemDrawingType itemType = pItem->GetType(); if (itemType == CONTEXT_MENU_ITEM_DRAWING_TYPE_TEXT) { - Rectangle drawRect = rect; + FloatRectangle drawRect = rect; drawRect.x = drawRect.x + __itemTextMargin; - drawRect.width = drawRect.width - (__itemTextMargin * 2); + drawRect.width = drawRect.width - (__itemTextMargin * 2.0f); ContextMenuCoreItemStatus itemStatus = CONTEXT_MENU_CORE_ITEM_STATUS_NORMAL; @@ -1213,8 +1244,7 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) { itemStatus = CONTEXT_MENU_CORE_ITEM_STATUS_PRESSED; - //pCanvas->FillRectangle(pressedColor, rect); - pCanvas->FillRoundRectangle(pressedColor, rect, Dimension(3, 3)); + pCanvas->FillRoundRectangle(pressedColor, rect, FloatDimension(3.0f, 3.0f)); } String text = pItem->GetText(); @@ -1232,10 +1262,10 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) } else { - Rectangle drawRect = rect; + FloatRectangle drawRect = rect; - drawRect.x = drawRect.x + (drawRect.width >> 1) - bitmapLeftMargin; - drawRect.y = drawRect.y + (drawRect.height >> 1) - bitmapTopMargin; + drawRect.x = drawRect.x + drawRect.width / 2.0f - bitmapLeftMargin; + drawRect.y = drawRect.y + drawRect.height / 2.0f - bitmapTopMargin; drawRect.width = __itemBitmapWidth; drawRect.height = __itemBitmapHeight; @@ -1245,8 +1275,7 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) { itemStatus = CONTEXT_MENU_ITEM_DRAWING_STATUS_PRESSED; - //pCanvas->FillRectangle(pressedColor, rect); - pCanvas->FillRoundRectangle(pressedColor, rect, Dimension(3, 3)); + pCanvas->FillRoundRectangle(pressedColor, rect, FloatDimension(3.0f, 3.0f)); } const Bitmap* pBitmap = pItem->GetBitmap(itemStatus); @@ -1255,41 +1284,13 @@ _ContextMenuGridPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) DrawBitmap(*pCanvas, drawRect, *pBitmap); } } - - // divder - bool drawDivider = pItem->GetDivider(); - if (drawDivider == true) - { - int x = rect.x + rect.width; - int y = rect.y + __topMargin; - - Point point1(x, y); - Point point2(x, y + __dividerHeight); - - - DrawLine(pCanvas, point1, point2, true); - } - - // horizontal line - if (linePositionY != rect.y) - { - linePositionY = rect.y; - - int x = linePositionX + __layoutSize.width - __leftMargin - __rightMargin; - int y = linePositionY - __itemGap; - - Point point1(linePositionX, y); - Point point2(x, y); - - DrawLine(pCanvas, point1, point2, false); - } } return r; } result -_ContextMenuGridPresenter::DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Point point1, Tizen::Graphics::Point point2, bool drawVLine) +_ContextMenuGridPresenter::DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatPoint point1, Tizen::Graphics::FloatPoint point2, bool drawVLine) { SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -1298,8 +1299,8 @@ _ContextMenuGridPresenter::DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Gra Color colorGridItemDivider01; Color colorGridItemDivider02; - GET_COLOR_CONFIG(CONTEXTMENU::GRID_ITEM_DIVIDER_01, colorGridItemDivider01); - GET_COLOR_CONFIG(CONTEXTMENU::GRID_ITEM_DIVIDER_02, colorGridItemDivider02); + GET_COLOR_CONFIG(CONTEXTMENU::GRID_ITEM_DIVIDER_01_NORMAL, colorGridItemDivider01); + GET_COLOR_CONFIG(CONTEXTMENU::GRID_ITEM_DIVIDER_02_NORMAL, colorGridItemDivider02); if (drawVLine == true) { @@ -1336,9 +1337,10 @@ _ContextMenuGridPresenter::OnPreviewTouchPressed(const _Control& source, const _ bool _ContextMenuGridPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Rectangle bodyRect = __pContextMenu->GetBodyRect(); + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); - if (bodyRect.Contains(touchinfo.GetCurrentPosition()) == false) + if (bodyRect.Contains(touchPosition) == false) { __selectedIndex = -1; __pressedIndex = -1; @@ -1347,7 +1349,7 @@ _ContextMenuGridPresenter::OnTouchPressed(const _Control& source, const _TouchIn return true; } - __selectedIndex = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + __selectedIndex = GetItemIndexFromPosition(touchPosition); __pressedIndex = __selectedIndex; __touchOutRect = false; Draw(); @@ -1364,14 +1366,15 @@ _ContextMenuGridPresenter::OnPreviewTouchReleased(const _Control& source, const bool _ContextMenuGridPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - Rectangle bodyRect = __pContextMenu->GetBodyRect(); + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); if (__touchOutRect == true) { __pContextMenu->SetVisibleState(false); } - int currentSelectedIndex = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + int currentSelectedIndex = GetItemIndexFromPosition(touchPosition); if (__selectedIndex != -1 && (__selectedIndex == currentSelectedIndex)) { _ActionEvent* pActionEvent = __pContextMenu->GetActionEvent(); @@ -1404,6 +1407,7 @@ _ContextMenuGridPresenter::OnTouchReleased(const _Control& source, const _TouchI return true; } + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); pActionEvent->Fire(*pEventArg); } @@ -1425,6 +1429,8 @@ _ContextMenuGridPresenter::OnPreviewTouchMoved(const _Control& source, const _To bool _ContextMenuGridPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + if (__selectedIndex != -1) { _ContextMenuItem* pItem = __pModel->GetItem(__selectedIndex); @@ -1436,8 +1442,8 @@ _ContextMenuGridPresenter::OnTouchMoved(const _Control& source, const _TouchInfo return true; } - Rectangle drawRect = pItem->GetDrawRect(); - if (drawRect.Contains(touchinfo.GetCurrentPosition()) == false) + FloatRectangle drawRect = pItem->GetDrawRect(); + if (drawRect.Contains(touchPosition) == false) { __selectedIndex = -1; Draw(); @@ -1448,8 +1454,8 @@ _ContextMenuGridPresenter::OnTouchMoved(const _Control& source, const _TouchInfo _ContextMenuItem* pItem = __pModel->GetItem(__pressedIndex); if(pItem != null) { - Rectangle drawRect = pItem->GetDrawRect(); - if(drawRect.Contains(touchinfo.GetCurrentPosition())) + FloatRectangle drawRect = pItem->GetDrawRect(); + if(drawRect.Contains(touchPosition)) { __selectedIndex = __pressedIndex; Draw(); @@ -1467,7 +1473,7 @@ _ContextMenuGridPresenter::OnFontChanged(Font* pFont) } void -_ContextMenuGridPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_ContextMenuGridPresenter::OnFontInfoRequested(unsigned long& style, float& size) { style = FONT_STYLE_PLAIN; size = __itemFontSize; @@ -1511,7 +1517,7 @@ _ContextMenuGridPresenter::SetAllAccessibilityElement(void) } _ContextMenuItemInfo -_ContextMenuGridPresenter::GetItemFromPosition(const Point& position) +_ContextMenuGridPresenter::GetItemFromPosition(const FloatPoint& position) { _ContextMenuItemInfo itemInfo; int index = GetItemIndexFromPosition(position); @@ -1539,7 +1545,7 @@ _ContextMenuGridPresenter::SetTopDrawnItemIndex(int index) } result -_ContextMenuGridPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) +_ContextMenuGridPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) diff --git a/src/ui/controls/FUiCtrl_ContextMenuImpl.cpp b/src/ui/controls/FUiCtrl_ContextMenuImpl.cpp index 52089cd..1e79110 100644 --- a/src/ui/controls/FUiCtrl_ContextMenuImpl.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenuImpl.cpp @@ -22,6 +22,7 @@ #include #include #include "FUi_ControlImplManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_ContextMenuImpl.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_Form.h" @@ -54,7 +55,7 @@ _ContextMenuImpl::_ContextMenuImpl(ContextMenu* pPublic, _ContextMenu* pCore, Co } _ContextMenuImpl* -_ContextMenuImpl::CreateContextMenuImplN(ContextMenu* pPublic, const Point& point, ContextMenuStyle style, +_ContextMenuImpl::CreateContextMenuImplN(ContextMenu* pPublic, const FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction) { @@ -179,6 +180,7 @@ _ContextMenuImpl::RemoveItemAt(int index) { SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is not valid(index = %d).", index); + // E_OUT_OF_RANGE is for API version 2.0 over return (_AppInfo::GetApiVersion() <= _API_VERSION_2_0 && _AppInfo::IsOspCompat())?E_SYSTEM:E_OUT_OF_RANGE; } @@ -196,34 +198,7 @@ _ContextMenuImpl::RemoveAllItems(void) } result -_ContextMenuImpl::OnAttachedToMainTree(void) -{ - result r = E_SUCCESS; - ClearLastResult(); - - if (GetOwner() == null) - { - _FrameImpl* pFrameImpl = dynamic_cast <_FrameImpl*>(_ControlImplManager::GetInstance()->GetCurrentFrame()); - SysTryReturn(NID_UI_CTRL, pFrameImpl != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); - _Form* pForm = pFrameImpl->GetCore().GetCurrentForm(); - _ContextMenu& control = GetCore(); - - if (pForm != null) - { - control.SetOwner(pForm); - } - else - { - control.SetOwner(&pFrameImpl->GetCore()); - } - } - - r = _WindowImpl::OnAttachedToMainTree(); - return r; -} - -result -_ContextMenuImpl::SetAnchorPosition(int x, int y) +_ContextMenuImpl::SetAnchorPosition(float x, float y) { ClearLastResult(); @@ -232,15 +207,14 @@ _ContextMenuImpl::SetAnchorPosition(int x, int y) return __pContextMenu->SetAnchorPosition(x, y); } -Tizen::Graphics::Point +Tizen::Graphics::FloatPoint _ContextMenuImpl::GetAnchorPosition(void) const { ClearLastResult(); SysAssertf(__pContextMenu != null, "Not yet constructed. Construct() should be called before use."); - Tizen::Graphics::Point point; - + Tizen::Graphics::FloatPoint point; point = __pContextMenu->GetAnchorPosition(); return point; diff --git a/src/ui/controls/FUiCtrl_ContextMenuItem.cpp b/src/ui/controls/FUiCtrl_ContextMenuItem.cpp index e380620..573a629 100644 --- a/src/ui/controls/FUiCtrl_ContextMenuItem.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenuItem.cpp @@ -21,9 +21,10 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" -#include "FUiCtrl_ContextMenuItem.h" +#include "FUiCtrl_ContextMenuItem.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -38,10 +39,10 @@ _ContextMenuItem::_ContextMenuItem(void) , __divider(false) , __selected(false) , __parentScrollEnable(false) - , __textSize(0) + , __textSize(0.0f) , __text(L"") - , __size(Dimension(0, 0)) - , __drawRect(Rectangle(0, 0, 0, 0)) + , __size(FloatDimension(0.0f, 0.0f)) + , __drawRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __pBitmapLabel(null) , __pTextLabel(null) , __pDividerLineLabel1(null) @@ -142,7 +143,7 @@ _ContextMenuItem::GetDivider(void) const } void -_ContextMenuItem::SetTextSize(int size) +_ContextMenuItem::SetTextSize(float size) { __textSize = size; } @@ -204,25 +205,25 @@ _ContextMenuItem::GetBitmap(ContextMenuItemDrawingStatus status) const } void -_ContextMenuItem::SetSize(Tizen::Graphics::Dimension size) +_ContextMenuItem::SetSize(Tizen::Graphics::FloatDimension size) { __size = size; } -Tizen::Graphics::Dimension +Tizen::Graphics::FloatDimension _ContextMenuItem::GetSize(void) const { return __size; } void -_ContextMenuItem::SetDrawRect(Tizen::Graphics::Rectangle rect) +_ContextMenuItem::SetDrawRect(Tizen::Graphics::FloatRectangle rect) { __drawRect = rect; } -Tizen::Graphics::Rectangle +Tizen::Graphics::FloatRectangle _ContextMenuItem::GetDrawRect(void) const { return __drawRect; @@ -264,20 +265,22 @@ _ContextMenuItem::DrawItem(void) void _ContextMenuItem::DrawItemDivider(void) { - int leftMargin, rightMargin; - GET_SHAPE_CONFIG(CONTEXTMENU::LIST_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - GET_SHAPE_CONFIG(CONTEXTMENU::LIST_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, rightMargin); + float leftMargin, rightMargin, dividerHeight; + GET_SHAPE_CONFIG(CONTEXTMENU::LIST_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); + GET_SHAPE_CONFIG(CONTEXTMENU::LIST_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, rightMargin); + GET_SHAPE_CONFIG(CONTEXTMENU::LIST_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight); + if (__pDividerLineLabel1 == null) { __pDividerLineLabel1 = _Label::CreateLabelN(); SysTryReturnVoidResult(NID_UI_CTRL, __pDividerLineLabel1, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); - __pDividerLineLabel1->SetBounds(Rectangle(leftMargin, bounds.height - 2, bounds.width - leftMargin - rightMargin, 1)); + __pDividerLineLabel1->SetBounds(FloatRectangle(leftMargin, bounds.height - 2.0f * dividerHeight, bounds.width - leftMargin - rightMargin, dividerHeight)); Color dividerLineColor; - GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER1, dividerLineColor); + GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER_01_NORMAL, dividerLineColor); __pDividerLineLabel1->SetBackgroundColor(dividerLineColor); AttachChild(*__pDividerLineLabel1); @@ -290,12 +293,12 @@ _ContextMenuItem::DrawItemDivider(void) __pDividerLineLabel2 = _Label::CreateLabelN(); SysTryReturnVoidResult(NID_UI_CTRL, __pDividerLineLabel2, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); - __pDividerLineLabel2->SetBounds(Rectangle(leftMargin, bounds.height - 1, bounds.width - leftMargin - rightMargin, 1)); + __pDividerLineLabel2->SetBounds(FloatRectangle(leftMargin, bounds.height - dividerHeight, bounds.width - leftMargin - rightMargin, dividerHeight)); Color dividerLineColor; - GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER2, dividerLineColor); + GET_COLOR_CONFIG(CONTEXTMENU::LIST_ITEM_DIVIDER_02_NORMAL, dividerLineColor); __pDividerLineLabel2->SetBackgroundColor(dividerLineColor); AttachChild(*__pDividerLineLabel2); @@ -307,44 +310,57 @@ _ContextMenuItem::DrawItemDivider(void) _UiTouchEventDelivery _ContextMenuItem::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { + SetAndInvalidate(true); + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } -_UiTouchEventDelivery -_ContextMenuItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) +bool +_ContextMenuItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; + SetAndInvalidate(true); + + return false; } _UiTouchEventDelivery -_ContextMenuItem::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo) +_ContextMenuItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + TouchMoved(source, touchinfo); + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } bool -_ContextMenuItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) +_ContextMenuItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - __selected = true; - __pressed = true; - Invalidate(); + TouchMoved(source, touchinfo); return false; } +_UiTouchEventDelivery +_ContextMenuItem::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo) +{ + SetAndInvalidate(false); + + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; +} + bool _ContextMenuItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - Reset(); - - Invalidate(); + SetAndInvalidate(false); return false; } -bool -_ContextMenuItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) + +void +_ContextMenuItem::TouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + if (__pressed) { if (__parentScrollEnable) @@ -359,8 +375,8 @@ _ContextMenuItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchin { int oldSelected = __selected; - Rectangle bounds(0, 0, __size.width, __size.height); - if (bounds.Contains(touchinfo.GetCurrentPosition())) + FloatRectangle bounds(0.0f, 0.0f, __size.width, __size.height); + if (bounds.Contains(touchPosition)) { __selected = true; } @@ -375,7 +391,6 @@ _ContextMenuItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchin } } } - return false; } void @@ -390,7 +405,7 @@ _ContextMenuItem::OnFontChanged(Tizen::Graphics::Font* pFont) } void -_ContextMenuItem::OnFontInfoRequested(unsigned long& style, int& size) +_ContextMenuItem::OnFontInfoRequested(unsigned long& style, float& size) { style = FONT_STYLE_PLAIN; size = __textSize; @@ -415,10 +430,11 @@ _ContextMenuItem::IsSelected() const } void -_ContextMenuItem::Reset() +_ContextMenuItem::SetAndInvalidate(bool flag) { - __selected = false; - __pressed = false; + __selected = flag; + __pressed = flag; + Invalidate(); } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp b/src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp index 7a34ce2..ccf45a2 100644 --- a/src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp @@ -21,15 +21,17 @@ #include #include -#include #include +#include #include -#include "FUiCtrl_ContextMenuListPresenter.h" -#include "FUiCtrl_IActionEventListener.h" -#include "FUiCtrl_ActionEvent.h" -#include "FUi_ResourceManager.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_ResourceManager.h" +#include "FUiCtrl_ActionEvent.h" +#include "FUiCtrl_IActionEventListener.h" + +#include "FUiCtrl_ContextMenuListPresenter.h" using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -47,32 +49,32 @@ _ContextMenuListPresenter::_ContextMenuListPresenter(_ContextMenu* pContextMenu) : __pContextMenu(pContextMenu) , __pModel(null) , __pFont(null) - , __layoutSize(Dimension(0, 0)) + , __layoutSize(FloatDimension(0.0f, 0.0f)) , __touchOutRect(false) , __selectedIndex(-1) , __scrollEnable(false) - , __maxWidth(0) - , __minWidth(0) - , __topMargin(0) - , __bottomMargin(0) - , __leftMargin(0) - , __rightMargin(0) - , __screenTopMargin(0) - , __screenBottomMargin(0) - , __screenLeftMargin(0) - , __screenRightMargin(0) - , __arrowMargin(0) - , __arrowWidth(0) - , __arrowHeight(0) - , __itemWidth(0) - , __itemMinWidth(0) - , __itemHeight(0) - , __itemMaxWidth(0) - , __itemGap(0) - , __itemBitmapWidth(0) - , __itemBitmapHeight(0) - , __itemFontSize(0) - , __dividerHeight(0) + , __maxWidth(0.0f) + , __minWidth(0.0f) + , __topMargin(0.0f) + , __bottomMargin(0.0f) + , __leftMargin(0.0f) + , __rightMargin(0.0f) + , __screenTopMargin(0.0f) + , __screenBottomMargin(0.0f) + , __screenLeftMargin(0.0f) + , __screenRightMargin(0.0f) + , __arrowMargin(0.0f) + , __arrowWidth(0.0f) + , __arrowHeight(0.0f) + , __itemWidth(0.0f) + , __itemMinWidth(0.0f) + , __itemHeight(0.0f) + , __itemMaxWidth(0.0f) + , __itemGap(0.0f) + , __itemBitmapWidth(0.0f) + , __itemBitmapHeight(0.0f) + , __itemFontSize(0.0f) + , __dividerHeight(0.0f) { } @@ -172,7 +174,7 @@ _ContextMenuListPresenter::CreateItem(const Base::String& text, int actionId, co pLabel->SetBackgroundColor(Color(0, 0, 0, 0)); int bitmapY = (__itemHeight - __itemBitmapHeight ) / 2; - pLabel->SetBounds(Rectangle(__leftMargin, bitmapY, __itemBitmapWidth, __itemBitmapHeight)); + pLabel->SetBounds(FloatRectangle(__leftMargin, bitmapY, __itemBitmapWidth, __itemBitmapHeight)); pItem->AttachChild(*pLabel); _AccessibilityContainer* pContainer = pLabel->GetAccessibilityContainer(); if (pContainer) @@ -206,17 +208,17 @@ _ContextMenuListPresenter::CreateItem(const Base::String& text, int actionId, co } // calculate item size - int bitmapWidth = (itemType == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP) ? __itemBitmapWidth : 0; + float bitmapWidth = (itemType == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP) ? __itemBitmapWidth : 0.0f; - Dimension textArea(0, 0); - Dimension itemSize(0, 0); + FloatDimension textArea(0.0f, 0.0f); + FloatDimension itemSize(0.0f, 0.0f); __pFont->GetTextExtent(text, text.GetLength(), textArea); - int labelLeftMargin, labelTopMargin; + float labelLeftMargin = 0.0f, labelTopMargin = 0.0f; GET_SHAPE_CONFIG(LABEL::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, labelLeftMargin); GET_SHAPE_CONFIG(LABEL::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, labelTopMargin); - textArea.width += 2 * labelLeftMargin; - textArea.height += 2 * labelTopMargin; + textArea.width += 2.0f * labelLeftMargin; + textArea.height += 2.0f * labelTopMargin; itemSize.height = __itemHeight + __dividerHeight; itemSize.width = __leftMargin + textArea.width + __rightMargin + bitmapWidth; @@ -226,8 +228,8 @@ _ContextMenuListPresenter::CreateItem(const Base::String& text, int actionId, co pItem->SetSize(itemSize); // add text label - int textLabelX = __leftMargin + bitmapWidth; - int textLabelWidth = textArea.width; + float textLabelX = __leftMargin + bitmapWidth; + float textLabelWidth = textArea.width; pLabel = _Label::CreateLabelN(); pLabel->SetText(text); @@ -236,7 +238,7 @@ _ContextMenuListPresenter::CreateItem(const Base::String& text, int actionId, co pLabel->SetBackgroundColor(Color(0, 0, 0, 0)); itemSize = pItem->GetSize(); - pLabel->SetBounds(Rectangle(textLabelX, (itemSize.height - textArea.height) / 2, textLabelWidth, textArea.height)); + pLabel->SetBounds(FloatRectangle(textLabelX, (itemSize.height - textArea.height) / 2.0f, textLabelWidth, textArea.height)); pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); pLabel->SetTextConfig(__itemFontSize, LABEL_TEXT_STYLE_NORMAL); @@ -391,24 +393,24 @@ _ContextMenuListPresenter::ApplyColorProperty(void) result _ContextMenuListPresenter::CalculateRect(void) { - Tizen::Graphics::Rectangle windowRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // Window Rect is bodyRect + arrowRect - Tizen::Graphics::Rectangle bodyRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // ContextMenu rect except arrowRect - Tizen::Graphics::Rectangle arrowRect = Tizen::Graphics::Rectangle(0, 0, 0, 0); // Arrow rect of the ContextMenu + Tizen::Graphics::FloatRectangle windowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // Window Rect is bodyRect + arrowRect + Tizen::Graphics::FloatRectangle bodyRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // ContextMenu rect except arrowRect + Tizen::Graphics::FloatRectangle arrowRect = Tizen::Graphics::FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); // Arrow rect of the ContextMenu - int bodyTopMargin = __topMargin; - int bodyBottomMargin = __bottomMargin; - int bodyLeftMargin = __leftMargin; - int bodyRightMargin = __rightMargin; + float bodyTopMargin = __topMargin; + float bodyBottomMargin = __bottomMargin; + float bodyLeftMargin = __leftMargin; + float bodyRightMargin = __rightMargin; - int screenTopMargin = __screenTopMargin; - int screenBottomMargin = __screenBottomMargin; - int screenLeftMargin = __screenLeftMargin; - int screenRightMargin = __screenRightMargin; - int arrowMargin = __arrowMargin; + float screenTopMargin = __screenTopMargin; + float screenBottomMargin = __screenBottomMargin; + float screenLeftMargin = __screenLeftMargin; + float screenRightMargin = __screenRightMargin; + float arrowMargin = __arrowMargin; - Point anchorPosition = __pContextMenu->GetAnchorPosition(); + FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE) { screen.SetSize(screen.height, screen.width); @@ -429,10 +431,10 @@ _ContextMenuListPresenter::CalculateRect(void) // calculate body rect // calculate real drawing margin for contextmenu - int leftMargin = screenLeftMargin; - int rightMargin = screen.width - screenRightMargin; - int topMargin = screenTopMargin; - int bottomMargin = screen.height - screenBottomMargin; + float leftMargin = screenLeftMargin; + float rightMargin = screen.width - screenRightMargin; + float topMargin = screenTopMargin; + float bottomMargin = screen.height - screenBottomMargin; // calculate layout size (__layoutSize) AdjustItemLayout(); @@ -466,7 +468,7 @@ _ContextMenuListPresenter::CalculateRect(void) } // Set body position x - bodyRect.x = anchorPosition.x - (bodyRect.width / 2); + bodyRect.x = anchorPosition.x - (bodyRect.width / 2.0f); // - Check left margin if (bodyRect.x <= leftMargin) { @@ -490,11 +492,11 @@ _ContextMenuListPresenter::CalculateRect(void) windowRect.width = bodyRect.width; windowRect.height = bodyRect.height + arrowRect.height; - bodyRect.x = 0; + bodyRect.x = 0.0f; bodyRect.y = arrowMargin; // Set arrow position - arrowRect.x = anchorPosition.x - (arrowRect.width / 2) - windowRect.x; + arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x; arrowRect.y = bodyRect.height; } else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_DOWN) // up Arrow @@ -522,7 +524,7 @@ _ContextMenuListPresenter::CalculateRect(void) } // Set body position x - bodyRect.x = anchorPosition.x - (bodyRect.width / 2); + bodyRect.x = anchorPosition.x - (bodyRect.width / 2.0f); // - Check left margin if (bodyRect.x <= leftMargin) { @@ -546,12 +548,12 @@ _ContextMenuListPresenter::CalculateRect(void) windowRect.width = bodyRect.width; windowRect.height = bodyRect.height + arrowRect.height; - bodyRect.x = 0; + bodyRect.x = 0.0f; bodyRect.y = arrowRect.height - arrowMargin; // Set arrow position - arrowRect.x = anchorPosition.x - (arrowRect.width / 2) - windowRect.x; - arrowRect.y = 0; + arrowRect.x = anchorPosition.x - (arrowRect.width / 2.0f) - windowRect.x; + arrowRect.y = 0.0f; } else if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_LEFT) // right Arrow { @@ -591,7 +593,7 @@ _ContextMenuListPresenter::CalculateRect(void) } // Set body position y - bodyRect.y = anchorPosition.y - (bodyRect.height / 2); + bodyRect.y = anchorPosition.y - (bodyRect.height / 2.0f); // - check top margin if (bodyRect.y <= topMargin) { @@ -609,11 +611,11 @@ _ContextMenuListPresenter::CalculateRect(void) windowRect.height = bodyRect.height; bodyRect.x = arrowMargin; - bodyRect.y = 0; + bodyRect.y = 0.0f; // Set arrow position arrowRect.x = bodyRect.width; - arrowRect.y = anchorPosition.y - (arrowRect.height / 2) - windowRect.y; + arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y; } else // left Arrow { @@ -652,7 +654,7 @@ _ContextMenuListPresenter::CalculateRect(void) bodyRect.x = rightMargin - bodyRect.width; } // Set body position y - bodyRect.y = anchorPosition.y - (bodyRect.height / 2); + bodyRect.y = anchorPosition.y - (bodyRect.height / 2.0f); // - check top margin if (bodyRect.y <= topMargin) { @@ -670,11 +672,11 @@ _ContextMenuListPresenter::CalculateRect(void) windowRect.height = bodyRect.height; bodyRect.x = arrowRect.width - arrowMargin; - bodyRect.y = 0; + bodyRect.y = 0.0f; // Set arrow position - arrowRect.x = 0; - arrowRect.y = anchorPosition.y - (arrowRect.height / 2) - windowRect.y; + arrowRect.x = 0.0f; + arrowRect.y = anchorPosition.y - (arrowRect.height / 2.0f) - windowRect.y; } __pContextMenu->SetBodyRect(bodyRect); @@ -683,21 +685,24 @@ _ContextMenuListPresenter::CalculateRect(void) // _ScrollPanel API call sequence: SetBounds() -> SetScrollAreaBounds() // _Scroll visual interaction if Bounds < ScrollAreaBounds - if (__pContextMenu->IsVisible()) { - __pContextMenu->GetScrollPanel()->SetBounds(Rectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin, __layoutSize.width, __layoutSize.height)); + if (__pContextMenu->IsVisible()) + { + __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin, __layoutSize.width, __layoutSize.height)); int itemCount = __pModel->GetItemCount(); - int itemHeight = __itemHeight + __dividerHeight; - int layoutClientHeight = itemCount * itemHeight - __dividerHeight; + float itemHeight = __itemHeight + __dividerHeight; + float layoutClientHeight = itemCount * itemHeight - __dividerHeight; __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight); } - __pContextMenu->SetMovable(true); // To do Modify a enabling - __pContextMenu->SetResizable(true); // To do Modify a enabling - __pContextMenu->SetMinimumSize(Dimension(0, 0)); // To do Modify - __pContextMenu->SetMaximumSize(screen); // To do Modify + __pContextMenu->SetMovable(true); + __pContextMenu->SetResizable(true); + + __pContextMenu->SetMinimumSize(FloatDimension(0.0f, 0.0f)); + __pContextMenu->SetMaximumSize(screen); __pContextMenu->SetBounds(windowRect); - __pContextMenu->SetMovable(false); // To do Modify a enabling - __pContextMenu->SetResizable(false); // To do Modify a enabling + + __pContextMenu->SetMovable(false); + __pContextMenu->SetResizable(false); return E_SUCCESS; } @@ -705,7 +710,7 @@ _ContextMenuListPresenter::CalculateRect(void) void _ContextMenuListPresenter::AdjustItemLayout(void) { - Dimension layoutSize(0, 0); + FloatDimension layoutSize(0.0f, 0.0f); int itemCount = __pModel->GetItemCount(); if (itemCount <= 0) @@ -717,7 +722,7 @@ _ContextMenuListPresenter::AdjustItemLayout(void) layoutSize = AdjustItemLayoutStyle(); - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); if (__pContextMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE) { screen.SetSize(screen.height, screen.width); @@ -733,18 +738,18 @@ _ContextMenuListPresenter::AdjustItemLayout(void) } -Tizen::Graphics::Dimension +Tizen::Graphics::FloatDimension _ContextMenuListPresenter::AdjustItemLayoutStyle(void) { int itemMaxCount = CalculateShowItemCount(); int itemCount = __pModel->GetItemCount(); - int itemHeight = __itemHeight + __dividerHeight; + float itemHeight = __itemHeight + __dividerHeight; - Dimension layoutSize(__itemWidth, 0); + FloatDimension layoutSize(__itemWidth, 0.0f); - int layoutClientHeight = itemCount * itemHeight - __dividerHeight; - int layoutMaxHeight = itemMaxCount * itemHeight - __dividerHeight; + float layoutClientHeight = itemCount * itemHeight - __dividerHeight; + float layoutMaxHeight = itemMaxCount * itemHeight - __dividerHeight; if (layoutClientHeight > layoutMaxHeight) { __scrollEnable = true; @@ -768,11 +773,11 @@ _ContextMenuListPresenter::AdjustItemPosition(void) return; } - int itemHeight = __itemHeight + __dividerHeight; - int drawItemY = 0; + float itemHeight = __itemHeight + __dividerHeight; + float drawItemY = 0.0f; - int x = __pContextMenu->GetBodyRect().x + __leftMargin; - int y = __pContextMenu->GetBodyRect().y + __topMargin; + float x = __pContextMenu->GetBodyRect().x + __leftMargin; + float y = __pContextMenu->GetBodyRect().y + __topMargin; _ContextMenuItem* pItem = null; @@ -785,12 +790,12 @@ _ContextMenuListPresenter::AdjustItemPosition(void) break; } - Rectangle drawRect(x, drawItemY + y, __itemWidth, itemHeight); + FloatRectangle drawRect(x, drawItemY + y, __itemWidth, itemHeight); pItem->SetDrawRect(drawRect); pItem->SetDivider(true); pItem->SetParentScrollEnable(__scrollEnable); - pItem->SetBounds(Rectangle(0, drawItemY, drawRect.width, drawRect.height)); + pItem->SetBounds(FloatRectangle(0.0f, drawItemY, drawRect.width, drawRect.height)); if (pItem->HasParent() == false) { @@ -802,7 +807,7 @@ _ContextMenuListPresenter::AdjustItemPosition(void) } int -_ContextMenuListPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const +_ContextMenuListPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const { int index = -1; int itemCount = __pModel->GetItemCount(); @@ -814,8 +819,8 @@ _ContextMenuListPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point _ContextMenuItem* pItem = null; - int scrollPosition = __pContextMenu->GetScrollPanel()->GetScrollPosition(); - Point position(point.x, point.y + scrollPosition); + float scrollPosition = __pContextMenu->GetScrollPanel()->GetScrollPosition(); + FloatPoint position(point.x, point.y + scrollPosition); for (int i = 0; i < itemCount; i++) { @@ -826,7 +831,7 @@ _ContextMenuListPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point break; } - Rectangle drawRect = pItem->GetDrawRect(); + FloatRectangle drawRect = pItem->GetDrawRect(); if (drawRect.Contains(position) == true) { @@ -849,8 +854,8 @@ _ContextMenuListPresenter::Draw(void) // Clear canvas for drawing area of the ContextMenu. pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); - Tizen::Graphics::Rectangle bounds(__pContextMenu->GetWindowRect()); - pCanvas->Clear(Tizen::Graphics::Rectangle(0, 0, bounds.width, bounds.height)); + Tizen::Graphics::FloatRectangle bounds(__pContextMenu->GetWindowRect()); + pCanvas->Clear(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); r = DrawBackground(pCanvas); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to draw background."); @@ -870,7 +875,7 @@ _ContextMenuListPresenter::DrawBackground(Canvas* pCanvas) result r = E_SUCCESS; - Tizen::Graphics::Rectangle bodyRect = __pContextMenu->GetBodyRect(); + Tizen::Graphics::FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); const Bitmap* pBackgroundNormalBitmap = __pContextMenu->GetBackgroundNormalBitmap(); const Bitmap* pBackgroundEffectBitmap = __pContextMenu->GetBackgroundEffectBitmap(); @@ -882,14 +887,14 @@ _ContextMenuListPresenter::DrawBackground(Canvas* pCanvas) } else { - if (pBackgroundNormalBitmap != null) + if (pBackgroundEffectBitmap != null) { - r = pCanvas->DrawNinePatchedBitmap(bodyRect, *pBackgroundNormalBitmap); + r = DrawBitmap(*pCanvas, bodyRect, *pBackgroundEffectBitmap); } - if (pBackgroundEffectBitmap != null) + if (pBackgroundNormalBitmap != null) { - r = pCanvas->DrawNinePatchedBitmap(bodyRect, *pBackgroundEffectBitmap); + r = DrawBitmap(*pCanvas, bodyRect, *pBackgroundNormalBitmap); } } @@ -903,20 +908,20 @@ _ContextMenuListPresenter::DrawArrow(Canvas* pCanvas) SysTryReturn(NID_UI_CTRL, pCanvas != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); result r = E_SUCCESS; - Tizen::Graphics::Rectangle arrowRect = __pContextMenu->GetArrowRect(); + Tizen::Graphics::FloatRectangle arrowRect = __pContextMenu->GetArrowRect(); ContextMenuCoreDropPosition dropPosition = __pContextMenu->GetDropPosition(); const Bitmap* pArrowNormalBitmap = __pContextMenu->GetArrowNormalBitmap(dropPosition); const Bitmap* pEffectArrowBitmap = __pContextMenu->GetArrowEffectBitmap(dropPosition); - if (pArrowNormalBitmap != null) + if (pEffectArrowBitmap != null) { - r = DrawBitmap(*pCanvas, arrowRect, *pArrowNormalBitmap); + r = DrawBitmap(*pCanvas, arrowRect, *pEffectArrowBitmap); } - if (pEffectArrowBitmap != null) + if (pArrowNormalBitmap != null) { - r = DrawBitmap(*pCanvas, arrowRect, *pEffectArrowBitmap); + r = DrawBitmap(*pCanvas, arrowRect, *pArrowNormalBitmap); } return r; @@ -931,15 +936,17 @@ _ContextMenuListPresenter::OnPreviewTouchPressed(const _Control& source, const _ bool _ContextMenuListPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Rectangle bodyRect = __pContextMenu->GetBodyRect(); - if (!bodyRect.Contains(touchinfo.GetCurrentPosition())) + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); + + if (!bodyRect.Contains(touchPosition)) { __selectedIndex = -1; __touchOutRect = true; return true; } - __selectedIndex = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + __selectedIndex = GetItemIndexFromPosition(touchPosition); __touchOutRect = false; return true; } @@ -953,16 +960,18 @@ _ContextMenuListPresenter::OnPreviewTouchReleased(const _Control& source, const bool _ContextMenuListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + if (__touchOutRect) { - Rectangle bodyRect = __pContextMenu->GetBodyRect(); - if (!bodyRect.Contains(touchinfo.GetCurrentPosition())) + FloatRectangle bodyRect = __pContextMenu->GetBodyRect(); + if (!bodyRect.Contains(touchPosition)) { __pContextMenu->SetVisibleState(false); } } - int currentSelectedIndex = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + int currentSelectedIndex = GetItemIndexFromPosition(touchPosition); if (__selectedIndex != -1 && (__selectedIndex == currentSelectedIndex)) { _ContextMenuItem* pItem = null; @@ -985,6 +994,7 @@ _ContextMenuListPresenter::OnTouchReleased(const _Control& source, const _TouchI return true; } + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); pActionEvent->Fire(*pEventArg); } @@ -994,11 +1004,6 @@ _ContextMenuListPresenter::OnTouchReleased(const _Control& source, const _TouchI _UiTouchEventDelivery _ContextMenuListPresenter::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - if (__scrollEnable) - { - __selectedIndex = -1; - } - return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } @@ -1039,7 +1044,7 @@ _ContextMenuListPresenter::OnFontChanged(Tizen::Graphics::Font* pFont) } void -_ContextMenuListPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_ContextMenuListPresenter::OnFontInfoRequested(unsigned long& style, float& size) { style = FONT_STYLE_PLAIN; size = __itemFontSize; @@ -1083,7 +1088,7 @@ _ContextMenuListPresenter::SetAllAccessibilityElement(void) } _ContextMenuItemInfo -_ContextMenuListPresenter::GetItemFromPosition(const Point& position) +_ContextMenuListPresenter::GetItemFromPosition(const FloatPoint& position) { _ContextMenuItemInfo itemInfo; int index = GetItemIndexFromPosition(position); @@ -1111,7 +1116,7 @@ _ContextMenuListPresenter::SetTopDrawnItemIndex(int index) } result -_ContextMenuListPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) +_ContextMenuListPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) diff --git a/src/ui/controls/FUiCtrl_ContextMenuModel.cpp b/src/ui/controls/FUiCtrl_ContextMenuModel.cpp index 76e0d4e..fcdb7d3 100644 --- a/src/ui/controls/FUiCtrl_ContextMenuModel.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenuModel.cpp @@ -135,7 +135,7 @@ _ContextMenuModel::RemoveAllItem(void) } void -_ContextMenuModel::ResetAllItem() +_ContextMenuModel::ResetAllItem(void) { int count = __items.GetCount(); @@ -143,7 +143,7 @@ _ContextMenuModel::ResetAllItem() for(int index = 0; index < count; index++) { pItem = static_cast <_ContextMenuItem*>(__items.GetAt(index)); - pItem->Reset(); + pItem->SetAndInvalidate(false); } } @@ -159,9 +159,6 @@ _ContextMenuModel::GetItem(int index) const const _ContextMenuItem* pItem = static_cast (__items.GetAt(index)); return const_cast<_ContextMenuItem*>(pItem); - -// return static_cast <_ContextMenuItem*>(__items.GetAt(index)); } - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_CustomElement.cpp b/src/ui/controls/FUiCtrl_CustomElement.cpp index d1ee42f..16872f2 100644 --- a/src/ui/controls/FUiCtrl_CustomElement.cpp +++ b/src/ui/controls/FUiCtrl_CustomElement.cpp @@ -24,6 +24,7 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_CustomElement.h" #ifdef MEMORY_LEAK_CHECK @@ -52,25 +53,25 @@ _CustomElement::GetElementId(void) const } bool -_CustomElement::DrawElement(Canvas* pCanvas, Rectangle& rect, ListViewItemDrawingStatus status) +_CustomElement::DrawElement(Canvas* pCanvas, FloatRectangle& rect, ListViewItemDrawingStatus status) { bool result = true; switch (status) { case LISTVIEW_ITEM_STATUS_NORMAL: - result = __pElement->OnDraw(*pCanvas, rect, LIST_ITEM_DRAWING_STATUS_NORMAL); + result = __pElement->OnDraw(*pCanvas, _CoordinateSystemUtils::ConvertToInteger(rect), LIST_ITEM_DRAWING_STATUS_NORMAL); break; case LISTVIEW_ITEM_STATUS_PRESSED: - result = __pElement->OnDraw(*pCanvas, rect, LIST_ITEM_DRAWING_STATUS_PRESSED); + result = __pElement->OnDraw(*pCanvas, _CoordinateSystemUtils::ConvertToInteger(rect), LIST_ITEM_DRAWING_STATUS_PRESSED); break; case LISTVIEW_ITEM_STATUS_HIGHLIGHTED: - result = __pElement->OnDraw(*pCanvas, rect, LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED); + result = __pElement->OnDraw(*pCanvas, _CoordinateSystemUtils::ConvertToInteger(rect), LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED); break; default: - result = __pElement->OnDraw(*pCanvas, rect, LIST_ITEM_DRAWING_STATUS_NORMAL); + result = __pElement->OnDraw(*pCanvas, _CoordinateSystemUtils::ConvertToInteger(rect), LIST_ITEM_DRAWING_STATUS_NORMAL); break; } diff --git a/src/ui/controls/FUiCtrl_CustomItemImpl.cpp b/src/ui/controls/FUiCtrl_CustomItemImpl.cpp index 17c3292..4406512 100644 --- a/src/ui/controls/FUiCtrl_CustomItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_CustomItemImpl.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_CustomElement.h" #include "FUiCtrl_CustomItemImpl.h" @@ -63,7 +64,7 @@ _CustomItemImpl::GetPublicClassName(void) const } _CustomItemImpl* -_CustomItemImpl::CreateCustomItemImplN(CustomItem* pPublic, const Dimension& itemSize, ListAnnexStyle style) +_CustomItemImpl::CreateCustomItemImplN(CustomItem* pPublic, const FloatDimension& itemSize, ListAnnexStyle style) { result r = E_SUCCESS; @@ -83,7 +84,7 @@ CATCH: } result -_CustomItemImpl::Construct(const Dimension& itemSize, ListAnnexStyle style) +_CustomItemImpl::Construct(const FloatDimension& itemSize, ListAnnexStyle style) { result r = _ListItemBaseImpl::Construct(itemSize, style); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -94,22 +95,22 @@ _CustomItemImpl::Construct(const Dimension& itemSize, ListAnnexStyle style) } result -_CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const EnrichedText& text) +_CustomItemImpl::AddElement(const FloatRectangle& rect, int elementId, const EnrichedText& text) { _ListViewItem* pItem = GetListViewItem(); - SysTryReturn(NID_UI_CTRL, (rect.width >= 0) && (rect.height >= 0), E_INVALID_ARG, E_INVALID_ARG, - ("[E_INVALID_ARG] The width and height should be greater than 0.")); + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, + ("[E_INVALID_ARG] The width and height should be greater than 0.0f.")); SysTryReturn(NID_UI_CTRL, (elementId >= 0) && (elementId <= Integer::VALUE_MAX), E_INVALID_ARG, E_INVALID_ARG, ("E_INVALID_ARG] The element ID should not be less than 0.")); - Rectangle bounds = rect; + FloatRectangle bounds = rect; ListAnnexStyle style = GetListItemAnnexStyle(); if (style == LIST_ANNEX_STYLE_MARK || style == LIST_ANNEX_STYLE_RADIO) { - int elementLeftMargin = 0; + float elementLeftMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, elementLeftMargin); bounds.x += GetAnnexWidth(style) + elementLeftMargin; @@ -124,22 +125,22 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const Enriched } result -_CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& text, bool textSliding) +_CustomItemImpl::AddElement(const FloatRectangle& rect, int elementId, const String& text, bool textSliding) { _ListViewItem* pItem = GetListViewItem(); - SysTryReturn(NID_UI_CTRL, (rect.width >= 0) && (rect.height >= 0), E_INVALID_ARG, E_INVALID_ARG, + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] The width and height should be greater than 0.")); SysTryReturn(NID_UI_CTRL, (elementId >= 0) && (elementId <= Integer::VALUE_MAX), E_INVALID_ARG, E_INVALID_ARG, ("E_INVALID_ARG] The element ID should not be less than 0.")); - Rectangle bounds = rect; + FloatRectangle bounds = rect; ListAnnexStyle style = GetListItemAnnexStyle(); if (style == LIST_ANNEX_STYLE_MARK || style == LIST_ANNEX_STYLE_RADIO) { - int elementLeftMargin = 0; + float elementLeftMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, elementLeftMargin); bounds.x += GetAnnexWidth(style) + elementLeftMargin; @@ -148,7 +149,7 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& result r = pItem->AddElement(bounds, elementId, text, textSliding); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - if (textSliding == true) + if (textSliding) { pItem->SetTextWrapType(elementId, TEXT_OBJECT_WRAP_TYPE_NONE); } @@ -157,25 +158,25 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& } result -_CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& text, int textSize, +_CustomItemImpl::AddElement(const FloatRectangle& rect, int elementId, const String& text, float textSize, const Color& normalTextColor, const Color& pressedTextColor, const Color& highlightedTextColor, bool textSliding) { _ListViewItem* pItem = GetListViewItem(); - SysTryReturn(NID_UI_CTRL, (rect.width >= 0) && (rect.height >= 0), E_INVALID_ARG, E_INVALID_ARG, - ("[E_INVALID_ARG] The width and height should be greater than 0.")); + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, + ("[E_INVALID_ARG] The width and height should be greater than 0.0f.")); SysTryReturn(NID_UI_CTRL, (elementId >= 0) && (elementId <= Integer::VALUE_MAX), E_INVALID_ARG, E_INVALID_ARG, ("E_INVALID_ARG] The element ID should not be less than 0.")); - Rectangle bounds = rect; + FloatRectangle bounds = rect; ListAnnexStyle style = GetListItemAnnexStyle(); bool ret; result r = E_SUCCESS; if (style == LIST_ANNEX_STYLE_MARK || style == LIST_ANNEX_STYLE_RADIO) { - int elementLeftMargin = 0; + float elementLeftMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, elementLeftMargin); bounds.x += GetAnnexWidth(style) + elementLeftMargin; @@ -196,7 +197,7 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& ret = pItem->SetTextColor(elementId, highlightedTextColor, LISTVIEW_ITEM_STATUS_HIGHLIGHTED); SysTryCatch(NID_UI_CTRL, (ret == true), (r = E_SYSTEM), E_SYSTEM, ("[E_SYSTEM] Unable to add element.")); - if (textSliding == true) + if (textSliding) { pItem->SetTextWrapType(elementId, TEXT_OBJECT_WRAP_TYPE_NONE); } @@ -204,7 +205,7 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const String& return E_SUCCESS; CATCH: - if (pItem->DeleteElement(elementId) == false) + if (!pItem->DeleteElement(elementId)) { SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(GetLastResult())); } @@ -213,23 +214,23 @@ CATCH: } result -_CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, +_CustomItemImpl::AddElement(const FloatRectangle& rect, int elementId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap) { _ListViewItem* pItem = GetListViewItem(); - SysTryReturn(NID_UI_CTRL, (rect.width >= 0) && (rect.height >= 0), E_INVALID_ARG, E_INVALID_ARG, - ("[E_INVALID_ARG] The width and height should be greater than 0.")); + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, + ("[E_INVALID_ARG] The width and height should be greater than 0.0f.")); SysTryReturn(NID_UI_CTRL, (elementId >= 0) && (elementId <= Integer::VALUE_MAX), E_INVALID_ARG, E_INVALID_ARG, ("E_INVALID_ARG] The element ID should not be less than 0.")); - Rectangle bounds = rect; + FloatRectangle bounds = rect; ListAnnexStyle style = GetListItemAnnexStyle(); if (style == LIST_ANNEX_STYLE_MARK || style == LIST_ANNEX_STYLE_RADIO) { - int elementLeftMargin = 0; + float elementLeftMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, elementLeftMargin); bounds.x += GetAnnexWidth(style) + elementLeftMargin; @@ -242,23 +243,23 @@ _CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const Bitmap& } result -_CustomItemImpl::AddElement(const Rectangle& rect, int elementId, const ICustomElement& element) +_CustomItemImpl::AddElement(const FloatRectangle& rect, int elementId, const ICustomElement& element) { _ListViewItem* pItem = GetListViewItem(); - SysTryReturn(NID_UI_CTRL, (rect.width >= 0) && (rect.height >= 0), E_INVALID_ARG, E_INVALID_ARG, - ("[E_INVALID_ARG] The width and height should be greater than 0.")); + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, + ("[E_INVALID_ARG] The width and height should be greater than 0.0f")); SysTryReturn(NID_UI_CTRL, (elementId >= 0) && (elementId <= Integer::VALUE_MAX), E_INVALID_ARG, E_INVALID_ARG, ("E_INVALID_ARG] The element ID should not be less than 0.")); _CustomElement* pCustomElement = null; - Rectangle bounds = rect; + FloatRectangle bounds = rect; ListAnnexStyle style = GetListItemAnnexStyle(); if (style == LIST_ANNEX_STYLE_MARK || style == LIST_ANNEX_STYLE_RADIO) { - int elementLeftMargin = 0; + float elementLeftMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, elementLeftMargin); bounds.x += GetAnnexWidth(style) + elementLeftMargin; diff --git a/src/ui/controls/FUiCtrl_CustomListElements.cpp b/src/ui/controls/FUiCtrl_CustomListElements.cpp index 5e57bdc..da9d476 100644 --- a/src/ui/controls/FUiCtrl_CustomListElements.cpp +++ b/src/ui/controls/FUiCtrl_CustomListElements.cpp @@ -382,7 +382,7 @@ _TextElementView::OnDraw(void) if (IsEnabled() == false) { - GET_COLOR_CONFIG(LIST::LIST_ELEMENT_TEXT_DISABLED_COLOR, textColor); + GET_COLOR_CONFIG(LIST::ELEMENT_TEXT_DISABLED, textColor); } pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); diff --git a/src/ui/controls/FUiCtrl_CustomListImpl.cpp b/src/ui/controls/FUiCtrl_CustomListImpl.cpp index f7f2d1e..e11d863 100644 --- a/src/ui/controls/FUiCtrl_CustomListImpl.cpp +++ b/src/ui/controls/FUiCtrl_CustomListImpl.cpp @@ -91,11 +91,13 @@ _CustomListItemDataProvider::CreateItem(int index, int itemWidth) bool _CustomListItemDataProvider::DeleteItem(const int itemIndex, TableViewItem* pItem) { - _TableViewItemData* pTableViewItemData = dynamic_cast<_TableViewItemData*>(pItem); - delete pTableViewItemData; + delete pItem; - CustomListItem* pCustomListItem = __pList->GetCustomListItemAt(-1, itemIndex); - pCustomListItem->__pCustomListItemImpl->__pTableViewItemData = null; + if (__pList->__directDelete == false) + { + CustomListItem* pCustomListItem = __pList->GetCustomListItemAt(-1, itemIndex); + pCustomListItem->__pCustomListItemImpl->__pTableViewItemData = null; + } return true; } @@ -136,6 +138,8 @@ _CustomListImpl::GetInstance(const CustomList& customList) _CustomListImpl::_CustomListImpl(Control* pList, _TableView* pCore) : _ListBaseImpl(pList, pCore) , __pItemProvider(null) + , __directDelete(false) + { } @@ -365,11 +369,15 @@ result _CustomListImpl::RemoveItemAt(int index) { result r = E_SUCCESS; + int groupIndex = 0; SysTryReturnResult(NID_UI_CTRL, (index >= 0 && index < GetItemCount()), E_INVALID_ARG, "The index %d is invalid.", index); - int groupIndex = 0; + r = RemoveFromItemsList(-1, index); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to remove an item."); + + __directDelete = true; if (GetCore().GetFirstDrawnFlag() == false) { @@ -377,8 +385,7 @@ _CustomListImpl::RemoveItemAt(int index) SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Propagating."); } - r = RemoveFromItemsList(-1, index); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to remove an item."); + __directDelete = false; return r; } diff --git a/src/ui/controls/FUiCtrl_CustomListItemImpl.cpp b/src/ui/controls/FUiCtrl_CustomListItemImpl.cpp index 1de425b..8e1195d 100644 --- a/src/ui/controls/FUiCtrl_CustomListItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_CustomListItemImpl.cpp @@ -497,6 +497,13 @@ _CustomListItemImpl::SetBackgroundBitmap(const Bitmap& bitmap, TableViewItemDraw SysTryReturnVoidResult(NID_UI_CTRL, returnValue == true, r, "[%s] Propagating.", GetErrorMessage(r)); } + else if (__pTableViewGroupItemData) + { + bool returnValue = __pTableViewGroupItemData->SetBackgroundBitmap(__pBitmaps[status], status); + result r = GetLastResult(); + + SysTryReturnVoidResult(NID_UI_CTRL, returnValue == true, r, "[%s] Propagating.", GetErrorMessage(r)); + } SetLastResult(E_SUCCESS); return; diff --git a/src/ui/controls/FUiCtrl_DatePickerImpl.cpp b/src/ui/controls/FUiCtrl_DatePickerImpl.cpp index b7fd824..3653687 100644 --- a/src/ui/controls/FUiCtrl_DatePickerImpl.cpp +++ b/src/ui/controls/FUiCtrl_DatePickerImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DatePickerImpl.cpp * @brief This is the implementation file for the _DatePickerImpl class. @@ -39,13 +40,13 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { -Dimension -_DatePickerImpl::DatePickerSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const +FloatDimension +_DatePickerImpl::DatePickerSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -56,13 +57,13 @@ _DatePickerImpl::DatePickerSizeInfo::GetDefaultMinimumSize(_ControlOrientation o return pickerSize; } -Dimension -_DatePickerImpl::DatePickerSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const +FloatDimension +_DatePickerImpl::DatePickerSizeInfo::GetDefaultMaximumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -386,7 +387,7 @@ _DatePickerImpl::OnAttachedToMainTree(void) } SetVisibleState(true); - _WindowImpl::OnAttachedToMainTree(); + _WindowImpl::OnAttachedToMainTree(); return r; } diff --git a/src/ui/controls/FUiCtrl_DateTimeBar.cpp b/src/ui/controls/FUiCtrl_DateTimeBar.cpp index 017e782..402f785 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBar.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBar.cpp @@ -29,6 +29,7 @@ #include "FUiCtrl_ActionEvent.h" #include "FUiCtrl_Frame.h" #include "FUiCtrl_Form.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Media; @@ -45,13 +46,25 @@ _DateTimeBar::_DateTimeBar(void) , __alignment(DATETIME_BAR_ALIGN_DOWN) , __pDateTimeChangeEvent(null) , __pGestureFlick(null) - , __parentWindowBounds(0, 0, 0, 0) + , __parentWindowBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __isAttachedToMainTree(false) + , __ownerInputEnableState(false) { } _DateTimeBar::~_DateTimeBar(void) { + _Control* pOwner = null; + pOwner = GetOwner(); + + if (__isAttachedToMainTree == true && pOwner != null) + { + pOwner->SetInputEventEnableState(__ownerInputEnableState); + } + + ReleaseTouchCapture(); + if (__pDateTimeChangeEvent != null) { delete __pDateTimeChangeEvent; @@ -85,10 +98,11 @@ _DateTimeBar::CreateDateTimeBarN(void) SysTryReturn(NID_UI_CTRL, pDateTimeBar != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -#if defined(MULTI_WINDOW) r = pDateTimeBar->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif + + // if SetActivationEnabled is removed, then remove IsActivatedOnOpen CallBack as well. + pDateTimeBar->SetActivationEnabled(false); pDateTimeBar->__pDateTimeBarPresenter = _DateTimeBarPresenter::CreateInstanceN(*pDateTimeBar); r = GetLastResult(); @@ -124,8 +138,14 @@ CATCH: return null; } +bool +_DateTimeBar::IsActivatedOnOpen(void) const +{ + return false; +} + result -_DateTimeBar::SetPositionAndAlignment(const Point& point, _DateTimeBarAlignment alignment) +_DateTimeBar::SetPositionAndAlignment(const FloatPoint& point, _DateTimeBarAlignment alignment) { ClearLastResult(); @@ -135,7 +155,7 @@ _DateTimeBar::SetPositionAndAlignment(const Point& point, _DateTimeBarAlignment r = __pDateTimeBarPresenter->LoadArrowBitmap(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - int height = 0; + float height = 0.0f; r = GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, GetOrientation(), height); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -145,12 +165,12 @@ _DateTimeBar::SetPositionAndAlignment(const Point& point, _DateTimeBarAlignment if (alignment == DATETIME_BAR_ALIGN_DOWN) { - SetPosition(Point(point.x, point.y)); + SetPosition(FloatPoint(point.x, point.y)); } else { - SetPosition(Point(point.x, point.y - height)); + SetPosition(FloatPoint(point.x, point.y - height)); } __pDateTimeBarPresenter->CalculateWindowBounds(); @@ -336,14 +356,14 @@ _DateTimeBar::FireActionEvent(int actionId) } result -_DateTimeBar::CalculateArrowBounds(const Rectangle& bounds) +_DateTimeBar::CalculateArrowBounds(const FloatRectangle& bounds) { ClearLastResult(); - Rectangle arrowBounds(0, 0, 0, 0); + FloatRectangle arrowBounds(0.0f, 0.0f, 0.0f, 0.0f); arrowBounds = __pDateTimeBarPresenter->GetArrowBounds(); - arrowBounds.x = bounds.x + (bounds.width / 2) - (arrowBounds.width / 2); + arrowBounds.x = bounds.x + (bounds.width / 2.0f) - (arrowBounds.width / 2.0f); arrowBounds.x -= __pDateTimeBarPresenter->GetWindowBounds().x; __pDateTimeBarPresenter->SetArrowBounds(arrowBounds); @@ -390,7 +410,6 @@ _DateTimeBar::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) int yDistance = 0; gesture.GetDistance(xDistance, yDistance); int duration = gesture.GetDuration(); - return __pDateTimeBarPresenter->OnFlickGestureDetected(xDistance, yDistance, duration); } @@ -409,45 +428,24 @@ _DateTimeBar::OnTouchMoveHandled(const Tizen::Ui::_Control& control) } result -_DateTimeBar::OnAttachingToMainTree(const _Control* pParent) +_DateTimeBar::OnAttachedToMainTree(void) { if (GetOwner() == null) { - _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); - SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, - E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); + _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); + SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available."); _Form* pForm = pFrame->GetCurrentForm(); - if (pForm != null) - { - SetOwner(pForm); - } - else - { - SetOwner(pFrame); - } + pForm != null ? SetOwner(pForm) : SetOwner(pFrame); } - return _Window::OnAttachingToMainTree(pParent); -} - -result -_DateTimeBar::OnAttachedToMainTree(void) -{ - _Window::OnAttachedToMainTree(); - return E_SUCCESS; -} - -result -_DateTimeBar::OnDetachingFromMainTree(void) -{ - return _Window::OnDetachingFromMainTree(); -} + _Control* pOwner = GetOwner(); -void -_DateTimeBar::OnActivated(void) -{ - _Window::OnActivated(); + if (pOwner != null && __isAttachedToMainTree == false) + { + __ownerInputEnableState = pOwner->GetInputEnableState(); + pOwner->SetInputEventEnableState(false); + } int itemWidth = 0; @@ -469,19 +467,30 @@ _DateTimeBar::OnActivated(void) __pDateTimeBarPresenter->StartAnimationEffect(); SetTouchCapture(); - return; + + __isAttachedToMainTree = true; + + return _Window::OnAttachedToMainTree(); } -void -_DateTimeBar::OnDeactivated(void) +result +_DateTimeBar::OnDetachingFromMainTree(void) { ReleaseTouchCapture(); - _Window::OnDeactivated(); - return; + _Control* pOwner = GetOwner(); + + if (pOwner != null) + { + pOwner->SetInputEventEnableState(__ownerInputEnableState); + } + + __isAttachedToMainTree = false; + + return _Window::OnDetachingFromMainTree(); } void -_DateTimeBar::AddAccessibilityElement(const Rectangle& itemBounds, const Tizen::Base::String& itemText) +_DateTimeBar::AddAccessibilityElement(const FloatRectangle& itemBounds, const String& itemText) { if (likely(!(_AccessibilityManager::IsActivated()))) { @@ -626,13 +635,13 @@ _DateTimeBar::SetFont(Font& pFont) } void -_DateTimeBar::SetParentWindowBounds(Rectangle& parentWindowBounds) +_DateTimeBar::SetParentWindowBounds(FloatRectangle& parentWindowBounds) { __parentWindowBounds = parentWindowBounds; return; } -Rectangle +FloatRectangle _DateTimeBar::GetParentWindowBounds() const { return __parentWindowBounds; @@ -651,11 +660,15 @@ _DateTimeBar::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& c } bool -_DateTimeBar::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_DateTimeBar::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} +bool +_DateTimeBar::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } - bool _DateTimeBar::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) { diff --git a/src/ui/controls/FUiCtrl_DateTimeBarItem.cpp b/src/ui/controls/FUiCtrl_DateTimeBarItem.cpp index bbc3914..05ce9c0 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBarItem.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBarItem.cpp @@ -31,7 +31,7 @@ _DateTimeBarItem::_DateTimeBarItem(void) : __actionId(-1) , __text() , __status(DATETIMEBAR_ITEM_STATUS_NORMAL) - , __bounds(Rectangle()) + , __bounds(FloatRectangle()) { ClearLastResult(); } @@ -41,7 +41,7 @@ _DateTimeBarItem::~_DateTimeBarItem(void) } _DateTimeBarItem* -_DateTimeBarItem::CreateInstanceN(_DateTimeBarAlignment alignment, int itemWidth) +_DateTimeBarItem::CreateInstanceN(_DateTimeBarAlignment alignment, float itemWidth) { _DateTimeBarItem* pItem = new (std::nothrow) _DateTimeBarItem; SysTryReturn(NID_UI_CTRL, pItem != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -106,13 +106,13 @@ _DateTimeBarItem::GetStatus(void) const } void -_DateTimeBarItem::SetBounds(const Tizen::Graphics::Rectangle& bounds) +_DateTimeBarItem::SetBounds(const Tizen::Graphics::FloatRectangle& bounds) { __bounds = bounds; return; } -Rectangle +FloatRectangle _DateTimeBarItem::GetBounds(void) const { return __bounds; diff --git a/src/ui/controls/FUiCtrl_DateTimeBarModel.cpp b/src/ui/controls/FUiCtrl_DateTimeBarModel.cpp index 7de82a3..e0ab80d 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBarModel.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBarModel.cpp @@ -94,7 +94,7 @@ _DateTimeBarModel::GetItemCount(void) const } result -_DateTimeBarModel::AddItem(const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, int itemWidth, int margin) +_DateTimeBarModel::AddItem(const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, float itemWidth, float margin) { _DateTimeBarItem* pItem = _DateTimeBarItem::CreateInstanceN(alignment, itemWidth); @@ -115,8 +115,7 @@ _DateTimeBarModel::AddItem(const Tizen::Base::String& text, int actionId, _DateT } else { - Rectangle itemBounds = pItem->GetBounds(); - + FloatRectangle itemBounds = pItem->GetBounds(); itemBounds.x = __itemStartPositionX; pItem->SetBounds(itemBounds); @@ -124,8 +123,8 @@ _DateTimeBarModel::AddItem(const Tizen::Base::String& text, int actionId, _DateT if (pPrevItem != null) { - Rectangle prevItemBounds = pPrevItem->GetBounds(); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle prevItemBounds = pPrevItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); itemBounds.x = prevItemBounds.x + prevItemBounds.width + margin; pItem->SetBounds(itemBounds); @@ -135,7 +134,7 @@ _DateTimeBarModel::AddItem(const Tizen::Base::String& text, int actionId, _DateT } result -_DateTimeBarModel::InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, int itemWidth, int margin) +_DateTimeBarModel::InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, float itemWidth, float margin) { _DateTimeBarItem* pItem = _DateTimeBarItem::CreateInstanceN(alignment, itemWidth); @@ -148,8 +147,8 @@ _DateTimeBarModel::InsertItemAt(int index, const Tizen::Base::String& text, int _DateTimeBarItem* pPrevItem = GetItemAt(index); if (pPrevItem != null) { - Rectangle prevItemBounds = pPrevItem->GetBounds(); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle prevItemBounds = pPrevItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); itemBounds.x = prevItemBounds.x - itemBounds.width - margin; pItem->SetBounds(itemBounds); @@ -226,7 +225,7 @@ _DateTimeBarModel::GetMaxCachingSize(void) const } result -_DateTimeBarModel::SetItemStartPosition(int positionX) +_DateTimeBarModel::SetItemStartPosition(float positionX) { __itemStartPositionX = positionX; return E_SUCCESS; diff --git a/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp b/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp index a8b1094..a87dca7 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBarPresenter.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_DateTimeUtils.h" #include "FUiCtrl_DateTimeBar.h" @@ -42,16 +43,18 @@ namespace Tizen { namespace Ui { namespace Controls _DateTimeBarPresenter::_DateTimeBarPresenter(_DateTimeBar* pDateTimeBar) : __pDateTimeBar(pDateTimeBar) , __pDateTimeBarModel(null) - , __currentPoint(Point(0, 0)) + , __currentPoint(FloatPoint(0.0f, 0.0f)) , __isTouchMoved(false) , __touchMoveHandled(false) - , __distance(0) + , __isFlickEnabled(true) + , __isFlickInProgress(false) + , __distance(0.0f) , __pFlickAnimationTimer(null) , __flickAnimation() , __selectedText(L"") - , __bodyAreaBounds(Rectangle()) - , __arrowAreaBounds(Rectangle()) - , __windowAreaBounds(Rectangle()) + , __bodyAreaBounds(FloatRectangle()) + , __arrowAreaBounds(FloatRectangle()) + , __windowAreaBounds(FloatRectangle()) , __pBgColorReplacementBitmap(null) , __pArrowColorReplacementBitmap(null) , __isInitialAnimation(false) @@ -216,10 +219,10 @@ _DateTimeBarPresenter::Draw(void) r = DrawBackground(*pCanvas); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = DrawArrow(*pCanvas); + r = DrawItem(*pCanvas); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = DrawItem(*pCanvas); + r = DrawArrow(*pCanvas); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pCanvas; @@ -235,13 +238,12 @@ _DateTimeBarPresenter::DrawItem(Canvas& canvas) { result r = E_SUCCESS; - Rectangle clientBounds = canvas.GetBounds(); + FloatRectangle clientBounds = canvas.GetBoundsF(); _DateTimeBarItem* pDrawItem = null; - Rectangle itemBounds(0, 0, 0, 0); + FloatRectangle itemBounds(0.0f, 0.0f, 0.0f, 0.0f); String drawText; - Rectangle textAreaBounds(0, 0, 0, 0); Color textColor; GET_COLOR_CONFIG(DATETIMEBAR::TEXT_NORMAL, textColor); @@ -270,8 +272,6 @@ _DateTimeBarPresenter::DrawItem(Canvas& canvas) continue; } - textAreaBounds = Rectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height); - drawText = pDrawItem->GetText(); if (drawText.CompareTo(__selectedText) == 0) @@ -312,12 +312,12 @@ _DateTimeBarPresenter::DrawItem(Canvas& canvas) pTextObject->SetForegroundColor(textColor, 0, pTextObject->GetTextLength()); } - pTextObject->SetBounds(textAreaBounds); + pTextObject->SetBounds(itemBounds); pTextObject->Draw(*_CanvasImpl::GetInstance(canvas)); delete pTextObject; - if ((textAreaBounds.x + textAreaBounds.width + GetLeftRightMargin()) >= clientBounds.width) + if ((itemBounds.x + itemBounds.width + GetLeftRightMargin()) >= clientBounds.width) { break; } @@ -331,7 +331,7 @@ _DateTimeBarPresenter::DrawBackground(Canvas& canvas) { result r = E_SUCCESS; - Rectangle bodyAreaBounds = GetBodyBounds(); + FloatRectangle bodyAreaBounds = GetBodyBounds(); if (__pBgColorReplacementBitmap != null) { @@ -360,7 +360,7 @@ result _DateTimeBarPresenter::DrawArrow(Canvas& canvas) { result r = E_SUCCESS; - Rectangle arrowAreaBounds = GetArrowBounds(); + FloatRectangle arrowAreaBounds = GetArrowBounds(); if (__pArrowColorReplacementBitmap != null) { @@ -393,9 +393,9 @@ _DateTimeBarPresenter::GetSelectedItemIndex(void) const } int -_DateTimeBarPresenter::GetItemIndexFromPosition(const Point& point) const +_DateTimeBarPresenter::GetItemIndexFromPosition(const FloatPoint& point) const { - Rectangle clientBounds = __pDateTimeBar->GetBounds(); + FloatRectangle clientBounds = __pDateTimeBar->GetBoundsF(); if (point.x > clientBounds.width || point.y > clientBounds.height) @@ -405,11 +405,11 @@ _DateTimeBarPresenter::GetItemIndexFromPosition(const Point& point) const int itemIndex = __pDateTimeBarModel->GetFirstDrawnItemIndex(); _DateTimeBarItem* pItem = __pDateTimeBarModel->GetItemAt(itemIndex); - int startX = 0; + float startX = 0.0f; while (pItem != null) { - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); if (itemBounds.x > clientBounds.x) { @@ -504,14 +504,14 @@ _DateTimeBarPresenter::SetMaximumValue(int maxValue) return; } -int +float _DateTimeBarPresenter::GetItemWidth(void) const { result r = E_SUCCESS; _DateTimeId boxId = __pDateTimeBar->GetSelectedBoxId(); - int itemWidth = 0; + float itemWidth = 0.0f; if (boxId == DATETIME_ID_YEAR) { @@ -525,7 +525,7 @@ _DateTimeBarPresenter::GetItemWidth(void) const { GET_SHAPE_CONFIG(DATETIMEBAR::MONTH_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth); - Dimension textArea; + FloatDimension textArea; int fontSize = 0; GET_SHAPE_CONFIG(DATETIMEBAR::MONTH_FONT_SIZE, __pDateTimeBar->GetOrientation(), fontSize); @@ -554,10 +554,10 @@ _DateTimeBarPresenter::GetItemWidth(void) const return itemWidth; } -int +float _DateTimeBarPresenter::GetFontSize(void) const { - int fontSize = 0; + float fontSize = 0.0f; _DateTimeId boxId = __pDateTimeBar->GetSelectedBoxId(); if (boxId == DATETIME_ID_YEAR) @@ -576,10 +576,10 @@ _DateTimeBarPresenter::GetFontSize(void) const return fontSize; } -int +float _DateTimeBarPresenter::GetLeftRightMargin(void) const { - int leftRightMargin = 0; + float leftRightMargin = 0.0f; _DateTimeId boxId = __pDateTimeBar->GetSelectedBoxId(); if (boxId == DATETIME_ID_YEAR) @@ -598,10 +598,10 @@ _DateTimeBarPresenter::GetLeftRightMargin(void) const return leftRightMargin; } -int +float _DateTimeBarPresenter::GetItemMargin(void) const { - int margin = 0; + float margin = 0.0f; _DateTimeId boxId = __pDateTimeBar->GetSelectedBoxId(); if (boxId == DATETIME_ID_YEAR) @@ -621,7 +621,7 @@ _DateTimeBarPresenter::GetItemMargin(void) const } result -_DateTimeBarPresenter::AdjustItemPosition(int distance) +_DateTimeBarPresenter::AdjustItemPosition(float distance) { int index = 0; @@ -630,7 +630,7 @@ _DateTimeBarPresenter::AdjustItemPosition(int distance) while (pItem != null) { - Rectangle bounds = pItem->GetBounds(); + FloatRectangle bounds = pItem->GetBounds(); bounds.x += distance; pItem->SetBounds(bounds); index++; @@ -679,12 +679,12 @@ _DateTimeBarPresenter::AddItems(int actionId) int firstDrawItemIndex = cachingSize; int value = actionId; - int startPosition = 0; - int itemWidth = GetItemWidth(); - int itemMargin = GetItemMargin(); + float startPosition = 0.0f; + float itemWidth = GetItemWidth(); + float itemMargin = GetItemMargin(); - startPosition = (GetWindowBounds().width) / 2; - startPosition = startPosition + (itemWidth / 2) + itemMargin; + startPosition = (GetWindowBounds().width) / 2.0f; + startPosition = startPosition + (itemWidth / 2.0f) + itemMargin; __pDateTimeBarModel->SetItemStartPosition(startPosition); while (cachingSize > 0) @@ -731,8 +731,8 @@ _DateTimeBarPresenter::InsertItems(int actionId) int cachingSize = __pDateTimeBarModel->GetMaxCachingSize() / 2; int value = actionId; - int itemWidth = GetItemWidth(); - int itemMargin = GetItemMargin(); + float itemWidth = GetItemWidth(); + float itemMargin = GetItemMargin(); while (cachingSize > 0) { @@ -836,12 +836,11 @@ result _DateTimeBarPresenter::CalculateWindowBounds(void) { _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); - Rectangle windowAreaBounds = Rectangle(0, 0, 0, 0); - Rectangle bodyAreaBounds = Rectangle(0, 0, 0, 0); - Rectangle arrowAreaBounds = Rectangle(0, 0, 0, 0); + FloatRectangle windowAreaBounds = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle bodyAreaBounds = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle arrowAreaBounds = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); - Rectangle parentWindowBounds = __pDateTimeBar->GetParentWindowBounds(); - int itemHeight = 0; + FloatRectangle parentWindowBounds = __pDateTimeBar->GetParentWindowBounds(); arrowAreaBounds = GetArrowBounds(); @@ -849,26 +848,24 @@ _DateTimeBarPresenter::CalculateWindowBounds(void) GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, orientation, arrowAreaBounds.height); GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_WIDTH, orientation, arrowAreaBounds.width); - - GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, orientation, itemHeight); + GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, orientation, bodyAreaBounds.height); bodyAreaBounds.width = parentWindowBounds.width; - bodyAreaBounds.height = itemHeight; - bodyAreaBounds.x = 0; - Point tempPoint = __pDateTimeBar->GetPosition(); + bodyAreaBounds.x = 0.0f; + FloatPoint tempPoint = __pDateTimeBar->GetPositionF(); windowAreaBounds.x = tempPoint.x; if (__pDateTimeBar->GetAlignment() == DATETIME_BAR_ALIGN_DOWN) { bodyAreaBounds.y = arrowAreaBounds.height; - arrowAreaBounds.y = 0; + arrowAreaBounds.y = 0.0f; windowAreaBounds.y = tempPoint.y - arrowAreaBounds.height; } else { arrowAreaBounds.y = bodyAreaBounds.height; - bodyAreaBounds.y = 0; + bodyAreaBounds.y = 0.0f; windowAreaBounds.y = tempPoint.y; } @@ -888,39 +885,39 @@ _DateTimeBarPresenter::CalculateWindowBounds(void) } void -_DateTimeBarPresenter::SetBodyBounds(const Rectangle& bounds) +_DateTimeBarPresenter::SetBodyBounds(const FloatRectangle& bounds) { __bodyAreaBounds = bounds; return; } -Rectangle +FloatRectangle _DateTimeBarPresenter::GetBodyBounds(void) const { return __bodyAreaBounds; } void -_DateTimeBarPresenter::SetArrowBounds(const Rectangle& bounds) +_DateTimeBarPresenter::SetArrowBounds(const FloatRectangle& bounds) { __arrowAreaBounds = bounds; return; } -Rectangle +FloatRectangle _DateTimeBarPresenter::GetArrowBounds(void) const { return __arrowAreaBounds; } void -_DateTimeBarPresenter::SetWindowBounds(const Rectangle& bounds) +_DateTimeBarPresenter::SetWindowBounds(const FloatRectangle& bounds) { __windowAreaBounds = bounds; return; } -Rectangle +FloatRectangle _DateTimeBarPresenter::GetWindowBounds(void) const { return __windowAreaBounds; @@ -934,14 +931,17 @@ _DateTimeBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& return false; } + __isFlickEnabled = true; + if (GetBodyBounds().Contains(touchinfo.GetCurrentPosition()) == false) { + __isFlickEnabled = false; return false; } - if (__isFlickEnabled) + if (__isFlickInProgress) { - ResetFlickAnimationTimer(); + ResetFlickAnimationTimer(); } __touchMoveHandled = false; @@ -955,7 +955,7 @@ _DateTimeBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& return true; } - __pDateTimeBar->Draw(); + __pDateTimeBar->Invalidate(); return true; } @@ -971,8 +971,9 @@ _DateTimeBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); bool isEventFire = true; - if (index != -1 && __isTouchMoved == false && __isFlickEnabled == false) + if (index != -1 && __isTouchMoved == false && __isFlickInProgress == false) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); SetItemStatus(index, DATETIMEBAR_ITEM_STATUS_SELECTED); __pDateTimeBarModel->SetFirstDrawnItemIndex(index); } @@ -982,17 +983,19 @@ _DateTimeBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& } __isTouchMoved = false; - __distance = 0; - - __pDateTimeBar->Draw(); + __distance = 0.0f; - if (GetBodyBounds().Contains(touchinfo.GetCurrentPosition()) == false) + if (GetBodyBounds().Contains(touchinfo.GetCurrentPosition()) == false && !__isFlickInProgress) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + __pDateTimeBar->SetVisibleState(false); __pDateTimeBar->Close(); ResetFlickAnimationTimer(); return false; } + __pDateTimeBar->Invalidate(); + if (isEventFire == true) { int index = GetFirstDrawnItemIndex(); @@ -1006,6 +1009,7 @@ _DateTimeBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& if (pItem != null) { + __pDateTimeBar->SetVisibleState(false); __pDateTimeBar->Close(); __pDateTimeBar->FireActionEvent(pItem->GetActionId()); @@ -1041,20 +1045,20 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to __isTouchMoved = true; - Dimension screen(0, 0); + FloatDimension screen(0.0f, 0.0f); GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, orientation, screen); - const int _BOUNDARY_X_POSITION = screen.width * 2; - int distance = (touchinfo.GetCurrentPosition()).x - __currentPoint.x; + const float _BOUNDARY_X_POSITION = screen.width * 2.0f; + float distance = touchinfo.GetCurrentPosition().x - __currentPoint.x; _DateTimeBarItem* pItem = null; - Rectangle itemBounds; + FloatRectangle itemBounds; bool needItem = false; int updateItemCount = 1; - if (distance > 0) + if (distance > 0.0f) { pItem = __pDateTimeBarModel->GetItemAt(GetFirstDrawnItemIndex()); @@ -1067,7 +1071,7 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to __distance += distance; - if (__distance > itemBounds.width / 2) + if (__distance > itemBounds.width / 2.0f) { needItem = true; if (__distance > itemBounds.width) @@ -1092,7 +1096,7 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to actionId = __pDateTimeBarModel->GetMaximumValue(); } - if (pItem->GetBounds().x > _BOUNDARY_X_POSITION * -1) + if (pItem->GetBounds().x > _BOUNDARY_X_POSITION * -1.0f) { if (InsertItem(0, actionId) == E_SUCCESS) { @@ -1107,7 +1111,7 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to updateItemCount--; } - __distance = 0; + __distance = 0.0f; } } else @@ -1122,14 +1126,14 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to __distance += distance; - if (__distance * -1 > itemBounds.width / 2) + if (__distance * -1.0f > itemBounds.width / 2.0f) { needItem = true; - if (__distance * -1 > itemBounds.width) + if (__distance * -1.0f > itemBounds.width) { updateItemCount = UPDATE_ITEM_COUNT; } - __distance = 0; + __distance = 0.0f; } if (needItem == true) @@ -1168,7 +1172,7 @@ _DateTimeBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to AdjustItemPosition(distance); - __pDateTimeBar->Draw(); + __pDateTimeBar->Invalidate(); return true; } @@ -1182,9 +1186,9 @@ _DateTimeBarPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& } __isTouchMoved = false; - __distance = 0; + __distance = 0.0f; - __pDateTimeBar->Draw(); + __pDateTimeBar->Invalidate(); return true; } @@ -1194,10 +1198,10 @@ _DateTimeBarPresenter::LoadItems() { _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); - Dimension screen(0, 0); + FloatDimension screen(0.0f, 0.0f); GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, orientation, screen); - const int _BOUNDARY_X_POSITION = screen.width * 2; + const float _BOUNDARY_X_POSITION = screen.width * 2.0f; _DateTimeBarItem* pItem = null; @@ -1205,7 +1209,7 @@ _DateTimeBarPresenter::LoadItems() int updateItemCount = UPDATE_ITEM_COUNT; - if (__distance > 0) + if (__distance > 0.0f) { pItem = __pDateTimeBarModel->GetItemAt(GetFirstDrawnItemIndex()); @@ -1290,7 +1294,12 @@ _DateTimeBarPresenter::LoadItems() bool _DateTimeBarPresenter::OnFlickGestureDetected(int distanceX,int distanceY,int duration) { - __isFlickEnabled = true; + if (!__isFlickEnabled) + { + return false; + } + + __isFlickInProgress = true; __isInitialAnimation = false; int velX = 0; @@ -1311,7 +1320,7 @@ _DateTimeBarPresenter::StartFlickAnimation(void) __flickAnimation.CalculateNextMove(&moveX, &moveY); - __distance = moveX; + __distance = _CoordinateSystemUtils::ConvertToFloat(moveX); if (moveX != 0) { StartFlickAnimationTimer(); @@ -1327,11 +1336,11 @@ void _DateTimeBarPresenter::StartAnimationEffect(void) { __isInitialAnimation = true; - __distance = -10; + __distance = -10.0f; if (__initialAnimationValue >= 0 ) { - __initialAnimationValue = __initialAnimationValue + __distance; + __initialAnimationValue = __initialAnimationValue + _CoordinateSystemUtils::ConvertToInteger(__distance); StartFlickAnimationTimer(); LoadItems(); @@ -1386,13 +1395,14 @@ _DateTimeBarPresenter::ResetFlickAnimationTimer(void) __pFlickAnimationTimer = null; } - __isFlickEnabled = false; + __isFlickInProgress = false; return E_SUCCESS; } void _DateTimeBarPresenter::OnTimerExpired(Timer& timer) { + __isFlickInProgress = false; if (&timer == __pFlickAnimationTimer) { if (__isInitialAnimation) @@ -1411,11 +1421,11 @@ void _DateTimeBarPresenter::ValidateAndAdjustStartPosition(void) { int index = -1; - int adjustPosition = 0; - int leftMargin = GetLeftRightMargin(); - Rectangle bodyBounds = GetBodyBounds(); + float adjustPosition = 0.0f; + float leftMargin = GetLeftRightMargin(); + FloatRectangle bodyBounds = GetBodyBounds(); - index = GetItemIndexFromPosition(Point(GetLeftRightMargin() + GetItemMargin(), bodyBounds.y + (bodyBounds.height / 2))); + index = GetItemIndexFromPosition(FloatPoint(GetLeftRightMargin() + GetItemMargin(), bodyBounds.y + (bodyBounds.height / 2.0f))); if (index == -1) { @@ -1430,11 +1440,11 @@ _DateTimeBarPresenter::ValidateAndAdjustStartPosition(void) return; } - if (pDrawItem->GetBounds().x > 0 && pDrawItem->GetBounds().x < leftMargin) + if (pDrawItem->GetBounds().x > 0.0f && pDrawItem->GetBounds().x < leftMargin) { adjustPosition = leftMargin - pDrawItem->GetBounds().x; } - else if (pDrawItem->GetBounds().x < 0) + else if (pDrawItem->GetBounds().x < 0.0f) { pDrawItem = __pDateTimeBarModel->GetItemAt(index + 1); if (pDrawItem == null) @@ -1475,7 +1485,7 @@ _DateTimeBarPresenter::SetFont(Font& pFont) bool _DateTimeBarPresenter::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) { - __distance = (GetItemWidth() + GetItemMargin()) * (-1); + __distance = (GetItemWidth() + GetItemMargin()) * (-1.0f); if (element.GetBounds().x + element.GetBounds().width > GetWindowBounds().width) { @@ -1504,9 +1514,11 @@ _DateTimeBarPresenter::OnTouchMoveHandled(const Tizen::Ui::_Control& control) __touchMoveHandled = true; __isTouchMoved = false; - __distance = 0; + __distance = 0.0f; + + __pDateTimeBar->Invalidate(); - __pDateTimeBar->Draw(); + return; } void diff --git a/src/ui/controls/FUiCtrl_DateTimeChangeEvent.cpp b/src/ui/controls/FUiCtrl_DateTimeChangeEvent.cpp index 56bb367..bf08be2 100644 --- a/src/ui/controls/FUiCtrl_DateTimeChangeEvent.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeChangeEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeChangeEvent.cpp * @brief This is the implementation file for the _DateTimeChangeEvent and _DateTimeChangeEventArg classes. diff --git a/src/ui/controls/FUiCtrl_DateTimeDisplayBox.cpp b/src/ui/controls/FUiCtrl_DateTimeDisplayBox.cpp index 2e476f0..c3f6a65 100644 --- a/src/ui/controls/FUiCtrl_DateTimeDisplayBox.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeDisplayBox.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeDisplayBox.cpp * @brief This is the implementation file for the _DateTimeDisplayBox class. @@ -39,7 +40,7 @@ using namespace Tizen::Graphics::_Text; namespace Tizen { namespace Ui { namespace Controls { -_DateTimeDisplayBox::_DateTimeDisplayBox(const Rectangle& bounds, int boxId) +_DateTimeDisplayBox::_DateTimeDisplayBox(const FloatRectangle& bounds, int boxId) : __windowBounds(bounds) , __boxId(boxId) , __pTextObject(null) @@ -82,7 +83,7 @@ _DateTimeDisplayBox::~_DateTimeDisplayBox(void) } } -Rectangle +FloatRectangle _DateTimeDisplayBox::GetDisplayBoxBounds(void) const { return __windowBounds; @@ -300,7 +301,7 @@ CATCH: } void -_DateTimeDisplayBox::UpdateDisplayBoxBounds(Rectangle& bounds) +_DateTimeDisplayBox::UpdateDisplayBoxBounds(FloatRectangle& bounds) { __windowBounds = bounds; diff --git a/src/ui/controls/FUiCtrl_DateTimeModel.cpp b/src/ui/controls/FUiCtrl_DateTimeModel.cpp index 5ece421..8058e22 100644 --- a/src/ui/controls/FUiCtrl_DateTimeModel.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeModel.cpp * @brief This is the implementation file for the _DateTimeModel class. diff --git a/src/ui/controls/FUiCtrl_DateTimePicker.cpp b/src/ui/controls/FUiCtrl_DateTimePicker.cpp index e657f0f..174b49d 100644 --- a/src/ui/controls/FUiCtrl_DateTimePicker.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePicker.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePicker.cpp * @brief This is the implementation file for the _DateTimePicker class. @@ -40,6 +41,7 @@ #include "FUi_AccessibilityManager.h" #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; @@ -117,8 +119,8 @@ _DateTimePicker* _DateTimePicker::CreateDateTimePickerN(int style, const String& title) { result r = E_SUCCESS; - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; SysTryReturn(NID_UI_CTRL, ((style & DATETIME_OUTPUT_STYLE_DATETIME) != DATETIME_OUTPUT_STYLE_INVALID), null, E_INVALID_ARG, @@ -133,13 +135,11 @@ _DateTimePicker::CreateDateTimePickerN(int style, const String& title) r = pView->InitializeFont(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to set the Font."); -#if defined(MULTI_WINDOW) r = pView->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif orientation = pView->GetOrientation(); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -192,8 +192,8 @@ CATCH: result _DateTimePicker::CreateHeader(void) { - Rectangle indicatorBounds(0, 0, 0, 0); - Rectangle headerBounds(0, 0, 0, 0); + FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle headerBounds(0.0f, 0.0f, 0.0f, 0.0f); _Frame* pFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturnResult(NID_UI_CTRL, (pFrame != null), E_SYSTEM, "A system error has occurred. Failed to get the instance of frame."); @@ -202,7 +202,7 @@ _DateTimePicker::CreateHeader(void) SysTryReturnResult(NID_UI_CTRL, (pForm != null), E_SYSTEM, "A system error has occurred. Failed to get the instance of form."); - indicatorBounds = pForm->GetIndicatorBounds(); + indicatorBounds = pForm->GetIndicatorBoundsF(); _Toolbar* pHeader = _Toolbar::CreateToolbarN(true); result r = GetLastResult(); @@ -219,7 +219,7 @@ _DateTimePicker::CreateHeader(void) pHeader->SetTitleText(__title); pHeader->SetMovable(true); pHeader->SetResizable(true); - headerBounds = pHeader->GetBounds(); + headerBounds = pHeader->GetBoundsF(); headerBounds.y = indicatorBounds.height; pHeader->SetBounds(headerBounds); pHeader->SetMovable(false); @@ -256,7 +256,8 @@ _DateTimePicker::CreateFooter(void) result r = E_SUCCESS; _Button* pSaveButton = null; _Button* pCancelButton = null; - Rectangle bounds; + Rectangle intBounds; + FloatRectangle bounds; String text; _ControlOrientation orientation = GetOrientation(); @@ -267,12 +268,13 @@ _DateTimePicker::CreateFooter(void) r = AttachSystemChild(*pFooter); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_SHAPE_CONFIG(DATETIMEPICKER::FOOTER_HEIGHT, orientation, bounds.height); - GET_SHAPE_CONFIG(DATETIMEPICKER::INPUTPAD_HEIGHT, orientation, bounds.y); - - bounds.x = 0; - bounds.y = GetBounds().height - bounds.y - bounds.height; - bounds.width = GetBounds().width; + GET_SHAPE_CONFIG(DATETIMEPICKER::FOOTER_HEIGHT, orientation, intBounds.height); + GET_SHAPE_CONFIG(DATETIMEPICKER::INPUTPAD_HEIGHT, orientation, intBounds.y); + bounds.height = _CoordinateSystemUtils::ConvertToFloat(intBounds.height); + bounds.y = _CoordinateSystemUtils::ConvertToFloat(intBounds.y); + bounds.x = 0.0f; + bounds.y = GetBoundsF().height - bounds.y - bounds.height; + bounds.width = GetBoundsF().width; pFooter->SetMovable(true); pFooter->SetResizable(true); @@ -355,26 +357,26 @@ _DateTimePicker::DestroyFooter(void) return E_SUCCESS; } -Rectangle +FloatRectangle _DateTimePicker::GetHeaderBounds(void) { - Rectangle headerBounds(0, 0, 0, 0); + FloatRectangle headerBounds(0.0f, 0.0f, 0.0f, 0.0f); if (__pHeader != null) { - headerBounds = __pHeader->GetBounds(); + headerBounds = __pHeader->GetBoundsF(); } else { _Frame* pFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); - SysTryReturn(NID_UI_CTRL, (pFrame != null), Rectangle(), E_SYSTEM, + SysTryReturn(NID_UI_CTRL, (pFrame != null), FloatRectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the instance of frame."); _Form* pForm = pFrame->GetCurrentForm(); - SysTryReturn(NID_UI_CTRL, (pForm != null), Rectangle(), E_SYSTEM, + SysTryReturn(NID_UI_CTRL, (pForm != null), FloatRectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the instance of form."); - headerBounds = pForm->GetIndicatorBounds(); + headerBounds = pForm->GetIndicatorBoundsF(); } return headerBounds; @@ -407,7 +409,7 @@ CATCH: } void -_DateTimePicker::SetDisplayVisualElementBounds(Rectangle bounds) +_DateTimePicker::SetDisplayVisualElementBounds(FloatRectangle bounds) { if (__pDisplayVisualElement != null) { @@ -911,7 +913,7 @@ _DateTimePicker::OnAttachedToMainTree(void) _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnResult(NID_UI_CTRL, (pElement != null), E_OUT_OF_MEMORY, "Memory allocation failed."); - Rectangle displayBoxBounds = pBox->GetDisplayBoxBounds(); + Rectangle displayBoxBounds = _CoordinateSystemUtils::ConvertToInteger(pBox->GetDisplayBoxBounds()); int displayBoxId = pBox->GetDisplayBoxId(); String hintText(L"Double tap to edit"); @@ -959,7 +961,7 @@ _DateTimePicker::OnAttachedToMainTree(void) _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnResult(NID_UI_CTRL, (pElement != null), E_OUT_OF_MEMORY, "Memory allocation failed."); - Rectangle amPmBoxBounds = pAmPmBox->GetDisplayBoxBounds(); + Rectangle amPmBoxBounds = _CoordinateSystemUtils::ConvertToInteger(pAmPmBox->GetDisplayBoxBounds()); if (__pDisplayVisualElement) { @@ -986,10 +988,10 @@ void _DateTimePicker::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -1035,14 +1037,14 @@ _DateTimePicker::OnChangeLayout(_ControlOrientation orientation) pBox = __pPresenter->GetDisplayBox(index); if (pBox != null) { - Rectangle displayBoxBounds = pBox->GetDisplayBoxBounds(); + FloatRectangle displayBoxBounds = pBox->GetDisplayBoxBounds(); if (__pDisplayVisualElement) { displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y; } - pElement->SetBounds(displayBoxBounds); + pElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(displayBoxBounds)); } } index++; diff --git a/src/ui/controls/FUiCtrl_DateTimePickerImpl.cpp b/src/ui/controls/FUiCtrl_DateTimePickerImpl.cpp index a184bae..5e351ec 100644 --- a/src/ui/controls/FUiCtrl_DateTimePickerImpl.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePickerImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePickerImpl.cpp * @brief This is the implementation file for the _DateTimePickerImpl class. @@ -38,13 +39,13 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { -Dimension -_DateTimePickerImpl::DateTimePickerSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const +FloatDimension +_DateTimePickerImpl::DateTimePickerSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -55,13 +56,13 @@ _DateTimePickerImpl::DateTimePickerSizeInfo::GetDefaultMinimumSize(_ControlOrien return pickerSize; } -Dimension -_DateTimePickerImpl::DateTimePickerSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const +FloatDimension +_DateTimePickerImpl::DateTimePickerSizeInfo::GetDefaultMaximumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0, 0); + FloatDimension screenSize(0, 0); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { diff --git a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp index c1bd875..2ad12e1 100644 --- a/src/ui/controls/FUiCtrl_DateTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_DateTimePresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePresenter.cpp * @brief This is the implementation file for the _DateTimePresenter class. @@ -35,6 +36,7 @@ #include "FUiCtrl_DateTimePicker.h" #include "FUiCtrl_DateTimeUtils.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Ui; using namespace Tizen::Base; @@ -138,14 +140,18 @@ _DateTimePresenter::Construct(_DateTimePicker& view) LoadResource(); UpdateDateTimeOutputConfig(); - Rectangle inputPadBounds(0, 0, 0, 0); - Rectangle pickerBounds(0, 0, 0, 0); + FloatRectangle inputPadBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle pickerBounds(0.0f, 0.0f, 0.0f, 0.0f); - pickerBounds = __pView->GetBounds(); + pickerBounds = __pView->GetBoundsF(); GET_SHAPE_CONFIG(DATETIMEPICKER::INPUTPAD_HEIGHT, orientation, inputPadBounds.height); - inputPadBounds.x = 0; + FloatDimension dim; + dim = CoordinateSystem::AlignToDevice(FloatDimension(pickerBounds.width, inputPadBounds.height)); + inputPadBounds.height = dim.height; + + inputPadBounds.x = 0.0f; inputPadBounds.width = pickerBounds.width; inputPadBounds.y = pickerBounds.height - inputPadBounds.height; @@ -447,7 +453,7 @@ result _DateTimePresenter::SetFont(Font* pFont) { result r = E_SUCCESS; - int fontSize = 0; + float fontSize = 0; if (__pView == null) { @@ -487,10 +493,10 @@ void _DateTimePresenter::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - Rectangle inputPadBounds(0, 0, 0, 0); - Rectangle pickerBounds(0, 0, 0, 0); + FloatRectangle inputPadBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle pickerBounds(0.0f, 0.0f, 0.0f, 0.0f); - pickerBounds = __pView->GetBounds(); + pickerBounds = __pView->GetBoundsF(); UpdateDateTimeOutputConfig(); @@ -581,6 +587,7 @@ _DateTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to if (touchedAreaId == DATETIME_AREA_OUTPUT_AMPM) { __isPm = (!__isPm); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } __inputComposing = DATETIME_INPUT_END; @@ -673,6 +680,44 @@ _DateTimePresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& to } void +_DateTimePresenter::PlaySoundFeedback(int inputPadReturnValue) +{ + switch(inputPadReturnValue) + { + case 0: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY0); + break; + case 1: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY1); + break; + case 2: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY2); + break; + case 3: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY3); + break; + case 4: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY4); + break; + case 5: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY5); + break; + case 6: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY6); + break; + case 7: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY7); + break; + case 8: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY8); + break; + case 9: + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_KEY9); + break; + } +} + +void _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadReturnValue) { if ((__inputPadEnabled == false) || (inputPadReturnValue == -1)) @@ -686,6 +731,7 @@ _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadR if (boxId == DATETIME_ID_YEAR) { + PlaySoundFeedback(inputPadReturnValue); __changeFocusCounter++; if (__isFocusBoxChanged == true) @@ -713,6 +759,8 @@ _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadR } else if (boxId == DATETIME_ID_MONTH) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_VIBRATION); newNumber = inputPadReturnValue; __inputComposing = DATETIME_INPUT_BEGIN; @@ -721,6 +769,7 @@ _DateTimePresenter::OnInputPadValueChanged(const _Control& source, int inputPadR } else { + PlaySoundFeedback(inputPadReturnValue); __changeFocusCounter++; if (__isFocusBoxChanged == true) @@ -854,28 +903,32 @@ _DateTimePresenter::UpdateDateTimeOutputConfig(void) _DateTimeDisplayBox* pPmBox = null; _DateTimeDisplayBox* pDisplayBox[DATETIME_ID_MAX]; - Rectangle outputAreaBounds(0, 0, 0, 0); - Rectangle dateBounds(0, 0, 0, 0); - Rectangle monthBounds(0, 0, 0, 0); - Rectangle yearBounds(0, 0, 0, 0); - Rectangle hourBounds(0, 0, 0, 0); - Rectangle minuteBounds(0, 0, 0, 0); - Rectangle amPmBounds(0, 0, 0, 0); + FloatRectangle outputAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle dateBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle monthBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle yearBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle hourBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle minuteBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle amPmBounds(0.0f, 0.0f, 0.0f, 0.0f); int indexBox = 0; int boxCount = 0; - int dateElementWidth = 0; - int displayBoxHeight = 0; - int dateTimeElementY = 0; - int dividerMargin = 0; - int dateTimeMargin = 0; - int leftMargin = 0; - int timeOutputMargin = 0; - int timeElementWidth = 0; - int colonWidth = 0; - int colonMargin = 0; - int amPmWidth = 0; - int amPmMargin = 0; + float dateElementWidth = 0; + + float dateTimeDisplayBoxHeight = 0; + float amPmDisplayBoxHeight = 0; + + float dateTimeElementY = 0; + float amPmElementY = 0; + float dividerMargin = 0; + float dateTimeMargin = 0; + float leftMargin = 0; + float timeOutputMargin = 0; + float timeElementWidth = 0; + float colonWidth = 0; + float colonMargin = 0; + float amPmWidth = 0; + float amPmMargin = 0; for (indexBox = 0; indexBox < DATETIME_ID_MAX; indexBox++) { @@ -887,7 +940,10 @@ _DateTimePresenter::UpdateDateTimeOutputConfig(void) GET_FIXED_VALUE_CONFIG(DATETIMEPICKER::DIVIDER_WIDTH, orientation, dividerMargin); GET_SHAPE_CONFIG(DATETIMEPICKER::DATE_ELEMENT_WIDTH, orientation, dateElementWidth); - GET_SHAPE_CONFIG(DATETIMEPICKER::DISPLAY_BOX_HEIGHT, orientation, displayBoxHeight); + + GET_SHAPE_CONFIG(DATETIMEPICKER::DATETIME_DISPLAY_BOX_HEIGHT, orientation, dateTimeDisplayBoxHeight); + GET_SHAPE_CONFIG(DATETIMEPICKER::AMPM_DISPLAY_BOX_HEIGHT, orientation, amPmDisplayBoxHeight); + GET_SHAPE_CONFIG(DATETIMEPICKER::DATE_TIME_MARGIN, orientation, dateTimeMargin); GET_SHAPE_CONFIG(DATETIMEPICKER::LEFT_MARGIN, orientation, leftMargin); GET_SHAPE_CONFIG(DATETIMEPICKER::TIME_OUTPUT_MARGIN, orientation, timeOutputMargin); @@ -897,14 +953,18 @@ _DateTimePresenter::UpdateDateTimeOutputConfig(void) GET_SHAPE_CONFIG(DATETIMEPICKER::AMPM_WIDTH, orientation, amPmWidth); GET_SHAPE_CONFIG(DATETIMEPICKER::TIME_AMPM_MARGIN, orientation, amPmMargin); - dateTimeElementY = (outputAreaBounds.height - displayBoxHeight) / 2; + dateTimeElementY = (outputAreaBounds.height - dateTimeDisplayBoxHeight) / 2.0f; + amPmElementY = (outputAreaBounds.height - amPmDisplayBoxHeight) / 2.0f; dateBounds.width = monthBounds.width = yearBounds.width = dateElementWidth; hourBounds.width = minuteBounds.width = timeElementWidth; amPmBounds.width = amPmWidth; - dateBounds.height = monthBounds.height = yearBounds.height = hourBounds.height = minuteBounds.height = amPmBounds.height = displayBoxHeight; - dateBounds.y = monthBounds.y = yearBounds.y = hourBounds.y = minuteBounds.y = amPmBounds.y = dateTimeElementY; + dateBounds.height = monthBounds.height = yearBounds.height = hourBounds.height = minuteBounds.height = dateTimeDisplayBoxHeight; + amPmBounds.height = amPmDisplayBoxHeight; + + dateBounds.y = monthBounds.y = yearBounds.y = hourBounds.y = minuteBounds.y = dateTimeElementY; + amPmBounds.y = amPmElementY; if (__pickerStyle == DATETIME_OUTPUT_STYLE_DATE || __pickerStyle == DATETIME_OUTPUT_STYLE_DATETIME) { @@ -1137,11 +1197,11 @@ _DateTimePresenter::DrawColon(Canvas& canvas) result r = E_SUCCESS; _ControlOrientation orientation = __pView->GetOrientation(); - Rectangle hourBounds(0, 0, 0, 0); - Rectangle colonBounds(0, 0, 0, 0); + FloatRectangle hourBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle colonBounds(0.0f, 0.0f, 0.0f, 0.0f); - int colonWidth = 0; - int colonMargin = 0; + float colonWidth = 0.0f; + float colonMargin = 0.0f; GET_SHAPE_CONFIG(DATETIMEPICKER::COLON_WIDTH, orientation, colonWidth); GET_SHAPE_CONFIG(DATETIMEPICKER::COLON_MARGIN, orientation, colonMargin); @@ -1285,10 +1345,10 @@ void _DateTimePresenter::DrawDividers(Canvas& canvas) { result r = E_SUCCESS; - int dividerWidth = 0; - int dividerHeight = 0; - Point lineStart(0,0); - Point lineEnd(0,0); + float dividerWidth = 0.0f; + float dividerHeight = 0.0f; + FloatPoint lineStart(0.0f,0.0f); + FloatPoint lineEnd(0.0f,0.0f); Color colorHalfLeft; Color colorHalfRight; @@ -1300,10 +1360,10 @@ _DateTimePresenter::DrawDividers(Canvas& canvas) GET_COLOR_CONFIG(DATETIMEPICKER::DIVIDER_LEFT_HALF, colorHalfLeft); GET_COLOR_CONFIG(DATETIMEPICKER::DIVIDER_RIGHT_HALF, colorHalfRight); - lineStart.y = (GetOutputArea().height - dividerHeight) / 2; + lineStart.y = (GetOutputArea().height - dividerHeight) / 2.0f; lineEnd.y = lineStart.y + dividerHeight; - canvas.SetLineWidth(dividerWidth/2); + canvas.SetLineWidth(dividerWidth/2.0f); for (int i = 0; i < __outputBoxMaxCount; i++) { @@ -1367,14 +1427,14 @@ _DateTimePresenter::DrawDividers(Canvas& canvas) return; } -Rectangle +FloatRectangle _DateTimePresenter::GetOutputArea(void) { _ControlOrientation orientation = __pView->GetOrientation(); - Rectangle outputArea(0, 0, 0, 0); - Rectangle headerBounds = __pView->GetHeaderBounds(); - int margin = 0; + FloatRectangle outputArea(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle headerBounds = __pView->GetHeaderBounds(); + float margin = 0; GET_SHAPE_CONFIG(DATETIMEPICKER::TOP_MARGIN, orientation, margin); @@ -1429,12 +1489,12 @@ _DateTimePresenter::ChangeInputPadStyle(int boxId) } int -_DateTimePresenter::CalculateTouchArea(int posX, int posY) +_DateTimePresenter::CalculateTouchArea(float posX, float posY) { _ControlOrientation orientation = __pView->GetOrientation(); - Rectangle outputArea = GetOutputArea(); + FloatRectangle outputArea = GetOutputArea(); - int margin = 0; + float margin = 0.0f; GET_SHAPE_CONFIG(DATETIMEPICKER::TOP_MARGIN, orientation, margin); @@ -1447,28 +1507,34 @@ _DateTimePresenter::CalculateTouchArea(int posX, int posY) if (posY < outputArea.y + outputArea.height) { - int boxHeight = 0; - GET_SHAPE_CONFIG(DATETIMEPICKER::DISPLAY_BOX_HEIGHT, orientation, boxHeight); + float displayBoxHeight = 0; + float amPmBoxHeight = 0; + + GET_SHAPE_CONFIG(DATETIMEPICKER::DATETIME_DISPLAY_BOX_HEIGHT, orientation, displayBoxHeight); + GET_SHAPE_CONFIG(DATETIMEPICKER::AMPM_DISPLAY_BOX_HEIGHT, orientation, amPmBoxHeight); - int boxPosY = outputArea.y + ((outputArea.height - boxHeight) / 2); + float displayBoxPosY = outputArea.y + ((outputArea.height - displayBoxHeight) / 2.0f); + float amPmBoxPosY = outputArea.y + ((outputArea.height - amPmBoxHeight) / 2.0f); - if ((posY >= boxPosY) && (posY <= boxPosY + boxHeight)) + if ((posY >= amPmBoxPosY) && (posY <= amPmBoxPosY + amPmBoxHeight)) { - // output area - touched = DATETIME_AREA_OUTPUT; + if ((posY >= displayBoxPosY) && (posY <= displayBoxPosY + displayBoxHeight)) + { + // output area + touched = DATETIME_AREA_OUTPUT; + } if (__pPmBox != null) { - Rectangle boxBounds = __pPmBox->GetDisplayBoxBounds(); - - boxBounds.y = outputArea.y + ((outputArea.height - boxBounds.height) / 2); + //am pm area + FloatRectangle boxBounds = __pPmBox->GetDisplayBoxBounds(); - if ((posX >= boxBounds.x) && (posX < boxBounds.x + boxBounds.width) - && (posY >= boxBounds.y) && (posY < boxBounds.y + boxBounds.height)) + if ((posX >= boxBounds.x) && (posX < boxBounds.x + boxBounds.width)) { touched = DATETIME_AREA_OUTPUT_AMPM; } } + } } else @@ -1480,13 +1546,13 @@ _DateTimePresenter::CalculateTouchArea(int posX, int posY) } int -_DateTimePresenter::CalculateTouchOutputArea(int posX, int posY) +_DateTimePresenter::CalculateTouchOutputArea(float posX, float posY) { - Rectangle outputArea = GetOutputArea(); + FloatRectangle outputArea = GetOutputArea(); for (int i = 0; i < __outputBoxMaxCount; i++) { - Rectangle boxBounds = __pDisplayBox[i]->GetDisplayBoxBounds(); + FloatRectangle boxBounds = __pDisplayBox[i]->GetDisplayBoxBounds(); boxBounds.y = outputArea.y + ((outputArea.height - boxBounds.height) / 2); @@ -1895,7 +1961,7 @@ _DateTimePresenter::SetAccessibilityElementText(void) if (__pDisplayBox[index]->GetDisplayBoxId() == DATETIME_ID_MONTH) { int number = GetNumberInBox(__pDisplayBox[index]->GetDisplayBoxId()); - __pView->SetAccessibilityElementText(index, __pInputPad->GetAccessebilityElementMonthName(number-1), false); + __pView->SetAccessibilityElementText(index, __pInputPad->GetAccessibilityElementMonthName(number-1), false); } else { diff --git a/src/ui/controls/FUiCtrl_DimmingLayer.cpp b/src/ui/controls/FUiCtrl_DimmingLayer.cpp index f88f249..3192854 100644 --- a/src/ui/controls/FUiCtrl_DimmingLayer.cpp +++ b/src/ui/controls/FUiCtrl_DimmingLayer.cpp @@ -37,11 +37,7 @@ using namespace Tizen::Graphics; using namespace Tizen::Ui::Animations; using namespace Tizen::Ui; -namespace Tizen -{ -namespace Ui -{ -namespace Controls +namespace Tizen { namespace Ui { namespace Controls { _DimmingLayer::_DimmingLayer(void) @@ -94,6 +90,7 @@ _DimmingLayer::Construct(_Control& control) r = __pDimmingElement->SetSurfaceOpaque(false); SysTryCatch(NID_UI, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + __pDimmingElement->SetShowState(true); __pDimmingElement->SetOpacity(0.65f); r = __pDimmingElement->SetBackgroundColor(_Colorf()); @@ -156,15 +153,10 @@ _DimmingLayer::SetDimmingEnabled(bool enabled) _VisualElement* pControlVisualElement = __pControl->GetVisualElement(); SysTryReturnResult(NID_UI, pControlVisualElement, E_SYSTEM, "A system error has been occurred."); - __pDimmingElement->SetShowState(enabled); if (enabled) { -#if !defined(MULTI_WINDOW) - VisualElement* pParent = pControlVisualElement->GetParent(); -#else _Window* pWindow = __pControl->GetRootWindow(); _RootVisualElement* pParent = pWindow->GetRootVisualElement(); -#endif if (pParent) { pParent->InsertChild(*__pDimmingElement, pControlVisualElement, false); @@ -172,12 +164,8 @@ _DimmingLayer::SetDimmingEnabled(bool enabled) } else { -#if !defined(MULTI_WINDOW) - VisualElement* pParent = pControlVisualElement->GetParent(); -#else _Window* pWindow = __pControl->GetRootWindow(); _RootVisualElement* pParent = pWindow->GetRootVisualElement(); -#endif if (pParent) { pParent->DetachChild(*__pDimmingElement); @@ -204,6 +192,8 @@ _DimmingLayer::Rearrange(void) result r = E_SUCCESS; Dimension size = _ControlManager::GetInstance()->GetScreenSize(); + bool oldValue = __pDimmingElement->IsImplicitAnimationEnabled(); + __pDimmingElement->SetImplicitAnimationEnabled(false); if (__pControl->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) { __pDimmingElement->SetBounds(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, (float)size.width, (float)size.height)); @@ -212,10 +202,9 @@ _DimmingLayer::Rearrange(void) { __pDimmingElement->SetBounds(Tizen::Graphics::FloatRectangle(0.0f, 0.0f, (float)size.height, (float)size.width)); } + __pDimmingElement->SetImplicitAnimationEnabled(oldValue); return r; } -} // Tizen::Ui::Controls -} // Tizen::Ui -} // Osp +}}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_Edit.cpp b/src/ui/controls/FUiCtrl_Edit.cpp old mode 100644 new mode 100755 index fb1960c..ee2abdd --- a/src/ui/controls/FUiCtrl_Edit.cpp +++ b/src/ui/controls/FUiCtrl_Edit.cpp @@ -27,6 +27,7 @@ #include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_IAccessibilityListener.h" #include "FUi_UiEventManager.h" #include "FUiAnim_VisualElement.h" @@ -77,7 +78,7 @@ public: * @param[in] currentPosition The current position * @param[in] touchInfo The touch event information */ - virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo){return false;}; + virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); /** * Notifies when an entity is touch moved. @@ -86,7 +87,7 @@ public: * @param[in] currentPosition The current position * @param[in] touchInfo The touch event information */ - virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo){return false;}; + virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); /** * Notifies when an entity is touch cancelled. @@ -110,27 +111,85 @@ bool _EditInternalTouchEventListener::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); - _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton(); - if (__pEdit == &source || pCommandButton == source.GetParent()) + SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null."); + + if (pEditPresenter->IsCopyPasteManagerExist()) { - return false; + if (pEditPresenter->GetTextCompositionState()) + { + pEditPresenter->FinishTextComposition(); + } + if (pEditPresenter->IsCopyPastePopup(source)) + { + return false; // CopyPastePopup is touched + } + else if (pEditPresenter->IsCopyPasteHandle(source)) + { + pEditPresenter->ReleaseCopyPastePopup(); + return false; + } + else if (pEditPresenter->IsCopyPastePopupExist()) + { + return true; + } + else + { + return false; + } } - else //check the state of Text Prediction & CopyPaste Popup + return false; +} + +bool +_EditInternalTouchEventListener::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) +{ + _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null."); + + if (pEditPresenter->IsCopyPasteManagerExist()) { - if (pEditPresenter->IsCopyPastePopupVisible()) + if (!pEditPresenter->IsCopyPastePopup(source) && !pEditPresenter->IsCopyPasteHandle(source)) { - if (pEditPresenter->GetTextCompositionState()) + if (pEditPresenter->IsCopyPastePopupExist()) { - pEditPresenter->FinishTextComposition(); + return true; } - - if (pEditPresenter->IsCopyPastePopup(source)) + else if (__pEdit == &source) { - return false; // CopyPastePopup is touched + return false; } else { pEditPresenter->InitializeCopyPasteManager(); + return false; + } + } + } + return false; +} + +bool +_EditInternalTouchEventListener::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) +{ + _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + SysTryReturn(NID_UI_CTRL, pEditPresenter, false, E_INVALID_STATE, "[E_INVALID_STATE] pEditPresenter is null."); + + if (pEditPresenter->IsCopyPasteManagerExist()) + { + if (!pEditPresenter->IsCopyPastePopup(source) && !pEditPresenter->IsCopyPasteHandle(source)) + { + if (pEditPresenter->IsCopyPastePopupExist()) + { + if (pEditPresenter->IsCopyPasteHandleExist()) + { + pEditPresenter->ReleaseCopyPastePopup(); + return true; + } + else + { + pEditPresenter->InitializeCopyPasteManager(); + return false; + } } } } @@ -142,18 +201,19 @@ IMPLEMENT_PROPERTY(_Edit); _Edit::_Edit(void) : _pEditPresenter(null) - , __bottomMargin(-1) - , __leftMargin(-1) - , __lineSpacing(-1) - , __rightMargin(-1) - , __textSize(-1) - , __topMargin(-1) + , __bottomMargin(-1.0f) + , __leftMargin(-1.0f) + , __lineSpacing(-1.0f) + , __rightMargin(-1.0f) + , __textSize(-1.0f) + , __topMargin(-1.0f) , __editStyle(EDIT_STYLE_NORMAL) , __borderRoundStyle(false) , __ellipsisPosition(ELLIPSIS_POSITION_END) , __inputStyle(INPUT_STYLE_OVERLAY) , __isConstructed(false) , __guideTextColor(Color()) + , __pressedGuideTextColor(Color()) , __isSettingGuideTextColor(false) , __pDefaultBackgroundEffectBitmap(null) , __pGestureFlick(null) @@ -167,12 +227,14 @@ _Edit::_Edit(void) , __pScrollPanelEvent(null) , __pTextBlockEvent(null) , __pTextEvent(null) - , __pTitleTextAccessibilityElement(null) , __pTextAccessibilityElement(null) , __pClearButtonTextAccessibilityElement(null) , __pToolbarAccessibilityElement(null) , __isAccessibilityCreated(false) , __isFullScreenKeypadEdit(false) + , __internalFocus(false) + , __isDestroyed(false) + , __pTextFilter(null) { for (int status = 0; status < EDIT_COLOR_MAX; status++) { @@ -290,11 +352,6 @@ _Edit::~_Edit(void) __pExpandableEditAreaEvent = null; } - if (__pTitleTextAccessibilityElement) - { - __pTitleTextAccessibilityElement->Activate(false); - __pTitleTextAccessibilityElement = null; - } if (__pTextAccessibilityElement) { __pTextAccessibilityElement->Activate(false); @@ -406,9 +463,36 @@ _Edit::Initialize(int editStyle, InputStyle inputStyle, int limitLength, GroupSt r = _UiEventManager::GetInstance()->AddTouchEventListener(*__pEditInternalTouchEventListener); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Unable to add internal event listener", GetErrorMessage(r)); - SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE); + SetTouchPressThreshold(0.16); __isConstructed = true; + _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer(); + if(pEditAccessibilityContainer) + { + pEditAccessibilityContainer->Activate(true); + } + if (pEditAccessibilityContainer) + { + __pTextAccessibilityElement = new _AccessibilityElement(true); + __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height)); + __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText()); + __pTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + __pTextAccessibilityElement->SetName(L"EditText"); + pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement); + + if (__editStyle & EDIT_STYLE_CLEAR && GetTextLength()) + { + __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true); + __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF()); + __pClearButtonTextAccessibilityElement->SetLabel(L"all clear, button"); + __pClearButtonTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton"); + pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement); + } + + __isAccessibilityCreated = true; + } + return r; } @@ -440,6 +524,8 @@ _Edit::InitializeColorInformation(void) __cutlinkColor[type].cutlinkFgColor = Color::GetColor(COLOR_ID_BLUE); GET_COLOR_CONFIG(EDIT::CUT_LINK_BG_NORMAL, __cutlinkColor[type].cutlinkBgColor); } + + return; } result @@ -521,6 +607,75 @@ _Edit::GetContentSizeInternal(void) const return dimension; } +FloatDimension +_Edit::GetContentSizeInternalF(void) const +{ + FloatDimension dimension(0.0f,0.0f); + float leftMargin = 0.0f; + float rightMargin = 0.0f; + float textTopMargin = 0.0f; + float textBottomMargin = 0.0f; + + _ControlOrientation orientation = GetOrientation(); + GET_SHAPE_CONFIG(EDIT::AREA_LEFT_MARGIN, orientation, leftMargin); + GET_SHAPE_CONFIG(EDIT::AREA_RIGHT_MARGIN, orientation, rightMargin); + GET_SHAPE_CONFIG(EDIT::AREA_TEXT_TOP_MARGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(EDIT::AREA_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin); + + TextObject* pTextObject = _pEditPresenter->GetTextObject(); + + if (!pTextObject) + { + return dimension; + } + + // store + TextObjectActionType previousActionType = pTextObject->GetAction(); + TextObjectWrapType previousWrapType = pTextObject->GetWrap(); + FloatRectangle previousRect = pTextObject->GetBoundsF(); + FloatRectangle newRect = previousRect; + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width; + } + else + { + newRect.width = _ControlManager::GetInstance()->GetScreenSizeF().height; + } + + + pTextObject->SetBounds(newRect); + pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); + pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); + pTextObject->Compose(); + + dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength()); + if (dimension.width > newRect.width) + { + dimension.width = newRect.width; + } + + dimension.height = pTextObject->GetTotalHeightF(); + + // restore + pTextObject->SetBounds(previousRect); + pTextObject->SetAction(previousActionType); + pTextObject->SetWrap(previousWrapType); + pTextObject->Compose(); + + dimension.width += leftMargin + rightMargin; + dimension.height += textTopMargin + textBottomMargin; + + return dimension; +} + +bool +_Edit::IsInternalFocused(void) const +{ + return __internalFocus; +} + HorizontalAlignment _Edit::GetTextAlignment(void) const { @@ -573,16 +728,30 @@ _Edit::GetLineSpacing(void) const return _pEditPresenter->GetLineSpacing(); } +float +_Edit::GetLineSpacingF(void) const +{ + return _pEditPresenter->GetLineSpacingF(); +} + result _Edit::SetLineSpacing(int linePixelGap) { return _pEditPresenter->SetLineSpacing(linePixelGap); } +result +_Edit::SetLineSpacing(float linePixelGap) +{ + return _pEditPresenter->SetLineSpacing(linePixelGap); +} + void _Edit::SetMaxLineCount(int maxLineCount) { _pEditPresenter->SetMaxLineCount(maxLineCount); + + return; } int @@ -594,6 +763,12 @@ _Edit::GetMaxLineCount(void) const int _Edit::GetHorizontalMargin(EditTextHorizontalMargin marginType) const { + return _CoordinateSystemUtils::ConvertToInteger(GetHorizontalMarginF(marginType)); +} + +float +_Edit::GetHorizontalMarginF(EditTextHorizontalMargin marginType) const +{ Variant var; switch (marginType) @@ -614,12 +789,19 @@ _Edit::GetHorizontalMargin(EditTextHorizontalMargin marginType) const break; } - return var.ToInt(); + return var.ToFloat(); } + int _Edit::GetVerticalMargin(EditTextVerticalMargin marginType) const { + return _CoordinateSystemUtils::ConvertToInteger(GetVerticalMarginF(marginType)); +} + +float +_Edit::GetVerticalMarginF(EditTextVerticalMargin marginType) const +{ Variant var; switch (marginType) @@ -640,12 +822,20 @@ _Edit::GetVerticalMargin(EditTextVerticalMargin marginType) const break; } - return var.ToInt(); + return var.ToFloat(); } result _Edit::SetHorizontalMargin(int margin, EditTextHorizontalMargin marginType) { + float floatMargin = _CoordinateSystemUtils::ConvertToFloat(margin); + + return SetHorizontalMargin(floatMargin, marginType); +} + +result +_Edit::SetHorizontalMargin(float margin, EditTextHorizontalMargin marginType) +{ result r = E_SUCCESS; Variant var(margin); @@ -677,12 +867,18 @@ _Edit::SetHorizontalMargin(int margin, EditTextHorizontalMargin marginType) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin."); return r; - } result _Edit::SetVerticalMargin(int margin, EditTextVerticalMargin marginType) { + float floatMargin = _CoordinateSystemUtils::ConvertToFloat(margin); + return SetVerticalMargin( floatMargin, marginType); +} + +result +_Edit::SetVerticalMargin(float margin, EditTextVerticalMargin marginType) +{ result r = E_SUCCESS; Variant var(margin); @@ -714,7 +910,6 @@ _Edit::SetVerticalMargin(int margin, EditTextVerticalMargin marginType) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to set margin."); return r; - } int @@ -821,31 +1016,53 @@ _Edit::UpdateAccessibilityElement(EditAccessibilityElementType type) return; } - switch(type) + if (__editStyle & EDIT_STYLE_CLEAR) { - case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TITLE_TEXT: - if (__pTitleTextAccessibilityElement) + _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer(); + if (pEditAccessibilityContainer) + { + if (!GetTextLength() && __pClearButtonTextAccessibilityElement) { - __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds()); - __pTitleTextAccessibilityElement->SetLabel(GetTitleText()); + if (__pClearButtonTextAccessibilityElement) + { + __pClearButtonTextAccessibilityElement->Activate(false); + __pClearButtonTextAccessibilityElement = null; + } } - break; + if (GetTextLength() && !__pClearButtonTextAccessibilityElement) + { + if (__editStyle & EDIT_STYLE_CLEAR && GetTextLength()) + { + __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true); + __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF()); + __pClearButtonTextAccessibilityElement->SetLabel(L"all clear, button"); + __pClearButtonTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton"); + pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement); + } + } + } + } + + switch(type) + { case EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT: if (__pTextAccessibilityElement) { - __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds()); - __pTextAccessibilityElement->SetLabel(GetText()); + __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height)); + __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText()); } break; case EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON: if (__pClearButtonTextAccessibilityElement) { - __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds()); + __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF()); } break; default: break; } + return; } @@ -853,6 +1070,8 @@ void _Edit::SetFullScreenKeypadEdit(bool enabled) { __isFullScreenKeypadEdit = enabled; + + return; } bool @@ -870,14 +1089,26 @@ _Edit::HideKeypad(void) int _Edit::GetTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_Edit::GetTextSizeF(void) const +{ Variant size = GetProperty("textSize"); - return size.ToInt(); + return size.ToFloat(); } result _Edit::SetTextSize(int size) { + return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +_Edit::SetTextSize(float size) +{ Variant var(size); return SetProperty("textSize", Variant(size)); @@ -1071,7 +1302,7 @@ _Edit::SetTextColor(EditTextColor type, const Color& color) String _Edit::GetText(int start, int end) const { - SysTryReturn(NID_UI_CTRL, (start > -1 && end > -1 && end > start), String(), E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument(start = %d, end = %d) is given."); + SysTryReturn(NID_UI_CTRL, (start > -1 && end > -1), String(), E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given."); return _pEditPresenter->GetText(start, end); } @@ -1264,6 +1495,8 @@ _Edit::SetLowerCaseModeEnabled(bool enable) Variant var(enable); SetProperty("lowerCaseModeEnabled", var); + + return; } bool @@ -1378,7 +1611,9 @@ _Edit::DeleteCharacterAtCursorPosition(void) void _Edit::GetCurrentTextRange(int& start, int& end) const { - return _pEditPresenter->GetCurrentTextRange(start, end); + _pEditPresenter->GetCurrentTextRange(start, end); + + return; } void @@ -1387,6 +1622,8 @@ _Edit::SetGuideText(const String& guideText) Variant var(guideText); SetProperty("guideText", var); + + return; } String @@ -1419,6 +1656,8 @@ _Edit::SetKeypadEnabled(bool enable) Variant var(enable); SetProperty("keypadEnabled", var); + + return; } bool @@ -1450,6 +1689,12 @@ _Edit::GetTextTotalHeight(void) const return _pEditPresenter->GetTextTotalHeight(); } +float +_Edit::GetTextTotalHeightF(void) const +{ + return _pEditPresenter->GetTextTotalHeightF(); +} + result _Edit::SetBlockTextColor(const Color& color) { @@ -1479,6 +1724,8 @@ void _Edit::GetBlockRange(int& start, int& end) const { _pEditPresenter->GetBlockRange(start, end); + + return; } result @@ -1491,6 +1738,8 @@ void _Edit::GetWordPosition(int cursorPos, int& startPos, int& endPos) const { _pEditPresenter->GetWordPosition(cursorPos, startPos, endPos); + + return; } result @@ -1565,6 +1814,12 @@ _Edit::CalculateAbsoluteCursorBounds(int index, Rectangle& absCursorRect) return _pEditPresenter->CalculateAbsoluteCursorBounds(index, absCursorRect); } +bool +_Edit::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCursorRect) +{ + return _pEditPresenter->CalculateAbsoluteCursorBounds(index, absCursorRect); +} + void _Edit::OnDraw(void) { @@ -1574,6 +1829,8 @@ _Edit::OnDraw(void) _pEditPresenter->Draw(*pCanvas); delete pCanvas; + + return; } bool @@ -1591,6 +1848,7 @@ _Edit::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) bool _Edit::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); return _pEditPresenter->OnTouchReleased(source, touchinfo); } @@ -1622,10 +1880,10 @@ _Edit::OnNotifiedN(const _Control& source, IList* pArgs) bool _Edit::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) { - int xDistance = 0; - int yDistance = 0; + float xDistance = 0.0f; + float yDistance = 0.0f; gesture.GetDistance(xDistance, yDistance); - Point flickPoint(xDistance, yDistance); + FloatPoint flickPoint(xDistance, yDistance); _pEditPresenter->InitializeCopyPasteManager(); @@ -1672,17 +1930,21 @@ void _Edit::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) { _pEditPresenter->OnClipboardPopupClosed(pClipboardItem); + + return; } bool _Edit::OnFocusGained(const _Control& source) { + __internalFocus = true; return _pEditPresenter->OnFocusGained(); } bool _Edit::OnFocusLost(const _Control& source) { + __internalFocus = false; _pEditPresenter->OnFocusLost(); Invalidate(); @@ -1697,43 +1959,15 @@ _Edit::OnAttachedToMainTree(void) return E_SUCCESS; } - _AccessibilityContainer* pEditAccessibilityContainer = GetAccessibilityContainer(); - if(pEditAccessibilityContainer) + if (__pTextAccessibilityElement) { - pEditAccessibilityContainer->Activate(true); + __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height)); } - if (pEditAccessibilityContainer) + if (__pClearButtonTextAccessibilityElement) { - if ((__editStyle & EDIT_STYLE_TITLE_TOP) || (__editStyle & EDIT_STYLE_TITLE_LEFT)) - { - __pTitleTextAccessibilityElement = new _AccessibilityElement(true); - __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds()); - __pTitleTextAccessibilityElement->SetLabel(GetTitleText()); - __pTitleTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); - __pTitleTextAccessibilityElement->SetName(L"EditTitleText"); - pEditAccessibilityContainer->AddElement(*__pTitleTextAccessibilityElement); - } - - __pTextAccessibilityElement = new _AccessibilityElement(true); - __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds()); - __pTextAccessibilityElement->SetLabel(GetText()); - __pTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); - __pTextAccessibilityElement->SetName(L"EditText"); - pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement); - - if (__editStyle & EDIT_STYLE_CLEAR) - { - __pClearButtonTextAccessibilityElement = new _AccessibilityElement(true); - __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds()); - __pClearButtonTextAccessibilityElement->SetLabel(L"all clear, button"); - __pClearButtonTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); - __pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton"); - pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement); - } + __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF()); } - __isAccessibilityCreated = true; - return E_SUCCESS; } @@ -1748,22 +1982,19 @@ _Edit::OnBoundsChanged(void) if(__isAccessibilityCreated) { - if (__pTitleTextAccessibilityElement) - { - __pTitleTextAccessibilityElement->SetBounds(_pEditPresenter->GetTitleBounds()); - } - if (__pTextAccessibilityElement) { - __pTextAccessibilityElement->SetBounds(_pEditPresenter->GetTextAreaBounds()); + __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height)); } if (__pClearButtonTextAccessibilityElement) { - __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBounds()); + __pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF()); } } } + + return; } void @@ -1771,24 +2002,32 @@ _Edit::OnChangeLayout(_ControlOrientation orientation) { result r = _pEditPresenter->ChangeLayout(orientation); SetLastResult(r); + + return; } void _Edit::OnScrollPanelBoundsChanged(void) { _pEditPresenter->OnScrollPanelBoundsChanged(); + + return; } void _Edit::OnFontChanged(Font* pFont) { _pEditPresenter->OnFontChanged(pFont); + + return; } void -_Edit::OnFontInfoRequested(unsigned long& style, int& size) +_Edit::OnFontInfoRequested(unsigned long& style, float& size) { _pEditPresenter->OnFontInfoRequested(style, size); + + return; } void @@ -1799,13 +2038,43 @@ _Edit::OnAncestorEnableStateChanged(const _Control& control) if (!enableState) { - if (_Edit::IsFocused()) + if (__internalFocus) { _pEditPresenter->HideKeypad(true); } } Invalidate(); + + return; +} + +result +_Edit::OnDetachingFromMainTree(void) +{ + __isDestroyed = true; + + return E_SUCCESS; +} + +void +_Edit::OnVisibleStateChanged(void) +{ + if (GetVisibleState() == false) + { + if (_pEditPresenter->IsCopyPasteManagerExist()) + { + _pEditPresenter->InitializeCopyPasteManager(); + } + } + + return; +} + +bool +_Edit::IsDestroyed(void) const +{ + return __isDestroyed; } unsigned long @@ -1818,12 +2087,16 @@ void _Edit::SetEditStyle(unsigned long style) { __editStyle = style; + + return; } void _Edit::SetBorderRoundStyleEnabled(bool enable) { __borderRoundStyle = enable; + + return; } bool @@ -1848,6 +2121,8 @@ void _Edit::SetAutoShrinkModeEnabled(bool enable) { _pEditPresenter->SetAutoShrinkModeEnabled(enable); + + return; } bool @@ -1867,18 +2142,24 @@ _Edit::SetEllipsisPosition(EllipsisPosition position) { __ellipsisPosition = position; _pEditPresenter->SetEllipsisPosition(position); + + return; } void _Edit::GetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor* colorInfo) const { *colorInfo = __cutlinkColor[type]; + + return; } void _Edit::SetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor colorInfo) { __cutlinkColor[type] = colorInfo; + + return; } Bitmap* @@ -1907,32 +2188,62 @@ _Edit::LoadDefaultBackgroundBitmap(GroupStyle groupStyle) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; case GROUP_STYLE_SINGLE: - r = GET_BITMAP_CONFIG_N(EDIT::BG_SINGLE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); - r = GET_BITMAP_CONFIG_N(EDIT::BG_SINGLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; - case GROUP_STYLE_TOP: - r = GET_BITMAP_CONFIG_N(EDIT::BG_TOP, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + case GROUP_STYLE_TOP: + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); - r = GET_BITMAP_CONFIG_N(EDIT::BG_TOP_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; case GROUP_STYLE_MIDDLE: - r = GET_BITMAP_CONFIG_N(EDIT::BG_CENTER, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); - r = GET_BITMAP_CONFIG_N(EDIT::BG_CENTER_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; case GROUP_STYLE_BOTTOM: - r = GET_BITMAP_CONFIG_N(EDIT::BG_BOTTOM, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); - r = GET_BITMAP_CONFIG_N(EDIT::BG_BOTTOM_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; default: r = GET_BITMAP_CONFIG_N(EDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_NORMAL]); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(EDIT::BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_DISABLED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(EDIT::BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_HIGHLIGHTED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); + r = GET_BITMAP_CONFIG_N(EDIT::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundBitmap[EDIT_STATUS_PRESSED]); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); r = GET_BITMAP_CONFIG_N(EDIT::BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDefaultBackgroundEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap"); break; @@ -2200,6 +2511,12 @@ _Edit::GetKeypadBounds(Rectangle& rect) const } result +_Edit::GetKeypadBounds(FloatRectangle& rect) const +{ + return _pEditPresenter->GetKeypadBounds(rect); +} + +result _Edit::SendExpandableEditAreaEvent(_ExpandableEditAreaEventStatus status, int selectedTokenIndex) { if (__pExpandableEditAreaEvent) @@ -2244,9 +2561,9 @@ _Edit::SendKeypadEvent(CoreKeypadAction keypadAction, CoreKeypadEventStatus even result _Edit::SendTextEvent(CoreTextEventStatus textEventStatus) { - if (__pTextAccessibilityElement) + if (__inputStyle == INPUT_STYLE_FULLSCREEN) { - __pTextAccessibilityElement->SetLabel(GetText()); + _pEditPresenter->DeleteFullscreenKeypad(); } if (__pTextEvent) @@ -2364,16 +2681,44 @@ _Edit::GetCursorBounds(bool isAbsRect, Rectangle& cursorBounds) const return _pEditPresenter->GetCursorBounds(isAbsRect, cursorBounds); } +result +_Edit::GetCursorBounds(bool isAbsRect, FloatRectangle& cursorBounds) const +{ + return _pEditPresenter->GetCursorBounds(isAbsRect, cursorBounds); +} + int _Edit::GetCursorPositionAt(const Point& touchPoint) const { return _pEditPresenter->GetCursorPositionAt(touchPoint); } +int +_Edit::GetCursorPositionAt(const FloatPoint& touchPoint) const +{ + return _pEditPresenter->GetCursorPositionAt(touchPoint); +} + void _Edit::SetCursorDisabled(bool disabled) { - return _pEditPresenter->SetCursorDisabled(disabled); + _pEditPresenter->SetCursorDisabled(disabled); + + return; +} + +void +_Edit::SetPressedGuideTextColor(const Color& color) +{ + __pressedGuideTextColor = color; + + return; +} + +Color +_Edit::GetPressedGuideTextColor(void) const +{ + return __pressedGuideTextColor; } result @@ -2504,7 +2849,7 @@ _Edit::GetPropertyKeypadAction(void) const result _Edit::SetPropertyLineSpacing(const Variant& lineSpacing) { - __lineSpacing = lineSpacing.ToInt(); + __lineSpacing = lineSpacing.ToFloat(); return E_SUCCESS; } @@ -2561,11 +2906,12 @@ result _Edit::SetPropertyTextSize(const Variant& textSize) { int fontMinSize = 0; - int size = textSize.ToInt(); + float size = textSize.ToFloat(); result r = E_SUCCESS; GET_FIXED_VALUE_CONFIG(EDIT::FONT_MIN_SIZE, _CONTROL_ORIENTATION_PORTRAIT, fontMinSize); - SysTryReturn(NID_UI_CTRL, size >= fontMinSize, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid size is given."); + int floatFontMinSize = _CoordinateSystemUtils::ConvertToFloat(fontMinSize); + SysTryReturn(NID_UI_CTRL, size >= floatFontMinSize, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid size is given."); r = _pEditPresenter->SetTextSize(size); @@ -2802,9 +3148,9 @@ _Edit::GetPropertyBlockedTextColor(void) const result _Edit::SetPropertyTopMargin(const Variant& margin) { - SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - __topMargin = margin.ToInt(); + __topMargin = margin.ToFloat(); return E_SUCCESS; } @@ -2818,9 +3164,9 @@ _Edit::GetPropertyTopMargin(void) const result _Edit::SetPropertyBottomMargin(const Variant& margin) { - SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - __bottomMargin = margin.ToInt(); + __bottomMargin = margin.ToFloat(); return E_SUCCESS; } @@ -2834,9 +3180,9 @@ _Edit::GetPropertyBottomMargin(void) const result _Edit::SetPropertyLeftMargin(const Variant& margin) { - SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - __leftMargin = margin.ToInt(); + __leftMargin = margin.ToFloat(); return E_SUCCESS; } @@ -2850,9 +3196,9 @@ _Edit::GetPropertyLeftMargin(void) const result _Edit::SetPropertyRightMargin(const Variant& margin) { - SysTryReturn(NID_UI_CTRL, margin.ToInt() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, margin.ToFloat() > 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - __rightMargin = margin.ToInt(); + __rightMargin = margin.ToFloat(); return E_SUCCESS; } @@ -2863,4 +3209,34 @@ _Edit::GetPropertyRightMargin(void) const return Variant(__rightMargin); } +bool +_Edit::ValidatePastedText(const String& pastedText, String& replacedText) +{ + bool enable = false; + if (__pTextFilter) + { + enable = __pTextFilter->ValidatePastedText(pastedText, replacedText); + } + + return enable; +} + +void +_Edit::SetEditTextFilter(IEditTextFilter* pFilter) +{ + __pTextFilter = pFilter; + _pEditPresenter->SetEditTextFilter(this); + + return; +} + +void +_Edit::SendOpaqueCommand (const String& command) +{ + _pEditPresenter->SendOpaqueCommand(command); + + return; +} + + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_EditAreaImpl.cpp b/src/ui/controls/FUiCtrl_EditAreaImpl.cpp old mode 100644 new mode 100755 index ae020c9..9b53a32 --- a/src/ui/controls/FUiCtrl_EditAreaImpl.cpp +++ b/src/ui/controls/FUiCtrl_EditAreaImpl.cpp @@ -23,7 +23,10 @@ #include #include #include +#include +#include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" #include "FUi_UiBuilder.h" @@ -51,6 +54,18 @@ _EditAreaImpl::EditAreaSizeInfo::GetDefaultMinimumSize(_ControlOrientation orien return editAreaMinimumSize; } +FloatDimension +_EditAreaImpl::EditAreaSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension editAreaMinimumSize(0.0f, 0.0f); + + r = GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editAreaMinimumSize); + SysTryReturn(NID_UI, r == E_SUCCESS, editAreaMinimumSize, r, "System Error occurred."); + + return editAreaMinimumSize; +} + _EditAreaImpl* _EditAreaImpl::GetInstance(EditArea& editArea) { @@ -154,6 +169,26 @@ _EditAreaImpl::CreateEditAreaImplN(EditArea* pControl, const Rectangle& rect) return pImpl; } +_EditAreaImpl* +_EditAreaImpl::CreateEditAreaImplN(EditArea* pControl, const Tizen::Graphics::FloatRectangle& rect) +{ + // To do: Check if it can be removed, Now it's almost same as CreateEditAreaImplN + ClearLastResult(); + result r = E_SUCCESS; + + _Edit* pCore = null; + + pCore = _Edit::CreateEditN(); + SysTryReturn(NID_UI_CTRL, pCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _EditAreaImpl* pImpl = new (std::nothrow) _EditAreaImpl(pControl, pCore); + + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +} + const char* _EditAreaImpl::GetPublicClassName(void) const { @@ -303,14 +338,26 @@ _EditAreaImpl::GetAutoLinkMask(void) const int _EditAreaImpl::GetLineSpacing(void) const { - return __pEdit->GetLineSpacing(); + return _CoordinateSystemUtils::ConvertToInteger(GetLineSpacingF()); +} + +float +_EditAreaImpl::GetLineSpacingF(void) const +{ + return __pEdit->GetLineSpacingF(); } result _EditAreaImpl::SetLineSpacing(int multiplier, int extra) { + return SetLineSpacing(multiplier, _CoordinateSystemUtils::ConvertToFloat(extra)); +} + +result +_EditAreaImpl::SetLineSpacing(int multiplier, float extra) +{ SysTryReturn(NID_UI_CTRL, multiplier >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - SysTryReturn(NID_UI_CTRL, extra >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, extra >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); return __pEdit->SetLineSpacing(DEFAULT_LINE_SPACE * multiplier + extra); } @@ -318,19 +365,31 @@ _EditAreaImpl::SetLineSpacing(int multiplier, int extra) int _EditAreaImpl::GetMargin(EditMarginType marginType) const { + return _CoordinateSystemUtils::ConvertToInteger(GetMarginF(marginType)); +} + +float +_EditAreaImpl::GetMarginF(EditMarginType marginType) const +{ if (marginType == EDIT_MARGIN_TYPE_VERTICAL) { - return __pEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN); + return __pEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); } else { - return __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + return __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); } } result _EditAreaImpl::SetMargin(EditMarginType marginType, int margin) { + return SetMargin(marginType, _CoordinateSystemUtils::ConvertToFloat(margin)); +} + +result +_EditAreaImpl::SetMargin(EditMarginType marginType, float margin) +{ result r = E_SUCCESS; Variant varMargin(margin); @@ -506,12 +565,24 @@ _EditAreaImpl::HideKeypad(void) int _EditAreaImpl::GetTextSize(void) const { - return __pEdit->GetPropertyTextSize().ToInt(); + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_EditAreaImpl::GetTextSizeF(void) const +{ + return __pEdit->GetPropertyTextSize().ToFloat(); } result _EditAreaImpl::SetTextSize(int size) { + return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +_EditAreaImpl::SetTextSize(float size) +{ Variant variantSize(size); return __pEdit->SetPropertyTextSize(variantSize); @@ -1065,6 +1136,8 @@ _EditAreaImpl::SetKeypadEnabled(bool enable) Variant variantEnable(enable); __pEdit->SetPropertyKeypadEnabled(variantEnable); + + return; } bool @@ -1465,6 +1538,23 @@ _EditAreaImpl::OnOtherControlSelected(const _Control& source) } } +void +_EditAreaImpl::SetEditTextFilter(IEditTextFilter* pFilter) +{ + __pEdit->SetEditTextFilter(pFilter); + + return; +} + +void +_EditAreaImpl::SendOpaqueCommand(const String& command) +{ + __pEdit->SendOpaqueCommand(command); + + return; +} + + class _EditAreaMaker : public _UiBuilderControlMaker { @@ -1531,7 +1621,6 @@ protected: { commandButtonVisible = true; } - } else { @@ -1556,6 +1645,10 @@ protected: { pEditArea->SetOverlayKeypadCommandButtonVisible(false); } + else + { + pEditArea->SetOverlayKeypadCommandButtonVisible(true); + } if (pControl->GetElement(L"text", elementString)) { @@ -1821,7 +1914,20 @@ protected: Base::Integer::Parse(elementString, verticalMargin); r = pEditArea->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMargin); } - + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pEditArea->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pEditArea; } private: diff --git a/src/ui/controls/FUiCtrl_EditCopyPasteEvent.cpp b/src/ui/controls/FUiCtrl_EditCopyPasteEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp b/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp index 8ee5bbe..9a27971 100644 --- a/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp +++ b/src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp @@ -26,20 +26,17 @@ #include #include "FUi_Clipboard.h" #include "FUi_ClipboardItem.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_EcoreEvasMgr.h" #include "FUiCtrl_EditCopyPasteManager.h" #include "FUiCtrl_EditCopyPasteEvent.h" #include "FUiCtrl_EditPresenter.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" - - -#if defined(MULTI_WINDOW) #include "FUi_EcoreEvas.h" #include "FUi_Window.h" -using namespace Tizen::Ui; -#endif +using namespace Tizen::Ui; using namespace Tizen::App; using namespace Tizen::Base; using namespace Tizen::Base::Runtime; @@ -56,6 +53,7 @@ const int COPY_PASTE_COPY_ID = 233; const int COPY_PASTE_CUT_ID = 234; const int COPY_PASTE_PASTE_ID = 235; const int COPY_PASTE_CLIPBOARD_ID = 236; +const int COPY_PASTE_SEARCH_ID = 237; /** * @class _EditCopyPasteHandler @@ -76,6 +74,7 @@ public: * */ _EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler); + _EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler); /** * This is the default class destructor. @@ -86,21 +85,27 @@ public: // Operations public: static _EditCopyPasteHandler* CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler = true); + static _EditCopyPasteHandler* CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler = true); int GetHandlerCursorPosition(void) const; void SetHandlerCursorPosition(int handlerCursorPos); - void SetLeftHandler(bool set); void AdjustBounds(void); -#if defined(MULTI_WINDOW) + void CheckReverseStatus(void); + void ChangeHandlerBitmap(bool leftHandler, bool reverse); Bitmap* GetHandlerBitmap(void) const; -#endif // virtual function virtual void OnDraw(void); virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); - virtual bool IsActivatedOnOpen(void) const; + virtual void OnChangeLayout(_ControlOrientation orientation); + virtual result OnAttachedToMainTree(void); + + result OnBoundsChanging(const Rectangle& bounds); + result OnBoundsChanging(const FloatRectangle& bounds); + result SetWindowBounds(const Rectangle& bounds); + result SetWindowBounds(const FloatRectangle& bounds); private: _EditCopyPasteHandler(const _EditCopyPasteHandler& value); @@ -111,32 +116,61 @@ private: _VisualElement* __pRoot; Bitmap* __pHandlerBitmap; Bitmap* __pHandlerPressedBitmap; - Point __touchPressedPoint; + FloatPoint __touchPressedPoint; _EditCopyPasteManager* __pCopyPasteManager; bool __leftHandler; + bool __reverseLeftHandler; + bool __reverseRightHandler; + bool __reverseCheck; int __handlerCursorPos; bool __isTouchPressed; - bool __isReverseBitmap; + FloatRectangle __windowBounds; }; // _EditCopyPasteHandler -#if defined(MULTI_WINDOW) Bitmap* _EditCopyPasteHandler::GetHandlerBitmap(void) const { return __pHandlerBitmap; } -#endif + +void +_EditCopyPasteHandler::ChangeHandlerBitmap(bool leftHandler, bool reverse) +{ + if (__pHandlerBitmap) + { + delete __pHandlerBitmap; + __pHandlerBitmap = null; + } + if (__pHandlerPressedBitmap) + { + delete __pHandlerPressedBitmap; + __pHandlerPressedBitmap = null; + } + if ( (leftHandler && reverse) || (!leftHandler && !reverse) ) + { + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_RIGHT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_RIGHT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerPressedBitmap); + } + else + { + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_LEFT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_LEFT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerPressedBitmap); + } +} _EditCopyPasteHandler::_EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler) : __pRoot(null) , __pHandlerBitmap(null) , __pHandlerPressedBitmap(null) - , __touchPressedPoint(0, 0) + , __touchPressedPoint(0.0f, 0.0f) , __pCopyPasteManager(pCopyPasteManager) , __leftHandler(leftHandler) + , __reverseLeftHandler(false) + , __reverseRightHandler(false) + , __reverseCheck(false) , __handlerCursorPos(handlerCursorPos) , __isTouchPressed(false) - , __isReverseBitmap(false) + , __windowBounds(0.0f, 0.0f, 0.0f, 0.0f) { AcquireHandle(); @@ -165,39 +199,52 @@ _EditCopyPasteHandler::_EditCopyPasteHandler(const Point& point, int handlerCurs } } - Rectangle bounds(handlerPoint.x, handlerPoint.y, __pHandlerBitmap->GetWidth(), __pHandlerBitmap->GetHeight()); -#if !defined(MULTI_WINDOW) - SetBounds(bounds); - _Window::Open(false); -#endif - _Edit* pEdit = __pCopyPasteManager->GetEdit(); - SysTryReturnVoidResult(NID_UI_CTRL, pEdit, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - _EditPresenter* pEditPresenter = pEdit->GetPresenter(); - SysTryReturnVoidResult(NID_UI_CTRL, pEdit, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + FloatRectangle bounds(handlerPoint.x, handlerPoint.y, __pHandlerBitmap->GetWidth(), __pHandlerBitmap->GetHeight()); +} - _Form* pParentForm = pEditPresenter->GetParentForm(); - if (pParentForm) +_EditCopyPasteHandler::_EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler) + : __pRoot(null) + , __pHandlerBitmap(null) + , __pHandlerPressedBitmap(null) + , __touchPressedPoint(0.0f, 0.0f) + , __pCopyPasteManager(pCopyPasteManager) + , __leftHandler(leftHandler) + , __reverseLeftHandler(false) + , __reverseRightHandler(false) + , __reverseCheck(false) + , __handlerCursorPos(handlerCursorPos) + , __isTouchPressed(false) + , __windowBounds(0.0f, 0.0f, 0.0f, 0.0f) +{ + AcquireHandle(); + + __pRoot = GetVisualElement(); + __pRoot->SetSurfaceOpaque(false); +//To do ..... + + //Point handlerPoint(_CoordinateSystemUtils::ConvertToInteger(point)); + FloatPoint handlerPoint(point); + if (singleHandler) { - SetOwner(pParentForm); + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_LEFT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + handlerPoint.x = handlerPoint.x - (__pHandlerBitmap->GetWidthF() / 2.0f); } else { - _Form* pForm = null; - _Frame* pCurrentFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); - if (pCurrentFrame) + if (leftHandler) { - pForm = pCurrentFrame->GetCurrentForm(); - if (pForm) - { - SetOwner(pForm); - } - else - { - SetOwner(pCurrentFrame); - } + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_LEFT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_LEFT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerPressedBitmap); + handlerPoint.x = handlerPoint.x - __pHandlerBitmap->GetWidthF(); + } + else + { + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_RIGHT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); + GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_ICON_RIGHT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerPressedBitmap); } } + + FloatRectangle bounds(handlerPoint.x, handlerPoint.y, _CoordinateSystemUtils::ConvertToFloat(__pHandlerBitmap->GetWidth()), _CoordinateSystemUtils::ConvertToFloat(__pHandlerBitmap->GetHeight())); } _EditCopyPasteHandler::~_EditCopyPasteHandler(void) @@ -220,7 +267,6 @@ _EditCopyPasteHandler::CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, singleHandler, leftHandler); SysTryReturn(NID_UI_CTRL, pCopyPasteHandler != null, null, E_OUT_OF_MEMORY, "pContextMenu is null"); -#if defined(MULTI_WINDOW) Point handlerPoint(point); Rectangle bounds(0, 0, 0, 0); Bitmap* pHandlerBitmap = pCopyPasteHandler->GetHandlerBitmap(); @@ -248,19 +294,61 @@ _EditCopyPasteHandler::CreateInstanceN(const Point& point, int handlerCursorPos, bounds.height = pHandlerBitmap->GetHeight(); pCopyPasteHandler->SetBounds(bounds); + pCopyPasteHandler->CheckReverseStatus(); + pCopyPasteHandler->Open(false); + return pCopyPasteHandler; + +CATCH: + pCopyPasteHandler->Close(); + delete pCopyPasteHandler; + + return null; +} + +_EditCopyPasteHandler* +_EditCopyPasteHandler::CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler) +{ + _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, singleHandler, leftHandler); + SysTryReturn(NID_UI_CTRL, pCopyPasteHandler != null, null, E_OUT_OF_MEMORY, "pContextMenu is null"); + + FloatPoint handlerPoint(point); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); + Bitmap* pHandlerBitmap = pCopyPasteHandler->GetHandlerBitmap(); + + result r = pCopyPasteHandler->CreateRootVisualElement(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pCopyPasteHandler->SetActivationEnabled(false); + + if (singleHandler) + { + handlerPoint.x = handlerPoint.x - (pHandlerBitmap->GetWidthF() / 2.0f); + } + else + { + if (leftHandler) + { + handlerPoint.x = handlerPoint.x - pHandlerBitmap->GetWidthF(); + } + } + + bounds.x = handlerPoint.x; + bounds.y = handlerPoint.y; + bounds.width = pHandlerBitmap->GetWidthF(); + bounds.height = pHandlerBitmap->GetHeightF(); + + pCopyPasteHandler->SetBounds(bounds); + pCopyPasteHandler->CheckReverseStatus(); pCopyPasteHandler->Open(false); -#endif return pCopyPasteHandler; -#if defined(MULTI_WINDOW) CATCH: pCopyPasteHandler->Close(); delete pCopyPasteHandler; return null; -#endif } int @@ -276,32 +364,51 @@ _EditCopyPasteHandler::SetHandlerCursorPosition(int handlerCursorPos) } void -_EditCopyPasteHandler::SetLeftHandler(bool set) -{ - __leftHandler = set; -} - -void _EditCopyPasteHandler::AdjustBounds(void) { int previousCursorPos; - Rectangle cursorRect; - Rectangle rect = GetBounds(); + FloatRectangle cursorRect; + FloatRectangle rect = GetBoundsF(); + FloatRectangle checkBounds(0.0f, 0.0f, 0.0f, 0.0f); previousCursorPos = __pCopyPasteManager->GetCursorPosition(); __pCopyPasteManager->SetCursorPosition(__handlerCursorPos); - cursorRect = __pCopyPasteManager->GetCursorBounds(true); + cursorRect = __pCopyPasteManager->GetCursorBoundsF(true); __pCopyPasteManager->SetCursorPosition(previousCursorPos); rect.x = cursorRect.x; rect.y = cursorRect.y + cursorRect.height; + if (__leftHandler && !__reverseLeftHandler) + { + rect.x = rect.x - __pHandlerBitmap->GetWidthF(); + } + + if (__reverseRightHandler) + { + rect.x = rect.x - __pHandlerBitmap->GetWidthF(); + } + + checkBounds = rect; + if (__leftHandler) { - rect.x = rect.x - __pHandlerBitmap->GetWidth(); + checkBounds.x += checkBounds.width; } + bool visibleState = __pCopyPasteManager->CheckHandleBounds(Point(checkBounds.x, checkBounds.y)); + if (visibleState && !GetVisibleState()) + { + SetVisibleState(true); + Open(); + } + else if (!visibleState && GetVisibleState()) + { + SetVisibleState(false); + Close(); + } SetBounds(rect); + return; } void @@ -318,26 +425,36 @@ _EditCopyPasteHandler::OnDraw(void) { if (__pHandlerPressedBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(pCanvas->GetBounds(), *__pHandlerPressedBitmap); + pCanvas->DrawNinePatchedBitmap(pCanvas->GetBoundsF(), *__pHandlerPressedBitmap); } else { - pCanvas->DrawBitmap(pCanvas->GetBounds(), *__pHandlerPressedBitmap); + pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pHandlerPressedBitmap); } } else { if (__pHandlerBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(pCanvas->GetBounds(), *__pHandlerBitmap); + pCanvas->DrawNinePatchedBitmap(pCanvas->GetBoundsF(), *__pHandlerBitmap); } else { - pCanvas->DrawBitmap(pCanvas->GetBounds(), *__pHandlerBitmap); + pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pHandlerBitmap); } } delete pCanvas; + + if (__reverseCheck) + { + SetWindowBounds(__windowBounds); + __reverseCheck = false; + } + else + { + SetWindowBounds(__windowBounds); + } } bool @@ -350,9 +467,69 @@ _EditCopyPasteHandler::OnTouchPressed(const _Control& source, const _TouchInfo& return true; } +void +_EditCopyPasteHandler::CheckReverseStatus(void) +{ + if (__leftHandler) + { + FloatRectangle rect = GetBoundsF(); + + if (!__reverseLeftHandler && rect.x < 0) + { + ChangeHandlerBitmap(true, true); + rect.x += rect.width; + __reverseLeftHandler = true; + __reverseCheck = true; + SetBounds(rect); + } + else if (__reverseLeftHandler && (rect.x >= rect.width)) + { + ChangeHandlerBitmap(true, false); + rect.x -= rect.width; + __reverseLeftHandler = false; + __reverseCheck = true; + SetBounds(rect); + } + } + else + { + FloatRectangle rect = GetBoundsF(); + FloatDimension screenSize; + _ControlManager* pControlManager = _ControlManager::GetInstance(); + _ControlOrientation orientation = GetOrientation(); + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + screenSize.width = pControlManager->GetScreenSize().width; + } + else + { + screenSize.width = pControlManager->GetScreenSize().height; + } + + if (!__reverseRightHandler && ((rect.x + rect.width) > screenSize.width)) + { + ChangeHandlerBitmap(false, true); + rect.x -= rect.width; + __reverseRightHandler = true; + __reverseCheck = true; + SetBounds(rect); + } + else if (__reverseRightHandler && ((rect.x + rect.width + rect.width) <= screenSize.width)) + { + ChangeHandlerBitmap(false, false); + rect.x += rect.width; + __reverseRightHandler = false; + __reverseCheck = true; + SetBounds(rect); + } + } +} + bool _EditCopyPasteHandler::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { + CheckReverseStatus(); __isTouchPressed = false; __pCopyPasteManager->CreateCopyPastePopup(); __pCopyPasteManager->Show(); @@ -366,11 +543,11 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to { int cursorPos; int previousCursorPos; - Rectangle cursorRect; - Rectangle absCursorRect; - Rectangle rect = GetBounds(); - Point point = touchinfo.GetCurrentPosition(); - Point touchPoint; + FloatRectangle cursorRect; + FloatRectangle absCursorRect; + FloatRectangle rect = GetBoundsF(); + FloatPoint point = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint; _Edit* pEdit = __pCopyPasteManager->GetEdit(); SysTryReturn(NID_UI_CTRL, pEdit, false, E_INVALID_STATE, "[E_INVALID_STATE] pEdit is null.\n"); @@ -385,18 +562,18 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to previousCursorPos = __pCopyPasteManager->GetCursorPosition(); __pCopyPasteManager->SetCursorPosition(__handlerCursorPos); - cursorRect = __pCopyPasteManager->GetCursorBounds(false); - absCursorRect = __pCopyPasteManager->GetCursorBounds(true); + cursorRect = __pCopyPasteManager->GetCursorBoundsF(false); + absCursorRect = __pCopyPasteManager->GetCursorBoundsF(true); touchPoint.x = cursorRect.x + (point.x - __touchPressedPoint.x); - touchPoint.y = cursorRect.y + cursorRect.height/2 + (point.y - __touchPressedPoint.y); + touchPoint.y = cursorRect.y + cursorRect.height/2.0f + (point.y - __touchPressedPoint.y); cursorPos = __pCopyPasteManager->GetCursorPositionAt(touchPoint); - if (cursorPos == -1 || (!__pCopyPasteManager->CheckHandleBounds(Point(absCursorRect.x, absCursorRect.y + absCursorRect.height)))) + if (cursorPos == -1 || (!__pCopyPasteManager->CheckHandleBounds(FloatPoint(absCursorRect.x, absCursorRect.y + absCursorRect.height)))) { TextObject* pTextObject = pEditPresenter->GetTextObject(); int curCursorLine = pTextObject->GetLineIndexAtTextIndex(__handlerCursorPos); int totalLine = pTextObject->GetTotalLineCount(); - Rectangle editVisibleArea = __pCopyPasteManager->GetEditVisibleArea(); + FloatRectangle editVisibleArea = __pCopyPasteManager->GetEditVisibleAreaF(); if (cursorPos != -1) { @@ -418,11 +595,11 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to int line = pTextObject->GetFirstDisplayLineIndex(); pTextObject->SetFirstDisplayLineIndex(line+1); __pCopyPasteManager->SetCursorPosition(cursorPos); - absCursorRect = __pCopyPasteManager->GetCursorBounds(true); - int firstDisplayY = pTextObject->GetFirstDisplayPositionY(); - int gapY = absCursorRect.y + absCursorRect.height - (editVisibleArea.y + editVisibleArea.height); - int tempMargin = 2; - if (gapY > 0) + absCursorRect = __pCopyPasteManager->GetCursorBoundsF(true); + float firstDisplayY = pTextObject->GetFirstDisplayPositionYF(); + float gapY = absCursorRect.y + absCursorRect.height - (editVisibleArea.y + editVisibleArea.height); + float tempMargin = 2.0f; + if (gapY > 0.0f) { pTextObject->SetFirstDisplayPositionY(firstDisplayY + gapY + tempMargin); } @@ -461,7 +638,7 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to { if (pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) { - if (point.x - __touchPressedPoint.x >= 0) // RightSide + if (point.x - __touchPressedPoint.x >= 0.0f) // RightSide { if (__handlerCursorPos == pEditPresenter->GetTextLength()) { @@ -490,14 +667,14 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to } } - if (point.y < 0 || (point.y > GetBounds().height)) + if (point.y < 0.0f || (point.y > GetBoundsF().height)) { return true; } } else { - if (point.y - __touchPressedPoint.y >= 0) // DownSide + if (point.y - __touchPressedPoint.y >= 0.0f) // DownSide { if (curCursorLine < totalLine - 1) { @@ -567,23 +744,16 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to return true; } - __pCopyPasteManager->SetCursorPosition(cursorPos); - - cursorRect = __pCopyPasteManager->GetCursorBounds(true); - - rect.x = cursorRect.x; - rect.y = cursorRect.y + cursorRect.height; - if (__leftHandler) { - rect.x = rect.x - __pHandlerBitmap->GetWidth(); + TextObject* pTextObject = pEditPresenter->GetTextObject(); + pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos); } + __pCopyPasteManager->SetCursorPosition(cursorPos); __handlerCursorPos = cursorPos; - SetBounds(rect); - - __pCopyPasteManager->RefreshBlock(true, __leftHandler); + __pCopyPasteManager->RefreshBlock(__leftHandler); return true; } @@ -594,15 +764,120 @@ _EditCopyPasteHandler::IsActivatedOnOpen(void) const return false; } +void +_EditCopyPasteHandler::OnChangeLayout(_ControlOrientation orientation) +{ + AdjustBounds(); + return; +} + +result +_EditCopyPasteHandler::OnAttachedToMainTree(void) +{ + result r = E_SUCCESS; + + if (GetOwner() == null) + { + _Edit* pEdit = __pCopyPasteManager->GetEdit(); + SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEdit."); + + _EditPresenter* pEditPresenter = pEdit->GetPresenter(); + SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEditPresenter."); + + _Form* pParentForm = pEditPresenter->GetParentForm(); + if (pParentForm) + { + SetOwner(pParentForm); + } + else + { + _Form* pForm = null; + _Frame* pCurrentFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); + if (pCurrentFrame) + { + pForm = pCurrentFrame->GetCurrentForm(); + if (pForm) + { + SetOwner(pForm); + } + else + { + SetOwner(pCurrentFrame); + } + } + } + } + + return r; +} + +result +_EditCopyPasteHandler::OnBoundsChanging(const FloatRectangle& bounds) +{ + result r = E_SUCCESS; + + __windowBounds = bounds; + + if (!GetVisibleState()) + { + return r; + } + + if (!__reverseCheck) + { + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds)); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + return r; +} + +result +_EditCopyPasteHandler::OnBoundsChanging(const Rectangle& bounds) +{ + result r = E_SUCCESS; + //To do + return r; +} +result +_EditCopyPasteHandler::SetWindowBounds(const Rectangle& bounds) +{ + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +_EditCopyPasteHandler::SetWindowBounds(const FloatRectangle& bounds) +{ + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds)); + result r = GetLastResult(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + _EditCopyPasteManager::_EditCopyPasteManager(_Edit& parenEdit) : __pCopyPastePopup(null) , __contextMenuAlign(CONTEXT_MENU_CORE_ALIGN_UP) , __pCoreCopyPasteEvent(null) , __pEdit(&parenEdit) - , __contextMenuHeight(0) + , __contextMenuHeight(0.0f) , __needToReleaseBlock(true) , __isHandlerMoving(false) - , __editVisibleArea(0, 0, 0, 0) + , __editVisibleArea(0.0f, 0.0f, 0.0f, 0.0f) { __pHandle[HANDLER_TYPE_LEFT] = null; __pHandle[HANDLER_TYPE_RIGHT] = null; @@ -663,17 +938,23 @@ _EditCopyPasteManager::ReleaseCopyPastePopup(void) bool _EditCopyPasteManager::IsCopyPastePopup(const _Control& control) const { - if (__pHandle[HANDLER_TYPE_LEFT] == &control) + if (__pCopyPastePopup == &control) { return true; } - if (__pHandle[HANDLER_TYPE_RIGHT] == &control) + return false; +} + +bool +_EditCopyPasteManager::IsCopyPasteHandle(const _Control& control) const +{ + if (__pHandle[HANDLER_TYPE_LEFT] == &control) { return true; } - if (__pCopyPastePopup == &control) + if (__pHandle[HANDLER_TYPE_RIGHT] == &control) { return true; } @@ -719,23 +1000,23 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) __pCopyPastePopup = null; } - Rectangle startRect; - Rectangle endRect; - Rectangle editAbsRect; - Rectangle editShowAreaAbsRect; - Rectangle commandButtonBounds; - Rectangle keypadBounds(0, 0, 0, 0); + FloatRectangle startRect; + FloatRectangle endRect; + FloatRectangle editAbsRect; + FloatRectangle editShowAreaAbsRect; + FloatRectangle commandButtonBounds; + FloatRectangle keypadBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle formClientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f); bool keypadExist = false; bool commandButtonExist = false; - Rectangle cursorRect = GetCursorBounds(true); + FloatRectangle cursorRect = GetCursorBoundsF(true); - int contextMenuHeight = 0; - int contextMenuTopMargin = 0; - int contextMenuBottomMargin = 0; - int contextMenuArrowHeight = 0; - int contextMenuLeftMargin = 0; - int contextMenuArrowWidth = 0; - int handlerHeight = 0; + float contextMenuHeight = 0.0f; + float contextMenuTopMargin = 0.0f; + float contextMenuBottomMargin = 0.0f; + float contextMenuArrowHeight = 0.0f; + float handlerHeight = 0.0f; bool isPasswordStyle = false; if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) { @@ -750,8 +1031,6 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) GET_SHAPE_CONFIG(CONTEXTMENU::GRID_TOP_MARGIN, orientation, contextMenuTopMargin); GET_SHAPE_CONFIG(CONTEXTMENU::GRID_BOTTOM_MARGIN, orientation, contextMenuBottomMargin); GET_SHAPE_CONFIG(CONTEXTMENU::ARROW_HEIGHT, orientation, contextMenuArrowHeight); - GET_SHAPE_CONFIG(CONTEXTMENU::SCREEN_LEFT_MARGIN, orientation, contextMenuLeftMargin); - GET_SHAPE_CONFIG(CONTEXTMENU::ARROW_WIDTH, orientation, contextMenuArrowWidth); __contextMenuHeight = contextMenuHeight + contextMenuTopMargin + contextMenuBottomMargin + contextMenuArrowHeight; if (__pEdit->IsClipped() == true && __pEdit->IsViewModeEnabled() == false && __pEdit->GetTextLength() > 0 && orientation == _CONTROL_ORIENTATION_PORTRAIT) @@ -759,17 +1038,29 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) __contextMenuHeight = __contextMenuHeight + contextMenuHeight; } - editAbsRect = __pEdit->GetAbsoluteBounds(); + editAbsRect = __pEdit->GetAbsoluteBoundsF(); _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + SysTryReturnVoidResult(NID_UI_CTRL, pEditPresenter, E_INVALID_STATE, "[EDIT] pEditPresenter is null."); + _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton(); if (pCommandButton) { - commandButtonBounds = pCommandButton->GetAbsoluteBounds(); + commandButtonBounds = pCommandButton->GetAbsoluteBoundsF(); commandButtonExist = true; } + _Form* pForm = pEditPresenter->GetParentForm(); + if (pForm) + { + formClientBounds = pForm->GetClientBoundsF(); + } + _ScrollPanel* pPanel = pEditPresenter->GetParentPanel(); + if (pPanel) + { + panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF(); + } __pEdit->GetKeypadBounds(keypadBounds); - Dimension screenSize(0, 0); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screenSize(0.0f, 0.0f); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); if (keypadBounds.y != screenSize.height) { keypadExist = true; @@ -793,9 +1084,19 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) editShowAreaAbsRect.height -= (editShowAreaAbsRect.y + editShowAreaAbsRect.height - keypadBounds.y); } } + if (editShowAreaAbsRect.y < formClientBounds.y) + { + editShowAreaAbsRect.y = formClientBounds.y; + editShowAreaAbsRect.height -= formClientBounds.y; + } + if (editShowAreaAbsRect.y < panelAbsoulteBounds.y) + { + editShowAreaAbsRect.y = panelAbsoulteBounds.y; + editShowAreaAbsRect.height -= (panelAbsoulteBounds.y - editShowAreaAbsRect.y); + } __editVisibleArea = editShowAreaAbsRect; } - Point copyPastePoint(0, 0); + FloatPoint copyPastePoint(0.0f, 0.0f); __contextMenuAlign = CONTEXT_MENU_CORE_ALIGN_UP; if (__pEdit->IsBlocked()) @@ -910,20 +1211,21 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) else { - Rectangle cursorRect; + FloatRectangle cursorRect; int cursorPosition = GetCursorPosition(); __pEdit->CalculateAbsoluteCursorBounds(cursorPosition, cursorRect); copyPastePoint.x = cursorRect.x; copyPastePoint.y = cursorRect.y; if (copyPastePoint.y < __contextMenuHeight) { - Rectangle cursorRect = GetCursorBounds(true); + FloatRectangle cursorRect = GetCursorBoundsF(true); copyPastePoint.y += cursorRect.height; __contextMenuAlign = CONTEXT_MENU_CORE_ALIGN_DOWN; } } - + + //Todo: Create API ex)CreateContrexMenuFN __pCopyPastePopup = _ContextMenu::CreateContextMenuN(copyPastePoint, CONTEXT_MENU_CORE_STYLE_GRID, __contextMenuAlign); SysTryReturnVoidResult(NID_UI_CTRL, __pCopyPastePopup, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -969,14 +1271,63 @@ _EditCopyPasteManager::CreateCopyPastePopup(void) __pCopyPastePopup->AddItem(pasteText, COPY_PASTE_PASTE_ID, null, null, null); if (!isPasswordStyle) { - __pCopyPastePopup->AddItem(clipboardText, COPY_PASTE_CLIPBOARD_ID, null, null, null); + __pCopyPastePopup->AddItem(clipboardText, COPY_PASTE_CLIPBOARD_ID, null, null, null); } } } + Bitmap* pSearchBitmap = null; + Bitmap* pReplacedSearchBitmap = null; + Bitmap* pReplacedSearchPressedBitmap = null; + Color searchColor; + Color searchPressedColor; + result r = E_SUCCESS; + + if (__pEdit->IsBlocked() && !isPasswordStyle) + { + r = GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_SEARCH_ICON, BITMAP_PIXEL_FORMAT_ARGB8888, pSearchBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + GET_COLOR_CONFIG(CONTEXTMENU::ITEM_TEXT_NORMAL, searchColor); + GET_COLOR_CONFIG(CONTEXTMENU::ITEM_TEXT_PRESSED, searchPressedColor); + + pReplacedSearchBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSearchBitmap, Color::GetColor(COLOR_ID_MAGENTA), searchColor); + SysTryCatch(NID_UI_CTRL, pReplacedSearchBitmap, r = GetLastResult(), GetLastResult(),"[%s] Propagating.", GetErrorMessage(GetLastResult())); + + pReplacedSearchPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSearchBitmap, Color::GetColor(COLOR_ID_MAGENTA), searchPressedColor); + SysTryCatch(NID_UI_CTRL, pReplacedSearchPressedBitmap, r = GetLastResult(), GetLastResult(),"[%s] Propagating.", GetErrorMessage(GetLastResult())); + + __pCopyPastePopup->AddItem(null, COPY_PASTE_SEARCH_ID, pReplacedSearchBitmap, pReplacedSearchPressedBitmap, null); + } + + if (pSearchBitmap) + { + delete pSearchBitmap; + pSearchBitmap = null; + } + if (pReplacedSearchBitmap) + { + delete pReplacedSearchBitmap; + pReplacedSearchBitmap = null; + } + + if (pReplacedSearchPressedBitmap) + { + delete pReplacedSearchPressedBitmap; + pReplacedSearchPressedBitmap = null; + } __pCopyPastePopup->AddActionEventListener(*this); return; + +CATCH: + delete pSearchBitmap; + pSearchBitmap = null; + + delete pReplacedSearchBitmap; + pReplacedSearchBitmap = null; + + return; } void @@ -1064,12 +1415,96 @@ _EditCopyPasteManager::PrintLog(const Point& point) } void +_EditCopyPasteManager::PrintLog(const FloatPoint& point) +{ + FloatRectangle startRect; + FloatRectangle endRect; + FloatRectangle editAbsRect; + FloatRectangle keypadBounds; + FloatRectangle editShowAreaAbsRect; + FloatRectangle commandButtonBounds; + FloatRectangle formClientBounds(0.0f, 0.0f, 0.0f, 0.0f); + bool hasParentForm = false; + bool hasCommandButton = false; + FloatRectangle cursorRect = GetCursorBoundsF(true); + float indicatorHeight = 0; + + editAbsRect = __pEdit->GetAbsoluteBoundsF(); + _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton(); + if (pCommandButton) + { + commandButtonBounds = pCommandButton->GetAbsoluteBoundsF(); + hasCommandButton = true; + } + _Form* pForm = pEditPresenter->GetParentForm(); + if (pForm) + { + formClientBounds = pForm->GetClientBoundsF(); + hasParentForm = true; + } + int start = -1; + int end = -1; + __pEdit->GetBlockRange(start, end); + if (start == -1 || end == -1) + { + SysLog(NID_UI_CTRL, "[EditCopyPasteManager] There is no blocked Range"); + return; + } + __pEdit->GetKeypadBounds(keypadBounds); + + if (pForm && pForm->IsIndicatorVisible()) + { + indicatorHeight = pForm->GetIndicatorBoundsF().height; + } + + { + editShowAreaAbsRect = editAbsRect; + if (indicatorHeight) + { + if (editShowAreaAbsRect.y < indicatorHeight) + { + editShowAreaAbsRect.y = indicatorHeight; + } + } + + if (hasCommandButton) + { + if (editShowAreaAbsRect.y + editShowAreaAbsRect.height > commandButtonBounds.y) + { + editShowAreaAbsRect.height -= (editShowAreaAbsRect.y + editShowAreaAbsRect.height - commandButtonBounds.y); + } + } + else + { + if (editShowAreaAbsRect.y + editShowAreaAbsRect.height > keypadBounds.y) + { + editShowAreaAbsRect.height -= (editShowAreaAbsRect.y + editShowAreaAbsRect.height - keypadBounds.y); + } + } + } + + __pEdit->CalculateAbsoluteCursorBounds(start, startRect); + __pEdit->CalculateAbsoluteCursorBounds(end, endRect); + + SysLog(NID_UI_CTRL, "copyPastePoint (x=%f), (y=%f)\n", point.x, point.y ); + SysLog(NID_UI_CTRL, "startRect (x=%f), (y=%f), (width=%f), (height=%f) \n", startRect.x, startRect.y ,startRect.width, startRect.height); + SysLog(NID_UI_CTRL, "endRect (x=%f), (y=%f), (width=%f), (height=%f) \n", endRect.x, endRect.y ,endRect.width, endRect.height); + SysLog(NID_UI_CTRL, "editAbsRect (x=%f), (y=%f), (width=%f), (height=%f) \n", editAbsRect.x, editAbsRect.y ,editAbsRect.width, editAbsRect.height); + SysLog(NID_UI_CTRL, "editShowAreaAbsRect (x=%f), (y=%f), (width=%f), (height=%f) \n", editShowAreaAbsRect.x, editShowAreaAbsRect.y ,editShowAreaAbsRect.width, editShowAreaAbsRect.height); + SysLog(NID_UI_CTRL, "keypadBounds (x=%f), (y=%f), (width=%f), (height=%f) \n", keypadBounds.x, keypadBounds.y ,keypadBounds.width, keypadBounds.height); + SysLog(NID_UI_CTRL, "commandButtonBounds (x=%f), (y=%f), (width=%f), (height=%f) \n", commandButtonBounds.x, commandButtonBounds.y ,commandButtonBounds.width, commandButtonBounds.height); + SysLog(NID_UI_CTRL, "formClientBounds (x=%f), (y=%f), (width=%f), (height=%f) \n", formClientBounds.x, formClientBounds.y ,formClientBounds.width, formClientBounds.height); + SysLog(NID_UI_CTRL, "contextMenuHeight = %f\n", __contextMenuHeight); +} + +void _EditCopyPasteManager::CreateHandle(void) { int start = -1; int end = -1; - Rectangle startRect; - Rectangle endRect; + FloatRectangle startRect; + FloatRectangle endRect; __pEdit->GetBlockRange(start, end); @@ -1086,21 +1521,9 @@ _EditCopyPasteManager::CreateHandle(void) void _EditCopyPasteManager::Show(void) { - bool hasParentForm = false; - Rectangle formClientBounds(0, 0, 0, 0); - _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); - - _Form* pForm = pEditPresenter->GetParentForm(); - if (pForm) - { - formClientBounds = pForm->GetClientBounds(); - hasParentForm = true; - } - if (__pHandle[HANDLER_TYPE_LEFT] && __pHandle[HANDLER_TYPE_RIGHT]) { - CheckVisibleState(true); - CheckVisibleState(false); + AdjustBounds(); } if (__pCopyPastePopup) @@ -1111,7 +1534,7 @@ _EditCopyPasteManager::Show(void) _Control* pControl = __pCopyPastePopup->GetOwner(); if (pControl) { - pControl->SetInputEnableState(true); + pControl->SetInputEventEnableState(true); } } } @@ -1121,9 +1544,11 @@ _EditCopyPasteManager::CheckHandleBounds(const Point& point) { bool hasCommandButton = false; bool hasParentForm = false; + bool hasParentPanel = false; bool showCheck = true; Rectangle commandButtonBounds(0, 0, 0, 0); Rectangle formClientBounds(0, 0, 0, 0); + Rectangle panelAbsoulteBounds(0, 0, 0, 0); Rectangle editAbsBounds = __pEdit->GetAbsoluteBounds(); _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton(); @@ -1139,6 +1564,13 @@ _EditCopyPasteManager::CheckHandleBounds(const Point& point) hasParentForm = true; } + _ScrollPanel* pPanel = pEditPresenter->GetParentPanel(); + if (pPanel) + { + panelAbsoulteBounds = pPanel->GetAbsoluteBounds(); + hasParentPanel = true; + } + if (editAbsBounds.x > point.x || point.x > (editAbsBounds.x + editAbsBounds.width)) { showCheck = false; @@ -1152,6 +1584,66 @@ _EditCopyPasteManager::CheckHandleBounds(const Point& point) { showCheck = false; } + if (hasParentPanel && (panelAbsoulteBounds.y > point.y || point.y > (panelAbsoulteBounds.y + panelAbsoulteBounds.height))) + { + showCheck = false; + } + if (hasCommandButton && commandButtonBounds.Contains(point)) + { + showCheck = false; + } + return showCheck; +} + +bool +_EditCopyPasteManager::CheckHandleBounds(const FloatPoint& point) +{ + bool hasCommandButton = false; + bool hasParentForm = false; + bool hasParentPanel = false; + bool showCheck = true; + FloatRectangle commandButtonBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle formClientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF(); + _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton(); + if (pCommandButton) + { + commandButtonBounds = pCommandButton->GetAbsoluteBoundsF(); + hasCommandButton = true; + } + _Form* pForm = pEditPresenter->GetParentForm(); + if (pForm) + { + formClientBounds = pForm->GetClientBoundsF(); + hasParentForm = true; + } + + _ScrollPanel* pPanel = pEditPresenter->GetParentPanel(); + if (pPanel) + { + panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF(); + hasParentPanel = true; + } + + if (editAbsBounds.x > point.x || point.x > (editAbsBounds.x + editAbsBounds.width)) + { + showCheck = false; + } + + if (editAbsBounds.y > point.y || point.y > (editAbsBounds.y + editAbsBounds.height)) + { + showCheck = false; + } + if (hasParentForm && (formClientBounds.y > point.y || point.y > (formClientBounds.y + formClientBounds.height))) + { + showCheck = false; + } + if (hasParentPanel && (panelAbsoulteBounds.y > point.y || point.y > (panelAbsoulteBounds.y + panelAbsoulteBounds.height))) + { + showCheck = false; + } if (hasCommandButton && commandButtonBounds.Contains(point)) { showCheck = false; @@ -1190,52 +1682,7 @@ _EditCopyPasteManager::CheckHandlePosition(bool leftHandle, int cursorPosition) } void -_EditCopyPasteManager::CheckVisibleState(bool leftHandle) -{ - if (leftHandle) - { - Point leftHandleXY(__pHandle[HANDLER_TYPE_LEFT]->GetAbsoluteBounds().x + __pHandle[HANDLER_TYPE_LEFT]->GetAbsoluteBounds().width, __pHandle[HANDLER_TYPE_LEFT]->GetAbsoluteBounds().y); - if (!CheckHandleBounds(leftHandleXY)) - { - __pHandle[HANDLER_TYPE_LEFT]->SetVisibleState(false); - } - else - { - __pHandle[HANDLER_TYPE_LEFT]->SetVisibleState(true); - __pHandle[HANDLER_TYPE_LEFT]->Open(); - } - } - else - { - Point rightHandleXY(__pHandle[HANDLER_TYPE_RIGHT]->GetAbsoluteBounds().x, __pHandle[HANDLER_TYPE_RIGHT]->GetAbsoluteBounds().y); - if (!CheckHandleBounds(rightHandleXY)) - { - __pHandle[HANDLER_TYPE_RIGHT]->SetVisibleState(false); - } - else - { - __pHandle[HANDLER_TYPE_RIGHT]->SetVisibleState(true); - __pHandle[HANDLER_TYPE_RIGHT]->Open(); - } - } -} - -void -_EditCopyPasteManager::HideHandle(void) -{ - __pEdit->ReleaseTextBlock(); - if (__pHandle[HANDLER_TYPE_LEFT]) - { - __pHandle[HANDLER_TYPE_LEFT]->SetVisibleState(false); - } - if (__pHandle[HANDLER_TYPE_RIGHT]) - { - __pHandle[HANDLER_TYPE_RIGHT]->SetVisibleState(false); - } -} - -void -_EditCopyPasteManager::RefreshBlock(bool changeVisibleState, bool isLeftHandle) +_EditCopyPasteManager::RefreshBlock(bool isLeftHandle) { int leftHandlerPos = __pHandle[HANDLER_TYPE_LEFT]->GetHandlerCursorPosition(); int rightHandlerPos = __pHandle[HANDLER_TYPE_RIGHT]->GetHandlerCursorPosition(); @@ -1243,27 +1690,10 @@ _EditCopyPasteManager::RefreshBlock(bool changeVisibleState, bool isLeftHandle) _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); SysTryReturnVoidResult(NID_UI_CTRL, pEditPresenter, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - if (!isLeftHandle) - { - pEditPresenter->ScrollPanelToCursorPosition(); - } - else - { - pEditPresenter->SetCursorPosition(leftHandlerPos); - pEditPresenter->ScrollPanelToCursorPosition(); - pEditPresenter->SetCursorPosition(rightHandlerPos); - } __pEdit->SetBlockRange(leftHandlerPos, rightHandlerPos); pEditPresenter->SetCursorChangedFlag(!isLeftHandle); pEditPresenter->DrawText(); - - __pHandle[HANDLER_TYPE_LEFT]->AdjustBounds(); - __pHandle[HANDLER_TYPE_RIGHT]->AdjustBounds(); - - if (changeVisibleState) - { - CheckVisibleState(!isLeftHandle); - } + AdjustBounds(); } Rectangle @@ -1276,12 +1706,28 @@ _EditCopyPasteManager::GetCursorBounds(bool isAbsRect) const return cursorBounds; } +FloatRectangle +_EditCopyPasteManager::GetCursorBoundsF(bool isAbsRect) const +{ + FloatRectangle cursorBounds; + + __pEdit->GetCursorBounds(isAbsRect, cursorBounds); + + return cursorBounds; +} + int _EditCopyPasteManager::GetCursorPositionAt(const Point& touchPoint) const { return __pEdit->GetCursorPositionAt(touchPoint); } +int +_EditCopyPasteManager::GetCursorPositionAt(const FloatPoint& touchPoint) const +{ + return __pEdit->GetCursorPositionAt(touchPoint); +} + result _EditCopyPasteManager::SetCursorPosition(int position) { @@ -1377,6 +1823,11 @@ _EditCopyPasteManager::OnActionPerformed(const _Control& source, int actionId) __needToReleaseBlock = false; pEditPresenter->SetKeypadClosedEventSkipped(true); pClipBoard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit); + SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_CLIPBOARD); + break; + case COPY_PASTE_SEARCH_ID: + LaunchSearch(); + SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_SEARCH); break; default: break; @@ -1386,21 +1837,6 @@ _EditCopyPasteManager::OnActionPerformed(const _Control& source, int actionId) } void -_EditCopyPasteManager::ScrollText(int distance) -{ - _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); - TextObject* pTextObject = pEditPresenter->GetTextObject(); - - int newFirstDisplayY = pTextObject->GetFirstDisplayPositionY(); - newFirstDisplayY += distance; - int moveLine = pTextObject->GetLineIndexAtPositionY(newFirstDisplayY); - pTextObject->SetFirstDisplayLineIndex(moveLine); - pTextObject->SetFirstDisplayPositionY(newFirstDisplayY); - - return; -} - -void _EditCopyPasteManager::AdjustBounds(void) { if (__pHandle[HANDLER_TYPE_LEFT]) @@ -1411,10 +1847,22 @@ _EditCopyPasteManager::AdjustBounds(void) { __pHandle[HANDLER_TYPE_RIGHT]->AdjustBounds(); } - if (__pCopyPastePopup) - { - //not need - } +} + +void +_EditCopyPasteManager::LaunchSearch(void) +{ + result r = E_SUCCESS; + int start = -1; + int end = -1; + __pEdit->GetBlockRange(start, end); + _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); + String blockText = pEditPresenter->GetText(start, end-1); + + _AppMessageImpl msg; + + msg.AddData(APPSVC_DATA_KEYWORD, blockText); + r = _AppControlManager::GetInstance()->LaunchPkg(msg, null, APPSVC_OPERATION_SEARCH, null, null, 0, 0); } bool @@ -1429,6 +1877,19 @@ _EditCopyPasteManager::SetTextBlockReleaseFlag(bool enabled) __needToReleaseBlock = enabled; } +bool +_EditCopyPasteManager::IsCopyPasteHandleExist(void) const +{ + if (__pHandle[HANDLER_TYPE_LEFT] && __pHandle[HANDLER_TYPE_RIGHT]) + { + return true; + } + else + { + return false; + } +} + _Edit* _EditCopyPasteManager::GetEdit(void) const { @@ -1446,10 +1907,10 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) int leftHandlerPosition = __pHandle[HANDLER_TYPE_LEFT]->GetHandlerCursorPosition(); int rightHandlerPosition = __pHandle[HANDLER_TYPE_RIGHT]->GetHandlerCursorPosition(); int textLength = __pEdit->GetTextLength(); - Rectangle cursorBounds; + FloatRectangle cursorBounds; int newCursorPosition; __pEdit->GetCursorBounds(false, cursorBounds); - Point cursorPoint(cursorBounds.x, cursorBounds.y); + FloatPoint cursorPoint(cursorBounds.x, cursorBounds.y); _EditPresenter* pEditPresenter = __pEdit->GetPresenter(); TextObject* pTextObject = pEditPresenter->GetTextObject(); @@ -1460,7 +1921,8 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) if (leftHandlerPosition < rightHandlerPosition-1) { __pHandle[HANDLER_TYPE_RIGHT]->SetHandlerCursorPosition(--rightHandlerPosition); - RefreshBlock(false); + RefreshBlock(); + __pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus(); } else { @@ -1468,7 +1930,7 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) } break; case HANDLER_MOVE_TYPE_UP: - cursorPoint.y -= cursorBounds.height/2; + cursorPoint.y -= cursorBounds.height/2.0f; newCursorPosition = GetCursorPositionAt(cursorPoint); if (newCursorPosition <= 0) @@ -1496,7 +1958,8 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) if (newCursorPosition >= 0 && leftHandlerPosition < newCursorPosition) { __pHandle[HANDLER_TYPE_RIGHT]->SetHandlerCursorPosition(newCursorPosition); - RefreshBlock(false); + RefreshBlock(); + __pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus(); } else { @@ -1504,7 +1967,7 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) } break; case HANDLER_MOVE_TYPE_DOWN: - cursorPoint.y += cursorBounds.height + cursorBounds.height/2; + cursorPoint.y += cursorBounds.height + cursorBounds.height/2.0f; newCursorPosition = GetCursorPositionAt(cursorPoint); if (newCursorPosition < 0) @@ -1534,7 +1997,8 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) if (newCursorPosition >= 0) { __pHandle[HANDLER_TYPE_RIGHT]->SetHandlerCursorPosition(newCursorPosition); - RefreshBlock(false); + RefreshBlock(); + __pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus(); } else { @@ -1545,7 +2009,8 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) if (textLength >= rightHandlerPosition+1) { __pHandle[HANDLER_TYPE_RIGHT]->SetHandlerCursorPosition(++rightHandlerPosition); - RefreshBlock(false); + RefreshBlock(); + __pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus(); } else { @@ -1556,8 +2021,6 @@ _EditCopyPasteManager::MoveHandler(HandlerMoveType moveType) break; } - CheckVisibleState(true); - ReleaseCopyPastePopup(); __isHandlerMoving = true; return; @@ -1578,8 +2041,19 @@ _EditCopyPasteManager::SetHandlerMovingEnabled(bool enabled) Rectangle _EditCopyPasteManager::GetEditVisibleArea(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetEditVisibleAreaF()); +} + +FloatRectangle +_EditCopyPasteManager::GetEditVisibleAreaF(void) const +{ return __editVisibleArea; } +_ContextMenu* +_EditCopyPasteManager::GetCopyPastePopup(void) const +{ + return __pCopyPastePopup; +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_EditDate.cpp b/src/ui/controls/FUiCtrl_EditDate.cpp index f3ea071..28b5d38 100644 --- a/src/ui/controls/FUiCtrl_EditDate.cpp +++ b/src/ui/controls/FUiCtrl_EditDate.cpp @@ -21,6 +21,7 @@ */ #include +#include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_ResourceManager.h" @@ -30,11 +31,13 @@ #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" #include "FUiCtrl_DateTimeUtils.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Base; using namespace Tizen::Base::Runtime; using namespace Tizen::Ui; +using namespace Tizen::System; namespace Tizen { namespace Ui { namespace Controls { @@ -45,9 +48,9 @@ _EditDate::_EditDate(void) : __pEditDatePresenter(null) , __pDateChangeEvent(null) , __pDateTimeBar(null) - , __absoluteBounds(Rectangle()) + , __absoluteBounds(FloatRectangle()) , __title() - , __pAccessibilityTitleElement(null) + , __pAccessibilityEditDateElement(null) , __pAccessibilityYearElement(null) , __pAccessibilityMonthElement(null) , __pAccessibilityDayElement(null) @@ -56,6 +59,8 @@ _EditDate::_EditDate(void) _EditDate::~_EditDate(void) { + SettingInfo::RemoveSettingEventListener(*this); + delete __pDateTimeBar; __pDateTimeBar = null; @@ -68,10 +73,10 @@ _EditDate::~_EditDate(void) __pDateChangeEvent = null; } - if (__pAccessibilityTitleElement) + if (__pAccessibilityEditDateElement) { - __pAccessibilityTitleElement->Activate(false); - __pAccessibilityTitleElement = null; + __pAccessibilityEditDateElement->Activate(false); + __pAccessibilityEditDateElement = null; } if (__pAccessibilityYearElement) { @@ -118,13 +123,12 @@ _EditDate::CreateEditDateN(const String& title) pEditDate->__title = title; } - pEditDate->SetResizable(false); - pContainer = pEditDate->GetAccessibilityContainer(); if (pContainer) { pContainer->Activate(true); + pEditDate->CreateAccessibilityElement(); } pEditDate->AcquireHandle(); @@ -151,6 +155,9 @@ _EditDate::CreateDateTimeBar(void) r = __pDateTimeBar->AddDateTimeChangeEventListener(*this); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + r = SettingInfo::AddSettingEventListener(*this); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + return r; CATCH: @@ -300,6 +307,19 @@ _EditDate::SetPropertyMonth(const Variant& month) SysTryReturn(NID_UI_CTRL, (__pEditDatePresenter != null), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null."); + int day; + int maxValue = -1; + + _DateTimeUtils dateTimeUtils; + + maxValue = dateTimeUtils.CalculateMaxDay(GetYear(), month.ToInt()); + day = __pEditDatePresenter->GetDay(); + + if (day > maxValue) + { + __pEditDatePresenter->SetDay(maxValue); + } + r = __pEditDatePresenter->SetMonth(month.ToInt()); if (r == E_SUCCESS) @@ -351,6 +371,19 @@ _EditDate::SetPropertyYear(const Variant& year) SysTryReturn(NID_UI_CTRL, (__pEditDatePresenter != null), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null."); + int day; + int maxValue = -1; + + _DateTimeUtils dateTimeUtils; + + maxValue = dateTimeUtils.CalculateMaxDay(year.ToInt(), GetMonth()); + day = __pEditDatePresenter->GetDay(); + + if (day > maxValue) + { + __pEditDatePresenter->SetDay(maxValue); + } + r = __pEditDatePresenter->SetYear(year.ToInt()); if (r == E_SUCCESS) @@ -562,44 +595,58 @@ result _EditDate::CalculateDateTimeBarPosition(void) { result r = E_SUCCESS; - Rectangle absoluteBounds; - Rectangle parentBounds; - Rectangle frameBounds; - absoluteBounds = GetAbsoluteBounds(); + float dateTimeBarHeight = 0.0f; + float arrowHeight = 0.0f; + float dateHeight = 0.0f; + float dateBarMargin = 0.0f; + float textHeight = 0.0f; + float titleDateMargin = 0.0f; + float bottomPosition = 0.0f; + float dateY = 0.0f; + + FloatRectangle absoluteBounds; + FloatRectangle frameBounds; + FloatRectangle parentWindowBounds; + FloatRectangle titleBounds; _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get frame instance."); - _Form* pForm = pFrame->GetCurrentForm(); - SysTryReturn(NID_UI_CTRL, pForm != null, E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get form instance."); + absoluteBounds = GetAbsoluteBoundsF(); + frameBounds = pFrame->GetAbsoluteBoundsF(); + parentWindowBounds = GetParentWindowBounds(); + titleBounds = __pEditDatePresenter->GetTitleBounds(); - parentBounds = pForm->GetClientBounds(); - frameBounds = pFrame->GetAbsoluteBounds(); - - int dateTimeBarHeight = 0; GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, GetOrientation(), dateTimeBarHeight); + GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, GetOrientation(), arrowHeight); + GET_SHAPE_CONFIG(EDITDATE::DATE_HEIGHT, GetOrientation(), dateHeight); + GET_SHAPE_CONFIG(EDITDATE::DATE_BAR_MARGIN, GetOrientation(), dateBarMargin); + GET_SHAPE_CONFIG(EDITDATE::TITLE_HEIGHT, GetOrientation(), textHeight); + GET_SHAPE_CONFIG(EDITDATE::TITLE_DATE_MARGIN, GetOrientation(), titleDateMargin); - Rectangle parentWindowBounds = GetParentWindowBounds(); - int bottomMargin = 0; - // DateTimeBar top margin can be used as Editdate's bottom margin. - GET_SHAPE_CONFIG(DATETIMEBAR::TOP_MARGIN, GetOrientation(), bottomMargin); + if (!__title.IsEmpty()) //with title + { + dateY = titleBounds.y + textHeight + titleDateMargin ; + } + else //without title + { + dateY = (absoluteBounds.height - dateHeight) / 2.0f ; + } - int bottomPosition = 0; - bottomPosition = absoluteBounds.y + absoluteBounds.height + bottomMargin + dateTimeBarHeight; + bottomPosition = absoluteBounds.y + dateY + dateHeight + dateBarMargin + arrowHeight + dateTimeBarHeight; GetDateTimeBar()->SetParentWindowBounds(parentWindowBounds); - if (bottomPosition > frameBounds.y + parentBounds.y + parentBounds.height) + if (bottomPosition > frameBounds.y + parentWindowBounds.y + parentWindowBounds.height) { - r = GetDateTimeBar()->SetPositionAndAlignment(Point(parentWindowBounds.x, absoluteBounds.y), DATETIME_BAR_ALIGN_UP); + r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + dateY - dateBarMargin - arrowHeight), DATETIME_BAR_ALIGN_UP); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } else { - r = GetDateTimeBar()->SetPositionAndAlignment(Point(parentWindowBounds.x, absoluteBounds.y + absoluteBounds.height + bottomMargin), DATETIME_BAR_ALIGN_DOWN); + r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + dateY + dateHeight + dateBarMargin + arrowHeight), DATETIME_BAR_ALIGN_DOWN); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -620,79 +667,70 @@ _EditDate::OnDraw(void) return; } -result -_EditDate::OnAttachedToMainTree(void) +void +_EditDate::CreateAccessibilityElement(void) { - if (likely(!(_AccessibilityManager::IsActivated()))) + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + + Rectangle dayBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_DAY)); + Rectangle monthBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH)); + Rectangle yearBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR)); + + if (__pAccessibilityEditDateElement == null) { - return E_SUCCESS; + __pAccessibilityEditDateElement = new _AccessibilityElement(true); + __pAccessibilityEditDateElement->SetBounds(GetClientBounds()); + __pAccessibilityEditDateElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); + __pAccessibilityEditDateElement->SetName("EditDateText"); + pContainer->AddElement(*__pAccessibilityEditDateElement); } - Rectangle dayBounds = __pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_DAY); - Rectangle monthBounds = __pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH); - Rectangle yearBounds = __pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR); - - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if (pContainer) + if (__pAccessibilityYearElement == null && __pAccessibilityMonthElement == null && __pAccessibilityDayElement == null) { + String hintText(L"Double tap to edit"); - if (__pAccessibilityTitleElement == null) - { - __pAccessibilityTitleElement = new _AccessibilityElement(true); - __pAccessibilityTitleElement->SetBounds(GetBounds()); - __pAccessibilityTitleElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); - pContainer->AddElement(*__pAccessibilityTitleElement); - } + __pAccessibilityYearElement = new _AccessibilityElement(true); + __pAccessibilityYearElement->SetBounds(yearBounds); + __pAccessibilityYearElement->SetTrait(ACCESSIBILITY_TRAITS_YEAR); + __pAccessibilityYearElement->SetHint(hintText); + + __pAccessibilityMonthElement = new _AccessibilityElement(true); + __pAccessibilityMonthElement->SetBounds(monthBounds); + __pAccessibilityMonthElement->SetTrait(ACCESSIBILITY_TRAITS_MONTH); + __pAccessibilityMonthElement->SetHint(hintText); - if (__pAccessibilityYearElement == null && __pAccessibilityMonthElement == null && __pAccessibilityDayElement == null) + __pAccessibilityDayElement = new _AccessibilityElement(true); + __pAccessibilityDayElement->SetBounds(dayBounds); + __pAccessibilityDayElement->SetTrait(ACCESSIBILITY_TRAITS_DAY); + __pAccessibilityDayElement->SetHint(hintText); + + switch (__pEditDatePresenter->GetLocaleDateFormat()) { - String hintText(L"Double tap to edit"); - - __pAccessibilityYearElement = new _AccessibilityElement(true); - __pAccessibilityYearElement->SetBounds(yearBounds); - __pAccessibilityYearElement->SetTrait(ACCESSIBILITY_TRAITS_YEAR); - __pAccessibilityYearElement->SetHint(hintText); - - __pAccessibilityMonthElement = new _AccessibilityElement(true); - __pAccessibilityMonthElement->SetBounds(monthBounds); - __pAccessibilityMonthElement->SetTrait(ACCESSIBILITY_TRAITS_MONTH); - __pAccessibilityMonthElement->SetHint(hintText); - - __pAccessibilityDayElement = new _AccessibilityElement(true); - __pAccessibilityDayElement->SetBounds(dayBounds); - __pAccessibilityDayElement->SetTrait(ACCESSIBILITY_TRAITS_DAY); - __pAccessibilityDayElement->SetHint(hintText); - - switch (__pEditDatePresenter->GetLocaleDateFormat()) - { - case SETTING_DATE_FORMAT_DD_MM_YYYY: - pContainer->AddElement(*__pAccessibilityDayElement); - pContainer->AddElement(*__pAccessibilityMonthElement); - pContainer->AddElement(*__pAccessibilityYearElement); - break; - case SETTING_DATE_FORMAT_MM_DD_YYYY: - pContainer->AddElement(*__pAccessibilityMonthElement); - pContainer->AddElement(*__pAccessibilityDayElement); - pContainer->AddElement(*__pAccessibilityYearElement); - break; - case SETTING_DATE_FORMAT_YYYY_MM_DD: - pContainer->AddElement(*__pAccessibilityYearElement); - pContainer->AddElement(*__pAccessibilityMonthElement); - pContainer->AddElement(*__pAccessibilityDayElement); - break; - case SETTING_DATE_FORMAT_YYYY_DD_MM: - pContainer->AddElement(*__pAccessibilityYearElement); - pContainer->AddElement(*__pAccessibilityDayElement); - pContainer->AddElement(*__pAccessibilityMonthElement); - break; - default: - break; - } - - UpdateAccessibilityElement(); + case SETTING_DATE_FORMAT_DD_MM_YYYY: + pContainer->AddElement(*__pAccessibilityDayElement); + pContainer->AddElement(*__pAccessibilityMonthElement); + pContainer->AddElement(*__pAccessibilityYearElement); + break; + case SETTING_DATE_FORMAT_MM_DD_YYYY: + pContainer->AddElement(*__pAccessibilityMonthElement); + pContainer->AddElement(*__pAccessibilityDayElement); + pContainer->AddElement(*__pAccessibilityYearElement); + break; + case SETTING_DATE_FORMAT_YYYY_MM_DD: + pContainer->AddElement(*__pAccessibilityYearElement); + pContainer->AddElement(*__pAccessibilityMonthElement); + pContainer->AddElement(*__pAccessibilityDayElement); + break; + case SETTING_DATE_FORMAT_YYYY_DD_MM: + pContainer->AddElement(*__pAccessibilityYearElement); + pContainer->AddElement(*__pAccessibilityDayElement); + pContainer->AddElement(*__pAccessibilityMonthElement); + break; + default: + break; } + UpdateAccessibilityElement(); } - return E_SUCCESS; } void @@ -700,21 +738,21 @@ _EditDate::OnBoundsChanged(void) { __pEditDatePresenter->Initialize(); - if (__pAccessibilityTitleElement) + if (__pAccessibilityEditDateElement) { - __pAccessibilityTitleElement->SetBounds(__pEditDatePresenter->GetTitleBounds()); + __pAccessibilityEditDateElement->SetBounds(__pEditDatePresenter->GetTitleBounds()); } if (__pAccessibilityYearElement) { - __pAccessibilityYearElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR)); + __pAccessibilityYearElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR))); } if (__pAccessibilityMonthElement) { - __pAccessibilityMonthElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH)); + __pAccessibilityMonthElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH))); } if (__pAccessibilityDayElement) { - __pAccessibilityDayElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_DAY)); + __pAccessibilityDayElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_DAY))); } return; @@ -723,7 +761,7 @@ _EditDate::OnBoundsChanged(void) void _EditDate::OnChangeLayout(_ControlOrientation orientation) { - __pEditDatePresenter->OnChangeLayout(orientation); + __pEditDatePresenter->Initialize(); if (GetDateTimeBar() != null) { @@ -737,7 +775,7 @@ _EditDate::OnChangeLayout(_ControlOrientation orientation) bool _EditDate::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Rectangle absoluteBounds = GetAbsoluteBounds(); + FloatRectangle absoluteBounds = GetAbsoluteBoundsF(); if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height) { @@ -867,16 +905,24 @@ _EditDate::OnFontInfoRequested(unsigned long& style, int& size) return; } -Rectangle +void +_EditDate::OnSettingChanged(String& key) +{ + Invalidate(); + + return; +} + +FloatRectangle _EditDate::GetParentWindowBounds(void) const { _Form* pForm = null; _Window* pwindow = null; _Control* pControlCore = GetParent(); - Dimension dateTimeBarSize(0, 0); + FloatDimension dateTimeBarSize(0.0f, 0.0f); GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, GetOrientation(), dateTimeBarSize); - Rectangle parentWindowBounds(0, 0, dateTimeBarSize.width, dateTimeBarSize.height); + FloatRectangle parentWindowBounds(0.0f, 0.0f, dateTimeBarSize.width, dateTimeBarSize.height); while (true) { @@ -891,7 +937,7 @@ _EditDate::GetParentWindowBounds(void) const pForm = dynamic_cast<_Form*>(pControlCore); if (pForm != null) { - parentWindowBounds = pForm->GetBounds(); + parentWindowBounds = pForm->GetBoundsF(); break; } @@ -899,7 +945,7 @@ _EditDate::GetParentWindowBounds(void) const if (pwindow != null) { - parentWindowBounds = pwindow->GetBounds(); + parentWindowBounds = pwindow->GetBoundsF(); break; } @@ -922,7 +968,7 @@ _EditDate::UpdateAccessibilityElement(void) return; } - if (__pAccessibilityTitleElement == null) + if (__pAccessibilityEditDateElement == null) { return; } @@ -971,7 +1017,7 @@ _EditDate::UpdateAccessibilityElement(void) break; } - __pAccessibilityTitleElement->SetLabel(string); + __pAccessibilityEditDateElement->SetLabel(string); __pAccessibilityDayElement->SetLabel(dayString); __pAccessibilityMonthElement->SetLabel(monthString); __pAccessibilityYearElement->SetLabel(yearString); diff --git a/src/ui/controls/FUiCtrl_EditDateImpl.cpp b/src/ui/controls/FUiCtrl_EditDateImpl.cpp index 563165a..7c7d358 100644 --- a/src/ui/controls/FUiCtrl_EditDateImpl.cpp +++ b/src/ui/controls/FUiCtrl_EditDateImpl.cpp @@ -21,11 +21,15 @@ */ #include +#include +#include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" #include "FUiCtrl_EditDateImpl.h" #include "FUiCtrl_DateTimeDefine.h" +#include "FUiCtrl_DateTimeUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Base; @@ -34,45 +38,11 @@ using namespace Tizen::Ui; namespace Tizen { namespace Ui { namespace Controls { -_EditDateImpl::EditDateSizeInfo::EditDateSizeInfo(void) - : __isTitle(false) -{ -} - -void -_EditDateImpl::EditDateSizeInfo::SetTitleStyle(bool titleStyle) -{ - __isTitle = titleStyle; - return; -} - -Dimension -_EditDateImpl::EditDateSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - Tizen::Graphics::Dimension dimension(0, 0); - - r = GET_DIMENSION_CONFIG(EDITDATE::DEFAULT_SIZE, orientation, dimension); - - SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] Propagating.", GetErrorMessage(r)); - return dimension; -} - -Dimension -_EditDateImpl::EditDateSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - Tizen::Graphics::Dimension dimension(0, 0); - - r = GET_DIMENSION_CONFIG(EDITDATE::DEFAULT_SIZE, orientation, dimension); - - SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] Propagating.", GetErrorMessage(r)); - return dimension; -} _EditDateImpl::_EditDateImpl(EditDate* pPublic, _EditDate* pCore) : _ControlImpl(pPublic, pCore) , __pPublicDateChangeEvent(null) + , __defaultBounds(0.0f, 0.0f, 0.0f, 0.0f) { ClearLastResult(); } @@ -103,9 +73,13 @@ _EditDateImpl::GetInstance(const EditDate& editDate) _EditDateImpl* _EditDateImpl::CreateEditDateImplN(EditDate* pControl, const Point& point, const String& title) { + return CreateEditDateImplFN(pControl, _CoordinateSystemUtils::ConvertToFloat(point), title); +} + +_EditDateImpl* +_EditDateImpl::CreateEditDateImplFN(EditDate* pControl, const FloatPoint& point, const String& title) +{ result r = E_SUCCESS; - Rectangle defaultSize; - bool isTitle = false; _EditDate* pCore = _EditDate::CreateEditDateN(title); SysTryReturn(NID_UI_CTRL, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -118,15 +92,7 @@ _EditDateImpl::CreateEditDateImplN(EditDate* pControl, const Point& point, const r = pCore->AddDateChangeEventListener(*pImpl); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_SHAPE_CONFIG(EDITDATE::WIDTH, pCore->GetOrientation(), defaultSize.width); - - GET_SHAPE_CONFIG(EDITDATE::HEIGHT, pCore->GetOrientation(), defaultSize.height); - - defaultSize.x = point.x; - defaultSize.y = point.y; - - r = pImpl->InitializeBoundsProperties(FUNC_SIZE_INFO(EditDate)(isTitle), defaultSize, pCore->GetOrientation()); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + pImpl->SetInitialPosition(point); ClearLastResult(); @@ -167,6 +133,35 @@ _EditDateImpl::GetCore(void) return static_cast <_EditDate&>(_ControlImpl::GetCore()); } +void +_EditDateImpl::SetInitialPosition(const FloatPoint& point) +{ + __defaultBounds.x = point.x; + __defaultBounds.y = point.y; + return; +} + +result +_EditDateImpl::OnAttachedToMainTree(void) +{ + result r = E_SUCCESS; + + int width; + int height; + + GET_SHAPE_CONFIG(EDITDATE::WIDTH, GetCore().GetOrientation(), width); + GET_SHAPE_CONFIG(EDITDATE::HEIGHT, GetCore().GetOrientation(),height); + + __defaultBounds.width = _CoordinateSystemUtils::ConvertToFloat(width); + __defaultBounds.height = _CoordinateSystemUtils::ConvertToFloat(height); + + r = InitializeBoundsPropertiesF(GET_SIZE_INFO(EditTime), __defaultBounds, GetCore().GetOrientation()); + + _ControlImpl::OnAttachedToMainTree(); + + return r; +} + result _EditDateImpl::AddDateChangeEventListener(IDateChangeEventListener& listener) { @@ -268,6 +263,14 @@ _EditDateImpl::SetYear(int year) SysTryReturn(NID_UI_CTRL, (year >= DATETIME_YEAR_MIN && year <= DATETIME_YEAR_MAX), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. year (%d).", year); + int minYear = -1; + int maxYear = -1; + + GetYearRange(minYear,maxYear); + + SysTryReturn(NID_UI_CTRL, (year >= minYear && year <= maxYear), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. year (%d).", year); + result r = GetCore().SetPropertyYear(Variant(year)); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); @@ -296,8 +299,14 @@ _EditDateImpl::SetDay(int day) SysTryReturn(NID_UI_CTRL, (day >= DATETIME_DAY_MIN && day <= DATETIME_DAY_MAX), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. day (%d).", day); - result r = GetCore().SetPropertyDay(Variant(day)); + int maxValue = -1; + _DateTimeUtils dateTimeUtils; + maxValue = dateTimeUtils.CalculateMaxDay(GetYear(), GetMonth()); + SysTryReturn(NID_UI_CTRL, (day <= maxValue), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. day (%d), month (%d)", day, GetMonth()); + + result r = GetCore().SetPropertyDay(Variant(day)); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -424,8 +433,8 @@ protected: virtual Control* Make(_UiBuilderControl* pControl) { result r = E_SUCCESS; - Point point; - Rectangle rect; + FloatPoint point; + FloatRectangle rect; Tizen::Base::String elementStringOne; Tizen::Base::String elementStringTwo; bool titleEnable = false; @@ -443,7 +452,7 @@ protected: return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); point.x = rect.x; point.y = rect.y; if (pControl->GetElement(L"titleText", elementStringOne)) @@ -486,7 +495,20 @@ protected: r = pEditDate->SetYearRange(tempMin, tempMax); } - + + if (pControl->GetElement(L"accessibilityHint", elementStringOne)) + { + AccessibilityContainer* pContainer = pEditDate->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement("EditDateText"); + if (pElement) + { + pElement->SetHint(elementStringOne); + } + } + } + return pEditDate; } }; // _EditDateMaker diff --git a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp index 52ea85b..307c6ec 100644 --- a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp @@ -34,6 +34,7 @@ #include "FUiAnim_VisualElement.h" #include "FUiAnimVisualElementPropertyAnimation.h" #include "FGrpColor.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Base; @@ -46,10 +47,10 @@ namespace Tizen { namespace Ui { namespace Controls _EditDatePresenter::_EditDatePresenter(void) : __pEditDateTimeModel(null) , __pEditDate(null) - , __dayBounds(Rectangle()) - , __monthBounds(Rectangle()) - , __yearBounds(Rectangle()) - , __titleBounds(Rectangle()) + , __dayBounds(FloatRectangle()) + , __monthBounds(FloatRectangle()) + , __yearBounds(FloatRectangle()) + , __titleBounds(FloatRectangle()) , __datePickerEnabled(true) , __selectedId(DATETIME_ID_NONE) , __lastSelectedId(DATETIME_ID_NONE) @@ -57,10 +58,10 @@ _EditDatePresenter::_EditDatePresenter(void) , __titleObject() , __textObject() , __pFont(null) - , __dividerLineWidth(0) - , __dividerLineHeight(0) - , __titleFontSize(0) - , __dateFontSize(0) + , __dividerLineWidth(0.0f) + , __dividerLineHeight(0.0f) + , __titleFontSize(0.0f) + , __dateFontSize(0.0f) , __pContentProvider(null) , __isAnimating(false) , __isEditDateInitialized(false) @@ -105,17 +106,15 @@ result _EditDatePresenter::Initialize(void) { result r = E_SUCCESS; - int editDateHeight = 0; - int editDateWidth = 0; - int leftMargin = 0; - int editDateFontSize = 0; - int titledateMargin = 0; - int dateHeight = 0; - Rectangle bounds(0, 0, 0, 0); + float editDateHeight = 0.0f; + float editDateWidth = 0.0f; + float leftMargin = 0.0f; + float titledateMargin = 0.0f; + float dateHeight = 0.0f; + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); GET_SHAPE_CONFIG(EDITDATE::WIDTH, __pEditDate->GetOrientation(), editDateWidth); GET_SHAPE_CONFIG(EDITDATE::HEIGHT, __pEditDate->GetOrientation(), editDateHeight); - GET_SHAPE_CONFIG(EDITDATE::DATE_FONT_SIZE, __pEditDate->GetOrientation(), editDateFontSize); GET_SHAPE_CONFIG(EDITDATE::DATE_TEXT_LEFT_MARGIN, __pEditDate->GetOrientation(), leftMargin); GET_FIXED_VALUE_CONFIG(EDITDATE::ITEM_DIVIDER_WIDTH, __pEditDate->GetOrientation(), __dividerLineWidth); GET_SHAPE_CONFIG(EDITDATE::ITEM_DIVIDER_HEIGHT, __pEditDate->GetOrientation(), __dividerLineHeight); @@ -123,11 +122,11 @@ _EditDatePresenter::Initialize(void) GET_SHAPE_CONFIG(EDITDATE::DATE_FONT_SIZE, __pEditDate->GetOrientation(), __dateFontSize); GET_SHAPE_CONFIG(EDITDATE::TITLE_DATE_MARGIN, __pEditDate->GetOrientation(), titledateMargin); GET_SHAPE_CONFIG(EDITDATE::DATE_HEIGHT, __pEditDate->GetOrientation(), dateHeight); - GET_SHAPE_CONFIG(EDITDATE::TEXT_HEIGHT, __pEditDate->GetOrientation(), __titleBounds.height); + GET_SHAPE_CONFIG(EDITDATE::TITLE_HEIGHT, __pEditDate->GetOrientation(), __titleBounds.height); - if (__pEditDate->GetBounds().height > editDateHeight) + if (__pEditDate->GetBoundsF().height > editDateHeight) { - editDateHeight = __pEditDate->GetBounds().height; + editDateHeight = __pEditDate->GetBoundsF().height; } __pFont = __pEditDate->GetFallbackFont(); @@ -137,7 +136,7 @@ _EditDatePresenter::Initialize(void) if (__title.IsEmpty() == false) { __titleBounds.x = leftMargin; - __titleBounds.y = (editDateHeight - (__titleBounds.height + titledateMargin + dateHeight)) / 2; + __titleBounds.y = (editDateHeight - (__titleBounds.height + titledateMargin + dateHeight)) / 2.0f; __titleBounds.width = editDateWidth; bounds.y = __titleBounds.y + __titleBounds.height + titledateMargin; @@ -161,16 +160,16 @@ _EditDatePresenter::Initialize(void) __yearBounds.height = editDateHeight; } - int elementWidth = 0; + float elementWidth = 0.0f; GET_SHAPE_CONFIG(EDITDATE::TEXT_ELEMENT_WIDTH, __pEditDate->GetOrientation(), elementWidth); __dayBounds.width = elementWidth; __monthBounds.width = elementWidth; __yearBounds.width = elementWidth; - __dayBounds.x = 0; - __monthBounds.x = 0; - __yearBounds.x = 0; + __dayBounds.x = 0.0f; + __monthBounds.x = 0.0f; + __yearBounds.x = 0.0f; __dayBounds.y = bounds.y; __monthBounds.y = bounds.y; @@ -423,7 +422,7 @@ _EditDatePresenter::Draw(void) return r; -CATCH: + CATCH: delete pCanvas; return r; } @@ -475,7 +474,7 @@ _EditDatePresenter::DrawTitle(Canvas& canvas) } result -_EditDatePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const String& text) +_EditDatePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const String& text) { Color textColor; @@ -489,14 +488,14 @@ _EditDatePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const Stri } _DateTimeId boxId = DATETIME_ID_NONE; - boxId = GetBoxIdFromPosition(Point(bounds.x, bounds.y)); + boxId = GetBoxIdFromPosition(FloatPoint(bounds.x, bounds.y)); if (boxId == __selectedId && boxId != DATETIME_ID_NONE) { GET_COLOR_CONFIG(EDITDATE::TEXT_PRESSED, textColor); } - Rectangle drawAreaBounds(0, 0, 0, 0); + FloatRectangle drawAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); drawAreaBounds = bounds; TextSimple* pSimpleText = null; @@ -522,50 +521,50 @@ _EditDatePresenter::DrawDividers(Canvas& canvas) { result r = E_SUCCESS; - int elementWidth = 0; - int editDateHeight = 0; - int dateHeight = 0; + float elementWidth = 0.0f; + float editDateHeight = 0.0f; + float dateHeight = 0.0f; GET_SHAPE_CONFIG(EDITDATE::TEXT_ELEMENT_WIDTH, __pEditDate->GetOrientation(), elementWidth); GET_SHAPE_CONFIG(EDITDATE::DATE_HEIGHT, __pEditDate->GetOrientation(), dateHeight); GET_SHAPE_CONFIG(EDITDATE::HEIGHT, __pEditDate->GetOrientation(), editDateHeight); - if (__pEditDate->GetBounds().height > editDateHeight) + if (__pEditDate->GetBoundsF().height > editDateHeight) { - editDateHeight = __pEditDate->GetBounds().height; + editDateHeight = __pEditDate->GetBoundsF().height; } Color dividerHalfLeftColor; Color dividerHalfRightColor; - GET_COLOR_CONFIG(EDITDATE::DIVIDER_HALF_LEFT, dividerHalfLeftColor); - GET_COLOR_CONFIG(EDITDATE::DIVIDER_HALF_RIGHT, dividerHalfRightColor); + GET_COLOR_CONFIG(EDITDATE::DIVIDER_LEFT_HALF, dividerHalfLeftColor); + GET_COLOR_CONFIG(EDITDATE::DIVIDER_RIGHT_HALF, dividerHalfRightColor); - Rectangle bounds(0, 0, 0, 0); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); bounds.x = elementWidth; if (__title.IsEmpty() == false) { - bounds.y = __dayBounds.y + ((dateHeight - __dividerLineHeight) / 2); + bounds.y = __dayBounds.y + ((dateHeight - __dividerLineHeight) / 2.0f); } else { - bounds.y = __dayBounds.y + ((editDateHeight - __dividerLineHeight) / 2); + bounds.y = __dayBounds.y + ((editDateHeight - __dividerLineHeight) / 2.0f); } for (int divider = 0; divider < __dividerCount; divider++) { canvas.SetForegroundColor(dividerHalfLeftColor); - canvas.SetLineWidth(__dividerLineWidth / 2); + canvas.SetLineWidth(__dividerLineWidth / 2.0f); - r = canvas.DrawLine(Point(bounds.x, bounds.y), Point(bounds.x, bounds.y + __dividerLineHeight)); + r = canvas.DrawLine(FloatPoint(bounds.x, bounds.y), FloatPoint(bounds.x, bounds.y + __dividerLineHeight)); SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); canvas.SetForegroundColor(dividerHalfRightColor); - canvas.SetLineWidth(__dividerLineWidth / 2); + canvas.SetLineWidth(__dividerLineWidth / 2.0f); - r = canvas.DrawLine(Point(bounds.x + 1, bounds.y), Point(bounds.x + 1, bounds.y + __dividerLineHeight)); + r = canvas.DrawLine(FloatPoint(bounds.x + 1.0f, bounds.y), FloatPoint(bounds.x + 1.0f, bounds.y + __dividerLineHeight)); SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); bounds.x = bounds.x + elementWidth; @@ -574,7 +573,7 @@ _EditDatePresenter::DrawDividers(Canvas& canvas) return r; } _DateTimeId -_EditDatePresenter::GetBoxIdFromPosition(const Point& point) const +_EditDatePresenter::GetBoxIdFromPosition(const FloatPoint& point) const { _DateTimeId displayBoxId = DATETIME_ID_NONE; @@ -599,7 +598,7 @@ _EditDatePresenter::GetBoxIdFromPosition(const Point& point) const return displayBoxId; } -Rectangle +FloatRectangle _EditDatePresenter::GetDateAreaBounds(_DateTimeId id) const { if (id == DATETIME_ID_DAY) @@ -616,11 +615,11 @@ _EditDatePresenter::GetDateAreaBounds(_DateTimeId id) const } else { - return Rectangle(); + return FloatRectangle(); } } -Rectangle +FloatRectangle _EditDatePresenter::GetTitleBounds(void) const { return __titleBounds; @@ -649,7 +648,7 @@ _EditDatePresenter::OnFontChanged(Font* pFont) __pEditDate->GetDateTimeBar()->SetFont(*pFont); } - return; + return; } void @@ -661,33 +660,11 @@ _EditDatePresenter::OnFontInfoRequested(unsigned long& style, int& size) return; } -void -_EditDatePresenter::OnChangeLayout(_ControlOrientation orientation) -{ - Dimension editDateSize; - - result r = E_SUCCESS; - - r = GET_DIMENSION_CONFIG(EDITDATE::DEFAULT_SIZE, orientation, editDateSize); - - if (r == E_SUCCESS && editDateSize != __pEditDate->GetSize()) - { - __pEditDate->SetResizable(true); - __pEditDate->SetSize(editDateSize); - __pEditDate->SetResizable(false); - } - - r = Initialize(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - return; -} - bool _EditDatePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { SysTryReturn(NID_UI_CTRL, IsDatePickerEnabled() == true, true, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. EditDate instance is disabled."); + "[E_SYSTEM] A system error has occurred. EditDate instance is disabled."); if (&source != __pEditDate) { @@ -696,7 +673,7 @@ _EditDatePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou __touchMoveHandled = false; - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point = touchinfo.GetCurrentPosition(); _DateTimeId boxId = DATETIME_ID_NONE; boxId = GetBoxIdFromPosition(point); @@ -760,14 +737,14 @@ bool _EditDatePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { SysTryReturn(NID_UI_CTRL, IsDatePickerEnabled() == true, true, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. EditDate instance is disabled."); + "[E_SYSTEM] A system error has occurred. EditDate instance is disabled."); if (&source != __pEditDate) { return false; } - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point = touchinfo.GetCurrentPosition(); _DateTimeId boxId = DATETIME_ID_NONE; boxId = GetBoxIdFromPosition(point); @@ -784,25 +761,28 @@ _EditDatePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to _DateTimeUtils dateTimeUtils; if (GetLastSelectedId() == DATETIME_ID_YEAR) { - __lastSelectedValue.Format(10, L"%04d", GetYear()); + __lastSelectedValue.Format(10, L"%04d", GetYear()); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } else if (GetLastSelectedId() == DATETIME_ID_MONTH) { - __lastSelectedValue = dateTimeUtils.GetMonthString(GetMonth()); + __lastSelectedValue = dateTimeUtils.GetMonthString(GetMonth()); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } else if (GetLastSelectedId() == DATETIME_ID_DAY) { - __lastSelectedValue.Format(10, L"%02d", GetDay()); + __lastSelectedValue.Format(10, L"%02d", GetDay()); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } __pEditDate->Invalidate(); if (__pEditDate->GetDateTimeBar() != null && GetLastSelectedId() != DATETIME_ID_NONE) { - Rectangle bounds(0, 0, 0, 0); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); bounds = GetDateAreaBounds(GetLastSelectedId()); - Rectangle absoluteBounds(0, 0, 0, 0); - absoluteBounds = __pEditDate->GetAbsoluteBounds(); + FloatRectangle absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f); + absoluteBounds = __pEditDate->GetAbsoluteBoundsF(); bounds.x += absoluteBounds.x; __pEditDate->GetDateTimeBar()->CalculateArrowBounds(bounds); @@ -836,7 +816,7 @@ _EditDatePresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return false; } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); if (GetBoxIdFromPosition(touchPoint) != __selectedId) { @@ -864,7 +844,7 @@ _EditDatePresenter::Animate(void) (_FontImpl::GetInstance(*__pFont))->SetSize(__dateFontSize); result r = E_SUCCESS; - Rectangle rect; + FloatRectangle rect; String monthString; String yearString; String dayString; @@ -897,9 +877,9 @@ _EditDatePresenter::Animate(void) rect = GetDateAreaBounds(DATETIME_ID_YEAR); } - Dimension newTextDim; - Dimension oldTextDim; - Point textPoint; + FloatDimension newTextDim; + FloatDimension oldTextDim; + FloatPoint textPoint; VisualElement* pNewVisualElement = null; VisualElement* pOldVisualElement = null; VisualElement* pEditDateElement = null; @@ -912,14 +892,14 @@ _EditDatePresenter::Animate(void) if (newTextDim.width > oldTextDim.width) { - textPoint.x = (rect.width - newTextDim.width) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; } else { - textPoint.x = (rect.width - oldTextDim.width) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; } - SysTryReturnVoidResult(NID_UI_CTRL, (rect.x + textPoint.x < __pEditDate->GetBounds().width), E_SUCCESS, "Rolling animation cann't be played."); + SysTryReturnVoidResult(NID_UI_CTRL, (rect.x + textPoint.x < __pEditDate->GetBoundsF().width), E_SUCCESS, "Rolling animation cann't be played."); __isAnimating = true; @@ -967,8 +947,8 @@ _EditDatePresenter::Animate(void) if (newTextDim.width > oldTextDim.width) { - textPoint.x = (rect.width - newTextDim.width) / 2; - textPoint.y = (rect.height - newTextDim.height) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; + textPoint.y = (rect.height - newTextDim.height) / 2.0f; __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); pNewVisualElement->SetBounds(FloatRectangle(0.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); @@ -977,15 +957,15 @@ _EditDatePresenter::Animate(void) rect.width = static_cast(__pContentProvider->GetBounds().width); rect.height = static_cast(__pContentProvider->GetBounds().height); - textPoint.x = (rect.width - oldTextDim.width) / 2; - textPoint.y = (rect.height - oldTextDim.height) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; + textPoint.y = (rect.height - oldTextDim.height) / 2.0f; pOldVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); } else { - textPoint.x = (rect.width - oldTextDim.width) / 2; - textPoint.y = (rect.height - oldTextDim.height) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; + textPoint.y = (rect.height - oldTextDim.height) / 2.0f; __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); pOldVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); @@ -994,8 +974,8 @@ _EditDatePresenter::Animate(void) rect.width = static_cast(__pContentProvider->GetBounds().width); rect.height = static_cast(__pContentProvider->GetBounds().height); - textPoint.x = (rect.width - newTextDim.width) / 2; - textPoint.y = (rect.height - newTextDim.height) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; + textPoint.y = (rect.height - newTextDim.height) / 2.0f; pNewVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); } @@ -1036,7 +1016,7 @@ _EditDatePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); pCanvas->SetFont(*__pFont); - pCanvas->DrawText(Point(0,0),__lastSelectedValue); + pCanvas->DrawText(FloatPoint(0.0f, 0.0f), __lastSelectedValue); delete pCanvas; pCanvas = null; @@ -1048,7 +1028,7 @@ _EditDatePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); pCanvas->SetFont(*__pFont); - pCanvas->DrawText(Point(0,0),newValue); + pCanvas->DrawText(FloatPoint(0.0f, 0.0f), newValue); delete pCanvas; pCanvas = null; @@ -1064,7 +1044,7 @@ _EditDatePresenter::Animate(void) return; -CATCH: + CATCH: __isAnimating = false; __pContentProvider->Destroy(); diff --git a/src/ui/controls/FUiCtrl_EditFieldImpl.cpp b/src/ui/controls/FUiCtrl_EditFieldImpl.cpp old mode 100644 new mode 100755 index 1a0a17e..915bd2c --- a/src/ui/controls/FUiCtrl_EditFieldImpl.cpp +++ b/src/ui/controls/FUiCtrl_EditFieldImpl.cpp @@ -23,10 +23,13 @@ #include #include #include +#include +#include #include #include #include #include "FUi_ControlImpl.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_IFocusEventListener.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_UiBuilder.h" @@ -82,6 +85,31 @@ _EditFieldImpl::EditFieldSizeInfo::GetDefaultMinimumSize(_ControlOrientation ori return editFieldMinimumSize; } +FloatDimension +_EditFieldImpl::EditFieldSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension editFieldMinimumSize(0.0f, 0.0f); + + if (__smallStyle) + { + r = GET_DIMENSION_CONFIG(EDIT::SMALL_STYLE_MIN_SIZE, orientation, editFieldMinimumSize); + SysTryReturn(NID_UI, r == E_SUCCESS, editFieldMinimumSize, r, "System Error occurred."); + } + else if (__titleStyle == EDIT_FIELD_TITLE_STYLE_TOP) + { + r = GET_DIMENSION_CONFIG(EDIT::TITLE_STYLE_MIN_SIZE, orientation, editFieldMinimumSize); + SysTryReturn(NID_UI, r == E_SUCCESS, editFieldMinimumSize, r, "System Error occurred."); + } + else + { + r = GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editFieldMinimumSize); + SysTryReturn(NID_UI, r == E_SUCCESS, editFieldMinimumSize, r, "System Error occurred."); + } + + return editFieldMinimumSize; +} + void _EditFieldImpl::EditFieldSizeInfo::SetTitleStyle(EditFieldTitleStyle titleStyle) { @@ -208,6 +236,33 @@ _EditFieldImpl::CreateEditFieldImplN(EditField* pControl, const Rectangle& rect, return pImpl; } +_EditFieldImpl* +_EditFieldImpl::CreateEditFieldImplN(EditField* pControl, const FloatRectangle& rect, EditFieldStyle style, EditFieldTitleStyle titleStyle) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + bool isSmallStyle = false; + + if (style == EDIT_FIELD_STYLE_NORMAL_SMALL || style == EDIT_FIELD_STYLE_PASSWORD_SMALL + || style == EDIT_FIELD_STYLE_EMAIL_SMALL || style == EDIT_FIELD_STYLE_URL_SMALL + || style == EDIT_FIELD_STYLE_IP_V4_SMALL || style == EDIT_FIELD_STYLE_PHONE_NUMBER_SMALL + || style == EDIT_FIELD_STYLE_NUMBER_SMALL || style == EDIT_FIELD_STYLE_PASSWORD_NUMBER_SMALL) + { + isSmallStyle = true; + } + + _Edit* pCore = _Edit::CreateEditN(); + SysTryReturn(NID_UI_CTRL, pCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _EditFieldImpl* pImpl = new (std::nothrow) _EditFieldImpl(pControl, pCore); + r = _ControlImpl::CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +} + const char* _EditFieldImpl::GetPublicClassName(void) const { @@ -486,19 +541,31 @@ _EditFieldImpl::GetAutoLinkMask(void) const int _EditFieldImpl::GetMargin(EditMarginType marginType) const { + return _CoordinateSystemUtils::ConvertToInteger(GetMarginF(marginType)); +} + +float +_EditFieldImpl::GetMarginF(EditMarginType marginType) const +{ if (marginType == EDIT_MARGIN_TYPE_VERTICAL) { - return __pEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN); + return __pEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); } else { - return __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + return __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); } } result _EditFieldImpl::SetMargin(EditMarginType marginType, int margin) { + return SetMargin(marginType, _CoordinateSystemUtils::ConvertToFloat(margin)); +} + +result +_EditFieldImpl::SetMargin(EditMarginType marginType, float margin) +{ result r = E_SUCCESS; Variant varMargin(margin); @@ -680,12 +747,24 @@ _EditFieldImpl::SetEllipsisPosition(EllipsisPosition position) int _EditFieldImpl::GetTextSize(void) const { - return __pEdit->GetPropertyTextSize().ToInt(); + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_EditFieldImpl::GetTextSizeF(void) const +{ + return __pEdit->GetPropertyTextSize().ToFloat(); } result _EditFieldImpl::SetTextSize(int size) { + return SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +_EditFieldImpl::SetTextSize(float size) +{ Variant variantSize(size); return __pEdit->SetPropertyTextSize(variantSize); @@ -1230,6 +1309,8 @@ _EditFieldImpl::SetKeypadEnabled(bool enable) Variant variantEnable(enable); __pEdit->SetPropertyKeypadEnabled(variantEnable); + + return; } bool @@ -1705,6 +1786,22 @@ _EditFieldImpl::OnOtherControlSelected(const _Control& source) } } +void +_EditFieldImpl::SetEditTextFilter(IEditTextFilter* pFilter) +{ + __pEdit->SetEditTextFilter(pFilter); + + return; +} + +void +_EditFieldImpl::SendOpaqueCommand(const String& command) +{ + __pEdit->SendOpaqueCommand(command); + + return; +} + class _EditFieldMaker : public _UiBuilderControlMaker { @@ -1928,6 +2025,10 @@ protected: { pEditField->SetOverlayKeypadCommandButtonVisible(false); } + else + { + pEditField->SetOverlayKeypadCommandButtonVisible(true); + } if (pControl->GetElement(L"text", elementString)) { @@ -2204,6 +2305,19 @@ protected: r = pEditField->SetEllipsisPosition(ellipsisPosition); } + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pEditField->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pEditField; } }; // _EditFieldMaker diff --git a/src/ui/controls/FUiCtrl_EditModel.cpp b/src/ui/controls/FUiCtrl_EditModel.cpp old mode 100644 new mode 100755 index c8c082c..77120f1 --- a/src/ui/controls/FUiCtrl_EditModel.cpp +++ b/src/ui/controls/FUiCtrl_EditModel.cpp @@ -38,7 +38,7 @@ _EditModel::_EditModel(void) , __keypadActionEnabled(true) , __viewModeEnabled(false) , __keypadStyle(KEYPAD_STYLE_NORMAL) - , __keypadEnabled(false) + , __keypadEnabled(true) , __isLowerCase(false) , __isTextPredictionEnabled(true) , __keypadAction(CORE_KEYPAD_ACTION_ENTER) diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index 3cd91aa..8ed8fb7 100644 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -45,8 +45,8 @@ #include "FUi_Clipboard.h" #include "FUi_ClipboardItem.h" #include "FUi_Control.h" -#include "FUi_ControlImpl.h" #include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiEventManager.h" #include "FUi_UiNotificationEvent.h" @@ -87,16 +87,18 @@ const int MAX_LINE_NUMBER = 100; const int MAX_FLEXIBLE_HEIGHT_VERTICAL_MODE = 4000; const int MAX_FLEXIBLE_HEIGHT_HORIZONTAL_MODE = 2500; const int EDIT_FLICK_SCROLL_TIMER_INTERVAL = 10; -const float DIRECTION_DECISION_RATIO = 1.3; -const float HORIZONTAL_DECISION_RATIO = 1.5; -const int MOVE_SKIP_DECISION_RANGE = 5; +const float DIRECTION_DECISION_RATIO = 1.3f; +const float HORIZONTAL_DECISION_RATIO = 1.5f; +const float MOVE_SKIP_DECISION_RANGE = 5.0f; const int TITLE_SLIDING_TIME = 800; const int LANGUAGE_CODE_START = 0; const int LANGUAGE_CODE_MAX = 2; bool _EditPresenter::__isKeypadExist = false; -int _EditPresenter::__initialParentHeight = 0; +bool _EditPresenter::__isClipboardExist = false; +float _EditPresenter::__initialParentHeight = 0.0f; +float _EditPresenter::__clipboardHeight = 0.0f; bool _EditPresenter::__isPanelBoundsChanging = false; _EditAnimationProvider::_EditAnimationProvider(void) @@ -121,7 +123,8 @@ _EditAnimationProvider::CreateAnimationForProperty(VisualElement& source, const } _EditPresenter::_EditPresenter(void) - : __pEdit(null) + : __pTitleSlidingTimer(null) + , __pEdit(null) , __pTextBuffer(null) , __pTextString(null) , __pEditModel(null) @@ -132,16 +135,16 @@ _EditPresenter::_EditPresenter(void) , __isScrollBarVisible(false) , __scrollBarBounds() , __initialBounds() - , __previousScrollBarPos(0) - , __previousScrollBarMaxPos(0) + , __previousScrollBarPos(0.0f) + , __previousScrollBarMaxPos(0.0f) , __pActionEventListener(null) , __pCursorTimer(null) , __pFlickAnimationTimer(null) , __pPasswordTimer(null) - , __pTitleSlidingTimer(null) , __pFont(null) , __pCursorVisualElement(null) , __pTextVisualElement(null) + , __pTitleTextVisualElement(null) , __pCopyPasteManager(null) , __pFlickAnimation(null) , __pParentForm(null) @@ -150,6 +153,7 @@ _EditPresenter::_EditPresenter(void) , __pCommandButton(null) , __pInputConnection(null) , __isInputConnectionBound(false) + , __pClipboard(null) , __guideText() , __titleText() , __pressedPoint() @@ -172,7 +176,7 @@ _EditPresenter::_EditPresenter(void) , __isKeypadCommandButtonVisible(false) , __isKeypadHiding(false) , __isTextComposing(false) - , __isCopyPastePopupVisible(false) + , __isCopyPasteManagerExist(false) , __isCursorChanged(false) , __isCursorInitialized(false) , __isCursorDisabled(false) @@ -190,12 +194,12 @@ _EditPresenter::_EditPresenter(void) , __isKeypadShowing(false) , __blockStartPos(0) , __cursorPos(0) - , __maximumFlexibleHeight(-1) - , __prevTotalTextHeight(-1) + , __maximumFlexibleHeight(-1.0f) + , __prevTotalTextHeight(-1.0f) , __textLength(0) , __composingTextLength(0) - , __titleWidth(-1) - , __verticalMargin(-1) + , __titleWidth(-1.0f) + , __verticalMargin(-1.0f) , __isUSBKeyboardConnected(false) , __rotated(false) , __isCutLinkParserEnabled(false) @@ -206,14 +210,17 @@ _EditPresenter::_EditPresenter(void) , __isAutoShrinkEnabled(false) , __groupStyle(GROUP_STYLE_NONE) , __isFontInitialized(false) - , __contentFontSize(0) - , __titleFontSize(0) + , __contentFontSize(0.0f) + , __titleFontSize(0.0f) , __contentFontStyle(FONT_STYLE_PLAIN) , __contentTextStyle(TEXT_BOX_TEXT_STYLE_NORMAL) , __titleFontFaceName("") , __isSearchBar(false) , __isKeypadClosedEventSkipped(false) , __pCurrentFrame(null) + , __pTextFilter(null) + , __textBlockMoveLeft(false) + , __textBlockMoving(false) { } @@ -223,13 +230,14 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, if (showState == INPUT_PANEL_SHOW_STATE_SHOW)// 1. bounded 2.bounded&rotate { __isKeypadShowing = false; + __isKeypadExist = true;//[TWT]temporary test CheckUSBKeyboardStatus(); CheckKeypadStatus(); if (__isInputConnectionBound) { - if (__isKeypadCommandButtonVisible) + if (__isKeypadCommandButtonVisible && !__isUSBKeyboardConnected) { SetFooterVisible(false); } @@ -237,16 +245,14 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, ChangeLayoutInternal(__pEdit->GetOrientation()); AdjustParentPanelHeight(false); - if (__pCommandButton) - { - __pCommandButton->Invalidate(); - } + ScrollPanelToExposedRegion(true); + ScrollPanelToCursorPosition(); - if (__pParentForm) + if (__isCopyPasteManagerExist) { - ScrollPanelToTop(true); - ScrollPanelToCursorPosition(); - __pParentForm->Draw(); + __pCopyPasteManager->CreateCopyPastePopup(); + __pCopyPasteManager->AdjustBounds(); + __pCopyPasteManager->Show(); } } @@ -257,13 +263,27 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN); __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED); + + if (!__pEdit->IsFullScreenKeypadEdit()) + { + if (__pParentForm) + { + if (!__isUSBKeyboardConnected) + { + __pParentForm->SetKeypadShowState(true); + } + __pParentForm->Draw(); + } + } } else if (showState == INPUT_PANEL_SHOW_STATE_HIDE)// 1.unbound 2.bounded&usb off -> usb on 3.Flick keypad hide { CheckUSBKeyboardStatus(); CheckKeypadStatus(); - if (__isCopyPastePopupVisible) + __isKeypadExist = false;//[TWT]temporary test + + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); __pTextObject->SetBlock(false); @@ -272,34 +292,22 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, if (__isInputConnectionBound && __isUSBKeyboardConnected) // hide callback from external condition(usb mode off->on) { - ChangeLayoutInternal(__pEdit->GetOrientation()); AdjustParentPanelHeight(true); - if (__pCommandButton) - { - __pCommandButton->Invalidate(); - } - - _Form* pParentForm = GetParentForm(); - if (pParentForm) + if (!__pEdit->IsFullScreenKeypadEdit()) { - __pParentForm->Draw(); + __pParentForm->SetKeypadShowState(false); } } else { - _Form* pParentForm = GetParentForm(); if (__isInputConnectionBound)// keypad drag down, auto keypad hide by clipboard switch { - if (__pCommandButton && __pCommandButton->GetVisibleState() == true) - { - SetFooterVisible(true);// must be called ahead of DeflateClientRectHeight - __pCommandButton->SetVisibleState(false); - } - - if ( IsFocused() && pParentForm && __pEdit->IsFullScreenKeypadEdit() == false) + if ( __isTextComposing) { - pParentForm->SetFocused(); + __pInputConnection->FinishTextComposition(); + __isTextComposing = false; + __composingTextLength = 0; } } else// called by focus move or HideKeypad() api call @@ -312,17 +320,23 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, __isInputConnectionBound = false; __pEdit->DetachScrollPanelEvent(); + } - if (pParentForm) - { - pParentForm->DeflateClientRectHeight(0); - __pParentForm->Draw(); - } + if (__pCommandButton && __pCommandButton->GetVisibleState() == true) + { + SetFooterVisible(true);// must be called ahead of DeflateClientRectHeight + __pCommandButton->SetVisibleState(false); + __pCommandButton->Invalidate(); + } + + if (__pParentForm) + { + __pParentForm->DeflateClientRectHeight(0.0f); } __isKeypadHiding = false; - SetKeypadBounds(Rectangle()); + SetKeypadBounds(FloatRectangle()); if (!__isKeypadClosedEventSkipped) { @@ -330,6 +344,18 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CLOSED); } __isKeypadClosedEventSkipped = false; + + if (!__pEdit->IsFullScreenKeypadEdit()) + { + if (__pParentForm) + { + if (!__isUSBKeyboardConnected) + { + __pParentForm->SetKeypadShowState(false); + } + __pParentForm->Draw(); + } + } } return; @@ -374,6 +400,7 @@ _EditPresenter::OnInputConnectionPanelBoundsChanged(InputConnection& source, con void _EditPresenter::OnInputConnectionTextPredictionShowStateChanged(InputConnection& source, bool isShown) { + /* CheckUSBKeyboardStatus(); CheckKeypadStatus(); @@ -391,7 +418,7 @@ _EditPresenter::OnInputConnectionTextPredictionShowStateChanged(InputConnection& } __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED); - + */ return; } @@ -413,6 +440,8 @@ void _EditPresenter::OnTextCommitted(const String& commitText) { bool isTextComposingFinished = false; + char enterText1[2] = {'\n', }; + char enterText2[2] = {'\r', }; if (IsViewModeEnabled() == true) { @@ -421,16 +450,20 @@ _EditPresenter::OnTextCommitted(const String& commitText) if (IsBlocked() == true) { - int start = 0; - int end = 0; - GetBlockRange(start, end); - __isFlexibleHeightFrozen = true; - DeleteText(start, end); - __isFlexibleHeightFrozen = false; - ReleaseTextBlock(); + CoreKeypadAction keypadaction = GetKeypadAction(); + if (keypadaction == CORE_KEYPAD_ACTION_ENTER || !(commitText == enterText1 || commitText == enterText2)) + { + int start = 0; + int end = 0; + GetBlockRange(start, end); + __isFlexibleHeightFrozen = true; + DeleteText(start, end); + __isFlexibleHeightFrozen = false; + ReleaseTextBlock(); + } } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -451,6 +484,7 @@ _EditPresenter::OnTextCommitted(const String& commitText) if (__ContentTextStatus != EDIT_TEXT_STATUS_COMPOSE_NON) { + __pTextObject->SetFont(__pFont, __cursorPos, __cursorPos+textLength); __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON; } @@ -460,9 +494,6 @@ _EditPresenter::OnTextCommitted(const String& commitText) StopPasswordTimer(); } - char enterText1[2] = {'\n', }; - char enterText2[2] = {'\r', }; - if (commitText == enterText1 || commitText == enterText2) { CoreKeypadAction keypadaction = GetKeypadAction(); @@ -552,7 +583,7 @@ _EditPresenter::OnComposingTextChanged(const String& composingText, int cursorPo ReleaseTextBlock(); } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -686,7 +717,7 @@ _EditPresenter::OnSurroundingTextDeleted(int offset, int charCount) DeleteText(start, end); - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -732,6 +763,145 @@ _EditPresenter::GetPreviousText(InputConnection& source, String& text, int& curs return; } +void +_EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopupSize) +{ + //if (__isInputConnectionBound)//[twt]already keypad closed before clipboard show, __isInputConnectionBound cann't be clue at this point. + FloatDimension floatClipboardPopupSize = _CoordinateSystemUtils::ConvertToFloat(clipboardPopupSize); + if (IsFocused()) //temporal condition + { + __isClipboardExist = true; + FloatRectangle absKeypadBounds; + GetKeypadBounds(absKeypadBounds); + CheckUSBKeyboardStatus(); + + __clipboardHeight = floatClipboardPopupSize.height; + + SysLog(NID_UI_CTRL, "clipboard popup : opened! height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height); + + if (IsKeypadExist()) //resize as difference between clipboard height vs keypad height + { + if (floatClipboardPopupSize.height > absKeypadBounds.height) + { + ChangeLayoutInternal(__pEdit->GetOrientation()); + AdjustParentPanelHeight(false, true); + + if (__pParentForm) + { + ScrollPanelToExposedRegion(true); + ScrollPanelToCursorPosition(); + __pParentForm->Draw(); + } + + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED); + } + } + else + { + ChangeLayoutInternal(__pEdit->GetOrientation()); + AdjustParentPanelHeight(false); + + if (__pParentForm) + { + ScrollPanelToExposedRegion(true); + ScrollPanelToCursorPosition(); + __pParentForm->Draw(); + } + + __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED); + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN); + } + } + + return; +} + +void +_EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipboardPopupSize) +{ + //if (__isInputConnectionBound) + FloatDimension floatClipboardPopupSize = _CoordinateSystemUtils::ConvertToFloat(clipboardPopupSize); + if (IsFocused())//[twt]temporal condition + { + FloatRectangle absKeypadBounds; + GetKeypadBounds(absKeypadBounds); + CheckUSBKeyboardStatus(); + //CheckKeypadStatus(); + __clipboardHeight = floatClipboardPopupSize.height; + + SysLog(NID_UI_CTRL, "clipboard popup : bounds changed! height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height); + + if (IsKeypadExist()) + { + if (floatClipboardPopupSize.height > absKeypadBounds.height) + { + ChangeLayoutInternal(__pEdit->GetOrientation()); + AdjustParentPanelHeight(false, true); + if (__pParentForm) + { + __pParentForm->Draw(); + ScrollPanelToCursorPosition(); + } + + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED); + } + } + else + { + ChangeLayoutInternal(__pEdit->GetOrientation()); + AdjustParentPanelHeight(false); + if (__pParentForm) + { + __pParentForm->Draw(); + ScrollPanelToCursorPosition(); + } + + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED); + } + } + + return; +} + +void +_EditPresenter::OnClipboardPopupClosed(void) +{ + //if (__isInputConnectionBound) + if (IsFocused())//[twt]temporal condition + { + __isClipboardExist = false; + FloatRectangle absKeypadBounds; + GetKeypadBounds(absKeypadBounds); + CheckUSBKeyboardStatus(); + + __clipboardHeight = 0.0f; + + SysLog(NID_UI_CTRL, "clipboard popup : closed!keypad height = %f", absKeypadBounds.height); + + ChangeLayoutInternal(__pEdit->GetOrientation()); + + if (IsKeypadExist()) + { + AdjustParentPanelHeight(false, true); + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED); + } + else + { + AdjustParentPanelHeight(true); + if (__pParentForm) + { + __pParentForm->DeflateClientRectHeight(0); + __pParentForm->Draw(); + } + + __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CLOSED); + __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE); + } + } + + return; +} + _EditPresenter::~_EditPresenter(void) { Dispose(); @@ -749,7 +919,7 @@ _EditPresenter::Dispose(void) if (__pCommandButton && __pCommandButton->GetVisibleState() == true) { __pCommandButton->SetVisibleState(false); - if (__isKeypadCommandButtonVisible) + if (__isKeypadCommandButtonVisible && !__isUSBKeyboardConnected) { SetFooterVisible(true); } @@ -758,13 +928,27 @@ _EditPresenter::Dispose(void) __pCommandButton = null; } - _Form* pParentForm = GetParentForm(); - if (pParentForm) + if (__pParentForm) + { + __pParentForm->DeflateClientRectHeight(0.0f); + } + + if (__pEdit && !__pEdit->IsDestroyed())//skip when force deleted + { + AdjustParentPanelHeight(true); + } + + //if (__isInputConnectionBound) + if (__isClipboardExist)//[twt]temporal condition { - pParentForm->DeflateClientRectHeight(0); + __pClipboard->HidePopup(); + __isClipboardExist = false; } - AdjustParentPanelHeight(true); + if (__pClipboard) + { + __pClipboard->RemoveClipboardPopupEventListener(*this); + } delete __pFullscreenKeypad; __pFullscreenKeypad = null; @@ -848,7 +1032,6 @@ _EditPresenter::Dispose(void) if (__pCopyPasteManager != null) { - __pCopyPasteManager->HideHandle(); delete __pCopyPasteManager; __pCopyPasteManager = null; } @@ -865,6 +1048,12 @@ _EditPresenter::Dispose(void) __pCursorVisualElement = null; } + if (__pTitleTextVisualElement) + { + __pTitleTextVisualElement->Destroy(); + __pTitleTextVisualElement = null; + } + if (__pEditVEDelegator) { delete __pEditVEDelegator; @@ -877,13 +1066,14 @@ _EditPresenter::Dispose(void) void _EditPresenter::CheckKeypadStatus(void) { +/* if (!__pEdit) { return ; } - Dimension screenSize; - Rectangle absKeypadBounds; + FloatDimension screenSize; + FloatRectangle absKeypadBounds; _ControlManager* pControlManager = _ControlManager::GetInstance(); GetKeypadBounds(absKeypadBounds); @@ -892,11 +1082,17 @@ _EditPresenter::CheckKeypadStatus(void) if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - screenSize.height = pControlManager->GetScreenSize().height; + screenSize.height = pControlManager->GetScreenSizeF().height; } else { - screenSize.height = pControlManager->GetScreenSize().width; + screenSize.height = pControlManager->GetScreenSizeF().width; + } + + if (absKeypadBounds.w == 0 && absKeypadBounds.h == 0) + { + __isKeypadExist = false; + return; } if (absKeypadBounds.y != screenSize.height) @@ -907,7 +1103,7 @@ _EditPresenter::CheckKeypadStatus(void) { __isKeypadExist = false; } - +*/ return; } @@ -1009,7 +1205,7 @@ _EditPresenter::Initialize(const _Control& control) if (__pFont == null) { _ControlOrientation orientation = __pEdit->GetOrientation(); - int defaultFontSize = 0; + float defaultFontSize = 0.0f; GET_SHAPE_CONFIG(EDIT::DEFAULT_FONT_SIZE, orientation, defaultFontSize); __contentFontSize = defaultFontSize; @@ -1035,8 +1231,8 @@ _EditPresenter::Initialize(const _Control& control) __pScrollEffect->touchScrollFrameLevel[i] = 2 + i; } - __pScrollEffect->previousY = -1; - __pScrollEffect->currentY = -1; + __pScrollEffect->previousY = -1.0f; + __pScrollEffect->currentY = -1.0f; pEditModel = new (std::nothrow) _EditModel; SysTryCatch(NID_UI_CTRL, pEditModel, , r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance"); @@ -1057,7 +1253,7 @@ _EditPresenter::Initialize(const _Control& control) __isCutLinkParserEnabled = false; } - __initialBounds = __pEdit->GetBounds(); + __initialBounds = __pEdit->GetBoundsF(); __pCursorVisualElement = new (std::nothrow) _VisualElement; SysTryCatch(NID_UI_CTRL, __pCursorVisualElement, , r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance"); @@ -1098,6 +1294,13 @@ _EditPresenter::Initialize(const _Control& control) } } + __pClipboard = _Clipboard::GetInstance(); + + if (__pClipboard) + { + __pClipboard->AddClipboardPopupEventListener(*this); + } + return r; CATCH: @@ -1147,7 +1350,7 @@ result _EditPresenter::DrawChangeableBackground(Canvas& canvas, bool focused, int bitmapId, int effectBitmapId, bool outLine, int outlineBitmapId) { result r = E_SUCCESS; - Rectangle editRect(0, 0, __pEdit->GetBounds().width, __pEdit->GetBounds().height); + FloatRectangle editRect(0.0f, 0.0f, __pEdit->GetBoundsF().width, __pEdit->GetBoundsF().height); Color bitmapColor; Bitmap* pEditBgBitmap = null; Bitmap* pEditBgEffectBitmap = null; @@ -1157,12 +1360,6 @@ _EditPresenter::DrawChangeableBackground(Canvas& canvas, bool focused, int bitma pEditBgBitmap = __pEdit->GetDefaultBackgroundBitmap(editStatus); - if (__pEdit->IsCustomDefaultBackgroundBitmap(editStatus)) - { - canvas.DrawBitmap(editRect, *pEditBgBitmap); - return r; - } - if (borderRoundEnable) { pEditBgBitmap = null; @@ -1171,6 +1368,10 @@ _EditPresenter::DrawChangeableBackground(Canvas& canvas, bool focused, int bitma } bitmapColor = __pEdit->GetColor(editStatus); + if (__groupStyle != GROUP_STYLE_NONE) + { + GET_COLOR_CONFIG(PANEL::GROUPED_STYLE_BG_NORMAL, bitmapColor); + } pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pEditBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), bitmapColor); if (pReplacementColorBackgroundBitmap) @@ -1242,7 +1443,7 @@ _EditPresenter::DrawBackground(Canvas& canvas, bool drawTitleText) return DrawSingleLineBackground(canvas, drawTitleText); } - Rectangle editRect(0, 0, __pEdit->GetBounds().width, __pEdit->GetBounds().height); + FloatRectangle editRect(0.0f, 0.0f, __pEdit->GetBoundsF().width, __pEdit->GetBoundsF().height); EditStatus editStatus = GetCurrentStatus(); @@ -1261,14 +1462,14 @@ _EditPresenter::DrawBackground(Canvas& canvas, bool drawTitleText) } else { - DrawBackgroundBitmap(canvas, IsFocused()); + DrawBackgroundBitmap(canvas, IsInternalFocused()); } if (drawTitleText) { if ((__pEdit->GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (__pEdit->GetEditStyle() & EDIT_STYLE_TITLE_LEFT)) { - DrawTitleText(canvas); + DrawTitleText(); } } @@ -1276,8 +1477,9 @@ _EditPresenter::DrawBackground(Canvas& canvas, bool drawTitleText) } result -_EditPresenter::DrawTitleText(Canvas& canvas) +_EditPresenter::DrawTitleText() { + result r = E_SUCCESS; if (__titleText == -1) { return E_SYSTEM; @@ -1285,8 +1487,35 @@ _EditPresenter::DrawTitleText(Canvas& canvas) Variant value; TextObjectActionType titleAction; + Canvas* pTitleTextCanvas = null; + _VisualElement* pRootElement = __pEdit->GetVisualElement(); + SysTryReturn(NID_UI_CTRL, pRootElement, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element."); + + if (!__pTitleTextVisualElement) + { + __pTitleTextVisualElement = new (std::nothrow) _VisualElement(); + SysTryReturnResult(NID_UI_CTRL, __pTitleTextVisualElement, E_OUT_OF_MEMORY, "Memory allocation failed."); + + r = __pTitleTextVisualElement->Construct(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r = E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct _VisualElement."); + + __pTitleTextVisualElement->SetImplicitAnimationEnabled(false); + __pTitleTextVisualElement->SetShowState(true); + + r = pRootElement->AttachChild(*__pTitleTextVisualElement); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + + __pTitleTextVisualElement->SetBounds(__titleBounds); + + pTitleTextCanvas = __pTitleTextVisualElement->GetCanvasN(); + SysTryCatch(NID_UI_CTRL, pTitleTextCanvas, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pTitleTextCanvas->SetBackgroundColor(Color(0)); + pTitleTextCanvas->Clear(); + titleAction = __pTitleTextObject->GetAction(); - if (IsFocused() == true) + if (IsInternalFocused() == true) { __pTitleTextObject->SetForegroundColor(__pEdit->GetTitleTextColor(EDIT_STATUS_HIGHLIGHTED), 0, __pTitleTextObject->GetTextLength()); @@ -1296,8 +1525,8 @@ _EditPresenter::DrawTitleText(Canvas& canvas) __pTitleTextObject->Compose(); } - __pTitleTextObject->SetBounds(__titleBounds); - __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(canvas)); + __pTitleTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, __titleBounds.width, __titleBounds.height)); + __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pTitleTextCanvas)); StopTitleSlidingTimer(); if (__pTitleTextObject->IsActionOn() == true) @@ -1314,11 +1543,19 @@ _EditPresenter::DrawTitleText(Canvas& canvas) __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); } // Draw title text - __pTitleTextObject->SetBounds(__titleBounds); - __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(canvas)); + __pTitleTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, __titleBounds.width, __titleBounds.height)); + __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pTitleTextCanvas)); } + delete pTitleTextCanvas; + return E_SUCCESS; + +CATCH: + __pTitleTextVisualElement->Destroy(); + __pTitleTextVisualElement = null; + + return r; } void @@ -1362,9 +1599,9 @@ _EditPresenter::DrawText(void) if (__pTextVisualElement) { - Rectangle editBounds = __pEdit->GetBounds(); + FloatRectangle editBounds = __pEdit->GetBoundsF(); __pTextVisualElement->SetOpacity(1.0f); - __pTextVisualElement->SetBounds(FloatRectangle(0, 0, editBounds.width, editBounds.height)); + __pTextVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, editBounds.width, editBounds.height)); pCanvas = __pTextVisualElement->GetCanvasN(); if (pCanvas == null) { @@ -1495,7 +1732,7 @@ _EditPresenter::DrawTextForEntireFontSetting(Canvas& canvas) { result r = E_SUCCESS; - if (!(__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) && IsFocused() == false) + if (!(__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) && IsInternalFocused() == false) { __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); } @@ -1513,6 +1750,14 @@ _EditPresenter::DrawTextForEntireFontSetting(Canvas& canvas) { __pGuideTextObject->SetForegroundColor(__pEdit->GetGuideTextColor(), 0, __pGuideTextObject->GetTextLength()); + if (GetSearchBarFlag()) + { + if (__isTouchPressed) + { + __pGuideTextObject->SetForegroundColor(__pEdit->GetPressedGuideTextColor(), 0, __pGuideTextObject->GetTextLength()); + } + } + if (__isGuideTextColorChanged == true && __pEdit->IsSettingGuideTextColor() == false) { __pGuideTextObject->SetForegroundColor(__pEdit->GetTextColor(EDIT_STATUS_NORMAL), 0, __pGuideTextObject->GetTextLength()); @@ -1536,15 +1781,11 @@ _EditPresenter::DrawTextForEntireFontSetting(Canvas& canvas) EditStatus editStatus = GetCurrentStatus(); - if (IsFocused() == false) + if (IsInternalFocused() == false) { __pTextObject->SetFirstDisplayLineIndexFromTextIndex(0); __pTextObject->SetForegroundColor(__pEdit->GetTextColor(editStatus), 0, __pTextObject->GetTextLength()); - - if (IsBlocked() == true) - { - __pTextObject->SetBlock(false); - } + __pTextObject->SetBlock(false); } else { @@ -1592,7 +1833,7 @@ _EditPresenter::DrawTextForEntireFontSetting(Canvas& canvas) result _EditPresenter::DrawSingleLineBackground(Canvas& canvas, bool drawTitleText) { - Rectangle editField(0, 0, __pEdit->GetBounds().width, __pEdit->GetBounds().height); + FloatRectangle editField(0.0f, 0.0f, __pEdit->GetBoundsF().width, __pEdit->GetBoundsF().height); EditStatus editStatus = GetCurrentStatus(); Bitmap* pEditBgBitmap = __pEdit->GetBackgroundBitmap(editStatus); @@ -1610,14 +1851,14 @@ _EditPresenter::DrawSingleLineBackground(Canvas& canvas, bool drawTitleText) } else { - DrawSingleLineBackgroundBitmap(canvas, IsFocused()); + DrawSingleLineBackgroundBitmap(canvas, IsInternalFocused()); } if (drawTitleText) { if (((__pEdit->GetEditStyle() & EDIT_STYLE_TITLE_LEFT) && !(__titleText.GetLength() == 0)) || (__pEdit->GetEditStyle() & EDIT_STYLE_TITLE_TOP)) { - DrawTitleText(canvas); + DrawTitleText(); } } @@ -1653,8 +1894,8 @@ _EditPresenter::DrawClearIcon(Canvas& canvas) { result r = E_SUCCESS; - int clearIconWidth = 0; - int clearIconHeight = 0; + float clearIconWidth = 0; + float clearIconHeight = 0; _ControlOrientation orientation = __pEdit->GetOrientation(); GET_SHAPE_CONFIG(EDIT::CLEAR_ICON_WIDTH, orientation, clearIconWidth); @@ -1697,15 +1938,15 @@ _EditPresenter::DrawClearIcon(Canvas& canvas) return E_SYSTEM; } - Rectangle textRect = __textObjectBounds; - Rectangle afterClearIconRect(textRect.x + textRect.width, textRect.y + (textRect.height - clearIconHeight) / 2, clearIconWidth, clearIconHeight); + FloatRectangle textRect = __textObjectBounds; + FloatRectangle afterClearIconRect(textRect.x + textRect.width, textRect.y + (textRect.height - clearIconHeight) / 2.0f, clearIconWidth, clearIconHeight); if (__clearIconBounds != afterClearIconRect) { __clearIconBounds = afterClearIconRect; __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON); } - Rectangle editBounds = __pEdit->GetBounds(); + FloatRectangle editBounds = __pEdit->GetBoundsF(); if (editBounds.height < clearIconHeight) { __clearIconBounds.y = textRect.y; @@ -1745,12 +1986,10 @@ _EditPresenter::Draw(Canvas& canvas) r = InitializeAtFirstDrawing(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Faild to initialize."); - if (IsFocused() == true && __isInputConnectionBound == false) + if (IsInternalFocused() == true && __isInputConnectionBound == false) { if (IsViewModeEnabled() == false) { - CheckUSBKeyboardStatus(); - if (__pEdit->GetInputStyle() == INPUT_STYLE_OVERLAY) { ShowKeypad(false); @@ -1769,9 +2008,14 @@ _EditPresenter::Draw(Canvas& canvas) r = canvas.Clear(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - if (__rotated && !IsKeypadExist()) // Command button should be relocated after rotation in case of no keypad. + if (__rotated) // Command button should be relocated after rotation in case of no keypad. { - ChangeLayoutInternal(__pEdit->GetOrientation()); + if (__isCopyPasteManagerExist) + { + __pCopyPasteManager->CreateCopyPastePopup(); + __pCopyPasteManager->AdjustBounds(); + __pCopyPasteManager->Show(); + } __rotated = false; } @@ -2028,46 +2272,63 @@ _EditPresenter::GetLinkElementOffsetInTextBuffer(int elementIndex) const return elementOffset; } +bool +_EditPresenter::IsTextBlockedInTokenEdit(void) const +{ + return false; +} + int _EditPresenter::GetCursorPositionAt(const Point& touchPoint) const { Point cursorPoint; int cursorPos = -1; - if (__textObjectBounds.Contains(touchPoint)) + Rectangle textObjectBounds = _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds); + Rectangle textBoxBounds = _CoordinateSystemUtils::ConvertToInteger(__textBoxBounds); + + if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false) + { + if (IsTextBlockedInTokenEdit()) + { + textObjectBounds = GetTextBounds(); + } + } + + if (textObjectBounds.Contains(touchPoint)) { - cursorPoint.x = touchPoint.x - __textObjectBounds.x; - cursorPoint.y = touchPoint.y - __textObjectBounds.y; + cursorPoint.x = touchPoint.x - textObjectBounds.x; + cursorPoint.y = touchPoint.y - textObjectBounds.y; } - else if (__textBoxBounds.Contains(touchPoint)) + else if (textBoxBounds.Contains(touchPoint)) { - if (touchPoint.y <= __textObjectBounds.y) + if (touchPoint.y <= textObjectBounds.y) { - cursorPoint.y = __textObjectBounds.y + 1; + cursorPoint.y = textObjectBounds.y + 1; } - else if (touchPoint.y >= (__textObjectBounds.y + __textObjectBounds.height)) + else if (touchPoint.y >= (textObjectBounds.y + textObjectBounds.height)) { - cursorPoint.y = __textObjectBounds.y + __textObjectBounds.height - 1; + cursorPoint.y = textObjectBounds.y + textObjectBounds.height - 1; } else { cursorPoint.y = touchPoint.y; } - if (touchPoint.x <= __textObjectBounds.x) + if (touchPoint.x <= textObjectBounds.x) { - cursorPoint.x = __textObjectBounds.x + 1; + cursorPoint.x = textObjectBounds.x + 1; } - else if (touchPoint.x >= (__textObjectBounds.x + __textObjectBounds.width)) + else if (touchPoint.x >= (textObjectBounds.x + textObjectBounds.width)) { - cursorPoint.x = __textObjectBounds.x + __textObjectBounds.width - 1; + cursorPoint.x = textObjectBounds.x + textObjectBounds.width - 1; } else { cursorPoint.x = touchPoint.x; } - cursorPoint.y -= __textObjectBounds.y; - cursorPoint.x -= __textObjectBounds.x; + cursorPoint.y -= textObjectBounds.y; + cursorPoint.x -= textObjectBounds.x; } else { @@ -2079,34 +2340,96 @@ _EditPresenter::GetCursorPositionAt(const Point& touchPoint) const return cursorPos; } -bool -_EditPresenter::IsHorizontalDirection(const _TouchInfo& touchInfo) +int +_EditPresenter::GetCursorPositionAt(const FloatPoint& touchPoint) const { - if (touchInfo.GetTouchStatus() != _TOUCH_MOVED) - { - return false; - } + FloatPoint cursorPoint; + int cursorPos = -1; - if (__isMovingCursorByTouchMove) + FloatRectangle textObjectBounds = __textObjectBounds; + + if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false) { - return true; + if (IsTextBlockedInTokenEdit()) + { + textObjectBounds = GetTextBoundsF(); + } } - Rectangle absoluteEditRect = __pEdit->GetAbsoluteBounds(); - Point touchStartPoint = __pressedAbsolutePoint; - Point touchPoint = touchInfo.GetCurrentPosition(); - - int movedWidth = touchStartPoint.x - touchPoint.x - absoluteEditRect.x; - int movedHeight = touchStartPoint.y - touchPoint.y - absoluteEditRect.y; - movedWidth = (movedWidth >= 0) ? movedWidth : -(movedWidth); - movedHeight = (movedHeight >= 0) ? movedHeight : -(movedHeight); - - if (movedWidth >= movedHeight * DIRECTION_DECISION_RATIO) + if (textObjectBounds.Contains(touchPoint)) { - return true; + cursorPoint.x = touchPoint.x - textObjectBounds.x; + cursorPoint.y = touchPoint.y - textObjectBounds.y; } - - return false; + else if (__textBoxBounds.Contains(touchPoint)) + { + if (touchPoint.y <= textObjectBounds.y) + { + cursorPoint.y = textObjectBounds.y + 1.0f; + } + else if (touchPoint.y >= (textObjectBounds.y + textObjectBounds.height)) + { + cursorPoint.y = textObjectBounds.y + textObjectBounds.height - 1.0f; + } + else + { + cursorPoint.y = touchPoint.y; + } + + if (touchPoint.x <= textObjectBounds.x) + { + cursorPoint.x = textObjectBounds.x + 1.0f; + } + else if (touchPoint.x >= (textObjectBounds.x + textObjectBounds.width)) + { + cursorPoint.x = textObjectBounds.x + textObjectBounds.width - 1.0f; + } + else + { + cursorPoint.x = touchPoint.x; + } + cursorPoint.y -= textObjectBounds.y; + cursorPoint.x -= textObjectBounds.x; + } + else + { + return cursorPos; + } + + cursorPos = __pTextObject->GetTextIndexFromPosition(cursorPoint.x, cursorPoint.y); + + return cursorPos; +} + +bool +_EditPresenter::IsHorizontalDirection(const _TouchInfo& touchInfo) +{ + if (touchInfo.GetTouchStatus() != _TOUCH_MOVED) + { + return false; + } + + if (__isMovingCursorByTouchMove) + { + return true; + } + + FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(); + FloatPoint touchStartPoint = __pressedAbsolutePoint; + //After internal touch core complete the float conversion, we need to change the code here + FloatPoint touchPoint = touchInfo.GetCurrentPosition(); + + float movedWidth = touchStartPoint.x - touchPoint.x - absoluteEditRect.x; + float movedHeight = touchStartPoint.y - touchPoint.y - absoluteEditRect.y; + movedWidth = (movedWidth >= 0.0f) ? movedWidth : -(movedWidth); + movedHeight = (movedHeight >= 0.0f) ? movedHeight : -(movedHeight); + + if (movedWidth >= movedHeight * DIRECTION_DECISION_RATIO) + { + return true; + } + + return false; } bool @@ -2116,6 +2439,79 @@ _EditPresenter::IsInitialized(void) const } result +_EditPresenter::CalculateCursorBounds(const FloatRectangle& textBounds, FloatRectangle& cursorBounds, int cursorPos) +{ + float cursorWidth = 0.0f; + float cursorHeight = 0.0f; + float cursorAbsX = 0.0f; + float cursorAbsY = 0.0f; + float cursorRelativeX = 0.0f; + float cursorRelativeY = 0.0f; + + __pTextObject->SetBounds(textBounds); + + if (cursorPos == -1) + { + cursorPos = __pTextObject->GetCursorIndex(); + } + + if (__pTextObject->GetTextPositionInfoAt(cursorPos, cursorWidth, cursorHeight, cursorAbsX, cursorAbsY, cursorRelativeX, cursorRelativeY) != E_SUCCESS) + { + return E_SYSTEM; + } + + cursorBounds.x = cursorRelativeX; + cursorBounds.y = cursorRelativeY; + float cursorWidthValue = 0.0f; + GET_SHAPE_CONFIG(EDIT::CURSOR_WIDTH, __pEdit->GetOrientation(), cursorWidthValue); + cursorBounds.width = cursorWidthValue; + cursorBounds.height = cursorHeight; + + if (cursorBounds.y == 0.0f) + { + cursorBounds.y = __textObjectBounds.y; + } + + if (cursorBounds.height == 0.0f) + { + cursorBounds.height = __textObjectBounds.height; + } + + if (cursorBounds.height == 0.0f) + { + return E_SYSTEM; + } + + if (cursorBounds.y < textBounds.y) + { + float cursorHeightDiff = textBounds.y - cursorBounds.y; + cursorBounds.y = textBounds.y; + cursorBounds.height -= cursorHeightDiff; + } + + if (cursorBounds.x == textBounds.x + textBounds.width) + { + cursorBounds.x -= 1.0f; + } + else if (cursorBounds.x > textBounds.x + textBounds.width) + { + cursorBounds.x = textBounds.x + textBounds.width; + return E_SYSTEM; + } + + if (__pTextObject->GetBlock() == false) + { + cursorBounds.x -= 1.0f; + if (cursorBounds.x < textBounds.x) + { + cursorBounds.x = textBounds.x; + } + } + + return E_SUCCESS; +} + +result _EditPresenter::CalculateCursorBounds(const Rectangle& textBounds, Rectangle& cursorBounds, int cursorPos) { int cursorWidth = 0; @@ -2144,12 +2540,12 @@ _EditPresenter::CalculateCursorBounds(const Rectangle& textBounds, Rectangle& cu if (cursorBounds.y == 0) { - cursorBounds.y = __textObjectBounds.y; + cursorBounds.y = _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.y); } if (cursorBounds.height == 0) { - cursorBounds.height = __textObjectBounds.height; + cursorBounds.height = _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.height); } if (cursorBounds.height == 0) @@ -2189,6 +2585,96 @@ _EditPresenter::CalculateCursorBounds(const Rectangle& textBounds, Rectangle& cu } result +_EditPresenter::ScrollContents(float moveY) +{ + int moveLine = 0; + float firstDisplayY = 0.0f; + float effectDistance = moveY; + + float totalHeight = __pTextObject->GetTotalHeightF(); + float newFirstDisplayY = firstDisplayY = __pTextObject->GetFirstDisplayPositionYF(); + int currentCursorLine = 0; + + if (__pTextObject->GetTextLength() < 1) + { + return E_SYSTEM; + } + + if (__pScrollBar && __pScrollBar->GetScrollPosition() == 0 && effectDistance < 0.0f) + { + if (__pFlickAnimationTimer) + { + StopFlickTimer(); + } + + if (__pScrollBar->IsOnFadeEffect() == true) + { + __pScrollBar->SetScrollVisibility(false); + } + + return E_SYSTEM; + } + else if (__pScrollBar && __pScrollBar->GetScrollPosition() != 0 && __pScrollBar->GetScrollPosition() == __previousScrollBarMaxPos && effectDistance > 0.0f) + { + if (__pFlickAnimationTimer) + { + StopFlickTimer(); + } + + if (__pScrollBar->IsOnFadeEffect() == true) + { + __pScrollBar->SetScrollVisibility(false); + } + + return E_SYSTEM; + } + + if (__pTextObject->GetCursorIndex() == __pTextObject->GetTextLength()) + { + currentCursorLine = __pTextObject->GetTotalLineCount() - 1; + } + else + { + currentCursorLine = __pTextObject->GetLineIndexAtTextIndex(__pTextObject->GetCursorIndex()); + } + + if (currentCursorLine == -1) + { + return E_SYSTEM; + } + + if (currentCursorLine < 0) + { + currentCursorLine = 0; + } + + newFirstDisplayY += moveY; + + if (newFirstDisplayY > (totalHeight - __textObjectBounds.height)) + { + newFirstDisplayY = totalHeight - __textObjectBounds.height; + } + + if (newFirstDisplayY < 0.0f) + { + newFirstDisplayY = 0.0f; + } + + moveLine = __pTextObject->GetLineIndexAtPositionY(newFirstDisplayY); + + __pTextObject->SetFirstDisplayLineIndex(moveLine); + __pTextObject->SetFirstDisplayPositionY(newFirstDisplayY); + + __isCursorOpaque = false; + if (__isCopyPasteManagerExist) + { + __pCopyPasteManager->AdjustBounds(); + } + + return E_SUCCESS; +} + +result _EditPresenter::ScrollContents(int moveY) { int moveLine = 0; @@ -2254,9 +2740,9 @@ _EditPresenter::ScrollContents(int moveY) newFirstDisplayY += moveY; - if (newFirstDisplayY > (totalHeight - __textObjectBounds.height)) + if (newFirstDisplayY > (totalHeight - _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.height))) { - newFirstDisplayY = totalHeight - __textObjectBounds.height; + newFirstDisplayY = totalHeight - _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds.height); } if (newFirstDisplayY < 0) @@ -2270,7 +2756,7 @@ _EditPresenter::ScrollContents(int moveY) __pTextObject->SetFirstDisplayPositionY(newFirstDisplayY); __isCursorOpaque = false; - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { __pCopyPasteManager->AdjustBounds(); } @@ -2286,17 +2772,17 @@ _EditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchIn return false; } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { __pCopyPasteManager->ReleaseCopyPastePopup(); } __isTouchPressed = true; - __pScrollEffect->previousY = touchInfo.GetCurrentPosition().y; - __pScrollEffect->currentY = touchInfo.GetCurrentPosition().y; + __pScrollEffect->previousY = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().y); + __pScrollEffect->currentY = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().y); - Rectangle absoluteEditRect = __pEdit->GetAbsoluteBounds(); + FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(); __pressedPoint = touchInfo.GetCurrentPosition(); __pressedAbsolutePoint.x = __pressedPoint.x + absoluteEditRect.x; @@ -2371,7 +2857,7 @@ _EditPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchi bool _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { if (__isTouchPressed && !__isCopyPastePopupMoving) { @@ -2379,11 +2865,17 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI } else { + if (!IsInternalFocused()) + { + __pEdit->SetFocused(); + } __pCopyPasteManager->CreateCopyPastePopup(); __pCopyPasteManager->AdjustBounds(); __pCopyPasteManager->Show(); } __isCopyPastePopupMoving = false; + + return true; } if ((&source != __pEdit) || (__pEdit->GetEnableState() == false)) @@ -2392,8 +2884,8 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI } int cutLinkIndex = -1; - Rectangle clientBounds; - Point touchPoint = touchInfo.GetCurrentPosition(); + FloatRectangle clientBounds; + FloatPoint touchPoint = touchInfo.GetCurrentPosition(); if (IsViewModeEnabled()) { @@ -2417,7 +2909,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI } } - if (!__isCopyPastePopupVisible) + if (!__isCopyPasteManagerExist) { __isTextBlocked = false; } @@ -2463,9 +2955,9 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI return true; } - clientBounds = __pEdit->GetBounds(); - clientBounds.x = 0; - clientBounds.y = 0; + clientBounds = __pEdit->GetBoundsF(); + clientBounds.x = 0.0f; + clientBounds.y = 0.0f; touchPoint = touchInfo.GetCurrentPosition(); if (clientBounds.Contains(touchPoint)) { @@ -2476,9 +2968,9 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI { __pInputConnection->FinishTextComposition(); } - if (!__isCopyPastePopupVisible) // Copy&Paste + if (!__isCopyPasteManagerExist) // Copy&Paste { - if ((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) == true && IsFocused() == false) + if ((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) == true && IsInternalFocused() == false) { __isCursorChanged = true; } @@ -2490,8 +2982,8 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI } FadeOutScrollBar(); - if ((cutLinkIndex < 0) && - ((__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER) == false) && (IsKeypadEnabled())) + //if ((cutLinkIndex < 0) && ((__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER) == false) && (IsKeypadEnabled())) + if ((cutLinkIndex < 0) && ((__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER) == false)) { CheckUSBKeyboardStatus(); @@ -2501,7 +2993,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI { if (__pEdit->GetInputStyle() == INPUT_STYLE_OVERLAY) { - if (IsFocused()) + if (IsInternalFocused()) { ShowKeypad(false); } @@ -2524,7 +3016,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI { if (__pEdit->GetInputStyle() == INPUT_STYLE_OVERLAY) { - if (IsFocused()) + if (IsInternalFocused()) { ShowKeypad(false); } @@ -2565,7 +3057,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo return false; } - Point touchPoint = touchInfo.GetCurrentPosition(); + FloatPoint touchPoint = touchInfo.GetCurrentPosition(); if (__isClearIconPressed) { @@ -2577,7 +3069,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo } } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { __pCopyPasteManager->AdjustBounds(); __pCopyPasteManager->Show(); @@ -2586,14 +3078,14 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo if (__isTouchMoving == false && IsHorizontalDirection(touchInfo)) { - if (__isCopyPastePopupVisible && IsBlocked()) + if (__isCopyPasteManagerExist && IsBlocked()) { return true; } int newIndex = -1; - Rectangle fromBounds; - Rectangle toBounds; + FloatRectangle fromBounds; + FloatRectangle toBounds; CalculateCursorBounds(__textObjectBounds, fromBounds); newIndex = GetCursorPositionAt(touchInfo.GetCurrentPosition()); @@ -2618,13 +3110,13 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo return true; } - if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) + if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE || __pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) { - int horizontalGap = touchInfo.GetCurrentPosition().x - fromBounds.x; - Dimension currentCharacterDimension; - if (horizontalGap > 0 && __cursorPos < GetTextLength()) + float horizontalGap = touchInfo.GetCurrentPosition().x - fromBounds.x; + FloatDimension currentCharacterDimension; + if (horizontalGap > 0.0f && __cursorPos < GetTextLength()) { - currentCharacterDimension = __pTextObject->GetTextExtent(__cursorPos, 1); + currentCharacterDimension = __pTextObject->GetTextExtentF(__cursorPos, 1); if (horizontalGap >= currentCharacterDimension.width) { SetCursorPosition(__cursorPos+1); @@ -2632,9 +3124,9 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo return true; } } - if (horizontalGap < 0 && __cursorPos > 0) + if (horizontalGap < 0.0f && __cursorPos > 0) { - currentCharacterDimension = __pTextObject->GetTextExtent(__cursorPos-1, 1); + currentCharacterDimension = __pTextObject->GetTextExtentF(__cursorPos-1, 1); if (Math::Abs(horizontalGap) >= currentCharacterDimension.width) { SetCursorPosition(__cursorPos-1); @@ -2650,7 +3142,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo } } - int totalHeight = __pTextObject->GetTotalHeight(); + float totalHeight = __pTextObject->GetTotalHeightF(); if (__pParentPanel) { @@ -2671,7 +3163,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo __pScrollEffect->previousY = __pScrollEffect->currentY; __pScrollEffect->currentY = touchInfo.GetCurrentPosition().y; - int moveGap = __pScrollEffect->previousY - __pScrollEffect->currentY; + float moveGap = __pScrollEffect->previousY - __pScrollEffect->currentY; if (__isMovingCursorByTouchMove) { @@ -2735,7 +3227,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) __composingTextLength = 0; } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2754,7 +3246,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) __pCopyPasteManager->AddCopyPasteEventListener(*this); __pCopyPasteManager->CreateCopyPastePopup(); __pCopyPasteManager->Show(); - __isCopyPastePopupVisible = true; + __isCopyPasteManagerExist = true; break; case _KEY_C: textLength = __pEdit->GetTextLength(); @@ -2763,7 +3255,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) return true; } CopyText(); - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2775,14 +3267,14 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) return true; } CutText(); - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } break; case _KEY_V: PasteText(); - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2803,9 +3295,17 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) } else if (__isUSBKeyboardConnected && keyInfo.GetKeyModifier() & _KEY_MODIFIER_SHIFT) { - if (!__isCopyPastePopupVisible) + if (!__isCopyPasteManagerExist) { - return false; + if ( (keyCode == _KEY_LEFT) || (keyCode == _KEY_UP) || (keyCode == _KEY_DOWN) || (keyCode == _KEY_RIGHT) ) + { + SetBlockRangeWithShiftArrowkey(keyCode); + return true; + } + else + { + return false; + } } switch (keyCode) @@ -2859,7 +3359,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) } else if (_KEY_LEFT == keyCode || _KEY_NUM_LEFT == keyCode) { - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2876,7 +3376,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) int startPosition = -1; int endPosition = -1; GetTextImageRangeAt(__cursorPos-1, startPosition, endPosition); - if (startPosition>0 && startPosition < __cursorPos-1) + if (endPosition > -1 && startPosition >= 0 && startPosition < __cursorPos-1) { SetCursorPosition(startPosition); } @@ -2884,16 +3384,21 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) { SetCursorPosition(__cursorPos-1); } + if ((__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false) { DrawText(); } + else + { + __pEdit->Invalidate(); + } } return true; } else if (_KEY_UP == keyCode || _KEY_NUM_UP == keyCode) { - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2912,8 +3417,8 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine-1); int newCursorPosition = offset + firstTextIndex; int textLength = __pTextObject->GetTextLengthAt(curCursorLine-1); - Rectangle clientBounds(0, 0, 0, 0); - Rectangle absCursorBounds(0, 0, 0, 0); + FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (offsetGetClientBounds(); + clientBounds = __pParentForm->GetClientBoundsF(); GetCursorBounds(true, absCursorBounds); - if (!clientBounds.Contains(Point(absCursorBounds.x, absCursorBounds.y))) + if (!clientBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y))) { ScrollPanelToCursorPosition(); __pParentForm->Draw(); @@ -2958,7 +3463,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) } else if (_KEY_DOWN == keyCode || _KEY_NUM_DOWN == keyCode) { - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -2978,8 +3483,8 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine+1); int newCursorPosition = offset + firstTextIndex; int textLength = __pTextObject->GetTextLengthAt(curCursorLine+1); - Rectangle clientBounds(0, 0, 0, 0); - Rectangle absCursorBounds(0, 0, 0, 0); + FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (offsetGetClientBounds(); + clientBounds = __pParentForm->GetClientBoundsF(); GetCursorBounds(true, absCursorBounds); - if (!clientBounds.Contains(Point(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height))) + if (!clientBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height))) { ScrollPanelToCursorPosition(); __pParentForm->Draw(); @@ -3026,7 +3531,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) } else if (_KEY_RIGHT == keyCode || _KEY_NUM_RIGHT == keyCode) { - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { InitializeCopyPasteManager(); } @@ -3051,10 +3556,15 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) { SetCursorPosition(__cursorPos+1); } + if ((__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false) { DrawText(); } + else + { + __pEdit->Invalidate(); + } } return true; } @@ -3068,7 +3578,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) } } - if (__isCopyPastePopupVisible) + if (__isCopyPasteManagerExist) { if (IsBlocked() == true) { @@ -3134,6 +3644,17 @@ _EditPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) __pCopyPasteManager->CreateCopyPastePopup(); __pCopyPasteManager->Show(); } + else if (__textBlockMoving) + { + __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit); + SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, true, E_OUT_OF_MEMORY, "[EDIT] Unable to create _EditCopyPasteManager instance."); + __pCopyPasteManager->AddCopyPasteEventListener(*this); + __pCopyPasteManager->CreateCopyPastePopup(); + __pCopyPasteManager->Show(); + __isCopyPasteManagerExist = true; + + __textBlockMoving = false; + } return true; } @@ -3146,6 +3667,9 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) int start = 0; int end = 0; int total = 0; + String userString; + String filteredString; + if (!pClipboardItem && IsBlocked()) { ReleaseTextBlock(); @@ -3160,11 +3684,25 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) String* pSubString = null; result r = E_SUCCESS; + filteredString = *pClipString; + + if (__pTextFilter) + { + if(__pTextFilter->ValidatePastedText(*pClipString, userString)) + { + filteredString = userString; + SysLog(NID_UI_CTRL, "ClipString was changed by User"); + } + } + else if (IsUnsupportedChracterExist(GetKeypadStyle(), *pClipString) == true) + { + return; + } if (IsBlocked()) { GetBlockRange(start, end); - total = currentLength - (end - start) + pClipString->GetLength(); + total = currentLength - (end - start) + filteredString.GetLength(); if (total > __limitLength) { DeleteText(start, end); @@ -3172,7 +3710,7 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) pSubString = new String(__limitLength - currentLength + (end - start)); SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer."); - pClipString->SubString(0, __limitLength - currentLength + (end - start), *pSubString); + filteredString.SubString(0, __limitLength - currentLength + (end - start), *pSubString); r = InsertTextAt(__cursorPos, pSubString->GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pSubString; @@ -3181,11 +3719,11 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) { DeleteText(start, end); ReleaseTextBlock(); - r = InsertTextAt(__cursorPos, pClipString->GetPointer()); + r = InsertTextAt(__cursorPos, filteredString.GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } } - else if (currentLength + pClipString->GetLength() > __limitLength) + else if (currentLength + filteredString.GetLength() > __limitLength) { if (__limitLength == currentLength) { @@ -3196,14 +3734,14 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem) pSubString = new String(__limitLength - currentLength); SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer."); - pClipString->SubString(0, __limitLength - currentLength, *pSubString); + filteredString.SubString(0, __limitLength - currentLength, *pSubString); r = InsertTextAt(__cursorPos, pSubString->GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pSubString; } else { - r = InsertTextAt(__cursorPos, pClipString->GetPointer()); + r = InsertTextAt(__cursorPos, filteredString.GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -3224,17 +3762,22 @@ CATCH: bool _EditPresenter::OnLongPressGestureDetected(void) { - if (__isCopyPastePopupVisible) + if (__isClearIconPressed) + { + return true; + } + + if (__isCopyPasteManagerExist) { return true; } - else if (IsFocused() == false && !IsViewModeEnabled()) + else if (IsInternalFocused() == false && !IsViewModeEnabled()) { return true; } __isTouchPressed = false; - Rectangle cursorBounds; + FloatRectangle cursorBounds; InitializeCopyPasteManager(); if (IsClipped() || GetTextLength()) { @@ -3243,6 +3786,11 @@ _EditPresenter::OnLongPressGestureDetected(void) return true; } + if (!IsClipped() && (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD)) + { + return true; + } + if (__isInputConnectionBound && __isTextComposing) { __pInputConnection->FinishTextComposition(); @@ -3251,11 +3799,10 @@ _EditPresenter::OnLongPressGestureDetected(void) } int cursorPos = GetCursorPositionAt(__pressedPoint); - if (cursorPos == -1) + if (cursorPos != -1) { - cursorPos = 0; + SetCursorPosition(cursorPos); } - SetCursorPosition(cursorPos); ScrollPanelToCursorPosition(); GetCursorBounds(true, cursorBounds); @@ -3263,7 +3810,7 @@ _EditPresenter::OnLongPressGestureDetected(void) SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "[EDIT] Unable to create _EditCopyPasteManager instance."); __pCopyPasteManager->AddCopyPasteEventListener(*this); __pCopyPasteManager->Show(); - __isCopyPastePopupVisible = true; + __isCopyPasteManagerExist = true; } @@ -3273,7 +3820,7 @@ _EditPresenter::OnLongPressGestureDetected(void) bool _EditPresenter::OnTapGestureDetected(void) { - if (IsFocused() == false || __isCopyPastePopupVisible) + if (IsInternalFocused() == false || __isCopyPasteManagerExist) { return true; } @@ -3289,7 +3836,7 @@ _EditPresenter::OnTapGestureDetected(void) if (GetTextLength() > 0) { - Rectangle cursorBounds; + FloatRectangle cursorBounds; int start = -1; int end = -1; int cursorPos = GetCursorPositionAt(__pressedPoint); @@ -3309,7 +3856,7 @@ _EditPresenter::OnTapGestureDetected(void) __pCopyPasteManager->AddCopyPasteEventListener(*this); __pCopyPasteManager->CreateCopyPastePopup(); __pCopyPasteManager->Show(); - __isCopyPastePopupVisible = true; + __isCopyPasteManagerExist = true; if (__isInputConnectionBound && __isTextComposing) { @@ -3339,6 +3886,16 @@ _EditPresenter::GetLineSpacing(void) const return linePixelGap; } +float +_EditPresenter::GetLineSpacingF(void) const +{ + float linePixelGap = -1.0; + + linePixelGap = __pTextObject->GetLineSpaceF(); + + return linePixelGap; +} + void _EditPresenter::GetBlockRange(int& start, int& end) const { @@ -3507,7 +4064,8 @@ _EditPresenter::PasteText(void) int start = 0; int end = 0; int total = 0; - + String userString; + String filteredString; _Clipboard* pClipBoard = _Clipboard::GetInstance(); SysTryReturnResult(NID_UI_CTRL, pClipBoard != null, E_SYSTEM, "[EDIT] Unable to get the clipboard instance."); @@ -3518,10 +4076,25 @@ _EditPresenter::PasteText(void) const String* pClipString = dynamic_cast(pClipboardItem->GetData()); SysTryCatch(NID_UI_CTRL, pClipString, r = E_SYSTEM, E_SYSTEM, "[EDIT] Unable to get the clipboarditem instance."); + filteredString = *pClipString; + + if (__pTextFilter) + { + if(__pTextFilter->ValidatePastedText(*pClipString, userString)) + { + filteredString = userString; + SysLog(NID_UI_CTRL, "ClipString was changed by User"); + } + } + else if (IsUnsupportedChracterExist(GetKeypadStyle(), *pClipString) == true) + { + return E_SYSTEM; + } + if (IsBlocked()) { GetBlockRange(start, end); - total = currentLength - (end - start) + pClipString->GetLength(); + total = currentLength - (end - start) + filteredString.GetLength(); if (total > __limitLength) { DeleteText(start, end); @@ -3529,7 +4102,7 @@ _EditPresenter::PasteText(void) pSubString = new String(__limitLength - currentLength + (end - start)); SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer."); - pClipString->SubString(0, __limitLength - currentLength + (end - start), *pSubString); + filteredString.SubString(0, __limitLength - currentLength + (end - start), *pSubString); r = InsertTextAt(__cursorPos, pSubString->GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pSubString; @@ -3538,11 +4111,11 @@ _EditPresenter::PasteText(void) { DeleteText(start, end); ReleaseTextBlock(); - r = InsertTextAt(__cursorPos, pClipString->GetPointer()); + r = InsertTextAt(__cursorPos, filteredString.GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } } - else if (currentLength + pClipString->GetLength() > __limitLength) + else if (currentLength + filteredString.GetLength() > __limitLength) { if (__limitLength == currentLength) { @@ -3553,14 +4126,14 @@ _EditPresenter::PasteText(void) pSubString = new String(__limitLength - currentLength); SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer."); - pClipString->SubString(0, __limitLength - currentLength, *pSubString); + filteredString.SubString(0, __limitLength - currentLength, *pSubString); r = InsertTextAt(__cursorPos, pSubString->GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pSubString; } else { - r = InsertTextAt(__cursorPos, pClipString->GetPointer()); + r = InsertTextAt(__cursorPos, filteredString.GetPointer()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -3664,15 +4237,24 @@ _EditPresenter::SetLineSpacing(int linePixelGap) return r; } +result +_EditPresenter::SetLineSpacing(float linePixelGap) +{ + result r = E_SUCCESS; + + __pTextObject->SetLineSpace(linePixelGap); + + return r; +} + String _EditPresenter::GetText(int start, int end) const { String tempString; + SysTryReturn(NID_UI_CTRL, (start <= end), tempString, E_SYSTEM, "[E_SYSTEM] The invalid argument(start = %d, end = %d) is given."); - if (start > end) - { - return tempString; - } + int textLength = GetTextLength(); + SysTryReturn(NID_UI_CTRL, (start < textLength && end < textLength), tempString, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given."); if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD) { @@ -3873,6 +4455,8 @@ _EditPresenter::InsertTextAt(int index, const String& text) int currentLength = GetTextLength(); int length = text.GetLength(); int totalLength = currentLength + length; + String insertText = text; + int i = 0; SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= currentLength, E_OUT_OF_RANGE, "[EDIT] The Invalid argument is given."); @@ -3887,13 +4471,37 @@ _EditPresenter::InsertTextAt(int index, const String& text) } else { - SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_INVALID_ARG, "[EDIT] The Invalid argument is given."); + SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "[EDIT] The Invalid argument is given."); + } + + if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE || __pEdit->GetEditStyle() & EDIT_STYLE_TOKEN ) + { + while (insertText.Contains(String(L"\n"))) + { + for (i = 0; i < length; i++) + { + wchar_t ch; + insertText.GetCharAt(i, ch); + if (ch == '\n') + { + insertText.Remove(i, 1); + length = insertText.GetLength(); + + if (length == 0) + { + return E_SUCCESS; + } + break; + } + } + } } - r = __pTextString->Insert(text, index); + + r = __pTextString->Insert(insertText, index); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - wchar_t* pTempString = const_cast(text.GetPointer()); + wchar_t* pTempString = const_cast(insertText.GetPointer()); wchar_t pOriginalString[currentLength - index]; for (int i = 0; i < currentLength - index; i++) @@ -3968,7 +4576,7 @@ _EditPresenter::AppendText(const String& text) } else { - SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_INVALID_ARG, "[EDIT] The Invalid argument is given."); + SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "[EDIT] The Invalid argument is given."); } r = __pTextString->Append(text); @@ -4258,9 +4866,9 @@ _EditPresenter::IsViewModeEnabled(void) const result _EditPresenter::SetViewModeEnabled(bool enable) { - if (!enable && __pEditModel->IsViewModeEnabled() && IsFocused()) + if (!enable && __pEditModel->IsViewModeEnabled() && IsInternalFocused()) { - __pEdit->SetFocusOff(__pEdit); + __pEdit->SetFocused(false); } int editStyle = __pEdit->GetEditStyle(); @@ -4285,7 +4893,6 @@ _EditPresenter::SetViewModeEnabled(bool enable) } } - __pEditModel->SetKeypadEnabled(!enable); __isCursorDisabled = enable; __pTextObject->SetCutLinkViewMode(enable); @@ -4381,7 +4988,16 @@ _EditPresenter::SetKeypadAction(CoreKeypadAction keypadAction) void _EditPresenter::SetKeypadEnabled(bool enable) { - SetViewModeEnabled(!enable); + if (!enable && IsKeypadEnabled()) + { + //hide keypad + if (!__isUSBKeyboardConnected && __isInputConnectionBound) + { + HideKeypad(false); + } + } + + __pEditModel->SetKeypadEnabled(enable); return; } @@ -4390,6 +5006,12 @@ bool _EditPresenter::IsKeypadEnabled(void) { bool enable = true; + + enable = __pEditModel->IsKeypadEnabled(); + + return enable; + /* + bool enable = true; if (__pEdit->IsEnabled()) { enable = __pEditModel->IsKeypadEnabled(); @@ -4400,6 +5022,7 @@ _EditPresenter::IsKeypadEnabled(void) } return enable; + */ } result @@ -4663,12 +5286,23 @@ _EditPresenter::IsFocused(void) const } bool +_EditPresenter::IsInternalFocused(void) const +{ + return __pEdit->IsInternalFocused(); +} + +bool _EditPresenter::OnFocusGained(void) { + if (!__pParentForm) + { + __pParentForm = GetParentForm(); + } + if (__isAutoShrinkEnabled) { - int flexibleHeight = CalculateFlexibleHeight(); - Rectangle initialRect = GetInitialBounds(); + float flexibleHeight = CalculateFlexibleHeightF(); + FloatRectangle initialRect = GetInitialBoundsF(); initialRect.height = flexibleHeight; SetFlexBounds(initialRect); @@ -4706,8 +5340,6 @@ _EditPresenter::OnFocusGained(void) { if (IsViewModeEnabled() == false) { - CheckUSBKeyboardStatus(); - if (__pEdit->GetInputStyle() == INPUT_STYLE_OVERLAY) { ShowKeypad(false); @@ -4760,7 +5392,7 @@ _EditPresenter::OnNotifiedN(IList* pArgs) void _EditPresenter::OnFrameActivated(const _Frame& source) { - if (IsFocused() == true && __isInputConnectionBound == false && __isInitialized) + if (IsInternalFocused() == true && __isInputConnectionBound == false && __isInitialized) { if (IsViewModeEnabled() == false) { @@ -4782,12 +5414,22 @@ _EditPresenter::OnFrameDeactivated(const _Frame& source) return; } +void +_EditPresenter::OnFrameMinimized(const _Frame& source) +{ +} + +void +_EditPresenter::OnFrameRestored(const _Frame& source) +{ +} + bool _EditPresenter::OnFocusLost(void) { if (__isAutoShrinkEnabled) { - Rectangle intialWindowBounds = GetInitialBounds(); + FloatRectangle intialWindowBounds = GetInitialBoundsF(); SetFlexBounds(intialWindowBounds); } @@ -4817,7 +5459,13 @@ _EditPresenter::OnFocusLost(void) __isTouchReleaseSkipped = false; __isUSBKeyboardConnected = false; - AdjustParentPanelHeight(true); + if (__isClipboardExist)//[twt]check later + { + if (__pClipboard) + { + __pClipboard->HidePopup(); + } + } HideKeypad(); } @@ -4834,7 +5482,7 @@ _EditPresenter::GetCurrentStatus(void) const if (__pEdit->IsEnabled()) { - if (IsFocused()) + if (IsInternalFocused()) { editState = EDIT_STATUS_HIGHLIGHTED; } @@ -4882,7 +5530,54 @@ _EditPresenter::UpdateComponentInformation(void) } bool setFirstDisplayLine = true; - if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE)) + if (!((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) || (__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))) + { + float firstDisplayY = __pTextObject->GetFirstDisplayPositionYF(); + float totalHeight = __pTextObject->GetTotalHeightF(); + FloatRectangle displayBounds = __pTextObject->GetBoundsF(); + if (totalHeight >= displayBounds.height) + { + float textGapFromBottom = displayBounds.height - (totalHeight - firstDisplayY); + if (textGapFromBottom > 0) + { + ScrollText(-textGapFromBottom); + } + } + + FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f); + CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds); + setFirstDisplayLine = (IsContained(absCursorBounds) == false); + } + + if (setFirstDisplayLine) + { + if (__pTextObject->IsChanged()) + { + __pTextObject->Compose(); + } + __pTextObject->SetFirstDisplayLineIndexFromTextIndex(__cursorPos); + } + + __pTextObject->SetCursorIndex(__cursorPos); + + __isCursorChanged = false; + + return r; +} + +/* +result +_EditPresenter::UpdateComponentInformation(void) +{ + result r = E_SUCCESS; + + if (__isCursorChanged == false) + { + return r; + } + + bool setFirstDisplayLine = true; + if (!((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) || (__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))) { int firstDisplayY = __pTextObject->GetFirstDisplayPositionY(); int totalHeight = __pTextObject->GetTotalHeight(); @@ -4892,13 +5587,14 @@ _EditPresenter::UpdateComponentInformation(void) int textGapFromBottom = displayBounds.height - (totalHeight - firstDisplayY); if (textGapFromBottom > 0) { - ScrollText(-textGapFromBottom); + ScrollText(_CoordinateSystemUtils::ConvertToFloat(-textGapFromBottom)); } } Rectangle absCursorBounds(0, 0, 0, 0); CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds); - setFirstDisplayLine = (IsContained(absCursorBounds) == false); + FloatRectangle floatAbsCursorBounds = _CoordinateSystemUtils::ConvertToFloat(absCursorBounds); + setFirstDisplayLine = (IsContained(floatAbsCursorBounds) == false); } if (setFirstDisplayLine) @@ -4916,11 +5612,12 @@ _EditPresenter::UpdateComponentInformation(void) return r; } +*/ void -_EditPresenter::ScrollText(int distance) +_EditPresenter::ScrollText(float distance) { - int newFirstDisplayY = __pTextObject->GetFirstDisplayPositionY(); + float newFirstDisplayY = __pTextObject->GetFirstDisplayPositionYF(); newFirstDisplayY += distance; int moveLine = __pTextObject->GetLineIndexAtPositionY(newFirstDisplayY); @@ -4932,9 +5629,9 @@ _EditPresenter::ScrollText(int distance) } bool -_EditPresenter::IsContained(Rectangle& paramRect) const +_EditPresenter::IsContained(FloatRectangle& paramRect) const { - Rectangle absBounds = __pEdit->GetAbsoluteBounds(); + FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(); if ((paramRect.x < absBounds.x) || (paramRect.y < absBounds.y) || @@ -5012,6 +5709,72 @@ _EditPresenter::GetCursorBounds(bool isAbsRect, Rectangle& cursorBounds) return E_SUCCESS; } +result +_EditPresenter::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCursorBounds) +{ + float cursorAbsX = 0.0f; + float cursorAbsY = 0.0f; + float cursorWidth = 0.0f; + float cursorHeight = 0.0f; + float cursorRelativeX = 0.0f; + float cursorRelativeY = 0.0f; + + FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(); + + __pTextObject->SetBounds(GetTextBoundsF()); + if (__pTextObject->GetTextPositionInfoAt(index, cursorWidth, cursorHeight, cursorAbsX, cursorAbsY, cursorRelativeX, cursorRelativeY) != E_SUCCESS) + { + return E_SYSTEM; + } + + absCursorBounds.x = absBounds.x + cursorRelativeX; + + if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) + { + FloatRectangle tempBounds; + GetCursorBounds(true, tempBounds); + absCursorBounds.y = tempBounds.y; + } + else + { + absCursorBounds.y = absBounds.y + cursorRelativeY; + } + + absCursorBounds.width = cursorWidth; + + if (cursorHeight > 0.0f) + { + absCursorBounds.height = cursorHeight; + } + else + { + absCursorBounds.height = __pTextObject->GetLineHeightAtF(0); + } + + return E_SUCCESS; +} + +result +_EditPresenter::GetCursorBounds(bool isAbsRect, FloatRectangle& cursorBounds) +{ + if (__isInitialized == false) + { + return E_SYSTEM; + } + + CalculateCursorBounds(GetTextBoundsF(), cursorBounds); + + if (isAbsRect) + { + FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(); + cursorBounds.x += absBounds.x; + cursorBounds.y += absBounds.y; + } + + return E_SUCCESS; +} + + void _EditPresenter::SetCursorDisabled(bool disabled) { @@ -5048,7 +5811,7 @@ _EditPresenter::CreateCommandButtonItemN(int actionId, const String& text) _Button* pButton = _Button::CreateButtonN(); SysTryReturn(NID_UI_CTRL, pButton, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance."); - int textSize = 0; + float textSize = 0.0f; r = pButton->SetActionId(actionId); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -5072,8 +5835,9 @@ CATCH: } result -_EditPresenter::SetKeypadCommandButton(const Rectangle& bounds) +_EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds) { + // This function must be changed after _ toolbar completes their float conversion works result r = E_SUCCESS; Bitmap* pNormalBackgroundBitmap = null; Bitmap* pReplacementColorBackgroundBitmap = null; @@ -5144,10 +5908,10 @@ _EditPresenter::SetKeypadCommandButton(const Rectangle& bounds) __pCommandButton->AddActionEventListener(*__pActionEventListener); } - if (GetParentForm()) + if (__pParentForm) { - r = GetParentForm()->AttachChild(*__pCommandButton); - GetParentForm()->MoveChildToTop(*__pCommandButton); + r = __pParentForm->AttachChild(*__pCommandButton); + __pParentForm->MoveChildToTop(*__pCommandButton); } else { @@ -5171,13 +5935,12 @@ CATCH: void _EditPresenter::CheckFooterVisible(void) { - _Form* pParentForm = GetParentForm(); - if (pParentForm == null) + if (__pParentForm == null) { return; } - _Toolbar* pFooter = pParentForm->GetFooter(); + _Toolbar* pFooter = __pParentForm->GetFooter(); if (pFooter) { if (pFooter->GetVisibleState() == false) @@ -5200,13 +5963,12 @@ _EditPresenter::CheckFooterVisible(void) void _EditPresenter::SetFooterVisible(bool isVisible) { - _Form* pParentForm = GetParentForm(); - if (pParentForm == null) + if (__pParentForm == null) { return; } - _Toolbar* pFooter = pParentForm->GetFooter(); + _Toolbar* pFooter = __pParentForm->GetFooter(); if (pFooter && __footerVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_SHOW) { if ((isVisible == true && pFooter->GetVisibleState() == false) || @@ -5264,14 +6026,30 @@ _EditPresenter::ShowFullscreenKeypad(void) r = __pFullscreenKeypad->Open(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - if (__pEdit->IsInputEnabled()) + if (__pEdit->IsInputEventEnabled()) { - __pEdit->SetInputEnableState(false); + __pEdit->SetInputEventEnableState(false); } + if (__pTextFilter) + { + __pFullscreenKeypad->SetEditTextFilter(this); + } return r; } +void +_EditPresenter::DeleteFullscreenKeypad(void) +{ + if (__pFullscreenKeypad) + { + delete __pFullscreenKeypad; + __pFullscreenKeypad = null; + } + + return; +} + result _EditPresenter::GetKeypadBounds(Rectangle& bounds) const { @@ -5294,9 +6072,30 @@ _EditPresenter::GetKeypadBounds(Rectangle& bounds) const } result +_EditPresenter::GetKeypadBounds(FloatRectangle& bounds) const +{ + if (__pInputConnection == null) + { + return E_SYSTEM; + } + + bounds = __pInputConnection->GetInputPanelBoundsF(); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturnResult(NID_UI_CTRL, pCoordSystem, E_SYSTEM, "[EDIT] Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); + SysTryReturnResult(NID_UI_CTRL, pXformer, E_SYSTEM, "[EDIT] Coordinate system load failed."); + + bounds = pXformer->Transform(bounds); + + return E_SUCCESS; +} + +result _EditPresenter::ShowKeypad(bool focus) { - SysTryReturnResult(NID_UI_CTRL, IsKeypadEnabled() == true, E_INVALID_STATE, "[EDIT] Keypad is not enabled."); + //SysTryReturnResult(NID_UI_CTRL, IsKeypadEnabled() == true, E_INVALID_STATE, "[EDIT] Keypad is not enabled."); if (focus) { @@ -5308,12 +6107,16 @@ _EditPresenter::ShowKeypad(bool focus) return E_SUCCESS; } + /* _ControlManager* pControlManager = _ControlManager::GetInstance(); if (!pControlManager->IsFrameActivated()) { return E_SUCCESS; - } + }*/ + + CheckKeypadStatus(); + CheckUSBKeyboardStatus(); __pInputConnection->BindInputMethod(); __isInputConnectionBound = true; @@ -5347,48 +6150,32 @@ _EditPresenter::ShowKeypad(bool focus) SetCurrentLanguage(initialKeypadLanguage); } - if (!__isUSBKeyboardConnected) + if (!__isUSBKeyboardConnected && IsKeypadEnabled()) { __pInputConnection->ShowInputPanel(); - __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED); - } - else - { - if (__isKeypadCommandButtonVisible) + + if (!IsKeypadExist()) { __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED); } - } - if (__isKeypadCommandButtonVisible) - { CheckFooterVisible(); - SetFooterVisible(false); - } - - ChangeLayoutInternal(__pEdit->GetOrientation()); - - AdjustParentPanelHeight(false); - - ScrollPanelToTop(false); - ScrollPanelToCursorPosition(); - - __pEdit->AttachScrollPanelEvent(); - __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED); - if (__isUSBKeyboardConnected) - { - __pEdit->Invalidate(); - } - - if (__isUSBKeyboardConnected) - { if (__isKeypadCommandButtonVisible) { - __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN); + SetFooterVisible(false); + } + + if (IsKeypadExist()) + { + ChangeLayoutInternal(__pEdit->GetOrientation()); + AdjustParentPanelHeight(false); } } + __pEdit->AttachScrollPanelEvent(); + __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED); + return E_SUCCESS; } @@ -5397,46 +6184,36 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - int commandButtonHeight = 0; - if (__pCopyPasteManager) { - __pCopyPasteManager->SetTextBlockReleaseFlag(false); - InitializeCopyPasteManager(); + __pCopyPasteManager->ReleaseCopyPastePopup(); } __rotated = true; CheckUSBKeyboardStatus(); - if (__isInputConnectionBound) + + if (__isInputConnectionBound || IsFocused())//[twt]IsFocused() condition will be deleted { - if (IsKeypadExist()) + if (__pParentForm) { - _Form* pParentForm = GetParentForm(); - - if (pParentForm) - { - _Toolbar* pFooter = pParentForm->GetFooter(); - - if (pFooter && pFooter->GetVisibleState()) - { - GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight); - } + __pParentForm->DeflateClientRectHeight(0.0f); + } - pParentForm->DeflateClientRectHeight(commandButtonHeight); - } - if (__pCommandButton && __pCommandButton->GetVisibleState()) - { - __pCommandButton->SetVisibleState(false); - } + if (__pCommandButton && __pCommandButton->GetVisibleState()) + { + __pCommandButton->SetVisibleState(false); } - else //usb mode on or bounded after keypad drag + + if (IsKeypadExist() || __isClipboardExist) { + __initialParentHeight = 0.0f; ChangeLayoutInternal(orientation); + AdjustParentPanelHeight(false); } } - __initialBounds = __pEdit->GetBounds(); + __initialBounds = __pEdit->GetBoundsF(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to change layout.", GetErrorMessage(r)); @@ -5448,83 +6225,126 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation) { result r = E_SUCCESS; - _Form* pParentForm = GetParentForm(); - Rectangle keypadBounds; - GetKeypadBounds(keypadBounds); + FloatRectangle keypadBounds(0.0f, 0.0f, 0.0f, 0.0f); _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturnResult(NID_UI_CTRL, pControlManager, E_SYSTEM, "[EDIT] Failed to get root."); - Dimension screenSize; - Rectangle commandButtonBounds(0, 0, 0, 0); + FloatDimension screenSize; + FloatRectangle commandButtonBounds(0.0f, 0.0f, 0.0f, 0.0f); - int formDeflateHeight = 0; + float formDeflateHeight = 0.0f; + float shrinkedHeight = 0.0f; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - screenSize.width = pControlManager->GetScreenSize().width; - screenSize.height = pControlManager->GetScreenSize().height; + screenSize.width = pControlManager->GetScreenSizeF().width; + screenSize.height = pControlManager->GetScreenSizeF().height; } else { - screenSize.width = pControlManager->GetScreenSize().height; - screenSize.height = pControlManager->GetScreenSize().width; + screenSize.width = pControlManager->GetScreenSizeF().height; + screenSize.height = pControlManager->GetScreenSizeF().width; } - if (__isInputConnectionBound) + //if (__isInputConnectionBound) + if (__isInputConnectionBound || IsFocused())//[twt]temporal { - if (__isKeypadCommandButtonVisible) - { - commandButtonBounds.width = screenSize.width; - GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonBounds.height); + GetKeypadBounds(keypadBounds); - if (pParentForm) + if (IsKeypadExist()) + { + if (__isClipboardExist) { - formDeflateHeight += commandButtonBounds.height; - - if (IsKeypadExist()) + if (__clipboardHeight > keypadBounds.height) { - formDeflateHeight += keypadBounds.height; - commandButtonBounds.y = screenSize.height - keypadBounds.height - commandButtonBounds.height - pParentForm->GetClientBounds().y; + shrinkedHeight = __clipboardHeight; } else { - commandButtonBounds.y = screenSize.height - commandButtonBounds.height - pParentForm->GetClientBounds().y; + shrinkedHeight = keypadBounds.height; } } else { - if (IsKeypadExist()) - { - commandButtonBounds.y = screenSize.height - keypadBounds.height - commandButtonBounds.height; - } - else - { - commandButtonBounds.y = screenSize.height - commandButtonBounds.height; - } + shrinkedHeight = keypadBounds.height; } - - r = SetKeypadCommandButton(commandButtonBounds); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (__pCommandButton) - { - __pCommandButton->SetVisibleState(true); + } + else + { + if (__isClipboardExist) + { + shrinkedHeight = __clipboardHeight; + } + } + + if (__isKeypadCommandButtonVisible && !__isUSBKeyboardConnected) + { + if (__isClipboardExist) + { + if (__pParentForm) + { + formDeflateHeight += shrinkedHeight; + } + } + else + { + commandButtonBounds.width = screenSize.width; + float commandButtonHeight = 0.0f; + GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight); + commandButtonBounds.height = commandButtonHeight; + + if (__pParentForm) + { + formDeflateHeight += commandButtonBounds.height; + + if (IsKeypadExist()) + { + formDeflateHeight += shrinkedHeight; + commandButtonBounds.y = screenSize.height - shrinkedHeight - commandButtonBounds.height - __pParentForm->GetClientBoundsF().y; + } + else + { + commandButtonBounds.y = screenSize.height - commandButtonBounds.height - __pParentForm->GetClientBoundsF().y; + } + } + else + { + if (IsKeypadExist()) + { + commandButtonBounds.y = screenSize.height - shrinkedHeight - commandButtonBounds.height; + } + else + { + commandButtonBounds.y = screenSize.height - commandButtonBounds.height; + } + } + + r = SetKeypadCommandButton(commandButtonBounds); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (__pCommandButton) + { + __pCommandButton->SetVisibleState(true); + __pCommandButton->Invalidate(); + } } } else { - if (pParentForm) + if (__pParentForm) { - if (IsKeypadExist()) + if (IsKeypadExist() || __isClipboardExist) { - formDeflateHeight += keypadBounds.height; + formDeflateHeight += shrinkedHeight; } } } } - if (pParentForm) - pParentForm->DeflateClientRectHeight(formDeflateHeight); + if (__pParentForm) + { + __pParentForm->DeflateClientRectHeight(formDeflateHeight); + } return r; } @@ -5532,16 +6352,17 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation) void _EditPresenter::OnScrollPanelBoundsChanged(void) { + /* if (__pParentPanel && __isPanelBoundsChanging == false) { __initialParentHeight = __pParentPanel->GetBounds().height; if (__pParentPanel->GetOrientation() == __pEdit->GetOrientation()) { AdjustParentPanelHeight(false); - ScrollPanelToTop(false); + ScrollPanelToExposedRegion(false); ScrollPanelToCursorPosition(); } - } + }*/ return; } @@ -5555,38 +6376,34 @@ _EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPredicti } _ControlOrientation orientation; - int commandButtonHeight = 0; + float commandButtonHeight = 0.0f; - Rectangle absKeypadBounds; - result r = GetKeypadBounds(absKeypadBounds); + FloatRectangle absKeypadBounds(0.0f, 0.0f, 0.0f, 0.0f); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - _Form* pParentForm = GetParentForm(); _Toolbar* pFooter = null; - if (pParentForm) + if (__pParentForm) { - pFooter = pParentForm->GetFooter(); + pFooter = __pParentForm->GetFooter(); } - Rectangle absScrollPanelBounds; - Rectangle scrollPanelBounds = __pParentPanel->GetBounds(); - int gapY = 0; + FloatRectangle absScrollPanelBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle scrollPanelBounds = __pParentPanel->GetBoundsF(); + float gapY = 0.0f; _ControlManager* pControlManager = _ControlManager::GetInstance(); - int displayedPanelHeight = 0; - Dimension screenSize; + float displayedPanelHeight = 0.0f; + FloatDimension screenSize; if (__pEdit->GetOrientation()== _CONTROL_ORIENTATION_PORTRAIT) { - screenSize.width = pControlManager->GetScreenSize().width; - screenSize.height = pControlManager->GetScreenSize().height; + screenSize.width = pControlManager->GetScreenSizeF().width; + screenSize.height = pControlManager->GetScreenSizeF().height; } else { - screenSize.width = pControlManager->GetScreenSize().height; - screenSize.height = pControlManager->GetScreenSize().width; + screenSize.width = pControlManager->GetScreenSizeF().height; + screenSize.height = pControlManager->GetScreenSizeF().width; } if (panelResizeByPrediction) @@ -5598,7 +6415,7 @@ _EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPredicti { scrollPanelBounds.height = __initialParentHeight; - __initialParentHeight = 0; + __initialParentHeight = 0.0f; __isPanelBoundsChanging = true; __pParentPanel->SetBounds(scrollPanelBounds); __isPanelBoundsChanging = false; @@ -5607,13 +6424,44 @@ _EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPredicti } else { + if (IsKeypadExist()) + { + GetKeypadBounds(absKeypadBounds); + + if (__isClipboardExist) + { + if (__clipboardHeight > absKeypadBounds.height) + { + absKeypadBounds.y = screenSize.height - __clipboardHeight; + } + } + else + { + if (__isUSBKeyboardConnected)//predictive window shown + { + absKeypadBounds.y = screenSize.height - absKeypadBounds.height;//only absKeypadBounds.height is meaningful in USB on. + } + } + } + else + { + if (__isClipboardExist) + { + absKeypadBounds.y = screenSize.height - __clipboardHeight; + } + else + { + absKeypadBounds.y = screenSize.height; + } + } + if (__isKeypadCommandButtonVisible || (pFooter && (pFooter->GetVisibleState() == true))) { orientation = __pEdit->GetOrientation(); GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight); } - absScrollPanelBounds = __pParentPanel->GetAbsoluteBounds(); + absScrollPanelBounds = __pParentPanel->GetAbsoluteBoundsF(); displayedPanelHeight = screenSize.height - commandButtonHeight - absScrollPanelBounds.y; gapY = (absKeypadBounds.y - commandButtonHeight)- absScrollPanelBounds.y; @@ -5621,7 +6469,7 @@ _EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPredicti { if (__isUSBKeyboardConnected) { - if (gapY > 0) + if (gapY > 0.0f) { scrollPanelBounds.height = gapY; @@ -5634,7 +6482,7 @@ _EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPredicti } else { - if ((gapY > 0) && __initialParentHeight) + if ((gapY > 0.0f) && __initialParentHeight) { scrollPanelBounds.height = gapY; @@ -5678,7 +6526,7 @@ _EditPresenter::HideKeypad(bool focus) __isKeypadShowing = false; - if (__isInitialized == false) + if (__isInitialized == false || !__isInputConnectionBound) { return E_SUCCESS; } @@ -5699,27 +6547,21 @@ _EditPresenter::HideKeypad(bool focus) __pCommandButton->SetVisibleState(false); } - _Form* pParentForm = GetParentForm(); - if (pParentForm) + if (IsKeypadExist()) { - pParentForm->DeflateClientRectHeight(0); - } + if (__pParentForm) + { + __pParentForm->DeflateClientRectHeight(0.0f); + } - AdjustParentPanelHeight(true); + AdjustParentPanelHeight(true); + } __isInputConnectionBound = false; - if (focus && IsFocused() && pParentForm) - { - pParentForm->SetFocused(); - } - - if (__isUSBKeyboardConnected) + if (focus && IsInternalFocused()) { - if (__isKeypadCommandButtonVisible) - { - __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE); - } + __pEdit->SetFocused(false); } return E_SUCCESS; @@ -5777,6 +6619,9 @@ _EditPresenter::OnEditCopyPasteStatusChanged(CoreCopyPasteStatus status, CoreCop case CORE_COPY_PASTE_ACTION_PASTE: __pEdit->PasteText(); break; + case CORE_COPY_PASTE_ACTION_SEARCH: + case CORE_COPY_PASTE_ACTION_CLIPBOARD: + //fall through default: break; } @@ -5791,13 +6636,13 @@ _EditPresenter::InitializeCursor(void) { StopCursorTimer(); - if (__isCursorDisabled == false && IsFocused() && __isTextBlocked == false) + if (__isCursorDisabled == false && IsInternalFocused() && __isTextBlocked == false) { - Rectangle cursorBounds; + FloatRectangle cursorBounds; CalculateCursorBounds(__textObjectBounds, cursorBounds); __pCursorVisualElement->SetOpacity(1.0f); - __pCursorVisualElement->SetBounds(FloatRectangle(cursorBounds.x, cursorBounds.y, cursorBounds.width, cursorBounds.height)); + __pCursorVisualElement->SetBounds(cursorBounds); Canvas* pCanvas = __pCursorVisualElement->GetCanvasN(); if (pCanvas == null) @@ -5809,7 +6654,7 @@ _EditPresenter::InitializeCursor(void) if (__pInputConnection) { - Rectangle absoluteEditRectangle; + FloatRectangle absoluteEditRectangle; if (GetCursorBounds(false, absoluteEditRectangle) == E_SUCCESS) { __pInputConnection->SetCursorBounds(absoluteEditRectangle); @@ -5827,7 +6672,7 @@ _EditPresenter::InitializeCursor(void) __pCursorVisualElement->SetOpacity(0); } - if (__pInputConnection != null && __isInputConnectionBound == true && !__isCopyPastePopupVisible) + if (__pInputConnection != null && __isInputConnectionBound == true && !__isCopyPasteManagerExist) { __pInputConnection->SetCursorPosition(__cursorPos); } @@ -5841,8 +6686,6 @@ _EditPresenter::StopCursorTimer(void) if (__pCursorTimer) { __pCursorTimer->Cancel(); - delete __pCursorTimer; - __pCursorTimer = null; } return; } @@ -5878,6 +6721,9 @@ _EditPresenter::StartCursorTimer(void) CATCH: StopCursorTimer(); + delete __pCursorTimer; + __pCursorTimer = null; + return r; } @@ -5927,7 +6773,52 @@ _EditPresenter::DrawCursor(Canvas& canvas, Rectangle& cursorBounds, bool isCurso } result -_EditPresenter::MoveCursor(const Rectangle& fromRect, const Rectangle& toRect) +_EditPresenter::DrawCursor(Canvas& canvas, FloatRectangle& cursorBounds, bool isCursorOpaque) +{ + result r = E_SUCCESS; + + if (__isCursorDisabled == false) + { + Color cursorColor; + GET_COLOR_CONFIG(EDIT::CURSOR_NORMAL, cursorColor); + + if (__isCursorInitialized) + { + cursorBounds.SetPosition(0.0f, 0.0f); + + if (canvas.GetBackgroundColor() != cursorColor) + { + canvas.FillRectangle(cursorColor, cursorBounds); + } + + if (isCursorOpaque) + { + __pCursorVisualElement->SetOpacity(1.0f); + } + else + { + __pCursorVisualElement->SetOpacity(0); + } + } + else + { + cursorBounds.SetPosition(0.0f, 0.0f); + + canvas.FillRectangle(cursorColor, cursorBounds); + __isCursorInitialized = true; + + } + } + else + { + __pCursorVisualElement->SetOpacity(0); + } + + return r; +} + +result +_EditPresenter::MoveCursor(const FloatRectangle& fromRect, const FloatRectangle& toRect) { if ((__previousCursorBounds.x != fromRect.x) || (__previousCursorBounds.y != fromRect.y) || (__previousCursorBounds.width != fromRect.width) || (__previousCursorBounds.height != fromRect.height)) { @@ -5936,7 +6827,7 @@ _EditPresenter::MoveCursor(const Rectangle& fromRect, const Rectangle& toRect) __pCursorVisualElement->SetOpacity(0); - __pCursorVisualElement->SetBounds(FloatRectangle(toRect.x, toRect.y, toRect.width, toRect.height)); + __pCursorVisualElement->SetBounds(toRect); Canvas* pCanvas = __pCursorVisualElement->GetCanvasN(); if (pCanvas == null) @@ -5944,8 +6835,8 @@ _EditPresenter::MoveCursor(const Rectangle& fromRect, const Rectangle& toRect) return E_SYSTEM; } - if (toRect.y < 0 || toRect.y >= __clientBounds.height || - toRect.x < 0 || toRect.x >= __clientBounds.width) + if (toRect.y < 0.0f || toRect.y >= __clientBounds.height || + toRect.x < 0.0f || toRect.x >= __clientBounds.width) { delete pCanvas; return E_SYSTEM; @@ -5968,13 +6859,13 @@ _EditPresenter::MoveCursor(const Rectangle& fromRect, const Rectangle& toRect) void _EditPresenter::OnCursorTimerExpired(void) { - if (!IsFocused() && __isCursorDisabled) + if (!IsInternalFocused() && __isCursorDisabled) { StopCursorTimer(); return; } - Rectangle cursorBounds; + FloatRectangle cursorBounds; if (CalculateCursorBounds(__textObjectBounds, cursorBounds) != E_SUCCESS) { @@ -5988,7 +6879,7 @@ _EditPresenter::OnCursorTimerExpired(void) if (__pCursorVisualElement) { - __pCursorVisualElement->SetBounds(FloatRectangle(cursorBounds.x, cursorBounds.y, cursorBounds.width, cursorBounds.height)); + __pCursorVisualElement->SetBounds(cursorBounds); Canvas* pCanvas = __pCursorVisualElement->GetCanvasN(); if (pCanvas == null) { @@ -6035,7 +6926,7 @@ _EditPresenter::SetEllipsisPosition(EllipsisPosition position) } void -_EditPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_EditPresenter::OnFontInfoRequested(unsigned long& style, float& size) { style = __contentFontStyle; size = __contentFontSize; @@ -6070,6 +6961,12 @@ _EditPresenter::GetFont(void) const int _EditPresenter::GetTextSize(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__contentFontSize); +} + +float +_EditPresenter::GetTextSizeF(void) const +{ return __contentFontSize; } @@ -6118,6 +7015,34 @@ _EditPresenter::SetTextSize(const int size) SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font."); } + __contentFontSize = _CoordinateSystemUtils::ConvertToFloat(size); + return r; +} + +result +_EditPresenter::SetTextSize(const float size) +{ + result r = E_SUCCESS; + _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, fontImpl, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = fontImpl->SetSize(size); + SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed."); + + if (__pTextObject) + { + r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); + __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON; + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font."); + } + + if (IsGuideTextActivated()) + { + r = __pGuideTextObject->SetFont(__pFont, 0, __pGuideTextObject->GetTextLength()); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font."); + } + __contentFontSize = size; return r; } @@ -6250,7 +7175,7 @@ _EditPresenter::SetFontType(const String& typefaceName, unsigned long styleMask) String tempFontFaceName; bool isFaceNameAvailable = false; - int textSize = __pFont->GetSize(); + float textSize = __pFont->GetSizeF(); unsigned long fontStyle = FONT_STYLE_PLAIN; if (styleMask & TEXT_BOX_TEXT_STYLE_ITALIC) @@ -6480,8 +7405,7 @@ _EditPresenter::SetTitleText(const String& title) __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); __pTitleTextObject->Compose(); - - int titleFontSize = 0; + float titleFontSize = 0.0f; GET_SHAPE_CONFIG(EDIT::DEFAULT_TITLE_FONT_SIZE, __pEdit->GetOrientation(), titleFontSize); __titleFontSize = titleFontSize; @@ -6504,7 +7428,7 @@ _EditPresenter::SetTitleText(const String& title) r = fontImpl->SetSize(__contentFontSize); SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed."); - __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TITLE_TEXT); + __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT); return r; } @@ -6543,6 +7467,23 @@ _EditPresenter::GetTextTotalHeight(void) const return __pTextObject->GetTotalHeight(); } +float +_EditPresenter::GetTextTotalHeightF(void) const +{ + if (GetTextLength() == 0) + { + return 0; + } + + if (__isInitialized == false) + { + __pTextObject->SetBounds(__textObjectBounds); + __pTextObject->Compose(); + } + + return __pTextObject->GetTotalHeightF(); +} + result _EditPresenter::Resize(void) { @@ -6573,19 +7514,19 @@ _EditPresenter::Resize(void) __pScrollBar->OnParentBoundsChanged(); } - __verticalMargin = __pEdit->GetBounds().height - __textObjectBounds.height; + __verticalMargin = __pEdit->GetBoundsF().height - __textObjectBounds.height; if (__pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE) { if (__initialBounds.height > __verticalMargin) { - if (__initialBounds.height > __pEdit->GetBounds().height) + if (__initialBounds.height > __pEdit->GetBoundsF().height) { __prevTotalTextHeight = __initialBounds.height - __verticalMargin; } else { - __prevTotalTextHeight = __pEdit->GetBounds().height - __verticalMargin; + __prevTotalTextHeight = __pEdit->GetBoundsF().height - __verticalMargin; } } } @@ -6599,23 +7540,23 @@ _EditPresenter::SetClientBounds(void) { int editStyle = __pEdit->GetEditStyle(); - __clientBounds = __pEdit->GetBounds(); - __clientBounds.x = 0; - __clientBounds.y = 0; + __clientBounds = __pEdit->GetBoundsF(); + __clientBounds.x = 0.0f; + __clientBounds.y = 0.0f; if (!(editStyle & EDIT_STYLE_SINGLE_LINE)) { return; } - int leftBorder = 0; - int rightBorder = 0; - int topBorder = 0; - int bottomBorder = 0; - int leftMargin = 0; - int rightMargin = 0; - int topMargin = 0; - int bottomMargin = 0; + float leftBorder = 0.0f; + float rightBorder = 0.0f; + float topBorder = 0.0f; + float bottomBorder = 0.0f; + float leftMargin = 0.0f; + float rightMargin = 0.0f; + float topMargin = 0.0f; + float bottomMargin = 0.0f; _ControlOrientation orientation = __pEdit->GetOrientation(); GET_SHAPE_CONFIG(EDIT::FIELD_LEFT_MARGIN, orientation, leftMargin); @@ -6625,8 +7566,8 @@ _EditPresenter::SetClientBounds(void) if (editStyle & EDIT_STYLE_TITLE_LEFT) { - int titleWidth = 0; - if (__titleWidth != -1) + float titleWidth = 0.0f; + if (__titleWidth != -1.0f) { titleWidth = __titleWidth; } @@ -6642,8 +7583,8 @@ _EditPresenter::SetClientBounds(void) } else if (editStyle & EDIT_STYLE_TITLE_TOP) { - int titletHeight = 0; - int titleTextTopMargin = 0; + float titletHeight = 0.0f; + float titleTextTopMargin = 0.0f; GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titletHeight); GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin); @@ -6666,33 +7607,23 @@ _EditPresenter::SetInitialEditFieldBounds(void) { result r = E_SUCCESS; int editStyle = __pEdit->GetEditStyle(); - int leftMargin = 0; - int rightMargin = 0; - int topMargin = 0; - int bottomMargin = 0; - int textLeftMargin = 0; - int textRightMargin = 0; - int textTopMargin = 0; - int textBottomMargin = 0; - int titleRectWidth = 0; - int titleRectHeight = 0; - int titleTextLeftMargin = 0; - int titleTextRightMargin = 0; - int titleTextTopMargin = 0; - int titleTextBottomMargin = 0; - int clearIconWidth = 0; + float bottomMargin = 0.0f; + float textLeftMargin = 0.0f; + float textRightMargin =0.0f; + float textTopMargin = 0.0f; + float textBottomMargin = 0.0f; + float titleTextLeftMargin = 0.0f; + float titleTextRightMargin =0.0f; + float titleTextTopMargin = 0.0f; + float titleTextBottomMargin = 0.0f; + float clearIconWidth = 0.0f; _ControlOrientation orientation = __pEdit->GetOrientation(); - GET_SHAPE_CONFIG(EDIT::FIELD_LEFT_MARGIN, orientation, leftMargin); - GET_SHAPE_CONFIG(EDIT::FIELD_RIGHT_MARGIN, orientation, rightMargin); - GET_SHAPE_CONFIG(EDIT::FIELD_TOP_MARGIN, orientation, topMargin); GET_SHAPE_CONFIG(EDIT::FIELD_BOTTOM_MARGIN, orientation, bottomMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TEXT_LEFT_MARGIN, orientation, textLeftMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TEXT_RIGHT_MARGIN, orientation, textRightMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TEXT_TOP_MARGIN, orientation, textTopMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin); - GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_WIDTH, orientation, titleRectWidth); - GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titleRectHeight); GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_LEFT_MARGIN, orientation, titleTextLeftMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_RIGHT_MARGIN, orientation, titleTextRightMargin); GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin); @@ -6704,7 +7635,7 @@ _EditPresenter::SetInitialEditFieldBounds(void) return E_SYSTEM; } - Rectangle bounds = __pEdit->GetBounds(); + FloatRectangle bounds = __pEdit->GetBoundsF(); if (editStyle & EDIT_STYLE_TITLE_LEFT) { __textObjectBounds.x = __clientBounds.x + textLeftMargin; @@ -6748,10 +7679,10 @@ _EditPresenter::SetInitialEditFieldBounds(void) else if ((editStyle & EDIT_STYLE_NORMAL) || (editStyle & EDIT_STYLE_CLEAR)) { __textObjectBounds = __clientBounds; - int tempLeftMargin = __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - int tempRightMargin = __pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + float tempLeftMargin = __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + float tempRightMargin = __pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); - if (tempLeftMargin != -1) + if (tempLeftMargin != -1.0f) { __textObjectBounds.x = __clientBounds.x + tempLeftMargin; __textObjectBounds.width = __clientBounds.width - tempLeftMargin; @@ -6762,7 +7693,7 @@ _EditPresenter::SetInitialEditFieldBounds(void) __textObjectBounds.width = __clientBounds.width - textLeftMargin; } - if (tempRightMargin != -1) + if (tempRightMargin != -1.0f) { __textObjectBounds.width -= tempRightMargin; } @@ -6781,9 +7712,9 @@ _EditPresenter::SetInitialEditFieldBounds(void) } else { - int tempLeftMargin = __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - int tempRightMargin = __pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); - if (tempLeftMargin != -1) + float tempLeftMargin = __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + float tempRightMargin = __pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); + if (tempLeftMargin != -1.0f) { __textObjectBounds.x = __clientBounds.x + tempLeftMargin; __textObjectBounds.width = __clientBounds.width - tempLeftMargin; @@ -6794,7 +7725,7 @@ _EditPresenter::SetInitialEditFieldBounds(void) __textObjectBounds.width = __clientBounds.width - textLeftMargin; } - if (tempRightMargin != -1) + if (tempRightMargin != -1.0f) { __textObjectBounds.width -= tempRightMargin; } @@ -6807,7 +7738,7 @@ _EditPresenter::SetInitialEditFieldBounds(void) - textBottomMargin; } - int textObectMinimumWidth = 0; + float textObectMinimumWidth = 0.0f; GET_SHAPE_CONFIG(EDIT::TEXT_OBJECT_MININMUM_WIDTH, orientation, textObectMinimumWidth); if (__textObjectBounds.width < textObectMinimumWidth) @@ -6822,7 +7753,7 @@ _EditPresenter::SetInitialEditFieldBounds(void) if (editStyle & EDIT_STYLE_TITLE_LEFT) { - int gap = 0; + float gap = 0.0f; if (__titleBounds.width < textObectMinimumWidth) { gap = textObectMinimumWidth - __titleBounds.width; @@ -6838,41 +7769,39 @@ _EditPresenter::SetInitialEditFieldBounds(void) return r; } - result _EditPresenter::SetInitialBounds(void) { result r = E_SUCCESS; - Rectangle bounds = __pEdit->GetBounds(); + FloatRectangle bounds = __pEdit->GetBoundsF(); int editStyle = __pEdit->GetEditStyle(); if (editStyle & EDIT_STYLE_SINGLE_LINE) { r = SetInitialEditFieldBounds(); - __textBoxBounds.x = 0; - __textBoxBounds.y = 0; + __textBoxBounds.x = 0.0f; + __textBoxBounds.y = 0.0f; __textBoxBounds.width = bounds.width; __textBoxBounds.height = bounds.height; return r; } - int leftMargin = 0; - int rightMargin = 0; - int topMargin = 0; - int bottomMargin = 0; - int textLeftMargin = 0; - int textRightMargin = 0; - int textTopMargin = 0; - int textBottomMargin = 0; - int titleRectWidth = 0; - int titleRectHeight = 0; - int titleTextLeftMargin = 0; - int titleTextRightMargin = 0; - int titleTextTopMargin = 0; - int titleTextBottomMargin = 0; - int clearIconWidth = 0; - int scrollWidth = 0; + float leftMargin = 0.0f; + float rightMargin = 0.0f; + float topMargin = 0.0f; + float bottomMargin = 0.0f; + float textLeftMargin = 0.0f; + float textRightMargin =0.0f; + float textTopMargin = 0.0f; + float textBottomMargin = 0.0f; + float titleRectWidth = 0.0f; + float titleRectHeight = 0.0f; + float titleTextLeftMargin = 0.0f; + float titleTextRightMargin = 0.0f; + float titleTextTopMargin = 0.0f; + float titleTextBottomMargin = 0.0f; + float scrollWidth = 0.0f; _ControlOrientation orientation = __pEdit->GetOrientation(); GET_SHAPE_CONFIG(EDIT::AREA_LEFT_MARGIN, orientation, leftMargin); @@ -6889,7 +7818,6 @@ _EditPresenter::SetInitialBounds(void) GET_SHAPE_CONFIG(EDIT::AREA_TITLE_TEXT_RIGHT_MARGIN, orientation, titleTextRightMargin); GET_SHAPE_CONFIG(EDIT::AREA_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin); GET_SHAPE_CONFIG(EDIT::AREA_TITLE_TEXT_BOTTOM_MARGIN, orientation, titleTextBottomMargin); - GET_SHAPE_CONFIG(EDIT::CLEAR_ICON_WIDTH, orientation, clearIconWidth); GET_SHAPE_CONFIG(EDIT::AREA_SCROLL_WIDTH, orientation, scrollWidth); if (editStyle & EDIT_STYLE_TITLE_TOP) @@ -6901,9 +7829,9 @@ _EditPresenter::SetInitialBounds(void) } else if (editStyle & EDIT_STYLE_TITLE_LEFT) { - int titleWidth = 0; + float titleWidth = 0.0f; - if (__titleWidth != -1) + if (__titleWidth != -1.0f) { titleWidth = __titleWidth; } @@ -6918,8 +7846,8 @@ _EditPresenter::SetInitialBounds(void) } else { - __textBoxBounds.x = 0; - __textBoxBounds.y = 0; + __textBoxBounds.x = 0.0f; + __textBoxBounds.y = 0.0f; __textBoxBounds.width = bounds.width; __textBoxBounds.height = bounds.height; } @@ -6927,10 +7855,10 @@ _EditPresenter::SetInitialBounds(void) // setting textBounds if (editStyle & EDIT_STYLE_TITLE_TOP) { - if (__pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN) != -1) + if (__pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN) != -1.0f) { - __textObjectBounds.x = __textBoxBounds.x + __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - __textObjectBounds.width = __textBoxBounds.width - __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + __textObjectBounds.x = __textBoxBounds.x + __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + __textObjectBounds.width = __textBoxBounds.width - __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); } else { @@ -6938,9 +7866,9 @@ _EditPresenter::SetInitialBounds(void) __textObjectBounds.width = __textBoxBounds.width - textLeftMargin; } - if (__pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN) != -1) + if (__pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN) != -1.0f) { - __textObjectBounds.width -= __pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + __textObjectBounds.width -= __pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); } else { @@ -6953,10 +7881,10 @@ _EditPresenter::SetInitialBounds(void) } else { - if (__pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN) != -1) + if (__pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN) != -1.0f) { - __textObjectBounds.x = __textBoxBounds.x + __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - __textObjectBounds.width = __textBoxBounds.width - __pEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + __textObjectBounds.x = __textBoxBounds.x + __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + __textObjectBounds.width = __textBoxBounds.width - __pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); } else { @@ -6964,9 +7892,9 @@ _EditPresenter::SetInitialBounds(void) __textObjectBounds.width = __textBoxBounds.width - textLeftMargin; } - if (__pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN) != -1) + if (__pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN) != -1.0f) { - __textObjectBounds.width -= __pEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + __textObjectBounds.width -= __pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); } else { @@ -6974,10 +7902,10 @@ _EditPresenter::SetInitialBounds(void) } - if (__pEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN) != -1) + if (__pEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) != -1.0f) { - __textObjectBounds.y = __textBoxBounds.y + __pEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN); - __textObjectBounds.height = __textBoxBounds.height - __pEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN); + __textObjectBounds.y = __textBoxBounds.y + __pEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); + __textObjectBounds.height = __textBoxBounds.height - __pEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); } else { @@ -6985,9 +7913,9 @@ _EditPresenter::SetInitialBounds(void) __textObjectBounds.height = __textBoxBounds.height - textTopMargin; } - if (__pEdit->GetVerticalMargin(EDIT_TEXT_BOTTOM_MARGIN) != -1) + if (__pEdit->GetVerticalMarginF(EDIT_TEXT_BOTTOM_MARGIN) != -1.0f) { - __textObjectBounds.height -= __pEdit->GetVerticalMargin(EDIT_TEXT_BOTTOM_MARGIN); + __textObjectBounds.height -= __pEdit->GetVerticalMarginF(EDIT_TEXT_BOTTOM_MARGIN); } else { @@ -7018,10 +7946,10 @@ _EditPresenter::SetInitialBounds(void) if (editStyle & EDIT_STYLE_NOSCROLL) { __isScrollBarVisible = false; - __scrollBarBounds.x = 0; - __scrollBarBounds.y = 0; - __scrollBarBounds.width = 0; - __scrollBarBounds.height = 0; + __scrollBarBounds.x = 0.0f; + __scrollBarBounds.y = 0.0f; + __scrollBarBounds.width = 0.0f; + __scrollBarBounds.height = 0.0f; } else { @@ -7030,9 +7958,9 @@ _EditPresenter::SetInitialBounds(void) __scrollBarBounds.x = bounds.width - __scrollBarBounds.width; __scrollBarBounds.y = __textBoxBounds.y + textTopMargin; __scrollBarBounds.height = __textBoxBounds.height - textTopMargin - textBottomMargin; - if (__scrollBarBounds.height < 0) + if (__scrollBarBounds.height < 0.0f) { - __scrollBarBounds.height = 0; + __scrollBarBounds.height = 0.0f; } __isScrollBarVisible = true; @@ -7043,7 +7971,7 @@ _EditPresenter::SetInitialBounds(void) } } - int textObectMinimumWidth = 0; + float textObectMinimumWidth = 0.0f; GET_SHAPE_CONFIG(EDIT::TEXT_OBJECT_MININMUM_WIDTH, orientation, textObectMinimumWidth); if (__textObjectBounds.width < textObectMinimumWidth) @@ -7108,35 +8036,35 @@ _EditPresenter::OnTitleSlidingTimerExpired(void) { result r = E_SUCCESS; - if (!IsFocused()) + if (!IsInternalFocused()) { StopTitleSlidingTimer(); return r; } - Rectangle tempBounds(0, 0, __pEdit->GetBounds().width, __pEdit->GetBounds().height); - Canvas* pCanvas = __pEdit->GetCanvasN(tempBounds); - SysTryReturnResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "[EDIT] pCanvas is invalid!"); - if (__pTitleTextObject->IsChanged()) { - DrawTitleText(*pCanvas); + r = DrawTitleText(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to draw title text"); } + Canvas *pTitleTextCanvas = __pTitleTextVisualElement->GetCanvasN(); + SysTryReturnResult(NID_UI_CTRL, pTitleTextCanvas, E_SYSTEM, "A system error has occurred. Failed to get canvas of VisualElement"); + if (__isTouchPressed) { - pCanvas->SetBackgroundColor(__pEdit->GetColor(EDIT_STATUS_PRESSED)); + pTitleTextCanvas->SetBackgroundColor(__pEdit->GetColor(EDIT_STATUS_PRESSED)); } else { - pCanvas->SetBackgroundColor(__pEdit->GetColor(EDIT_STATUS_HIGHLIGHTED)); + pTitleTextCanvas->SetBackgroundColor(__pEdit->GetColor(EDIT_STATUS_HIGHLIGHTED)); } - pCanvas->Clear(__titleBounds); - __pTitleTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas)); - r = pCanvas->Show(__titleBounds); + pTitleTextCanvas->Clear(); + __pTitleTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pTitleTextCanvas)); + r = pTitleTextCanvas->Show(); - delete pCanvas; + delete pTitleTextCanvas; r = StartTitleSlidingTimer(); @@ -7214,7 +8142,7 @@ _EditPresenter::OnPasswordTimerExpired(void) { result r = E_SUCCESS; - if (!IsFocused()) + if (!IsInternalFocused()) { return E_SYSTEM; } @@ -7277,7 +8205,7 @@ _EditPresenter::SetDefaultFont(void) Font* pControlFont = null; _ControlOrientation orientation = __pEdit->GetOrientation(); - int defaultFontSize = 0; + float defaultFontSize = 0.0f; GET_SHAPE_CONFIG(EDIT::DEFAULT_FONT_SIZE, orientation, defaultFontSize); __isFontInitialized = false; @@ -7292,22 +8220,22 @@ _EditPresenter::SetDefaultFont(void) return r; } -int -_EditPresenter::CalculateFlexibleHeight(void) +float +_EditPresenter::CalculateFlexibleHeightF(void) { - int height = 0; - int expectedEditHeight = __pTextObject->GetTotalHeight() + __verticalMargin; + float height = 0.0f; + float expectedEditHeight = __pTextObject->GetTotalHeightF() + __verticalMargin; int lineCount = __pTextObject->GetTotalLineCount(); if (__pTextObject->GetTotalHeight()) { if ((lineCount >= MAX_LINE_NUMBER) && (GetMaxLineCount() > MAX_LINE_NUMBER)) { - height = MAX_LINE_NUMBER * __pTextObject->GetLineHeightAt(0) + __verticalMargin; + height = MAX_LINE_NUMBER * __pTextObject->GetLineHeightAtF(0) + __verticalMargin; return height; } - int maxHeight = CalculateMaximumFlexibleHeight(); + float maxHeight = CalculateMaximumFlexibleHeight(); if (expectedEditHeight >= maxHeight) { @@ -7330,6 +8258,44 @@ _EditPresenter::CalculateFlexibleHeight(void) return height; } +int +_EditPresenter::CalculateFlexibleHeight(void) +{ + int height = 0; + int expectedEditHeight = __pTextObject->GetTotalHeight() + _CoordinateSystemUtils::ConvertToInteger(__verticalMargin); + int lineCount = __pTextObject->GetTotalLineCount(); + + if (__pTextObject->GetTotalHeight()) + { + if ((lineCount >= MAX_LINE_NUMBER) && (GetMaxLineCount() > MAX_LINE_NUMBER)) + { + height = MAX_LINE_NUMBER * __pTextObject->GetLineHeightAt(0) + _CoordinateSystemUtils::ConvertToInteger(__verticalMargin); + return height; + } + + int maxHeight = _CoordinateSystemUtils::ConvertToInteger(CalculateMaximumFlexibleHeight()); + + if (expectedEditHeight >= maxHeight) + { + height = maxHeight; + } + else if (expectedEditHeight < _CoordinateSystemUtils::ConvertToInteger(__initialBounds.height)) + { + height = _CoordinateSystemUtils::ConvertToInteger(__initialBounds.height); + } + else + { + height = expectedEditHeight; + } + } + else + { + height = _CoordinateSystemUtils::ConvertToInteger(__initialBounds.height); + } + + return height; +} + result _EditPresenter::AdjustFlexibleHeight(void) { @@ -7347,20 +8313,20 @@ _EditPresenter::AdjustFlexibleHeight(void) __pTextObject->Compose(); - if (__prevTotalTextHeight == __pTextObject->GetTotalHeight()) // if text height has not changed. + if (__prevTotalTextHeight == __pTextObject->GetTotalHeightF()) // if text height has not changed. { - __prevTotalTextHeight = __pTextObject->GetTotalHeight(); + __prevTotalTextHeight = __pTextObject->GetTotalHeightF(); return E_SYSTEM; } // get edit height - Rectangle bounds = __pEdit->GetBounds(); - int calculateHeight = CalculateFlexibleHeight(); + FloatRectangle bounds = __pEdit->GetBoundsF(); + float calculateHeight = CalculateFlexibleHeight(); if (bounds.height != calculateHeight) { bounds.height = calculateHeight; - __prevTotalTextHeight = __pTextObject->GetTotalHeight(); + __prevTotalTextHeight = __pTextObject->GetTotalHeightF(); return SetFlexBounds(bounds); } __prevTotalTextHeight = __pTextObject->GetTotalHeight(); @@ -7393,7 +8359,7 @@ _EditPresenter::SetFlexBounds(const Rectangle& bounds) __pEdit->Invalidate(); - __prevTotalTextHeight = __pTextObject->GetTotalHeight(); + __prevTotalTextHeight = _CoordinateSystemUtils::ConvertToFloat(__pTextObject->GetTotalHeight()); __pEdit->SendExpandableEditAreaEvent(expandableEditAreaStatus); pVisualElement->SetImplicitAnimationEnabled(false); @@ -7401,11 +8367,45 @@ _EditPresenter::SetFlexBounds(const Rectangle& bounds) return r; } -int +result +_EditPresenter::SetFlexBounds(const FloatRectangle& bounds) +{ + result r = E_SUCCESS; + + _ExpandableEditAreaEventStatus expandableEditAreaStatus = _EXPANDABLE_EDITAREA_EVENT_ADDED; + if (__pEdit->GetBoundsF().height > bounds.height) + { + expandableEditAreaStatus = _EXPANDABLE_EDITAREA_EVENT_REMOVED; + } + else if (__pEdit->GetBoundsF().height < bounds.height) + { + expandableEditAreaStatus = _EXPANDABLE_EDITAREA_EVENT_ADDED; + } + + _VisualElement* pVisualElement = __pEdit->GetVisualElement(); + SysTryReturnResult(NID_UI_CTRL, pVisualElement, E_SYSTEM, "A system error has occurred. Unable to get root visual element."); + + pVisualElement->SetAnimationProvider(__pEditVEDelegator); + pVisualElement->SetImplicitAnimationEnabled(true); + + __pEdit->SetBounds(bounds); + Resize(); + + __pEdit->Invalidate(); + + __prevTotalTextHeight = __pTextObject->GetTotalHeightF(); + __pEdit->SendExpandableEditAreaEvent(expandableEditAreaStatus); + + pVisualElement->SetImplicitAnimationEnabled(false); + + return r; +} + +float _EditPresenter::CalculateMaximumFlexibleHeight(void) { - int maxHeight = __maximumFlexibleHeight; - int expectedEditHeight = __pTextObject->GetTotalHeight() + __verticalMargin; + float maxHeight = __maximumFlexibleHeight; + float expectedEditHeight = __pTextObject->GetTotalHeightF() + __verticalMargin; int maximumFlexibleLineNumber = GetMaxLineCount(); // if height is longer than max height. @@ -7415,9 +8415,9 @@ _EditPresenter::CalculateMaximumFlexibleHeight(void) } else if (maximumFlexibleLineNumber > 0) // if max line number is set. { - maxHeight = maximumFlexibleLineNumber * __pTextObject->GetLineHeightAt(0) + __verticalMargin; + maxHeight = maximumFlexibleLineNumber * __pTextObject->GetLineHeightAtF(0) + __verticalMargin; - Dimension dim = __pEdit->GetMaximumSize(); + FloatDimension dim = __pEdit->GetMaximumSizeF(); if (maxHeight > dim.height) { maxHeight = dim.height; @@ -7430,6 +8430,16 @@ _EditPresenter::CalculateMaximumFlexibleHeight(void) bool _EditPresenter::SetKeypadBounds(const Rectangle& bounds) { + __keypadBounds.x = _CoordinateSystemUtils::ConvertToFloat(bounds.x); + __keypadBounds.y = _CoordinateSystemUtils::ConvertToFloat(bounds.y); + __keypadBounds.width = _CoordinateSystemUtils::ConvertToFloat(bounds.width); + __keypadBounds.height = _CoordinateSystemUtils::ConvertToFloat(bounds.height); + return true; +} + +bool +_EditPresenter::SetKeypadBounds(const FloatRectangle& bounds) +{ __keypadBounds.x = bounds.x; __keypadBounds.y = bounds.y; __keypadBounds.width = bounds.width; @@ -7467,11 +8477,17 @@ _EditPresenter::GetParentForm(void) pForm = dynamic_cast<_Form*>(pControlCore); } - __pParentForm = pForm; + return pForm; } CATCH: - return __pParentForm; + return null; +} + +_ScrollPanel* +_EditPresenter::GetParentPanel(void) const +{ + return __pParentPanel; } result @@ -7542,15 +8558,28 @@ _EditPresenter::RemoveActionEventListener(const _IActionEventListener& listener) result _EditPresenter::SetTextBounds(Rectangle& bounds) { - __textObjectBounds = bounds; + __textObjectBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); return E_SUCCESS; } -Rectangle -_EditPresenter::GetTextBounds(void) const +result +_EditPresenter::SetTextBounds(FloatRectangle& bounds) { - return __textObjectBounds; -} + __textObjectBounds = bounds; + return E_SUCCESS; +} + +FloatRectangle +_EditPresenter::GetTextBoundsF(void) const +{ + return __textObjectBounds; +} + +Rectangle +_EditPresenter::GetTextBounds(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds); +} bool _EditPresenter::IsKeypadCommandButtonVisible(void) const @@ -7580,23 +8609,23 @@ _EditPresenter::DrawScrollBar(void) return E_SYSTEM; } - int totalHeight = __pTextObject->GetTotalHeight(); - int dspHeight = __textObjectBounds.height; - int firstDisplayY = __pTextObject->GetFirstDisplayPositionY(); + float totalHeight = __pTextObject->GetTotalHeightF(); + float dspHeight = __textObjectBounds.height; + float firstDisplayY = __pTextObject->GetFirstDisplayPositionYF(); if (totalHeight <= dspHeight) { - if (__prevTotalTextHeight != 0 && __prevTotalTextHeight == totalHeight) // flexible edit's case + if (__prevTotalTextHeight != 0.0f && __prevTotalTextHeight == totalHeight) // flexible edit's case { return E_SUCCESS; } __pScrollBar->SetScrollRange(1, 1); - __pScrollBar->SetScrollPosition(0); + __pScrollBar->SetScrollPosition(0.0f); __isScrollBarVisible = false; - __previousScrollBarPos = 0; - __previousScrollBarMaxPos = 0; + __previousScrollBarPos = 0.0f; + __previousScrollBarMaxPos = 0.0f; } else { @@ -7609,8 +8638,8 @@ _EditPresenter::DrawScrollBar(void) else { __pScrollBar->SetScrollRange(dspHeight, totalHeight); - __pScrollBar->SetScrollPosition(0); - __previousScrollBarMaxPos = 0; + __pScrollBar->SetScrollPosition(0.0f); + __previousScrollBarMaxPos = 0.0f; } if (__pScrollBar->GetScrollVisibility()) @@ -7681,7 +8710,7 @@ CATCH: } result -_EditPresenter::StartFlickAnimation(const Point& flickPosition, int flickTime) +_EditPresenter::StartFlickAnimation(const FloatPoint& flickPosition, int flickTime) { // delete Scroll Fadeout Timer if (!__pScrollBar) @@ -7699,12 +8728,13 @@ _EditPresenter::StartFlickAnimation(const Point& flickPosition, int flickTime) return E_SYSTEM; } + //We must check the flick animation about float conversion work at later // Initialize flick animation int velocityX = 0; int velocityY = 0; - __pFlickAnimation->CalculateInitializeVelocity(flickPosition.x, flickPosition.y, flickTime, &velocityX, &velocityY); + __pFlickAnimation->CalculateInitializeVelocity(_CoordinateSystemUtils::ConvertToInteger(flickPosition.x), _CoordinateSystemUtils::ConvertToInteger(flickPosition.y), flickTime, &velocityX, &velocityY); if (Math::Abs(flickPosition.x) > Math::Abs(flickPosition.y)) { @@ -7752,6 +8782,8 @@ _EditPresenter::StartFlickTimer(int flickVelocityX, int flickVelocityY) result _EditPresenter::ScrollContentsOnFlick(void) { + //We must check the flick animation about float conversion work at later + if (__pFlickAnimation) { int moveAmountX = 0; @@ -7759,7 +8791,7 @@ _EditPresenter::ScrollContentsOnFlick(void) __pFlickAnimation->CalculateNextMove(&moveAmountX, &moveAmountY); // Scroll process - if (ScrollOnFlick(-moveAmountY)) + if (ScrollOnFlick(_CoordinateSystemUtils::ConvertToFloat(-moveAmountY))) { __pEdit->Invalidate(); @@ -7771,7 +8803,7 @@ _EditPresenter::ScrollContentsOnFlick(void) } bool -_EditPresenter::ScrollOnFlick(int moveDistanceY) +_EditPresenter::ScrollOnFlick(float moveDistanceY) { if (moveDistanceY == 0) { @@ -7858,28 +8890,56 @@ _EditPresenter::SetScrollBarVisible(bool enable) } void -_EditPresenter::SetScrollBarBounds(const Rectangle& bounds) +_EditPresenter::SetScrollBarBounds(const FloatRectangle& bounds) { __scrollBarBounds = bounds; return; } +void +_EditPresenter::SetScrollBarBounds(const Rectangle& bounds) +{ + __scrollBarBounds = _CoordinateSystemUtils::ConvertToFloat(bounds); + + return; +} + +FloatRectangle +_EditPresenter::GetDisplayScrollBoundsF(void) const +{ + return __scrollBarBounds; +} + Rectangle _EditPresenter::GetDisplayScrollBounds(void) const { - return __scrollBarBounds; + return _CoordinateSystemUtils::ConvertToInteger(__scrollBarBounds); +} + +FloatRectangle +_EditPresenter::GetInitialBoundsF(void) const +{ + return __initialBounds; } Rectangle _EditPresenter::GetInitialBounds(void) const { - return __initialBounds; + return _CoordinateSystemUtils::ConvertToInteger(__initialBounds); } void _EditPresenter::SetPreviousScrollBarPosition(int position) { + __previousScrollBarPos = _CoordinateSystemUtils::ConvertToFloat(position); + + return; +} + +void +_EditPresenter::SetPreviousScrollBarPosition(float position) +{ __previousScrollBarPos = position; return; @@ -7888,12 +8948,26 @@ _EditPresenter::SetPreviousScrollBarPosition(int position) int _EditPresenter::GetPreviousScrollPosition(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__previousScrollBarPos); +} + +float +_EditPresenter::GetPreviousScrollPositionF(void) const +{ return __previousScrollBarPos; } void _EditPresenter::SetMaximumPreviousScrollBarPosition(int position) { + __previousScrollBarMaxPos = _CoordinateSystemUtils::ConvertToFloat(position); + + return; +} + +void +_EditPresenter::SetMaximumPreviousScrollBarPosition(float position) +{ __previousScrollBarMaxPos = position; return; @@ -7964,9 +9038,9 @@ _EditPresenter::ScrollPanelToTop(bool show) if (!__pParentPanel) return; - Rectangle editAbsoluteBounds = __pEdit->GetAbsoluteBounds(); - Rectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBounds(); - int scrollPosition = __pParentPanel->GetScrollPosition() + (editAbsoluteBounds.y - panelAbsoluteBounds.y); + FloatRectangle editAbsoluteBounds = __pEdit->GetAbsoluteBoundsF(); + FloatRectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBoundsF(); + float scrollPosition = __pParentPanel->GetScrollPosition() + (editAbsoluteBounds.y - panelAbsoluteBounds.y); __pParentPanel->SetScrollPosition(scrollPosition); @@ -8002,7 +9076,7 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show) result r = E_SUCCESS; - Rectangle absCursorBounds(0, 0, 0, 0); + FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f); r = CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds); if (r != E_SUCCESS) @@ -8010,29 +9084,29 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show) return; } - Rectangle absPanelRect = __pParentPanel->GetAbsoluteBounds(); - int panelHeight = __pParentPanel->GetBounds().height; + FloatRectangle absPanelRect = __pParentPanel->GetAbsoluteBoundsF(); + float panelHeight = __pParentPanel->GetBoundsF().height; - int scrollPosition = __pParentPanel->GetScrollPosition(); - int cursorBoundsY = absCursorBounds.y - absPanelRect.y; + float scrollPosition = __pParentPanel->GetScrollPosition(); + float cursorBoundsY = absCursorBounds.y - absPanelRect.y; - int topYCompared = 0; - int bottomYCompared = panelHeight; + float topYCompared = 0.0f; + float bottomYCompared = panelHeight; if (__textObjectBounds.height < absCursorBounds.height) { absCursorBounds.height = __textObjectBounds.height; } - int upSideGap = topYCompared - cursorBoundsY; - int downSideGap = (upSideGap > 0) ? 0 : cursorBoundsY + absCursorBounds.height - bottomYCompared; + float upSideGap = topYCompared - cursorBoundsY; + float downSideGap = (upSideGap > 0.0f) ? 0.0f : cursorBoundsY + absCursorBounds.height - bottomYCompared; - if (upSideGap > 0 || downSideGap > 0) + if (upSideGap > 0.0f || downSideGap > 0.0f) { - int gap = 0; - int GAP_CORRECTION = __verticalMargin / 2; + float gap = 0.0f; + float GAP_CORRECTION = __verticalMargin / 2.0f; - if (upSideGap > 0) + if (upSideGap > 0.0f) { gap = scrollPosition - (upSideGap + GAP_CORRECTION); } @@ -8069,12 +9143,12 @@ _EditPresenter::SetFocused(void) bool focused = true; if (__pParentPanel) { - if ((__pParentPanel->GetFocused() != __pEdit) && IsFocused() == false) + if ((__pParentPanel->GetFocused() != __pEdit) && IsInternalFocused() == false) { focused = false; } } - else if (IsFocused() == false) + else if (IsInternalFocused() == false) { focused = false; } @@ -8148,7 +9222,6 @@ _EditPresenter::GetTextImageRangeAt(int postion, int& startPosition, int& endPos endPosition = -1; SysTryReturnResult(NID_UI_CTRL, postion >= 0 && postion <= length, E_OUT_OF_RANGE, "[EDIT] The given index is out-of-range."); - SysTryReturnResult(NID_UI_CTRL, postion >0, E_OBJ_NOT_FOUND, "[EDIT] Object is not found at 0."); _Text::TextElement* pTextElement = __pTextObject->GetElementAtTextIndex(postion); const TextSimple* pSimpleText = dynamic_cast (pTextElement); @@ -8203,33 +9276,51 @@ _EditPresenter::InitializeCopyPasteManager(void) __pEdit->Invalidate(); } - __isCopyPastePopupVisible = false; + __isCopyPasteManagerExist = false; __isCopyPastePopupMoving = false; return; } bool -_EditPresenter::IsCopyPastePopupVisible(void) const +_EditPresenter::IsCopyPasteManagerExist(void) const { - return __isCopyPastePopupVisible; + return __isCopyPasteManagerExist; } Rectangle _EditPresenter::GetTextAreaBounds(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__textObjectBounds); +} + +FloatRectangle +_EditPresenter::GetTextAreaBoundsF(void) const +{ return __textObjectBounds; } Rectangle _EditPresenter::GetTitleBounds(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__titleBounds); +} + +FloatRectangle +_EditPresenter::GetTitleBoundsF(void) const +{ return __titleBounds; } Rectangle _EditPresenter::GetClearIconBounds(void) const { + return _CoordinateSystemUtils::ConvertToInteger(__clearIconBounds); +} + +FloatRectangle +_EditPresenter::GetClearIconBoundsF(void) const +{ return __clearIconBounds; } @@ -8263,6 +9354,17 @@ _EditPresenter::IsCopyPastePopup(const _Control& control) const return false; } +bool +_EditPresenter::IsCopyPasteHandle(const _Control& control) const +{ + if (__pCopyPasteManager) + { + return __pCopyPasteManager->IsCopyPasteHandle(control); + } + + return false; +} + void _EditPresenter::SetCursorChangedFlag(bool enabled) { @@ -8317,6 +9419,396 @@ _EditPresenter::PostInternalEvent(const Tizen::Base::String& type) _UiNotificationEvent event(__pEdit->GetHandle(), pArgs); r = _UiEventManager::GetInstance()->PostEvent(event); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Unable to send event"); + + return; +} + +void +_EditPresenter::ReleaseCopyPastePopup(void) +{ + if (__pCopyPasteManager) + { + return __pCopyPasteManager->ReleaseCopyPastePopup(); + } +} + +bool +_EditPresenter::IsCopyPastePopupExist(void) const +{ + if (__pCopyPasteManager) + { + if (__pCopyPasteManager->GetCopyPastePopup()) + { + return true; + } + else + { + return false; + } + } + return false; +} + +bool +_EditPresenter::IsCopyPasteHandleExist(void) const +{ + if (__pCopyPasteManager) + { + return __pCopyPasteManager->IsCopyPasteHandleExist(); + } + return false; +} + +bool +_EditPresenter::IsUnsupportedChracterExist(const KeypadStyle keypadStyle, const Tizen::Base::String& text) +{ + if (!(keypadStyle == KEYPAD_STYLE_NUMBER || keypadStyle == KEYPAD_STYLE_PHONE_NUMBER || keypadStyle == KEYPAD_STYLE_IP_V4)) + { + return false; + } + + const int numberOfCharOnNumOnlyStyle = 10; + const int numberOfCharOnPhoneNumStyle = 13; + const int numberOfCharOnIpStyle = 18; + + const wchar_t* TempKey = null; + const wchar_t characterOnNumOnlyStyle[numberOfCharOnNumOnlyStyle+1] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/, 0}; + const wchar_t characterOnPhoneNumStyle[numberOfCharOnPhoneNumStyle+1] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/, + 0x2a/***/, 0x2b/*+*/, 0x23/*#*/, 0}; + const wchar_t characterOnIPStyle[numberOfCharOnIpStyle+1] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/, + 0x3a/*:*/, 0x2e/*.*/, 0x61/*a*/, 0x62/*b*/, 0x63/*c*/, 0x64/*d*/, 0x65/*e*/, 0x66/*f*/, 0}; + bool isSupportedCharacterExist = false; + int supportedCharacterCount = 0; + + switch (keypadStyle) + { + case KEYPAD_STYLE_NUMBER: + supportedCharacterCount = numberOfCharOnNumOnlyStyle; + TempKey = characterOnNumOnlyStyle; + break; + case KEYPAD_STYLE_PHONE_NUMBER: + supportedCharacterCount = numberOfCharOnPhoneNumStyle; + TempKey = characterOnPhoneNumStyle; + break; + case KEYPAD_STYLE_IP_V4: + supportedCharacterCount = numberOfCharOnIpStyle; + TempKey = characterOnIPStyle; + break; + default: + return false; + } + + if (text.GetLength() < 1) + { + return false; + } + + for (int i = 0; i < text.GetLength(); i++) + { + isSupportedCharacterExist = false; + wchar_t checkChar =0; + if ( text.GetCharAt(i, checkChar) != E_SUCCESS) + { + break; + } + for (int j = 0; j < supportedCharacterCount ; j++) + { + if (TempKey[j] == checkChar) + { + isSupportedCharacterExist = true; + break; + } + } + if (!isSupportedCharacterExist) + { + return true; + } + } + + return false; } +void +_EditPresenter::SetBlockRangeWithShiftArrowkey(_KeyCode keyCode) +{ + int start = 0; + int end = 0; + if (IsBlocked() == true) + { + GetBlockRange(start, end); + switch(keyCode) + { + case _KEY_LEFT: + if (__textBlockMoveLeft) + { + if (start > 0) + { + SetBlockRange(--start, end); + } + } + else + { + if (start < end - 1) + { + SetBlockRange(start, --end); + } + else if (start == end - 1) + { + ReleaseTextBlock(); + SetCursorPosition(start); + } + } + break; + case _KEY_UP: + if (__textBlockMoveLeft) + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(start); + + if (curCursorLine > 0) + { + int offset = start - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine-1); + start = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine-1); + if (offset > textLength) + { + start = firstTextIndex+textLength; + } + SetBlockRange(start, end); + } + } + else + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(end); + + if (curCursorLine > 0) + { + int offset = end - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine-1); + end = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine-1); + if (offset > textLength) + { + end = firstTextIndex+textLength; + } + if (start > end) + { + int temp = start; + start = end; + end = temp; + __textBlockMoveLeft = true; + SetBlockRange(start, end); + } + else if (start == end) + { + ReleaseTextBlock(); + SetCursorPosition(end); + } + else + { + SetBlockRange(start, end); + } + } + } + break; + case _KEY_DOWN: + if (__textBlockMoveLeft) + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(start); + int totalLine = __pTextObject->GetTotalLineCount(); + if (curCursorLine < totalLine - 1) + { + int offset = start - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine+1); + start = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine+1); + if (offset > textLength) + { + start = firstTextIndex+textLength; + } + + if (start > end) + { + int temp = start; + start = end; + end = temp; + __textBlockMoveLeft = false; + SetBlockRange(start, end); + } + else if (start == end) + { + ReleaseTextBlock(); + SetCursorPosition(end); + } + else + { + SetBlockRange(start, end); + } + } + } + else + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(end); + int totalLine = __pTextObject->GetTotalLineCount(); + if (curCursorLine < totalLine - 1) + { + int offset = end - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine+1); + end = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine+1); + if (offset > textLength) + { + end = firstTextIndex+textLength; + } + SetBlockRange(start, end); + } + } + break; + case _KEY_RIGHT: + if (__textBlockMoveLeft) + { + if (start + 1 < end) + { + SetBlockRange(++start, end); + } + else if (start + 1 == end) + { + ReleaseTextBlock(); + SetCursorPosition(end); + } + } + else + { + if (end + 1 <= GetTextLength()) + { + SetBlockRange(start, ++end); + } + } + break; + default: + break; + } + + if (IsBlocked()) + { + if (__textBlockMoveLeft) + { + __pTextObject->SetFirstDisplayLineIndexFromTextIndex(start); + } + SetCursorChangedFlag(!__textBlockMoveLeft); + } + DrawText(); + } + else + { + switch(keyCode) + { + case _KEY_LEFT: + if (__cursorPos > 0) + { + start = __cursorPos - 1; + end = __cursorPos; + SetBlockRange(start, end); + __textBlockMoveLeft = true; + } + break; + case _KEY_UP: + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(__pTextObject->GetCursorIndex()); + + if (curCursorLine > 0) + { + int offset = __cursorPos - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine-1); + start = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine-1); + if (offset > textLength) + { + start = firstTextIndex+textLength; + } + end = __cursorPos; + SetBlockRange(start, end); + __textBlockMoveLeft = true; + } + } + break; + case _KEY_DOWN: + if (GetTextLength() >= __cursorPos + 1) + { + int curCursorLine = __pTextObject->GetLineIndexAtTextIndex(__pTextObject->GetCursorIndex()); + int totalLine = __pTextObject->GetTotalLineCount(); + if (curCursorLine < totalLine - 1) + { + int offset = __cursorPos - __pTextObject->GetFirstTextIndexAt(curCursorLine); + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine+1); + end = offset + firstTextIndex; + int textLength = __pTextObject->GetTextLengthAt(curCursorLine+1); + if (offset > textLength) + { + end = firstTextIndex+textLength; + } + } + else if (curCursorLine == totalLine - 1) + { + int firstTextIndex = __pTextObject->GetFirstTextIndexAt(curCursorLine); + int textLength = __pTextObject->GetTextLengthAt(curCursorLine); + end = firstTextIndex + textLength; + } + start = __cursorPos; + SetBlockRange(start, end); + __textBlockMoveLeft = false; + } + break; + case _KEY_RIGHT: + if (GetTextLength() >= __cursorPos + 1) + { + start = __cursorPos; + end = __cursorPos + 1; + SetBlockRange(start, end); + __textBlockMoveLeft = false; + } + break; + default: + break; + } + DrawText(); + } + if (IsBlocked()) + { + __textBlockMoving = true; + } +} + +void +_EditPresenter::SetEditTextFilter(_IEditTextFilter* pFilter) +{ + __pTextFilter = pFilter; + + return; +} + +bool +_EditPresenter::ValidatePastedText(const String& pastedText, String& replacedText) +{ + bool enable = false; + if (__pTextFilter) + { + enable = __pTextFilter->ValidatePastedText(pastedText, replacedText); + } + + return enable; +} + +void +_EditPresenter::SendOpaqueCommand (const String& command) +{ + if (__pInputConnection) + { + __pInputConnection->SendOpaqueCommand(command); + } + + return; +} + + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_EditTime.cpp b/src/ui/controls/FUiCtrl_EditTime.cpp index 4e97e42..01d0b06 100644 --- a/src/ui/controls/FUiCtrl_EditTime.cpp +++ b/src/ui/controls/FUiCtrl_EditTime.cpp @@ -20,6 +20,8 @@ * @brief This is the implementation file for the _EditTime class. */ +#include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_ResourceManager.h" @@ -33,6 +35,7 @@ using namespace Tizen::Graphics; using namespace Tizen::Base::Runtime; using namespace Tizen::Base; +using namespace Tizen::System; namespace Tizen { namespace Ui { namespace Controls { @@ -43,9 +46,9 @@ _EditTime::_EditTime(void) : __pEditTimePresenter(null) , __pTimeChangeEvent(null) , __pDateTimeBar(null) - , __absoluteBounds(Rectangle()) + , __absoluteBounds(FloatRectangle()) , __title() - , __pAccessibilityTitleElement(null) + , __pAccessibilityEditTimeElement(null) , __pAccessibilityHourElement(null) , __pAccessibilityMinuteElement(null) , __pAccessibilityAmPmElement(null) @@ -54,6 +57,8 @@ _EditTime::_EditTime(void) _EditTime::~_EditTime(void) { + SettingInfo::RemoveSettingEventListener(*this); + delete __pDateTimeBar; __pDateTimeBar = null; @@ -66,10 +71,10 @@ _EditTime::~_EditTime(void) __pTimeChangeEvent = null; } - if (__pAccessibilityTitleElement) + if (__pAccessibilityEditTimeElement) { - __pAccessibilityTitleElement->Activate(false); - __pAccessibilityTitleElement = null; + __pAccessibilityEditTimeElement->Activate(false); + __pAccessibilityEditTimeElement = null; } if (__pAccessibilityHourElement) { @@ -118,12 +123,11 @@ _EditTime::CreateEditTimeN(const String& title) pEditTime->__title = title; } - pEditTime->SetResizable(false); - pContainer = pEditTime->GetAccessibilityContainer(); if (pContainer) { pContainer->Activate(true); + pEditTime->CreateAccessibilityElement(); } pEditTime->AcquireHandle(); @@ -150,6 +154,9 @@ _EditTime::CreateDateTimeBar(void) r = __pDateTimeBar->AddDateTimeChangeEventListener(*this); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + r = SettingInfo::AddSettingEventListener(*this); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + return r; CATCH: @@ -400,44 +407,58 @@ result _EditTime::CalculateDateTimeBarPosition(void) { result r = E_SUCCESS; - Rectangle absoluteBounds; - Rectangle parentBounds; - Rectangle frameBounds; - absoluteBounds = GetAbsoluteBounds(); + float dateTimeBarHeight = 0.0f; + float arrowHeight = 0.0f; + float timeHeight = 0.0f; + float timeBarMargin = 0.0f; + float textHeight = 0.0f; + float titleTimeMargin = 0.0f; + float bottomPosition = 0.0f; + float timeY = 0.0f; + + FloatRectangle absoluteBounds; + FloatRectangle frameBounds; + FloatRectangle parentWindowBounds; + FloatRectangle titleBounds; _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); SysTryReturn(NID_UI_CTRL, (pFrame != null), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get frame instance."); - - _Form* pForm = pFrame->GetCurrentForm(); - SysTryReturn(NID_UI_CTRL, (pForm != null), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get form instance."); + "[E_SYSTEM] A system error has occurred. Failed to get frame instance."); - parentBounds = pForm->GetClientBounds(); - frameBounds = pFrame->GetAbsoluteBounds(); + frameBounds = pFrame->GetAbsoluteBoundsF(); + absoluteBounds = GetAbsoluteBoundsF(); + parentWindowBounds = GetParentWindowBounds(); + titleBounds = __pEditTimePresenter->GetTitleBounds(); - int dateTimeBarHeight = 0; GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, GetOrientation(), dateTimeBarHeight); + GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, GetOrientation(), arrowHeight); + GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, GetOrientation(), timeHeight); + GET_SHAPE_CONFIG(EDITTIME::TIME_BAR_MARGIN, GetOrientation(), timeBarMargin); + GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, GetOrientation(), textHeight); + GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, GetOrientation(), titleTimeMargin); - Rectangle parentWindowBounds = GetParentWindowBounds(); - int bottomMargin = 0; - // DateTimeBar top margin can be used as EditTime's bottom margin. - GET_SHAPE_CONFIG(DATETIMEBAR::TOP_MARGIN, GetOrientation(), bottomMargin); + if (!__title.IsEmpty()) //with title + { + timeY = titleBounds.y + textHeight + titleTimeMargin ; + } + else //without title + { + timeY = (absoluteBounds.height - timeHeight) / 2.0f ; + } - int bottomPosition = 0; - bottomPosition = absoluteBounds.y + absoluteBounds.height + bottomMargin + dateTimeBarHeight; + bottomPosition = absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight + dateTimeBarHeight; GetDateTimeBar()->SetParentWindowBounds(parentWindowBounds); - if (bottomPosition > frameBounds.y + parentBounds.y + parentBounds.height) + if (bottomPosition > frameBounds.y + parentWindowBounds.y + parentWindowBounds.height) //ALIGN_UP { - r = GetDateTimeBar()->SetPositionAndAlignment(Point(parentWindowBounds.x, absoluteBounds.y), DATETIME_BAR_ALIGN_UP); + r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY - timeBarMargin - arrowHeight), DATETIME_BAR_ALIGN_UP); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - else + else //ALIGN_DOWN { - r = GetDateTimeBar()->SetPositionAndAlignment(Point(parentWindowBounds.x, absoluteBounds.y + absoluteBounds.height + bottomMargin), DATETIME_BAR_ALIGN_DOWN); + r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight), DATETIME_BAR_ALIGN_DOWN); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -460,57 +481,48 @@ _EditTime::OnDraw(void) return; } -result -_EditTime::OnAttachedToMainTree(void) +void +_EditTime::CreateAccessibilityElement(void) { - if (likely(!(_AccessibilityManager::IsActivated()))) + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + Rectangle hourBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR)); + Rectangle minuteBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE)); + Rectangle ampmBounds = _CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM)); + + pContainer->AddListener(*this); + if (__pAccessibilityEditTimeElement == null) { - return E_SUCCESS; + __pAccessibilityEditTimeElement = new _AccessibilityElement(true); + __pAccessibilityEditTimeElement->SetBounds(GetClientBounds()); + __pAccessibilityEditTimeElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); + __pAccessibilityEditTimeElement->SetName(L"EditTimeText"); + pContainer->AddElement(*__pAccessibilityEditTimeElement); } - Rectangle hourBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); - Rectangle minuteBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); - Rectangle ampmBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM); - - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if (pContainer) + if (__pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null) { - pContainer->AddListener(*this); - if (__pAccessibilityTitleElement == null) - { - __pAccessibilityTitleElement = new _AccessibilityElement(true); - __pAccessibilityTitleElement->SetBounds(GetBounds()); - __pAccessibilityTitleElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); - pContainer->AddElement(*__pAccessibilityTitleElement); - } - - if (__pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null) - { - String hintText(L"Double tap to edit"); + String hintText(L"Double tap to edit"); - __pAccessibilityHourElement = new _AccessibilityElement(true); - __pAccessibilityHourElement->SetBounds(hourBounds); - __pAccessibilityHourElement->SetTrait(ACCESSIBILITY_TRAITS_HOUR); - __pAccessibilityHourElement->SetHint(hintText); - pContainer->AddElement(*__pAccessibilityHourElement); + __pAccessibilityHourElement = new _AccessibilityElement(true); + __pAccessibilityHourElement->SetBounds(hourBounds); + __pAccessibilityHourElement->SetTrait(ACCESSIBILITY_TRAITS_HOUR); + __pAccessibilityHourElement->SetHint(hintText); + pContainer->AddElement(*__pAccessibilityHourElement); - __pAccessibilityMinuteElement = new _AccessibilityElement(true); - __pAccessibilityMinuteElement->SetBounds(minuteBounds); - __pAccessibilityMinuteElement->SetTrait(ACCESSIBILITY_TRAITS_MINUTE); - __pAccessibilityMinuteElement->SetHint(hintText); - pContainer->AddElement(*__pAccessibilityMinuteElement); + __pAccessibilityMinuteElement = new _AccessibilityElement(true); + __pAccessibilityMinuteElement->SetBounds(minuteBounds); + __pAccessibilityMinuteElement->SetTrait(ACCESSIBILITY_TRAITS_MINUTE); + __pAccessibilityMinuteElement->SetHint(hintText); + pContainer->AddElement(*__pAccessibilityMinuteElement); - if (Is24HourNotationEnabled() == false) - { - __pAccessibilityAmPmElement = new _AccessibilityElement(true); - __pAccessibilityAmPmElement->SetBounds(ampmBounds); - __pAccessibilityAmPmElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pContainer->AddElement(*__pAccessibilityAmPmElement); - } + if (Is24HourNotationEnabled() == false) + { + __pAccessibilityAmPmElement = new _AccessibilityElement(true); + __pAccessibilityAmPmElement->SetBounds(ampmBounds); + __pAccessibilityAmPmElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); + pContainer->AddElement(*__pAccessibilityAmPmElement); } } - - return E_SUCCESS; } void @@ -518,21 +530,21 @@ _EditTime::OnBoundsChanged(void) { __pEditTimePresenter->Initialize(); - if (__pAccessibilityTitleElement) + if (__pAccessibilityEditTimeElement) { - __pAccessibilityTitleElement->SetBounds(__pEditTimePresenter->GetTitleBounds()); + __pAccessibilityEditTimeElement->SetBounds(__pEditTimePresenter->GetTitleBounds()); } if (__pAccessibilityHourElement) { - __pAccessibilityHourElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR)); + __pAccessibilityHourElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR))); } if (__pAccessibilityMinuteElement) { - __pAccessibilityMinuteElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE)); + __pAccessibilityMinuteElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE))); } if (__pAccessibilityAmPmElement) { - __pAccessibilityAmPmElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM)); + __pAccessibilityAmPmElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM))); } return; @@ -541,7 +553,7 @@ _EditTime::OnBoundsChanged(void) void _EditTime::OnChangeLayout(_ControlOrientation orientation) { - __pEditTimePresenter->OnChangeLayout(orientation); + __pEditTimePresenter->Initialize(); if (GetDateTimeBar() != null) { @@ -555,7 +567,7 @@ _EditTime::OnChangeLayout(_ControlOrientation orientation) bool _EditTime::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Rectangle absoluteBounds = GetAbsoluteBounds(); + FloatRectangle absoluteBounds = GetAbsoluteBoundsF(); if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height) { @@ -684,16 +696,27 @@ _EditTime::OnFontInfoRequested(unsigned long& style, int& size) return; } -Rectangle +void +_EditTime::OnSettingChanged(String& key) +{ + __pEditTimePresenter->UpdateTimeFormat(); + Invalidate(); + + return; +} + +FloatRectangle _EditTime::GetParentWindowBounds(void) const { _Form* pForm = null; _Window* pwindow = null; _Control* pControlCore = GetParent(); - Dimension dateTimeBarSize(0, 0); + FloatDimension dateTimeBarSize(0.0f, 0.0f); + GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, GetOrientation(), dateTimeBarSize); - Rectangle parentWindowBounds(0, 0, dateTimeBarSize.width, dateTimeBarSize.height); + + FloatRectangle parentWindowBounds(0.0f, 0.0f, dateTimeBarSize.width, dateTimeBarSize.height); while (true) { @@ -708,7 +731,7 @@ _EditTime::GetParentWindowBounds(void) const pForm = dynamic_cast<_Form*>(pControlCore); if (pForm != null) { - parentWindowBounds = pForm->GetBounds(); + parentWindowBounds = pForm->GetBoundsF(); break; } @@ -716,7 +739,7 @@ _EditTime::GetParentWindowBounds(void) const if (pwindow != null) { - parentWindowBounds = pwindow->GetBounds(); + parentWindowBounds = pwindow->GetBoundsF(); break; } @@ -736,7 +759,7 @@ _EditTime::UpdateAccessibilityElement(void) return; } - if (__pAccessibilityTitleElement == null && __pAccessibilityHourElement == null + if (__pAccessibilityEditTimeElement == null && __pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null && __pAccessibilityAmPmElement == null) { return; @@ -790,7 +813,7 @@ _EditTime::UpdateAccessibilityElement(void) __pAccessibilityAmPmElement->SetHint(hintAmPmText); } - __pAccessibilityTitleElement->SetLabel(string); + __pAccessibilityEditTimeElement->SetLabel(string); __pAccessibilityHourElement->SetLabel(hourString); @@ -814,12 +837,19 @@ _EditTime::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& cont } bool -_EditTime::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_EditTime::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } bool +_EditTime::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + + +bool _EditTime::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; diff --git a/src/ui/controls/FUiCtrl_EditTimeImpl.cpp b/src/ui/controls/FUiCtrl_EditTimeImpl.cpp index 7dd7502..af985bd 100644 --- a/src/ui/controls/FUiCtrl_EditTimeImpl.cpp +++ b/src/ui/controls/FUiCtrl_EditTimeImpl.cpp @@ -22,7 +22,10 @@ #include #include +#include +#include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" @@ -36,45 +39,11 @@ using namespace Tizen::App; namespace Tizen { namespace Ui { namespace Controls { -_EditTimeImpl::EditTimeSizeInfo::EditTimeSizeInfo(void) - : __isTitle(false) -{ -} - -void -_EditTimeImpl::EditTimeSizeInfo::SetTitleStyle(bool titleStyle) -{ - __isTitle = titleStyle; - return; -} - -Dimension -_EditTimeImpl::EditTimeSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - Tizen::Graphics::Dimension dimension(0, 0); - - r = GET_DIMENSION_CONFIG(EDITTIME::DEFAULT_SIZE, orientation, dimension); - - SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] Propagating.", GetErrorMessage(r)); - return dimension; -} - -Dimension -_EditTimeImpl::EditTimeSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - Tizen::Graphics::Dimension dimension(0, 0); - - r = GET_DIMENSION_CONFIG(EDITTIME::DEFAULT_SIZE, orientation, dimension); - - SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] Propagating.", GetErrorMessage(r)); - return dimension; -} _EditTimeImpl::_EditTimeImpl(EditTime* pPublic, _EditTime* pCore) : _ControlImpl(pPublic, pCore) , __pPublicTimeChangeEvent(null) + , __defaultBounds(0.0f, 0.0f, 0.0f, 0.0f) { ClearLastResult(); } @@ -102,13 +71,16 @@ _EditTimeImpl::GetInstance(const EditTime& editTime) return static_cast (editTime._pControlImpl); } - _EditTimeImpl* _EditTimeImpl::CreateEditTimeImplN(EditTime* pControl, const Point& point, const String& title) { + return CreateEditTimeImplFN(pControl, _CoordinateSystemUtils::ConvertToFloat(point), title); +} + +_EditTimeImpl* +_EditTimeImpl::CreateEditTimeImplFN(EditTime* pControl, const FloatPoint& point, const String& title) +{ result r = E_SUCCESS; - Rectangle defaultSize; - bool isTitle = false; _EditTime* pCore = _EditTime::CreateEditTimeN(title); SysTryReturn(NID_UI_CTRL, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -121,16 +93,7 @@ _EditTimeImpl::CreateEditTimeImplN(EditTime* pControl, const Point& point, const r = pCore->AddTimeChangeEventListener(*pImpl); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_SHAPE_CONFIG(EDITTIME::WIDTH, pCore->GetOrientation(), defaultSize.width); - - GET_SHAPE_CONFIG(EDITTIME::HEIGHT, pCore->GetOrientation(), defaultSize.height); - - - defaultSize.x = point.x; - defaultSize.y = point.y; - - r = pImpl->InitializeBoundsProperties(FUNC_SIZE_INFO(EditTime)(isTitle), defaultSize, pCore->GetOrientation()); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + pImpl->SetInitialPosition(point); ClearLastResult(); @@ -171,6 +134,35 @@ _EditTimeImpl::GetCore(void) return static_cast <_EditTime&>(_ControlImpl::GetCore()); } +void +_EditTimeImpl::SetInitialPosition(const FloatPoint& point) +{ + __defaultBounds.x = point.x; + __defaultBounds.y = point.y; + return; +} + +result +_EditTimeImpl::OnAttachedToMainTree(void) +{ + result r = E_SUCCESS; + + int width; + int height; + + GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetCore().GetOrientation(), width); + GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetCore().GetOrientation(),height); + + __defaultBounds.width = _CoordinateSystemUtils::ConvertToFloat(width); + __defaultBounds.height = _CoordinateSystemUtils::ConvertToFloat(height); + + r = InitializeBoundsPropertiesF(GET_SIZE_INFO(EditTime), __defaultBounds, GetCore().GetOrientation()); + + _ControlImpl::OnAttachedToMainTree(); + + return r; +} + result _EditTimeImpl::AddTimeChangeEventListener(ITimeChangeEventListener& listener) { @@ -368,11 +360,11 @@ protected: _UiBuilderControlLayout* pControlProperty = null; EditTime* pEditTime = null; - Point point; + FloatPoint point; Tizen::Base::String elementString; bool titleEnable = false; bool hourNotationEnable = false; - Rectangle rect; + FloatRectangle rect; GetProperty(pControl, &pControlProperty); if (pControlProperty == null) @@ -380,7 +372,7 @@ protected: return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); point.x = rect.x; point.y = rect.y; @@ -419,7 +411,20 @@ protected: pEditTime->Set24HourNotationEnabled(hourNotationEnable); } } - + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pEditTime->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditTimeText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pEditTime; } diff --git a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp index 093f3dd..72b0053 100644 --- a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp @@ -20,10 +20,12 @@ * @brief This is the implementation file for the _EditTimePresenter class. */ +#include #include #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_EditTimePresenter.h" #include "FUiCtrl_EditTime.h" @@ -37,19 +39,21 @@ using namespace Tizen::Graphics; using namespace Tizen::Base; using namespace Tizen::Graphics::_Text; using namespace Tizen::Ui::Animations; +using namespace Tizen::System; namespace Tizen { namespace Ui { namespace Controls { _EditTimePresenter::_EditTimePresenter(const String& title) : __pEditDateTimeModel(null) , __pEditTime(null) - , __bounds(Rectangle()) - , __titleBounds(Rectangle()) + , __bounds(FloatRectangle()) + , __titleBounds(FloatRectangle()) , __ampmString(String()) , __hourString(String()) , __minuteString(String()) , __title(title) , __24hours(false) + , __is24hoursSet(false) , __amEnable(true) , __timePickerEnabled(true) , __selectedId(DATETIME_ID_NONE) @@ -190,6 +194,7 @@ void _EditTimePresenter::Set24HourNotationEnabled(bool enable) { __24hours = enable; + __is24hoursSet = true; return; } @@ -271,23 +276,23 @@ _EditTimePresenter::GetAmEnabled(void) const return __amEnable; } -Rectangle +FloatRectangle _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) const { - SysTryReturn(NID_UI_CTRL, displayBoxId >= DATETIME_ID_HOUR && displayBoxId <= DATETIME_ID_AMPM, Rectangle(), - E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] displayBoxId is out of range."); + SysTryReturn(NID_UI_CTRL, displayBoxId >= DATETIME_ID_HOUR && displayBoxId <= DATETIME_ID_AMPM, FloatRectangle(), + E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] displayBoxId is out of range."); - Rectangle bounds(0, 0, 0, 0); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); - int width = 0; - int colonWidth = 0; - int margin = 0; - int colonMargin = 0; - int timeElementWidth = 0; - int amPmHeight = 0; - int timeHeight = 0; - int titleTimeMargin = 0; - int leftMargin = 0; + float width = 0.0f; + float colonWidth = 0.0f; + float margin = 0.0f; + float colonMargin = 0.0f; + float timeElementWidth = 0.0f; + float amPmHeight = 0.0f; + float timeHeight = 0.0f; + float titleTimeMargin = 0.0f; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(EDITTIME::TIME_WIDTH, __pEditTime->GetOrientation(), width); GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), bounds.height); @@ -300,9 +305,9 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, __pEditTime->GetOrientation(), titleTimeMargin); GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, __pEditTime->GetOrientation(), timeHeight); - if (__pEditTime->GetBounds().height > bounds.height) + if (__pEditTime->GetBoundsF().height > bounds.height) { - bounds.height = __pEditTime->GetBounds().height; + bounds.height = __pEditTime->GetBoundsF().height; } if (!__title.IsEmpty()) @@ -318,7 +323,12 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) } } - bounds.x = leftMargin + ((width - (2 * timeElementWidth + colonWidth + 2 * colonMargin)) / 2); + if (__pEditTime->GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) + { + leftMargin = 0.0f; + } + + bounds.x = leftMargin + ((width - (2.0f * timeElementWidth + colonWidth + 2.0f * colonMargin)) / 2.0f); if (displayBoxId == DATETIME_ID_HOUR) { @@ -326,7 +336,7 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) } else if (displayBoxId == DATETIME_ID_MINUTE) { - bounds.x = bounds.x + timeElementWidth + colonWidth + 2 * colonMargin; + bounds.x = bounds.x + timeElementWidth + colonWidth + 2.0f * colonMargin; bounds.width = timeElementWidth; } else if (displayBoxId == DATETIME_ID_AMPM) @@ -335,7 +345,7 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) if (__title.IsEmpty()) { - bounds.y = bounds.y + (bounds.height - amPmHeight) / 2; + bounds.y = bounds.y + (bounds.height - amPmHeight) / 2.0f; } GET_SHAPE_CONFIG(EDITTIME::AMPM_WIDTH, __pEditTime->GetOrientation(), bounds.width); @@ -350,12 +360,12 @@ _EditTimePresenter::SetTitleBounds(void) { GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), __titleBounds.x); GET_SHAPE_CONFIG(EDITTIME::WIDTH, __pEditTime->GetOrientation(), __titleBounds.width); - GET_SHAPE_CONFIG(EDITTIME::TEXT_HEIGHT, __pEditTime->GetOrientation(), __titleBounds.height); + GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, __pEditTime->GetOrientation(), __titleBounds.height); return; } -Rectangle +FloatRectangle _EditTimePresenter::GetTitleBounds(void) const { return __titleBounds; @@ -404,10 +414,22 @@ _EditTimePresenter::LoadResource(void) SysTryCatch(NID_UI_CTRL, (__pAmPmBgNormalColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + __pAmPmBgDisabledColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonDisabledBgColor); SysTryCatch(NID_UI_CTRL, (__pAmPmBgDisabledColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + __pAmPmBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalPressedColor); SysTryCatch(NID_UI_CTRL, (__pAmPmBgPressedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -450,7 +472,7 @@ CATCH: } result -_EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pBitmap) +_EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap) { result r = E_SUCCESS; @@ -536,17 +558,24 @@ _EditTimePresenter::Draw(void) Canvas* pCanvas = __pEditTime->GetCanvasN(); SysAssertf((pCanvas != null), "Failed to get canvas."); - Rectangle colonBounds; + FloatRectangle colonBounds(0.0f, 0.0f, 0.0f, 0.0f); + int colonWidth = 0; int colonMargin = 0; + int colonHeight = 0; + + float colonMarginF = 0.0f; Dimension textArea; pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle hourBounds(0, 0, 0, 0); - Rectangle minuteBounds(0, 0, 0, 0); - Rectangle ampmBounds(0, 0, 0, 0); + FloatRectangle hourBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle minuteBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle ampmBounds(0.0f, 0.0f, 0.0f, 0.0f); + bool isCustomBitmap = false; + Bitmap* pReplacementBitmap = null; + Bitmap* pEffectBitmap = null; hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); @@ -554,32 +583,32 @@ _EditTimePresenter::Draw(void) if (__24hours == false) { ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM); - } - if (__24hours == false) - { if (!__pEditTime->IsEnabled()) { - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgDisabledColorReplacementBitmap); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectDisabledBitmap); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::BUTTON_BG_DISABLED); + pReplacementBitmap = __pAmPmBgDisabledColorReplacementBitmap; + pEffectBitmap = __pAmPmBgEffectDisabledBitmap; } else if (__selectedId != DATETIME_ID_AMPM) { - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgNormalColorReplacementBitmap); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectNomralBitmap); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::BUTTON_BG_NORMAL); + pReplacementBitmap = __pAmPmBgNormalColorReplacementBitmap; + pEffectBitmap = __pAmPmBgEffectNomralBitmap; } else { - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgPressedColorReplacementBitmap); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::BUTTON_BG_PRESSED); + pReplacementBitmap = __pAmPmBgPressedColorReplacementBitmap; + pEffectBitmap = __pAmPmBgEffectPressedBitmap; + } + + r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectPressedBitmap); + if (!isCustomBitmap) + { + r = DrawResourceBitmap(*pCanvas, ampmBounds, pEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); } } @@ -595,12 +624,16 @@ _EditTimePresenter::Draw(void) SetTimeConversion(); - GET_SHAPE_CONFIG(EDITTIME::COLON_WIDTH, __pEditTime->GetOrientation(), colonBounds.width); + GET_SHAPE_CONFIG(EDITTIME::COLON_WIDTH, __pEditTime->GetOrientation(), colonWidth); GET_SHAPE_CONFIG(EDITTIME::COLON_MARGIN, __pEditTime->GetOrientation(), colonMargin); - GET_SHAPE_CONFIG(EDITTIME::AMPM_HEIGHT, __pEditTime->GetOrientation(), colonBounds.height); + GET_SHAPE_CONFIG(EDITTIME::AMPM_HEIGHT, __pEditTime->GetOrientation(), colonHeight); - colonBounds.x = hourBounds.x + hourBounds.width + colonMargin; - colonBounds.y = hourBounds.y + (hourBounds.height - colonBounds.height) / 2; + colonBounds.width = _CoordinateSystemUtils::ConvertToFloat(colonWidth); + colonMarginF = _CoordinateSystemUtils::ConvertToFloat(colonMargin); + colonBounds.height = _CoordinateSystemUtils::ConvertToFloat(colonHeight); + + colonBounds.x = hourBounds.x + hourBounds.width + colonMarginF; + colonBounds.y = hourBounds.y + (hourBounds.height - colonBounds.height) / 2.0f; if (__title.IsEmpty() == false) { @@ -630,7 +663,7 @@ CATCH: } result -_EditTimePresenter::DrawColon(Canvas& canvas, const Rectangle& bounds) +_EditTimePresenter::DrawColon(Canvas& canvas, const FloatRectangle& bounds) { result r = E_SUCCESS; @@ -671,7 +704,7 @@ _EditTimePresenter::DrawTitle(Canvas& canvas) } result -_EditTimePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const String& text, int textSize) +_EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const String& text, int textSize) { result r = E_SUCCESS; @@ -679,7 +712,7 @@ _EditTimePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const Stri Color textColor; _DateTimeId boxId = DATETIME_ID_NONE; - boxId = GetBoxIdFromPosition(Point(bounds.x + 1, bounds.y)); + boxId = GetBoxIdFromPosition(FloatPoint(bounds.x + 1.0f, bounds.y)); if (!__pEditTime->IsEnabled()) { @@ -714,7 +747,7 @@ _EditTimePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const Stri } } - Rectangle drawAreaBounds(0, 0, 0, 0); + FloatRectangle drawAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); drawAreaBounds = bounds; TextSimple* pSimpleText = null; @@ -745,13 +778,13 @@ _EditTimePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const Stri } _DateTimeId -_EditTimePresenter::GetBoxIdFromPosition(const Point& point) const +_EditTimePresenter::GetBoxIdFromPosition(const FloatPoint& point) const { _DateTimeId displayBoxId = DATETIME_ID_NONE; - Rectangle hourBounds; - Rectangle minuteBounds; - Rectangle ampmBounds; + FloatRectangle hourBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle minuteBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle ampmBounds(0.0f, 0.0f, 0.0f, 0.0f); hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); @@ -807,9 +840,9 @@ _EditTimePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou __touchMoveHandled = false; - Rectangle hourBounds(0, 0, 0, 0); - Rectangle minuteBounds(0, 0, 0, 0); - Rectangle ampmBounds(0, 0, 0, 0); + FloatRectangle hourBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle minuteBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle ampmBounds(0.0f, 0.0f, 0.0f, 0.0f); hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); @@ -819,7 +852,7 @@ _EditTimePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM); } - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point = touchinfo.GetCurrentPosition(); _DateTimeId boxId = GetBoxIdFromPosition(point); @@ -913,14 +946,18 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to return false; } - Rectangle bounds = __pEditTime->GetBounds(); + FloatRectangle bounds = __pEditTime->GetBoundsF(); + + FloatPoint startPoint(0.0f, 0.0f); - Point startPoint(0, 0); - GET_SHAPE_CONFIG(EDITTIME::TEXT_HEIGHT, __pEditTime->GetOrientation(), startPoint.y); + int titleHeight = 0; + GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, __pEditTime->GetOrientation(), titleHeight); - __bounds = Rectangle(startPoint.x, startPoint.y, bounds.width, bounds.height); + startPoint.y = _CoordinateSystemUtils::ConvertToFloat(titleHeight); - Point point = touchinfo.GetCurrentPosition(); + __bounds = FloatRectangle(startPoint.x, startPoint.y, bounds.width, bounds.height); + + FloatPoint point = touchinfo.GetCurrentPosition(); _DateTimeId boxId = GetBoxIdFromPosition(point); @@ -953,10 +990,12 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to } } __lastSelectedValue.Format(10, L"%02d", hours); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } else if (GetLastSelectedId() == DATETIME_ID_MINUTE) { __lastSelectedValue.Format(10, L"%02d", GetMinute()); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } if (GetLastSelectedId() == DATETIME_ID_AMPM) @@ -964,16 +1003,17 @@ _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to SetAmEnabled(!GetAmEnabled()); __pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED); __pEditTime->UpdateAccessibilityElement(); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } __pEditTime->Draw(); if (__pEditTime->GetDateTimeBar() != null && boxId != DATETIME_ID_AMPM && GetLastSelectedId() != DATETIME_ID_NONE) { - Rectangle bounds(0, 0, 0, 0); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); bounds = GetDisplayAreaBoundsFromHoursStyle(GetLastSelectedId()); - Rectangle absoluteBounds = Rectangle(0, 0, 0, 0); - absoluteBounds = __pEditTime->GetAbsoluteBounds(); + FloatRectangle absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f); + absoluteBounds = __pEditTime->GetAbsoluteBoundsF(); bounds.x += absoluteBounds.x; __pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds); @@ -1007,7 +1047,7 @@ _EditTimePresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return false; } - Point touchPoint = touchinfo.GetCurrentPosition(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); if (GetBoxIdFromPosition(touchPoint) != __selectedId) { @@ -1049,25 +1089,6 @@ _EditTimePresenter::OnFontInfoRequested(unsigned long& style, int& size) return; } -void -_EditTimePresenter::OnChangeLayout(_ControlOrientation orientation) -{ - Dimension editTimeSize; - - result r = E_SUCCESS; - - r = GET_DIMENSION_CONFIG(EDITTIME::DEFAULT_SIZE, orientation, editTimeSize); - - if (r == E_SUCCESS && editTimeSize != __pEditTime->GetSize()) - { - __pEditTime->SetResizable(true); - __pEditTime->SetSize(editTimeSize); - __pEditTime->SetResizable(false); - } - - return; -} - result _EditTimePresenter::Initialize(void) { @@ -1077,15 +1098,23 @@ _EditTimePresenter::Initialize(void) int timeHeight = 0; int editTimeHeight = 0; + float fTitleTimeMargin = 0.0f; + float fTimeHeight = 0.0f; + float fEditTimeHeight = 0.0f; + GET_SHAPE_CONFIG(EDITTIME::TEXT_FONT_SIZE, __pEditTime->GetOrientation(), __titleFontSize); GET_SHAPE_CONFIG(EDITTIME::TIME_FONT_SIZE, __pEditTime->GetOrientation(), __timeFontSize); GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, __pEditTime->GetOrientation(), titleTimeMargin); GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, __pEditTime->GetOrientation(), timeHeight); GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), editTimeHeight); - if (__pEditTime->GetBounds().height > editTimeHeight) + fTitleTimeMargin = _CoordinateSystemUtils::ConvertToFloat(titleTimeMargin); + fTimeHeight = _CoordinateSystemUtils::ConvertToFloat(timeHeight); + fEditTimeHeight = _CoordinateSystemUtils::ConvertToFloat(editTimeHeight); + + if (__pEditTime->GetBoundsF().height > fEditTimeHeight) { - editTimeHeight = __pEditTime->GetBounds().height; + fEditTimeHeight = __pEditTime->GetBoundsF().height; } if (__title.IsEmpty() == false) @@ -1097,7 +1126,7 @@ _EditTimePresenter::Initialize(void) SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); } - __titleBounds.y = (editTimeHeight - (__titleBounds.height + titleTimeMargin + timeHeight)) / 2; + __titleBounds.y = (fEditTimeHeight - (__titleBounds.height + fTitleTimeMargin + fTimeHeight)) / 2.0f; __titleObject.SetBounds(__titleBounds); } @@ -1115,10 +1144,25 @@ _EditTimePresenter::Initialize(void) } __isEditTimeInitialized = true; + + UpdateTimeFormat(); return r; } void +_EditTimePresenter::UpdateTimeFormat(void) +{ + + if (!__is24hoursSet) + { + String key(L"http://tizen.org/setting/locale.time.format.24hour"); + SettingInfo::GetValue(key , __24hours); + } + + return; +} + +void _EditTimePresenter::Animate(void) { SysAssertf((__pFont != null), "Font instance must not be null."); @@ -1126,7 +1170,7 @@ _EditTimePresenter::Animate(void) (_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize); result r = E_SUCCESS; - Rectangle rect; + FloatRectangle rect; String hourString; String minuteString; String newValue; @@ -1160,9 +1204,9 @@ _EditTimePresenter::Animate(void) rect = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); } - Dimension newTextDim; - Dimension oldTextDim; - Point textPoint; + FloatDimension newTextDim; + FloatDimension oldTextDim; + FloatPoint textPoint; VisualElement* pNewVisualElement = null; VisualElement* pOldVisualElement = null; VisualElement* pEditTimeElement = null; @@ -1175,11 +1219,11 @@ _EditTimePresenter::Animate(void) if (newTextDim.width > oldTextDim.width) { - textPoint.x = (rect.width - newTextDim.width) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; } else { - textPoint.x = (rect.width - oldTextDim.width) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; } SysTryReturnVoidResult(NID_UI_CTRL, (rect.x + textPoint.x < __pEditTime->GetBounds().width), E_SUCCESS, "Rolling animation cann't be played."); @@ -1231,8 +1275,8 @@ _EditTimePresenter::Animate(void) if (newTextDim.width > oldTextDim.width) { - textPoint.x = (rect.width - newTextDim.width) / 2; - textPoint.y = (rect.height - newTextDim.height) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; + textPoint.y = (rect.height - newTextDim.height) / 2.0f; __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); pNewVisualElement->SetBounds(FloatRectangle(0.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); @@ -1241,15 +1285,15 @@ _EditTimePresenter::Animate(void) rect.width = static_cast(__pContentProvider->GetBounds().width); rect.height = static_cast(__pContentProvider->GetBounds().height); - textPoint.x = (rect.width - oldTextDim.width) / 2; - textPoint.y = (rect.height - oldTextDim.height) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; + textPoint.y = (rect.height - oldTextDim.height) / 2.0f; pOldVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); } else { - textPoint.x = (rect.width - oldTextDim.width) / 2; - textPoint.y = (rect.height - oldTextDim.height) / 2; + textPoint.x = (rect.width - oldTextDim.width) / 2.0f; + textPoint.y = (rect.height - oldTextDim.height) / 2.0f; __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); pOldVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f)); @@ -1258,8 +1302,8 @@ _EditTimePresenter::Animate(void) rect.width = static_cast(__pContentProvider->GetBounds().width); rect.height = static_cast(__pContentProvider->GetBounds().height); - textPoint.x = (rect.width - newTextDim.width) / 2; - textPoint.y = (rect.height - newTextDim.height) / 2; + textPoint.x = (rect.width - newTextDim.width) / 2.0f; + textPoint.y = (rect.height - newTextDim.height) / 2.0f; pNewVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f)); } @@ -1299,7 +1343,7 @@ _EditTimePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); pCanvas->SetFont(*__pFont); - pCanvas->DrawText(Point(0,0),__lastSelectedValue); + pCanvas->DrawText(FloatPoint(0.0f, 0.0f), __lastSelectedValue); delete pCanvas; pCanvas = null; @@ -1311,7 +1355,7 @@ _EditTimePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); pCanvas->SetFont(*__pFont); - pCanvas->DrawText(Point(0,0),newValue); + pCanvas->DrawText(FloatPoint(0.0f, 0.0f), newValue); delete pCanvas; pCanvas = null; @@ -1327,7 +1371,7 @@ _EditTimePresenter::Animate(void) return; -CATCH: + CATCH: __isAnimating = false; __pContentProvider->Destroy(); diff --git a/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp b/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp old mode 100644 new mode 100755 index 1445f26..b00d65d --- a/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp +++ b/src/ui/controls/FUiCtrl_ExpandableEditAreaImpl.cpp @@ -22,14 +22,15 @@ #include #include +#include +#include #include #include "FUi_UiBuilder.h" #include "FUi_ResourceSizeInfo.h" #include "FUiCtrl_Edit.h" #include "FUiCtrl_ExpandableEditAreaImpl.h" #include "FUiCtrl_TokenEdit.h" - -static const int _EXPANDABLE_EDIT_AREA_DEFAULT_MAX_LINE_COUNT = 10; +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -55,7 +56,7 @@ _ExpandableEditAreaImpl::_ExpandableEditAreaImpl(ExpandableEditArea* pPublic, _E , __pExpandableEditArea(pCore) , __expandableEditAreaStyle(EXPANDABLE_EDIT_AREA_STYLE_NORMAL) , __expandableEditAreaTitleStyle(EXPANDABLE_EDIT_AREA_TITLE_STYLE_NONE) - , __maxLineCount(_EXPANDABLE_EDIT_AREA_DEFAULT_MAX_LINE_COUNT) + , __maxLineCount(EXPANDABLE_EDIT_AREA_DEFAULT_MAX_LINE_COUNT) , __pPublicTextEvent(null) , __pPublicExpandableEditAreaEvent(null) , __pPublicTextBlockEvent(null) @@ -91,13 +92,31 @@ _ExpandableEditAreaImpl::~_ExpandableEditAreaImpl(void) _ExpandableEditAreaImpl* _ExpandableEditAreaImpl::CreateExpandableEditAreaImplN(ExpandableEditArea* pControl, const Rectangle& rect, - ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle) + ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle) { ClearLastResult(); result r = E_SUCCESS; - r = FUNC_SIZE_INFO(ExpandableEditArea)().CheckInitialSizeValid(Dimension(rect.width, rect.height), _CONTROL_ORIENTATION_PORTRAIT); + FloatRectangle fRect = _CoordinateSystemUtils::ConvertToFloat(rect); + + _ExpandableEditAreaImpl* pImpl = CreateExpandableEditAreaImplFN(pControl, fRect, style, titleStyle); + r = GetLastResult(); + + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +} + +_ExpandableEditAreaImpl* +_ExpandableEditAreaImpl::CreateExpandableEditAreaImplFN(ExpandableEditArea* pControl, const FloatRectangle& fRect, + ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + r = FUNC_SIZE_INFO(ExpandableEditArea)().CheckInitialSizeValidF(FloatDimension(fRect.width, fRect.height), _CONTROL_ORIENTATION_PORTRAIT); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The given rect size is not valid."); _Edit* pCore = null; @@ -115,7 +134,7 @@ _ExpandableEditAreaImpl::CreateExpandableEditAreaImplN(ExpandableEditArea* pCont r = CheckConstruction(pCore, pImpl); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pImpl->InitializeBoundsProperties(FUNC_SIZE_INFO(ExpandableEditArea)(), _CONTROL_ORIENTATION_PORTRAIT); + r = pImpl->InitializeBoundsPropertiesF(FUNC_SIZE_INFO(ExpandableEditArea)(), fRect, _CONTROL_ORIENTATION_PORTRAIT); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = pCore->AddExpandableEditAreaEventListener(*pImpl); @@ -172,13 +191,29 @@ _ExpandableEditAreaImpl::GetCore(void) result _ExpandableEditAreaImpl::Construct(const Rectangle& rect, ExpandableEditAreaStyle style, - ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines) + ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines) { ClearLastResult(); result r = E_SUCCESS; - r = CreateExpandableEditArea(rect, style, titleStyle, maxExpandableLines); + FloatRectangle fRect = _CoordinateSystemUtils::ConvertToFloat(rect); + + r = CreateExpandableEditArea(fRect, style, titleStyle, maxExpandableLines); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + return r; +} + +result +_ExpandableEditAreaImpl::Construct(const FloatRectangle& fRect, ExpandableEditAreaStyle style, + ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + r = CreateExpandableEditArea(fRect, style, titleStyle, maxExpandableLines); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); return r; @@ -201,8 +236,8 @@ _ExpandableEditAreaImpl::Dispose(void) } result -_ExpandableEditAreaImpl::CreateExpandableEditArea(const Rectangle& rect, ExpandableEditAreaStyle style, - ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines) +_ExpandableEditAreaImpl::CreateExpandableEditArea(const FloatRectangle& fRect, ExpandableEditAreaStyle style, + ExpandableEditAreaTitleStyle titleStyle, int maxExpandableLines) { ClearLastResult(); @@ -223,7 +258,7 @@ _ExpandableEditAreaImpl::CreateExpandableEditArea(const Rectangle& rect, Expanda editStyle |= EDIT_STYLE_TITLE_TOP; } - r = __pExpandableEditArea->Initialize(editStyle, INPUT_STYLE_OVERLAY, 1000); + r = __pExpandableEditArea->Initialize(editStyle, INPUT_STYLE_OVERLAY, EXPANDABLE_EDIT_AREA_TEXT_LENGTH_MAX); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); __pExpandableEditArea->SetMaxLineCount(maxExpandableLines); @@ -246,13 +281,51 @@ _ExpandableEditAreaImpl::GetMargin(EditMarginType marginType) const } } +float +_ExpandableEditAreaImpl::GetMarginF(EditMarginType marginType) const +{ + ClearLastResult(); + + if (marginType == EDIT_MARGIN_TYPE_VERTICAL) + { + return __pExpandableEditArea->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); + } + else + { + return __pExpandableEditArea->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + } +} result _ExpandableEditAreaImpl::SetMargin(EditMarginType marginType, int margin) { ClearLastResult(); result r = E_SUCCESS; - Variant varMargin(margin); + + if (marginType == EDIT_MARGIN_TYPE_HORIZONTAL) + { + r = __pExpandableEditArea->SetHorizontalMargin(margin, EDIT_TEXT_LEFT_MARGIN); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = __pExpandableEditArea->SetHorizontalMargin(margin, EDIT_TEXT_RIGHT_MARGIN); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = __pExpandableEditArea->SetVerticalMargin(margin, EDIT_TEXT_TOP_MARGIN); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = __pExpandableEditArea->SetVerticalMargin(margin, EDIT_TEXT_BOTTOM_MARGIN); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + return r; +} + +result +_ExpandableEditAreaImpl::SetMargin(EditMarginType marginType, float margin) +{ + ClearLastResult(); + + result r = E_SUCCESS; if (marginType == EDIT_MARGIN_TYPE_HORIZONTAL) { @@ -421,6 +494,14 @@ _ExpandableEditAreaImpl::GetTextSize(void) const return __pExpandableEditArea->GetTextSize(); } +float +_ExpandableEditAreaImpl::GetTextSizeF(void) const +{ + ClearLastResult(); + + return __pExpandableEditArea->GetTextSizeF(); +} + result _ExpandableEditAreaImpl::SetTextSize(int size) { @@ -429,6 +510,14 @@ _ExpandableEditAreaImpl::SetTextSize(int size) return __pExpandableEditArea->SetTextSize(size); } +result +_ExpandableEditAreaImpl::SetTextSize(float size) +{ + ClearLastResult(); + + return __pExpandableEditArea->SetTextSize(size); +} + Color _ExpandableEditAreaImpl::GetColor(EditStatus status) const { @@ -803,20 +892,43 @@ _ExpandableEditAreaImpl::SetGuideTextColor(const Color& color) } int -_ExpandableEditAreaImpl::GetLineSpacing (void) const +_ExpandableEditAreaImpl::GetLineSpacing(void) const { + ClearLastResult(); + return __pExpandableEditArea->GetLineSpacing(); } +float +_ExpandableEditAreaImpl::GetLineSpacingF(void) const +{ + ClearLastResult(); + + return __pExpandableEditArea->GetLineSpacingF(); +} + result -_ExpandableEditAreaImpl::SetLineSpacing (int multiplier, int extra) +_ExpandableEditAreaImpl::SetLineSpacing(int multiplier, int extra) { + ClearLastResult(); + SysTryReturn(NID_UI_CTRL, multiplier >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. multiplier = %d ", multiplier); SysTryReturn(NID_UI_CTRL, extra >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. extra = %d ", extra); return __pExpandableEditArea->SetLineSpacing(DEFAULT_LINE_SPACE * multiplier + extra); } +result +_ExpandableEditAreaImpl::SetLineSpacing(int multiplier, float extra) +{ + ClearLastResult(); + + SysTryReturn(NID_UI_CTRL, multiplier >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. multiplier = %d ", multiplier); + SysTryReturn(NID_UI_CTRL, extra >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. extra = %d ", extra); + + return __pExpandableEditArea->SetLineSpacing(DEFAULT_LINE_SPACE * multiplier + extra); +} + Color _ExpandableEditAreaImpl::GetTitleTextColor(EditStatus status) const { @@ -957,11 +1069,33 @@ _ExpandableEditAreaImpl::GetCurrentLanguage(LanguageCode& language) const } void +_ExpandableEditAreaImpl::SetEditTextFilter(IEditTextFilter* pFilter) +{ + ClearLastResult(); + + __pExpandableEditArea->SetEditTextFilter(pFilter); + + return; +} + +void +_ExpandableEditAreaImpl::SendOpaqueCommand (const String& command) +{ + ClearLastResult(); + + __pExpandableEditArea->SendOpaqueCommand(command); + + return; +} + +void _ExpandableEditAreaImpl::SetKeypadEnabled(bool enable) { ClearLastResult(); __pExpandableEditArea->SetKeypadEnabled(enable); + + return; } bool @@ -1491,7 +1625,7 @@ protected: { result r = E_SUCCESS; - Rectangle rect; + FloatRectangle rect; ExpandableEditArea* pExpandableEditArea = null; _UiBuilderControlLayout* pControlProperty = null; ExpandableEditAreaStyle style = EXPANDABLE_EDIT_AREA_STYLE_NORMAL; @@ -1525,7 +1659,7 @@ protected: return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); if (pControl->GetElement(L"style", elementString)) { @@ -1854,6 +1988,13 @@ protected: r = pExpandableEditArea->SetTokenColor(EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED, color); } + if (pControl->GetElement(L"selectedTokenTextColor", elementString)) + { + opacity = 100; + ConvertStringToColor32(elementString, opacity, color); + r = pExpandableEditArea->SetSelectedTokenTextColor(color); + } + if (pControl->GetElement(L"tokenTextColor", elementString)) { opacity = 100; @@ -1888,7 +2029,20 @@ protected: pExpandableEditArea->SetAutoShrinkModeEnabled(autoShrink); } - + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pExpandableEditArea->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pExpandableEditArea; } }; diff --git a/src/ui/controls/FUiCtrl_ExpandableListData.cpp b/src/ui/controls/FUiCtrl_ExpandableListData.cpp deleted file mode 100644 index 5bef837..0000000 --- a/src/ui/controls/FUiCtrl_ExpandableListData.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** -* @file FUiCtrl_ExpandableListData.cpp -* @brief This is the implementation file for _MainItem, _SubItem & _ExpandableListItemDataProvider class. -* -*/ - -// Includes -#include -#include "FUiCtrl_ExpandableListData.h" -#include "FUiCtrl_ExpandableListImpl.h" -#include "FUiCtrl_CustomListImpl.h" - -using namespace Tizen::Base::Collection; - -namespace Tizen { namespace Ui { namespace Controls -{ - -_MainItem::_MainItem(void) - : isExpanded(false) - , isEnabled(true) - , checkCount(0) - , pCustomItemData(null) -{ -} - -_MainItem::~_MainItem(void) -{ - subItemList.RemoveAll(!isExpanded); - actualSubItemList.RemoveAll(true); -} - - -_SubItem::_SubItem(bool removeItemData) - : isEnabled(true) - , pCustomItemData(null) - , isDeleteNeeded(removeItemData) -{ -} - -_SubItem::~_SubItem(void) -{ - if (isDeleteNeeded) - { - delete pCustomItemData; - pCustomItemData = null; - } -} - - -_ExpandableListItemDataProvider::_ExpandableListItemDataProvider(_ExpandableListImpl* pList) - : __pList(pList) -{ -} - -_ExpandableListItemDataProvider::~_ExpandableListItemDataProvider(void) -{ - -} - -int -_ExpandableListItemDataProvider::GetItemCount(void) -{ - - if (__pList) - { - return __pList->__mainList.GetCount(); - } - - return 0; -} - -ListItemBase* -_ExpandableListItemDataProvider::CreateItem(int index, int itemWidth) -{ - _MainItem* pMainItem = null; - _SubItem* pSubItem = null; - _CustomItemData* pCustomItemData = null; - - pMainItem = dynamic_cast<_MainItem*>(__pList->__mainList.GetAt(index)); - - if (pMainItem!= null) - { - return pCustomItemData = dynamic_cast<_CustomItemData*>(pMainItem->pCustomItemData); - } - - pSubItem = dynamic_cast<_SubItem*>(__pList->__mainList.GetAt(index)); - - if (pSubItem != null) - { - return pCustomItemData = dynamic_cast<_CustomItemData*>(pSubItem->pCustomItemData); - } - - return null; -} - -bool -_ExpandableListItemDataProvider::DeleteItem(int index, ListItemBase* pItem, int itemWidth) -{ - return false; -} - -}}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ExpandableListImpl.cpp b/src/ui/controls/FUiCtrl_ExpandableListImpl.cpp index 94acc7d..2bb1021 100644 --- a/src/ui/controls/FUiCtrl_ExpandableListImpl.cpp +++ b/src/ui/controls/FUiCtrl_ExpandableListImpl.cpp @@ -248,6 +248,74 @@ _ExpandableListItemDataProvider::UpdateItem(int groupIndex, int itemIndex, Table return; } +_ExpandableListArrowBitmap::_ExpandableListArrowBitmap(void) + : __pNormalBitmap(null) + , __pEffectBitmap(null) +{ +} + +_ExpandableListArrowBitmap::~_ExpandableListArrowBitmap(void) +{ +} + +void +_ExpandableListArrowBitmap::SetBitmap(const Bitmap &pNormalBitmap, const Bitmap *pEffectBitmap) +{ + __pNormalBitmap = &pNormalBitmap; + __pEffectBitmap = pEffectBitmap; + + return; +} + +result +_ExpandableListArrowBitmap::OnDraw(void) +{ + SysTryReturn(NID_UI_CTRL, (__pNormalBitmap), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Normal Arrow bitmap is null."); + + result r = E_SUCCESS; + + Canvas* pCanvas = null; + pCanvas = GetCanvasN(); + + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, (pCanvas != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + const Rectangle bounds = GetBounds(); + + if (__pNormalBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, bounds.width, bounds.height), *__pNormalBitmap); + } + else + { + r = pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *__pNormalBitmap); + } + + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + if (__pEffectBitmap != null) + { + if (__pEffectBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, bounds.width, bounds.height), *__pEffectBitmap); + } + + else + { + r = pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *__pEffectBitmap); + } + + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + } + + delete pCanvas; + return E_SUCCESS; + +CATCH: + delete pCanvas; + return E_SYSTEM; +} + _ExpandableListImpl* _ExpandableListImpl::GetInstance(ExpandableList& expandableList) { @@ -264,6 +332,8 @@ _ExpandableListImpl::_ExpandableListImpl(Control* pList, _TableView* pCore) : _ListBaseImpl(pList, pCore) , __pOpenedImage(null) , __pClosedImage(null) + , __pEffectClosedImage(null) + , __pEffectOpenedImage(null) , __pItemProvider(null) , __directDelete(false) , __groupExpandStateList(DeleteExpandStateFlag) @@ -295,6 +365,25 @@ _ExpandableListImpl::~_ExpandableListImpl(void) delete __pItemProvider; __pItemProvider = null; + + delete __pEffectOpenedImage; + __pEffectOpenedImage = null; + + delete __pEffectClosedImage; + __pEffectClosedImage = null; + + delete __pOpenedDisabledImage; + __pOpenedDisabledImage = null; + + delete __pOpenedPressedImage; + __pOpenedPressedImage = null; + + delete __pClosedDisabledImage; + __pClosedDisabledImage = null; + + delete __pClosedPressedImage; + __pClosedPressedImage = null; + } const char* @@ -396,7 +485,8 @@ _ExpandableListImpl::Initialize(void) r = GetCore().AddGroupedTableViewItemEventListener(*this); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); - LoadArrowBitmap(); + r = LoadArrowBitmap(); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); GET_COLOR_CONFIG(LIST::EXPANDABLELIST_SUB_ITEM_BG_COLOR, __subItemBgColor); @@ -409,26 +499,90 @@ _ExpandableListImpl::CreateArrowIcon(int groupIndex) int size = __pOpenedImage->GetWidth(); result r = E_SUCCESS; + bool isEnabled = true; + + isEnabled = IsItemEnabled(groupIndex); + _TableViewGroupItemData* pTableViewGroupItemData = GetTableViewGroupItemAt(groupIndex); SysTryReturnResult(NID_UI_CTRL, pTableViewGroupItemData, E_SYSTEM, "A system error has occurred. Failed to get GroupItemData at %d index.", groupIndex); - Label* pArrowLabel = null; - pArrowLabel = dynamic_cast(pTableViewGroupItemData->GetControl(ARROW_ELEMENT_NAME)); + _ExpandableListArrowBitmap* pArrowIcon = null; + pArrowIcon = dynamic_cast<_ExpandableListArrowBitmap*>(pTableViewGroupItemData->GetControl(ARROW_ELEMENT_NAME)); - if (!pArrowLabel) + if (pArrowIcon == null) { - Label* pArrowLabel = new (std::nothrow) Label(); - SysTryReturn(NID_UI_CTRL, pArrowLabel, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + _ExpandableListArrowBitmap* pArrowIcon = new (std::nothrow) _ExpandableListArrowBitmap(); + SysTryReturn(NID_UI_CTRL, pArrowIcon, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - r = pArrowLabel->Construct(Rectangle((GetCore().GetBounds().width - (size + _EXPANDABLE_ARROW_X_POSITION)), _EXPANDABLE_ARROW_Y_POSITION, size, size), L""); + r = pArrowIcon->Construct(Rectangle((GetCore().GetBounds().width - (size + _EXPANDABLE_ARROW_X_POSITION)), _EXPANDABLE_ARROW_Y_POSITION, size, size), GROUP_STYLE_NONE); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - pArrowLabel->SetName(ARROW_ELEMENT_NAME); - pArrowLabel->SetBackgroundBitmap(*__pOpenedImage); - pArrowLabel->AddTouchEventListener(*this); + pArrowIcon->SetName(ARROW_ELEMENT_NAME); + + Boolean* pIsExpanded = dynamic_cast(const_cast(__groupExpandStateList.GetAt(groupIndex))); + bool isCustomBitmap = false; + if (isEnabled) + { + if (pIsExpanded && pIsExpanded->ToBool()) + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_EXPAND_GROUP); + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pClosedImage); + } + else + { + pArrowIcon->SetBitmap(*__pClosedImage, __pEffectClosedImage); + } + } + else + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_COLLAPSE_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pOpenedImage); + } + else + { + pArrowIcon->SetBitmap(*__pOpenedImage, __pEffectOpenedImage); + } - pTableViewGroupItemData->AddControl(*pArrowLabel); - pTableViewGroupItemData->SetIndividualSelectionEnabled(pArrowLabel, true); + } + } + else + { + if (pIsExpanded && pIsExpanded->ToBool()) + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_EXPAND_GROUP); + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pClosedDisabledImage); + } + else + { + pArrowIcon->SetBitmap(*__pClosedDisabledImage, __pEffectClosedImage); + } + } + else + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_COLLAPSE_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pOpenedDisabledImage); + } + else + { + pArrowIcon->SetBitmap(*__pOpenedDisabledImage, __pEffectOpenedImage); + } + } + } + + pArrowIcon->AddTouchEventListener(*this); + + pTableViewGroupItemData->AddControl(*pArrowIcon); + pTableViewGroupItemData->SetIndividualSelectionEnabled(pArrowIcon, true); } return E_SUCCESS; @@ -440,12 +594,18 @@ _ExpandableListImpl::LoadArrowBitmap(void) result r = E_SUCCESS; Bitmap* pTempBitmap = null; Color normalColor; + Color disabledColor; + Color pressedColor; - GET_COLOR_CONFIG(LIST::EXPANDABLELIST_DOWN_AND_UP_ARROW_COLOR, normalColor); + GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_NORMAL, normalColor); + GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_DISABLED, disabledColor); + GET_COLOR_CONFIG(TABLEVIEW::EXPANDABLE_ARROW_PRESSED, pressedColor); r = GET_BITMAP_CONFIG_N(LIST::BUTTON_COLLAPSE_GROUP, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow Bitmap"); __pOpenedImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); + __pOpenedDisabledImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); + __pOpenedPressedImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); delete pTempBitmap; pTempBitmap = null; @@ -453,10 +613,18 @@ _ExpandableListImpl::LoadArrowBitmap(void) r = GET_BITMAP_CONFIG_N(LIST::BUTTON_EXPAND_GROUP, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow Bitmap"); __pClosedImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); + __pClosedDisabledImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); + __pClosedPressedImage = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); delete pTempBitmap; pTempBitmap = null; + r = GET_BITMAP_CONFIG_N(TABLEVIEW::BUTTON_EXPAND_CLOSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectOpenedImage); + SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow effect Bitmap"); + + r = GET_BITMAP_CONFIG_N(TABLEVIEW::BUTTON_EXPAND_OPENED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pEffectClosedImage); + SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to fetch Arrow effect Bitmap"); + return r; } @@ -845,21 +1013,43 @@ _ExpandableListImpl::SetItemExpanded(int mainIndex, bool expand) _TableViewGroupItemData* pTableViewGroupItemData = GetTableViewGroupItemAt(mainIndex); SysTryReturn(NID_UI_CTRL, pTableViewGroupItemData, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get item at %d mainIndex.", mainIndex); - Label* pArrowLabel = dynamic_cast(pTableViewGroupItemData->GetControl(ARROW_ELEMENT_NAME)); - SysTryReturn(NID_UI_CTRL, pArrowLabel, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get arrow icon."); + _ExpandableListArrowBitmap* pArrowIcon = dynamic_cast<_ExpandableListArrowBitmap*>(pTableViewGroupItemData->GetControl(ARROW_ELEMENT_NAME)); + SysTryReturn(NID_UI_CTRL, pArrowIcon, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get arrow icon."); + + bool isCustomBitmap = false; if (expand) { r = GetCore().ExpandGroup(mainIndex); - pArrowLabel->SetBackgroundBitmap(*__pClosedImage); + + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_EXPAND_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pClosedImage); + } + else + { + pArrowIcon->SetBitmap(*__pClosedImage, __pEffectClosedImage); + } } else { r = GetCore().CollapseGroup(mainIndex); - pArrowLabel->SetBackgroundBitmap(*__pOpenedImage); + + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_COLLAPSE_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pOpenedImage); + } + else + { + pArrowIcon->SetBitmap(*__pOpenedImage, __pEffectOpenedImage); + } } - pArrowLabel->Invalidate(true); + pArrowIcon->Invalidate(true); return r; } @@ -1474,7 +1664,6 @@ _ExpandableListImpl::IsItemExpanded(int mainIndex) const SysTryReturn(NID_UI_CTRL, pIsExpanded, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get expanded state at index(%d).", mainIndex); return pIsExpanded->ToBool(); - } return (GetCore().IsGroupExpanded(mainIndex)); @@ -1667,25 +1856,46 @@ _ExpandableListImpl::OnTableViewItemSwept(_TableView& tableView, int groupIndex, void _ExpandableListImpl::OnTouchPressed (const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) { - Label* pArrowLabel = dynamic_cast(const_cast(&source)); + _ExpandableListArrowBitmap* pArrowIcon = dynamic_cast<_ExpandableListArrowBitmap*>(const_cast(&source)); - if (pArrowLabel) + if (pArrowIcon != null) { - _TableViewGroupItemData* pTableViewGroupItemData = dynamic_cast<_TableViewGroupItemData*>(pArrowLabel->GetParent()); + _TableViewGroupItemData* pTableViewGroupItemData = dynamic_cast<_TableViewGroupItemData*>(pArrowIcon->GetParent()); SysTryReturnVoidResult(NID_UI_CTRL, (pTableViewGroupItemData != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get arrow icon."); + bool isCustomBitmap = false; + if (GetCore().IsGroupExpanded(pTableViewGroupItemData->groupIndex)) { GetCore().CollapseGroup(pTableViewGroupItemData->groupIndex); - pArrowLabel->SetBackgroundBitmap(*__pOpenedImage); + + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_COLLAPSE_GROUP); + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pOpenedPressedImage); + } + else + { + pArrowIcon->SetBitmap(*__pOpenedPressedImage, __pEffectOpenedImage); + } } else { GetCore().ExpandGroup(pTableViewGroupItemData->groupIndex); - pArrowLabel->SetBackgroundBitmap(*__pClosedImage); + + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_EXPAND_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pClosedPressedImage); + } + else + { + pArrowIcon->SetBitmap(*__pClosedPressedImage, __pEffectClosedImage); + } } - pArrowLabel->Invalidate(true); + pArrowIcon->Invalidate(true); } else { @@ -1695,10 +1905,57 @@ _ExpandableListImpl::OnTouchPressed (const Control &source, const Point ¤t } void +_ExpandableListImpl::OnTouchReleased (const Control &source, const Point ¤tPosition, const TouchEventInfo &touchInfo) +{ + _ExpandableListArrowBitmap* pArrowIcon = dynamic_cast<_ExpandableListArrowBitmap*>(const_cast(&source)); + + if (pArrowIcon != null) + { + _TableViewGroupItemData* pTableViewGroupItemData = dynamic_cast<_TableViewGroupItemData*>(pArrowIcon->GetParent()); + SysTryReturnVoidResult(NID_UI_CTRL, (pTableViewGroupItemData != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get arrow icon."); + + bool isCustomBitmap = false; + + if (GetCore().IsGroupExpanded(pTableViewGroupItemData->groupIndex)) + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_COLLAPSE_GROUP); + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pClosedImage); + } + else + { + pArrowIcon->SetBitmap(*__pClosedImage, __pEffectClosedImage); + } + } + else + { + isCustomBitmap = IS_CUSTOM_BITMAP(LIST::BUTTON_EXPAND_GROUP); + + if (isCustomBitmap) + { + pArrowIcon->SetBitmap(*__pOpenedImage); + } + else + { + pArrowIcon->SetBitmap(*__pOpenedImage, __pEffectOpenedImage); + } + } + + pArrowIcon->Invalidate(true); + } + else + { + _ListBaseImpl::OnTouchReleased(source, currentPosition, touchInfo); + } + return; +} + +void _ExpandableListImpl::ProcessItemStateChange(int mainIndex, int subIndex, int elementId, ItemStatus itemStatus) { int itemId = -1; - if (subIndex == -1 ) + if (subIndex == -1) { itemId = GetItemIdAt(mainIndex); } @@ -1793,6 +2050,31 @@ _ExpandableListImpl::DeleteExpandStateFlag(Object* pObj) return; } +void +_ExpandableListImpl::OnBoundsChanged(void) +{ + int mainCount = GetGroupCount(); + result r = E_SUCCESS; + + for (int mainIndex = 0; mainIndex < mainCount; mainIndex++) + { + _TableViewGroupItemData* pTableViewGroupItemData = GetTableViewGroupItemAt(mainIndex); + SysTryReturnVoidResult(NID_UI_CTRL, pTableViewGroupItemData, E_SYSTEM, "A system error has occurred. Failed to get GroupItemData at %d index.", mainIndex); + + _ExpandableListArrowBitmap* pArrowLabel = dynamic_cast<_ExpandableListArrowBitmap*>(pTableViewGroupItemData->GetControl(ARROW_ELEMENT_NAME)); + + if (pArrowLabel) + { + pTableViewGroupItemData->RemoveControl(*pArrowLabel); + } + + r = CreateArrowIcon(mainIndex); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to Create Arrow Icon at %d index.", mainIndex); + } + + _ListBaseImpl::OnBoundsChanged(); +} + class _ExpandableListMaker : public _UiBuilderControlMaker { diff --git a/src/ui/controls/FUiCtrl_FastScroll.cpp b/src/ui/controls/FUiCtrl_FastScroll.cpp index b323535..aea5323 100644 --- a/src/ui/controls/FUiCtrl_FastScroll.cpp +++ b/src/ui/controls/FUiCtrl_FastScroll.cpp @@ -43,7 +43,8 @@ public: virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} @@ -257,7 +258,7 @@ _FastScroll::OnFontChanged(Font* pFont) } void -_FastScroll::OnFontInfoRequested(unsigned long& style, int& size) +_FastScroll::OnFontInfoRequested(unsigned long& style, float& size) { GetPresenter().OnFontInfoRequested(style, size); } diff --git a/src/ui/controls/FUiCtrl_FastScrollIndex.cpp b/src/ui/controls/FUiCtrl_FastScrollIndex.cpp index 26c2996..cc89b8e 100644 --- a/src/ui/controls/FUiCtrl_FastScrollIndex.cpp +++ b/src/ui/controls/FUiCtrl_FastScrollIndex.cpp @@ -150,14 +150,19 @@ _FastScrollIndex::SetOmissionIndex(int indexCountMax) int childCount = GetChildCount(); int maxOmissionSlot = (indexCountMax - 1) / 2; int omissionCount = childCount - indexCountMax; - int omittedNum = (omissionCount / maxOmissionSlot) + 1; + int omittedNum = childCount - indexCountMax; + int additionalOmittedNum = 0; + int additionalOmissionStartIndex = 0; + if (maxOmissionSlot > 0) + { + omittedNum = (omissionCount / maxOmissionSlot) + 1; + additionalOmittedNum = (omissionCount % maxOmissionSlot); + additionalOmissionStartIndex = ((maxOmissionSlot - additionalOmittedNum) / 2); + } - int additionalOmittedNum = (omissionCount % maxOmissionSlot); - int additionalOmissionStartIndex = ((maxOmissionSlot - additionalOmittedNum) / 2); int i = 0; int j = 0; result r = E_SUCCESS; - Tizen::Base::String omissionText(L"."); if ((indexCountMax % 2) == 0) diff --git a/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp b/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp index 90233b8..e58b52a 100644 --- a/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp +++ b/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp @@ -42,6 +42,8 @@ #include "FUi_Control.h" #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUiCtrl_IFastScrollListener.h" #include "FUiCtrl_UiFastScrollEvent.h" #include "FUiCtrl_UiFastScrollEventArg.h" @@ -70,40 +72,32 @@ const int FASTSCROLL_POPUPINDEX_COUNT = 3; namespace Tizen { namespace Ui { namespace Controls { -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - - _FastScrollViewConfig::_FastScrollViewConfig(void) : __indexBgColor(Color::GetColor(COLOR_ID_BLACK)) , __indexHighlightColor(Color::GetColor(COLOR_ID_BLACK)) - , __indexLeftLineColor(Color::GetColor(COLOR_ID_BLACK)) + , __indexSelectedLineColor(Color::GetColor(COLOR_ID_BLACK)) , __indexTextColor(Color::GetColor(COLOR_ID_BLACK)) - , __indexSeparatorColor(Color::GetColor(COLOR_ID_BLACK)) + , __indexDividerColor(Color::GetColor(COLOR_ID_BLACK)) , __selectedIndexBgColor(Color::GetColor(COLOR_ID_BLACK)) , __selectedIndexTextColor(Color::GetColor(COLOR_ID_BLACK)) - , __selectedIndexOutlineColor(Color::GetColor(COLOR_ID_BLACK)) , __popupBgColor(Color::GetColor(COLOR_ID_BLACK)) , __popupTextColor(Color::GetColor(COLOR_ID_BLACK)) - , __indexSizeMin(0, 0) - , __popupSize(0, 0) - , __indexMarginRight(0) - , __indexMarginTop(0) - , __indexGap(0) - , __indexLeftLineThickness(0) - , __indexTextSize(0) - , __indexSeparatorThickness(0) - , __selectedIndexMarginRight(0) - , __selectedIndexHeight(0) - , __popupWidthIncrement(0) - , __popupTextSize(0) - , __popupShadowRight(0) - , __popupShadowBottom(0) + , __indexSizeMin(0.0f, 0.0f) + , __popupSize(0.0f, 0.0f) + , __indexMarginTop(0.0f) + , __indexGap(0.0f) + , __indexLeftLineThickness(0.0f) + , __indexTextSize(0.0f) + , __indexSeparatorThickness(0.0f) + , __selectedIndexMarginRight(0.0f) + , __selectedIndexHeight(0.0f) + , __popupWidthIncrement(0.0f) + , __popupTextSize(0.0f) + , __popupShadowRight(0.0f) + , __popupShadowBottom(0.0f) , __pIndexBgBitmap(null) , __pSelectedIndexBgBitmap(null) - , __pSelectedIndexOutlineBitmap(null) + , __pSelectedIndexlineBitmap(null) , __pPopupBgBitmap(null) , __pPopupBgEffectBitmap(null) , __pFont(null) @@ -142,19 +136,19 @@ _FastScrollViewConfig::ReloadConfig(_ControlOrientation orientation) ReleaseResources(); // load bitmap resources - r = GET_BITMAP_CONFIG_N(FASTSCROLL::INDEX_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pIndexBgBitmap); + r = GET_BITMAP_CONFIG_N(FASTSCROLL::INDEX_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pIndexBgBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to load image."); - r = GET_BITMAP_CONFIG_N(FASTSCROLL::SELECTED_INDEX_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pSelectedIndexBgBitmap); + r = GET_BITMAP_CONFIG_N(FASTSCROLL::INDEX_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pSelectedIndexBgBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to load image."); - r = GET_BITMAP_CONFIG_N(FASTSCROLL::SELECTED_INDEX_OUTLINE, BITMAP_PIXEL_FORMAT_ARGB8888, __pSelectedIndexOutlineBitmap); + r = GET_BITMAP_CONFIG_N(FASTSCROLL::INDEX_LINE_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pSelectedIndexlineBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to load image."); - r = GET_BITMAP_CONFIG_N(FASTSCROLL::POPUP_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pPopupBgEffectBitmap); + r = GET_BITMAP_CONFIG_N(FASTSCROLL::POPUP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pPopupBgBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to load image."); - r = GET_BITMAP_CONFIG_N(FASTSCROLL::POPUP_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pPopupBgBitmap); + r = GET_BITMAP_CONFIG_N(FASTSCROLL::POPUP_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pPopupBgEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to load image."); @@ -203,31 +197,28 @@ _FastScrollViewConfig::ReloadConfig(_ControlOrientation orientation) // load color configuration - r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_BAR, __indexBgColor); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - - r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_LEFT_LINE, __indexLeftLineColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_BG_NORMAL, __indexBgColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_BAR_TEXT, __indexTextColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_LINE_PRESSED, __indexSelectedLineColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_SEPARATOR, __indexSeparatorColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_TEXT_NORMAL, __indexTextColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::SELECTED_INDEX_BG, __selectedIndexBgColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_DIVIDER_NORMAL, __indexDividerColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::SELECTED_INDEX_TEXT, __selectedIndexTextColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_BG_PRESSED, __selectedIndexBgColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::SELECTED_INDEX_OUTLINE, __selectedIndexOutlineColor); + r = GET_COLOR_CONFIG(FASTSCROLL::INDEX_TEXT_PRESSED, __selectedIndexTextColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::POPUP_BG, __popupBgColor); + r = GET_COLOR_CONFIG(FASTSCROLL::POPUP_BG_NORMAL, __popupBgColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(FASTSCROLL::POPUP_TEXT, __popupTextColor); + r = GET_COLOR_CONFIG(FASTSCROLL::POPUP_TEXT_NORMAL, __popupTextColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); return E_SUCCESS; @@ -235,28 +226,28 @@ _FastScrollViewConfig::ReloadConfig(_ControlOrientation orientation) CATCH: __indexBgColor = Color::GetColor(COLOR_ID_BLACK); __indexHighlightColor = Color::GetColor(COLOR_ID_BLACK); - __indexLeftLineColor = Color::GetColor(COLOR_ID_BLACK); + __indexSelectedLineColor= Color::GetColor(COLOR_ID_BLACK); __indexTextColor = Color::GetColor(COLOR_ID_BLACK); - __indexSeparatorColor = Color::GetColor(COLOR_ID_BLACK); + __indexDividerColor= Color::GetColor(COLOR_ID_BLACK); __selectedIndexBgColor = Color::GetColor(COLOR_ID_BLACK); __selectedIndexTextColor = Color::GetColor(COLOR_ID_BLACK); - __selectedIndexOutlineColor = Color::GetColor(COLOR_ID_BLACK); __popupBgColor = Color::GetColor(COLOR_ID_BLACK); __popupTextColor = Color::GetColor(COLOR_ID_BLACK); - __indexSizeMin.SetSize(0, 0); - __popupSize.SetSize(0, 0); - - __indexMarginRight = 0; - __indexMarginTop = 0; - __indexGap = 0; - __indexLeftLineThickness = 0; - __indexTextSize = 0; - __indexSeparatorThickness = 0; - __selectedIndexMarginRight = 0; - __selectedIndexHeight = 0; - __popupWidthIncrement = 0; - __popupTextSize = 0; + __indexSizeMin.SetSize(0.0f, 0.0f); + __popupSize.SetSize(0.0f, 0.0f); + + __indexMarginTop = 0.0f; + __indexGap = 0.0f; + __indexLeftLineThickness = 0.0f; + __indexTextSize = 0.0f; + __indexSeparatorThickness = 0.0f; + __selectedIndexMarginRight = 0.0f; + __selectedIndexHeight = 0.0f; + __popupWidthIncrement = 0.0f; + __popupTextSize = 0.0f; + __popupShadowRight = 0.0f; + __popupShadowBottom = 0.0f; ReleaseResources(); @@ -268,13 +259,13 @@ _FastScrollViewConfig::ReleaseResources(void) { delete __pIndexBgBitmap; delete __pSelectedIndexBgBitmap; - delete __pSelectedIndexOutlineBitmap; + delete __pSelectedIndexlineBitmap; delete __pPopupBgBitmap; delete __pPopupBgEffectBitmap; __pIndexBgBitmap = null; __pSelectedIndexBgBitmap = null; - __pSelectedIndexOutlineBitmap = null; + __pSelectedIndexlineBitmap = null; __pPopupBgBitmap = null; __pPopupBgEffectBitmap = null; } @@ -385,18 +376,17 @@ _FastScrollIndexView::GetBaseIndex(void) const } result -_FastScrollIndexView::SetIndexBounds(const Rectangle& indexBounds) +_FastScrollIndexView::SetIndexBounds(const FloatRectangle& indexBounds) { SysTryReturnResult(NID_UI_CTRL, __pSelectedIndexVe, E_INVALID_STATE, "__pSelectedIndexVe must not be null."); FloatRectangle veBounds(indexBounds.x, indexBounds.y, indexBounds.width, indexBounds.height); - __pBaseIndexVe->SetBounds(veBounds); __needUpdateBaseIndex = true; - veBounds.x = 0; - veBounds.y = 0; + veBounds.x = 0.0f; + veBounds.y = 0.0f; __pSelectedIndexVe->SetBounds(veBounds); __needUpdateSelectedIndex = true; @@ -411,48 +401,14 @@ _FastScrollIndexView::GetIndexBounds(void) const return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); } -result -_FastScrollIndexView::SetSelectedBgBounds(const Rectangle& indexBounds) +FloatRectangle +_FastScrollIndexView::GetIndexBoundsF(void) const { - SysTryReturnResult(NID_UI_CTRL, __pSelectedBgVe, E_INVALID_STATE, "__pSelectedBgVe must not be null."); - - FloatRectangle veBounds(indexBounds.x, indexBounds.y, indexBounds.width, indexBounds.height); - __pSelectedBgVe->SetBounds(veBounds); - - return E_SUCCESS; -} - -Rectangle -_FastScrollIndexView::GetSelectedBgBounds(void) const -{ - SysTryReturn(NID_UI_CTRL, __pSelectedBgVe, Rectangle(0, 0, 0, 0), E_INVALID_STATE, "[E_INVALID_STATE] __pSelectedBgVe must not be null."); - - FloatRectangle veBounds = __pSelectedBgVe->GetBounds(); - return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); -} - -result -_FastScrollIndexView::SetSelectedIndexBounds(const Rectangle& indexBounds) -{ - SysTryReturnResult(NID_UI_CTRL, __pSelectedIndexVe, E_INVALID_STATE, "__pSelectedIndexVe must not be null."); - - FloatRectangle veBounds(indexBounds.x, indexBounds.y, indexBounds.width, indexBounds.height); - __pSelectedIndexVe->SetBounds(veBounds); - - return E_SUCCESS; -} - -Rectangle -_FastScrollIndexView::GetSelectedIndexBounds(void) const -{ - SysTryReturn(NID_UI_CTRL, __pSelectedIndexVe, Rectangle(0, 0, 0, 0), E_INVALID_STATE, "[E_INVALID_STATE] __pSelectedIndexVe must not be null."); - - FloatRectangle veBounds = __pSelectedIndexVe->GetBounds(); - return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); + return __pBaseIndexVe->GetBounds(); } _FastScrollIndex* -_FastScrollIndexView::GetIndexAtPoint(const Point& point) const +_FastScrollIndexView::GetIndexAtPoint(const FloatPoint& point) const { SysTryReturn(NID_UI_CTRL, __pBaseIndex, null, E_INVALID_STATE, "[E_INVALID_STATE] __pBaseIndex must not be null."); @@ -461,16 +417,16 @@ _FastScrollIndexView::GetIndexAtPoint(const Point& point) const _FastScrollIndex* pChildIndex = null; - Rectangle bounds = GetIndexBounds(); + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); if (bounds.Contains(point) == true) { - int touchY = point.y - bounds.y - __viewConfig.__indexMarginTop; - int indexHeight = GetIndexHeight(); + float touchY = point.y - bounds.y - __viewConfig.__indexMarginTop; + float indexHeight = GetIndexHeight(); int indexOrder = 0; - if ((touchY != 0) && (indexHeight != 0)) + if (!(_FloatCompare(touchY, 0.0f) || _FloatCompare(indexHeight, 0.0f))) { - indexOrder = touchY / indexHeight; + indexOrder = _CoordinateSystemUtils::ConvertToInteger(touchY / indexHeight); } pChildIndex = __pBaseIndex->GetChildIndex(indexOrder, true); @@ -483,16 +439,16 @@ _FastScrollIndexView::GetIndexAtPoint(const Point& point) const } _FastScrollIndex* -_FastScrollIndexView::GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const Point& point) const +_FastScrollIndexView::GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const FloatPoint& point) const { - Rectangle bounds = GetIndexBounds(); - int touchY = point.y - bounds.y - __viewConfig.__indexMarginTop - (pIndex->GetIndexOrder(true) * GetIndexHeight()); - int indexHeight = GetIndexHeight() / pIndex->GetChildCount(); + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); + float touchY = point.y - bounds.y - __viewConfig.__indexMarginTop - (pIndex->GetIndexOrder(true) * GetIndexHeight()); + float indexHeight = GetIndexHeight() / pIndex->GetChildCount(); int omissionIndexOrder = 0; - if ((touchY != 0) && (indexHeight != 0)) + if (!(_FloatCompare(touchY, 0.0f) || _FloatCompare(indexHeight, 0.0f))) { - omissionIndexOrder = touchY / indexHeight; + omissionIndexOrder = _CoordinateSystemUtils::ConvertToInteger(touchY / indexHeight); } _FastScrollIndex* pChildIndex = pIndex->GetChildIndex(omissionIndexOrder); @@ -503,16 +459,19 @@ _FastScrollIndexView::GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const Po return pChildIndex; } -int +float _FastScrollIndexView::GetIndexHeight(void) const { - Rectangle bounds = GetIndexBounds(); - int indexHeight = __viewConfig.__indexSizeMin.height; + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); + float indexHeight = __viewConfig.__indexSizeMin.height; if (__pBaseIndex->GetParentIndex() == null) { - indexHeight = MAX(indexHeight, - ((bounds.height - __viewConfig.__indexMarginTop * 2) / __pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType()))); + float indexHeightPerChild = (bounds.height - __viewConfig.__indexMarginTop * 2.0f) / (__pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType())); + if (indexHeight < indexHeightPerChild) + { + indexHeight = indexHeightPerChild; + } } return indexHeight; @@ -548,9 +507,7 @@ _FastScrollIndexView::SelectIndex(_FastScrollIndex* pIndex, bool animation) if (__pSelectedIndex) { - r = SetSelectedBgBounds(CalculateSelectedBg()); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to get the canvas of the Selected Bg ve."); - + __pSelectedBgVe->SetBounds(CalculateSelectedBg()); if (GetSelectedIndexVisibility() == false) { r = SetSelectedIndexVisibility(true, animation); @@ -583,6 +540,12 @@ _FastScrollIndexView::GetSelectedIndexOrder(void) const return __pBaseIndex->GetChildOrder(__pSelectedIndex, true); } +void +_FastScrollIndexView::SetSelectedIndex(_FastScrollIndex* pIndex) +{ + __pSelectedIndex = pIndex; +} + _FastScrollIndex* _FastScrollIndexView::GetSelectedIndex(void) const { @@ -709,9 +672,9 @@ _FastScrollIndexView::AddAccessibilityElement(const _AccessibilityContainer& con int omittedChildCount = __pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType()); SysTryReturnResult(NID_UI_CTRL, omittedChildCount > 0, E_INVALID_STATE, "The index have no children."); - Rectangle bounds = GetIndexBounds(); - int indexHeight = GetIndexHeight(); - Rectangle indexRect(bounds.x, __viewConfig.__indexMarginTop, bounds.width, indexHeight); + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); + float indexHeight = GetIndexHeight(); + FloatRectangle indexRect(bounds.x, __viewConfig.__indexMarginTop, bounds.width, indexHeight); int nonOmittedIndex = 0; _AccessibilityElement* pAccessibilityElement = null; @@ -787,43 +750,105 @@ _FastScrollIndexView::UpdateIndex(bool bNeedUpdateBaseIndex) return E_SUCCESS; } -Rectangle +void +_FastScrollIndexView::OnDraw(void) +{ + DrawBaseIndex(); + if (__pSelectedIndex) + { + DrawSelectedBg(); + DrawSelectedIndex(); + } +} + +VisualElementAnimation* +_FastScrollIndexView::CreateAnimationForProperty(VisualElement& target, const String& property) +{ + VisualElementAnimation* pAnimation = VisualElementAnimationProvider::CreateAnimationForProperty(target, property); + + if (pAnimation) + { + const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName("EaseInOut"); + if (pTimingFunction) + { + pAnimation->SetTimingFunction(pTimingFunction); + } + pAnimation->SetVisualElementAnimationStatusEventListener(this); + } + return pAnimation; +} + +void +_FastScrollIndexView::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ +} + +void +_FastScrollIndexView::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ +} + +void +_FastScrollIndexView::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + if (__pBaseIndexVe == (static_cast <_VisualElement*>(&target))) + { + if (__needDestroySelf && completedNormally) + { + if (__pSelectedIndexVe) + { + __pSelectedIndexVe->RemoveAllAnimations(); + __pSelectedIndexVe->SetAnimationProvider(null); + } + + if (__pSelectedBgVe) + { + __pSelectedBgVe->RemoveAllAnimations(); + __pSelectedBgVe->SetAnimationProvider(null); + } + + __pBaseIndexVe->RemoveAllAnimations(); + __pBaseIndexVe->SetAnimationProvider(null); + + delete this; + } + } +} + +FloatRectangle _FastScrollIndexView::CalculateSelectedBg(void) { - SysTryReturn(NID_UI_CTRL, __pBaseIndex, Rectangle(0, 0, 0, 0), E_INVALID_STATE, + SysTryReturn(NID_UI_CTRL, __pBaseIndex, FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), E_INVALID_STATE, "[E_INVALID_STATE] __pBaseIndex must not be null."); - SysTryReturn(NID_UI_CTRL, __pSelectedIndexVe, Rectangle(0, 0, 0, 0), E_INVALID_STATE, + SysTryReturn(NID_UI_CTRL, __pSelectedIndexVe, FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), E_INVALID_STATE, "[E_INVALID_STATE] __pSelectedIndexVe must not be null."); - SysTryReturn(NID_UI_CTRL, __pSelectedIndex, Rectangle(0, 0, 0, 0), E_INVALID_STATE, + SysTryReturn(NID_UI_CTRL, __pSelectedIndex, FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), E_INVALID_STATE, "[E_INVALID_STATE] __pSelectedIndex must not be null."); int childCount = __pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType()); - SysTryReturn(NID_UI_CTRL, childCount > 0, Rectangle(0, 0, 0, 0), E_INVALID_STATE, "[E_INVALID_STATE] The index have no children."); + SysTryReturn(NID_UI_CTRL, childCount > 0, FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), E_INVALID_STATE, "[E_INVALID_STATE] The index have no children."); - Rectangle bounds = GetIndexBounds(); - int indexHeight = GetIndexHeight(); + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); + float indexHeight = GetIndexHeight(); int selectedIndexOrder = GetSelectedIndexOrder(); - Rectangle selectedRect(0, 0, (bounds.width - __viewConfig.__selectedIndexMarginRight), __viewConfig.__selectedIndexHeight); + FloatRectangle selectedRect(0.0f, 0.0f, (bounds.width - __viewConfig.__selectedIndexMarginRight), __viewConfig.__selectedIndexHeight); if (indexHeight > __viewConfig.__selectedIndexHeight) { - selectedRect.y = (selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop * 2; - selectedRect.height = indexHeight - (__viewConfig.__indexMarginTop * 2) ; + selectedRect.y = (selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop * 2.0f; + selectedRect.height = indexHeight - (__viewConfig.__indexMarginTop * 2.0f) ; } - else if (bounds.height <= __viewConfig.__selectedIndexHeight) + else if (_FloatCompare(bounds.height, __viewConfig.__selectedIndexHeight) || (bounds.height < __viewConfig.__selectedIndexHeight)) { selectedRect.height = bounds.height; } else { - if (selectedIndexOrder == (childCount - 1)) + selectedRect.y = ((selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop) - + (__viewConfig.__selectedIndexHeight - indexHeight) / 2.0f; + if (selectedRect.y < __viewConfig.__indexMarginTop) { - selectedRect.y = bounds.height - __viewConfig.__selectedIndexHeight - __viewConfig.__indexMarginTop; - } - else - { - selectedRect.y = ((selectedIndexOrder * indexHeight) + __viewConfig.__indexMarginTop) - (__viewConfig.__selectedIndexHeight - indexHeight) / 2; - selectedRect.y = MAX (selectedRect.y, __viewConfig.__indexMarginTop); + selectedRect.y = __viewConfig.__indexMarginTop; } } @@ -831,28 +856,15 @@ _FastScrollIndexView::CalculateSelectedBg(void) } void -_FastScrollIndexView::OnDraw(void) -{ - DrawBaseIndex(); - if (__pSelectedIndex) - { - DrawSelectedBg(); - DrawSelectedIndex(); - } -} - -void _FastScrollIndexView::DrawBaseIndex() { if (!__needUpdateBaseIndex) { return; } - SysTryReturnVoidResult(NID_UI_CTRL, __pBaseIndex, E_INVALID_STATE, "[E_INVALID_STATE] __pBaseIndex must not be null."); result r = E_SUCCESS; - int childCount = __pBaseIndex->GetChildCount(__pBaseIndex->GetIndexType()); SysTryReturnVoidResult(NID_UI_CTRL, childCount > 0, E_INVALID_STATE, "[E_INVALID_STATE] The index have no children."); @@ -863,14 +875,12 @@ _FastScrollIndexView::DrawBaseIndex() pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - //Draw Seperator pCanvas->SetLineWidth(__viewConfig.__indexSeparatorThickness); - Rectangle bounds = GetIndexBounds(); - int indexHeight = GetIndexHeight(); + FloatRectangle bounds = __pBaseIndexVe->GetBounds(); + float indexHeight = GetIndexHeight(); - //Draw background ef, bitmap - Rectangle bgBounds(0, 0, bounds.width, bounds.height); + FloatRectangle bgBounds(0.0f, 0.0f, bounds.width, bounds.height); if (__viewConfig.__pIndexBgBitmap) { Bitmap* pReplacementColorBackgroundBitmap = @@ -881,7 +891,7 @@ _FastScrollIndexView::DrawBaseIndex() delete pReplacementColorBackgroundBitmap; } - Rectangle indexRect(0, __viewConfig.__indexMarginTop, bounds.width, indexHeight); + FloatRectangle indexRect(0.0f, __viewConfig.__indexMarginTop, bounds.width, indexHeight); Bitmap* pReplacementColorBitmap = null; TextObject* pTextObject = new (std::nothrow) TextObject(); @@ -900,28 +910,32 @@ _FastScrollIndexView::DrawBaseIndex() Bitmap* pChildIndexImage = pChildIndex->GetIndexImage(); if (pChildIndexImage) { - Rectangle imageRect = indexRect; - - float scaleFactor = MIN(((float)indexRect.width / pChildIndexImage->GetWidth()), ((float)indexRect.height / pChildIndexImage->GetHeight())); + FloatRectangle imageRect = indexRect; + float scaleFactor = indexRect.width / pChildIndexImage->GetWidthF(); + float heightScaleFactor = indexRect.height / pChildIndexImage->GetHeightF(); + if (scaleFactor > heightScaleFactor) + { + scaleFactor = heightScaleFactor; + } - imageRect.width = pChildIndexImage->GetWidth() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; - imageRect.height = pChildIndexImage->GetHeight() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; + imageRect.width = pChildIndexImage->GetWidthF() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; + imageRect.height = pChildIndexImage->GetHeightF() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; - if (indexRect.width - imageRect.width > 0) + if (indexRect.width - imageRect.width > 0.0f) { - imageRect.x = indexRect.x + (indexRect.width - imageRect.width)/2; + imageRect.x = indexRect.x + (indexRect.width - imageRect.width) / 2.0f; } - if (indexRect.height - imageRect.height > 0) + if (indexRect.height - imageRect.height > 0.0f) { - imageRect.y = indexRect.y + (indexRect.height - imageRect.height)/2; + imageRect.y = indexRect.y + (indexRect.height - imageRect.height) / 2.0f; } pReplacementColorBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pChildIndexImage, Color::GetColor(COLOR_ID_MAGENTA), __viewConfig.__indexTextColor); r = DrawBitmap(*pCanvas, imageRect, *pReplacementColorBitmap, - Rectangle(0, 0, pChildIndexImage->GetWidth(), pChildIndexImage->GetHeight())); + FloatRectangle(0.0f, 0.0f, pChildIndexImage->GetWidthF(), pChildIndexImage->GetHeightF())); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw a bitmap.", GetErrorMessage(r)); delete pReplacementColorBitmap; @@ -963,9 +977,9 @@ _FastScrollIndexView::DrawBaseIndex() indexRect.y += indexHeight; if (i != (childCount - 1)) { - pCanvas->SetForegroundColor(__viewConfig.__indexSeparatorColor); - pCanvas->DrawLine(Point(indexRect.x, indexRect.y + __viewConfig.__indexSeparatorThickness), - Point(indexRect.x + indexRect.width, indexRect.y + __viewConfig.__indexSeparatorThickness)); + pCanvas->SetForegroundColor(__viewConfig.__indexDividerColor); + pCanvas->DrawLine(FloatPoint(indexRect.x, indexRect.y + __viewConfig.__indexSeparatorThickness), + FloatPoint(indexRect.x + indexRect.width, indexRect.y + __viewConfig.__indexSeparatorThickness)); } } @@ -995,8 +1009,8 @@ _FastScrollIndexView::DrawSelectedBg() pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle bounds = GetSelectedBgBounds(); - bounds.y = 0; + FloatRectangle bounds = __pSelectedBgVe->GetBounds(); + bounds.y = 0.0f; if (__viewConfig.__pSelectedIndexBgBitmap) { @@ -1027,19 +1041,17 @@ _FastScrollIndexView::DrawSelectedIndex() GetErrorMessage(GetLastResult())); result r = E_SUCCESS; - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle bounds = GetSelectedIndexBounds(); + FloatRectangle bounds = __pSelectedIndexVe->GetBounds(); + FloatRectangle outlineBounds = __pSelectedBgVe->GetBounds(); - //draw selected outline - Rectangle outlineBounds = GetSelectedBgBounds(); - if (__viewConfig.__pSelectedIndexOutlineBitmap) + if (__viewConfig.__pSelectedIndexlineBitmap) { Bitmap* pReplacementColorBackgroundBitmap = null; pReplacementColorBackgroundBitmap = - _BitmapImpl::GetColorReplacedBitmapN(*__viewConfig.__pSelectedIndexOutlineBitmap, - Color::GetColor(COLOR_ID_MAGENTA), __viewConfig.__selectedIndexOutlineColor); + _BitmapImpl::GetColorReplacedBitmapN(*__viewConfig.__pSelectedIndexlineBitmap, + Color::GetColor(COLOR_ID_MAGENTA), __viewConfig.__indexSelectedLineColor); DrawBitmap(*pCanvas, outlineBounds, *pReplacementColorBackgroundBitmap); delete pReplacementColorBackgroundBitmap; @@ -1047,45 +1059,49 @@ _FastScrollIndexView::DrawSelectedIndex() //Draw left line pCanvas->SetLineWidth(__viewConfig.__indexLeftLineThickness); - pCanvas->SetForegroundColor(__viewConfig.__indexLeftLineColor); + pCanvas->SetForegroundColor(__viewConfig.__indexSelectedLineColor); - pCanvas->DrawLine(Point(0, 0), Point(0, outlineBounds.y)); - pCanvas->DrawLine(Point(0, (outlineBounds.y + 1 + outlineBounds.height)), Point(0, bounds.height)); + pCanvas->DrawLine(FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, outlineBounds.y)); + pCanvas->DrawLine(FloatPoint(0.0f, (outlineBounds.y + 1.0f + outlineBounds.height)), FloatPoint(0.0f, bounds.height)); //draw text TextObject* pTextObject = null; TextSimple* pSimpleText = null; - int indexHeight = GetIndexHeight(); - Rectangle indexRect(0, ((GetSelectedIndexOrder() * indexHeight) + __viewConfig.__indexMarginTop), + float indexHeight = GetIndexHeight(); + FloatRectangle indexRect(0.0f, ((GetSelectedIndexOrder() * indexHeight) + __viewConfig.__indexMarginTop), bounds.width, indexHeight); Bitmap* pChildIndexImage = __pSelectedIndex->GetIndexImage(); Bitmap* pReplacementColorBitmap = null; if (pChildIndexImage) { - Rectangle imageRect = indexRect; - - float scaleFactor = MIN(((float)indexRect.width / pChildIndexImage->GetWidth()), ((float)indexRect.height / pChildIndexImage->GetHeight())); + FloatRectangle imageRect = indexRect; + float scaleFactor = indexRect.width / pChildIndexImage->GetWidthF(); + float heightScaleFactor = indexRect.height / pChildIndexImage->GetHeightF(); + if (scaleFactor > heightScaleFactor) + { + scaleFactor = heightScaleFactor; + } - imageRect.width = pChildIndexImage->GetWidth() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; - imageRect.height = pChildIndexImage->GetHeight() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; + imageRect.width = pChildIndexImage->GetWidthF() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; + imageRect.height = pChildIndexImage->GetHeightF() * scaleFactor + FASTSCROLL_OPACITY_SELECTEDBG_DIM; - if (indexRect.width - imageRect.width > 0) + if (indexRect.width - imageRect.width > 0.0f) { - imageRect.x = indexRect.x + (indexRect.width - imageRect.width)/2; + imageRect.x = indexRect.x + (indexRect.width - imageRect.width) / 2.0f; } - if (indexRect.height - imageRect.height > 0) + if (indexRect.height - imageRect.height > 0.0f) { - imageRect.y = indexRect.y + (indexRect.height - imageRect.height)/2; + imageRect.y = indexRect.y + (indexRect.height - imageRect.height) / 2.0f; } pReplacementColorBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pChildIndexImage, Color::GetColor(COLOR_ID_MAGENTA), __viewConfig.__selectedIndexTextColor); r = DrawBitmap(*pCanvas, imageRect, *pReplacementColorBitmap, - Rectangle(0, 0, pChildIndexImage->GetWidth(), pChildIndexImage->GetHeight())); + FloatRectangle(0.0f, 0.0f, pChildIndexImage->GetWidthF(), pChildIndexImage->GetHeightF())); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw a bitmap.", GetErrorMessage(r)); delete pReplacementColorBitmap; @@ -1126,7 +1142,6 @@ _FastScrollIndexView::DrawSelectedIndex() SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw text.", GetErrorMessage(r)); } - __needUpdateSelectedIndex = false; //fall through @@ -1137,7 +1152,7 @@ CATCH: } result -_FastScrollIndexView::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitmap& bitmap) +_FastScrollIndexView::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -1155,7 +1170,7 @@ _FastScrollIndexView::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const } result -_FastScrollIndexView::DrawBitmap(Canvas& canvas, const Rectangle& srcRect, const Bitmap& bitmap, const Rectangle& dstRect) +_FastScrollIndexView::DrawBitmap(Canvas& canvas, const FloatRectangle& srcRect, const Bitmap& bitmap, const FloatRectangle& dstRect) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -1172,60 +1187,6 @@ _FastScrollIndexView::DrawBitmap(Canvas& canvas, const Rectangle& srcRect, const return E_SUCCESS; } -VisualElementAnimation* -_FastScrollIndexView::CreateAnimationForProperty(VisualElement& target, const String& property) -{ - VisualElementAnimation* pAnimation = VisualElementAnimationProvider::CreateAnimationForProperty(target, property); - - if (pAnimation) - { - const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName("EaseInOut"); - if (pTimingFunction) - { - pAnimation->SetTimingFunction(pTimingFunction); - } - pAnimation->SetVisualElementAnimationStatusEventListener(this); - } - return pAnimation; -} - -void -_FastScrollIndexView::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) -{ -} - -void -_FastScrollIndexView::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) -{ -} - -void -_FastScrollIndexView::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) -{ - if (__pBaseIndexVe == (static_cast <_VisualElement*>(&target))) - { - if (__needDestroySelf && completedNormally) - { - if (__pSelectedIndexVe) - { - __pSelectedIndexVe->RemoveAllAnimations(); - __pSelectedIndexVe->SetAnimationProvider(null); - } - - if (__pSelectedBgVe) - { - __pSelectedBgVe->RemoveAllAnimations(); - __pSelectedBgVe->SetAnimationProvider(null); - } - - __pBaseIndexVe->RemoveAllAnimations(); - __pBaseIndexVe->SetAnimationProvider(null); - - delete this; - } - } -} - result _FastScrollIndexView::Construct(void) { @@ -1405,24 +1366,24 @@ _FastScrollPopupView::SelectIndex(int indexLevel, _FastScrollIndex* pIndex, _Fas if (selectedOrder > oldOrder) { - _MatrixUtilTranslate(popupVeMatrix, 0, 0, 0); + _MatrixUtilTranslate(popupVeMatrix, 0.0f, 0.0f, 0.0f); } else { - _MatrixUtilTranslate(popupVeMatrix, 0, -(popupVeBounds.height * (FASTSCROLL_POPUPINDEX_COUNT - 1)), 0); + _MatrixUtilTranslate(popupVeMatrix, 0.0f, -(popupVeBounds.height * (FASTSCROLL_POPUPINDEX_COUNT - 1)), 0.0f); } pIndexVe->SetTransformMatrix(popupVeMatrix); pIndexVe->SetImplicitAnimationEnabled(true); popupVeMatrix.SetAsIdentity(); - _MatrixUtilTranslate(popupVeMatrix, 0, -popupVeBounds.height, 0); + _MatrixUtilTranslate(popupVeMatrix, 0.0f, -popupVeBounds.height, 0.0f); pIndexVe->SetTransformMatrix(popupVeMatrix); pIndexVe->SetImplicitAnimationEnabled(false); } else { - _MatrixUtilTranslate(popupVeMatrix, 0, -popupVeBounds.height, 0); + _MatrixUtilTranslate(popupVeMatrix, 0.0f, -popupVeBounds.height, 0.0f); pIndexVe->SetTransformMatrix(popupVeMatrix); } } @@ -1495,26 +1456,15 @@ _FastScrollPopupView::RemovePopupIndexVe(int indexLevel) } result -_FastScrollPopupView::SetPopupBounds(const Rectangle& indexBounds) +_FastScrollPopupView::SetPopupBounds(const FloatRectangle& indexBounds) { SysTryReturnResult(NID_UI_CTRL, __pPopupVe, E_INVALID_STATE, "__pPopupVe must not be null."); - FloatRectangle veBounds(indexBounds.x, indexBounds.y, indexBounds.width, indexBounds.height); - __pPopupVe->SetBounds(veBounds); + __pPopupVe->SetBounds(indexBounds); return E_SUCCESS; } -Rectangle -_FastScrollPopupView::GetPopupBounds(void) const -{ - SysTryReturn(NID_UI_CTRL, __pPopupVe, Rectangle(0, 0, 0, 0), E_INVALID_STATE, - "[E_INVALID_STATE] __pPopupVe must not be null."); - - FloatRectangle veBounds = __pPopupVe->GetBounds(); - return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); -} - result _FastScrollPopupView::SetPopupIndexBounds(int indexLevel, const _FastScrollIndex* pBaseIndex) { @@ -1524,13 +1474,13 @@ _FastScrollPopupView::SetPopupIndexBounds(int indexLevel, const _FastScrollIndex if (pBaseIndex) { - veBounds.x = 0; - veBounds.y = 0; + veBounds.x = 0.0f; + veBounds.y = 0.0f; veBounds.height = veBounds.height * FASTSCROLL_POPUPINDEX_COUNT; } int indexVeCount = GetIndexVeCount(); - int indexWidth = veBounds.width; + float indexWidth = veBounds.width; if (indexVeCount > 0) { indexWidth /= indexVeCount; @@ -1544,17 +1494,6 @@ _FastScrollPopupView::SetPopupIndexBounds(int indexLevel, const _FastScrollIndex return E_SUCCESS; } -Rectangle -_FastScrollPopupView::GetPopupIndexBounds(int indexLevel) const -{ - _VisualElement* pIndexVe = GetIndexVe(indexLevel); - SysTryReturn(NID_UI_CTRL, pIndexVe, Rectangle(0, 0, 0, 0), GetLastResult(), "[%s] Failed to get the popup index view.", - GetErrorMessage(GetLastResult())); - - FloatRectangle veBounds = pIndexVe->GetBounds(); - return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); -} - _VisualElement* _FastScrollPopupView::GetIndexVe(int indexLevel) const { @@ -1637,7 +1576,7 @@ _FastScrollPopupView::UpdateIndex(void) result r = E_SUCCESS; r = __parentVe.InvalidateRectangle(null); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to invaildate the popup Ve."); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to invalidate the popup Ve."); __needUpdatePopupIndexVe = true; @@ -1645,6 +1584,66 @@ _FastScrollPopupView::UpdateIndex(void) } void +_FastScrollPopupView::OnDraw(int indexLevel, const _FastScrollIndex* pBaseIndex, const _FastScrollIndex* pSelectedIndex) +{ + DrawPopupVe(); + DrawPopupIndexVe(indexLevel, pBaseIndex, pSelectedIndex); +} + +VisualElementAnimation* +_FastScrollPopupView::CreateAnimationForProperty(VisualElement& target, const String& property) +{ + VisualElementAnimation* pAnimation = VisualElementAnimationProvider::CreateAnimationForProperty(target, property); + + if (pAnimation) + { + const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName("EaseInOut"); + if (pTimingFunction) + { + pAnimation->SetTimingFunction(pTimingFunction); + } + pAnimation->SetVisualElementAnimationStatusEventListener(this); + } + return pAnimation; +} + +void +_FastScrollPopupView::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ +} + +void +_FastScrollPopupView::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ +} + +void +_FastScrollPopupView::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + SysTryReturnVoidResult(NID_UI_CTRL, __pPopupVe, E_INVALID_STATE, "[E_INVALID_STATE] The popup Ve must not be null."); + if (__pPopupVe == (static_cast <_VisualElement*>(&target))) + { + if (__needDestroySelf && completedNormally) + { + for (int i = 0; i < GetIndexVeCount(); i++) + { + _VisualElement* pIndexVe = GetIndexVe(i); + if (pIndexVe) + { + pIndexVe->RemoveAllAnimations(); + pIndexVe->SetAnimationProvider(null); + } + } + + __pPopupVe->RemoveAllAnimations(); + __pPopupVe->SetAnimationProvider(null); + + delete this; + } + } +} + +void _FastScrollPopupView::DrawPopupVe(void) { if (!__needUpdatePopupVe) @@ -1658,13 +1657,14 @@ _FastScrollPopupView::DrawPopupVe(void) SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, GetLastResult(), "[%s] Failed to get the canvas of the popup ve.", GetErrorMessage(GetLastResult())); - Rectangle bounds = GetPopupBounds(); - bounds.SetPosition(0, 0); + FloatRectangle bounds = __pPopupVe->GetBounds(); + bounds.SetPosition(0.0f, 0.0f); pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + bool isCustomBitmap = IS_CUSTOM_BITMAP(FASTSCROLL::POPUP_BG_NORMAL); - if (__viewConfig.__pPopupBgEffectBitmap) + if (__viewConfig.__pPopupBgEffectBitmap && isCustomBitmap == false) { DrawBitmap(*pCanvas, bounds, *__viewConfig.__pPopupBgEffectBitmap); } @@ -1713,12 +1713,15 @@ _FastScrollPopupView::DrawPopupIndexVe(int indexLevel, const _FastScrollIndex* p pCanvas->Clear(); FloatRectangle veBounds = pIndexVe->GetBounds(); - Rectangle bounds(veBounds.x, veBounds.y, veBounds.width, veBounds.height); + FloatRectangle bounds(veBounds.x, veBounds.y, veBounds.width, veBounds.height); - int indexHeight = bounds.height / FASTSCROLL_POPUPINDEX_COUNT; - indexHeight = MAX(__viewConfig.__popupTextSize, indexHeight); + float indexHeight = bounds.height / FASTSCROLL_POPUPINDEX_COUNT; + if (indexHeight < __viewConfig.__popupTextSize) + { + indexHeight = __viewConfig.__popupTextSize; + } - Rectangle indexRect(0, 0, bounds.width, indexHeight); + FloatRectangle indexRect(0.0f, 0.0f, bounds.width, indexHeight); int selectedOrder = pSelectedIndex->GetIndexOrder(false); Bitmap* pReplacementColorBitmap = null; @@ -1737,30 +1740,37 @@ _FastScrollPopupView::DrawPopupIndexVe(int indexLevel, const _FastScrollIndex* p Bitmap* pChildIndexImage = pChildIndex->GetIndexImage(); if (pChildIndexImage) { - Rectangle imageRect = indexRect; - float widthScale = (float)indexRect.width / pChildIndexImage->GetWidth(); - int rectHeight = MIN(indexRect.height, __viewConfig.__popupTextSize); - float heightScale = (float)rectHeight / pChildIndexImage->GetHeight(); - float scaleFactor = MIN(widthScale, heightScale); + FloatRectangle imageRect = indexRect; + float scaleFactor = indexRect.width / pChildIndexImage->GetWidthF(); + float heightScale = indexRect.height / pChildIndexImage->GetHeightF(); + float rectHeight = indexRect.height; + if (rectHeight > __viewConfig.__popupTextSize) + { + rectHeight = __viewConfig.__popupTextSize; + } - imageRect.width = pChildIndexImage->GetWidth() * scaleFactor; - imageRect.height = pChildIndexImage->GetHeight() * scaleFactor; + if (scaleFactor > heightScale) + { + scaleFactor = heightScale; + } + imageRect.width = pChildIndexImage->GetWidthF() * scaleFactor; + imageRect.height = pChildIndexImage->GetHeightF() * scaleFactor; - if (indexRect.width - imageRect.width > 0) + if (indexRect.width - imageRect.width > 0.0f) { - imageRect.x = indexRect.x + (indexRect.width - imageRect.width)/2; + imageRect.x = indexRect.x + (indexRect.width - imageRect.width) / 2.0f; } - if (indexRect.height - imageRect.height > 0) + if (indexRect.height - imageRect.height > 0.0f) { - imageRect.y = indexRect.y + (indexRect.height - imageRect.height)/2; + imageRect.y = indexRect.y + (indexRect.height - imageRect.height) / 2.0f; } pReplacementColorBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pChildIndexImage, Color::GetColor(COLOR_ID_MAGENTA), __viewConfig.__popupTextColor); r = DrawBitmap(*pCanvas, imageRect, *pReplacementColorBitmap, - Rectangle(0, 0, pChildIndexImage->GetWidth(), pChildIndexImage->GetHeight())); + FloatRectangle(0.0f, 0.0f, pChildIndexImage->GetWidthF(), pChildIndexImage->GetHeightF())); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw a bitmap.", GetErrorMessage(r)); delete pReplacementColorBitmap; @@ -1809,15 +1819,8 @@ CATCH: delete pReplacementColorBitmap; } -void -_FastScrollPopupView::OnDraw(int indexLevel, const _FastScrollIndex* pBaseIndex, const _FastScrollIndex* pSelectedIndex) -{ - DrawPopupVe(); - DrawPopupIndexVe(indexLevel, pBaseIndex, pSelectedIndex); -} - result -_FastScrollPopupView::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitmap& bitmap) +_FastScrollPopupView::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -1835,7 +1838,7 @@ _FastScrollPopupView::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const } result -_FastScrollPopupView::DrawBitmap(Canvas& canvas, const Rectangle& srcRect, const Bitmap& bitmap, const Rectangle& dstRect) +_FastScrollPopupView::DrawBitmap(Canvas& canvas, const FloatRectangle& srcRect, const Bitmap& bitmap, const FloatRectangle& dstRect) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -1852,59 +1855,6 @@ _FastScrollPopupView::DrawBitmap(Canvas& canvas, const Rectangle& srcRect, const return E_SUCCESS; } -VisualElementAnimation* -_FastScrollPopupView::CreateAnimationForProperty(VisualElement& target, const String& property) -{ - VisualElementAnimation* pAnimation = VisualElementAnimationProvider::CreateAnimationForProperty(target, property); - - if (pAnimation) - { - const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName("EaseInOut"); - if (pTimingFunction) - { - pAnimation->SetTimingFunction(pTimingFunction); - } - pAnimation->SetVisualElementAnimationStatusEventListener(this); - } - return pAnimation; -} - -void -_FastScrollPopupView::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) -{ -} - -void -_FastScrollPopupView::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) -{ -} - -void -_FastScrollPopupView::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) -{ - SysTryReturnVoidResult(NID_UI_CTRL, __pPopupVe, E_INVALID_STATE, "[E_INVALID_STATE] The popup Ve must not be null."); - if (__pPopupVe == (static_cast <_VisualElement*>(&target))) - { - if (__needDestroySelf && completedNormally) - { - for (int i = 0; i < GetIndexVeCount(); i++) - { - _VisualElement* pIndexVe = GetIndexVe(i); - if (pIndexVe) - { - pIndexVe->RemoveAllAnimations(); - pIndexVe->SetAnimationProvider(null); - } - } - - __pPopupVe->RemoveAllAnimations(); - __pPopupVe->SetAnimationProvider(null); - - delete this; - } - } -} - result _FastScrollPopupView::Construct(void) { @@ -1936,8 +1886,8 @@ _FastScrollPopupView::Construct(void) __matrixFadeInStart.SetAsIdentity(); __matrixFadeOutEnd.SetAsIdentity(); - _MatrixUtilScale(__matrixFadeInStart, 0.8, 0.8, 1); - _MatrixUtilScale(__matrixFadeOutEnd, 0.1, 0.1, 1); + _MatrixUtilScale(__matrixFadeInStart, 0.8f, 0.8f, 1.0f); + _MatrixUtilScale(__matrixFadeOutEnd, 0.1f, 0.1f, 1.0f); return E_SUCCESS; @@ -1959,7 +1909,7 @@ _FastScrollPresenter::_FastScrollPresenter(_Control& parentCtrl, _FastScroll& fa , __pFastScrollEvent(null) , __pFastScrollModel(null) , __fontStyle(0) - , __fontSize(0) + , __fontSize(0.0f) , __pPopupView(null) , __focusedIndexLevel(0) , __pSelectedIndex(null) @@ -2119,6 +2069,11 @@ _FastScrollPresenter::SetScrollVisibility(bool visibility) return E_SUCCESS; } + if (visibility == false && __pSelectedIndex != null) + { + return E_SUCCESS; + } + __pCtrlVe->RemoveAllAnimations(); if (visibility) { @@ -2312,7 +2267,8 @@ _FastScrollPresenter::OnDraw(void) bool _FastScrollPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - return OnTouchPressedAndMoved(touchinfo.GetCurrentPosition(), true); + FloatPoint touchedPosition = touchinfo.GetCurrentPosition(); + return OnTouchPressedAndMoved(touchedPosition, true); } bool @@ -2324,7 +2280,8 @@ _FastScrollPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& bool _FastScrollPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - return OnTouchPressedAndMoved(touchinfo.GetCurrentPosition(), false); + FloatPoint touchedPosition = touchinfo.GetCurrentPosition(); + return OnTouchPressedAndMoved(touchedPosition, false); } bool @@ -2340,14 +2297,14 @@ _FastScrollPresenter::OnFontChanged(Font* pFont) } void -_FastScrollPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_FastScrollPresenter::OnFontInfoRequested(unsigned long& style, float& size) { style = __fontStyle; size = __fontSize; } result -_FastScrollPresenter::SetFontInfo(unsigned long style, int size) +_FastScrollPresenter::SetFontInfo(unsigned long style, float size) { __fontStyle = style; __fontSize = size; @@ -2410,8 +2367,8 @@ _FastScrollPresenter::HitTest(const Tizen::Graphics::FloatPoint& point) SysTryReturn(NID_UI_CTRL, pIndexView, HIT_TEST_NOWHERE, GetLastResult(), "[%s] Failed to get the index view.", GetErrorMessage(GetLastResult())); - Rectangle indexBounds = pIndexView->GetIndexBounds(); - if (indexBounds.Contains(Point(point.x, point.y)) == true) + FloatRectangle indexBounds = pIndexView->GetIndexBoundsF(); + if (indexBounds.Contains(point) == true) { return HIT_TEST_MATCH; } @@ -2596,7 +2553,8 @@ _FastScrollPresenter::Construct(void) __fastScroll.SetBackgroundColor(Tizen::Graphics::Color(0, 0, 0, 0)); - __indexCountMax = (__fastScroll.GetBounds().height - (__pViewConfig->__indexMarginTop * 2)) / __pViewConfig->__indexSizeMin.height; + __indexCountMax = _CoordinateSystemUtils::ConvertToInteger((__fastScroll.GetBoundsF().height - + (__pViewConfig->__indexMarginTop * 2.0f)) / __pViewConfig->__indexSizeMin.height); return E_SUCCESS; @@ -2610,55 +2568,53 @@ CATCH: return GetLastResult(); } -Rectangle +FloatRectangle _FastScrollPresenter::CalculateFastScrollBounds(int indexCount) { - Rectangle fastScrollBounds(0, 0, 0, 0); - Rectangle parentBounds = __parentCtrl.GetBounds(); + FloatRectangle fastScrollBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle parentBounds = __parentCtrl.GetBoundsF(); fastScrollBounds.width = parentBounds.width; fastScrollBounds.height = parentBounds.height; return fastScrollBounds; } -Rectangle +FloatRectangle _FastScrollPresenter::CalculateIndexBounds(int indexLevel, _FastScrollIndex& pIndex) { - Rectangle indexBounds(0, 0, 0, 0); - Rectangle fastScrollBounds = __fastScroll.GetBounds(); + FloatRectangle fastScrollBounds = __fastScroll.GetBoundsF(); + FloatRectangle indexBounds(0.0f, 0.0f, __pViewConfig->__indexSizeMin.width, fastScrollBounds.height); - indexBounds.x = fastScrollBounds.width; - for (int i = 0; i <= indexLevel; i++) + indexBounds.x = fastScrollBounds.width - __pViewConfig->__indexSizeMin.width; + for (int i = 1; i <= indexLevel; i++) { - if ( i != 0) - { - indexBounds.x -= __pViewConfig->__indexGap; - } - - indexBounds.x -= __pViewConfig->__indexSizeMin.width; + indexBounds.x -= __pViewConfig->__indexGap + __pViewConfig->__indexSizeMin.width; } - indexBounds.x = MAX(indexBounds.x, 0); - indexBounds.y = 0; - indexBounds.width = __pViewConfig->__indexSizeMin.width; - indexBounds.height = fastScrollBounds.height; + if (indexBounds.x < 0.0f) + { + indexBounds.x = 0.0f; + } if (indexLevel != 0) { int childCount = pIndex.GetChildCount(); - indexBounds.height = (childCount * __pViewConfig->__indexSizeMin.height) + (__pViewConfig->__indexMarginTop * 2); + indexBounds.height = (childCount * __pViewConfig->__indexSizeMin.height) + (__pViewConfig->__indexMarginTop * 2.0f); if (indexBounds.height < fastScrollBounds.height) { _FastScrollIndexView* pParentIndexView = GetIndexView(indexLevel - 1); if (pParentIndexView) { - int parentIndexHeight = pParentIndexView->GetIndexHeight(); - Rectangle parentBounds = pParentIndexView->GetIndexBounds(); + FloatRectangle parentBounds = pParentIndexView->GetIndexBoundsF(); - indexBounds.y = parentBounds.y + (pIndex.GetIndexOrder() * parentIndexHeight) - __pViewConfig->__indexMarginTop; - indexBounds.y = MAX(indexBounds.y, fastScrollBounds.y); + indexBounds.y = parentBounds.y + (pIndex.GetIndexOrder() * pParentIndexView->GetIndexHeight()) - __pViewConfig->__indexMarginTop; + if (indexBounds.y < fastScrollBounds.y) + { + indexBounds.y = fastScrollBounds.y; + } - if (indexBounds.y + indexBounds.height >= fastScrollBounds.height) + float totalHeight = indexBounds.y + indexBounds.height; + if (_FloatCompare(totalHeight, fastScrollBounds.height) || (totalHeight > fastScrollBounds.height)) { indexBounds.y = fastScrollBounds.height - indexBounds.height; } @@ -2673,22 +2629,36 @@ _FastScrollPresenter::CalculateIndexBounds(int indexLevel, _FastScrollIndex& pIn return indexBounds; } -Rectangle +FloatRectangle _FastScrollPresenter::CalculatePopupBounds(void) { - Rectangle popupBounds(0, 0, 0, 0); - Rectangle parentBounds = __parentCtrl.GetBounds(); - Rectangle fastScrollBounds = __fastScroll.GetBounds(); - int popupWidth = __pViewConfig->__popupSize.width + (__pViewConfig->__popupWidthIncrement * __focusedIndexLevel); + FloatRectangle popupBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle parentBounds = __parentCtrl.GetBoundsF(); + FloatRectangle fastScrollBounds = __fastScroll.GetBoundsF(); - popupBounds.width = MIN(popupWidth, parentBounds.width); - popupBounds.height = MIN(__pViewConfig->__popupSize.height, parentBounds.height); + popupBounds.width = __pViewConfig->__popupSize.width + (__pViewConfig->__popupWidthIncrement * __focusedIndexLevel); + if (popupBounds.width > parentBounds.width) + { + popupBounds.width = parentBounds.width; + } + + popupBounds.height = __pViewConfig->__popupSize.height; + if (popupBounds.height > parentBounds.height) + { + popupBounds.height = parentBounds.height; + } - popupBounds.x = (parentBounds.width - popupBounds.width) ? ((parentBounds.width - popupBounds.width)/2) : 0; - popupBounds.y = (parentBounds.height - popupBounds.height) ? ((parentBounds.height - popupBounds.height)/2) : 0; + popupBounds.x = ((parentBounds.width - popupBounds.width) / 2.0f) - fastScrollBounds.x; + if (popupBounds.x < 0.0f) + { + popupBounds.x = 0.0f; + } - popupBounds.x -= fastScrollBounds.x; - popupBounds.y -= fastScrollBounds.y; + popupBounds.y = ((parentBounds.height - popupBounds.height) / 2.0f) - fastScrollBounds.y; + if (popupBounds.y < 0.0f) + { + popupBounds.y = 0.0f; + } return popupBounds; } @@ -2704,7 +2674,8 @@ _FastScrollPresenter::RelayoutFastScrollChildren(void) r = __fastScroll.SetBounds(CalculateFastScrollBounds(indexViewCount)); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Failed to set the bounds of _FastScroll", GetErrorMessage(r)); - __indexCountMax = (__fastScroll.GetBounds().height - (__pViewConfig->__indexMarginTop * 2)) / __pViewConfig->__indexSizeMin.height; + __indexCountMax = _CoordinateSystemUtils::ConvertToInteger((__fastScroll.GetBoundsF().height - + (__pViewConfig->__indexMarginTop * 2.0f)) / __pViewConfig->__indexSizeMin.height); for (int i = 0; i < indexViewCount; i++) { @@ -2718,6 +2689,11 @@ _FastScrollPresenter::RelayoutFastScrollChildren(void) _FastScrollIndex* pIndex = pIndexView->GetBaseIndex(); if (pIndex->GetIndexType() == FAST_SCROLL_INDEX_TYPE_OMISSION) { + _FastScrollIndex* pSelectedIndex = pIndexView->GetSelectedIndex(); + if (pSelectedIndex && pSelectedIndex->GetOmitted()) + { + pIndexView->SetSelectedIndex(null); + } r = pIndex->RemoveOmissionChildren(false); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Failed to remove omission index view", GetErrorMessage(r)); } @@ -2740,7 +2716,7 @@ _FastScrollPresenter::RelayoutFastScrollChildren(void) } _FastScrollIndex* -_FastScrollPresenter::SelectOnIndexViews(const Point& point, bool animation) +_FastScrollPresenter::SelectOnIndexViews(const FloatPoint& point, bool animation) { result r = E_SUCCESS; @@ -2781,7 +2757,7 @@ _FastScrollPresenter::SelectOnIndexViews(const Point& point, bool animation) SysTryReturn(NID_UI_CTRL, pFocusedIndexView, null, GetLastResult(), "[%s] Failed to get the index view.", GetErrorMessage(GetLastResult())); - _FastScrollIndex* pIndex = pFocusedIndexView->GetIndexAtPoint(Point(pFocusedIndexView->GetIndexBounds().x, point.y)); + _FastScrollIndex* pIndex = pFocusedIndexView->GetIndexAtPoint(FloatPoint(pFocusedIndexView->GetIndexBoundsF().x, point.y)); if (pIndex) { // select the index of the focused index view. @@ -2792,7 +2768,7 @@ _FastScrollPresenter::SelectOnIndexViews(const Point& point, bool animation) if (pIndex->GetOmitted() == true) { pSelectedIndex = pFocusedIndexView->GetOmissionIndexAtPoint(pIndex, - Point(pFocusedIndexView->GetIndexBounds().x, point.y)); + FloatPoint(pFocusedIndexView->GetIndexBoundsF().x, point.y)); } pFocusedIndexView->SetSelectedIndexInOmittedIndex(pSelectedIndex); @@ -2894,7 +2870,7 @@ _FastScrollPresenter::DeselectIndexViews(void) } result -_FastScrollPresenter::SetPopupIndex(_FastScrollIndex& popupIndex, const Point& point) +_FastScrollPresenter::SetPopupIndex(_FastScrollIndex& popupIndex, const FloatPoint& point) { result r = E_SUCCESS; @@ -3002,7 +2978,7 @@ _FastScrollPresenter::FireFastScrollEvent(_FastScrollIndex& selectedIndex) } bool -_FastScrollPresenter::OnTouchPressedAndMoved(const Point& point, bool animation) +_FastScrollPresenter::OnTouchPressedAndMoved(const FloatPoint& point, bool animation) { result r = E_SUCCESS; if (__scrollVisibility == false) @@ -3014,6 +2990,7 @@ _FastScrollPresenter::OnTouchPressedAndMoved(const Point& point, bool animation) _FastScrollIndex* pSelectedIndex = SelectOnIndexViews(point, animation); if (pSelectedIndex && (__pSelectedIndex != pSelectedIndex)) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); r = SetPopupIndex(*pSelectedIndex, point); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Failed to set the poup index.", GetErrorMessage(r)); @@ -3037,14 +3014,13 @@ _FastScrollPresenter::OnTouchReleasedAndCanceled(void) r = ClearPopupIndex(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Failed to clear the popup index.", GetErrorMessage(r)); - if (__scrollVisibility == false) + __pSelectedIndex = null; + if (__scrollVisibility == true) { r = SetScrollVisibility(false); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Failed to fade out fastscroll.", GetErrorMessage(r)); } - __pSelectedIndex = null; - return true; } diff --git a/src/ui/controls/FUiCtrl_FooterImpl.cpp b/src/ui/controls/FUiCtrl_FooterImpl.cpp index 51131ea..2bd5cd3 100644 --- a/src/ui/controls/FUiCtrl_FooterImpl.cpp +++ b/src/ui/controls/FUiCtrl_FooterImpl.cpp @@ -21,6 +21,8 @@ #include #include +#include "FUi_AccessibilityContainer.h" +#include "FUi_AccessibilityElement.h" #include "FUi_Control.h" #include "FUi_ResourceManager.h" #include "FUi_UiBuilder.h" @@ -51,6 +53,9 @@ _FooterImpl::CreateFooterImplN(Footer* pControl) r = pCore->InitializeLongPressGesture(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + r = pCore->InitializeFlickGesture(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + _FooterImpl* pFooterImpl = new (std::nothrow) _FooterImpl(pControl, pCore); r = CheckConstruction(pCore, pFooterImpl); @@ -379,9 +384,8 @@ _FooterImpl::SetBackgroundBitmap(const Bitmap* pBitmap) result _FooterImpl::SetButton(ButtonPosition position, const ButtonItem& button) { - SysTryReturnResult(NID_UI_CTRL, (__style == FOOTER_STYLE_SEGMENTED_TEXT || __style == FOOTER_STYLE_SEGMENTED_ICON || __style == FOOTER_STYLE_SEGMENTED_ICON_TEXT - || __style == FOOTER_STYLE_BUTTON_TEXT || __style == FOOTER_STYLE_BUTTON_ICON || __style == FOOTER_STYLE_BUTTON_ICON_TEXT), - E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Unable to set the button item because the current style does not support it."); + SysTryReturnResult(NID_UI_CTRL, __style != FOOTER_STYLE_TAB, + E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Unable to set the button item because the current style does not support it."); SysTryReturnResult(NID_UI_CTRL, (button.GetActionId() >= FOOTER_ACTION_ID_MIN && button.GetActionId() <= FOOTER_ACTION_ID_MAX), E_INVALID_ARG, "[E_INVALID_ARG] The actionId is invalid."); @@ -453,72 +457,63 @@ _FooterImpl::SetBackButton(void) _Button* pButton = _Button::CreateButtonN(); - int buttonHeight = 0; - int buttonWidth = 0; - int iconSize = 0; + float buttonHeight = 0.0f; + float buttonWidth = 0.0f; + float iconSize = 0.0f; GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonHeight); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonWidth); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetCore().GetOrientation(), iconSize); - pButton->SetSize(Dimension(buttonWidth, buttonHeight)); + pButton->SetSize(FloatDimension(buttonWidth, buttonHeight)); - Bitmap* pBackgroundBaseBitmap = null; - Bitmap* pPressedBitmap = null; + Bitmap* pBackgroundNormalBitmap = null; + Bitmap* pBackgroundPressedBitmap = null; Bitmap* pColorReplacedBitmap = null; - Bitmap* pIconBaseBitmap = null; - Bitmap* pIconBaseEffectBitmap = null; + Bitmap* pBackIconNormalBitmap = null; + Bitmap* pBackIconNormalEffectBitmap = null; + + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundNormalBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundPressedBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundBaseBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconBaseBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconBaseEffectBitmap); + bool themeBackNormalBitmap = IS_CUSTOM_BITMAP(FOOTER::BACK_ICON_NORMAL); + if (!themeBackNormalBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalEffectBitmap); + } - if (pBackgroundBaseBitmap) + if (pBackgroundNormalBitmap) { - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_NORMAL)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *pColorReplacedBitmap); delete pColorReplacedBitmap; - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_HIGHLIGHTED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_DISABLED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_DISABLED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - delete pBackgroundBaseBitmap; + delete pBackgroundNormalBitmap; } - //# if (pBackgroundEffectBitmap) - //# { - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pBackgroundEffectBitmap); - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pBackgroundEffectBitmap); - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pBackgroundEffectBitmap); - //# delete pBackgroundEffectBitmap; - //# } - - if (pPressedBitmap) + if (pBackgroundPressedBitmap) { - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_PRESSED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - delete pPressedBitmap; + delete pBackgroundPressedBitmap; } - //# if (pPressedEffectBitmap) - //# { - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pPressedEffectBitmap); - //# delete pPressedEffectBitmap; - //# } - - if (pIconBaseBitmap) + if (pBackIconNormalBitmap) { Color normalColor; Color pressedColor; @@ -528,45 +523,42 @@ _FooterImpl::SetBackButton(void) GET_COLOR_CONFIG(FOOTER::BACK_ICON_PRESSED, pressedColor); GET_COLOR_CONFIG(FOOTER::BACK_ICON_DISABLED, disabledColor); - pIconBaseBitmap->Scale(Dimension(iconSize, iconSize)); + pBackIconNormalBitmap->Scale(FloatDimension(iconSize, iconSize)); - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); if (pColorReplacedBitmap) { - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); if (pColorReplacedBitmap) { - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); if (pColorReplacedBitmap) { - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - delete pIconBaseBitmap; + delete pBackIconNormalBitmap; } - if (pIconBaseEffectBitmap) + if (pBackIconNormalEffectBitmap) { - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_SELECTED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pIconBaseEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); - delete pIconBaseEffectBitmap; + delete pBackIconNormalEffectBitmap; } return GetCore().SetButton(BACK_BUTTON, pButton); @@ -773,6 +765,28 @@ _FooterImpl::GetButtonBounds(ButtonPosition position) const return rect; } +FloatRectangle +_FooterImpl::GetButtonBoundsF(ButtonPosition position) const +{ + bool isButtonSet = IsButtonSet(position); + + SysTryReturn(NID_UI_CTRL, isButtonSet, FloatRectangle(-1.0f, -1.0f, -1.0f, -1.0f), + E_INVALID_OPERATION, "[E_INVALID_OPERATION] No button item is set at the specified position."); + + FloatRectangle rect; + + if (position == BUTTON_POSITION_LEFT) + { + rect = GetCore().GetButtonBoundsF(LEFT_BUTTON); + } + else if (position == BUTTON_POSITION_RIGHT) + { + rect = GetCore().GetButtonBoundsF(RIGHT_BUTTON); + } + + return rect; +} + void _FooterImpl::AddActionEventListener(IActionEventListener& listener) { @@ -897,14 +911,14 @@ _FooterImpl::ConvertButtonItem(const ButtonItem& buttonItem) { _Button* pButton = _Button::CreateButtonN(); - int buttonItemWidth = 0; - int buttonItemHeight = 0; + float buttonItemWidth = 0.0f; + float buttonItemHeight = 0.0f; GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonItemWidth); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonItemHeight); - pButton->SetMargin(0, 0); - pButton->SetSize(Dimension(buttonItemWidth, buttonItemHeight)); + pButton->SetMargin(0.0f, 0.0f, 0.0f, 0.0f); + pButton->SetSize(FloatDimension(buttonItemWidth, buttonItemHeight)); pButton->SetActionId(buttonItem.GetActionId()); @@ -912,7 +926,7 @@ _FooterImpl::ConvertButtonItem(const ButtonItem& buttonItem) pButton->SetTextMaxLine(2); - int fontSize = 0; + float fontSize = 0.0f; result r = GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_FONT_SIZE, GetCore().GetOrientation(), fontSize); if (!IsFailed(r)) @@ -920,7 +934,7 @@ _FooterImpl::ConvertButtonItem(const ButtonItem& buttonItem) pButton->SetTextSize(fontSize, FONT_STYLE_BOLD); } - int iconSize = 0; + float iconSize = 0.0f; GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetCore().GetOrientation(), iconSize); @@ -930,52 +944,45 @@ _FooterImpl::ConvertButtonItem(const ButtonItem& buttonItem) if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_PRESSED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_HIGHLIGHTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_DISABLED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } Bitmap* pNormalBackgroundBitmap = null; Bitmap* pColorReplacedBitmap = null; - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); if (pNormalBackgroundBitmap) { @@ -1048,6 +1055,19 @@ _FooterImpl::ConvertButtonItem(const ButtonItem& buttonItem) pButton->SetToolbarItemBackgroundBitmap(_BUTTON_STATUS_DISABLED, *buttonItem.__pImpl->GetBackgroundBitmap(BUTTON_ITEM_STATUS_DISABLED)); } + if (buttonItem.__pImpl->__accessibilityHint.GetLength() > 0) + { + _AccessibilityContainer* pContainer = pButton->GetAccessibilityContainer(); + if (pContainer) + { + _AccessibilityElement* pElement = pContainer->GetChildElement(L"ButtonText"); + if (pElement) + { + pElement->SetHint(buttonItem.__pImpl->__accessibilityHint); + } + } + } + return pButton; } @@ -1056,11 +1076,11 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) { _Button* pButton = _Button::CreateButtonN(); - int minItemLength = 0; + float minItemLength = 0.0f; GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_WIDTH_1_MIN, GetCore().GetOrientation(), minItemLength); - pButton->SetSize(Dimension(minItemLength, minItemLength)); + pButton->SetSize(FloatDimension(minItemLength, minItemLength)); pButton->SetActionId(footerItem.GetActionId()); @@ -1071,8 +1091,8 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) pButton->SetTextMaxLine(2); - int fontSize = 0; - int iconSize = 0; + float fontSize = 0.0f; + float iconSize = 0.0f; result r = E_SUCCESS; @@ -1094,7 +1114,7 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) Bitmap* pColorReplacedBitmap = null; Color selectedBitmapColor; - GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap); + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap); GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_PRESSED, selectedBitmapColor); pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedBitmapColor); @@ -1104,7 +1124,6 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) pButton->SetToolbarSelectedBitmap(*pColorReplacedBitmap, false); delete pColorReplacedBitmap; - delete pSelectedBitmap; } } @@ -1134,49 +1153,49 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) pIconBitmap = const_cast(footerItem.__pImpl->GetIcon(FOOTER_ITEM_STATUS_NORMAL)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_SELECTED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(footerItem.__pImpl->GetIcon(FOOTER_ITEM_STATUS_PRESSED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(footerItem.__pImpl->GetIcon(FOOTER_ITEM_STATUS_SELECTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_SELECTED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(footerItem.__pImpl->GetIcon(FOOTER_ITEM_STATUS_HIGHLIGHTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(footerItem.__pImpl->GetIcon(FOOTER_ITEM_STATUS_DISABLED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } } @@ -1206,6 +1225,19 @@ _FooterImpl::ConvertFooterItem(const FooterItem& footerItem) *footerItem.__pImpl->GetBackgroundBitmap(FOOTER_ITEM_STATUS_DISABLED)); } + if (footerItem.__pImpl->__accessibilityHint.GetLength() > 0) + { + _AccessibilityContainer* pContainer = pButton->GetAccessibilityContainer(); + if (pContainer) + { + _AccessibilityElement* pElement = pContainer->GetChildElement(L"ButtonText"); + if (pElement) + { + pElement->SetHint(footerItem.__pImpl->__accessibilityHint); + } + } + } + return pButton; } @@ -1217,6 +1249,51 @@ _FooterImpl::OnChangeLayout(_ControlOrientation orientation) return; } +result +_FooterImpl::SetButtonBadgeIcon(ButtonPosition position, const Bitmap* pBadgeIcon) +{ + SysTryReturnResult(NID_UI_CTRL, (position == BUTTON_POSITION_LEFT || position == BUTTON_POSITION_RIGHT), E_SYSTEM, + "[E_SYSTEM] The position is invalid."); + + bool isButtonSet = IsButtonSet(position); + + SysTryReturnResult(NID_UI_CTRL, isButtonSet, E_INVALID_STATE, + "[E_INVALID_STATE] No button item is set at the specified position."); + + if (position == BUTTON_POSITION_LEFT) + { + return GetCore().SetButtonBadgeIcon(LEFT_BUTTON, pBadgeIcon); + } + else + { + return GetCore().SetButtonBadgeIcon(RIGHT_BUTTON, pBadgeIcon); + } +} + +result +_FooterImpl::SetButtonNumberedBadgeIcon(ButtonPosition position, int number) +{ + SysTryReturnResult(NID_UI_CTRL, (position == BUTTON_POSITION_LEFT || position == BUTTON_POSITION_RIGHT), E_SYSTEM, + "[E_SYSTEM] The position is invalid."); + + bool isButtonSet = IsButtonSet(position); + + SysTryReturnResult(NID_UI_CTRL, isButtonSet, E_INVALID_STATE, + "[E_INVALID_STATE] No button item is set at the specified position."); + + SysTryReturnResult(NID_UI_CTRL, (0 <= number && number <= FOOTER_NUMBERD_BADGE_ICON_NUMBER_MAX), E_INVALID_ARG, + "[E_INVALID_ARG] The number is invalid."); + + if (position == BUTTON_POSITION_LEFT) + { + return GetCore().SetButtonNumberedBadgeIcon(LEFT_BUTTON, number); + } + else + { + return GetCore().SetButtonNumberedBadgeIcon(RIGHT_BUTTON, number); + } +} + ButtonItemStatus _FooterImpl::ConvertButtonItemStatus(_ButtonStatus status) const { @@ -1388,7 +1465,6 @@ protected: virtual Control* Make(_UiBuilderControl* pControl) { Footer* pFooter = null; - Rectangle rect; String elementString; int opacity = 0; @@ -1731,7 +1807,12 @@ protected: pBitmap = LoadBitmapN(elementString); footerItem.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmap); } - + + if (pControl->GetItemElement(i, L"accessibilityHint", elementString)) + { + _FooterItemImpl::GetInstance(footerItem)->SetAccessibilityHint(elementString); + } + pFooter->AddItem(footerItem); } else if (footerItemString.Equals(L"buttonItem", false)) @@ -1839,7 +1920,12 @@ protected: pBitmap = LoadBitmapN(elementString); buttonItem.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmap); } - + + if (pControl->GetItemElement(i, L"accessibilityHint", elementString)) + { + _ButtonItemImpl::GetInstance(buttonItem)->SetAccessibilityHint(elementString); + } + pFooter->SetButton(buttonPosition, buttonItem); } } diff --git a/src/ui/controls/FUiCtrl_FooterItemImpl.cpp b/src/ui/controls/FUiCtrl_FooterItemImpl.cpp index e4cc5e3..3e15efe 100644 --- a/src/ui/controls/FUiCtrl_FooterItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_FooterItemImpl.cpp @@ -31,6 +31,7 @@ namespace Tizen { namespace Ui { namespace Controls _FooterItemImpl::_FooterItemImpl(FooterItem* pPublic) : __actionId(-1) , __itemText(L"") + , __accessibilityHint(L"") { for (int i = 0; i < FOOTER_ITEM_MAX_STATE_COUNT; i++) { @@ -157,4 +158,10 @@ _FooterItemImpl::SetText(const String& text) return E_SUCCESS; } +void +_FooterItemImpl::SetAccessibilityHint(const Tizen::Base::String& hint) +{ + __accessibilityHint = hint; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_Form.cpp b/src/ui/controls/FUiCtrl_Form.cpp old mode 100644 new mode 100755 index 892497e..7ffda64 --- a/src/ui/controls/FUiCtrl_Form.cpp +++ b/src/ui/controls/FUiCtrl_Form.cpp @@ -43,6 +43,7 @@ #include "FUiCtrl_OverlayPanelImpl.h" #include "FUiCtrl_IFormBackEventListener.h" #include "FUiCtrl_Indicator.h" +#include "FUi_SystemUtilImpl.h" using namespace Tizen::Ui::Animations; using namespace Tizen::Ui; @@ -68,11 +69,12 @@ _Form::_Form(void) , __transparentTab(false) , __indicatorShowState(false) , __deflated(false) - , __deflatedHeight(0) + , __deflatedHeight(0.0f) , __overlayRegionCount(0) , __ppOverlayerRegionImplArray(null) , __softkeyCount(SOFTKEY_COUNT + 1) , __updatedSoftkeyCount(0) + , __keypadShowstate(false) { Color color; result r = GET_COLOR_CONFIG(FORM::BG_NORMAL,color); @@ -110,7 +112,7 @@ _Form::_Form(void) __pSoftkeyPressedEffectBitmap[_SOFTKEY_0 + j] = null; } - for (int k = 0; k < SOFTKEY_COUNT; k++) + for (int k = 0; k < SOFTKEY_COUNT + 1; k++) { __pSoftkeyNormalIcon[_SOFTKEY_0 + k] = null; __pSoftkeyPressedIcon[_SOFTKEY_0 + k] = null; @@ -177,7 +179,7 @@ _Form::~_Form(void) } } - for (int i = 0; i < SOFTKEY_COUNT ; i++) + for (int i = 0; i < SOFTKEY_COUNT+1; i++) { if (__pSoftkeyNormalIcon[i]) { @@ -226,8 +228,6 @@ _Form::CreateFormN(void) SysTryReturn(NID_UI_CTRL, pForm, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); - pForm->SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE); - pForm->AcquireHandle(); SetLastResult(E_SUCCESS); @@ -265,7 +265,7 @@ _Form::OnDraw(void) } if(unlikely((_AccessibilityManager::IsActivated()))) { - _AccessibilityManager::GetInstance()->RequestAutoReading(); + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); } return; } @@ -418,7 +418,112 @@ _Form::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType) pOverlayRegionImpl = new (std::nothrow) _OverlayRegionImpl(); SysTryReturn(NID_UI_CTRL, pOverlayRegionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to make the OverlayRegionImpl instance!"); - r = pOverlayRegionImpl->Construct(this, regionType, overlayPosition, rect, devBounds); + r = pOverlayRegionImpl->Construct(this, regionType, _CoordinateSystemUtils::ConvertToFloat(rect), devBounds); + if (r != E_SUCCESS) + { + delete pOverlayRegionImpl; + SysTryReturn(NID_UI_CTRL, 0, null, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + pOverlayRegion = pOverlayRegionImpl->CreateOverlayRegionN(); + if (pOverlayRegion == null) + { + delete pOverlayRegionImpl; + SysTryReturn(NID_UI_CTRL, 0, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + } + + __ppOverlayerRegionImplArray[idx] = pOverlayRegionImpl; + pOverlayRegionImpl->SetFormArrayIndex(idx); + + __overlayRegionCount++; + + SetLastResult(E_SUCCESS); + + return pOverlayRegion; +} + +OverlayRegion* +_Form::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionType) +{ + _OverlayRegionImpl* pOverlayRegionImpl = null; + OverlayRegion* pOverlayRegion = null; + Color bgColor(0, 0, 0, 0); + int idx = 0; + int maxCount = 0; + _OverlayPanel* pOverlayPanel = null; + result r = E_SYSTEM; + bool modified = false; + + ClearLastResult(); + + maxCount = OverlayRegion::GetMaxCount(); + SysTryReturn(NID_UI_CTRL, maxCount > 0, null, E_SYSTEM, "[E_SYSTEM] maxCount [%d] is invalid", maxCount); + + if (__ppOverlayerRegionImplArray == null) + { + __ppOverlayerRegionImplArray = new (std::nothrow) _OverlayRegionImpl*[maxCount]; + SysTryReturn(NID_UI_CTRL, __ppOverlayerRegionImplArray != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Can not allocate memory for the OverlayRegionList."); + + for (int i = 0; i < maxCount; i++) + { + __ppOverlayerRegionImplArray[i] = null; + } + __overlayRegionCount = 0; + } + + FloatRectangle clientRectF(GetClientBoundsF()); + FloatPoint overlayPositionF(clientRectF.x + rect.x, clientRectF.y + rect.y); + FloatRectangle overlayRectF(overlayPositionF.x, overlayPositionF.y, rect.width, rect.height); + + FloatRectangle devPhyBoundsF = _CoordinateSystemUtils::Transform(overlayRectF); + Rectangle devPhyBounds = _CoordinateSystemUtils::ConvertToInteger(devPhyBoundsF); + + //org user float + SysLog(NID_UI_CTRL, "user rect [%.3f, %.3f, %.3f, %.3f] ", rect.x, rect.y, rect.width, rect.height); + //adjustedlogical user float + SysLog(NID_UI_CTRL, "overlayRectF [%.3f, %.3f, %.3f, %.3f]", overlayRectF.x, overlayRectF.y, overlayRectF.width, overlayRectF.height); + //adjusted logical -> adjusted physical float + SysLog(NID_UI_CTRL, "devPhyBoundsF [%.3f, %.3f, %.3f, %.3f]", devPhyBoundsF.x, devPhyBoundsF.y, devPhyBoundsF.width, devPhyBoundsF.height); + //adjusted physical float -> physical integer + SysLog(NID_UI_CTRL, "devPhyBounds [%d, %.3d, %.3d, %.3d]", devPhyBounds.x, devPhyBounds.y, devPhyBounds.width, devPhyBounds.height); + + Rectangle overlayLgcRect = _CoordinateSystemUtils::ConvertToInteger(overlayRectF); + Rectangle basePhyBounds = _CoordinateSystemUtils::ConvertToInteger(_CoordinateSystemUtils::Transform(clientRectF)); + + // 1. width , height unit check + if (_OverlayRegionImpl::IsValidOverlayRect(overlayLgcRect, devPhyBounds, basePhyBounds, modified) != E_SUCCESS) + { + SysTryReturn(NID_UI_CTRL, 0, null, E_INVALID_ARG, "[E_INVALID_ARG] IsValidOverlayRect is failed!"); + } + + if (modified) + { + SysLog(NID_UI_CTRL, "devBounds modified [%d, %d, %d, %d]", devPhyBounds.x, devPhyBounds.y, devPhyBounds.width, devPhyBounds.height); + } + + // 2. check for using OverlayPanel simutaneously + for (idx = 0 ; idx < GetChildCount() ; idx++) + { + pOverlayPanel = dynamic_cast <_OverlayPanel*>(GetChild(idx)); + SysTryReturn(NID_UI_CTRL, pOverlayPanel == null, null, E_SYSTEM, "[E_SYSTEM] Using OverlayRegion mixed with OverlayPanel is not supported!"); + } + + // 3. find the empty slot idx + for (idx = 0; idx < maxCount; idx++) + { + if (__ppOverlayerRegionImplArray[idx] == null) + { + break; + } + } + + SysTryReturn(NID_UI_CTRL, idx < maxCount, null, E_SYSTEM, "[E_SYSTEM] already used permitted maximum number of OverlayRegion!"); + + // 4. make OverlayRegion object + pOverlayRegionImpl = new (std::nothrow) _OverlayRegionImpl(); + SysTryReturn(NID_UI_CTRL, pOverlayRegionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to make the OverlayRegionImpl instance!"); + + r = pOverlayRegionImpl->Construct(this, regionType, rect, devPhyBounds); if (r != E_SUCCESS) { delete pOverlayRegionImpl; @@ -475,13 +580,13 @@ void _Form::CreateSoftkey(unsigned long formStyle) { Bitmap* pTempBitmap = null; - Dimension softkeyDimension(0, 0); - Dimension softkeyDisplayDimension(0, 0); - Dimension optionkeyDimension(0, 0); - int softkeyTextSize = 0; - int leftSoftkeyLeftMargin = 0; - int rightSoftkeyLeftMargin = 0; - int softkeyTopMargin = 0; + FloatDimension softkeyDimension(0.0f, 0.0f); + FloatDimension softkeyDisplayDimension(0.0f, 0.0f); + FloatDimension optionkeyDimension(0.0f, 0.0f); + float softkeyTextSize = 0.0; + float leftSoftkeyLeftMargin = 0.0f; + float rightSoftkeyLeftMargin = 0.0f; + float softkeyTopMargin = 0.0f; Color softkeyNormalBackgroundColor; Color softkeyPressedBackgroundColor; Color softkeyNormalTextColor; @@ -577,7 +682,7 @@ _Form::CreateSoftkey(unsigned long formStyle) { pButton->SetSize(softkeyDimension); pButton->SetTextSize(softkeyTextSize); - pButton->SetUserDefinedTextArea(Rectangle(leftSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height)); + pButton->SetUserDefinedTextArea(FloatRectangle(leftSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height)); pButton->SetTextColor(_BUTTON_STATUS_NORMAL, softkeyNormalTextColor); pButton->SetTextColor(_BUTTON_STATUS_PRESSED, softkeyPressedTextColor); __pFooter->SetButton(LEFT_BUTTON, pButton); @@ -650,7 +755,7 @@ _Form::CreateSoftkey(unsigned long formStyle) { pButton->SetSize(softkeyDimension); pButton->SetTextSize(softkeyTextSize); - pButton->SetUserDefinedTextArea(Rectangle(rightSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height)); + pButton->SetUserDefinedTextArea(FloatRectangle(rightSoftkeyLeftMargin, softkeyTopMargin, softkeyDisplayDimension.width, softkeyDisplayDimension.height)); pButton->SetTextColor(_BUTTON_STATUS_NORMAL, softkeyNormalTextColor); pButton->SetTextColor(_BUTTON_STATUS_PRESSED, softkeyPressedTextColor); __pFooter->SetButton(RIGHT_BUTTON, pButton); @@ -699,6 +804,28 @@ _Form::CreateSoftkey(unsigned long formStyle) __pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedBackgroundColor); delete pTempBitmap; + r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_HANDLE_MORE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (__pSoftkeyNormalIcon[SOFTKEY_COUNT]) + { + delete __pSoftkeyNormalIcon[SOFTKEY_COUNT]; + __pSoftkeyNormalIcon[SOFTKEY_COUNT] = null; + } + __pSoftkeyNormalIcon[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyNormalIconColor); + delete pTempBitmap; + + r = GET_BITMAP_CONFIG_N(FOOTER::OPTIONKEY_HANDLE_MORE_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (__pSoftkeyPressedIcon[SOFTKEY_COUNT]) + { + delete __pSoftkeyPressedIcon[SOFTKEY_COUNT]; + __pSoftkeyPressedIcon[SOFTKEY_COUNT] = null; + } + __pSoftkeyPressedIcon[SOFTKEY_COUNT] = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), softkeyPressedIconColor); + delete pTempBitmap; + _Button* pButton = _Button::CreateButtonN(); if (pButton) { @@ -713,7 +840,7 @@ _Form::CreateSoftkey(unsigned long formStyle) void _Form::UpdateSoftkey(unsigned long formStyle) { - int softkeyIconGap = 3; + float softkeyIconGap = 3.0f; if (__formStyle & FORM_STYLE_SOFTKEY_0)// && __updatedSoftkeyCount % 2 == 0) { @@ -752,15 +879,15 @@ _Form::UpdateSoftkey(unsigned long formStyle) if (__pSoftkeyNormalIcon[_SOFTKEY_0]) { __pFooter->GetButton(LEFT_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((__pFooter->GetButton(LEFT_BUTTON)->GetSize().width - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetWidth()) / 2, - (__pFooter->GetButton(LEFT_BUTTON)->GetSize().height - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetHeight()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_0]); + FloatPoint((__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().width - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetWidthF()) / 2, + (__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().height - __pSoftkeyNormalIcon[_SOFTKEY_0]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_0]); } if (__pSoftkeyPressedIcon[_SOFTKEY_0]) { __pFooter->GetButton(LEFT_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((__pFooter->GetButton(LEFT_BUTTON)->GetSize().width - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetWidth()) / 2, - (__pFooter->GetButton(LEFT_BUTTON)->GetSize().height - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetHeight()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_0]); + FloatPoint((__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().width - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetWidthF()) / 2, + (__pFooter->GetButton(LEFT_BUTTON)->GetSizeF().height - __pSoftkeyPressedIcon[_SOFTKEY_0]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_0]); } } } @@ -803,15 +930,15 @@ _Form::UpdateSoftkey(unsigned long formStyle) if (__pSoftkeyNormalIcon[_SOFTKEY_1]) { __pFooter->GetButton(RIGHT_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((__pFooter->GetButton(RIGHT_BUTTON)->GetSize().width - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetWidth()) / 2, - (__pFooter->GetButton(RIGHT_BUTTON)->GetSize().height - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetHeight()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_1]); + FloatPoint((__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().width - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetWidthF()) / 2, + (__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().height - __pSoftkeyNormalIcon[_SOFTKEY_1]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyNormalIcon[_SOFTKEY_1]); } if (__pSoftkeyPressedIcon[_SOFTKEY_1]) { __pFooter->GetButton(RIGHT_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((__pFooter->GetButton(RIGHT_BUTTON)->GetSize().width - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetWidth()) / 2, - (__pFooter->GetButton(RIGHT_BUTTON)->GetSize().height - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetHeight()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_1]); + FloatPoint((__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().width - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetWidthF()) / 2, + (__pFooter->GetButton(RIGHT_BUTTON)->GetSizeF().height - __pSoftkeyPressedIcon[_SOFTKEY_1]->GetHeightF()) / 2 + softkeyIconGap), *__pSoftkeyPressedIcon[_SOFTKEY_1]); } } } @@ -842,6 +969,16 @@ _Form::UpdateSoftkey(unsigned long formStyle) { __pFooter->GetButton(MIDDLE_BUTTON)->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *__pSoftkeyPressedEffectBitmap[SOFTKEY_COUNT]); } + + if (__pSoftkeyNormalIcon[SOFTKEY_COUNT]) + { + __pFooter->GetButton(MIDDLE_BUTTON)->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *__pSoftkeyNormalIcon[SOFTKEY_COUNT]); + } + + if (__pSoftkeyPressedIcon[SOFTKEY_COUNT]) + { + __pFooter->GetButton(MIDDLE_BUTTON)->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *__pSoftkeyPressedIcon[SOFTKEY_COUNT]); + } } } @@ -923,12 +1060,12 @@ _Form::SetFormStyle(unsigned long formStyle) __pIndicator = CreateIndicatorN(); SysTryReturnVoidResult(NID_UI_CTRL, __pIndicator != null, r, "[%s] Propagating.", GetErrorMessage(r)); - int indicatorwidth = GetClientBounds().width; - int indicatorheight = 0; + float indicatorwidth = GetClientBoundsF().width; + float indicatorheight = 0.0f; GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight); - __pIndicator->SetBounds(Rectangle(0, 0, indicatorwidth, indicatorheight)); + __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, indicatorwidth, indicatorheight)); r = AttachSystemChild(*__pIndicator); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -985,12 +1122,15 @@ _Form::SetActionBarsTranslucent(unsigned long actionBars, bool translucent) } } - if (IsIndicatorTranslucent() != IsHeaderTranslucent()) + if (IsHeaderVisible()) { - if (IsIndicatorTranslucent()) + if (IsIndicatorTranslucent() != IsHeaderTranslucent()) { - r = SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + if (IsIndicatorTranslucent()) + { + r = SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } } } @@ -1030,7 +1170,7 @@ _Form::SetActionBarsVisible(unsigned long actionBars, bool visible) return E_INVALID_OPERATION; } - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); SetBounds(bounds); if (actionBars & FORM_ACTION_BAR_INDICATOR) @@ -1046,13 +1186,13 @@ _Form::SetActionBarsVisible(unsigned long actionBars, bool visible) { if (visible == true) { - int adjHeight = 0; + float adjHeight = 0.0f; if (IsIndicatorVisible()) { - Rectangle indicatorBounds = GetIndicatorBounds(); + FloatRectangle indicatorBounds = GetIndicatorBoundsF(); adjHeight = indicatorBounds.height; } - Rectangle bounds = __pHeader->GetBounds(); + FloatRectangle bounds = __pHeader->GetBoundsF(); bounds.y = adjHeight; SetHeaderBounds(bounds); @@ -1181,7 +1321,7 @@ _Form::SetSoftkeyIcon(_Softkey softkey, const Bitmap& normalBitmap, const Bitmap return r; } - int softkey_icon_size = 0; + float softkey_icon_size = 0.0f; GET_SHAPE_CONFIG(FOOTER::SOFTKEY_ICON_SIZE, GetOrientation(), softkey_icon_size); @@ -1196,7 +1336,7 @@ _Form::SetSoftkeyIcon(_Softkey softkey, const Bitmap& normalBitmap, const Bitmap __pSoftkeyNormalIcon[softkey] = pClonedNormalBitmap; - __pSoftkeyNormalIcon[softkey]->Scale(Dimension(softkey_icon_size, softkey_icon_size)); + __pSoftkeyNormalIcon[softkey]->Scale(FloatDimension(softkey_icon_size, softkey_icon_size)); r = E_SUCCESS; } @@ -1214,7 +1354,7 @@ _Form::SetSoftkeyIcon(_Softkey softkey, const Bitmap& normalBitmap, const Bitmap __pSoftkeyPressedIcon[softkey] = pClonedPressedBitmap; - __pSoftkeyPressedIcon[softkey]->Scale(Dimension(softkey_icon_size, softkey_icon_size)); + __pSoftkeyPressedIcon[softkey]->Scale(FloatDimension(softkey_icon_size, softkey_icon_size)); r = E_SUCCESS; } @@ -1475,6 +1615,13 @@ _Form::TranslateToClientAreaPosition(const Point& position) const return Point(position.x - clientArea.x, position.y - clientArea.y); } +FloatPoint +_Form::TranslateToClientAreaPosition(const FloatPoint& position) const +{ + FloatRectangle clientArea = GetClientBoundsF(); + return FloatPoint(position.x - clientArea.x, position.y - clientArea.y); +} + Point _Form::TranslateFromClientAreaPosition(const Point& clientPosition) const { @@ -1482,6 +1629,13 @@ _Form::TranslateFromClientAreaPosition(const Point& clientPosition) const return Point(clientPosition.x + clientArea.x, clientPosition.y + clientArea.y); } +FloatPoint +_Form::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const +{ + FloatRectangle clientArea = GetClientBoundsF(); + return FloatPoint(clientPosition.x + clientArea.x, clientPosition.y + clientArea.y); +} + bool _Form::DeflateClientRectHeight(int height) { @@ -1494,21 +1648,54 @@ _Form::DeflateClientRectHeight(int height) __deflated = false; } + __deflatedHeight = _CoordinateSystemUtils::ConvertToFloat(height); + + AdjustClientBounds(); + + if (__pFooter) + { + float adjHeight = 0.0f; + + if (!(__pFooter->GetVisibleState()) || IsFooterTranslucent()) + { + adjHeight = GetToolbarHeightF(false); + } + + FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height-adjHeight, + GetClientBoundsF().width, GetToolbarHeightF(false)); + SetFooterBounds(bounds); + } + + return true; +} + +bool +_Form::DeflateClientRectHeight(float height) +{ + if ( height > 0.0f) + { + __deflated = true; + } + else + { + __deflated = false; + } + __deflatedHeight = height; AdjustClientBounds(); if (__pFooter) { - int adjHeight = 0; + float adjHeight = 0.0f; if (!(__pFooter->GetVisibleState()) || IsFooterTranslucent()) { - adjHeight = GetToolbarHeight(false); + adjHeight = GetToolbarHeightF(false); } - Rectangle bounds(0, GetClientBounds().y + GetClientBounds().height-adjHeight, - GetClientBounds().width, GetToolbarHeight(false)); + FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height-adjHeight, + GetClientBoundsF().width, GetToolbarHeightF(false)); SetFooterBounds(bounds); } @@ -1584,6 +1771,39 @@ _Form::GetToolbarHeight(bool header) const return toolbarHeight; } +float +_Form::GetToolbarHeightF(bool header) const +{ + FloatDimension toolbarSize(0.0f, 0.0f); + + if (header && (__formStyle & FORM_STYLE_HEADER)) + { + if (__pHeader) + { + toolbarSize.height = __pHeader->GetBoundsF().height; + } + } + else if (header && (__formStyle & FORM_STYLE_TITLE)) + { + GET_SHAPE_CONFIG(HEADER::HEIGHT, GetOrientation(), toolbarSize.height); + } + else if (__formStyle & FORM_STYLE_SOFTKEY_0 || __formStyle & FORM_STYLE_SOFTKEY_1 || __formStyle & FORM_STYLE_OPTIONKEY) + { + GET_SHAPE_CONFIG(FOOTER::SOFTKEY_HEIGHT, GetOrientation(), toolbarSize.height); + } + else + { + if (__pFooter) + { + toolbarSize.height = __pFooter->GetBoundsF().height; + } + } + + toolbarSize = TranslateSize(toolbarSize); + + return toolbarSize.height; +} + int _Form::GetTabHeight(void) const { @@ -1597,6 +1817,21 @@ _Form::GetTabHeight(void) const return height; } +float +_Form::GetTabHeightF(void) const +{ + FloatDimension tabSize(0.0f, 0.0f); + + if ((__formStyle & FORM_STYLE_TEXT_TAB) || (__formStyle & FORM_STYLE_ICON_TAB)) + { + GET_SHAPE_CONFIG(TAB::HEIGHT, GetOrientation(), tabSize.height); + } + + tabSize = TranslateSize(tabSize); + + return tabSize.height; +} + bool _Form::RemoveHeader(void) { @@ -1687,7 +1922,7 @@ _Form::SetHeaderBounds(Rectangle& bounds) __pHeader->SetResizable(true); result r = E_SUCCESS; - r = __pHeader->SetBounds(bounds); + r = __pHeader->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds)); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __pHeader->SetMovable(movable); @@ -1699,7 +1934,7 @@ _Form::SetHeaderBounds(Rectangle& bounds) } result -_Form::SetHeaderFloatBounds(FloatRectangle& bounds) +_Form::SetHeaderBounds(FloatRectangle& bounds) { SysTryReturn(NID_UI_CTRL, __pHeader, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Header isn't constructed."); @@ -1733,6 +1968,29 @@ _Form::SetFooterBounds(Rectangle& bounds) __pFooter->SetResizable(true); result r = E_SUCCESS; + r = __pFooter->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pFooter->SetMovable(movable); + __pFooter->SetResizable(resizable); + + AdjustClientBounds(); + + return r; +} + +result +_Form::SetFooterBounds(FloatRectangle& bounds) +{ + SysTryReturn(NID_UI_CTRL, __pFooter, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed."); + + bool movable = __pFooter->IsMovable(); + bool resizable = __pFooter->IsResizable(); + + __pFooter->SetMovable(true); + __pFooter->SetResizable(true); + + result r = E_SUCCESS; r = __pFooter->SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1756,6 +2014,29 @@ _Form::SetTabBounds(Rectangle& bounds) __pTab->SetResizable(true); result r = E_SUCCESS; + r = __pTab->SetBounds(_CoordinateSystemUtils::ConvertToFloat(bounds)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pTab->SetMovable(movable); + __pTab->SetResizable(resizable); + + AdjustClientBounds(); + + return r; +} + +result +_Form::SetTabBounds(FloatRectangle& bounds) +{ + SysTryReturn(NID_UI_CTRL, __pTab, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Tab isn't constructed."); + + bool movable = __pTab->IsMovable(); + bool resizable = __pTab->IsResizable(); + + __pTab->SetMovable(true); + __pTab->SetResizable(true); + + result r = E_SUCCESS; r = __pTab->SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1836,9 +2117,17 @@ _Form::OnActionPerformed(const _Control& source, int actionId) switch (actionId) { case ID_BACK_BUTTON: - if (__pFormBackEventListener) + if (__keypadShowstate) + { + _SystemUtilImpl::GenerateKeyEvent(KEY_EVENT_TYPE_PRESSED, _KEY_STOP); + _SystemUtilImpl::GenerateKeyEvent(KEY_EVENT_TYPE_RELEASED, _KEY_STOP); + } + else { - __pFormBackEventListener->OnFormBackRequested(*this); + if (__pFormBackEventListener) + { + __pFormBackEventListener->OnFormBackRequested(*this); + } } break; @@ -1852,13 +2141,13 @@ _Form::OnChildVisibleStateChanged(const _Control& child) { if (IsHeaderVisible()) { - int adjHeight = 0; + float adjHeight = 0.0f; if (IsIndicatorVisible()) { - Rectangle indicatorBounds = GetIndicatorBounds(); + FloatRectangle indicatorBounds = GetIndicatorBoundsF(); adjHeight = indicatorBounds.height; } - Rectangle bounds = __pHeader->GetBounds(); + FloatRectangle bounds = __pHeader->GetBoundsF(); bounds.y = adjHeight; SetHeaderBounds(bounds); } @@ -1894,7 +2183,7 @@ _Form::GetIndicatorBounds(void) const } FloatRectangle -_Form::GetIndicatorFloatBounds(void) const +_Form::GetIndicatorBoundsF(void) const { _Control* pParent = GetParent(); _Frame* pFrame = dynamic_cast<_Frame*>(pParent); @@ -1908,18 +2197,16 @@ _Form::GetIndicatorFloatBounds(void) const } } - int indicatorwidth = GetClientBounds().width; - int indicatorheight = 0; + float indicatorwidth = GetClientBoundsF().width; + float indicatorheight = 0.0f; GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight); - Rectangle rect (0, 0, indicatorwidth, indicatorheight); - - Tizen::Graphics::FloatRectangle outputRect(rect.x, rect.y, rect.width, rect.height); + FloatRectangle rect (0.0f, 0.0f, indicatorwidth, indicatorheight); SetLastResult(E_SUCCESS); - return outputRect; + return rect; } void @@ -2022,7 +2309,7 @@ _Form::AddIndicatorObject(void) if (__pIndicator) { - r = __pIndicator->AddEvasObject(this); + r = __pIndicator->AddIndicatorObject(this); } return r; @@ -2034,12 +2321,41 @@ _Form::DeleteIndicatorObject(void) result r = E_SUCCESS; if (__pIndicator) { - r = __pIndicator->DeleteEvasObject(); + r = __pIndicator->DeleteIndicatorObject(); } return r; } +void +_Form::SetKeypadShowState(bool state) +{ + __keypadShowstate = state; + if (state) + { + if (__pHeader) + { + __pHeader->SetHideButton(true); + } + if (__pFooter) + { + __pFooter->SetHideButton(true); + } + } + else + { + if (__pHeader) + { + __pHeader->SetHideButton(false); + } + if (__pFooter) + { + __pFooter->SetHideButton(false); + } + } + +} + result _Form::AttachedToMainTree(void) { @@ -2049,7 +2365,7 @@ _Form::AttachedToMainTree(void) FrameShowMode mode = pFrame->GetShowMode(); if (mode != FRAME_SHOW_MODE_FULL_SCREEN) { - SetBounds(Rectangle(0, 0, pFrame->GetBounds().width, pFrame->GetBounds().height)); + SetBounds(FloatRectangle(0.0f, 0.0f, pFrame->GetBoundsF().width, pFrame->GetBoundsF().height)); } } @@ -2101,15 +2417,15 @@ _Form::AdjustClientBounds(void) { result r = E_SUCCESS; - Dimension size = GetSize(); - Rectangle clientBounds(0, 0, size.width, size.height); + FloatDimension size = GetSizeF(); + FloatRectangle clientBounds(0.0f, 0.0f, size.width, size.height); if (__deflated) { clientBounds.height -= __deflatedHeight; } - Rectangle indicatorBounds = GetIndicatorBounds(); + FloatRectangle indicatorBounds = GetIndicatorBoundsF(); _Control* pParent = GetParent(); _Frame* pFrame = dynamic_cast<_Frame*>(pParent); @@ -2144,8 +2460,8 @@ _Form::AdjustClientBounds(void) { if (__pHeader->GetVisibleState() && !IsHeaderTranslucent()) { - clientBounds.y += GetToolbarHeight(true); - clientBounds.height -= GetToolbarHeight(true); + clientBounds.y += GetToolbarHeightF(true); + clientBounds.height -= GetToolbarHeightF(true); } } @@ -2153,8 +2469,8 @@ _Form::AdjustClientBounds(void) { if (__pTab->GetVisibleState()) //&& !IsHeaderTranslucent()) { - clientBounds.y += GetTabHeight(); - clientBounds.height -= GetTabHeight(); + clientBounds.y += GetTabHeightF(); + clientBounds.height -= GetTabHeightF(); } } @@ -2165,12 +2481,12 @@ _Form::AdjustClientBounds(void) { if (__pFooter->GetVisibleState() && !IsFooterTranslucent()) { - clientBounds.height -= GetToolbarHeight(false); + clientBounds.height -= GetToolbarHeightF(false); } } } - if (clientBounds.height < 0) + if (clientBounds.height < 0.0f) { SysLog(NID_UI_CTRL, "[E_SYSTEM] The Client bounds is not valid. : client height(%d), indicator height(%d), header height(%d), footer height(%d)", clientBounds.height, indicatorBounds.height, GetToolbarHeight(true), GetToolbarHeight(false)); @@ -2185,43 +2501,57 @@ _Form::AdjustClientBounds(void) void _Form::OnBoundsChanged(void) { - Rectangle toolbarBounds; + FloatRectangle toolbarBounds; FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f); - int indicatorheight = 0; + float indicatorheight = 0.0f; GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight); if (__pIndicator) - __pIndicator->SetBounds(Rectangle(0, 0, GetClientBounds().width, indicatorheight)); + { + __pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight)); + } AdjustClientBounds(); if (HasHeader()) { - indicatorFloatBounds = GetIndicatorFloatBounds(); + if (IsIndicatorVisible()) + { + indicatorFloatBounds = GetIndicatorBoundsF(); + } - toolbarBounds = GetHeader()->GetBounds(); - toolbarBounds.width = GetSize().width; + toolbarBounds = GetHeader()->GetBoundsF(); + toolbarBounds.width = GetSizeF().width; FloatRectangle bounds(toolbarBounds.x, indicatorFloatBounds.height, toolbarBounds.width, toolbarBounds.height); - SetHeaderFloatBounds(bounds); + SetHeaderBounds(bounds); } if (HasFooter()) { - toolbarBounds = GetFooter()->GetBounds(); - toolbarBounds.width = GetSize().width; - toolbarBounds.y = GetSize().height - toolbarBounds.height; + toolbarBounds = GetFooter()->GetBoundsF(); + toolbarBounds.width = GetSizeF().width; + toolbarBounds.y = GetSizeF().height - toolbarBounds.height; SetFooterBounds(toolbarBounds); } if (HasTab()) { - toolbarBounds = GetTab()->GetBounds(); - toolbarBounds.width = GetSize().width; + toolbarBounds = GetTab()->GetBoundsF(); + toolbarBounds.width = GetSizeF().width; SetTabBounds(toolbarBounds); } AdjustClientBounds(); } +FloatDimension +_Form::TranslateSize(FloatDimension size ) const +{ + FloatDimension returnSize(0.0f, 0.0f); + returnSize = CoordinateSystem::AlignToDevice(size); + + return returnSize; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_FormImpl.cpp b/src/ui/controls/FUiCtrl_FormImpl.cpp old mode 100644 new mode 100755 index 6696768..ba0e8ef --- a/src/ui/controls/FUiCtrl_FormImpl.cpp +++ b/src/ui/controls/FUiCtrl_FormImpl.cpp @@ -28,6 +28,7 @@ #include #include #include "FUi_LayoutImpl.h" +#include "FUi_LayoutLayoutMaker.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" #include "FUi_ControlImplManager.h" @@ -59,6 +60,8 @@ using namespace Tizen::Ui::Animations; namespace Tizen { namespace Ui { namespace Controls { +const String _REQUEST_ORIENTATION_EVENT = L"RequestOrientationEvent"; + Dimension _FormImpl::FormSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const { @@ -69,6 +72,16 @@ _FormImpl::FormSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) return dimension; } +FloatDimension +_FormImpl::FormSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension dimension(0.0f, 0.0f); + SetLastResult(r); + + return dimension; +} + const _FormImpl* _FormImpl::GetInstance(const Form& form) { @@ -146,18 +159,18 @@ _FormImpl::CreateFormImplN(Form* pControl, Layout* pPublicPortraitLayout, Layout r = _ControlImpl::CheckConstruction(pCore, pImpl); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); _ControlOrientation orientation = pCore->GetOrientation(); if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(Form), portraitSize, orientation); + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Form), portraitSize, orientation); } else { - r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(Form), landscapeSize, orientation); + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Form), landscapeSize, orientation); } SysAssert(r == E_SUCCESS); @@ -279,14 +292,12 @@ _FormImpl::SetFormStyle(unsigned long formStyle) GetCore().SetFormStyle(formStyle); - Rectangle indicatorBounds(0, 0, 0, 0); - FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (FORM_STYLE_INDICATOR & formStyle) { GetCore().SetIndicatorShowState(true); - indicatorBounds = GetCore().GetIndicatorBounds(); - indicatorFloatBounds = GetCore().GetIndicatorFloatBounds(); + indicatorBounds = GetCore().GetIndicatorBoundsF(); r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -306,8 +317,8 @@ _FormImpl::SetFormStyle(unsigned long formStyle) GetCore().SetHeader(&pHeader->GetCore()); GetCore().AdjustClientBounds(); - FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true)); - GetCore().SetHeaderFloatBounds(bounds); + FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true)); + GetCore().SetHeaderBounds(bounds); r = GetCore().AttachSystemChild(pHeader->GetCore()); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -325,8 +336,8 @@ _FormImpl::SetFormStyle(unsigned long formStyle) GetCore().SetHeader(&pHeader->GetCore()); GetCore().AdjustClientBounds(); - FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true)); - GetCore().SetHeaderFloatBounds(bounds); + FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true)); + GetCore().SetHeaderBounds(bounds); r = GetCore().AttachSystemChild(pHeader->GetCore()); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -345,13 +356,13 @@ _FormImpl::SetFormStyle(unsigned long formStyle) if (formStyle & FORM_STYLE_TEXT_TAB) { - int titleHeight = 0; + float titleHeight = 0.0f; if (formStyle & FORM_STYLE_TITLE) { if (pHeader) { - titleHeight = pHeader->GetBounds().height; + titleHeight = pHeader->GetBoundsF().height; } } @@ -360,12 +371,12 @@ _FormImpl::SetFormStyle(unsigned long formStyle) pTabImpl = CreateTabImplN(); SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r)); - int posY = indicatorBounds.height + titleHeight; + float posY = indicatorBounds.height + titleHeight; GetCore().SetTab(&pTabImpl->GetCore()); GetCore().AdjustClientBounds(); - Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight()); + FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF()); GetCore().SetTabBounds(bounds); r = GetCore().AttachSystemChild(pTabImpl->GetCore()); @@ -375,13 +386,13 @@ _FormImpl::SetFormStyle(unsigned long formStyle) } else if (formStyle & FORM_STYLE_ICON_TAB) { - int titleHeight = 0; + float titleHeight = 0.0f; if (formStyle & FORM_STYLE_TITLE) { if (pHeader) { - titleHeight = pHeader->GetBounds().height; + titleHeight = pHeader->GetBoundsF().height; } } @@ -390,12 +401,12 @@ _FormImpl::SetFormStyle(unsigned long formStyle) pTabImpl = CreateTabImplN(); SysTryReturnVoidResult(NID_UI_CTRL, pTabImpl != null, r, "[%s] Propagating.", GetErrorMessage(r)); - int posY = indicatorBounds.height + titleHeight; + float posY = indicatorBounds.height + titleHeight; GetCore().SetTab(&pTabImpl->GetCore()); GetCore().AdjustClientBounds(); - Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight()); + FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF()); GetCore().SetTabBounds(bounds); r = GetCore().AttachSystemChild(pTabImpl->GetCore()); @@ -423,8 +434,8 @@ _FormImpl::SetFormStyle(unsigned long formStyle) GetCore().SetFooter(&pFooter->GetCore()); GetCore().AdjustClientBounds(); - Rectangle clientbounds = GetClientBounds(); - Rectangle bounds(0, clientbounds.y + clientbounds.height, clientbounds.width, GetCore().GetToolbarHeight(false)); + FloatRectangle clientbounds = GetClientBoundsF(); + FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height, clientbounds.width, GetCore().GetToolbarHeightF(false)); GetCore().SetFooterBounds(bounds); @@ -453,8 +464,8 @@ _FormImpl::SetFormStyle(unsigned long formStyle) GetCore().SetFooter(&pFooter->GetCore()); GetCore().AdjustClientBounds(); - Rectangle clientbounds = GetClientBounds(); - Rectangle bounds(0, clientbounds.y + clientbounds.height - GetCore().GetToolbarHeight(false), clientbounds.width, GetCore().GetToolbarHeight(false)); + FloatRectangle clientbounds = GetClientBoundsF(); + FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height - GetCore().GetToolbarHeightF(false), clientbounds.width, GetCore().GetToolbarHeightF(false)); GetCore().SetFooterBounds(bounds); @@ -637,10 +648,15 @@ _FormImpl::GetOverlayRegionN(const Rectangle& rect, OverlayRegionType regionType return GetCore().GetOverlayRegionN(rect, regionType); } +OverlayRegion* +_FormImpl::GetOverlayRegionN(const FloatRectangle& rect, OverlayRegionType regionType) +{ + return GetCore().GetOverlayRegionN(rect, regionType); +} + void _FormImpl::OnDraw(void) { - // [ToDo] Versioning!!! __pOriAgent->FireOrientationEvent(); _ContainerImpl::OnDraw(); @@ -747,12 +763,24 @@ _FormImpl::TranslateToClientAreaPosition(const Point& position) const return GetCore().TranslateToClientAreaPosition(position); } +FloatPoint +_FormImpl::TranslateToClientAreaPosition(const FloatPoint& position) const +{ + return GetCore().TranslateToClientAreaPosition(position); +} + Point _FormImpl::TranslateFromClientAreaPosition(const Point& clientPosition) const { return GetCore().TranslateFromClientAreaPosition(clientPosition); } +FloatPoint +_FormImpl::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const +{ + return GetCore().TranslateFromClientAreaPosition(clientPosition); +} + void _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener) { @@ -986,8 +1014,8 @@ _FormImpl::SetSoftkeyIcon(Softkey softkey, const Bitmap& pNormalBitmap, const Bi void _FormImpl::OnChangeLayout(_ControlOrientation orientation) { - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); // Change layout. _ContainerImpl::OnChangeLayout(orientation); @@ -1002,35 +1030,37 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) SetSize(landscapeSize); } - int indicatorheight = 0; + float indicatorheight = 0.0f; GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetCore().GetOrientation(), indicatorheight); if (GetCore().HasIndicator()) { _Indicator* pIndicator = GetCore().GetIndicator(); if (pIndicator) - pIndicator->SetBounds(Rectangle(0, 0, GetClientBounds().width, indicatorheight)); + { + pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight)); + } GetCore().AdjustClientBounds(); } - int adjHeight = 0; + float adjHeight = 0.0f; if (GetCore().HasHeader()) { - FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (GetCore().IsIndicatorVisible()) { - indicatorFloatBounds = GetCore().GetIndicatorFloatBounds(); + indicatorBounds = GetCore().GetIndicatorBoundsF(); } - FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true)); - GetCore().SetHeaderFloatBounds(bounds); + FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true)); + GetCore().SetHeaderBounds(bounds); } if (GetCore().HasTab()) // Ki-Dong,Hong.Temp { - int titleHeight = 0; + float titleHeight = 0.0f; if (GetCore().GetFormStyle() & FORM_STYLE_TITLE) { @@ -1039,21 +1069,21 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) _HeaderImpl* pHeaderImpl = GetHeader(); if (pHeaderImpl) { - titleHeight = pHeaderImpl->GetBounds().height; + titleHeight = pHeaderImpl->GetBoundsF().height; } } } - Rectangle indicatorBounds(0, 0, 0, 0); + FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (GetCore().IsIndicatorVisible()) { - indicatorBounds = GetCore().GetIndicatorBounds(); + indicatorBounds = GetCore().GetIndicatorBoundsF(); } - int posY = indicatorBounds.height + titleHeight; + float posY = indicatorBounds.height + titleHeight; - Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight()); + FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF()); GetCore().SetTabBounds(bounds); } @@ -1061,21 +1091,21 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) { if (GetCore().GetFooter()->GetVisibleState() && !GetCore().IsFooterTranslucent()) { - adjHeight = 0; + adjHeight = 0.0f; } else { - adjHeight = GetCore().GetToolbarHeight(false); + adjHeight = GetCore().GetToolbarHeightF(false); } if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY)) { - adjHeight = GetCore().GetToolbarHeight(false); + adjHeight = GetCore().GetToolbarHeightF(false); } - Rectangle bounds(0, GetClientBounds().y + GetClientBounds().height - adjHeight, - GetClientBounds().width, GetCore().GetToolbarHeight(false)); + FloatRectangle bounds(0.0f, GetClientBoundsF().y + GetClientBoundsF().height - adjHeight, + GetClientBoundsF().width, GetCore().GetToolbarHeightF(false)); GetCore().SetFooterBounds(bounds); } } @@ -1146,6 +1176,12 @@ _FormImpl::DeflateClientRectHeight(int height) } bool +_FormImpl::DeflateClientRectHeight(float height) +{ + return GetCore().DeflateClientRectHeight(height); +} + +bool _FormImpl::RemoveHeader(void) { _HeaderImpl* pHeaderImpl = GetHeader(); @@ -1238,13 +1274,11 @@ _FormImpl::OnAttachedToMainTree(void) r = GetCore().AttachedToMainTree(); r = _ContainerImpl::OnAttachedToMainTree(); - Rectangle indicatorBounds(0, 0, 0, 0); - FloatRectangle indicatorFloatBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f); if (FORM_STYLE_INDICATOR & GetCore().GetFormStyle()) { - indicatorBounds = GetCore().GetIndicatorBounds(); - indicatorFloatBounds = GetCore().GetIndicatorFloatBounds(); + indicatorBounds = GetCore().GetIndicatorBoundsF(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -1255,48 +1289,50 @@ _FormImpl::OnAttachedToMainTree(void) if (pHeader) { - FloatRectangle bounds(0, indicatorFloatBounds.height, GetClientBounds().width, GetCore().GetToolbarHeight(true)); - GetCore().SetHeaderFloatBounds(bounds); + FloatRectangle bounds(0.0f, indicatorBounds.height, GetClientBoundsF().width, GetCore().GetToolbarHeightF(true)); + GetCore().SetHeaderBounds(bounds); } - int titleHeight = 0; + float titleHeight = 0.0f; if (pHeader) { - titleHeight = pHeader->GetBounds().height; + titleHeight = pHeader->GetBoundsF().height; } if (pTabImpl) { - int posY = indicatorBounds.height + titleHeight; + float posY = indicatorBounds.height + titleHeight; - Rectangle bounds(0, posY, GetClientBounds().width, GetCore().GetTabHeight()); + FloatRectangle bounds(0.0f, posY, GetClientBoundsF().width, GetCore().GetTabHeightF()); GetCore().SetTabBounds(bounds); } if (pFooter) { - int adjHeight = 0; + float adjHeight = 0.0f; if (!(GetCore().GetFooter()->GetVisibleState()) || GetCore().IsFooterTranslucent()) { - adjHeight = GetCore().GetToolbarHeight(false); + adjHeight = GetCore().GetToolbarHeightF(false); } if (!(GetCore().GetFormStyle() & FORM_STYLE_FOOTER || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_0 || GetCore().GetFormStyle() & FORM_STYLE_SOFTKEY_1 || GetCore().GetFormStyle() & FORM_STYLE_OPTIONKEY)) { - adjHeight = GetCore().GetToolbarHeight(false); + adjHeight = GetCore().GetToolbarHeightF(false); } - Rectangle clientbounds = GetClientBounds(); - Rectangle bounds(0, clientbounds.y + clientbounds.height - adjHeight, clientbounds.width, GetCore().GetToolbarHeight(false)); + FloatRectangle clientbounds = GetClientBoundsF(); + FloatRectangle bounds(0.0f, clientbounds.y + clientbounds.height - adjHeight, clientbounds.width, GetCore().GetToolbarHeightF(false)); GetCore().SetFooterBounds(bounds); } UpdateOrientationStatus(); + __pOriAgent->RequestOrientationEvent(); + return r; } @@ -1310,6 +1346,26 @@ _FormImpl::OnDetachingFromMainTree(void) return r; } +bool +_FormImpl::OnNotifiedN(const _ControlImpl& source, IList* pArgs) +{ + String* pString = dynamic_cast (pArgs->GetAt(0)); + if (pString) + { + if (*pString == _REQUEST_ORIENTATION_EVENT) + { + __pOriAgent->FireOrientationEvent(); + + pArgs->RemoveAll(true); + delete pArgs; + + return true; + } + } + + return false; +} + void _FormImpl::OnFormBackRequested(Tizen::Ui::Controls::_Form& source) { @@ -1331,7 +1387,8 @@ _FormImpl::OnFormBackRequested(Tizen::Ui::Controls::_Form& source) bool _FormImpl::IsOpaque(void) const { - return true; + //return true; + return false; } _Softkey @@ -1390,11 +1447,11 @@ protected: SysLog(NID_UI_CTRL, "Unable to get the control manager.n"); return null; } - Dimension screenSize = pControlManager->GetScreenSize(); + FloatDimension screenSize = pControlManager->GetScreenSizeF(); //Set rect - (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(0, 0, screenSize.width, screenSize.height); - (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(0, 0, screenSize.height, screenSize.width); + (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(0.0f, 0.0f, screenSize.width, screenSize.height); + (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(0.0f, 0.0f, screenSize.height, screenSize.width); // Get device orientation app_device_orientation_e deviceOrientation = app_get_device_orientation(); @@ -1457,7 +1514,7 @@ protected: } _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - GetLayoutType(pControlProperty, layoutType); + __pLayoutMaker->GetLayoutType(pControlProperty, layoutType); if (layoutType == UIBUILDER_LAYOUT_NONE) { // Construct @@ -1468,7 +1525,7 @@ protected: Layout* pPortraitLayout = null; Layout* pLandscapeLayout = null; result tempResult = E_SUCCESS; - tempResult = GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); + tempResult = __pLayoutMaker->GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); if (E_SUCCESS == tempResult) { r = pForm->Construct(*pPortraitLayout, *pLandscapeLayout, style); @@ -1480,7 +1537,7 @@ protected: _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - if (GetLayoutType(pControlProperty, layoutType) == false) + if (__pLayoutMaker->GetLayoutType(pControlProperty, layoutType) == false) { return null; } @@ -1500,7 +1557,7 @@ protected: { pGridLayout = dynamic_cast(pLandscapeLayout); } - SetGridLayoutContainerProperty(pGridLayout, pControlProperty); + __pLayoutMaker->SetGridLayoutContainerProperty(pGridLayout, pControlProperty); } } delete pPortraitLayout; @@ -1534,26 +1591,29 @@ protected: isTitleAlign = true; } - if (pControl->GetElement(L"title", elementString)) + if (style & FORM_STYLE_TITLE) { - if (isTitleAlign) + if (pControl->GetElement(L"title", elementString)) { - pForm->SetTitleText(elementString, align); - } - else - { - pForm->SetTitleText(elementString); - } - } - else - { - if (isTitleAlign) - { - pForm->SetTitleText(L"", align); + if (isTitleAlign) + { + pForm->SetTitleText(elementString, align); + } + else + { + pForm->SetTitleText(elementString); + } } else { - pForm->SetTitleText(L""); + if (isTitleAlign) + { + pForm->SetTitleText(L"", align); + } + else + { + pForm->SetTitleText(L""); + } } } diff --git a/src/ui/controls/FUiCtrl_Frame.cpp b/src/ui/controls/FUiCtrl_Frame.cpp old mode 100644 new mode 100755 index 8328f19..c30b2b6 --- a/src/ui/controls/FUiCtrl_Frame.cpp +++ b/src/ui/controls/FUiCtrl_Frame.cpp @@ -29,6 +29,7 @@ #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" #include "FUi_TouchManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_Frame.h" #include "FUiCtrl_FramePresenter.h" #include "FUiCtrl_FrameEvent.h" @@ -51,16 +52,18 @@ namespace Tizen { namespace Ui { namespace Controls { _Frame::_Frame(void) : __pFramePresenter(null) , __pFrameEvent(null) - , __floatingBounds(0, 0, 0, 0) + , __floatingBounds(0.0f, 0.0f, 0.0f, 0.0f) , __showMode(FRAME_SHOW_MODE_FULL_SCREEN) , __restore(false) + , __minimized(false) , __activated(false) + , __constructed(false) , __pFormActivationChangeEventListener(null) { _FramePresenter* pPresenter = new (std::nothrow) _FramePresenter(*this); SysTryReturnVoidResult(NID_UI_CTRL, pPresenter, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); __floatingBounds.width = screen.width; __floatingBounds.height = screen.height; @@ -96,19 +99,14 @@ _Frame::~_Frame(void) _Frame* _Frame::CreateFrameN(void) { - //_VisualElement* pFrameVE = null; - -#if defined(MULTI_WINDOW) result r = E_SUCCESS; _RootVisualElement* pRootVE = null; _EflLayer* pLayer = null; -#endif _Frame* pFrame = new (std::nothrow) _Frame; SysTryCatch(NID_UI_CTRL, pFrame, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#if defined(MULTI_WINDOW) r = pFrame->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -119,10 +117,6 @@ _Frame::CreateFrameN(void) SysAssert(pLayer); pLayer->SetOpacity(1); -#endif - - //pFrameVE = pFrame->GetVisualElement(); - //pFrameVE->SetRenderOperation(_VisualElement::RENDER_OPERATION_COPY); pFrame->AcquireHandle(); @@ -163,9 +157,7 @@ _Frame::OnActivated(void) return; } -#if defined(MULTI_WINDOW) _Window::OnActivated(); -#endif _Form* pCurrentForm = GetCurrentForm(); if (pCurrentForm == null) @@ -249,14 +241,11 @@ _Frame::OnFrameActivated(void) { _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas"); -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetIndicatorShowState(false); -#else + if (GetShowMode() == FRAME_SHOW_MODE_FULL_SCREEN) { pEcoreEvas->SetIndicatorShowState(*GetRootWindow(), false); } -#endif } } @@ -286,6 +275,22 @@ _Frame::OnFrameDeactivated(void) } } +void +_Frame::OnFrameMinimized(void) +{ + IEventArg* pArg = _FrameEvent::CreateFrameEventArgN(*this, _FRAME_STATUS_MINIMIZED); + __pFrameEvent->Fire(*pArg); +} + +void +_Frame::OnFrameRestored(void) +{ + __minimized = false; + + IEventArg* pArg = _FrameEvent::CreateFrameEventArgN(*this, _FRAME_STATUS_RESTORED); + __pFrameEvent->Fire(*pArg); +} + bool _Frame::IsFocusableDescendant(const _Control* pFocus) const { @@ -312,26 +317,6 @@ _Frame::IsFocusableDescendant(const _Control* pFocus) const } void -_Frame::SetFocusOff(_Control* pFocus) -{ - _Control* pTopOfFocus = null; - _Control* pTemp = pFocus; - - while (pTemp != this) - { - pTopOfFocus = pTemp; - pTemp = pTemp->GetParent(); - } - - // [ToDo] If pTem == null??? - - if (pTopOfFocus) - { - pTopOfFocus->SetFocusOff(pFocus); - } -} - -void _Frame::SetCurrentForm(const _Form* pForm) { result r = E_SUCCESS; @@ -402,14 +387,6 @@ _Frame::GetCurrentForm(void) const return pCurrentForm; } -#if !defined(MULTI_WINDOW) -bool -_Frame::IsLayoutChangable(void) const -{ - return false; -} -#endif - bool _Frame::IsOrientationRoot(void) const { @@ -419,6 +396,8 @@ _Frame::IsOrientationRoot(void) const void _Frame::AddFrameEventListener(const _IFrameEventListener& listener) { + __constructed = true; + result r = __pFrameEvent->AddListener(listener); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -438,14 +417,43 @@ _Frame::SetFormActivationChangeEventListener(const _IFormActivationChangeEventLi void -_Frame::SetFloatingBounds(const Rectangle& rect) +_Frame::SetFloatingBounds(const FloatRectangle& rect) { __floatingBounds = rect; } +void +_Frame::SetFloatingBounds(const Rectangle& rect) +{ + __floatingBounds = _CoordinateSystemUtils::ConvertToFloat(rect); +} + result _Frame::SetShowMode(FrameShowMode showMode) { + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + SysTryReturnResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "The method cannot proceed due to a severe system error."); + + if (showMode == FRAME_SHOW_MODE_MINIMIZED) + { + if (__minimized == true) + { + return E_SUCCESS; + } + + pEcoreEvas->MinimizeWindow(*GetRootWindow()); + __minimized = true; + + return E_SUCCESS; + } + else + { + if (__minimized == true) + { + return E_SYSTEM; + } + } + bool changeMode = true; if ((showMode == FRAME_SHOW_MODE_PARTIAL_SCREEN) || (showMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING)) @@ -463,9 +471,6 @@ _Frame::SetShowMode(FrameShowMode showMode) SysTryReturnResult(NID_UI_CTRL, changeMode == true, E_SYSTEM, "The method cannot proceed due to a severe system error."); - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysTryReturnResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "The method cannot proceed due to a severe system error."); - int oldShowMode = __showMode; __showMode = showMode; @@ -476,27 +481,23 @@ _Frame::SetShowMode(FrameShowMode showMode) case FRAME_SHOW_MODE_FULL_SCREEN: if (oldShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING) { -#if !defined(MULTI_WINDOW) - r = pEcoreEvas->SetFloatingMode(false); -#else r = pEcoreEvas->SetFloatingMode(*GetRootWindow(), false); -#endif SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } if (oldShowMode != FRAME_SHOW_MODE_FULL_SCREEN) { - Dimension screen = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF(); __restore = true; if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) { - SetBounds(Rectangle(0, 0, screen.width, screen.height)); + SetBounds(FloatRectangle(0.0f, 0.0f, screen.width, screen.height)); } else { - SetBounds(Rectangle(0, 0, screen.height, screen.width)); + SetBounds(FloatRectangle(0.0f, 0.0f, screen.height, screen.width)); } __restore = false; @@ -506,11 +507,7 @@ _Frame::SetShowMode(FrameShowMode showMode) case FRAME_SHOW_MODE_PARTIAL_SCREEN: if (oldShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING) { -#if !defined(MULTI_WINDOW) - r = pEcoreEvas->SetFloatingMode(false); -#else r = pEcoreEvas->SetFloatingMode(*GetRootWindow(), false); -#endif SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -520,22 +517,14 @@ _Frame::SetShowMode(FrameShowMode showMode) } else if (oldShowMode == FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING) { -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetWindowBounds(__floatingBounds); -#else - pEcoreEvas->SetWindowBounds(*GetRootWindow(), __floatingBounds); -#endif + pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(__floatingBounds)); } break; case FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING: if (oldShowMode != FRAME_SHOW_MODE_PARTIAL_SCREEN_FLOATING) { -#if !defined(MULTI_WINDOW) - r = pEcoreEvas->SetFloatingMode(true); -#else r = pEcoreEvas->SetFloatingMode(*GetRootWindow(), true); -#endif SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -555,7 +544,14 @@ _Frame::SetShowMode(FrameShowMode showMode) FrameShowMode _Frame::GetShowMode(void) const { - return __showMode; + if (__minimized == true) + { + return FRAME_SHOW_MODE_MINIMIZED; + } + else + { + return __showMode; + } } bool @@ -597,16 +593,12 @@ _Frame::OnChildDetached(const _Control& child) { _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas"); -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetIndicatorShowState(false); -#else pEcoreEvas->SetIndicatorShowState(*GetRootWindow(), false); -#endif } } result -_Frame::OnBoundsChanging(const Rectangle& bounds) +_Frame::OnBoundsChanging(const FloatRectangle& bounds) { if (__restore == false) { @@ -615,17 +607,20 @@ _Frame::OnBoundsChanging(const Rectangle& bounds) if ((__showMode == FRAME_SHOW_MODE_FULL_SCREEN) && (__restore == false)) { - return E_SUCCESS; + if (__constructed == false) + { + return E_SUCCESS; + } + else + { + return E_UNSUPPORTED_OPERATION; + } } _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetWindowBounds(bounds); -#else - pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds); -#endif + pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds)); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -639,48 +634,24 @@ _Frame::OnAttached(void) _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); SysAssert(pEcoreEvas); -#if !defined(MULTI_WINDOW) - pEcoreEvas->SetWindowVisibleState(true); -#else pEcoreEvas->SetWindowVisibleState(*GetRootWindow(), true); -#endif return E_SUCCESS; } -#if !defined(MULTI_WINDOW) -result -_Frame::OnAttachedToMainTree(void) +void +_Frame::OnBackgroundColorChanged(Color& backgroundColor) { - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysAssert(pEcoreEvas); - - _RootVisualElement* pRootVE = pEcoreEvas->GetRootVisualElement(); + _RootVisualElement* pRootVE = GetRootVisualElement(); SysAssert(pRootVE); _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer()); SysAssert(pLayer); - pLayer->SetShowState(true); - pRootVE->SetShowState(true); - - return E_SUCCESS; -} - -void -_Frame::OnVisibleStateChanged(void) -{ - _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); - SysTryReturnVoidResult(NID_UI, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - - bool visibleState = GetVisibleState(); + byte alpha = backgroundColor.GetAlpha(); + float opacity = static_cast(alpha) / 255.0f; - pEcoreEvas->SetWindowVisibleState(visibleState); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - SetLastResult(E_SUCCESS); + pLayer->SetOpacity(opacity); } -#endif }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_FrameEvent.cpp b/src/ui/controls/FUiCtrl_FrameEvent.cpp index 0ce7b77..f4e7df5 100644 --- a/src/ui/controls/FUiCtrl_FrameEvent.cpp +++ b/src/ui/controls/FUiCtrl_FrameEvent.cpp @@ -161,6 +161,14 @@ _FrameEvent::FireImpl(IEventListener& listener, const IEventArg& arg) { pFrameListener->OnFrameDeactivated(*pArg->GetSource()); } + else if (pArg->GetType() == _FRAME_STATUS_MINIMIZED) + { + pFrameListener->OnFrameMinimized(*pArg->GetSource()); + } + else if (pArg->GetType() == _FRAME_STATUS_RESTORED) + { + pFrameListener->OnFrameRestored(*pArg->GetSource()); + } return; } diff --git a/src/ui/controls/FUiCtrl_FrameImpl.cpp b/src/ui/controls/FUiCtrl_FrameImpl.cpp index 36b3844..85eb087 100644 --- a/src/ui/controls/FUiCtrl_FrameImpl.cpp +++ b/src/ui/controls/FUiCtrl_FrameImpl.cpp @@ -22,6 +22,7 @@ #include #include "FUi_ControlManager.h" #include "FUi_OrientationAgent.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrlForm.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_FormImpl.h" @@ -29,6 +30,7 @@ #include "FUiCtrl_PublicFrameEvent.h" using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -36,6 +38,8 @@ using namespace Tizen::Ui::Animations; namespace Tizen { namespace Ui { namespace Controls { +const String _REQUEST_ORIENTATION_EVENT = L"RequestOrientationEvent"; + const _FrameImpl* _FrameImpl::GetInstance(const Frame& frame) { @@ -166,6 +170,42 @@ _FrameImpl::SetCurrentForm(const _FormImpl& formImpl) return E_SUCCESS; } +result +_FrameImpl::SetCurrentForm(_FormImpl* pFormImpl) +{ + result r = E_SUCCESS; + + _FormImpl* pNewCurForm = pFormImpl; + + SysTryReturn(NID_UI_CTRL, + pNewCurForm != null, E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The Form is not initialized."); + + SysTryReturn(NID_UI_CTRL, + IsAncestorOf(pNewCurForm), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] The Form is not the child of this Frame."); + + if (GetCore().GetShowMode() != FRAME_SHOW_MODE_FULL_SCREEN) + { + SysTryReturn(NID_UI_CTRL, !(pNewCurForm->GetFormStyle() & FORM_STYLE_INDICATOR), E_INVALID_ARG, E_INVALID_ARG, "Only Frame whose show mode is @c FRAME_SHOW_MODE_FULL_SCREEN can set a Form which has the style of @c FORM_STYLE_INDICATOR as the current form."); + } + + + r = MoveChildToTop(*pNewCurForm); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + // [ToDo] Change the method to return result. And the arg should be reference. + GetCore().SetCurrentForm(&pNewCurForm->GetCore()); + r = GetLastResult(); + SysAssert(r == E_SUCCESS); // [ToDo] Exception check. + + pNewCurForm->UpdateOrientationStatus(); + + // [ToDo] Check last result + SysAssert(GetLastResult() == E_SUCCESS); + return E_SUCCESS; +} + // [ToDo] This function should return _FormImpl*. _FormImpl* _FrameImpl::GetCurrentForm(void) const @@ -262,16 +302,6 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation) SysAssert(pCoreManager); const Dimension& screenSize = pCoreManager->GetScreenSize(); -#if !defined(MULTI_WINDOW) - if (orientation == _CONTROL_ORIENTATION_PORTRAIT) - { - SetSize(screenSize); - } - else - { - SetSize(Dimension(screenSize.height, screenSize.width)); - } -#else if (GetCore().GetShowMode() == FRAME_SHOW_MODE_FULL_SCREEN) { if (orientation == _CONTROL_ORIENTATION_PORTRAIT) @@ -283,7 +313,6 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation) SetSize(Dimension(screenSize.height, screenSize.width)); } } -#endif SetResizable(resizable); } @@ -366,10 +395,36 @@ _FrameImpl::OnFrameDeactivated(const _Frame& source) } void +_FrameImpl::OnFrameMinimized(const _Frame& source) +{ + if (__pFrameEvent) + { + IEventArg* pEventArg = _PublicFrameEvent::CreateFrameEventArgN(_FrameImpl::GetPublic(), FRAME_STATE_MINIMIZED); + if (pEventArg) + { + __pFrameEvent->Fire(*pEventArg); + } + } +} + +void +_FrameImpl::OnFrameRestored(const _Frame& source) +{ + if (__pFrameEvent) + { + IEventArg* pEventArg = _PublicFrameEvent::CreateFrameEventArgN(_FrameImpl::GetPublic(), FRAME_STATE_RESTORED); + if (pEventArg) + { + __pFrameEvent->Fire(*pEventArg); + } + } +} + +void _FrameImpl::OnBoundsChanged(void) { int childcount = GetChildCount(); - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); for (int i = 0 ; i < childcount ; i++) { @@ -381,16 +436,16 @@ _FrameImpl::OnBoundsChanged(void) { if (pForm->GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || pForm->GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE) { - pForm->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + pForm->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); } else { - pForm->SetBounds(Rectangle(0, 0, GetBounds().height, GetBounds().width)); + pForm->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.height, bounds.width)); } } else { - pForm->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + pForm->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); } } @@ -400,6 +455,36 @@ _FrameImpl::OnBoundsChanged(void) } +result +_FrameImpl::OnAttachedToMainTree(void) +{ + result r = _WindowImpl::OnAttachedToMainTree(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pOrientationAgent->RequestOrientationEvent(); + + return r; +} + +bool +_FrameImpl::OnNotifiedN(const _ControlImpl& source, IList* pArgs) +{ + String* pString = dynamic_cast (pArgs->GetAt(0)); + if (pString) + { + if (*pString == _REQUEST_ORIENTATION_EVENT) + { + __pOrientationAgent->FireOrientationEvent(); + + pArgs->RemoveAll(true); + delete pArgs; + + return true; + } + } + + return false; +} void _FrameImpl::AddOrientationEventListener(Tizen::Ui::IOrientationEventListener& listener) @@ -446,7 +531,14 @@ _FrameImpl::UpdateOrientationStatus(void) bool _FrameImpl::IsOpaque(void) const { - return true; + //return true; + return false; +} + +void +_FrameImpl::SetFloatingBounds(const FloatRectangle& rect) +{ + GetCore().SetFloatingBounds(rect); } void diff --git a/src/ui/controls/FUiCtrl_Gallery.cpp b/src/ui/controls/FUiCtrl_Gallery.cpp old mode 100644 new mode 100755 index 5d2e497..3cbf5ae --- a/src/ui/controls/FUiCtrl_Gallery.cpp +++ b/src/ui/controls/FUiCtrl_Gallery.cpp @@ -16,6 +16,11 @@ // #include #include +#include "FUi_AccessibilityContainer.h" +#include "FUi_AccessibilityElement.h" +#include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_ResourceManager.h" #include "FUi_TouchFlickGestureDetector.h" #include "FUi_TouchTapGestureDetector.h" #include "FUi_TouchPinchGestureDetector.h" @@ -39,8 +44,13 @@ _Gallery::_Gallery(void) : __pRenderer(null) , __pPresenter(null) , __modelInitialized(false) + , __pGalleryImageElement(null) { - // Do nothing. + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + if (pContainer != null) + { + pContainer->Activate(true); + } } _Gallery::~_Gallery(void) @@ -59,14 +69,28 @@ _Gallery::~_Gallery(void) SysAssert(false); } - r = __tapGesture.RemoveGestureListener(*this); + r = __oneTapGesture.RemoveGestureListener(*this); if (r != E_SUCCESS) { SetLastResult(r); SysAssert(false); } - r = RemoveGestureDetector(__tapGesture); + r = RemoveGestureDetector(__oneTapGesture); + if (r != E_SUCCESS) + { + SetLastResult(r); + SysAssert(false); + } + + r = __twoTapGesture.RemoveGestureListener(*this); + if (r != E_SUCCESS) + { + SetLastResult(r); + SysAssert(false); + } + + r = RemoveGestureDetector(__twoTapGesture); if (r != E_SUCCESS) { SetLastResult(r); @@ -87,6 +111,8 @@ _Gallery::~_Gallery(void) SysAssert(false); } + RemoveGalleryAccessibilityElements(); + delete __pRenderer; delete __pPresenter; } @@ -123,7 +149,7 @@ _Gallery::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor pRenderer = _GalleryRenderer::CreateGalleryRendererN((Tizen::Ui::_Control&)*this); SysTryCatch(NID_UI_CTRL, pRenderer != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to create the _GalleryRenderer."); - pPresenter = _GalleryPresenter::CreateGalleryPresenterN((_IGalleryRenderer&)*pRenderer, pGalleryItemProviderAdaptor); + pPresenter = _GalleryPresenter::CreateGalleryPresenterN((_IGalleryRenderer&)*pRenderer, pGalleryItemProviderAdaptor, this); SysTryCatch(NID_UI_CTRL, pPresenter != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to create the _GalleryPresenter."); r = pRenderer->AddNotiListener(*pPresenter); @@ -137,13 +163,22 @@ _Gallery::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor r = _Control::AddGestureDetector(__flickGesture); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = __tapGesture.AddGestureListener(*this); + r = __oneTapGesture.AddGestureListener(*this); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __oneTapGesture.SetTapCount(1); + r = _Control::AddGestureDetector(__oneTapGesture); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __twoTapGesture.AddGestureListener(*this); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __tapGesture.SetTapCount(2); - r = _Control::AddGestureDetector(__tapGesture); + __twoTapGesture.SetTapCount(2); + r = _Control::AddGestureDetector(__twoTapGesture); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + __oneTapGesture.StartOnFailureOf(__twoTapGesture); + SetMultiTouchEnabled(true); r = _Control::AddGestureDetector(__pinchGesture); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -283,33 +318,58 @@ result _Gallery::RequestToLoadItem(int itemIndex) { SysTryReturnResult(NID_UI_CTRL, __modelInitialized == true, E_INVALID_OPERATION, "Does not call to first draw."); - return GetPresenter().RequestToLoadItem(itemIndex); + result r = GetPresenter().RequestToLoadItem(itemIndex); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagation.", GetErrorMessage(r)); + + InitializeAccessibilityElement(); + + return E_SUCCESS; } result _Gallery::RequestToUnloadItem(int itemIndex) { SysTryReturnResult(NID_UI_CTRL, __modelInitialized == true, E_INVALID_OPERATION, "Does not call to first draw."); - return GetPresenter().RequestToUnloadItem(itemIndex); + result r = GetPresenter().RequestToUnloadItem(itemIndex); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagation.", GetErrorMessage(r)); + + InitializeAccessibilityElement(); + + return E_SUCCESS; } result _Gallery::RequestToUnloadAllItems(void) { - return GetPresenter().RequestToUnloadAllItems(); + result r = GetPresenter().RequestToUnloadAllItems(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagation.", GetErrorMessage(r)); + + InitializeAccessibilityElement(); + + return E_SUCCESS; } result _Gallery::RequestToUpdateItem(int itemIndex) { SysTryReturnResult(NID_UI_CTRL, __modelInitialized == true, E_INVALID_OPERATION, "Does not call to first draw."); - return GetPresenter().RequestToUpdateItem(itemIndex); + result r = GetPresenter().RequestToUpdateItem(itemIndex); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagation.", GetErrorMessage(r)); + + InitializeAccessibilityElement(); + + return E_SUCCESS; } result _Gallery::RequestToUpdateAllItems(void) { - return GetPresenter().RequestToUpdateAllItems(); + result r = GetPresenter().RequestToUpdateAllItems(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagation.", GetErrorMessage(r)); + + InitializeAccessibilityElement(); + + return E_SUCCESS; } bool @@ -340,13 +400,21 @@ _Gallery::OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture) bool _Gallery::OnTapGestureDetected(_TouchTapGestureDetector& gesture) { - Point pos(0, 0); - Tizen::Ui::_TouchInfo touchInfo(0, _TOUCH_DOUBLE_PRESSED, pos, false, 0); - _GalleryViewEventInfo viewEventInfo(touchInfo); - _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_DOUBLE_PRESSED, &viewEventInfo); - - bool r = GetPresenter().PostEvent(viewEvent); - SysTryReturn(NID_UI_CTRL, r == true, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + if (gesture.GetTapCount() == 1) + { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + } + else + { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_MULTI_TAP); + Point pos(0, 0); + Tizen::Ui::_TouchInfo touchInfo(0, _TOUCH_DOUBLE_PRESSED, pos, false, 0); + _GalleryViewEventInfo viewEventInfo(touchInfo); + _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_DOUBLE_PRESSED, &viewEventInfo); + + bool r = GetPresenter().PostEvent(viewEvent); + SysTryReturn(NID_UI_CTRL, r == true, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + } return true; } @@ -368,7 +436,7 @@ bool _Gallery::OnPinchGestureChanged(_TouchPinchGestureDetector& gesture) { _GalleryViewEventInfo viewEventInfo; - viewEventInfo.SetPinchCenterPosition(gesture.GetCenterPoint()); + viewEventInfo.SetPinchCenterPosition(_CoordinateSystemUtils::ConvertToFloat(gesture.GetCenterPoint())); viewEventInfo.SetPinchArea(gesture.GetScale()); _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_TOUCH_PINCH_ZOOM, &viewEventInfo); bool r = GetPresenter().PostEvent(viewEvent); @@ -444,12 +512,12 @@ _Gallery::OnDraw(void) void _Gallery::OnBoundsChanged(void) { -// GetRenderer().OnBoundsChanged(); _GalleryViewEventInfo viewEventInfo; _GalleryViewEvent viewEvent(GALLERY_VIEW_EVENT_BOUNDS_CHANGED, &viewEventInfo); bool r = GetPresenter().PostEvent(viewEvent); SysTryReturnVoidResult(NID_UI_CTRL, r == true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + ResizeGalleryAccessibilityElement(); } void @@ -476,4 +544,81 @@ _Gallery::GetEffect(void) return GetRenderer().GetEffect(); } +result +_Gallery::OnAttachedToMainTree(void) +{ + InitializeAccessibilityElement(); + + return E_SUCCESS; +} + +void +_Gallery::InitializeAccessibilityElement(void) +{ + if (_AccessibilityManager::IsActivated() != true) + { + return; + } + + if (GetItemCount() > 0) + { + AddGalleryAccessibilityElement(); + } + else + { + RemoveGalleryAccessibilityElements(); + } + + return; +} + +void +_Gallery::ResizeGalleryAccessibilityElement(void) +{ + if (_AccessibilityManager::IsActivated() == true && __pGalleryImageElement != null) + { + // TODO : need _AccessibilityElement::SetBoundsF() + FloatRectangle floatRect = __pRenderer->GetCanvasImageBounds(__pPresenter->SearchCanvasIndex(GetCurrentItemIndex())); + Rectangle rect(floatRect.x, floatRect.y, floatRect.width, floatRect.height); + __pGalleryImageElement->SetBounds(rect); + } + + return; +} + +void +_Gallery::RemoveGalleryAccessibilityElements(void) +{ + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + + if (pContainer != null && __pGalleryImageElement != null) + { + result r = pContainer->RemoveElement(*__pGalleryImageElement); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + __pGalleryImageElement = null; + } +} + +void +_Gallery::AddGalleryAccessibilityElement(void) +{ + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + if(pContainer != null && __pGalleryImageElement == null) + { + _AccessibilityElement* pGalleryElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, pGalleryElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + FloatRectangle floatRect = __pRenderer->GetCanvasImageBounds(__pPresenter->SearchCanvasIndex(GetCurrentItemIndex())); + Rectangle rect(floatRect.x, floatRect.y, floatRect.width, floatRect.height); + pGalleryElement->SetBounds(rect); + pGalleryElement->SetTrait(L"Image"); + pGalleryElement->SetName(L"GalleryImage"); + + pContainer->AddElement(*pGalleryElement); + __pGalleryImageElement = pGalleryElement; + } + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_GalleryBitmap.cpp b/src/ui/controls/FUiCtrl_GalleryBitmap.cpp old mode 100644 new mode 100755 index 90046d2..9e4c154 --- a/src/ui/controls/FUiCtrl_GalleryBitmap.cpp +++ b/src/ui/controls/FUiCtrl_GalleryBitmap.cpp @@ -119,10 +119,10 @@ _GalleryBitmap::SetSize(const Dimension& size) return E_SUCCESS; } -Dimension +FloatDimension _GalleryBitmap::GetSize(void) const { - Dimension dim; + FloatDimension dim; dim.width = __pBitmap->GetWidth(); dim.height = __pBitmap->GetHeight(); @@ -130,16 +130,13 @@ _GalleryBitmap::GetSize(void) const } result -_GalleryBitmap::Initialize(const Dimension& size, _GalleryFittingType fittingType) +_GalleryBitmap::Initialize(const FloatDimension& size, _GalleryFittingType fittingType) { if (IsInitialize() == false) { result r = AdjustBitmapRotate(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = AdjustBitmapSize(size, fittingType); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - SetAdjustBitmapFlag(true); } @@ -147,56 +144,9 @@ _GalleryBitmap::Initialize(const Dimension& size, _GalleryFittingType fittingTyp } result -_GalleryBitmap::AdjustBitmapSize(const Dimension& size, _GalleryFittingType fittingType) -{ - Dimension scaledSize = size; - if (fittingType == GALLERY_FITTING_TYPE_NONE) - { - return E_SUCCESS; - } - - if (fittingType != GALLERY_FITTING_TYPE_FIT_XY) - { - float width = GetSize().width; - float height = GetSize().height; - - float widthFactor = (float)size.width / width; - float heightFactor = (float)size.height / height; - - if (fittingType == GALLERY_FITTING_TYPE_STRECTABLE) - { - if (widthFactor < 1.0f && heightFactor < 1.0f) - { - return E_SUCCESS; - } - } - else if (fittingType == GALLERY_FITTING_TYPE_SHRINKABLE) - { - if (widthFactor > 1.0f && heightFactor > 1.0f) - { - return E_SUCCESS; - } - } - - if (widthFactor > heightFactor) - { - scaledSize.width = width * heightFactor + 0.5f; - } - else - { - scaledSize.height = height * widthFactor + 0.5f; - } - } - - result r = __pBitmap->Scale(scaledSize); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - - return E_SUCCESS; -} - -result _GalleryBitmap::AdjustBitmapRotate(void) { + // TODO : need _Effect::RotateImageF() Bitmap* pImage = null; _Util::LockManager* pSrcLock = null; _Util::LockManager* pDstLock = null; diff --git a/src/ui/controls/FUiCtrl_GalleryCanvas.cpp b/src/ui/controls/FUiCtrl_GalleryCanvas.cpp old mode 100644 new mode 100755 index 3fc7f6b..88917f5 --- a/src/ui/controls/FUiCtrl_GalleryCanvas.cpp +++ b/src/ui/controls/FUiCtrl_GalleryCanvas.cpp @@ -17,8 +17,7 @@ #include #include #include -#include -#include +#include #include #include #include "FUiAnim_VisualElement.h" @@ -113,7 +112,7 @@ _GalleryAnimationProvider::GetTimingFunc(_GalleryAnimationTimingFunction timingF // _GalleryCanvas _GalleryCanvas* -_GalleryCanvas::CreateGalleryCanvasN(Rectangle& canvasBounds) +_GalleryCanvas::CreateGalleryCanvasN(FloatRectangle& canvasBounds) { result r = E_SUCCESS; @@ -135,14 +134,14 @@ CATCH: } result -_GalleryCanvas::SetImage(const _GalleryBitmap* pImage, const Rectangle& viewBounds, _GalleryFittingType fittingType) +_GalleryCanvas::SetImage(const _GalleryBitmap* pImage, const FloatRectangle& viewBounds, _GalleryFittingType fittingType) { if (pImage == null) { return E_SUCCESS; } - Rectangle canvasBounds = GetBounds(); + FloatRectangle canvasBounds = GetBounds(); canvasBounds.width = viewBounds.width; canvasBounds.height = viewBounds.height; result r = SetBounds(canvasBounds); @@ -160,11 +159,11 @@ _GalleryCanvas::SetImage(const _GalleryBitmap* pImage, const Rectangle& viewBoun result r = __pImage->Initialize(__pRootCanvas->GetControlSize(), fittingType); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Dimension imageSize = __pImage->GetSize(); - Point position(0,0); + FloatDimension imageSize = GetScaledBitmapSize(*__pImage, __pRootCanvas->GetControlSize(), fittingType); + FloatPoint position(0,0); if (__imageVerticalAlignment == GALLERY_VERTICAL_ALIGN_MIDDLE) { - position.y = (__bounds.height - imageSize.height) >> 1; + position.y = (__bounds.height - imageSize.height) / 2; } else if (__imageVerticalAlignment == GALLERY_VERTICAL_ALIGN_BOTTOM) { @@ -172,14 +171,14 @@ _GalleryCanvas::SetImage(const _GalleryBitmap* pImage, const Rectangle& viewBoun } if (__imageHorizontalAlignment == GALLERY_HORIZONTAL_ALIGN_CENTER) { - position.x = (__bounds.width - imageSize.width) >> 1; + position.x = (__bounds.width - imageSize.width) / 2; } else if (__imageHorizontalAlignment == GALLERY_HORIZONTAL_ALIGN_RIGHT) { position.x = (__bounds.width - imageSize.width); } - Rectangle visualElementBounds(position.x, position.y, imageSize.width, imageSize.height); + FloatRectangle visualElementBounds(position.x, position.y, imageSize.width, imageSize.height); r = SetVisualElementBounds(visualElementBounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -201,20 +200,19 @@ _GalleryCanvas::GetImage(void) const } result -_GalleryCanvas::SetBounds(const Rectangle& bounds) +_GalleryCanvas::SetBounds(const FloatRectangle& bounds) { - SysTryReturnResult(NID_UI_CTRL, bounds.width >= 0 && bounds.height >= 0, E_INVALID_ARG, + SysTryReturnResult(NID_UI_CTRL, bounds.width >= 0.0 && bounds.height >= 0.0, E_INVALID_ARG, "The bounds width or height is negative value."); __bounds = bounds; if (GetFrameVisualElement().IsClipChildrenEnabled() == true) { - FloatRectangle floatBounds(bounds.x, bounds.y, bounds.width, bounds.height); - GetFrameVisualElement().SetBounds(floatBounds); + GetFrameVisualElement().SetBounds(bounds); } return E_SUCCESS; } -const Rectangle& +const FloatRectangle& _GalleryCanvas::GetBounds(void) const { return __bounds; @@ -254,11 +252,14 @@ _GalleryCanvas::LoadImage(void) _GalleryBitmap* pImage = GetImage(); if (pImage != null) { + FloatRectangle rect = GetImageVisualElementBounds(); + rect.x = 0.0; + rect.y = 0.0; pCanvas = GetImageVisualElement().GetCanvasN(); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = pCanvas->DrawBitmap(Point(0, 0), *pImage->GetInternalBitmap()); + r = pCanvas->DrawBitmap(rect, *pImage->GetInternalBitmap()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = GetImageVisualElement().SetFlushNeeded(); @@ -315,12 +316,11 @@ _GalleryCanvas::~_GalleryCanvas(void) } result -_GalleryCanvas::Construct(Rectangle& canvasBounds) +_GalleryCanvas::Construct(FloatRectangle& canvasBounds) { result r = E_SUCCESS; _VisualElement* pImageVisualElement = null; _VisualElement* pFrameVisualElement = null; - FloatRectangle floatBounds(canvasBounds.x, canvasBounds.y, canvasBounds.width, canvasBounds.height); pImageVisualElement = new (std::nothrow) _VisualElement(); SysTryCatch(NID_UI_CTRL, pImageVisualElement != null, , E_OUT_OF_MEMORY, @@ -330,7 +330,7 @@ _GalleryCanvas::Construct(Rectangle& canvasBounds) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); pImageVisualElement->SetImplicitAnimationEnabled(false); - pImageVisualElement->SetBounds(floatBounds); + pImageVisualElement->SetBounds(canvasBounds); pImageVisualElement->SetShowState(true); @@ -346,7 +346,7 @@ _GalleryCanvas::Construct(Rectangle& canvasBounds) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); pFrameVisualElement->SetImplicitAnimationEnabled(false); - pFrameVisualElement->SetBounds(floatBounds); + pFrameVisualElement->SetBounds(canvasBounds); pFrameVisualElement->SetShowState(true); @@ -441,24 +441,20 @@ _GalleryCanvas::GetCanvasFactor(void) const } result -_GalleryCanvas::SetVisualElementBounds(const Rectangle& bounds) +_GalleryCanvas::SetVisualElementBounds(const FloatRectangle& bounds) { __visualElementBoundsChanged = true; - FloatRectangle floatBounds(bounds.x, bounds.y, bounds.width, bounds.height); - return GetImageVisualElement().SetBounds(floatBounds); + return GetImageVisualElement().SetBounds(bounds); } -Rectangle +FloatRectangle _GalleryCanvas::GetImageVisualElementBounds(void) const { - FloatRectangle floatRect = GetImageVisualElement().GetBounds(); - Rectangle bounds(floatRect.x, floatRect.y, floatRect.width, floatRect.height); - - return bounds; + return GetImageVisualElement().GetBounds(); } void -_GalleryCanvas::SetImageBounds(const Rectangle& canvasBounds) +_GalleryCanvas::SetImageBounds(const FloatRectangle& canvasBounds) { float factor = GetCanvasFactor(); if (__visualElementBoundsChanged == true) @@ -470,7 +466,7 @@ _GalleryCanvas::SetImageBounds(const Rectangle& canvasBounds) if (__imageVerticalAlignment == GALLERY_VERTICAL_ALIGN_MIDDLE) { - __imageBounds.y = (canvasBounds.height - __imageBounds.height) >> 1; + __imageBounds.y = (canvasBounds.height - __imageBounds.height) / 2; } else if (__imageVerticalAlignment == GALLERY_VERTICAL_ALIGN_BOTTOM) { @@ -478,7 +474,7 @@ _GalleryCanvas::SetImageBounds(const Rectangle& canvasBounds) } if (__imageHorizontalAlignment == GALLERY_HORIZONTAL_ALIGN_CENTER) { - __imageBounds.x = (canvasBounds.width - __imageBounds.width) >> 1; + __imageBounds.x = (canvasBounds.width - __imageBounds.width) / 2; } else if (__imageHorizontalAlignment == GALLERY_HORIZONTAL_ALIGN_RIGHT) { @@ -488,13 +484,13 @@ _GalleryCanvas::SetImageBounds(const Rectangle& canvasBounds) return; } -Rectangle +FloatRectangle _GalleryCanvas::GetOriginalImageBounds(void) const { return __originalImageBounds; } -Rectangle +FloatRectangle _GalleryCanvas::GetImageBounds(void) const { return __imageBounds; @@ -532,10 +528,10 @@ _GalleryCanvas::GetImageAnchor(void) const return __imageAnchor; } -Rectangle +FloatRectangle _GalleryCanvas::GetAlignBoundary(void) const { - Rectangle imageBounds = GetImageBounds(); + FloatRectangle imageBounds = GetImageBounds(); if (__originalImageBounds.width != imageBounds.width || __originalImageBounds.height != imageBounds.height) { imageBounds.x += GetBounds().x; @@ -544,7 +540,7 @@ _GalleryCanvas::GetAlignBoundary(void) const } else { - return Rectangle(-1, -1, -1, -1); + return FloatRectangle(-1, -1, -1, -1); } } @@ -570,6 +566,50 @@ _GalleryCanvas::GetImageAlignment(_GalleryVerticalAlignment& imageVerticalAlignm imageHorizontalAlignment = __imageHorizontalAlignment; } +FloatDimension +_GalleryCanvas::GetScaledBitmapSize(_GalleryBitmap& galleryBitmap, const FloatDimension& size, _GalleryFittingType fittingType) const +{ + FloatDimension scaledSize = size; + if (fittingType == GALLERY_FITTING_TYPE_NONE) + { + return scaledSize; + } + + if (fittingType != GALLERY_FITTING_TYPE_FIT_XY) + { + float width = galleryBitmap.GetSize().width; + float height = galleryBitmap.GetSize().height; + + float widthFactor = size.width / width; + float heightFactor = size.height / height; + + if (fittingType == GALLERY_FITTING_TYPE_STRECTABLE) + { + if (widthFactor < 1.0f && heightFactor < 1.0f) + { + return scaledSize; + } + } + else if (fittingType == GALLERY_FITTING_TYPE_SHRINKABLE) + { + if (widthFactor > 1.0f && heightFactor > 1.0f) + { + return scaledSize; + } + } + + if (widthFactor > heightFactor) + { + scaledSize.width = width * heightFactor + 0.5f; + } + else + { + scaledSize.height = height * widthFactor + 0.5f; + } + } + return scaledSize; +} + // _GalleryRootCanvas _GalleryRootCanvas* @@ -604,21 +644,21 @@ _GalleryRootCanvas::GetBackgroundColor(void) const } result -_GalleryRootCanvas::SetBounds(const Rectangle& bounds) +_GalleryRootCanvas::SetBounds(const FloatRectangle& bounds) { return GetControl().SetBounds(bounds); } -Rectangle +FloatRectangle _GalleryRootCanvas::GetBounds(void) const { - return GetControl().GetBounds(); + return GetControl().GetBoundsF(); } -Dimension +FloatDimension _GalleryRootCanvas::GetControlSize(void) const { - return GetControl().GetSize(); + return GetControl().GetSizeF(); } result @@ -666,7 +706,6 @@ _GalleryRootCanvas::RemoveChildCanvas(_GalleryCanvas& canvas) result _GalleryRootCanvas::RefreshCanvas(void) { - //GetControl().Draw(); GetControl().Invalidate(); return E_SUCCESS; } diff --git a/src/ui/controls/FUiCtrl_GalleryCanvasManager.cpp b/src/ui/controls/FUiCtrl_GalleryCanvasManager.cpp old mode 100644 new mode 100755 index 29283ec..f8745c4 --- a/src/ui/controls/FUiCtrl_GalleryCanvasManager.cpp +++ b/src/ui/controls/FUiCtrl_GalleryCanvasManager.cpp @@ -30,7 +30,7 @@ namespace Tizen { namespace Ui { namespace Controls { _GalleryCanvasManager* _GalleryCanvasManager::CreateCanvasManagerN(_Control& control, int initialCanvasCount, - Rectangle& initialCanvasBounds, _GalleryAnimationProvider* pVEDelegator) + FloatRectangle& initialCanvasBounds, _GalleryAnimationProvider* pVEDelegator) { result r = E_SUCCESS; @@ -54,7 +54,7 @@ CATCH: } result -_GalleryCanvasManager::ResetCanvasManager(int canvasCount, Rectangle& canvasBounds) +_GalleryCanvasManager::ResetCanvasManager(int canvasCount, FloatRectangle& canvasBounds) { SysTryReturn(NID_UI_CTRL, canvasCount >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The maxCount parameter is invalid."); @@ -132,7 +132,7 @@ _GalleryCanvasManager::ReleaseAllCanvasResource(void) } result -_GalleryCanvasManager::ResetAllCanvas(Tizen::Graphics::Rectangle& canvasBounds) +_GalleryCanvasManager::ResetAllCanvas(Tizen::Graphics::FloatRectangle& canvasBounds) { _GalleryCanvas* pCanvas = null; result r = E_SUCCESS; @@ -214,7 +214,7 @@ _GalleryCanvasManager::~_GalleryCanvasManager(void) result -_GalleryCanvasManager::Construct(_Control& control, int initialCanvasCount, Rectangle& initialCanvasBounds) +_GalleryCanvasManager::Construct(_Control& control, int initialCanvasCount, FloatRectangle& initialCanvasBounds) { result r = E_SUCCESS; _GalleryRootCanvas* pRootCanvas = null; diff --git a/src/ui/controls/FUiCtrl_GalleryImageReader.cpp b/src/ui/controls/FUiCtrl_GalleryImageReader.cpp old mode 100644 new mode 100755 index 72c0b6e..1ea2e56 --- a/src/ui/controls/FUiCtrl_GalleryImageReader.cpp +++ b/src/ui/controls/FUiCtrl_GalleryImageReader.cpp @@ -48,7 +48,8 @@ _GalleryImageReader::~_GalleryImageReader(void) } _GalleryBitmap* -_GalleryImageReader::GetPartialImageFromFileN(int index, const Rectangle& partialBounds, const Dimension& imageSize) const +_GalleryImageReader::GetPartialImageFromFileN(int index, + const FloatRectangle& partialBounds, const FloatDimension& imageSize) const { SysTryReturn(NID_UI_CTRL, index >= 0, null, E_INVALID_ARG, "[E_INVALID_ARG] The index argument is negative value."); SysTryReturn(NID_UI_CTRL, index < __galleryModel.GetItemCount(), null, E_OUT_OF_RANGE, @@ -94,7 +95,7 @@ _GalleryImageReader::GetItemImage(int index) const } void -_GalleryImageReader::LoadPartialImageFromFile(int index, const Dimension& imageSize) +_GalleryImageReader::LoadPartialImageFromFile(int index, const FloatDimension& imageSize) { _GalleryBitmap* pPartialGalleryBitmap = null; Dimension bitmapSize; @@ -126,7 +127,7 @@ _GalleryImageReader::LoadPartialImageFromFile(int index, const Dimension& imageS break; } - pBuffer = _ImageDecoder::DecodeToBufferN(pItem->GetGalleryItemFilePath(), mediaPixelFormat, bitmapSize.width, bitmapSize.height); + pBuffer = _ImageDecoder::DecodeToBufferN(pItem->GetGalleryItemFilePath(), mediaPixelFormat, bitmapSize.width, bitmapSize.height, true); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -134,9 +135,14 @@ _GalleryImageReader::LoadPartialImageFromFile(int index, const Dimension& imageS __pTmpFileBitmap = new (std::nothrow) Bitmap(); SysTryCatch(NID_UI_CTRL, __pTmpFileBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + // TODO : need Bitmap::ConstructF(ByteBuffer, ) + //FloatDimension bitmapSizeF(bitmapSize.width, bitmapSize.height); r = __pTmpFileBitmap->Construct(*pBuffer, bitmapSize, pItem->GetGalleryItemImage()->GetInternalBitmap()->GetPixelColorFormat()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + r = __pTmpFileBitmap->Scale(imageSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + pPartialGalleryBitmap = _GalleryBitmap::CreateGalleryBitmapN(__pTmpFileBitmap); SysTryCatch(NID_UI_CTRL, pPartialGalleryBitmap != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -145,9 +151,6 @@ _GalleryImageReader::LoadPartialImageFromFile(int index, const Dimension& imageS r = pPartialGalleryBitmap->Initialize(imageSize, GALLERY_FITTING_TYPE_FIT); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = pPartialGalleryBitmap->SetSize(imageSize); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - delete __pTmpFileBitmap; __pTmpFileBitmap = _BitmapImpl::CloneN(*pPartialGalleryBitmap->GetInternalBitmap()); SysTryCatch(NID_UI_CTRL, __pTmpFileBitmap != null, , r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrl_GalleryItem.cpp b/src/ui/controls/FUiCtrl_GalleryItem.cpp index 1fb49e0..ef1d8e3 100644 --- a/src/ui/controls/FUiCtrl_GalleryItem.cpp +++ b/src/ui/controls/FUiCtrl_GalleryItem.cpp @@ -24,8 +24,7 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { _GalleryItem::_GalleryItem(_GalleryBitmap* pImage, String imageFilePath, _GalleryImageRotation rotation) - : __pOriginImage(pImage) - , __pImage(null) + : __pImage(pImage) , __imageFilePath(imageFilePath) , __rotation(rotation) , __itemIndex(-1) @@ -35,10 +34,6 @@ _GalleryItem::_GalleryItem(_GalleryBitmap* pImage, String imageFilePath, _Galler _GalleryItem::~_GalleryItem(void) { - - delete __pOriginImage; - __pOriginImage = null; - delete __pImage; __pImage = null; } @@ -53,49 +48,7 @@ _GalleryItem::SetGalleryItemImage(_GalleryBitmap* pImage) _GalleryBitmap* _GalleryItem::GetGalleryItemImage(void) const { - if (__pOriginImage == null) - { - SetLastResult(E_SYSTEM); - return null; - } - - Dimension dim = __pOriginImage->GetSize(); - Rectangle rect(0, 0, dim.width, dim.height); - - result r = E_SUCCESS; - _GalleryBitmap* pImage = null; - - Bitmap* pBitmap = new(std::nothrow) Bitmap(); - SysTryCatch(NID_UI_CTRL, pBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = pBitmap->Construct(*__pOriginImage->GetInternalBitmap(), rect); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - pImage = _GalleryBitmap::CreateGalleryBitmapN(pBitmap); - SysTryCatch(NID_UI_CTRL, pImage != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - pImage->SetBitmapRotation(__pOriginImage->GetBitmapRotation()); - const_cast<_GalleryItem*>(this)->SetGalleryItemImage(pImage); - - delete pBitmap; - return pImage; - -CATCH: - delete pBitmap; - const_cast<_GalleryItem*>(this)->SetGalleryItemImage(null); - return null; -} - -void -_GalleryItem::SetOriginGalleryItemImage(_GalleryBitmap* pImage) -{ - delete __pOriginImage; - __pOriginImage = pImage; -} - -_GalleryBitmap* -_GalleryItem::GetOriginItemImage(void) const -{ - return __pOriginImage; + return __pImage; } void diff --git a/src/ui/controls/FUiCtrl_GalleryPresenter.cpp b/src/ui/controls/FUiCtrl_GalleryPresenter.cpp old mode 100644 new mode 100755 index 300a16d..1350a1c --- a/src/ui/controls/FUiCtrl_GalleryPresenter.cpp +++ b/src/ui/controls/FUiCtrl_GalleryPresenter.cpp @@ -19,6 +19,7 @@ #include #include "FUi_Math.h" #include "FUi_ResourceManager.h" +#include "FUiCtrl_Gallery.h" #include "FUiCtrl_GalleryPresenter.h" #include "FUiCtrl_GalleryModel.h" #include "FUiCtrl_GalleryItemProvider.h" @@ -81,6 +82,7 @@ _GalleryPresenter::_GalleryPresenter(_IGalleryRenderer& galleryRenderer) , __horizontalAlignment(GALLERY_HORIZONTAL_ALIGN_CENTER) , __emptyFontSize(0) , __emptyFontStyle(FONT_STYLE_PLAIN) + , __pGalleryView(null) { AddPropertyChangeEventListener(*this); } @@ -99,12 +101,13 @@ _GalleryPresenter::~_GalleryPresenter(void) } _GalleryPresenter* -_GalleryPresenter::CreateGalleryPresenterN(_IGalleryRenderer& galleryRenderer, _GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor) +_GalleryPresenter::CreateGalleryPresenterN(_IGalleryRenderer& galleryRenderer, + _GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor, _Gallery* pGalleryView) { _GalleryPresenter* pPresenter = new (std::nothrow) _GalleryPresenter(galleryRenderer); SysTryReturn(NID_UI_CTRL, pPresenter != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - result r = pPresenter->Construct(pGalleryItemProviderAdaptor); + result r = pPresenter->Construct(pGalleryItemProviderAdaptor, pGalleryView); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); SetLastResult(E_SUCCESS); @@ -117,7 +120,7 @@ CATCH: } result -_GalleryPresenter::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor) +_GalleryPresenter::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor, _Gallery* pGalleryView) { SetLastResult(E_SUCCESS); @@ -158,6 +161,8 @@ _GalleryPresenter::Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProvid SetFontStyle(FONT_STYLE_PLAIN); SetFontSize(32); + __pGalleryView = pGalleryView; + return E_SUCCESS; CATCH: @@ -223,13 +228,13 @@ _GalleryPresenter::SetCurrentItem(int index) if (__currentItemIndex > index) { - Rectangle rect = __galleryRenderer.GetViewRect(); + FloatRectangle rect = __galleryRenderer.GetViewRect(); rect.x = rect.width; r = __galleryRenderer.SetCanvasBounds(oldCurrentCanvasIndex, rect); } else if (__currentItemIndex < index) { - Rectangle rect = __galleryRenderer.GetViewRect(); + FloatRectangle rect = __galleryRenderer.GetViewRect(); rect.x = -rect.width; r = __galleryRenderer.SetCanvasBounds(oldCurrentCanvasIndex, rect); } @@ -539,8 +544,8 @@ _GalleryPresenter::OnBoundsChanged(void) else { __galleryRenderer.GalleryBoundsChanged(currentCanvasIndex); - Rectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); + FloatRectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); __pGalleryViewEventHandler->CorrectCanvasPosition(canvasBounds, imageBounds); r = __galleryRenderer.SetCanvasBounds(currentCanvasIndex, canvasBounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -598,6 +603,8 @@ _GalleryPresenter::ChangedItem(void) return true; } + __pGalleryView->ResizeGalleryAccessibilityElement(); + _GalleryCoreEventArg* pArg = new(std::nothrow) _GalleryCoreEventArg(GALLERY_CORE_EVENT_CURRENT_ITEM_CHANGED, __currentItemIndex); return __pGalleryCoreEvent->Fire(*pArg); } @@ -712,6 +719,8 @@ _GalleryPresenter::RequestToUpdateItem(int itemIndex) r = __galleryRenderer.SetCanvasImage(canvasIndex, (const _GalleryBitmap*)pImage , __verticalAlignment, __horizontalAlignment, __fittingType); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __galleryRenderer.GalleryBoundsChanged(canvasIndex); } else if (canvasIndex != NOT_EXIST_CANVAS) { @@ -767,9 +776,6 @@ _GalleryPresenter::RequestToUpdateAllItems(void) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - //r = __galleryRenderer.RefreshView(); - //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - return E_SUCCESS; } @@ -887,7 +893,7 @@ _GalleryPresenter::SetCanvasImage(int itemIndex) , __verticalAlignment, __horizontalAlignment, __fittingType); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle bounds = __galleryRenderer.GetViewRect(); + FloatRectangle bounds = __galleryRenderer.GetViewRect(); r = __galleryRenderer.SetCanvasBounds(emptyCanvasIndex, bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -903,15 +909,10 @@ _GalleryPresenter::SetPartialCanvasImage(void) SysTryReturn(NID_UI_CTRL, __currentItemIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument(%d) is negative value.", __currentItemIndex); - if (__galleryRenderer.IsCanvasVisibility(PARTIAL_CANVAS) == true) - { - return E_SUCCESS; - } - int currentCanvasIndex = SearchCanvasIndex(__currentItemIndex); - Rectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); - Rectangle viewBounds = __galleryRenderer.GetViewRect(); + FloatRectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); + FloatRectangle viewBounds = __galleryRenderer.GetViewRect(); if (imageBounds.width < viewBounds.width) { @@ -928,8 +929,7 @@ _GalleryPresenter::SetPartialCanvasImage(void) canvasBounds.width = viewBounds.width < imageBounds.width ? viewBounds.width : imageBounds.width; canvasBounds.height = viewBounds.height < imageBounds.height ? viewBounds.height : imageBounds.height; - //Dimension size(canvasBounds.width, canvasBounds.height); - Dimension size(imageBounds.width, imageBounds.height); + FloatDimension size(imageBounds.width, imageBounds.height); _GalleryBitmap* pImage = __pGalleryImageReader->GetPartialImageFromFileN(__currentItemIndex, canvasBounds, size); SysTryReturn(NID_UI_CTRL, pImage != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); diff --git a/src/ui/controls/FUiCtrl_GalleryRenderer.cpp b/src/ui/controls/FUiCtrl_GalleryRenderer.cpp old mode 100644 new mode 100755 index d9a8111..428c1da --- a/src/ui/controls/FUiCtrl_GalleryRenderer.cpp +++ b/src/ui/controls/FUiCtrl_GalleryRenderer.cpp @@ -26,6 +26,7 @@ #include #include #include "FUi_Control.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiAnim_MatrixUtil.h" #include "FUiAnim_VisualElement.h" @@ -97,7 +98,7 @@ _GalleryRenderer::SetCanvasMaxCount(int maxCount) { result r = E_SUCCESS; _GalleryCanvasManager& canvasManager = GetCanvasManager(); - Rectangle viewRect = GetViewRect(); + FloatRectangle viewRect = GetViewRect(); r = canvasManager.ResetCanvasManager(maxCount + 1, viewRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -156,12 +157,12 @@ _GalleryRenderer::IsCanvasVisibility(int canvasIndex) const return pCanvas->IsVisibility(); } -Rectangle +FloatRectangle _GalleryRenderer::GetViewRect(void) const { - Rectangle rect = GetCanvasManager().GetRootCanvas().GetBounds(); - rect.x = 0; - rect.y = 0; + FloatRectangle rect = GetCanvasManager().GetRootCanvas().GetBounds(); + rect.x = 0.0; + rect.y = 0.0; return rect; } @@ -226,7 +227,7 @@ _GalleryRenderer::SetCanvasImage(int canvasIndex, const _GalleryBitmap* pImage } result -_GalleryRenderer::SetCanvasBounds(int canvasIndex, const Rectangle& bounds, +_GalleryRenderer::SetCanvasBounds(int canvasIndex, const FloatRectangle& bounds, const _GalleryAnimationTiming* pAnimation) { _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex); @@ -237,21 +238,14 @@ _GalleryRenderer::SetCanvasBounds(int canvasIndex, const Rectangle& bounds, _VisualElement& frameVisualElement = pCanvas->GetFrameVisualElement(); frameVisualElement.SetImplicitAnimationEnabled(false); - Rectangle canvasVEBounds = pCanvas->GetImageVisualElementBounds(); - FloatMatrix4 endMatrix;// = visualElement.GetTransformMatrix(); + FloatMatrix4 endMatrix; endMatrix.SetAsIdentity(); -#if 0 - float factor = (float)bounds.width / (float)canvasVEBounds.width; - float translateX = (float)realBounds.x - (float)canvasVEBounds.x; - float translateY = (float)realBounds.y - (float)canvasVEBounds.y; -#else - float translateX = (float)bounds.x; - float translateY = (float)bounds.y; -#endif - - Rectangle viewRect = GetViewRect(); - Rectangle imageBounds = pCanvas->GetOriginalImageBounds(); + float translateX = bounds.x; + float translateY = bounds.y; + + FloatRectangle viewRect = GetViewRect(); + FloatRectangle imageBounds = pCanvas->GetOriginalImageBounds(); if (bounds.width != viewRect.width) { float factor = (float)bounds.width / (float)(viewRect.width); @@ -310,33 +304,33 @@ _GalleryRenderer::SetCanvasBounds(int canvasIndex, const Rectangle& bounds, FloatPoint anchor; imageBounds = pCanvas->GetImageBounds(); - anchor.x = (float)(-bounds.x + (GetViewRect().width / 2)) / (float)bounds.width; - anchor.y = (float)(-bounds.y + (GetViewRect().height / 2)) / (float)bounds.height; + anchor.x = (-bounds.x + (GetViewRect().width / 2)) / bounds.width; + anchor.y = (-bounds.y + (GetViewRect().height / 2)) / bounds.height; pCanvas->SetImageAnchor(anchor); return E_SUCCESS; } -Rectangle +FloatRectangle _GalleryRenderer::GetCanvasBounds(int canvasIndex) const { _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex); - SysTryReturn(NID_UI_CTRL, pCanvas != null, Rectangle(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetLastResult(E_SUCCESS); return pCanvas->GetBounds(); } -Rectangle +FloatRectangle _GalleryRenderer::GetCanvasAlignBoundary(int canvasIndex) const { _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex); - SysTryReturn(NID_UI_CTRL, pCanvas != null, Rectangle(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetLastResult(E_SUCCESS); - Rectangle alignBoundary = pCanvas->GetAlignBoundary(); + FloatRectangle alignBoundary = pCanvas->GetAlignBoundary(); if (alignBoundary.width == -1 || alignBoundary.width < GetViewRect().width) { alignBoundary = GetViewRect(); @@ -346,7 +340,7 @@ _GalleryRenderer::GetCanvasAlignBoundary(int canvasIndex) const } result -_GalleryRenderer::SetCanvasImageBounds(int canvasIndex, const Rectangle& bounds) +_GalleryRenderer::SetCanvasImageBounds(int canvasIndex, const FloatRectangle& bounds) { _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex); result r = GetLastResult(); @@ -356,11 +350,11 @@ _GalleryRenderer::SetCanvasImageBounds(int canvasIndex, const Rectangle& bounds) return E_SUCCESS; } -Rectangle +FloatRectangle _GalleryRenderer::GetCanvasImageBounds(int canvasIndex) const { _GalleryCanvas* pCanvas = GetCanvasManager().GetCanvas(canvasIndex); - SysTryReturn(NID_UI_CTRL, pCanvas != null, Rectangle(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + SysTryReturn(NID_UI_CTRL, pCanvas != null, FloatRectangle(-1, -1, -1, -1), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetLastResult(E_SUCCESS); @@ -414,8 +408,6 @@ _GalleryRenderer::RunCanvasTransition(int startCanvasIndex, int endCanvasIndex, default: break; } - //r = RefreshView(); - //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; } @@ -464,7 +456,7 @@ _GalleryRenderer::ReleaseAllCanvasResource(void) result _GalleryRenderer::ResetAllCanvas(void) { - Rectangle viewRect = GetViewRect(); + FloatRectangle viewRect = GetViewRect(); result r = GetCanvasManager().ResetAllCanvas(viewRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -476,7 +468,7 @@ _GalleryRenderer::InitializeCanvasBounds(void) { int canvasCount = GetCanvasManager().GetCanvasCount(); _GalleryCanvas* pCanvas = null; - Rectangle bounds = GetViewRect(); + FloatRectangle bounds = GetViewRect(); result r = E_SUCCESS; for (int canvasIndex = 0; canvasIndex < canvasCount; canvasIndex++) { @@ -484,9 +476,6 @@ _GalleryRenderer::InitializeCanvasBounds(void) r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); - //r = pCanvas->SetVisualElementBounds(bounds); - //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pCanvas->SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -527,7 +516,7 @@ _GalleryRenderer::GalleryBoundsChanged(int currentCanvasIndex) SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); float factor = pCanvas->GetCanvasFactor(); - Rectangle bounds = pCanvas->GetBounds(); + FloatRectangle bounds = pCanvas->GetBounds(); bounds.width *= factor; bounds.height *= factor; @@ -536,7 +525,7 @@ _GalleryRenderer::GalleryBoundsChanged(int currentCanvasIndex) bounds.x = -(pCanvas->GetImageAnchor().x * bounds.width - GetViewRect().width / 2); bounds.y = -(pCanvas->GetImageAnchor().y * bounds.height - GetViewRect().height / 2); - r = pCanvas->GetFrameVisualElement().SetBounds(FloatRectangle(0, 0, bounds.width, bounds.height)); + r = pCanvas->GetFrameVisualElement().SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); pCanvas->SetImageBounds(bounds); @@ -633,12 +622,11 @@ _GalleryRenderer::_GalleryRenderer(void) , __pTransparentBitmap(null) , __pPageCurlingBitmap(null) { - GET_COLOR_CONFIG(GALLERY::EMPTY_GALLERY_TEXT_NORMAL, __emptyTextColor); + GET_COLOR_CONFIG(GALLERY::EMPTY_TEXT_NORMAL, __emptyTextColor); } _GalleryRenderer::~_GalleryRenderer(void) { - StopAllAnimation(); if (GetEffect() != null) @@ -661,7 +649,7 @@ _GalleryRenderer::Construct(_Control& control) _GalleryRendererNotifier* pRendererNotifier = null; _GalleryCanvasManager* pCanvasManager = null; _GalleryAnimationProvider* pVEDelegator = null; - Rectangle initialCanvasBounds = control.GetBounds(); + FloatRectangle initialCanvasBounds = control.GetBoundsF(); pRendererNotifier = new (std::nothrow) _GalleryRendererNotifier(); SysTryCatch(NID_UI_CTRL, pRendererNotifier != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -692,7 +680,7 @@ result _GalleryRenderer::ShowEmptyImageAndText(void) { Canvas* pEmptyCanvas = null; - Dimension textDimension(0, 0); + FloatDimension textDimension(0, 0); Font* pFont = null; TextObject* pTextObject = null; result r = E_SUCCESS; @@ -725,7 +713,8 @@ _GalleryRenderer::ShowEmptyImageAndText(void) pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); pTextObject->SetFont(pFont, 0, pTextObject->GetTextLength()); - textDimension = pTextObject->GetTextExtent(0, pTextObject->GetTextLength()); + textDimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength()); + if (textDimension.width > GetViewRect().width) { textDimension.width = GetViewRect().width; @@ -733,10 +722,10 @@ _GalleryRenderer::ShowEmptyImageAndText(void) pTextObject->SetForegroundColor(__emptyTextColor, 0, pTextObject->GetTextLength()); } - Point imagePosition(0, 0); - Point textPosition(0, 0); - Dimension imageSize(0, 0); - Rectangle visualElementBounds(0, 0, 0, 0); + FloatPoint imagePosition(0, 0); + FloatPoint textPosition(0, 0); + FloatDimension imageSize(0, 0); + FloatRectangle visualElementBounds(0, 0, 0, 0); _GalleryBitmap* pImage = pEmptyGalleryCanvas->GetImage(); if (pImage != null) { @@ -766,7 +755,7 @@ _GalleryRenderer::ShowEmptyImageAndText(void) pEmptyGalleryCanvas->SetVisualElementBounds(visualElementBounds); - Rectangle imageBounds(imagePosition.x, imagePosition.y, imageSize.width, imageSize.height); + FloatRectangle imageBounds(imagePosition.x, imagePosition.y, imageSize.width, imageSize.height); pEmptyGalleryCanvas->SetImageBounds(imageBounds); if (pImage != null || __emptyString.GetLength() != 0) @@ -785,8 +774,8 @@ _GalleryRenderer::ShowEmptyImageAndText(void) { if (pImage->GetInternalBitmap()->IsNinePatchedBitmap() == true) { - Dimension size = pImage->GetSize(); - Rectangle rect(imagePosition.x, imagePosition.y, size.width, size.height); + FloatDimension size = pImage->GetSize(); + FloatRectangle rect(imagePosition.x, imagePosition.y, size.width, size.height); r = pEmptyCanvas->DrawNinePatchedBitmap(rect, *pImage->GetInternalBitmap()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -800,7 +789,7 @@ _GalleryRenderer::ShowEmptyImageAndText(void) textPosition.y = imageBounds.y + imageBounds.height; if (pTextObject != null) { - pTextObject->SetBounds(Rectangle(textPosition.x, textPosition.y, textDimension.width, textDimension.height)); + pTextObject->SetBounds(FloatRectangle(textPosition.x, textPosition.y, textDimension.width, textDimension.height)); pTextObject->Draw(*_CanvasImpl::GetInstance(*pEmptyCanvas)); delete pTextObject; @@ -834,7 +823,7 @@ _GalleryRenderer::RunDissolveTransition(int startCanvasIndex, int endCanvasIndex SysTryReturn(NID_UI_CTRL, pAnimation != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The gallery animation timing is null"); - Rectangle viewBounds = GetViewRect(); + FloatRectangle viewBounds = GetViewRect(); result r = SetCanvasBounds(endCanvasIndex, viewBounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -878,8 +867,8 @@ _GalleryRenderer::RunZoomTransition(int startCanvasIndex, int endCanvasIndex, co result r = RunDissolveTransition(startCanvasIndex, endCanvasIndex, pAnimation); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle viewRect = GetViewRect(); - Rectangle zoomBounds = viewRect; + FloatRectangle viewRect = GetViewRect(); + FloatRectangle zoomBounds = viewRect; zoomBounds.width *= GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR; zoomBounds.height *= GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR; zoomBounds.x = -(viewRect.width / 2 * (GALLERY_ZOOM_TRANSITION_ZOOM_FACTOR - 1)); @@ -1120,7 +1109,7 @@ _GalleryRenderer::OnEffectStarted(Effect& effect) void _GalleryRenderer::OnEffectFinished(Effect& effect, EffectResult effectResult, const IList& lastShownBitmapIds) { - Rectangle viewBounds = GetViewRect(); + FloatRectangle viewBounds = GetViewRect(); int endCanvasIndex = GetEndCanvasOfPageCurling(); result r = SetCanvasBounds(endCanvasIndex, viewBounds); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1185,7 +1174,7 @@ _GalleryRenderer::SetBitmap(Effect& effect, long bitmapId) r = pageCurlingCanvas.Clear(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle imageBounds = pStartCanvas->GetImageBounds(); + FloatRectangle imageBounds = pStartCanvas->GetImageBounds(); r = pageCurlingCanvas.DrawBitmap(imageBounds, *pStartCanvas->GetImage()->GetInternalBitmap()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1210,7 +1199,7 @@ _GalleryRenderer::SetBitmap(Effect& effect, long bitmapId) r = transparentCanvas.Clear(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle imageBounds = pEndCanvas->GetImageBounds(); + FloatRectangle imageBounds = pEndCanvas->GetImageBounds(); r = transparentCanvas.DrawBitmap(imageBounds, *pEndCanvas->GetImage()->GetInternalBitmap()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/ui/controls/FUiCtrl_GalleryViewEventHandler.cpp b/src/ui/controls/FUiCtrl_GalleryViewEventHandler.cpp old mode 100644 new mode 100755 index b744835..1b17013 --- a/src/ui/controls/FUiCtrl_GalleryViewEventHandler.cpp +++ b/src/ui/controls/FUiCtrl_GalleryViewEventHandler.cpp @@ -15,7 +15,7 @@ // limitations under the License. // #include -#include +#include #include #include "FUiCtrl_GalleryImageReader.h" #include "FUiCtrl_GalleryPresenter.h" @@ -79,11 +79,11 @@ _GalleryViewEventHandler::OnTouchPressed(_GalleryViewEventInfo& eventInfo) SysTryReturn(NID_UI_CTRL, __pressed == false, true, E_SYSTEM, "[E_SYSTEM] Already pressed state."); result r = SetVisibleCanvas(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __pressed = true; __previousPosition.SetPosition(eventInfo.GetCurrentPosition()); __touchPointId = eventInfo.GetPointId(); + __flickingDirection = FLICK_DIRECTION_NONE; //SetLastResult(E_SUCCESS); @@ -98,7 +98,7 @@ bool _GalleryViewEventHandler::OnTouchDoublePressed(_GalleryViewEventInfo& eventInfo) { _GalleryAnimationTiming animation = {ZOOM_ANIMATION_DURATION, GALLERY_ANIMATION_TIMING_FUNC_EASEOUT}; - Point center; + FloatPoint center; int distance = DOUBLE_PRESSE_ZOOM_DISTANCE; if (__zoomMode == false) { @@ -107,11 +107,11 @@ _GalleryViewEventHandler::OnTouchDoublePressed(_GalleryViewEventInfo& eventInfo) } else { - Rectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); center.SetPosition(viewRect.width / 2, viewRect.height / 2); __zoomMode = false; int currentCanvasIndex = __galleryPresenter.SearchCanvasIndex(__galleryPresenter.GetCurrentItemIndex()); - Rectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); distance = canvasRect.width - viewRect.width; } result r = ZoomCanvas(distance, center, __zoomMode, &animation); @@ -136,7 +136,7 @@ _GalleryViewEventHandler::OnTouchMoved(_GalleryViewEventInfo& eventInfo) return true; } - Dimension distance; + FloatDimension distance; distance.width = __previousPosition.x - eventInfo.GetCurrentPosition().x; distance.height = __previousPosition.y - eventInfo.GetCurrentPosition().y; @@ -162,12 +162,20 @@ _GalleryViewEventHandler::OnTouchReleased(_GalleryViewEventInfo& eventInfo) { if (__moving == true) { - r = AlignCanvas(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + if (__flickingDirection == FLICK_DIRECTION_NONE) + { + r = AlignCanvas(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } __moving = false; } else { + if (IsZoomFlag() == true && __zoomAnimationComplete == true) + { + r = __galleryPresenter.SetPartialCanvasImage(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating", GetErrorMessage(r)); + } itemClickedSuccess = __galleryPresenter.ClickedItem(); } __pressed = false; @@ -175,15 +183,15 @@ _GalleryViewEventHandler::OnTouchReleased(_GalleryViewEventInfo& eventInfo) if (__pinchMode == true) { - Rectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); int currentCanvasIndex = __galleryPresenter.SearchCanvasIndex(__galleryPresenter.GetCurrentItemIndex()); - Rectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - int distance = canvasRect.width - viewRect.width; + FloatRectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + float distance = canvasRect.width - viewRect.width; if (distance < 0) { - Point center(viewRect.width / 2, viewRect.height / 2); + FloatPoint center(viewRect.width / 2, viewRect.height / 2); _GalleryAnimationTiming animation = {PINCH_ZOOM_ANIMATION_DURATION, GALLERY_ANIMATION_TIMING_FUNC_EASEOUT}; r = ZoomCanvas(distance, center, false, &animation); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -193,7 +201,7 @@ _GalleryViewEventHandler::OnTouchReleased(_GalleryViewEventInfo& eventInfo) r = AlignCanvas(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); __pinchInitialArea = 0; - __startPinchCenterPosition.SetPosition(0, 0); + __startPinchCenterPosition.SetPosition(0.0, 0.0); __pinchMode = false; } @@ -228,10 +236,10 @@ _GalleryViewEventHandler::OnTouchPinchZoom(_GalleryViewEventInfo& eventInfo) return true; } - Point center = eventInfo.GetPinchCenterPosition(); + FloatPoint center = eventInfo.GetPinchCenterPosition(); int currentCanvasIndex = __galleryPresenter.SearchCanvasIndex(__galleryPresenter.GetCurrentItemIndex()); - Rectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle canvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); int area = eventInfo.GetPinchArea(); @@ -257,7 +265,7 @@ _GalleryViewEventHandler::OnTouchPinchZoom(_GalleryViewEventInfo& eventInfo) if (__startPinchCenterPosition.x == 0 && __startPinchCenterPosition.y == 0) { - float factor = (float)canvasRect.width / (float)viewRect.width; + float factor = canvasRect.width / viewRect.width; __startPinchCenterPosition = center; __startPinchCenterPosition.x = CalculateRound((__startPinchCenterPosition.x - canvasRect.x) / factor); __startPinchCenterPosition.y = CalculateRound((__startPinchCenterPosition.y - canvasRect.y) / factor); @@ -322,7 +330,7 @@ _GalleryViewEventHandler::OnTouchFlicked(_GalleryViewEventInfo& eventInfo) moveY = FLICK_MOVE_DISTANCE; } - Dimension dim(moveX, moveY); + FloatDimension dim(moveX, moveY); r = MoveCanvas(dim, &animation); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -426,8 +434,8 @@ _GalleryViewEventHandler::SetVisibleCanvas(void) SysTryReturn(NID_UI_CTRL, currentItemIndex >= 0 && currentItemIndex < __galleryPresenter.GetItemCount(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] This value(%d) is out of range(%d ~ %d)", currentItemIndex, 0, __galleryPresenter.GetItemCount()); - Rectangle viewRect = __galleryRenderer.GetViewRect(); - Rectangle rect = viewRect; + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle rect = viewRect; // current item int currentCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex); @@ -445,7 +453,7 @@ _GalleryViewEventHandler::SetVisibleCanvas(void) } else { - Rectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); r = __galleryRenderer.SetCanvasBounds(currentCanvasIndex, currentCanvasRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -453,7 +461,7 @@ _GalleryViewEventHandler::SetVisibleCanvas(void) r = __galleryRenderer.SetCanvasVisibility(currentCanvasIndex, true); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle currentCanvasAlignBoundary = __galleryRenderer.GetCanvasAlignBoundary(currentCanvasIndex); + FloatRectangle currentCanvasAlignBoundary = __galleryRenderer.GetCanvasAlignBoundary(currentCanvasIndex); // left item if (currentItemIndex - 1 >= 0 && currentItemIndex - 1 < __galleryPresenter.GetItemCount()) { @@ -528,8 +536,8 @@ result _GalleryViewEventHandler::FlickToTheRight(void) { result r = E_SUCCESS; - Rectangle viewRect = __galleryRenderer.GetViewRect(); - Rectangle rect = viewRect; + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle rect = viewRect; int currentItemIndex = __galleryPresenter.GetCurrentItemIndex(); int leftCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex - 1); @@ -538,6 +546,7 @@ _GalleryViewEventHandler::FlickToTheRight(void) { if (currentItemIndex - 1 < 0) { + __flickingDirection = FLICK_DIRECTION_NONE; return E_SUCCESS; } else @@ -588,8 +597,8 @@ result _GalleryViewEventHandler::FlickToTheLeft(void) { result r = E_SUCCESS; - Rectangle viewRect = __galleryRenderer.GetViewRect(); - Rectangle rect = viewRect; + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle rect = viewRect; int currentItemIndex = __galleryPresenter.GetCurrentItemIndex(); int rightCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex + 1); @@ -598,6 +607,7 @@ _GalleryViewEventHandler::FlickToTheLeft(void) { if (currentItemIndex + 1 >= __galleryPresenter.GetItemCount()) { + __flickingDirection = FLICK_DIRECTION_NONE; return E_SUCCESS; } else @@ -644,9 +654,9 @@ _GalleryViewEventHandler::FlickToTheLeft(void) } result -_GalleryViewEventHandler::ZoomCanvas(int distance, const Point& center, bool zoomIn, _GalleryAnimationTiming* pAnimation) +_GalleryViewEventHandler::ZoomCanvas(float distance, const FloatPoint& center, bool zoomIn, _GalleryAnimationTiming* pAnimation) { - if (__galleryPresenter.IsZoomingEnabled() == false || distance == 0) + if (__galleryPresenter.IsZoomingEnabled() == false || distance == 0.0) { __zoomMode = false; return E_SUCCESS; @@ -660,13 +670,13 @@ _GalleryViewEventHandler::ZoomCanvas(int distance, const Point& center, bool zoo SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - Rectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); - Rectangle viewBounds = __galleryRenderer.GetViewRect(); + FloatRectangle canvasBounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle imageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); + FloatRectangle viewBounds = __galleryRenderer.GetViewRect(); float factor = 1.0; if (zoomIn == true) { - factor = (float)(canvasBounds.width + distance) / (float)viewBounds.width; + factor = (canvasBounds.width + distance) / viewBounds.width; canvasBounds.width = factor * viewBounds.width; canvasBounds.height = factor * viewBounds.height; canvasBounds.x = -(center.x * factor - viewBounds.width / 2); @@ -700,7 +710,7 @@ _GalleryViewEventHandler::ZoomCanvas(int distance, const Point& center, bool zoo } result -_GalleryViewEventHandler::PinchZoomCanvas(int area, const Point& center, bool zoomIn) +_GalleryViewEventHandler::PinchZoomCanvas(int area, const FloatPoint& center, bool zoomIn) { if (__galleryPresenter.IsZoomingEnabled() == false || area == 0 || __startPinchCenterPosition.x == 0 || __startPinchCenterPosition.y == 0) @@ -711,13 +721,13 @@ _GalleryViewEventHandler::PinchZoomCanvas(int area, const Point& center, bool zo int currentItemIndex = __galleryPresenter.GetCurrentItemIndex(); int currentCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex); - Rectangle bounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle viewBounds = __galleryRenderer.GetViewRect(); + FloatRectangle bounds = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle viewBounds = __galleryRenderer.GetViewRect(); float factor = 1.0f; if (zoomIn == true) { - factor = (float)(bounds.width + area) / (float)viewBounds.width; + factor = (bounds.width + area) / viewBounds.width; if (factor > MAX_ZOOM_RATIO) { factor = MAX_ZOOM_RATIO; @@ -725,7 +735,7 @@ _GalleryViewEventHandler::PinchZoomCanvas(int area, const Point& center, bool zo } else { - factor = (float)(bounds.width - area) / (float)viewBounds.width; + factor = (bounds.width - area) / viewBounds.width; if (factor < MIN_ZOOM_RATIO) { factor = MIN_ZOOM_RATIO; @@ -789,7 +799,7 @@ _GalleryViewEventHandler::PinchZoomCanvas(int area, const Point& center, bool zo } result -_GalleryViewEventHandler::MoveCanvas(const Dimension& distance, _GalleryAnimationTiming* pAnimation) +_GalleryViewEventHandler::MoveCanvas(const FloatDimension& distance, _GalleryAnimationTiming* pAnimation) { SysTryReturn(NID_UI_CTRL, __pressed == true, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] not pressed state."); @@ -807,11 +817,11 @@ _GalleryViewEventHandler::MoveCanvas(const Dimension& distance, _GalleryAnimatio rightCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex + 1); } - Rectangle viewRect = __galleryRenderer.GetViewRect(); - Rectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle rect = currentCanvasRect; + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle rect = currentCanvasRect; - Rectangle canvasImageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); + FloatRectangle canvasImageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); if (IsZoomFlag() == true) { if (canvasImageBounds.y + rect.y > 0) @@ -891,23 +901,24 @@ _GalleryViewEventHandler::AlignCanvas(bool animation) int rightCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex + 1); result r = E_SUCCESS; - Rectangle viewRect = __galleryRenderer.GetViewRect(); - Rectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); - Rectangle canvasImageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle currentCanvasRect = __galleryRenderer.GetCanvasBounds(currentCanvasIndex); + FloatRectangle canvasImageBounds = __galleryRenderer.GetCanvasImageBounds(currentCanvasIndex); - Rectangle rect = viewRect; + FloatRectangle rect = viewRect; _GalleryAnimationTiming* pAnimationTimingFunction = null; bool immediatePartialCanvasChange = false; if (animation == true) { + __galleryRenderer.StopAllCanvasAnimation(); pAnimationTimingFunction = new(std::nothrow) _GalleryAnimationTiming(); SysTryCatch(NID_UI_CTRL, pAnimationTimingFunction != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pAnimationTimingFunction->duration_ms = ALIGH_ANIMATION_DURATION; pAnimationTimingFunction->timingFunction = GALLERY_ANIMATION_TIMING_FUNC_EASEOUT; } - if (canvasImageBounds.height > viewRect.height) // zoom mode + if (__zoomMode == true) { if (!(viewRect.y < canvasImageBounds.y && viewRect.height > canvasImageBounds.height + canvasImageBounds.y)) { @@ -957,7 +968,8 @@ _GalleryViewEventHandler::AlignCanvas(bool animation) if (__zoomMode == true) { bool corrected = CorrectCanvasPosition(rect, canvasImageBounds); - if (corrected == false && immediatePartialCanvasChange == true && __zoomAnimationComplete == true) + if ((animation != true || corrected == false) && + immediatePartialCanvasChange == true && __zoomAnimationComplete == true) { r = __galleryPresenter.SetPartialCanvasImage(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating", GetErrorMessage(r)); @@ -971,7 +983,7 @@ _GalleryViewEventHandler::AlignCanvas(bool animation) r = __galleryRenderer.SetCanvasBounds(currentCanvasIndex, rect, pAnimationTimingFunction); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } - Rectangle currentCanvasAlignBoundary = __galleryRenderer.GetCanvasAlignBoundary(currentCanvasIndex); + FloatRectangle currentCanvasAlignBoundary = __galleryRenderer.GetCanvasAlignBoundary(currentCanvasIndex); if (rightCanvasIndex != NOT_EXIST_CANVAS) { rect = viewRect; @@ -1005,7 +1017,7 @@ _GalleryViewEventHandler::SetRollbackCanvas(void) int leftCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex - 1); int rightCanvasIndex = __galleryPresenter.SearchCanvasIndex(currentItemIndex + 1); - Rectangle viewRect = __galleryRenderer.GetViewRect(); + FloatRectangle viewRect = __galleryRenderer.GetViewRect(); result r = __galleryRenderer.SetCanvasBounds(currentCanvasIndex, viewRect); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1027,13 +1039,13 @@ _GalleryViewEventHandler::CalculateRound(float value) } bool -_GalleryViewEventHandler::CorrectCanvasPosition(Rectangle& canvasBounds, const Rectangle& imageBounds) +_GalleryViewEventHandler::CorrectCanvasPosition(FloatRectangle& canvasBounds, const FloatRectangle& imageBounds) { if (IsZoomFlag() == false) { return false; } - Rectangle viewBounds = __galleryRenderer.GetViewRect(); + FloatRectangle viewBounds = __galleryRenderer.GetViewRect(); bool corrected = false; if (imageBounds.width > viewBounds.width) { diff --git a/src/ui/controls/FUiCtrl_GalleryViewEventInfo.cpp b/src/ui/controls/FUiCtrl_GalleryViewEventInfo.cpp index ff22c7a..3e81a77 100644 --- a/src/ui/controls/FUiCtrl_GalleryViewEventInfo.cpp +++ b/src/ui/controls/FUiCtrl_GalleryViewEventInfo.cpp @@ -15,6 +15,7 @@ // limitations under the License. // #include +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_GalleryViewEventInfo.h" namespace Tizen { namespace Ui { namespace Controls { @@ -53,7 +54,7 @@ _GalleryViewEventInfo::GetTouchStatus(void) const return __pTouchInfo->GetTouchStatus(); } -Tizen::Graphics::Point +Tizen::Graphics::FloatPoint _GalleryViewEventInfo::GetCurrentPosition(void) const { SysAssert(__pTouchInfo != null); @@ -97,12 +98,12 @@ _GalleryViewEventInfo::GetFlickTime(void) const } void -_GalleryViewEventInfo::SetPinchCenterPosition(Tizen::Graphics::Point centerPos) +_GalleryViewEventInfo::SetPinchCenterPosition(Tizen::Graphics::FloatPoint centerPos) { __pinchCenterPosition = centerPos; } -Tizen::Graphics::Point +Tizen::Graphics::FloatPoint _GalleryViewEventInfo::GetPinchCenterPosition(void) const { return __pinchCenterPosition; diff --git a/src/ui/controls/FUiCtrl_GroupContainer.cpp b/src/ui/controls/FUiCtrl_GroupContainer.cpp new file mode 100644 index 0000000..3cb30ea --- /dev/null +++ b/src/ui/controls/FUiCtrl_GroupContainer.cpp @@ -0,0 +1,1183 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainer.cpp + * @brief This is the implementation file for the _GroupContainer class. + * + */ + +#include +#include +#include +#include "FUiCtrl_GroupContainer.h" +#include "FUiAnim_VisualElement.h" +#include "FUi_ControlImpl.h" +#include "FUiCtrl_GroupContainerImpl.h" +#include "FUi_ControlManager.h" +#include "FUi_ResourceManager.h" +#include "FUiCtrl_Label.h" +#include "FUi_CoordinateSystemUtils.h" + +using namespace Tizen::Graphics; +using namespace Tizen::Ui; +using namespace Tizen::Base; +using namespace Tizen::Ui::Animations; + +class GroupedContentContentProvider : public IVisualElementContentProvider +{ + virtual bool PrepareDraw(Tizen::Ui::Animations::VisualElement& target) { return true;} + + virtual void DrawContent(Tizen::Ui::Animations::VisualElement& target, Tizen::Graphics::Canvas& canvas) {} + + virtual HitTestResult HitTest(Tizen::Ui::Animations::VisualElement& target, const Tizen::Graphics::FloatPoint& point) + { + return HIT_TEST_NOWHERE; + } +}; + +namespace Tizen { namespace Ui { namespace Controls +{ + +_GroupContainer::_GroupContainer(void) + : __pCellsArray(null) + , __pGroupContainerImpl(null) + , __pGroupContainerPresenter(null) + , __rowCount(0) + , __columnCount(0) + , __childAttachedRowIndex(-1) + , __childAttachedColumnIndex(-1) + , __lineWidth(0) + , __lineColor() + , __isChildAdding(false) + , __pStretchableRowIndex(null) + , __pStretchableColumnIndex(null) + , __pSystemControl(null) +{ + +} + +_GroupContainer::~_GroupContainer(void) +{ + for (int i = 0; i < __rowCount; i++) + { + delete[] __pCellsArray[i]; + } + delete[] __pCellsArray; + delete __pGroupContainerPresenter; + __pGroupContainerPresenter = null; + + delete[] __pStretchableRowIndex; + delete[] __pStretchableColumnIndex; +} + +_GroupContainer* +_GroupContainer::CreateGroupContainerN(const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth) +{ + ClearLastResult(); + _GroupContainer* pGroupContainer = new (std::nothrow) _GroupContainer(); + SysTryReturn(NID_UI_CTRL, pGroupContainer != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + result r = pGroupContainer->Initialize(rect, rowCount, columnCount, lineWidth); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pGroupContainer->AcquireHandle(); + return pGroupContainer; + +CATCH: + delete pGroupContainer; + + SetLastResult(r); + return null; +} + +result +_GroupContainer::Initialize(const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth) +{ + result r = E_SUCCESS; + GroupedContentContentProvider* pNewContent = null; + + SysTryReturn(NID_UI_CTRL, (lineWidth >= 1), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The line width should not be less than 1."); + __lineWidth = lineWidth; + + SysTryReturn(NID_UI_CTRL, (rect.width >= 0.0f && rect.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The bounds of the container should be non negative."); + SysTryReturn(NID_UI_CTRL, (rowCount > 0 && columnCount > 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The rowCount or columnCount should be greater than 0."); + + Color backgroundColor; + GET_COLOR_CONFIG(GROUPCONTAINER::NORMAL_BG, backgroundColor); + SetBackgroundColor(backgroundColor); + + r = GET_COLOR_CONFIG(GROUPCONTAINER::LINE_COLOR_FG, __lineColor); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + float totalColLineWidth = (columnCount + 1.0f) * __lineWidth; + float totalRowLineHeight = (rowCount + 1.0f) * __lineWidth; + + int cellWidth = (rect.width - totalColLineWidth) / (columnCount); + int cellHeight = (rect.height - totalRowLineHeight) / (rowCount); + + float balanceWidthPixels = fmod((rect.width - totalColLineWidth), columnCount); + float balanceHeightPixels = fmod((rect.height - totalRowLineHeight), rowCount); + int additionalWidth = -1; + int additionalHeight = -1; + int margin = 0; + + int width = _CoordinateSystemUtils::ConvertToInteger(balanceWidthPixels); + int height = _CoordinateSystemUtils::ConvertToInteger(balanceHeightPixels); + + _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + r = GET_FIXED_VALUE_CONFIG(GROUPCONTAINER::DEFAULT_MARGIN, orientation, margin); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pCellsArray = new (std::nothrow) _CellInfo *[rowCount]; + SysTryReturn(NID_UI_CTRL, __pCellsArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pStretchableRowIndex = new (std::nothrow) bool[rowCount]; + SysTryReturn(NID_UI_CTRL, __pCellsArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + for (int i = 0; i < rowCount; i++) + { + __pStretchableRowIndex[i] = false; + } + + __pStretchableColumnIndex = new (std::nothrow) bool[columnCount]; + SysTryReturn(NID_UI_CTRL, __pCellsArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + for (int i = 0; i < columnCount; i++) + { + __pStretchableColumnIndex[i] = false; + } + + for (int i = 0; i < rowCount; i++) + { + __pCellsArray[i] = null; + } + + for (int i = 0; i < rowCount; i++) + { + __pCellsArray[i] = new (std::nothrow) _CellInfo[columnCount]; + SysTryCatch(NID_UI_CTRL, __pCellsArray[i] != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + } + + for (int row = 0; row < rowCount; row++) + { + for (int col = 0; col < columnCount; col++) + { + additionalWidth = (col < width) ? 1 : 0; + additionalHeight = (row < height) ? 1 : 0; + + if (col == 0) + { + __pCellsArray[row][col].cellBounds.x = __lineWidth; + } + else + { + __pCellsArray[row][col].cellBounds.x = (__pCellsArray[row][col - 1].cellBounds.x + __pCellsArray[row][col - 1].cellBounds.width) + __lineWidth; + } + + if (row == 0) + { + __pCellsArray[row][col].cellBounds.y = __lineWidth; + } + else + { + __pCellsArray[row][col].cellBounds.y = (__pCellsArray[row - 1][col].cellBounds.y + __pCellsArray[row - 1][col].cellBounds.height) + __lineWidth; + } + + __pCellsArray[row][col].cellBounds.width = cellWidth + additionalWidth; + __pCellsArray[row][col].cellBounds.height = cellHeight + additionalHeight; + + __pCellsArray[row][col].actualSize.width = __pCellsArray[row][col].cellBounds.width; + __pCellsArray[row][col].actualSize.height = __pCellsArray[row][col].cellBounds.height; + + __pCellsArray[row][col].parentCell.row = row; + __pCellsArray[row][col].parentCell.column = col; + __pCellsArray[row][col].cellMargin.left = margin; + __pCellsArray[row][col].cellMargin.right = margin; + __pCellsArray[row][col].cellMargin.top = margin; + __pCellsArray[row][col].cellMargin.bottom = margin; + + __pCellsArray[row][col].isResizeEnabled = false; + __pCellsArray[row][col].isMerged = false; + __pCellsArray[row][col].isParent = false; + __pCellsArray[row][col].mergedRowCount = 0; + __pCellsArray[row][col].mergedColumnCount = 0; + __pCellsArray[row][col].isBoundsModified = false; + } + } + + __pSystemControl = _Control::CreateControlN(); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.", GetErrorMessage(r)); + + __pSystemControl->SetBounds(FloatRectangle(0.0f, 0.0f, rect.width, rect.height)); + __pSystemControl->SetBackgroundColor(Color(0)); + r = AttachSystemChild(*__pSystemControl); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.", GetErrorMessage(r)); + + pNewContent = new GroupedContentContentProvider(); + SysTryCatch(NID_UI_CTRL, pNewContent != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pSystemControl->GetVisualElement()->SetContentProvider(pNewContent); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.", GetErrorMessage(r)); + + __pGroupContainerPresenter = new (std::nothrow) _GroupContainerPresenter(*this); + SysTryCatch(NID_UI_CTRL, __pGroupContainerPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + r = GetVisualElement()->SetSurfaceOpaque(false); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __rowCount = rowCount; + __columnCount = columnCount; + + r = SetBounds(rect); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + + for (int i = 0; i < __rowCount; i++) + { + delete[] __pCellsArray[i]; + } + delete[] __pCellsArray; + + delete __pSystemControl; + __pSystemControl = null; + + delete pNewContent; + + delete __pGroupContainerPresenter; + __pGroupContainerPresenter = null; + + return r; +} + +void +_GroupContainer::SetImpl(_GroupContainerImpl *pImpl) +{ + __pGroupContainerImpl = pImpl; +} + +result +_GroupContainer::AddControlAt(Control &control, int rowIndex, int columnIndex) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row or column index."); + SysTryReturnResult(NID_UI_CTRL, (HasChild(rowIndex, columnIndex) == false), E_INVALID_OPERATION, "The control instance is already added in this index."); + + //Can't add in merged cells + if (__pCellsArray[rowIndex][columnIndex].parentCell.row == rowIndex && + __pCellsArray[rowIndex][columnIndex].parentCell.column == columnIndex) + { + float x = __pCellsArray[rowIndex][columnIndex].cellBounds.x; + float y = __pCellsArray[rowIndex][columnIndex].cellBounds.y; + float leftMargin = __pCellsArray[rowIndex][columnIndex].cellMargin.left; + float topMargin = __pCellsArray[rowIndex][columnIndex].cellMargin.top; + + __childAttachedRowIndex = rowIndex; + __childAttachedColumnIndex = columnIndex; + + __isChildAdding = true; + r = __pGroupContainerImpl->AddChild(const_cast <_ControlImpl*>(_ControlImpl::GetInstance(control))); + __isChildAdding = false; + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _ControlImpl* pControlImpl = const_cast <_ControlImpl*>(_ControlImpl::GetInstance(control)); + SetChildPosition(pControlImpl->GetCore(), rowIndex, columnIndex, FloatPoint(x + leftMargin + control.GetXF(), y + topMargin + control.GetYF())); + + pControlImpl->GetCore().SetUserData(static_cast(pControlImpl)); + + } + else + { + r = E_INVALID_OPERATION; + } + return r; + +CATCH: + __childAttachedRowIndex = -1; + __childAttachedColumnIndex = -1; + return r; +} + +Control* +_GroupContainer::GetControlAt(int rowIndex, int columnIndex) +{ + SysTryReturn(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Invalid row or column index."); + + result r = E_SUCCESS; + SysTryReturn(NID_UI_CTRL, (HasChild(rowIndex, columnIndex)), null, E_INVALID_OPERATION, "Control does not exist in the specified cell."); + + _Control* pChild = null; + _ControlImpl* pChildImpl = null; + + pChild = GetControlCoreAt(rowIndex, columnIndex); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pChild, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + pChildImpl = static_cast<_ControlImpl*>(pChild->GetUserData()); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pChildImpl, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return &pChildImpl->GetPublic(); +} + +result +_GroupContainer::RemoveControlAt(int rowIndex, int columnIndex) +{ + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row or column index."); + + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (HasChild(rowIndex, columnIndex)), E_INVALID_OPERATION, "Control does not exist in the specified cell."); + + _Control* pChild = null; + _ControlImpl* pChildImpl = null; + + pChild = GetControlCoreAt(rowIndex, columnIndex); + r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + pChildImpl = static_cast<_ControlImpl*>(pChild->GetUserData()); + r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pGroupContainerImpl->GetPublic().RemoveControl(const_cast(pChildImpl->GetPublic())); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +_GroupContainer::SetColumnWidth(int columnIndex, float width) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (columnIndex >= 0 && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Column index should be non negative and less than total column count."); + SysTryReturnResult(NID_UI_CTRL, width >= 0, E_INVALID_ARG, "Invalid argument(s) is used. Column width should be non negative."); + + int row = -1; + int column = -1; + + for (int i = 0; i < __rowCount; i++) + { + for (int j = 0; j < __columnCount; j++) + { + __pCellsArray[i][j].isBoundsModified = false; + } + } + + //Algorithm: + //Step 1: If a particular cell is NOT merged, set Width, else goto Step 2 + //Step 2: If Merged and Parent = FALSE, set Width + //Step 3: If parent cell's Width is NOT adjusted according to child then adjust it + //Step 4: Assign actual size + //Step 5: Calculate other cells x,y and re position control in it, if any + for (int i = 0; i < __rowCount; i++) + { + row = __pCellsArray[i][columnIndex].parentCell.row; + column = __pCellsArray[i][columnIndex].parentCell.column; + + if (__pCellsArray[i][columnIndex].isMerged) + { + if (__pCellsArray[i][columnIndex].isParent == false) + { + __pCellsArray[i][columnIndex].cellBounds.width = width; + } + if (__pCellsArray[row][column].isBoundsModified == false) + { + __pCellsArray[row][column].cellBounds.width -= (__pCellsArray[i][columnIndex].actualSize.width - width); + __pCellsArray[row][column].isBoundsModified = true; + } + } + else + { + __pCellsArray[i][columnIndex].cellBounds.width = width; + } + + __pCellsArray[i][columnIndex].actualSize.width = width; + + for (int j = columnIndex; j < __columnCount - 1; j++) + { + FloatRectangle previousCellBounds = __pCellsArray[i][j + 1].cellBounds; + __pCellsArray[i][j + 1].cellBounds.x = __pCellsArray[i][j].cellBounds.x + __pCellsArray[i][j].actualSize.width + __lineWidth; + + if (HasChild(i, j + 1) == true) + { + _Control* pControl = GetControlCoreAt(i, j + 1); + if (pControl) + { + FloatPoint controlPosition = pControl->GetPositionF(); + float updatedPosition = controlPosition.x - previousCellBounds.x; + SetChildPosition(*pControl, i, j + 1, FloatPoint(__pCellsArray[i][j + 1].cellBounds.x + updatedPosition, controlPosition.y)); + } + } + } + } + + return r; +} + +float +_GroupContainer::GetColumnWidth(int columnIndex) +{ + SysTryReturnResult(NID_UI_CTRL, (columnIndex >= 0 && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Column index should be non negative and less than total column count."); + return __pCellsArray[0][columnIndex].cellBounds.width; +} + +result +_GroupContainer::SetRowHeight(int rowIndex, float height) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && rowIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Row index should be non negative and less then total row count."); + SysTryReturnResult(NID_UI_CTRL, height >= 0, E_INVALID_ARG, "Invalid argument(s) is used. Row height should be non negative."); + + int row = -1; + int column = -1; + + for (int i = 0; i < __rowCount; i++) + { + for (int j = 0; j < __columnCount; j++) + { + __pCellsArray[i][j].isBoundsModified = false; + } + } + + //Algorithm: + //Step 1: If a particular cell is NOT merged, set Height, else goto Step 2 + //Step 2: If Merged and Parent = FALSE, set Height + //Step 3: If parent cell's Height is NOT adjusted according to child then adjust it + //Step 4: Assign actual size + //Step 5: Calculate other cells x,y and re position control in it, if any. + for (int j = 0; j < __columnCount; j++) + { + row = __pCellsArray[rowIndex][j].parentCell.row; + column = __pCellsArray[rowIndex][j].parentCell.column; + + if (__pCellsArray[rowIndex][j].isMerged) + { + if (__pCellsArray[rowIndex][j].isParent == false) + { + __pCellsArray[rowIndex][j].cellBounds.height = height; + } + if (__pCellsArray[row][column].isBoundsModified == false) + { + __pCellsArray[row][column].cellBounds.height -= (__pCellsArray[rowIndex][j].actualSize.height - height); + __pCellsArray[row][column].isBoundsModified = true; + } + } + else + { + __pCellsArray[rowIndex][j].cellBounds.height = height; + } + + __pCellsArray[rowIndex][j].actualSize.height = height; + + for (int i = rowIndex; i < __rowCount - 1; i++) + { + FloatRectangle previousCellBounds = __pCellsArray[i + 1][j].cellBounds; + __pCellsArray[i + 1][j].cellBounds.y = __pCellsArray[i][j].cellBounds.y + __pCellsArray[i][j].actualSize.height + __lineWidth; + + if (HasChild(i + 1, j) == true) + { + _Control* pControl = GetControlCoreAt(i + 1, j); + if (pControl) + { + FloatPoint controlPosition = pControl->GetPositionF(); + float updatedPosition = controlPosition.y - previousCellBounds.y; + SetChildPosition(*pControl, i + 1, j, FloatPoint(controlPosition.x, __pCellsArray[i + 1][j].cellBounds.y + updatedPosition)); + } + } + } + } + return r; +} + +float +_GroupContainer::GetRowHeight(int rowIndex) +{ + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && rowIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Row index should be non negative and less than total row count."); + return __pCellsArray[rowIndex][0].cellBounds.height; +} + +result +_GroupContainer::Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount) +{ + int rowEndIndex = rowStartIndex + rowCount; + int columnEndIndex = columnStartIndex + columnCount; + + SysTryReturnResult(NID_UI_CTRL, (rowStartIndex >= 0 && rowStartIndex < __rowCount && rowEndIndex >= 0 && rowEndIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row start or end index."); + SysTryReturnResult(NID_UI_CTRL, (columnStartIndex >= 0 && columnStartIndex < __columnCount && columnEndIndex >= 0 && columnEndIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid column start or end index."); + + //If same combination of cells, return success + if (__pCellsArray[rowStartIndex][columnStartIndex].isParent) + { + _MergeCellIndex parent = __pCellsArray[rowEndIndex][columnEndIndex].parentCell; + if ((parent.row == rowStartIndex) && (parent.column == columnStartIndex)) + { + return E_SUCCESS; + } + } + + //If non empty, return + for (int i = rowStartIndex; i <= rowEndIndex; i++) + { + for (int j = columnStartIndex; j <= columnEndIndex; j++) + { + + if (__pCellsArray[i][j].isMerged) + { + if (__pCellsArray[i][j].isParent) + { + if ((__pCellsArray[i][j].mergedColumnCount > (columnEndIndex - j)) || (__pCellsArray[i][j].mergedRowCount > (rowEndIndex - i))) + { + return E_INVALID_ARG; + } + } + else if (columnStartIndex > __pCellsArray[i][j].parentCell.column || rowStartIndex > __pCellsArray[i][j].parentCell.row) + { + return E_INVALID_ARG; + } + } + + //Allow merge if Control is added in parent cell + if (i != rowStartIndex || j != columnStartIndex) + { + if (HasChild(i, j) == true) + { + return E_INVALID_ARG; + } + } + } + } + + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.width = __pCellsArray[rowStartIndex][columnStartIndex].actualSize.width; + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.height = __pCellsArray[rowStartIndex][columnStartIndex].actualSize.height; + + for (int i = rowStartIndex; i < rowEndIndex; i++) + { + for (int j = columnStartIndex; j < columnEndIndex; j++) + { + if (__pCellsArray[i][j].isParent) + { + __pCellsArray[i][j].isParent = false; + } + //Add Width of All Cells on RHS of parent, to Parent Cell + if (i == rowStartIndex) + { + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.width += (__pCellsArray[i][j + 1].actualSize.width + __lineWidth); + } + //Add Height of All Cells below parent, to Parent Cell + if (j == columnStartIndex) + { + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.height += (__pCellsArray[i + 1][j].actualSize.height + __lineWidth); + } + + CollapseCell(i, j, rowStartIndex, columnStartIndex); + CollapseCell(i, j + 1, rowStartIndex, columnStartIndex); + CollapseCell(i + 1, j, rowStartIndex, columnStartIndex); + CollapseCell(i + 1, j + 1, rowStartIndex, columnStartIndex); + } + //Logic to handle merge cells in same column but different rows + if (columnStartIndex == columnEndIndex) + { + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.height += (__pCellsArray[i + 1][columnStartIndex].actualSize.height + __lineWidth); + CollapseCell(rowStartIndex, columnStartIndex, rowStartIndex, columnStartIndex); + + CollapseCell(i + 1, columnStartIndex, rowStartIndex, columnStartIndex); + } + } + //Logic to handle merge cells in same row but different columns + if (rowStartIndex == rowEndIndex) + { + for (int j = columnStartIndex; j < columnEndIndex; j++) + { + __pCellsArray[rowStartIndex][columnStartIndex].cellBounds.width += (__pCellsArray[rowStartIndex][j + 1].actualSize.width + __lineWidth); + CollapseCell(rowStartIndex, columnStartIndex, rowStartIndex, columnStartIndex); + + CollapseCell(rowStartIndex, j + 1, rowStartIndex, columnStartIndex); + } + } + + __pCellsArray[rowStartIndex][columnStartIndex].mergedColumnCount = columnEndIndex - columnStartIndex; + __pCellsArray[rowStartIndex][columnStartIndex].mergedRowCount = rowEndIndex - rowStartIndex; + __pCellsArray[rowStartIndex][columnStartIndex].isParent = true; + + return E_SUCCESS; +} + +result +_GroupContainer::SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row or column index."); + + if (__pCellsArray[rowIndex][columnIndex].parentCell.row == rowIndex && + __pCellsArray[rowIndex][columnIndex].parentCell.column == columnIndex) + { + if (enable) + { + __pCellsArray[rowIndex][columnIndex].isResizeEnabled = true; + r = ResizeControl(rowIndex, columnIndex); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + __pCellsArray[rowIndex][columnIndex].isResizeEnabled = false; + } + } + else + { + r = E_INVALID_ARG; + } + + return r; +} + +result +_GroupContainer::SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row or column index."); + + SysTryReturnResult(NID_UI_CTRL, (leftMargin >= 0.0f && rightMargin >= 0.0f && topMargin >= 0.0f && bottomMargin >= 0.0f), E_INVALID_ARG, "Invalid argument(s) is used. Invalid margin value."); + + _CellMargin prevCellMargin = __pCellsArray[rowIndex][columnIndex].cellMargin; + __pCellsArray[rowIndex][columnIndex].cellMargin.left = leftMargin; + __pCellsArray[rowIndex][columnIndex].cellMargin.right = rightMargin; + __pCellsArray[rowIndex][columnIndex].cellMargin.top = topMargin; + __pCellsArray[rowIndex][columnIndex].cellMargin.bottom = bottomMargin; + + if (HasChild(rowIndex, columnIndex) == true) + { + FloatRectangle controlRect(0.0f, 0.0f, 0.0f, 0.0f); + + FloatRectangle rect = GetBoundsAt(rowIndex, columnIndex); + + _Control* pControl = GetControlCoreAt(rowIndex, columnIndex); + if (pControl) + { + controlRect = pControl->GetBoundsF(); + + FloatRectangle localCellControlRect(0.0f, 0.0f, 0.0f, 0.0f); + localCellControlRect.x = controlRect.x - rect.x - prevCellMargin.left; + localCellControlRect.y = controlRect.y - rect.y - prevCellMargin.top; + + rect.x = rect.x + leftMargin + localCellControlRect.x; + rect.y = rect.y + topMargin + localCellControlRect.y; + if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true) + { + controlRect.width = rect.width - (leftMargin + localCellControlRect.x + rightMargin); + controlRect.height = rect.height - (topMargin + localCellControlRect.y + bottomMargin); + } + + r = SetChildBounds(*pControl, rowIndex, columnIndex, FloatRectangle(rect.x, rect.y, controlRect.width, controlRect.height)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } + + return r; +} + +FloatRectangle +_GroupContainer::GetBoundsAt(int rowIndex, int columnIndex) const +{ + ClearLastResult(); + + FloatRectangle rect(0.0f, 0.0f, -1.0f, -1.0f); + SysTryReturn(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >=0 && rowIndex < __rowCount && columnIndex < __columnCount), rect, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. Invalid row or column index."); + + rect.x = __pCellsArray[rowIndex][columnIndex].cellBounds.x; + rect.width = __pCellsArray[rowIndex][columnIndex].cellBounds.width; + rect.y = __pCellsArray[rowIndex][columnIndex].cellBounds.y; + rect.height = __pCellsArray[rowIndex][columnIndex].cellBounds.height; + + return rect; +} + +result +_GroupContainer::Split(int rowIndex, int columnIndex) +{ + result r = E_SUCCESS; + int rowEndIndex = -1; + int columnEndIndex = -1; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && rowIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row start index."); + SysTryReturnResult(NID_UI_CTRL, (columnIndex >= 0 && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid column start index."); + + if (__pCellsArray[rowIndex][columnIndex].isParent) + { + Point lastChild = GetLastChild(rowIndex, columnIndex); + rowEndIndex = lastChild.x; + columnEndIndex = lastChild.y; + } + else + { + return E_INVALID_ARG; + } + + __pCellsArray[rowIndex][columnIndex].mergedColumnCount = 0; + __pCellsArray[rowIndex][columnIndex].mergedRowCount = 0; + + for (int i = rowIndex; i <= rowEndIndex; i++) + { + for (int j = columnIndex; j <= columnEndIndex; j++) + { + __pCellsArray[i][j].cellBounds.width = __pCellsArray[i][j].actualSize.width; + __pCellsArray[i][j].cellBounds.height = __pCellsArray[i][j].actualSize.height; + __pCellsArray[i][j].isMerged = false; + __pCellsArray[i][j].isParent = false; + __pCellsArray[i][j].parentCell.row = i; + __pCellsArray[i][j].parentCell.column = j; + } + } + + return r; +} + +void +_GroupContainer::SetLineColor(const Color& color) +{ + __lineColor = color; +} + +Color +_GroupContainer::GetLineColor(void) +{ + return __lineColor; +} + +int +_GroupContainer::GetLineWidth(void) +{ + return __lineWidth; +} + +result +_GroupContainer::SetColumnStretchable(int columnIndex, bool stretchable) +{ + SysTryReturnResult(NID_UI_CTRL, (columnIndex >= 0 && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Column index should be non negative and less than total column count."); + + if (stretchable) + { + __pStretchableColumnIndex[columnIndex] = true; + } + else + { + __pStretchableColumnIndex[columnIndex] = false; + } + + return E_SUCCESS; +} + +bool +_GroupContainer::IsColumnStretchable(int columnIndex) +{ + SysTryReturnResult(NID_UI_CTRL, (columnIndex >= 0 && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Column index should be non negative and less than total column count."); + + return __pStretchableColumnIndex[columnIndex]; +} + +result +_GroupContainer::SetRowStretchable(int rowIndex, bool stretchable) +{ + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && rowIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Row index should be non negative and less than total row count."); + + if (stretchable) + { + __pStretchableRowIndex[rowIndex] = true; + + } + else + { + __pStretchableRowIndex[rowIndex] = false; + } + return E_SUCCESS; +} + +bool +_GroupContainer::IsRowStretchable(int rowIndex) +{ + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && rowIndex < __rowCount), E_INVALID_ARG, "Invalid argument(s) is used. Row index should be non negative and less than total row count."); + + return __pStretchableRowIndex[rowIndex]; +} + +int +_GroupContainer::GetRowCount(void) +{ + return __rowCount; +} + +int +_GroupContainer::GetColumnCount(void) +{ + return __columnCount; +} + +result +_GroupContainer::ResizeControl(int rowIndex, int columnIndex) +{ + result r = E_SUCCESS; + + SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_INVALID_ARG, "Invalid argument(s) is used. Invalid row or column index."); + + if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true) + { + if (HasChild(rowIndex, columnIndex) == true) + { + FloatRectangle rect = GetBoundsAt(rowIndex, columnIndex); + _Control* pControl = GetControlCoreAt(rowIndex, columnIndex); +#if 1 //New Algorithm + if (pControl) + { + FloatRectangle controlRect = pControl->GetBoundsF(); + if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true) + { + rect.width = rect.width - (controlRect.x - rect.x + __pCellsArray[rowIndex][columnIndex].cellMargin.right); + rect.height = rect.height - (controlRect.y - rect.y + __pCellsArray[rowIndex][columnIndex].cellMargin.bottom); + } + + r = SetChildBounds(*pControl, rowIndex, columnIndex, FloatRectangle(controlRect.x, controlRect.y, rect.width, rect.height)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + +#else + + rect.x += __pCellsArray[rowIndex][columnIndex].cellMargin.left; + rect.y += __pCellsArray[rowIndex][columnIndex].cellMargin.top; + rect.width -= (__pCellsArray[rowIndex][columnIndex].cellMargin.left + __pCellsArray[rowIndex][columnIndex].cellMargin.right); + rect.height -= (__pCellsArray[rowIndex][columnIndex].cellMargin.top + __pCellsArray[rowIndex][columnIndex].cellMargin.bottom); + + + if (pControl) + { + r = pControl->SetBounds(rect); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } +#endif + } + } + + return r; +} + +void +_GroupContainer::CollapseCell(int rowIndex, int columnIndex, int rowStartIndex, int columnStartIndex) +{ + __pCellsArray[rowIndex][columnIndex].isMerged = true; + __pCellsArray[rowIndex][columnIndex].parentCell.row = rowStartIndex; + __pCellsArray[rowIndex][columnIndex].parentCell.column = columnStartIndex; +} + +bool +_GroupContainer::HasChild(int rowIndex, int columnIndex) +{ + if (__pCellsArray[rowIndex][columnIndex].controlHandle.IsValid()) + { + return true; + } + + return false; +} + +Point +_GroupContainer::GetLastChild(int rowIndex, int columnIndex) +{ + Point lastChild; + if (__pCellsArray[rowIndex][columnIndex].isParent) + { + lastChild.x = rowIndex + __pCellsArray[rowIndex][columnIndex].mergedRowCount; + lastChild.y = columnIndex + __pCellsArray[rowIndex][columnIndex].mergedColumnCount; + } + return lastChild; +} + +bool +_GroupContainer::IsMerged(int rowIndex, int columnIndex) +{ + return __pCellsArray[rowIndex][columnIndex].isMerged; +} + +bool +_GroupContainer::IsParent(int rowIndex, int columnIndex) +{ + return __pCellsArray[rowIndex][columnIndex].isParent; +} + +_Control* +_GroupContainer::GetControlCoreAt(int rowIndex, int columnIndex) +{ + SetLastResult(E_SUCCESS); + + _Control* pControl = null; + _ControlManager *pControlManager = null; + pControlManager = _ControlManager::GetInstance(); + if (pControlManager) + { + pControl = pControlManager->GetObject(__pCellsArray[rowIndex][columnIndex].controlHandle); + } + + if (!pControl) + { + SysLogException(NID_UI, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get control at specified index."); + } + + return pControl; +} + +_GroupContainer::_MergeCellIndex +_GroupContainer::GetParentCell(const _Control& child) +{ + _MergeCellIndex index = {-1, -1}; + for (int row = 0; row < __rowCount; row++) + { + for (int cols = 0; cols < __columnCount; cols++) + { + if (__pCellsArray[row][cols].controlHandle == child.GetHandle()) + { + return __pCellsArray[row][cols].parentCell; + } + } + } + return index; +} + +void +_GroupContainer::OnDraw(void) +{ + ClearLastResult(); + + if (__pGroupContainerPresenter != null) + { + __pGroupContainerPresenter->Draw(); + } +} + +result +_GroupContainer::OnAttachedToMainTree(void) +{ + __pGroupContainerPresenter->LoadResourceBitmaps(); + + return E_SUCCESS; +} + +void +_GroupContainer::OnChildAttached(const _Control& child) +{ + //This check is to make sure this _Control is added through AddControlAt(int, int); + if (__childAttachedRowIndex >= 0 && __childAttachedColumnIndex >= 0) + { + __pCellsArray[__childAttachedRowIndex][__childAttachedColumnIndex].controlHandle = child.GetHandle(); + } + __childAttachedRowIndex = -1; + __childAttachedColumnIndex = -1; +} + +void +_GroupContainer::OnChildDetached(const _Control& child) +{ + +} + +void +_GroupContainer::OnChildBoundsChanged(const _Control& child) +{ + if (__isChildAdding) + { + //This check is to make sure this _Control is added through AddControlAt(int, int); + if (__childAttachedRowIndex >= 0 && __childAttachedColumnIndex >= 0) + { + __pCellsArray[__childAttachedRowIndex][__childAttachedColumnIndex].controlHandle = child.GetHandle(); + } + __childAttachedRowIndex = -1; + __childAttachedColumnIndex = -1; + __isChildAdding = false; + } + + _MergeCellIndex parentIndex = GetParentCell(child); + FloatRectangle parentBounds = __pCellsArray[parentIndex.row][parentIndex.column].cellBounds; + _CellMargin parentMargin = __pCellsArray[parentIndex.row][parentIndex.column].cellMargin; + + FloatPoint childCurrentPosition = __pCellsArray[parentIndex.row][parentIndex.column].childControlPos; + FloatPoint childNewPosition = child.GetPositionF(); + + if (childCurrentPosition != childNewPosition) + { + childNewPosition.x += parentBounds.x; + childNewPosition.y += parentBounds.y; + childNewPosition.x += parentMargin.left; + childNewPosition.y += parentMargin.top; + + __pCellsArray[parentIndex.row][parentIndex.column].childControlPos = childNewPosition; + (const_cast<_Control&>(child)).SetPosition(childNewPosition); + } +} + +result +_GroupContainer::SetChildPosition(_Control& pControl, int rowIndex, int columnIndex, FloatPoint position) +{ + __pCellsArray[rowIndex][columnIndex].childControlPos = position; + FloatRectangle rect = pControl.GetBoundsF(); + return pControl.SetBounds(FloatRectangle(position.x, position.y, rect.width, rect.height), false); +} + +result +_GroupContainer::SetChildBounds(_Control& pControl, int rowIndex, int columnIndex, FloatRectangle bounds) +{ + __pCellsArray[rowIndex][columnIndex].childControlPos = FloatPoint(bounds.x, bounds.y); + return pControl.SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height), false); +} + +void +_GroupContainer::OnBoundsChanged(void) +{ + __pSystemControl->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height), false); +} + +void +_GroupContainer::UpdateStretchableCellBounds(FloatRectangle gridRect, FloatRectangle controlRect) +{ + int stretchableRowCount = 0; + int stretchableColumnCount = 0; + float stretchableWidth = 0.0f; + float stretchableHeight = 0.0f; + float balanceWidthPixels = 0.0f; + float balanceHeightPixels = 0.0f; + int width = 0; + int height = 0; + + for (int columnIndex = 0; columnIndex < __columnCount; columnIndex++) + { + if (__pStretchableColumnIndex[columnIndex]) + { + stretchableColumnCount++; + } + } + + if (stretchableColumnCount != 0) + { + stretchableWidth = (controlRect.width - gridRect.width) / stretchableColumnCount; + balanceWidthPixels = fmod((controlRect.width - gridRect.width), stretchableColumnCount); + + width = _CoordinateSystemUtils::ConvertToInteger(balanceWidthPixels); + + for (int columnIndex = 0; columnIndex < __columnCount; columnIndex++) + { + if (__pStretchableColumnIndex[columnIndex] == true) + { + FloatDimension rect = __pCellsArray[0][columnIndex].actualSize; + rect.width = rect.width + stretchableWidth; + + if (width > 0) + { + rect.width = rect.width + 1; + width--; + } + else if (width < 0) + { + rect.width = rect.width - 1; + width++; + } + + if (rect.width < 0) + { + rect.width = 0; + } + + SetColumnWidth(columnIndex, rect.width); + } + } + } + + for (int rowIndex = 0; rowIndex < __rowCount; rowIndex++) + { + if (__pStretchableRowIndex[rowIndex]) + { + stretchableRowCount++; + } + } + + if (stretchableRowCount != 0) + { + stretchableHeight = (controlRect.height - gridRect.height) / stretchableRowCount; + balanceHeightPixels = fmod((controlRect.height - gridRect.height), stretchableRowCount); + height = _CoordinateSystemUtils::ConvertToInteger(balanceHeightPixels); + + for (int rowIndex = 0; rowIndex < __rowCount; rowIndex++) + { + if (__pStretchableRowIndex[rowIndex] == true) + { + FloatDimension rect = __pCellsArray[rowIndex][0].actualSize; + rect.height = rect.height + stretchableHeight; + + if (height > 0) + { + rect.height = rect.height + 1; + height--; + } + else if (height < 0) + { + rect.height = rect.height - 1; + height++; + } + + if (rect.height < 0) + { + rect.height = 0; + } + + SetRowHeight(rowIndex, rect.height); + } + } + } +} + +FloatRectangle +_GroupContainer::GetGridBounds(void) +{ + FloatRectangle gridBounds(0.0f, 0.0f, 0.0f, 0.0f); + + //Calculate total grid bounds (Accumulated Bounds of all Cells) + gridBounds.x = __pCellsArray[0][0].cellBounds.x - __lineWidth; + gridBounds.y = __pCellsArray[0][0].cellBounds.y - __lineWidth; + + _MergeCellIndex parent = __pCellsArray[0][__columnCount - 1].parentCell; + FloatRectangle lastCell = GetBoundsAt(parent.row, parent.column); + gridBounds.width = (lastCell.x + lastCell.width + __lineWidth); + + parent = __pCellsArray[__rowCount - 1][0].parentCell; + lastCell = GetBoundsAt(parent.row, parent.column); + gridBounds.height = (lastCell.y + lastCell.height + __lineWidth); + + return gridBounds; +} + +_Control* +_GroupContainer::GetSystemChild(void) +{ + return __pSystemControl; +} + +}}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_GroupContainerImpl.cpp b/src/ui/controls/FUiCtrl_GroupContainerImpl.cpp new file mode 100644 index 0000000..877c4f5 --- /dev/null +++ b/src/ui/controls/FUiCtrl_GroupContainerImpl.cpp @@ -0,0 +1,328 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainerImpl.cpp + * @brief This is the implementation file for the _GroupContainerImpl class. + * + */ + +#include +#include +#include "FUiCtrl_GroupContainerImpl.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_UiBuilder.h" + +using namespace Tizen::Graphics; +using namespace Tizen::Base; + +namespace Tizen { namespace Ui { namespace Controls +{ +_GroupContainerImpl::_GroupContainerImpl(Control* pPublic, _Control* pCore) +: _ContainerImpl(pPublic, pCore) +{ + +} + +_GroupContainerImpl::~_GroupContainerImpl(void) +{ + // nothing +} + +_GroupContainerImpl* +_GroupContainerImpl::CreateGroupContainerImplN(GroupContainer* pControl, const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth) +{ + ClearLastResult(); + + _GroupContainerImpl* pImpl = null; + _GroupContainer* pCore = null; + + pCore = _GroupContainer::CreateGroupContainerN(rect, rowCount, columnCount, lineWidth); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + pImpl = new (std::nothrow) _GroupContainerImpl(pControl, pCore); + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +} + +void +_GroupContainerImpl::Initialize(void) +{ + GetCore().SetImpl(this); +} + +const _GroupContainerImpl* +_GroupContainerImpl::GetInstance(const GroupContainer& grpContainer) +{ + return static_cast(_ControlImpl::GetInstance(grpContainer)); +} + +_GroupContainerImpl* +_GroupContainerImpl::GetInstance(GroupContainer& grpContainer) +{ + return static_cast<_GroupContainerImpl*>(_ControlImpl::GetInstance(grpContainer)); +} + +const char* +_GroupContainerImpl::GetPublicClassName(void) const +{ + return "Tizen::Ui::Controls::GroupContainer"; +} + +const GroupContainer& +_GroupContainerImpl::GetPublic(void) const +{ + return static_cast (_ControlImpl::GetPublic()); +} + +GroupContainer& +_GroupContainerImpl::GetPublic(void) +{ + return static_cast (_ControlImpl::GetPublic()); +} + +const _GroupContainer& +_GroupContainerImpl::GetCore(void) const +{ + return static_cast (_ControlImpl::GetCore()); +} + +_GroupContainer& +_GroupContainerImpl::GetCore(void) +{ + return static_cast <_GroupContainer&>(_ControlImpl::GetCore()); +} + +result +_GroupContainerImpl::AddControlAt(Control &control, int rowIndex, int rolumnIndex) +{ + return GetCore().AddControlAt(control, rowIndex, rolumnIndex); +} + +Control* +_GroupContainerImpl::GetControlAt(int rowIndex, int columnIndex) +{ + return GetCore().GetControlAt(rowIndex, columnIndex); +} + +result +_GroupContainerImpl::RemoveControlAt(int rowIndex, int columnIndex) +{ + return GetCore().RemoveControlAt(rowIndex, columnIndex); +} + +result +_GroupContainerImpl::SetColumnWidth(int columnIndex, float width) +{ + return GetCore().SetColumnWidth(columnIndex, width); +} + +float +_GroupContainerImpl::GetColumnWidth(int columnIndex) +{ + return GetCore().GetColumnWidth(columnIndex); +} + +result +_GroupContainerImpl::SetRowHeight(int rowIndex, float height) +{ + return GetCore().SetRowHeight(rowIndex, height); +} + +float +_GroupContainerImpl::GetRowHeight(int rowIndex) +{ + return GetCore().GetRowHeight(rowIndex); +} + +result +_GroupContainerImpl::Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount) +{ + return GetCore().Merge(rowStartIndex, columnStartIndex, rowCount, columnCount); +} + +result +_GroupContainerImpl::SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable) +{ + return GetCore().SetChildResizingEnabled(rowIndex, columnIndex, enable); +} + +result +_GroupContainerImpl::SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin) +{ + return GetCore().SetMargin(rowIndex, columnIndex, leftMargin, rightMargin, topMargin, bottomMargin); +} + +result +_GroupContainerImpl::Split(int rowIndex, int columnIndex) +{ + return GetCore().Split(rowIndex, columnIndex); +} + +FloatRectangle +_GroupContainerImpl::GetBoundsAt(int rowIndex, int columnIndex) const +{ + return GetCore().GetBoundsAt(rowIndex, columnIndex); +} + +result +_GroupContainerImpl::SetColumnStretchable(int columnIndex, bool stretchable) +{ + return GetCore().SetColumnStretchable(columnIndex, stretchable); +} + +bool +_GroupContainerImpl::IsColumnStretchable(int columnIndex) +{ + return GetCore().IsColumnStretchable(columnIndex); +} + +result +_GroupContainerImpl::SetRowStretchable(int rowIndex, bool stretchable) +{ + return GetCore().SetRowStretchable(rowIndex, stretchable); +} + +bool +_GroupContainerImpl::IsRowStretchable(int rowIndex) +{ + return GetCore().IsRowStretchable(rowIndex); +} + +void +_GroupContainerImpl::SetLineColor(const Color& color) +{ + GetCore().SetLineColor(color); +} + +Color +_GroupContainerImpl::GetLineColor(void) +{ + return GetCore().GetLineColor(); +} + +class _GroupContainerMaker + : public _UiBuilderControlMaker +{ +public: + _GroupContainerMaker(_UiBuilder* pUiBuilder) + : _UiBuilderControlMaker(pUiBuilder){}; + virtual ~_GroupContainerMaker(void){}; + + static _UiBuilderControlMaker* + GetInstance(_UiBuilder* pUiBuilder) + { + _GroupContainerMaker* pGroupContainerMaker = new (std::nothrow) _GroupContainerMaker(pUiBuilder); + SysTryReturn(NID_UI_CTRL, pGroupContainerMaker, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + return pGroupContainerMaker; + }; + +protected: + virtual Control* + Make(_UiBuilderControl* pControl) + { + result r = E_SYSTEM; + _UiBuilderControlLayout* pControlProperty = null; + GroupContainer* pGroupContainer = null; + FloatRectangle rect(0.0f, 0.0f, 0.0f, 0.0f); + String elementString = L""; + int rowCount = 1; + int columnCount = 1; + float lineWidth = 1.0f; + Color backgroundColor(0, 0, 0, 0); + Color lineColor(0, 0, 0, 0); + + GetProperty(pControl, &pControlProperty); + + if (pControlProperty == null) + { + return null; + } + + if (pControl->GetElement("rowCount", elementString)) + { + Integer::Parse(elementString, rowCount); + } + + if (pControl->GetElement("columnCount", elementString)) + { + Integer::Parse(elementString, columnCount); + } + + if (pControl->GetElement("lineWidth", elementString)) + { + Float::Parse(elementString, lineWidth); + } + + rect = pControlProperty->GetRectF(); + + pGroupContainer = new (std::nothrow) GroupContainer(); + SysTryReturn(NID_UI_CTRL, pGroupContainer, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + // Construct + r = pGroupContainer->Construct(rect, rowCount, columnCount, lineWidth); + + if (r != E_SUCCESS) + { + SysLog(NID_UI_CTRL, "Failed to create GroupContainer."); + + delete pGroupContainer; + pGroupContainer = null; + + return null; + } + + if (pControl->GetElement(L"backgroundColor", elementString)) + { + ConvertStringToColor(elementString, backgroundColor); + pGroupContainer->SetBackgroundColor(backgroundColor); + } + + if (pControl->GetElement(L"lineColor", elementString)) + { + ConvertStringToColor(elementString, lineColor); + pGroupContainer->SetBackgroundColor(lineColor); + } + + return pGroupContainer; + } +}; // _GroupContainerMaker + +_GroupContainerRegister::_GroupContainerRegister(void) +{ + _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); + if (pUiBuilderControlTableManager) + { + pUiBuilderControlTableManager->RegisterControl(L"GroupContainer", _GroupContainerMaker::GetInstance); + } +} + +_GroupContainerRegister::~_GroupContainerRegister(void) +{ + _UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance(); + if (pUiBuilderControlTableManager) + { + pUiBuilderControlTableManager->UnregisterControl(L"GroupContainer"); + } +} +static _GroupContainerRegister GroupContainerRegisterToUiBuilder; +}}} //Tizen::Ui::Controls + diff --git a/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp b/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp new file mode 100644 index 0000000..16bf48c --- /dev/null +++ b/src/ui/controls/FUiCtrl_GroupContainerPresenter.cpp @@ -0,0 +1,225 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainerPresenter.cpp + * @brief This is the implementation file for the _GroupContainerPresenter class. + * + */ + +#include +#include +#include +#include "FUiCtrl_GroupContainerPresenter.h" +#include "FUi_ResourceManager.h" +#include +#include "FUiAnim_VisualElement.h" + +using namespace Tizen::Graphics; +using namespace Tizen::Ui::Animations; + +namespace Tizen { namespace Ui { namespace Controls +{ + +_GroupContainerPresenter::_GroupContainerPresenter(void) + : __pGroupContainer(null) + , __pBgBitmap(null) + , __pBgEffectBitmap(null) + , __pBgColorReplacementBitmap(null) + , __pBgEffectColorReplacementBitmap(null) +{ + // Nothing +} + +_GroupContainerPresenter::_GroupContainerPresenter(_GroupContainer& groupContainer) +: __pGroupContainer(&groupContainer) +{ + // Nothing +} + +_GroupContainerPresenter::~_GroupContainerPresenter(void) +{ + __pGroupContainer = null; +} + +result +_GroupContainerPresenter::LoadResourceBitmaps(void) +{ + result r = E_SUCCESS; + r = GET_BITMAP_CONFIG_N(GROUPCONTAINER::SYSTEM_CONTROL_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pGroupContainer->GetParent()->GetBackgroundColor()); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to get replacement color Bitmap.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(GROUPCONTAINER::BORDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888,__pBgEffectBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pBgEffectColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pBgEffectBitmap, Color::GetColor(COLOR_ID_MAGENTA),Color(0,0,0,0)); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to get replacement color Bitmap.", GetErrorMessage(r)); + + return r; + +CATCH: + + delete __pBgColorReplacementBitmap; + __pBgColorReplacementBitmap = null; + + delete __pBgEffectBitmap; + __pBgEffectBitmap = null; + + delete __pBgEffectColorReplacementBitmap; + __pBgEffectColorReplacementBitmap = null; + + return r; +} + +void +_GroupContainerPresenter::Draw(void) +{ + result r = E_SUCCESS; + FloatRectangle gridBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle rect(0.0f, 0.0f, 0.0f, 0.0f); + int lineAdjustPosition = 0; + int rowIndex = 0; + int columnIndex = 0; + int rows = __pGroupContainer->GetRowCount(); + int columns = __pGroupContainer->GetColumnCount(); + int lineWidth = __pGroupContainer->GetLineWidth(); + + Canvas* pCanvas = __pGroupContainer->GetVisualElement()->GetCanvasN(); + _Control* pControl = __pGroupContainer->GetSystemChild(); + Canvas* pControlCanvas = pControl->GetCanvasN(); + SysTryCatch(NID_UI_CTRL, pCanvas != null, ,E_SYSTEM, "A system error has occurred. Failed to get the canvas."); + + pCanvas->SetBackgroundColor(__pGroupContainer->GetBackgroundColor()); + pCanvas->Clear(); + pCanvas->SetLineStyle(LINE_STYLE_SOLID); + pCanvas->SetLineWidth(lineWidth); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, ,r, "[%s] Propagating.", GetErrorMessage(r)); + + pCanvas->SetForegroundColor(__pGroupContainer->GetLineColor()); + + __pGroupContainer->UpdateStretchableCellBounds(__pGroupContainer->GetGridBounds(), __pGroupContainer->GetBoundsF()); + gridBounds = __pGroupContainer->GetGridBounds(); + + DrawBackgroundBitmapForSystemChild(pControlCanvas); + DrawBackgroundEffectBitmapForSystemChild(pControlCanvas); + + if (gridBounds.width < __pGroupContainer->GetBoundsF().width) + { + pCanvas->DrawLine(FloatPoint(gridBounds.x + gridBounds.width, gridBounds.y), FloatPoint(gridBounds.x + gridBounds.width, gridBounds.y + gridBounds.height)); + } + + if (gridBounds.height < __pGroupContainer->GetBoundsF().height) + { + pCanvas->DrawLine(FloatPoint(gridBounds.x, gridBounds.y + gridBounds.height), FloatPoint(gridBounds.x + gridBounds.width, gridBounds.y + gridBounds.height)); + } + + lineAdjustPosition = ((lineWidth % 2) == 0) ? (lineWidth / 2) : ((lineWidth - 1) / 2); + for (rowIndex = 0; rowIndex < rows; rowIndex++) + { + for (columnIndex = 0; columnIndex < columns; columnIndex++) + { + __pGroupContainer->ResizeControl(rowIndex, columnIndex); + rect = __pGroupContainer->GetBoundsAt(rowIndex , columnIndex); + + //Draw Cell Left and Top Lines for all cells + if ((__pGroupContainer->IsMerged(rowIndex, columnIndex) == false) || (__pGroupContainer->IsParent(rowIndex, columnIndex) == true)) + { + //Cells's Top Line + if (rowIndex != 0) + { + pCanvas->DrawLine(FloatPoint(rect.x - lineWidth, rect.y - lineWidth + lineAdjustPosition), FloatPoint(rect.x + rect.width, rect.y - lineWidth + lineAdjustPosition)); + } + //Cell's Left Line + if (columnIndex != 0) + { + pCanvas->DrawLine(FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y), FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y + rect.height)); + } + } + } + } + + delete pCanvas; + delete pControlCanvas; + + return; + +CATCH: + delete pCanvas; + delete pControlCanvas; + + return; +} + + +void +_GroupContainerPresenter::DrawBackgroundBitmapForSystemChild(Canvas* pCanvas) +{ + result r = E_SUCCESS; + + FloatRectangle bounds = __pGroupContainer->GetBoundsF(); + bounds.x = 0.0f; + bounds.y = 0.0f; + + if(__pBgColorReplacementBitmap != null) + { + if (__pBgColorReplacementBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(bounds, *__pBgColorReplacementBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = pCanvas->DrawBitmap(bounds, *__pBgColorReplacementBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } + +} + +void +_GroupContainerPresenter::DrawBackgroundEffectBitmapForSystemChild(Canvas* pCanvas) +{ + result r = E_SUCCESS; + + FloatRectangle bounds = __pGroupContainer->GetBoundsF(); + bounds.x = 0.0f; + bounds.y = 0.0f; + + if(__pBgEffectColorReplacementBitmap != null) + { + if (__pBgEffectColorReplacementBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(bounds, *__pBgEffectColorReplacementBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = pCanvas->DrawBitmap(bounds, *__pBgEffectColorReplacementBitmap); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } +} + + +}}} // Tizen::Ui::Controls + diff --git a/src/ui/controls/FUiCtrl_GroupItemImpl.cpp b/src/ui/controls/FUiCtrl_GroupItemImpl.cpp index f123d00..461cf9f 100644 --- a/src/ui/controls/FUiCtrl_GroupItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupItemImpl.cpp @@ -25,6 +25,7 @@ #include #include #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_GroupItemImpl.h" #include "FUiCtrl_ListViewItem.h" @@ -55,7 +56,7 @@ _GroupItemImpl::_GroupItemImpl(GroupItem* pPublic) : _ListItemBaseImpl(null) { GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, __textSize); - GET_COLOR_CONFIG(LISTVIEW::GROUPITEM_TEXT_NORMAL, __textColor); + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, __textColor); } _GroupItemImpl::~_GroupItemImpl(void) @@ -70,7 +71,7 @@ _GroupItemImpl::GetPublicClassName(void) const } _GroupItemImpl* -_GroupItemImpl::CreateGroupItemImpN(GroupItem* pPublic, const Dimension& itemSize) +_GroupItemImpl::CreateGroupItemImpN(GroupItem* pPublic, const FloatDimension& itemSize) { result r = E_SUCCESS; @@ -90,7 +91,7 @@ CATCH: } result -_GroupItemImpl::Construct(const Dimension& itemSize) +_GroupItemImpl::Construct(const FloatDimension& itemSize) { result r = _ListItemBaseImpl::Construct(itemSize, LIST_ANNEX_STYLE_NORMAL); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -160,7 +161,7 @@ _GroupItemImpl::GetTextColor(void) const } result -_GroupItemImpl::SetTextSize(int size) +_GroupItemImpl::SetTextSize(float size) { __textSize = size; @@ -175,7 +176,7 @@ _GroupItemImpl::SetTextSize(int size) return E_SUCCESS; } -int +float _GroupItemImpl::GetTextSize(void) const { return __textSize; @@ -199,11 +200,11 @@ _GroupItemImpl::SetElement(const String& text, const Bitmap* pBitmap) SysTryReturn(NID_UI_CTRL, (ret == true), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to delete text element."); } - Rectangle bitmapRect = Rectangle(0, 0, 0, 0); - Rectangle textRect = Rectangle(0, 0, 0, 0); - int leftMargin = 0; - int itemHeight = GetItemSize().height; - int elementSpacing = 0; + FloatRectangle bitmapRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle textRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + float leftMargin = 0.0f; + float itemHeight = GetItemSize().height; + float elementSpacing = 0.0f; result r = E_SUCCESS; GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); @@ -213,11 +214,11 @@ _GroupItemImpl::SetElement(const String& text, const Bitmap* pBitmap) { GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_ELEMENT_SPACING, _CONTROL_ORIENTATION_PORTRAIT, elementSpacing); - int elementWidth = itemHeight * GROUP_ITEM_ELEMENT_BITMAP_SIZE_RATIO; - int elementHeight = elementWidth; + float elementWidth = itemHeight * GROUP_ITEM_ELEMENT_BITMAP_SIZE_RATIO; + float elementHeight = elementWidth; bitmapRect.x = leftMargin; - bitmapRect.y = (itemHeight - elementHeight) / 2; + bitmapRect.y = (itemHeight - elementHeight) / 2.0f; bitmapRect.width = elementWidth; bitmapRect.height = elementHeight; diff --git a/src/ui/controls/FUiCtrl_GroupedListImpl.cpp b/src/ui/controls/FUiCtrl_GroupedListImpl.cpp index 62db032..7bd29ff 100644 --- a/src/ui/controls/FUiCtrl_GroupedListImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListImpl.cpp @@ -424,10 +424,13 @@ _GroupedListImpl::Initialize(void) __pItemFormat->Construct(); int leftMargin = 0; + Color groupTextColor = Color(0); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_LEFT_MARGIN, GetCore().GetOrientation(), leftMargin); + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, groupTextColor); __pItemFormat->AddElement(ID_FORMAT_MARGIN, Rectangle(0, 0, leftMargin, __groupItemHeight), __groupItemTextFont); - __pItemFormat->AddElement(ID_FORMAT_STRING, Rectangle(leftMargin, 0, GetCore().GetBounds().width, __groupItemHeight), __groupItemTextFont); + __pItemFormat->AddElement(ID_FORMAT_STRING, Rectangle(leftMargin, 0, GetCore().GetBounds().width, __groupItemHeight), + __groupItemTextFont, groupTextColor, groupTextColor); __pItemFormat->SetElementEventEnabled(ID_FORMAT_MARGIN, true); __pItemFormat->SetElementEventEnabled(ID_FORMAT_STRING, true); @@ -515,8 +518,11 @@ _GroupedListImpl::InsertGroupAt(int groupIndex, const String& text, const Bitmap r = InsertIntoItemsList(*pCustomListItem, groupIndex, -1); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to insert an item."); - r = GetCore().RefreshTableView(groupIndex, -1, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to insert an item."); + if (GetCore().GetFirstDrawnFlag() == false) + { + r = GetCore().RefreshTableView(groupIndex, -1, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to insert an item."); + } return r; } @@ -589,18 +595,15 @@ _GroupedListImpl::RemoveItemAt(int groupIndex, int itemIndex) result r = E_SUCCESS; + r = RemoveFromItemsList(groupIndex, itemIndex); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove item."); + __directDelete = true; r = GetCore().RefreshTableView(groupIndex, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); __directDelete = false; - if (r != E_SUCCESS) - { - r = RemoveFromItemsList(groupIndex, itemIndex); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove item."); - } - return r; } diff --git a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp index 31c1221..4eff4c6 100644 --- a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp @@ -24,12 +24,12 @@ * class. */ -#include #include #include #include "FApp_AppInfo.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" -#include "FUi_TouchManager.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_FastScrollEvent.h" #include "FUiCtrl_FastScrollEventArg.h" @@ -78,9 +78,17 @@ _GroupedListViewImpl::_GroupedListViewImpl(GroupedListView* pGroupedList, _Table , __pEmptyText(null) , __redrawListView(true) , __pItemNeedsLazyDeletion(null) - , __pItemSwept(null) + , __pTouchEventHandler(null) + , __pLongPressedGesture(null) { - GET_COLOR_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_NORMAL, __emptyTextColor); + GET_COLOR_CONFIG(TABLEVIEW::EMPTY_CONTENTS_TEXT_NORMAL, __emptyTextColor); + + // Add _TouchLongPressGestureDetector + __pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector(); + SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + pCore->AddGestureDetector(*__pLongPressedGesture); + __pLongPressedGesture->AddGestureListener(*this); } _GroupedListViewImpl::~_GroupedListViewImpl() @@ -124,6 +132,21 @@ _GroupedListViewImpl::~_GroupedListViewImpl() delete __pEmptyText; __pEmptyText = null; } + + if (__pTouchEventHandler != null) + { + delete __pTouchEventHandler; + __pTouchEventHandler = null; + } + + if (__pLongPressedGesture != null) + { + __pLongPressedGesture->RemoveGestureListener(*this); + GetCore().RemoveGestureDetector(*__pLongPressedGesture); + + delete __pLongPressedGesture; + __pLongPressedGesture = null; + } } const char* @@ -167,18 +190,23 @@ _GroupedListViewImpl::CreateGroupedListViewImplN(GroupedListView* pControl, Grou case SCROLL_STYLE_FADE_OUT: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT; break; + case SCROLL_STYLE_FIXED: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FIXED; break; + case SCROLL_STYLE_FAST_SCROLL: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL; break; + case SCROLL_STYLE_JUMP_TO_TOP: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_JUMP_TO_TOP; break; + case SCROLL_STYLE_THUMB: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_THUMB; break; + default: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_NONE; break; @@ -201,14 +229,55 @@ result _GroupedListViewImpl::SetItemProvider(IGroupedListViewItemProvider& provider) { result r = E_SUCCESS; - int itemWidth = GetCore().GetBounds().width; + float itemWidth = GetCore().GetBoundsF().width; + + if (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_SECTION) + { + float margin = 0.0f; + GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); + + itemWidth -= (margin * 2.0f); + } + + _GroupedListViewItemProviderAdaptor* pProviderAdaptor = + static_cast <_GroupedListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor()); + + if (pProviderAdaptor == null) + { + pProviderAdaptor = new (std::nothrow) _GroupedListViewItemProviderAdaptor(provider); + SysTryReturn(NID_UI_CTRL, (pProviderAdaptor != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, + "[E_OUT_OF_MEMORY] The memory is insufficient."); + + pProviderAdaptor->SetListViewItemEventListener(*this); + + r = pProviderAdaptor->SetListWidth(itemWidth); + GetCore().SetItemProviderAdaptor(pProviderAdaptor); + } + else + { + pProviderAdaptor->SetItemProvider(provider); + r = pProviderAdaptor->SetListWidth(itemWidth); + + UpdateList(); + } + + __redrawListView = true; + + SetLastResultReturn(r); +} + +result +_GroupedListViewImpl::SetItemProvider(IGroupedListViewItemProviderF& provider) +{ + result r = E_SUCCESS; + float itemWidth = GetCore().GetBoundsF().width; if (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_SECTION) { - int margin = 0; + float margin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); - itemWidth -= (margin * 2); + itemWidth -= (margin * 2.0f); } _GroupedListViewItemProviderAdaptor* pProviderAdaptor = @@ -236,6 +305,8 @@ _GroupedListViewImpl::SetItemProvider(IGroupedListViewItemProvider& provider) __redrawListView = true; SetLastResultReturn(r); + + return E_SUCCESS; } void @@ -328,6 +399,27 @@ _GroupedListViewImpl::AddScrollEventListener(IScrollEventListener& listener) } void +_GroupedListViewImpl::AddScrollEventListener(IScrollEventListenerF& listener) +{ + result r = E_SUCCESS; + + if (__pScrollEvent == null) + { + __pScrollEvent = new (std::nothrow) _ScrollEvent(); + SysTryReturnVoidResult(NID_UI_CTRL, (__pScrollEvent != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = __pScrollEvent->Construct(GetPublic()); + SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "[E_SYSTEM] Unable to construct Scroll Event."); + } + + __pScrollEvent->AddListener(listener); + + GetCore().AddScrollEventListener(*this); + + SetLastResult(r); +} + +void _GroupedListViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) { result r = E_SUCCESS; @@ -341,6 +433,19 @@ _GroupedListViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) } void +_GroupedListViewImpl::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + result r = E_SUCCESS; + + if (__pScrollEvent != null) + { + r = __pScrollEvent->RemoveListener(listener); + } + + SetLastResult(r); +} + +void _GroupedListViewImpl::AddUiLinkEventListener(const IUiLinkEventListener& listener) { result r = E_SUCCESS; @@ -528,16 +633,18 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType } } - if ((__pItemSwept != null) && (type != LIST_REFRESH_TYPE_ITEM_ADD)) + if (type == LIST_REFRESH_TYPE_ITEM_MODIFY) { - if (__pItemSwept == pListViewItem) + int sweepGroupIndex = -1; + int sweepItemIndex = -1; + + GetCore().GetSweepItemIndex(sweepGroupIndex, sweepItemIndex); + + if ((sweepGroupIndex == groupIndex) && (sweepItemIndex == itemIndex)) { GetCore().ResetSweepItem(); } - } - if (type == LIST_REFRESH_TYPE_ITEM_MODIFY) - { int topGroupIndex = -1; int topItemIndex = -1; int bottomGroupIndex = -1; @@ -557,13 +664,13 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType { TableViewItemDrawingStatus itemDrawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; bool itemSelected = false; - Point touchPosition(-1, -1); + FloatPoint touchPosition(-1.0f, -1.0f); if (pListViewItem != null) { itemDrawingStatus = pListViewItem->GetDrawingStatus(); itemSelected = pListViewItem->GetSelectionState(); - touchPosition = pListViewItem->GetLastTouchPressedPosition(); + touchPosition = pListViewItem->GetLastTouchPressedPositionF(); pListViewItem = null; } @@ -587,7 +694,7 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType for (int i = 0; i < pListViewItem->GetChildCount(); i++) { - if (pListViewItem->GetChild(i)->GetBounds().Contains(touchPosition)) + if (pListViewItem->GetChild(i)->GetBoundsF().Contains(touchPosition)) { target = pListViewItem->GetChild(i); } @@ -670,7 +777,14 @@ _GroupedListViewImpl::UpdateList(void) result _GroupedListViewImpl::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex); +} + +result +_GroupedListViewImpl::GetItemIndexFromPosition(const FloatPoint& position, int& groupIndex, int& itemIndex) const +{ result r = GetCore().GetItemIndexFromPosition(position, groupIndex, itemIndex); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] There is no item at the specified position."); SetLastResultReturn(r); @@ -679,6 +793,12 @@ _GroupedListViewImpl::GetItemIndexFromPosition(const Point& position, int& group result _GroupedListViewImpl::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex, int& elementId) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex, elementId); +} + +result +_GroupedListViewImpl::GetItemIndexFromPosition(const FloatPoint& position, int& groupIndex, int& itemIndex, int& elementId) const +{ elementId = -1; result r = GetCore().GetItemIndexFromPosition(position, groupIndex, itemIndex); @@ -688,10 +808,10 @@ _GroupedListViewImpl::GetItemIndexFromPosition(const Point& position, int& group if (pListViewItem != null) { - Point originPosition = pListViewItem->GetPosition(); + FloatPoint originPosition = pListViewItem->GetPositionF(); originPosition.y -= GetCore().GetScrollPosition(); - elementId = pListViewItem->GetElementIdFromPosition(Point(position.x - originPosition.x, position.y - originPosition.y)); + elementId = pListViewItem->GetElementIdFromPosition(FloatPoint(position.x - originPosition.x, position.y - originPosition.y)); } SetLastResultReturn(r); @@ -757,19 +877,12 @@ _GroupedListViewImpl::SetBitmapOfEmptyList(const Bitmap* pBitmap) SysTryReturn(NID_UI_CTRL, (__pEmptyBitmap != null), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pEmptyBitmap->SetVisibleState(false); - __pEmptyBitmap->SetMargin(0, 0); + __pEmptyBitmap->SetMargin(0.0f, 0.0f); GetCore().AttachChild(*__pEmptyBitmap); } - Dimension bitmapSize(pBitmap->GetWidth(), pBitmap->GetHeight()); - Dimension listDimension = GetCore().GetSize(); - Dimension labelDimension; - - labelDimension.width = ((listDimension.width < bitmapSize.width) ? listDimension.width : bitmapSize.width); - labelDimension.height = ((listDimension.height < bitmapSize.height) ? listDimension.height : bitmapSize.height); - - __pEmptyBitmap->SetSize(labelDimension); + __pEmptyBitmap->SetSize(FloatDimension(pBitmap->GetWidthF(), pBitmap->GetHeightF())); __pEmptyBitmap->SetBackgroundColor(Color(0, 0, 0, 0)); __pEmptyBitmap->SetBackgroundBitmap(*pBitmap); } @@ -800,7 +913,7 @@ _GroupedListViewImpl::SetTextOfEmptyList(const String& text) SysTryReturn(NID_UI_CTRL, (__pEmptyText != null), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pEmptyText->SetVisibleState(false); - __pEmptyText->SetMargin(0, 0); + __pEmptyText->SetMargin(0.0f, 0.0f); GetCore().AttachChild(*__pEmptyText); } @@ -814,27 +927,27 @@ _GroupedListViewImpl::SetTextOfEmptyList(const String& text) SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult())); pText->AppendElement(*pSimpleText); - int fontSize = 0; + float fontSize = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, fontSize); Font font; font.Construct(GetFont(), FONT_STYLE_PLAIN, fontSize); pText->SetFont(&font, 0, pText->GetTextLength()); - Dimension listDimension = GetCore().GetSize(); + FloatDimension listDimension = GetCore().GetSizeF(); - pText->SetBounds(Rectangle(0, 0, listDimension.width, 1)); + pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f)); pText->Compose(); - Dimension labelDimension = pText->GetTextExtent(0, pText->GetTextLength()); - labelDimension.height = pText->GetTotalHeight(); + FloatDimension labelDimension = pText->GetTextExtentF(0, pText->GetTextLength()); + labelDimension.height = pText->GetTotalHeightF(); if (labelDimension.width > listDimension.width) { - pText->SetBounds(Rectangle(0, 0, listDimension.width, 1)); + pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f)); pText->Compose(); - int labelHeight = pText->GetTotalHeight(); + float labelHeight = pText->GetTotalHeightF(); labelDimension.width = listDimension.width; labelDimension.height = ((listDimension.height < labelHeight) ? listDimension.height : labelHeight); @@ -882,12 +995,18 @@ _GroupedListViewImpl::GetTextColorOfEmptyList(void) const result _GroupedListViewImpl::ExpandGroup(int groupIndex) { + SysTryReturn(NID_UI_CTRL, (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED), E_INVALID_OPERATION, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] The control should be indexed style."); + return GetCore().ExpandGroup(groupIndex); } result _GroupedListViewImpl::CollapseGroup(int groupIndex) { + SysTryReturn(NID_UI_CTRL, (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED), E_INVALID_OPERATION, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] The control should be indexed style."); + return GetCore().CollapseGroup(groupIndex); } @@ -897,6 +1016,24 @@ _GroupedListViewImpl::IsGroupExpanded(int groupIndex) const return GetCore().IsGroupExpanded(groupIndex); } +result +_GroupedListViewImpl::ExpandAllGroups(void) +{ + SysTryReturn(NID_UI_CTRL, (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED), E_INVALID_OPERATION, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] The control should be indexed style."); + + return GetCore().ExpandAllGroup(true); +} + +result +_GroupedListViewImpl::CollapseAllGroups(void) +{ + SysTryReturn(NID_UI_CTRL, (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED), E_INVALID_OPERATION, E_INVALID_OPERATION, + "[E_INVALID_OPERATION] The control should be indexed style."); + + return GetCore().CollapseAllGroup(true); +} + void _GroupedListViewImpl::CheckEmptyListShowState(void) { @@ -916,44 +1053,44 @@ _GroupedListViewImpl::CheckEmptyListShowState(void) void _GroupedListViewImpl::AdjustLayoutOfEmptyList(void) { - Dimension listDimension = GetCore().GetSize(); - Dimension emptyBitmap; - Dimension emptyText; - Point bitmapPos; - Point textPos; - int totalHeight = 0; + FloatDimension listDimension = GetCore().GetSizeF(); + FloatDimension emptyBitmap; + FloatDimension emptyText; + FloatPoint bitmapPos; + FloatPoint textPos; + float totalHeight = 0.0f; if (__pEmptyBitmap != null) { - emptyBitmap = __pEmptyBitmap->GetSize(); + emptyBitmap = __pEmptyBitmap->GetSizeF(); } if (__pEmptyText != null) { - emptyText = __pEmptyText->GetSize(); + emptyText = __pEmptyText->GetSizeF(); } totalHeight = emptyBitmap.height + emptyText.height; if ((__pEmptyBitmap != null) && (__pEmptyText != null) && (totalHeight < listDimension.height)) { - bitmapPos.x = ((listDimension.width == emptyBitmap.width) ? 0 : (listDimension.width - emptyBitmap.width) / 2); - bitmapPos.y = (listDimension.height - totalHeight) / 2; + bitmapPos.x = ((_FloatCompare(listDimension.width, emptyBitmap.width)) ? 0.0f : (listDimension.width - emptyBitmap.width) / 2.0f); + bitmapPos.y = (listDimension.height - totalHeight) / 2.0f; - textPos.x = ((listDimension.width == emptyText.width) ? 0 : (listDimension.width - emptyText.width) / 2); + textPos.x = ((_FloatCompare(listDimension.width, emptyText.width)) ? 0.0f : (listDimension.width - emptyText.width) / 2.0f); textPos.y = bitmapPos.y + emptyBitmap.height; } else { if (__pEmptyBitmap != null) { - bitmapPos.x = ((listDimension.width == emptyBitmap.width) ? 0 : (listDimension.width - emptyBitmap.width) / 2); - bitmapPos.y = ((listDimension.height == emptyBitmap.height) ? 0 : (listDimension.height - emptyBitmap.height) / 2); + bitmapPos.x = ((_FloatCompare(listDimension.width, emptyBitmap.width)) ? 0.0f : (listDimension.width - emptyBitmap.width) / 2.0f); + bitmapPos.y = ((_FloatCompare(listDimension.height, emptyBitmap.height)) ? 0.0f : (listDimension.height - emptyBitmap.height) / 2.0f); } if (__pEmptyText != null) { - textPos.x = ((listDimension.width == emptyText.width) ? 0 : (listDimension.width - emptyText.width) / 2); - textPos.y = ((listDimension.height == emptyText.height) ? 0 : (listDimension.height - emptyText.height) / 2); + textPos.x = ((_FloatCompare(listDimension.width, emptyText.width)) ? 0.0f : (listDimension.width - emptyText.width) / 2.0f); + textPos.y = ((_FloatCompare(listDimension.height, emptyText.height)) ? 0.0f : (listDimension.height - emptyText.height) / 2.0f); } } @@ -984,7 +1121,7 @@ result _GroupedListViewImpl::EndReorderingMode(void) { SysTryReturn(NID_UI_CTRL, (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED), E_INVALID_OPERATION, E_INVALID_OPERATION, - "[E_INVALID_OPERATION] Reordering mode is supported only Indexed style."); + "[E_INVALID_OPERATION] Reordering mode is supported only Indexed style."); result r = GetCore().SetReorderModeEnabled(false); @@ -998,30 +1135,28 @@ _GroupedListViewImpl::IsInReorderingMode(void) const } void -_GroupedListViewImpl::OnListViewContextItemStateChanged(_Control& source, int groupIndex, int itemIndex, int elementId, - ListContextItemStatus status) +_GroupedListViewImpl::SetScrollInputMode(ScrollInputMode mode) { - if (__pListItemEvent != null) - { - GetCore().ResetSweepItem(); - - __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex)); - - _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM); - __pListItemEvent->Fire(*pArg); + GetCore().SetScrollInputMode(mode); +} - __pItemNeedsLazyDeletion = null; - } +ScrollInputMode +_GroupedListViewImpl::GetScrollInputMode(void) const +{ + return GetCore().GetScrollInputMode(); } void -_GroupedListViewImpl::OnListViewItemLongPressed(_Control& source, int groupIndex, int itemIndex, int elementId) +_GroupedListViewImpl::OnListViewContextItemStateChanged(_Control& source, int groupIndex, int itemIndex, int elementId, + ListContextItemStatus status) { if (__pListItemEvent != null) { + GetCore().ResetSweepItem(); + __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex)); - _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM); + _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM); __pListItemEvent->Fire(*pArg); __pItemNeedsLazyDeletion = null; @@ -1050,8 +1185,6 @@ _GroupedListViewImpl::OnGroupedTableViewContextItemActivationStateChanged(_Table if (pListViewItem != null) { - __pItemSwept = (activated ? pListViewItem : null); - pListViewItem->SetContextItemActivationState(activated); } } @@ -1083,8 +1216,6 @@ _GroupedListViewImpl::OnSectionTableViewContextItemActivationStateChanged(_Table if (pListViewItem != null) { - __pItemSwept = (activated ? pListViewItem : null); - pListViewItem->SetContextItemActivationState(activated); } } @@ -1154,11 +1285,11 @@ _GroupedListViewImpl::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_GroupedListViewImpl::OnScrollPositionChanged(_Control& source, int scrollPos) +_GroupedListViewImpl::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (__pScrollEvent != null) { - _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPos); + _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPosition); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1178,6 +1309,7 @@ _GroupedListViewImpl::OnScrollStopped(_Control& source) __pScrollEvent->Fire(*pEventArg); } } + void _GroupedListViewImpl::OnUiFastScrollIndexSelected(_Control& source, _FastScrollIndex& index) { @@ -1223,14 +1355,14 @@ _GroupedListViewImpl::OnBoundsChanged(void) if (pProviderAdaptor != null) { - int itemWidth = GetCore().GetBounds().width; + float itemWidth = GetCore().GetBoundsF().width; if (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_SECTION) { - int margin = 0; + float margin = 0; GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); - itemWidth -= (margin * 2); + itemWidth -= (margin * 2.0f); } pProviderAdaptor->SetListWidth(itemWidth); @@ -1285,7 +1417,16 @@ _GroupedListViewImpl::OnFontChanged(Font* pFont) void _GroupedListViewImpl::OnFontInfoRequested(unsigned long& style, int& size) { - int textSize = 0; + float textSize = 0.0f; + OnFontInfoRequested(style, textSize); + + size = _CoordinateSystemUtils::ConvertToInteger(textSize); +} + +void +_GroupedListViewImpl::OnFontInfoRequested(unsigned long& style, float& size) +{ + float textSize = 0; GET_SHAPE_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, textSize); style = FONT_STYLE_PLAIN; @@ -1295,170 +1436,101 @@ _GroupedListViewImpl::OnFontInfoRequested(unsigned long& style, int& size) bool _GroupedListViewImpl::OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _GroupedListViewImpl::OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _GroupedListViewImpl::OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _GroupedListViewImpl::OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } -void -_GroupedListViewImpl::FirePublicTouchEvent(const _TouchInfo& touchInfo) +bool +_GroupedListViewImpl::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture) { - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - TouchEventInfo publicTouchInfo; + bool filtered = false; - _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); - SysTryReturnVoidResult(NID_UI, pEventArg, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + if (__pTouchEventHandler != null) + { + filtered = __pTouchEventHandler->ProcessTouchEventListener(); + } - publicTouchInfo.Construct(*pEventArg); + if (!filtered && (__pListItemEvent != null)) + { + _TouchManager* pTouchManager = _TouchManager::GetInstance(); + FloatPoint currentTouchPos = pTouchManager->GetScreenPoint(0); + FloatRectangle bounds = GetCore().GetAbsoluteBoundsF(); + int groupIndex = -1; + int itemIndex = -1; + int elementId = -1; - _Control* pDraggedControl = pTouchManager->GetTouchControlSource(); + currentTouchPos.x -= bounds.x; + currentTouchPos.y -= bounds.y; - IEnumeratorT* pEnumerator = GetTouchEventListener()->GetEnumeratorN(); - if (pEnumerator) - { - while (pEnumerator->MoveNext() == E_SUCCESS) + if ((GetItemIndexFromPosition(currentTouchPos, groupIndex, itemIndex, elementId) == E_SUCCESS) && (itemIndex != -1)) { - IEventListener* pListener = null; - pEnumerator->GetCurrent(pListener); + __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(groupIndex, itemIndex)); - ITouchEventListener* pTouchEventListener = dynamic_cast (pListener); - if (pTouchEventListener) + if ((__pItemNeedsLazyDeletion != null) && (!__pItemNeedsLazyDeletion->IsContextItem())) { - FirePublicListener(*pTouchEventListener, publicTouchInfo); + _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(groupIndex, itemIndex, elementId, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM); + __pListItemEvent->Fire(*pArg); - if (touchInfo.GetTouchStatus() == _TOUCH_RELEASED) - { - if (pDraggedControl == null) //if exist dragged control, don't send focus event - { - FireFocusListener(*pTouchEventListener, publicTouchInfo); - } - } - else if (touchInfo.GetTouchStatus() == _TOUCH_MOVED) - { - FireFocusListener(*pTouchEventListener, publicTouchInfo); - } + __pItemNeedsLazyDeletion = null; } } - - delete pEnumerator; } - delete pEventArg; + return filtered; } -void -_GroupedListViewImpl::FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +bool +_GroupedListViewImpl::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture) { - switch (touchEventInfo.GetTouchStatus()) - { - case TOUCH_PRESSED: - listener.OnTouchPressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_LONG_PRESSED: - listener.OnTouchLongPressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_RELEASED: - listener.OnTouchReleased(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_MOVED: - listener.OnTouchMoved(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_DOUBLE_PRESSED: - listener.OnTouchDoublePressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_FOCUS_IN: - listener.OnTouchFocusIn(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_FOCUS_OUT: - listener.OnTouchFocusOut(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_CANCELED: - listener.OnTouchCanceled(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - default: - break; - } + return false; } -void -_GroupedListViewImpl::FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +result +_GroupedListViewImpl::OnTouchEventListenerAdded(void) { - _ControlManager* pControlManager = _ControlManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - Point screenPoint(pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).x, - pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).y); - - _Control* pTouchedControl = pControlManager->GetTopmostTouchedControl(screenPoint); - SysTryReturnVoidResult(NID_UI, pTouchedControl, E_INVALID_CONDITION, "[E_INVALID_CONDITION] pTouchedControl is null."); - - if (pTouchManager->GetFocusedControlSource() != pTouchedControl) + // support ITouchEventListener + if (GetTouchEventListener()->GetCount() == 1) { - if (&(GetCore()) != pTouchedControl) - { - if (pTouchManager->GetFocusedControlSource() == &(GetCore())) - { - listener.OnTouchFocusOut(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - } - } - else - { - listener.OnTouchFocusIn(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - } - - pTouchManager->SetFocusedControlSource(*pTouchedControl); + __pTouchEventHandler = new (std::nothrow) _ListViewTouchEventHandler(*this, LIST_VIEW_STYLE_GROUPED); } + + return E_SUCCESS; } -_TouchEventArg* -_GroupedListViewImpl::GetTouchEventArgN(const _TouchInfo& touchInfo) +result +_GroupedListViewImpl::OnTouchEventListenerRemoved(void) { - Point startPoint; - - _TouchEventArg* pEventArg = new (std::nothrow) _TouchEventArg(GetPublic(), touchInfo.GetTouchStatus()); - SysTryReturn(NID_UI, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryCatch(NID_UI, pTouchManager, , E_SYSTEM, "[E_SYSTEM] System error occurred."); - - startPoint.SetPosition(pTouchManager->GetStartPoint(touchInfo.GetPointId()).x - GetCore().GetAbsoluteBounds().x, - pTouchManager->GetStartPoint(touchInfo.GetPointId()).y - GetCore().GetAbsoluteBounds().y); - - pEventArg->SetTouchPosition(touchInfo.GetPointId(), startPoint.x, startPoint.y, - touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); + return E_SUCCESS; +} - // need to flick distance setting +bool +_GroupedListViewImpl::GetInputEventConsumeState(void) +{ + bool filtered = IsInputEventConsumed(); - return pEventArg; + if (filtered) + { + ResetInputEventConsumed(); + } -CATCH: - delete pEventArg; - return null; + return filtered; } class _GroupedListViewMaker diff --git a/src/ui/controls/FUiCtrl_GroupedListViewItemProviderAdaptor.cpp b/src/ui/controls/FUiCtrl_GroupedListViewItemProviderAdaptor.cpp index 1e98f8e..97b0837 100644 --- a/src/ui/controls/FUiCtrl_GroupedListViewItemProviderAdaptor.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListViewItemProviderAdaptor.cpp @@ -24,6 +24,7 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_GroupedListViewItemProviderAdaptor.h" #include "FUiCtrl_GroupItemImpl.h" @@ -42,15 +43,33 @@ namespace Tizen { namespace Ui { namespace Controls _GroupedListViewItemProviderAdaptor::_GroupedListViewItemProviderAdaptor(const IGroupedListViewItemProvider& provider) : __pGroupedListViewProvider(const_cast(&provider)) + , __pGroupedListViewProviderF(null) , __pEventListener(null) , __fontName(L"") - , __groupItemAverageHeight(0) - , __itemAverageHeight(0) + , __groupItemAverageHeight(0.0f) + , __itemAverageHeight(0.0f) , __groupItemLoadedCount(0) , __itemLoadedCount(0) , __countOfAllGroups(0) , __countOfAllItems(0) , __pItemNeedsLazyDeletion(null) + , __usingFloatingPoint(false) +{ +} + +_GroupedListViewItemProviderAdaptor::_GroupedListViewItemProviderAdaptor(const IGroupedListViewItemProviderF& provider) + : __pGroupedListViewProvider(null) + , __pGroupedListViewProviderF(const_cast(&provider)) + , __pEventListener(null) + , __fontName(L"") + , __groupItemAverageHeight(0.0f) + , __itemAverageHeight(0.0f) + , __groupItemLoadedCount(0) + , __itemLoadedCount(0) + , __countOfAllGroups(0) + , __countOfAllItems(0) + , __pItemNeedsLazyDeletion(null) + , __usingFloatingPoint(true) { } @@ -65,6 +84,18 @@ void _GroupedListViewItemProviderAdaptor::SetItemProvider(const IGroupedListViewItemProvider& provider) { __pGroupedListViewProvider = const_cast(&provider); + __pGroupedListViewProviderF = null; + + __usingFloatingPoint = false; +} + +void +_GroupedListViewItemProviderAdaptor::SetItemProvider(const IGroupedListViewItemProviderF& provider) +{ + __pGroupedListViewProvider = null; + __pGroupedListViewProviderF = const_cast(&provider); + + __usingFloatingPoint = true; } _IListItemCommon* @@ -76,7 +107,15 @@ _GroupedListViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) if (itemIndex == -1) { - pGroupItem = __pGroupedListViewProvider->CreateGroupItem(groupIndex, GetListWidth()); + if (__usingFloatingPoint) + { + pGroupItem = __pGroupedListViewProviderF->CreateGroupItem(groupIndex, GetListWidth()); + } + else + { + pGroupItem = __pGroupedListViewProvider->CreateGroupItem(groupIndex, _CoordinateSystemUtils::ConvertToInteger(GetListWidth())); + } + if (pGroupItem == null) { pTableViewItem = GetDefaultItem(); @@ -87,7 +126,15 @@ _GroupedListViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) } else { - pItemBase = __pGroupedListViewProvider->CreateItem(groupIndex, itemIndex, GetListWidth()); + if (__usingFloatingPoint) + { + pItemBase = __pGroupedListViewProviderF->CreateItem(groupIndex, itemIndex, GetListWidth()); + } + else + { + pItemBase = __pGroupedListViewProvider->CreateItem(groupIndex, itemIndex, _CoordinateSystemUtils::ConvertToInteger(GetListWidth())); + } + if (pItemBase == null) { pTableViewItem = GetDefaultItem(); @@ -140,7 +187,7 @@ _GroupedListViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) } } - if (IsDescriptionTextShown(groupIndex, itemIndex) == true) + if (IsDescriptionTextShown(groupIndex, itemIndex)) { pListViewItem->SetDescriptionTextShowState(true); } @@ -176,17 +223,38 @@ _GroupedListViewItemProviderAdaptor::UnloadItem(_IListItemCommon* pListItem, int if (itemIndex == -1) { GroupItem* pGroupItem = static_cast(pListViewItem->GetAppInfo()); - if (__pGroupedListViewProvider->DeleteGroupItem(groupIndex, pGroupItem, GetListWidth()) == false) + if (__usingFloatingPoint) + { + if (!__pGroupedListViewProviderF->DeleteGroupItem(groupIndex, pGroupItem, GetListWidth())) + { + delete pGroupItem; + } + } + else { - delete pGroupItem; + if (!__pGroupedListViewProvider->DeleteGroupItem(groupIndex, pGroupItem, _CoordinateSystemUtils::ConvertToInteger(GetListWidth()))) + { + delete pGroupItem; + } } } else { ListItemBase* pItemBase = static_cast(pListViewItem->GetAppInfo()); - if (__pGroupedListViewProvider->DeleteItem(groupIndex, itemIndex, pItemBase, GetListWidth()) == false) + if (__usingFloatingPoint) { - delete pItemBase; + if (!__pGroupedListViewProviderF->DeleteItem(groupIndex, itemIndex, pItemBase, GetListWidth())) + { + delete pItemBase; + } + } + else + { + if (!__pGroupedListViewProvider->DeleteItem(groupIndex, itemIndex, pItemBase, _CoordinateSystemUtils::ConvertToInteger(GetListWidth()))) + { + delete pItemBase; + } + } } } @@ -251,7 +319,16 @@ int _GroupedListViewItemProviderAdaptor::GetItemCount(int groupIndex) const { _GroupedListViewItemProviderAdaptor* pItemProviderAdaptor = const_cast<_GroupedListViewItemProviderAdaptor*>(this); - int itemCount = __pGroupedListViewProvider->GetItemCount(groupIndex); + + int itemCount = 0; + if (__usingFloatingPoint) + { + itemCount = __pGroupedListViewProviderF->GetItemCount(groupIndex); + } + else + { + itemCount = __pGroupedListViewProvider->GetItemCount(groupIndex); + } if (__groupItemLoadedCount <= groupIndex) { @@ -265,18 +342,26 @@ int _GroupedListViewItemProviderAdaptor::GetGroupCount(void) const { _GroupedListViewItemProviderAdaptor* pItemProviderAdaptor = const_cast<_GroupedListViewItemProviderAdaptor*>(this); - pItemProviderAdaptor->__countOfAllGroups = __pGroupedListViewProvider->GetGroupCount(); + + if (__usingFloatingPoint) + { + pItemProviderAdaptor->__countOfAllGroups = __pGroupedListViewProviderF->GetGroupCount(); + } + else + { + pItemProviderAdaptor->__countOfAllGroups = __pGroupedListViewProvider->GetGroupCount(); + } return __countOfAllGroups; } -int +float _GroupedListViewItemProviderAdaptor::GetDefaultItemHeight(void) { return __itemAverageHeight; } -int +float _GroupedListViewItemProviderAdaptor::GetDefaultGroupItemHeight(void) { return __groupItemAverageHeight; @@ -285,6 +370,11 @@ _GroupedListViewItemProviderAdaptor::GetDefaultGroupItemHeight(void) bool _GroupedListViewItemProviderAdaptor::IsReorderable(int groupIndexFrom, int groupIndexTo) { + if (__usingFloatingPoint) + { + return __pGroupedListViewProviderF->IsReorderable(groupIndexFrom, groupIndexTo); + } + return __pGroupedListViewProvider->IsReorderable(groupIndexFrom, groupIndexTo); } diff --git a/src/ui/controls/FUiCtrl_HeaderImpl.cpp b/src/ui/controls/FUiCtrl_HeaderImpl.cpp index 944e20c..6bd0a35 100644 --- a/src/ui/controls/FUiCtrl_HeaderImpl.cpp +++ b/src/ui/controls/FUiCtrl_HeaderImpl.cpp @@ -21,6 +21,10 @@ #include #include +#include +#include +#include "FUi_AccessibilityContainer.h" +#include "FUi_AccessibilityElement.h" #include "FUi_Control.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" @@ -54,6 +58,9 @@ _HeaderImpl::CreateHeaderImplN(Header* pControl) r = pCore->InitializeLongPressGesture(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + r = pCore->InitializeFlickGesture(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + _HeaderImpl* pHeaderImpl = new (std::nothrow) _HeaderImpl(pControl, pCore); r = CheckConstruction(pCore, pHeaderImpl); @@ -639,8 +646,7 @@ _HeaderImpl::SetItemAt(int itemIndex, const HeaderItem& item) result _HeaderImpl::SetItemBadgeIcon(int itemIndex, const Bitmap* pBadgeIcon) { - SysTryReturnResult(NID_UI_CTRL, (__style == HEADER_STYLE_SEGMENTED || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE - || __style == HEADER_STYLE_TAB || __style == HEADER_STYLE_TAB_WITH_TITLE || __style == HEADER_STYLE_BUTTON), + SysTryReturnResult(NID_UI_CTRL, __style != HEADER_STYLE_TITLE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Unable to set the badge icon because the current style does not support it."); int count = GetItemCount(); @@ -654,8 +660,7 @@ _HeaderImpl::SetItemBadgeIcon(int itemIndex, const Bitmap* pBadgeIcon) result _HeaderImpl::SetItemNumberedBadgeIcon(int itemIndex, int number) { - SysTryReturnResult(NID_UI_CTRL, (__style == HEADER_STYLE_SEGMENTED || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE - || __style == HEADER_STYLE_TAB || __style == HEADER_STYLE_TAB_WITH_TITLE || __style == HEADER_STYLE_BUTTON), + SysTryReturnResult(NID_UI_CTRL, __style != HEADER_STYLE_TITLE, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] Unable to set the badge icon because the current style does not support it."); SysTryReturnResult(NID_UI_CTRL, (0 <= number && number <= HEADER_NUMBERD_BADGE_ICON_NUMBER_MAX), E_INVALID_ARG, @@ -818,7 +823,7 @@ result _HeaderImpl::SetTabEditModeEnabled(bool enable) { SysTryReturnResult(NID_UI_CTRL, (__style == HEADER_STYLE_TAB || __style == HEADER_STYLE_TAB_WITH_TITLE), E_UNSUPPORTED_OPERATION, - "[E_UNSUPPORTED_OPERATION] This operation is only for HEADER_STYLE_TAB."); + "[E_UNSUPPORTED_OPERATION] This operation is only for HEADER_STYLE_TAB or HEADER_STYLE_TAB_WITH_TITLE"); return GetCore().SetTabEditModeEnabled(enable); } @@ -831,70 +836,64 @@ _HeaderImpl::SetBackButton(void) _Button* pButton = _Button::CreateButtonN(); - int buttonHeight = 0; - int buttonWidth = 0; + float buttonHeight = 0.0f; + float buttonWidth = 0.0f; + float iconSize = 0.0f; GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonHeight); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonWidth); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetCore().GetOrientation(), iconSize); - pButton->SetSize(Dimension(buttonWidth, buttonHeight)); + pButton->SetSize(FloatDimension(buttonWidth, buttonHeight)); - Bitmap* pBackgroundBaseBitmap = null; - Bitmap* pPressedBitmap = null; + Bitmap* pBackgroundNormalBitmap = null; + Bitmap* pBackgroundPressedBitmap = null; Bitmap* pColorReplacedBitmap = null; - Bitmap* pIconBaseBitmap = null; - Bitmap* pIconBaseEffectBitmap = null; + Bitmap* pBackIconNormalBitmap = null; + Bitmap* pBackIconNormalEffectBitmap = null; + + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundNormalBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundPressedBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalEffectBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackgroundBaseBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconBaseBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconBaseEffectBitmap); + bool themeBackNormalBitmap = IS_CUSTOM_BITMAP(FOOTER::BACK_ICON_NORMAL); + if (!themeBackNormalBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBackIconNormalEffectBitmap); + } - if (pBackgroundBaseBitmap) + if (pBackgroundNormalBitmap) { - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_NORMAL)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *pColorReplacedBitmap); delete pColorReplacedBitmap; - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_HIGHLIGHTED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_DISABLED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_DISABLED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - delete pBackgroundBaseBitmap; + delete pBackgroundNormalBitmap; } - //# if (pBackgroundEffectBitmap) - //# { - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pBackgroundEffectBitmap); - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pBackgroundEffectBitmap); - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pBackgroundEffectBitmap); - //# delete pBackgroundEffectBitmap; - //# } - - if (pPressedBitmap) + if (pBackgroundPressedBitmap) { - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackgroundPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetCore().GetButtonColor(_BUTTON_STATUS_PRESSED)); pButton->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *pColorReplacedBitmap); delete pColorReplacedBitmap; - delete pPressedBitmap; + delete pBackgroundPressedBitmap; } - //# if (pPressedEffectBitmap) - //# { - //# pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pPressedEffectBitmap); - //# delete pPressedEffectBitmap; - //# } - - if (pIconBaseBitmap) + if (pBackIconNormalBitmap) { Color normalColor; Color pressedColor; @@ -904,53 +903,46 @@ _HeaderImpl::SetBackButton(void) GET_COLOR_CONFIG(FOOTER::BACK_ICON_PRESSED, pressedColor); GET_COLOR_CONFIG(FOOTER::BACK_ICON_DISABLED, disabledColor); - int iconSize = 0; - - GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetCore().GetOrientation(), iconSize); - - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); if (pColorReplacedBitmap) { - pColorReplacedBitmap->Scale(Dimension(iconSize, iconSize)); + pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); if (pColorReplacedBitmap) { - pColorReplacedBitmap->Scale(Dimension(iconSize, iconSize)); + pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconBaseBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBackIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); if (pColorReplacedBitmap) { - pColorReplacedBitmap->Scale(Dimension(iconSize, iconSize)); + pColorReplacedBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pColorReplacedBitmap); delete pColorReplacedBitmap; } - delete pIconBaseBitmap; + delete pBackIconNormalBitmap; } - if (pIconBaseEffectBitmap) + if (pBackIconNormalEffectBitmap) { - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_SELECTED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pIconBaseEffectBitmap); - pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pIconBaseEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); + pButton->SetEffectBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pBackIconNormalEffectBitmap); - delete pIconBaseEffectBitmap; + delete pBackIconNormalEffectBitmap; } return GetCore().SetButton(BACK_BUTTON, pButton); @@ -1010,6 +1002,51 @@ _HeaderImpl::GetButtonBounds(ButtonPosition position) const return rect; } +FloatRectangle +_HeaderImpl::GetButtonBoundsF(ButtonPosition position) const +{ + bool isButtonSet = IsButtonSet(position); + + SysTryReturn(NID_UI_CTRL, isButtonSet, FloatRectangle(-1.0f, -1.0f, -1.0f, -1.0f), + E_INVALID_OPERATION, "[E_INVALID_OPERATION] No button item is set at the specified position."); + + FloatRectangle rect; + + if (position == BUTTON_POSITION_LEFT) + { + rect = GetCore().GetButtonBoundsF(LEFT_BUTTON); + } + else if (position == BUTTON_POSITION_RIGHT) + { + rect = GetCore().GetButtonBoundsF(RIGHT_BUTTON); + } + + return rect; +} + +result +_HeaderImpl::SetTitleBadgeIcon(const Bitmap* pBadgeIcon) +{ + SysTryReturnResult(NID_UI_CTRL, (__style == HEADER_STYLE_TITLE || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE + || __style == HEADER_STYLE_TAB_WITH_TITLE), + E_INVALID_OPERATION, "[E_INVALID_OPERATION] Unable to set the title badge icon because the current style does not support it."); + + return GetCore().SetTitleBadgeIcon(pBadgeIcon); +} + +result +_HeaderImpl::SetTitleNumberedBadgeIcon(int number) +{ + SysTryReturnResult(NID_UI_CTRL, (__style == HEADER_STYLE_TITLE || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE + || __style == HEADER_STYLE_TAB_WITH_TITLE), + E_INVALID_OPERATION, "[E_INVALID_OPERATION] Unable to set the title badge icon because the current style does not support it."); + + SysTryReturnResult(NID_UI_CTRL, (0 <= number && number <= HEADER_NUMBERD_BADGE_ICON_NUMBER_MAX), E_INVALID_ARG, + "[E_INVALID_ARG] The number is invalid."); + + return GetCore().SetTitleNumberedBadgeIcon(number); +} + void _HeaderImpl::AddActionEventListener(IActionEventListener& listener) { @@ -1154,38 +1191,30 @@ _HeaderImpl::ConvertButtonItem(const ButtonItem& buttonItem) { _Button* pButton = _Button::CreateButtonN(); - int buttonItemWidth = 0; - int buttonItemHeight = 0; + float buttonItemWidth = 0.0f; + float buttonItemHeight = 0.0f; if (__style == HEADER_STYLE_BUTTON) { - GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonItemWidth); - GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonItemHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonItemWidth); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonItemHeight); } else { - if (__style == HEADER_STYLE_TITLE || __style == HEADER_STYLE_TITLE_BUTTON) + if (buttonItem.GetText() != L"") { - if (buttonItem.GetText() != L"") - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_WITH_TEXT, GetCore().GetOrientation(), buttonItemWidth); - } - else - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonItemWidth); - } - - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonItemHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_WITH_TEXT, GetCore().GetOrientation(), buttonItemWidth); } - else // Segmented or SegmentedTitle + else { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_OF_SEGMENTED, GetCore().GetOrientation(), buttonItemWidth); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT_OF_SEGMENTED, GetCore().GetOrientation(), buttonItemHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetCore().GetOrientation(), buttonItemWidth); } + + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetCore().GetOrientation(), buttonItemHeight); } - pButton->SetMargin(0, 0); - pButton->SetSize(Dimension(buttonItemWidth, buttonItemHeight)); + pButton->SetMargin(0.0f, 0.0f, 0.0f, 0.0f); + pButton->SetSize(FloatDimension(buttonItemWidth, buttonItemHeight)); pButton->SetActionId(buttonItem.GetActionId()); @@ -1195,7 +1224,7 @@ _HeaderImpl::ConvertButtonItem(const ButtonItem& buttonItem) result r = E_SUCCESS; - int fontSize = 0; + float fontSize = 0.0f; if (__style == HEADER_STYLE_BUTTON) { @@ -1211,7 +1240,7 @@ _HeaderImpl::ConvertButtonItem(const ButtonItem& buttonItem) pButton->SetTextSize(fontSize, FONT_STYLE_BOLD); } - int iconSize = 0; + float iconSize = 0.0f; if (__style == HEADER_STYLE_BUTTON) { @@ -1234,52 +1263,45 @@ _HeaderImpl::ConvertButtonItem(const ButtonItem& buttonItem) if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_PRESSED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_HIGHLIGHTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(buttonItem.__pImpl->GetIcon(BUTTON_ITEM_STATUS_DISABLED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - iconSize) / 2, (buttonItemHeight - iconSize) / 2), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } Bitmap* pNormalBackgroundBitmap = null; Bitmap* pColorReplacedBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); if (pNormalBackgroundBitmap) { @@ -1355,6 +1377,19 @@ _HeaderImpl::ConvertButtonItem(const ButtonItem& buttonItem) *buttonItem.__pImpl->GetBackgroundBitmap(BUTTON_ITEM_STATUS_DISABLED)); } + if (buttonItem.__pImpl->__accessibilityHint.GetLength() > 0) + { + _AccessibilityContainer* pContainer = pButton->GetAccessibilityContainer(); + if (pContainer) + { + _AccessibilityElement* pElement = pContainer->GetChildElement(L"ButtonText"); + if (pElement) + { + pElement->SetHint(buttonItem.__pImpl->__accessibilityHint); + } + } + } + return pButton; } @@ -1363,11 +1398,11 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) { _Button* pButton = _Button::CreateButtonN(); - int minItemLength = 0; + float minItemLength = 0.0f; GET_SHAPE_CONFIG(HEADER::HEADER_ITEM_WIDTH_1_MIN, GetCore().GetOrientation(), minItemLength); - pButton->SetSize(Dimension(minItemLength, minItemLength)); + pButton->SetSize(FloatDimension(minItemLength, minItemLength)); pButton->SetActionId(headerItem.GetActionId()); @@ -1375,7 +1410,7 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) pButton->SetTextMaxLine(2); - int fontSize = 0; + float fontSize = 0.0f; result r = E_SUCCESS; if (__style == HEADER_STYLE_SEGMENTED || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE || __style == HEADER_STYLE_TITLE_BUTTON) @@ -1396,7 +1431,7 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) pButton->SetTextSize(fontSize, FONT_STYLE_BOLD); } - int iconSize = 0; + float iconSize = 0.0f; if (__style == HEADER_STYLE_SEGMENTED || __style == HEADER_STYLE_SEGMENTED_WITH_TITLE || __style == HEADER_STYLE_TAB_WITH_TITLE || __style == HEADER_STYLE_TAB) @@ -1414,7 +1449,7 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) Bitmap* pColorReplacedBitmap = null; Color selectedBitmapColor; - GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap); + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap); GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_PRESSED, selectedBitmapColor); pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedBitmapColor); @@ -1431,7 +1466,6 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) } delete pColorReplacedBitmap; - delete pSelectedBitmap; } } @@ -1452,49 +1486,49 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) pIconBitmap = const_cast(headerItem.__pImpl->GetIcon(HEADER_ITEM_STATUS_NORMAL)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_NORMAL, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_SELECTED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, Point(0, 0), *pIconBitmap); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_NORMAL, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(headerItem.__pImpl->GetIcon(HEADER_ITEM_STATUS_PRESSED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_PRESSED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_PRESSED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(headerItem.__pImpl->GetIcon(HEADER_ITEM_STATUS_SELECTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_SELECTED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_SELECTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(headerItem.__pImpl->GetIcon(HEADER_ITEM_STATUS_HIGHLIGHTED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } pIconBitmap = const_cast(headerItem.__pImpl->GetIcon(HEADER_ITEM_STATUS_DISABLED)); if (pIconBitmap) { - pIconBitmap->Scale(Dimension(iconSize, iconSize)); + pIconBitmap->Scale(FloatDimension(iconSize, iconSize)); - pButton->SetBitmap(_BUTTON_STATUS_DISABLED, Point(0, 0), *pIconBitmap); + pButton->SetBitmap(_BUTTON_STATUS_DISABLED, FloatPoint(0.0f, 0.0f), *pIconBitmap); } if (headerItem.__pImpl->GetBackgroundBitmap(HEADER_ITEM_STATUS_NORMAL) != null) @@ -1523,6 +1557,19 @@ _HeaderImpl::ConvertHeaderItem(const HeaderItem& headerItem) *headerItem.__pImpl->GetBackgroundBitmap(HEADER_ITEM_STATUS_DISABLED)); } + if (headerItem.__pImpl->__accessibilityHint.GetLength() > 0) + { + _AccessibilityContainer* pContainer = pButton->GetAccessibilityContainer(); + if (pContainer) + { + _AccessibilityElement* pElement = pContainer->GetChildElement(L"ButtonText"); + if (pElement) + { + pElement->SetHint(headerItem.__pImpl->__accessibilityHint); + } + } + } + return pButton; } @@ -1764,6 +1811,19 @@ protected: } } + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pHeader->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"HeaderTitleText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + // normal button if (pControl->GetElement(L"normalButtonColorOpacity", elementString)) { @@ -2043,7 +2103,12 @@ protected: pBitmap = LoadBitmapN(headerItemString); headerItem.SetBackgroundBitmap(HEADER_ITEM_STATUS_DISABLED, pBitmap); } - + + if (pControl->GetItemElement(i, L"accessibilityHint", elementString)) + { + _HeaderItemImpl::GetInstance(headerItem)->SetAccessibilityHint(elementString); + } + pHeader->AddItem(headerItem); } else if (headerItemString.Equals(L"buttonItem", false)) @@ -2149,7 +2214,11 @@ protected: pBitmap = LoadBitmapN(headerItemString); buttonItem.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmap); } - + + if (pControl->GetItemElement(i, L"accessibilityHint", elementString)) + { + _ButtonItemImpl::GetInstance(buttonItem)->SetAccessibilityHint(elementString); + } pHeader->SetButton(buttonPosition, buttonItem); } diff --git a/src/ui/controls/FUiCtrl_HeaderItemImpl.cpp b/src/ui/controls/FUiCtrl_HeaderItemImpl.cpp index 33a9900..8508f6a 100644 --- a/src/ui/controls/FUiCtrl_HeaderItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_HeaderItemImpl.cpp @@ -31,6 +31,7 @@ namespace Tizen { namespace Ui { namespace Controls _HeaderItemImpl::_HeaderItemImpl(HeaderItem* pPublic) : __actionId(-1) , __itemText(L"") + , __accessibilityHint(L"") { for (int i = 0; i < HEADER_ITEM_MAX_STATE_COUNT; i++) { @@ -157,4 +158,10 @@ _HeaderItemImpl::SetText(const String& text) return E_SUCCESS; } +void +_HeaderItemImpl::SetAccessibilityHint(const Tizen::Base::String& hint) +{ + __accessibilityHint = hint; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_IconListItem.cpp b/src/ui/controls/FUiCtrl_IconListItem.cpp index 1095299..4836142 100644 --- a/src/ui/controls/FUiCtrl_IconListItem.cpp +++ b/src/ui/controls/FUiCtrl_IconListItem.cpp @@ -29,6 +29,8 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUiAnim_VisualElement.h" #include "FUiCtrl_IconListItem.h" #include "FUiCtrl_IconListItemDrawingProperty.h" @@ -160,7 +162,7 @@ CATCH: } bool -_IconListItem::DrawItem(Rectangle& rcItem, ListItemState isFocused, bool itemDivider) +_IconListItem::DrawItem(FloatRectangle& rect, ListItemState isFocused) { SysAssertf(__pProperty != null, "Not yet initialized. SetDrawingProperty() should be called before use."); @@ -171,14 +173,14 @@ _IconListItem::DrawItem(Rectangle& rcItem, ListItemState isFocused, bool itemDiv __pBase->SetShowState(true); } - __pBase->SetBounds(FloatRectangle(rcItem.x, rcItem.y, rcItem.width, rcItem.height)); + __pBase->SetBounds(rect); if (!__pProperty->IsChanged() && __isDrawn && __foreDrawnState == isFocused) { return true; } - Canvas* pCanvas = __pBase->GetCanvasN(Rectangle(0, 0, rcItem.width, rcItem.height)); + Canvas* pCanvas = __pBase->GetCanvasN(FloatRectangle(0.0f, 0.0f, rect.width, rect.height)); if (pCanvas == null) { return false; @@ -188,8 +190,9 @@ _IconListItem::DrawItem(Rectangle& rcItem, ListItemState isFocused, bool itemDiv IconListViewItemDrawingStatus status = _IconListUtils::EnumConverter::ConvertListItemStateToIconListViewItemDrawingStatus(isFocused); pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - int margin = __pProperty->GetSelectBackgroundMargin(); - pCanvas->FillRectangle(__pProperty->GetBackgroundColor(status), Rectangle(margin, margin, rcItem.width - margin, rcItem.height - margin)); + + float margin = __pProperty->GetSelectBackgroundMargin(); + pCanvas->FillRectangle(__pProperty->GetBackgroundColor(status), FloatRectangle(margin, margin, rect.width - margin, rect.height - margin)); // Draw Bitmap Bitmap* pBitmap = (__pBitmap[isFocused] != null) ? __pBitmap[isFocused] : __pBitmap[ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL]; @@ -222,18 +225,18 @@ _IconListItem::DrawItem(Rectangle& rcItem, ListItemState isFocused, bool itemDiv } result -_IconListItem::DrawItemTouchAnimation(Rectangle& rcItem, float ratio) +_IconListItem::DrawItemTouchAnimation(FloatRectangle& rect, float ratio) { SysAssertf(__pProperty != null, "Not yet initialized. SetDrawingProperty() should be called before use."); - __pBase->SetBounds(FloatRectangle(rcItem.x, rcItem.y, rcItem.width, rcItem.height)); + __pBase->SetBounds(rect); if (!__pBase->GetShowState()) { __pBase->SetShowState(true); } - Canvas* pCanvas = __pBase->GetCanvasN(Rectangle(0, 0, rcItem.width, rcItem.height)); + Canvas* pCanvas = __pBase->GetCanvasN(FloatRectangle(0.0f, 0.0f, rect.width, rect.height)); if (pCanvas == null) { result r = GetLastResult(); @@ -272,18 +275,18 @@ _IconListItem::DrawItemTouchAnimation(Rectangle& rcItem, float ratio) } result -_IconListItem::DrawItemCheckAnimation(Tizen::Graphics::Rectangle& rcItem, float ratio) +_IconListItem::DrawItemCheckAnimation(FloatRectangle& rect, float ratio) { SysAssertf(__pProperty != null, "Not yet initialized. SetDrawingProperty() should be called before use."); - __pBase->SetBounds(FloatRectangle(rcItem.x, rcItem.y, rcItem.width, rcItem.height)); + __pBase->SetBounds(rect); if (!__pBase->GetShowState()) { __pBase->SetShowState(true); } - Canvas* pCanvas = __pBase->GetCanvasN(Rectangle(0, 0, rcItem.width, rcItem.height)); + Canvas* pCanvas = __pBase->GetCanvasN(FloatRectangle(0.0f, 0.0f, rect.width, rect.height)); if (pCanvas == null) { result r = GetLastResult(); @@ -324,47 +327,46 @@ _IconListItem::DrawItemCheckAnimation(Tizen::Graphics::Rectangle& rcItem, float result _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float ratio) { - Rectangle rect = __pProperty->GetItemBitmapBounds(); - int borderWidth = __pProperty->GetDropShadowBorderWidth(); - int dropShadowSize = __pProperty->GetDropShadowMargin() + (borderWidth << 1); + FloatRectangle rect = __pProperty->GetItemBitmapBounds(); + float borderWidth = __pProperty->GetDropShadowBorderWidth(); if (__pProperty->GetBorderStyle() == ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW) { - rect.x += borderWidth; - rect.y += borderWidth; - rect.width -= dropShadowSize; - rect.height -= dropShadowSize; + rect.x += 1; + rect.y += 1; + rect.width -= borderWidth; + rect.height -= borderWidth; } - int width = rect.width; - int height = rect.height; + float width = rect.width; + float height = rect.height; // Adjust Bitmap Ratio if (__pProperty->IsItemBitmapAsAspectRatio()) { - width = bitmap.GetWidth() * rect.height / bitmap.GetHeight(); - height = bitmap.GetHeight() * rect.width / bitmap.GetWidth(); - if (width > rect.width) + width = bitmap.GetWidthF() * rect.height / bitmap.GetHeightF(); + height = bitmap.GetHeightF() * rect.width / bitmap.GetWidthF(); + if (!_FloatCompareLE(width, rect.width)) { width = rect.width; } - if (height > rect.height) + if (!_FloatCompareLE(height, rect.height)) { height = rect.height; } } // Resize & Set Alpha by Ratio(ratio < 1.0f) - if (ratio < REFERENCE_FACTOR) + if (!_FloatCompareGE(ratio, REFERENCE_FACTOR)) { width = width * ratio; height = height * ratio; bitmap.SetAlphaConstant(OPAQUE_ALPHA * ratio); } - // Set Bitmap Rect - rect.x += (rect.width - width) >> 1; - rect.y += (rect.height - height) >> 1; + // Set bitmap bounds + rect.x += (rect.width - width) / 2; + rect.y += (rect.height - height) / 2; rect.SetSize(width, height); switch (__pProperty->GetBorderStyle()) @@ -395,14 +397,13 @@ _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float canvas.DrawBitmap(rect, bitmap); } - if (ratio >= REFERENCE_FACTOR) + if (_FloatCompareGE(ratio, REFERENCE_FACTOR)) { // Draw Outline canvas.SetForegroundColor(__pProperty->GetBorderColor(isFocused)); - canvas.SetLineWidth(1); - Dimension dim = __pProperty->GetItemSize(); - Rectangle rect(0, 0, dim.width, dim.height); - canvas.DrawRectangle(rect); + canvas.SetLineWidth(1.0f); + FloatDimension dim = __pProperty->GetItemSize(); + canvas.DrawRectangle(FloatRectangle(0.0f, 0.0f, dim.width, dim.height)); } break; } @@ -412,7 +413,7 @@ _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float if (isFocused) { // Draw Drop-Shadow Effect - if (__pProperty->GetFocusDropShadowBitmap() != null && ratio >= REFERENCE_FACTOR) + if (__pProperty->GetFocusDropShadowBitmap() != null && _FloatCompareGE(ratio, REFERENCE_FACTOR)) { const Bitmap* pShadowBitmap = __pProperty->GetFocusDropShadowBitmap(); if (pShadowBitmap->IsNinePatchedBitmap()) @@ -428,7 +429,7 @@ _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float else { // Draw Drop-Shadow Effect - if (__pProperty->GetDropShadowBitmap() != null && ratio >= REFERENCE_FACTOR) + if (__pProperty->GetDropShadowBitmap() != null && _FloatCompareGE(ratio, REFERENCE_FACTOR)) { const Bitmap* pShadowBitmap = __pProperty->GetDropShadowBitmap(); if (pShadowBitmap->IsNinePatchedBitmap()) @@ -455,7 +456,7 @@ _IconListItem::DrawBitmap(Canvas& canvas, Bitmap& bitmap, bool isFocused, float } } - if (ratio < REFERENCE_FACTOR) + if (!_FloatCompareGE(ratio, REFERENCE_FACTOR)) { bitmap.SetAlphaConstant(OPAQUE_ALPHA); } @@ -503,18 +504,18 @@ _IconListItem::DrawText(const Color& color) Font* pFont = __pProperty->GetFont(); SysTryReturn(NID_UI_CTRL, pFont != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred."); - int textVerticalMargin = __pProperty->GetTextVerticalMargin(); - int width = __pProperty->GetTextAreaWidth(); + float textVerticalMargin = __pProperty->GetTextVerticalMargin(); + float width = __pProperty->GetTextAreaWidth(); __pTextObject->SetFont(pFont, 0, __pTextObject->GetTextLength()); __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); - __pTextObject->SetBounds(Rectangle(0, 0, width, 1)); + __pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, width, 1.0f)); __pTextObject->Compose(); - int height = __pTextObject->GetTotalHeight(); - int leading = _FontImpl::GetInstance((*pFont))->GetLeading(); - int textYPos = __pProperty->GetTextYPosition(); - if (height >= leading * 2) + float height = __pTextObject->GetTotalHeightF(); + float leading = _FontImpl::GetInstance((*pFont))->GetLeadingF(); + float textYPos = __pProperty->GetTextYPosition(); + if (_FloatCompareGE(height, leading * 2)) { textYPos = __pProperty->GetTwoLineTextYPosition(); height = (leading + textVerticalMargin) * 2; @@ -526,17 +527,21 @@ _IconListItem::DrawText(const Color& color) if (__pProperty->GetTextVerticalAlignment() == ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_BOTTOM) { - Dimension itemSize = __pProperty->GetItemSize(); - textYPos = itemSize.height - height; + FloatDimension itemSize = __pProperty->GetItemSize(); + textYPos = itemSize.height - height - 1; } + result r = GetLastResult(); + FloatRectangle bounds(0.0f, 0.0f, width, height); + Canvas* pCanvas = null; + if (__pTextVE == null) { __pTextVE = new (std::nothrow) _VisualElement(); SysTryReturn(NID_UI_CTRL, __pTextVE != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); result r = __pTextVE->Construct(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); __pTextVE->SetRedrawOnResizeEnabled(false); __pTextVE->SetImplicitAnimationEnabled(false); @@ -547,10 +552,9 @@ _IconListItem::DrawText(const Color& color) __pTextVE->SetBounds(FloatRectangle(__pProperty->GetTextXPosition(), textYPos, width, height)); __pTextVE->SetShowState(true); - Canvas* pCanvas = __pTextVE->GetCanvasN(); + pCanvas = __pTextVE->GetCanvasN(); SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - Rectangle bounds(0, 0, width, height); pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); pCanvas->FillRectangle(__pProperty->GetTextBackgroundColor(), bounds); @@ -560,6 +564,12 @@ _IconListItem::DrawText(const Color& color) delete pCanvas; return E_SUCCESS; + +CATCH: + __pTextVE->Destroy(); + __pTextVE = null; + + return r; } result @@ -575,12 +585,12 @@ _IconListItem::DrawCheck(Canvas& canvas, float ratio) return E_SYSTEM; } - int width = pBackgroundBitmap->GetWidth(); - int height = pBackgroundBitmap->GetHeight(); - int checkMargin = __pProperty->GetCheckMargin(); + float width = pBackgroundBitmap->GetWidthF(); + float height = pBackgroundBitmap->GetHeightF(); + float checkMargin = __pProperty->GetCheckMargin(); - Rectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); - Point checkPosition(bitmapBounds.x, bitmapBounds.y); + FloatRectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); + FloatPoint checkPosition(bitmapBounds.x, bitmapBounds.y); switch (__pProperty->GetCheckBoxPosition()) { case ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT: @@ -604,10 +614,12 @@ _IconListItem::DrawCheck(Canvas& canvas, float ratio) break; } + FloatRectangle checkRect(checkPosition.x, checkPosition.y, width, height); + // draw background of check box if (pBackgroundBitmap->IsNinePatchedBitmap()) { - canvas.DrawNinePatchedBitmap(Rectangle(checkPosition.x, checkPosition.y, width, height), *pBackgroundBitmap); + canvas.DrawNinePatchedBitmap(checkRect, *pBackgroundBitmap); } else { @@ -628,7 +640,6 @@ _IconListItem::DrawCheck(Canvas& canvas, float ratio) __pBase->AttachChild(*__pCheckVE); } - FloatRectangle checkRect(checkPosition.x, checkPosition.y, width, height); __pCheckVE->SetBounds(checkRect); __pCheckVE->SetShowState(true); @@ -642,11 +653,11 @@ _IconListItem::DrawCheck(Canvas& canvas, float ratio) { if (pBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()), *pBitmap); + pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, pBitmap->GetWidthF(), pBitmap->GetHeightF()), *pBitmap); } else { - Rectangle animationRect(0, 0, pBitmap->GetWidth() * ratio, pBitmap->GetHeight()); + FloatRectangle animationRect(0.0f, 0.0f, pBitmap->GetWidthF() * ratio, pBitmap->GetHeightF()); pCanvas->DrawBitmap(animationRect, *pBitmap, animationRect); } } @@ -659,15 +670,15 @@ result _IconListItem::DrawOverlayBitmaps(void) { result r = E_SUCCESS; - Rectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); + FloatRectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); Canvas* pCanvas = null; for (int i = 0, n = __overlayBitmaps.size(); i < n; i++) { _OverlayBitmap* pOverlayBitmap = __overlayBitmaps.at(i); - int overlayMargin = __pProperty->GetOverlayMargin(); + float overlayMargin = __pProperty->GetOverlayMargin(); if (pOverlayBitmap->pBitmap != null) { - Rectangle rect = GetOverlayBitmapBounds(pOverlayBitmap, bitmapBounds, overlayMargin); + FloatRectangle overlayBitmapBounds = GetOverlayBitmapBounds(pOverlayBitmap, bitmapBounds, overlayMargin); _VisualElement* pVE = null; if (pOverlayBitmap->pVE == null) @@ -689,7 +700,7 @@ _IconListItem::DrawOverlayBitmaps(void) pVE = pOverlayBitmap->pVE; } - pVE->SetBounds(FloatRectangle(rect.x, rect.y, rect.width, rect.height)); + pVE->SetBounds(overlayBitmapBounds); pVE->SetShowState(true); pCanvas = pVE->GetCanvasN(); @@ -698,14 +709,15 @@ _IconListItem::DrawOverlayBitmaps(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + overlayBitmapBounds.SetPosition(0.0f, 0.0f); Bitmap* pBitmap = pOverlayBitmap->pBitmap; if(pBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, rect.width, rect.height), *pBitmap); + pCanvas->DrawNinePatchedBitmap(overlayBitmapBounds, *pBitmap); } else { - pCanvas->DrawBitmap(Rectangle(0, 0, rect.width, rect.height), *pBitmap); + pCanvas->DrawBitmap(overlayBitmapBounds, *pBitmap); } delete pCanvas; } @@ -737,16 +749,14 @@ _IconListItem::GetText(void) const result _IconListItem::SetBitmap(IconListViewItemDrawingStatus status, const Bitmap* pBitmap) { - if (ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL > status - || ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED < status) + if (ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL > status || ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED < status) { SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used."); return E_INVALID_ARG; } SysTryReturn(NID_UI_CTRL, (status != ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL || pBitmap != null), E_INVALID_ARG, - E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. The normal bitmap must not be null."); + E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The normal bitmap must not be null."); result r = E_SUCCESS; Bitmap* pCopiedBitmap = null; @@ -778,7 +788,7 @@ _IconListItem::GetBitmap(IconListViewItemDrawingStatus status) const return __pBitmap[status]; } -Tizen::Ui::Animations::_VisualElement* +_VisualElement* _IconListItem::GetVisualElement(void) const { return __pBase; @@ -824,14 +834,14 @@ _IconListItem::GetItemIndex(int& groupIndex, int& itemIndex) const } result -_IconListItem::SetOverlayBitmap(int overlayBitmapId, const Tizen::Graphics::Bitmap* pOverlayBitmap, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) +_IconListItem::SetOverlayBitmap(int overlayBitmapId, const Bitmap* pOverlayBitmap, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) { result r = E_SUCCESS; SysTryReturn(NID_UI_CTRL, horizontalAlignment >= ALIGNMENT_LEFT && horizontalAlignment <= ALIGNMENT_RIGHT, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The horizontal alignment is inappropriate."); SysTryReturn(NID_UI_CTRL, verticalAlignment >= ALIGNMENT_TOP && verticalAlignment <= ALIGNMENT_BOTTOM, E_INVALID_ARG, - E_INVALID_ARG, "[E_INVALID_ARG] The vertical alignment is inappropriate."); + E_INVALID_ARG, "[E_INVALID_ARG] The vertical alignment is inappropriate."); bool found = false; Bitmap* pCopiedBitmap = null; @@ -899,23 +909,23 @@ _IconListItem::SetOverlayBitmap(int overlayBitmapId, const Tizen::Graphics::Bitm } int -_IconListItem::GetOverlayBitmapIdFromPosition(Point& position) const +_IconListItem::GetOverlayBitmapIdFromPosition(FloatPoint& position) const { if (__overlayBitmaps.size() <= 0) { return -1; } - Rectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); + FloatRectangle bitmapBounds = __pProperty->GetItemBitmapBounds(); for (int i = __overlayBitmaps.size() - 1; i >= 0; i--) { _OverlayBitmap* pOverlayBitmap = __overlayBitmaps.at(i); if (pOverlayBitmap != null) { - int overlayMargin = __pProperty->GetOverlayMargin(); + float overlayMargin = __pProperty->GetOverlayMargin(); if (pOverlayBitmap->pBitmap != null) { - Rectangle rect = GetOverlayBitmapBounds(pOverlayBitmap, bitmapBounds, overlayMargin); + FloatRectangle rect = GetOverlayBitmapBounds(pOverlayBitmap, bitmapBounds, overlayMargin); if (rect.Contains(position)) { return pOverlayBitmap->id; @@ -923,7 +933,6 @@ _IconListItem::GetOverlayBitmapIdFromPosition(Point& position) const } } } - return -1; } @@ -933,41 +942,47 @@ _IconListItem::GetItemVisualElement(void) const return __pBase; } -Rectangle -_IconListItem::GetOverlayBitmapBounds(_OverlayBitmap* pOverlayBitmap, const Rectangle& parentRect, int margin) const +FloatRectangle +_IconListItem::GetOverlayBitmapBounds(_OverlayBitmap* pOverlayBitmap, const FloatRectangle& parentRect, float overlayMargin) const { - int x = parentRect.x; - int y = parentRect.y; - int width = pOverlayBitmap->pBitmap->GetWidth(); - int height = pOverlayBitmap->pBitmap->GetHeight(); + float x = parentRect.x; + float y = parentRect.y; + float width = pOverlayBitmap->pBitmap->GetWidthF(); + float height = pOverlayBitmap->pBitmap->GetHeightF(); switch (pOverlayBitmap->horizontalAlignment) { case ALIGNMENT_LEFT: - x += margin; + x += overlayMargin; break; case ALIGNMENT_CENTER: x += (parentRect.width - width) / 2; break; case ALIGNMENT_RIGHT: - x += (parentRect.width - width - margin); + x += (parentRect.width - width - overlayMargin); break; } switch (pOverlayBitmap->verticalAlignment) { case ALIGNMENT_TOP: - y += margin; + y += overlayMargin; break; case ALIGNMENT_MIDDLE: y += (parentRect.height - height) / 2; break; case ALIGNMENT_BOTTOM: - y += (parentRect.height - height - margin); + y += (parentRect.height - height - overlayMargin); break; } - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); +} + +bool +_IconListItem::IsDrawn(void) const +{ + return __isDrawn; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_IconListItemDrawingProperty.cpp b/src/ui/controls/FUiCtrl_IconListItemDrawingProperty.cpp index ecc7cf6..0c19fe1 100644 --- a/src/ui/controls/FUiCtrl_IconListItemDrawingProperty.cpp +++ b/src/ui/controls/FUiCtrl_IconListItemDrawingProperty.cpp @@ -24,6 +24,8 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_IconListItemDrawingProperty.h" @@ -35,30 +37,30 @@ namespace Tizen { namespace Ui { namespace Controls { _IconListItemDrawingProperty::_IconListItemDrawingProperty(void) - : __textSize(0) + : __textSize(0.0f) , __pFont(null) , __normalTextColor(0) , __pressedTextColor(0) , __highlightedTextColor(0) - , __size(0, 0) - , __bitmapBounds(0, 0, 0, 0) + , __size(0.0f, 0.0f) + , __bitmapBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pDropShadowBitmap(null) , __pFocusDropShadowBitmap(null) , __pDropShadowBitmapWithReplacementColor(null) - , __dropShadowBorderWidth(0) - , __dropShadowMargin(0) + , __dropShadowBorderWidth(0.0f) + , __dropShadowMargin(0.0f) , __pCheckBitmap(null) , __pCheckedBackgroundBitmap(null) , __pUnCheckedBackgroundBitmap(null) , __pDisabledCheckBitmap(null) - , __checkMargin(0) - , __overlayMargin(0) + , __checkMargin(0.0f) + , __overlayMargin(0.0f) , __pressedBackgroundColor(0) , __normalBorderColor(0) , __focusBorderColor(0) , __inTextBackgroundColor(0) - , __textYPos(0) - , __2LineTextYPos(0) + , __textYPos(0.0f) + , __2LineTextYPos(0.0f) , __checkBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_RIGHT) , __borderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE) , __textHorizontalAlignment(ALIGNMENT_CENTER) @@ -67,12 +69,12 @@ _IconListItemDrawingProperty::_IconListItemDrawingProperty(void) , __changed(true) , __asAspectRatio(true) , __checkedStyle(false) - , __verticalExtent(0) - , __insideOneLineTextHeight(0) - , __insideTwoLineTextHeight(0) - , __selectBackgroundMargin(0) - , __itemTextHorizontalMargin(0) - , __itemTextVerticalMargin(0) + , __verticalExtent(0.0f) + , __insideOneLineTextHeight(0.0f) + , __insideTwoLineTextHeight(0.0f) + , __selectBackgroundMargin(0.0f) + , __itemTextHorizontalMargin(0.0f) + , __itemTextVerticalMargin(0.0f) { // Do nothing } @@ -123,16 +125,16 @@ _IconListItemDrawingProperty::Initialize(void) { result r = E_SUCCESS; - int width = 0; - int height = 0; - // Load Drop Shadow Bitmap GET_FIXED_VALUE_CONFIG(ICONLIST::DROP_SHADOW_BORDER, _CONTROL_ORIENTATION_PORTRAIT, __dropShadowBorderWidth); GET_FIXED_VALUE_CONFIG(ICONLIST::DROP_SHADOW_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __dropShadowMargin); + + float width = 0.0f; + float height = 0.0f; GET_FIXED_VALUE_CONFIG(ICONLIST::DROP_SHADOW_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, width); GET_FIXED_VALUE_CONFIG(ICONLIST::DROP_SHADOW_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); - if (width > 0 && height > 0) + if (!_FloatCompareLE(width, 0.0f) && !_FloatCompareLE(height, 0.0f)) { r = GET_BITMAP_CONFIG_N(ICONLIST::ITEM_BORDER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDropShadowBitmap); if (r != E_SUCCESS) @@ -158,12 +160,12 @@ _IconListItemDrawingProperty::Initialize(void) // Load Check Bitmap GET_FIXED_VALUE_CONFIG(ICONLIST::CHECKBOX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __checkMargin); - Dimension dimension(0, 0); + FloatDimension dimension(0.0f, 0.0f); GET_DIMENSION_CONFIG(ICONLIST::CHECKBOX_SIZE, _CONTROL_ORIENTATION_PORTRAIT, dimension); width = dimension.width; height = dimension.height; - if (width > 0 && height > 0) + if (!_FloatCompareLE(width, 0.0f) && !_FloatCompareLE(height, 0.0f)) { r = GET_BITMAP_CONFIG_N(ICONLIST::CHECK_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pCheckBitmap); if (r != E_SUCCESS) @@ -196,8 +198,8 @@ _IconListItemDrawingProperty::Initialize(void) } } - // Load overaly bitmap margin - GET_FIXED_VALUE_CONFIG(ICONLIST::OVERLAY_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __overlayMargin); + // Load overlay bitmap margin + GET_FIXED_VALUE_CONFIG(ICONLIST::OVERLAY_ICON_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __overlayMargin); // Load item press state background color GET_COLOR_CONFIG(ICONLIST::ITEM_BG_PRESSED, __pressedBackgroundColor); @@ -242,8 +244,8 @@ const Color _IconListItemDrawingProperty::GetBackgroundColor(IconListViewItemDrawingStatus status) const { SysTryReturn(NID_UI_CTRL, - (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), - Color(0), E_INVALID_ARG, "[E_INVALID_ARG] Invalid value of drawing status is used."); + (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), + Color(0), E_INVALID_ARG, "[E_INVALID_ARG] Invalid value of drawing status is used."); ClearLastResult(); if (status == ICON_LIST_VIEW_ITEM_DRAWING_STATUS_PRESSED) @@ -254,14 +256,14 @@ _IconListItemDrawingProperty::GetBackgroundColor(IconListViewItemDrawingStatus s } result -_IconListItemDrawingProperty::SetTextSize(int size) +_IconListItemDrawingProperty::SetTextSize(float size) { - int minSize = 0; + float minSize = 0.0f; GET_FIXED_VALUE_CONFIG(ICONLIST::MINIMUM_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, minSize); - SysTryReturn(NID_UI_CTRL, (size >= minSize), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. Font size should be greater than or equal to the minimum size."); + SysTryReturn(NID_UI_CTRL, _FloatCompareGE(size, minSize), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. Font size should be greater than or equal to the minimum size."); - if (__textSize != size) + if (!_FloatCompare(__textSize, size)) { __textSize = size; } @@ -269,7 +271,7 @@ _IconListItemDrawingProperty::SetTextSize(int size) return E_SUCCESS; } -int +float _IconListItemDrawingProperty::GetTextSize(void) const { ClearLastResult(); @@ -288,15 +290,15 @@ _IconListItemDrawingProperty::SetFont(Font* pFont) __pFont = pFont; - int oldVerticalExtent = __verticalExtent; - int defaultTextSize = 0; - GET_SHAPE_CONFIG(ICONLIST::FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, defaultTextSize); + float oldVerticalExtent = __verticalExtent; + float textSize = 0.0f; + GET_SHAPE_CONFIG(ICONLIST::FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, textSize); - if (__textSize != defaultTextSize) + if (!_FloatCompare(__textSize, textSize)) { int leading = _FontImpl::GetInstance(*__pFont)->GetLeading(); - __insideOneLineTextHeight = leading + __itemTextVerticalMargin * 2; - __insideTwoLineTextHeight = (leading << 1) + __itemTextVerticalMargin * 2; + __insideOneLineTextHeight = leading + __itemTextVerticalMargin * 2.0f; + __insideTwoLineTextHeight = (leading * 2.0f) + __itemTextVerticalMargin * 2.0f; __verticalExtent = __insideTwoLineTextHeight; } else @@ -328,8 +330,8 @@ result _IconListItemDrawingProperty::SetTextColor(IconListViewItemDrawingStatus status, const Color color) { SysTryReturn(NID_UI_CTRL, - (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), - E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid value of drawing status."); + (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), + E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid value of drawing status."); if (status == ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -352,8 +354,8 @@ const Color _IconListItemDrawingProperty::GetTextColor(IconListViewItemDrawingStatus status) const { SysTryReturn(NID_UI_CTRL, - (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), - Color(0), E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid value of drawing status."); + (status >= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_NORMAL && status <= ICON_LIST_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED), + Color(0), E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid value of drawing status."); ClearLastResult(); @@ -390,32 +392,31 @@ _IconListItemDrawingProperty::GetBorderColor(bool isFocused) const result _IconListItemDrawingProperty::SetItemLayout(void) { - SysTryReturn( - NID_UI_CTRL, + SysTryReturn(NID_UI_CTRL, (__textVerticalAlignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_TOP && __textVerticalAlignment <= - ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_BOTTOM), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has been occurred. The current state of vertical text alignment is not valid."); + ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_BOTTOM), E_SYSTEM, E_SYSTEM, + "[E_SYSTEM] A system error has been occurred. The current state of vertical text alignment is not valid."); switch (__textVerticalAlignment) { case ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_TOP: - __textYPos = 0; + __textYPos = 1.0f; __2LineTextYPos = __textYPos; break; case ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_MIDDLE: - __textYPos = (__size.height - __insideOneLineTextHeight) >> 1; - __2LineTextYPos = (__size.height - __insideTwoLineTextHeight) >> 1; + __textYPos = (__size.height - __insideOneLineTextHeight) / 2.0f ; + __2LineTextYPos = (__size.height - __insideTwoLineTextHeight) / 2.0f; break; case ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_BOTTOM: - __textYPos = __size.height - __insideOneLineTextHeight; - __2LineTextYPos = __size.height - __insideTwoLineTextHeight; + __textYPos = __size.height - __insideOneLineTextHeight - 2.0f; + __2LineTextYPos = __size.height - __insideTwoLineTextHeight - 2.0f; break; case ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP: __textYPos = __insideOneLineTextHeight - __itemTextVerticalMargin; - __2LineTextYPos = 0; + __2LineTextYPos = 1.0f; break; case ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_BOTTOM: @@ -429,12 +430,12 @@ _IconListItemDrawingProperty::SetItemLayout(void) } result -_IconListItemDrawingProperty::SetItemBitmapBounds(const Rectangle bounds) +_IconListItemDrawingProperty::SetItemBitmapBounds(const FloatRectangle bounds) { - SysTryReturn(NID_UI_CTRL, (bounds.x >= 0 && bounds.y >= 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. X and Y must be a non negative integer."); - SysTryReturn(NID_UI_CTRL, (bounds.width > 0 && bounds.height > 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. Width and Height size should be larger than 0."); + SysTryReturn(NID_UI_CTRL, _FloatCompareGE(bounds.x, 0.0f) && _FloatCompareGE(bounds.y, 0.0f), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. X and Y must be a non-negative value."); + SysTryReturn(NID_UI_CTRL, !_FloatCompareLE(bounds.width, 0.0f) && !_FloatCompareLE(bounds.height, 0.0f), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. Width and height should be larger than 0.0f."); __bitmapBounds = bounds; __size.width = bounds.width; @@ -449,12 +450,12 @@ _IconListItemDrawingProperty::SetItemBitmapBounds(const Rectangle bounds) return SetItemLayout(); } -const Rectangle +FloatRectangle _IconListItemDrawingProperty::GetItemBitmapBounds(void) const { ClearLastResult(); - Rectangle bounds(__bitmapBounds); + FloatRectangle bounds(__bitmapBounds); if (__textVerticalAlignment == ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) { bounds.y += __verticalExtent; @@ -463,55 +464,55 @@ _IconListItemDrawingProperty::GetItemBitmapBounds(void) const return bounds; } -const Tizen::Graphics::Dimension +FloatDimension _IconListItemDrawingProperty::GetItemBitmapSize(void) const { ClearLastResult(); - return Dimension(__bitmapBounds.width, __bitmapBounds.height); + return FloatDimension(__bitmapBounds.width, __bitmapBounds.height); } result -_IconListItemDrawingProperty::SetItemSize(const Tizen::Graphics::Dimension size) +_IconListItemDrawingProperty::SetItemSize(const FloatDimension size) { - SysTryReturn(NID_UI_CTRL, (size.width > 0 && size.height > 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. Width and Height size should be larger than 0."); + SysTryReturn(NID_UI_CTRL, !_FloatCompareLE(size.width, 0.0f) && !_FloatCompareLE(size.height, 0.0f), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. Width and height should be larger than 0."); __size = size; return E_SUCCESS; } -const Tizen::Graphics::Dimension +FloatDimension _IconListItemDrawingProperty::GetItemSize(void) const { ClearLastResult(); return __size; } -const int +float _IconListItemDrawingProperty::GetTextXPosition(void) const { return __itemTextHorizontalMargin; } -const int +float _IconListItemDrawingProperty::GetTextYPosition(void) const { return __textYPos; } -const int +float _IconListItemDrawingProperty::GetTwoLineTextYPosition(void) const { return __2LineTextYPos; } -const int +float _IconListItemDrawingProperty::GetTextAreaWidth(void) const { - return __bitmapBounds.width - __itemTextHorizontalMargin * 2; + return __bitmapBounds.width - __itemTextHorizontalMargin * 2.0f; } -const int +float _IconListItemDrawingProperty::GetTextVerticalMargin(void) const { return __itemTextVerticalMargin; @@ -520,10 +521,9 @@ _IconListItemDrawingProperty::GetTextVerticalMargin(void) const result _IconListItemDrawingProperty::SetCheckBoxPosition(IconListViewCheckBoxPosition position) { - SysTryReturn( - NID_UI_CTRL, - (position >= ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT && position <= ICON_LIST_VIEW_CHECK_BOX_POSITION_BOTTOM_RIGHT), - E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid position of CheckBox is used."); + SysTryReturn(NID_UI_CTRL, + (position >= ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT && position <= ICON_LIST_VIEW_CHECK_BOX_POSITION_BOTTOM_RIGHT), + E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid position of CheckBox is used."); __checkBoxPosition = position; __changed = true; @@ -560,7 +560,7 @@ result _IconListItemDrawingProperty::SetTextHorizontalAlignment(HorizontalAlignment alignment) { SysTryReturn(NID_UI_CTRL, (alignment >= ALIGNMENT_LEFT && alignment <= ALIGNMENT_RIGHT), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has been occurred. Invalid horizontal text alignment is used."); + "[E_SYSTEM] A system error has been occurred. Invalid horizontal text alignment is used."); __textHorizontalAlignment = alignment; __changed = true; @@ -577,19 +577,17 @@ _IconListItemDrawingProperty::GetTextHorizontalAlignment(void) const result _IconListItemDrawingProperty::SetTextVerticalAlignment(IconListViewItemTextVerticalAlignment alignment) { - SysTryReturn( - NID_UI_CTRL, - (alignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_TOP && alignment <= - ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_BOTTOM), - E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid vertical text alignment is used."); + SysTryReturn(NID_UI_CTRL, (alignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_TOP && alignment <= + ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_BOTTOM), E_SYSTEM, E_SYSTEM, + "[E_SYSTEM] A system error has been occurred. Invalid vertical text alignment is used."); - if (alignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP - && __textVerticalAlignment < ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) + if (alignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP && + __textVerticalAlignment < ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) { __size.height = __size.height + __verticalExtent; } - else if (alignment < ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP - && __textVerticalAlignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) + else if (alignment < ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP && + __textVerticalAlignment >= ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) { __size.height -= __verticalExtent; } @@ -607,34 +605,34 @@ _IconListItemDrawingProperty::GetTextVerticalAlignment(void) const return __textVerticalAlignment; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetDropShadowBitmap(void) const { return __pDropShadowBitmapWithReplacementColor; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetFocusDropShadowBitmap(void) const { return __pFocusDropShadowBitmap; } -int +float _IconListItemDrawingProperty::GetDropShadowBorderWidth(void) const { return __dropShadowBorderWidth; } -int +float _IconListItemDrawingProperty::GetDropShadowMargin(void) const { return __dropShadowMargin; } -const Rectangle +FloatRectangle _IconListItemDrawingProperty::GetDropShadowBitmapBounds(void) const { - Rectangle bounds(__bitmapBounds); + FloatRectangle bounds(__bitmapBounds); if (__textVerticalAlignment == ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_OUTSIDE_TOP) { bounds.y += __verticalExtent; @@ -643,25 +641,25 @@ _IconListItemDrawingProperty::GetDropShadowBitmapBounds(void) const return bounds; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetCheckBitmap(void) const { return __pCheckBitmap; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetCheckedBackgroundBitmap(void) const { return __pCheckedBackgroundBitmap; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetUnCheckedBackgroundBitmap(void) const { return __pUnCheckedBackgroundBitmap; } -const Tizen::Graphics::Bitmap* +const Bitmap* _IconListItemDrawingProperty::GetDisabledCheckBitmap(void) const { return __pDisabledCheckBitmap; @@ -679,19 +677,19 @@ _IconListItemDrawingProperty::IsItemCheckedStyle(void) const return __checkedStyle; } -int +float _IconListItemDrawingProperty::GetCheckMargin(void) const { return __checkMargin; } -int +float _IconListItemDrawingProperty::GetOverlayMargin(void) const { return __overlayMargin; } -int +float _IconListItemDrawingProperty::GetSelectBackgroundMargin(void) const { return __selectBackgroundMargin; @@ -722,7 +720,6 @@ _IconListItemDrawingProperty::Release(void) if (__refCount <= 0) { delete this; - return 0; } return __refCount; diff --git a/src/ui/controls/FUiCtrl_IconListItemProvider.cpp b/src/ui/controls/FUiCtrl_IconListItemProvider.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_IconListItemProviderAdaptor.cpp b/src/ui/controls/FUiCtrl_IconListItemProviderAdaptor.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_IconListPresenter.cpp b/src/ui/controls/FUiCtrl_IconListPresenter.cpp old mode 100755 new mode 100644 index a91bcb2..b9ecc2d --- a/src/ui/controls/FUiCtrl_IconListPresenter.cpp +++ b/src/ui/controls/FUiCtrl_IconListPresenter.cpp @@ -22,7 +22,6 @@ //Includes #include -#include #include #include #include @@ -32,6 +31,8 @@ #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiAnim_VisualElement.h" @@ -65,39 +66,37 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo , __backgroundColor(0) , __currentTouchInfo() , __selectedOverlayBitmapId(-1) - , __selectedIndex(-1) - , __checkedIndex(-1) - , __highlightedIndex(-1) - , __firstDrawnIndex(-1) - , __lastDrawnIndex(-1) + , __selectedIndex(INVALID_INDEX) + , __checkedIndex(INVALID_INDEX) + , __highlightedIndex(INVALID_INDEX) + , __firstDrawnIndex(INVALID_INDEX) + , __lastDrawnIndex(INVALID_INDEX) , __scrollDirection(ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) - , __topMargin(0) - , __bottomMargin(0) - , __leftMargin(0) - , __rightMargin(0) - , __horizontalSpacing(0) - , __verticalSpacing(0) + , __topMargin(0.0f) + , __bottomMargin(0.0f) + , __leftMargin(0.0f) + , __rightMargin(0.0f) + , __horizontalSpacing(0.0f) + , __verticalSpacing(0.0f) , __magneticScrollSize(0) , __itemCountPerAxis(0) , __itemHorizontalAlignment(ALIGNMENT_LEFT) , __itemVerticalAlignment(ALIGNMENT_TOP) - , __scrollPosition(0) - , __unitScrollLength(0) - , __scrollLength(0) - , __unitLengthOfAxis(0) - , __startPosOfAxis(0) - , __endPosOfAxis(0) + , __scrollPosition(0.0f) + , __unitScrollLength(0.0f) + , __scrollLength(0.0f) + , __unitLengthOfAxis(0.0f) + , __startPosOfAxis(0.0f) + , __endPosOfAxis(0.0f) , __pItemDrawingProperty(null) , __pSelectionAnimationTimer(null) , __pCheckAnimationTimer(null) , __pTouchActionTimer(null) - , __pFlickAnimationTimer(null) , __pMagneticScrollTimer(null) , __pAnimationTimer(null) - , __flickAnimation() , __touchAnimation() - , __magneticScrollAnimation() , __checkAnimation() + , __magneticScrollAnimation() , __isTouchAnimationEnabled(true) , __previousTouchAnimatinEnabled(true) , __isLayoutChanged(true) @@ -113,20 +112,23 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo , __pEmptyListVE(null) , __pVE(null) , __onReordering(false) - , __reorderFromIndex(-1) - , __reorderToIndex(-1) - , __lastReorderedPosition(-1, -1) - , __lastReorderedDifferences(0, 0) - , __reorderItemBounds(0, 0, 0, 0) + , __reorderFromIndex(INVALID_INDEX) + , __reorderToIndex(INVALID_INDEX) + , __lastReorderedPosition(-1.0f, -1.0f) + , __lastReorderedDifferences(0.0f, 0.0f) + , __reorderItemBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pReorderScrollTimer(null) - , __reorderScrollAnimationDistance(0) - , __scrollPositionBeforeScrollAnimation(0) + , __reorderScrollAnimationDistance(0.0f) + , __scrollPositionBeforeScrollAnimation(0.0f) , __flickCount(0) , __isFlickDown(false) - , __animationItemIndex(-1) + , __flickRunning(false) + , __animationItemIndex(INVALID_INDEX) , __addTransactionId(0) , __removeTransactionId(0) , __moveTransactionId(0) + , __firstTouchMove(true) + , __firstTouchMoveDirection(ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { } @@ -189,9 +191,6 @@ _IconListPresenter::Dispose(void) delete __pTouchActionTimer; __pTouchActionTimer = null; - delete __pFlickAnimationTimer; - __pFlickAnimationTimer = null; - delete __pMagneticScrollTimer; __pMagneticScrollTimer = null; @@ -219,9 +218,6 @@ _IconListPresenter::Dispose(void) result _IconListPresenter::Initialize(void) { - __flickAnimation.SetSizeInformation(SCREEN_WIDTH, SCREEN_HEIGHT, DEVICE_SIZE_HORIZONTAL, DEVICE_SIZE_VERTICAL); - __flickAnimation.SetSensitivity(FLICK_ANIMATION_FPS_LIST, FLICK_ANIMATION_SENSITIVITY_LIST); - SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE); SetTextHorizontalAlignment(ALIGNMENT_CENTER); SetTextVerticalAlignment(ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_BOTTOM); @@ -232,15 +228,6 @@ _IconListPresenter::Initialize(void) __pVE->SetClipChildrenEnabled(true); __pVE->SetSurfaceOpaque(false); - // Default Margin & Spacing - _ControlOrientation orientation = __pIconListView->GetOrientation(); - GET_SHAPE_CONFIG(ICONLIST::TOP_MARGIN, orientation, __topMargin); - GET_SHAPE_CONFIG(ICONLIST::BOTTOM_MARGIN, orientation, __bottomMargin); - GET_SHAPE_CONFIG(ICONLIST::LEFT_MARGIN, orientation, __leftMargin); - GET_SHAPE_CONFIG(ICONLIST::RIGHT_MARGIN, orientation, __rightMargin); - GET_SHAPE_CONFIG(ICONLIST::HORIZONTAL_SPACING, orientation, __horizontalSpacing); - GET_SHAPE_CONFIG(ICONLIST::VERTICAL_SPACING, orientation, __verticalSpacing); - return E_SUCCESS; } @@ -274,7 +261,7 @@ _IconListPresenter::SetItemProvider(const IIconListViewItemProvider& provider) pAdaptor->SetItemProvider(const_cast (&provider)); __isLayoutChanged = true; - __scrollPosition = 0; + __scrollPosition = 0.0f; AdjustLayout(); InitializeFont(); @@ -334,133 +321,117 @@ _IconListPresenter::SetScrollDirection(IconListViewScrollDirection scrollDirecti (scrollDirection >= ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL && scrollDirection <= ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid scrollDirection is used."); - int scrollBarWidth = 0; _ControlOrientation orientation = __pIconListView->GetOrientation(); + float scrollBarWidth = 0.0f; GET_SHAPE_CONFIG(SCROLL::THUMB_MIN_WIDTH, orientation, scrollBarWidth); + GET_SHAPE_CONFIG(ICONLIST::TOP_MARGIN, orientation, __topMargin); + GET_SHAPE_CONFIG(ICONLIST::BOTTOM_MARGIN, orientation, __bottomMargin); + GET_SHAPE_CONFIG(ICONLIST::LEFT_MARGIN, orientation, __leftMargin); + GET_SHAPE_CONFIG(ICONLIST::RIGHT_MARGIN, orientation, __rightMargin); + GET_SHAPE_CONFIG(ICONLIST::HORIZONTAL_SPACING, orientation, __horizontalSpacing); + GET_SHAPE_CONFIG(ICONLIST::VERTICAL_SPACING, orientation, __verticalSpacing); __scrollDirection = scrollDirection; - Rectangle bounds = __pIconListView->GetBounds(); + FloatRectangle bounds = __pIconListView->GetBoundsF(); if (scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - GET_SHAPE_CONFIG(ICONLIST::LEFT_MARGIN, orientation, __leftMargin); - GET_SHAPE_CONFIG(ICONLIST::RIGHT_MARGIN, orientation, __rightMargin); - SetItemLayoutHorizontalAlignment(ALIGNMENT_CENTER); - __pIconListView->SetScroll(Rectangle(bounds.width - scrollBarWidth, 0, scrollBarWidth, bounds.height), + __pIconListView->SetScroll(FloatRectangle(bounds.width - scrollBarWidth, 0.0f, scrollBarWidth, bounds.height), SCROLL_DIRECTION_VERTICAL); - __flickAnimation.SetDirection(0x1); } else { - GET_SHAPE_CONFIG(ICONLIST::OUTSIDE_TEXT_LEFT_MARGIN, orientation, __leftMargin); - GET_SHAPE_CONFIG(ICONLIST::OUTSIDE_TEXT_RIGHT_MARGIN, orientation, __rightMargin); - SetItemLayoutVerticalAlignment(ALIGNMENT_MIDDLE); - __pIconListView->SetScroll(Rectangle(0, bounds.height - scrollBarWidth, bounds.width, scrollBarWidth), + __pIconListView->SetScroll(FloatRectangle(0.0f, bounds.height - scrollBarWidth, bounds.width, scrollBarWidth), SCROLL_DIRECTION_HORIZONTAL); - __flickAnimation.SetDirection(0x2); } return E_SUCCESS; } result -_IconListPresenter::SetTopMargin(int value) +_IconListPresenter::SetMargin(MarginType type, float value) { - SysTryReturn(NID_UI_CTRL, (value >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The value must be non negative integer."); + SysTryReturn(NID_UI_CTRL, _FloatCompareGE(value, 0.0f), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The value must be non-negative value."); - if (__topMargin != value) + switch (type) { - __topMargin = value; - AdjustLayout(); - } + case MARGIN_TYPE_TOP: + if (!_FloatCompare(__topMargin, value)) + { + __topMargin = value; + AdjustLayout(); + } + break; - return E_SUCCESS; -} + case MARGIN_TYPE_BOTTOM: + if (!_FloatCompare(__bottomMargin, value)) + { + __bottomMargin = value; + AdjustLayout(); + } + break; -int -_IconListPresenter::GetTopMargin(void) const -{ - ClearLastResult(); - return __topMargin; -} + case MARGIN_TYPE_LEFT: + if (!_FloatCompare(__leftMargin, value)) + { + __leftMargin = value; + AdjustLayout(); + } + break; -result -_IconListPresenter::SetBottomMargin(int value) -{ - SysTryReturn(NID_UI_CTRL, (value >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The value must be non negative integer."); + case MARGIN_TYPE_RIGHT: + if (!_FloatCompare(__rightMargin, value)) + { + __rightMargin = value; + AdjustLayout(); + } + break; - if (__bottomMargin != value) - { - __bottomMargin = value; - AdjustLayout(); + default: + SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used."); + return E_INVALID_ARG; } - return E_SUCCESS; } -int -_IconListPresenter::GetBottomMargin(void) const +float +_IconListPresenter::GetMargin(MarginType type) const { ClearLastResult(); - return __bottomMargin; -} - -result -_IconListPresenter::SetLeftMargin(int value) -{ - SysTryReturn(NID_UI_CTRL, (value >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The value must be non negative integer."); - - if (__leftMargin != value) + switch (type) { - __leftMargin = value; - AdjustLayout(); - } + case MARGIN_TYPE_TOP: + return __topMargin; - return E_SUCCESS; -} + case MARGIN_TYPE_BOTTOM: + return __bottomMargin; -int -_IconListPresenter::GetLeftMargin(void) const -{ - ClearLastResult(); - return __leftMargin; -} + case MARGIN_TYPE_LEFT: + return __leftMargin; -result -_IconListPresenter::SetRightMargin(int value) -{ - SysTryReturn(NID_UI_CTRL, (value >= 0), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. The value must be non negative integer."); + case MARGIN_TYPE_RIGHT: + return __rightMargin; - if (__rightMargin != value) - { - __rightMargin = value; - AdjustLayout(); + default: + SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used."); + return -1.0f; } - - return E_SUCCESS; -} - -int -_IconListPresenter::GetRightMargin(void) const -{ - ClearLastResult(); - return __rightMargin; } result -_IconListPresenter::SetItemSpacing(int horizontalSpacing, int verticalSpacing) +_IconListPresenter::SetItemSpacing(float horizontalSpacing, float verticalSpacing) { - SysTryReturn(NID_UI_CTRL, (horizontalSpacing >= 0 && verticalSpacing >= 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. The value must be non negative integer."); + SysTryReturn(NID_UI_CTRL, _FloatCompareGE(horizontalSpacing, 0.0f) && _FloatCompareGE(verticalSpacing, 0.0f), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. The value must be non-negative value."); - if (__horizontalSpacing != horizontalSpacing) + if (!_FloatCompare(__horizontalSpacing, horizontalSpacing)) { __horizontalSpacing = horizontalSpacing; __isLayoutChanged = true; } - if (__verticalSpacing != verticalSpacing) + if (!_FloatCompare(__verticalSpacing, verticalSpacing)) { __verticalSpacing = verticalSpacing; __isLayoutChanged = true; @@ -474,14 +445,14 @@ _IconListPresenter::SetItemSpacing(int horizontalSpacing, int verticalSpacing) return E_SUCCESS; } -int +float _IconListPresenter::GetItemHorizontalSpacing(void) const { ClearLastResult(); return __horizontalSpacing; } -int +float _IconListPresenter::GetItemVerticalSpacing(void) const { ClearLastResult(); @@ -517,9 +488,8 @@ _IconListPresenter::SetItemChecked(int index, bool check) } else { - SysTryReturn(NID_UI_CTRL, (index >= 0 && index < __pListModel->GetItemCountInGroup( - DEFAULT_GROUP_INDEX)), E_OUT_OF_RANGE, E_OUT_OF_RANGE, - "[E_OUT_OF_RANGE] Index must be non-negative integer, and less count of whole items."); + SysTryReturn(NID_UI_CTRL, (index >= 0 && index < __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX)), E_OUT_OF_RANGE, + E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Index must be non-negative integer, and less count of whole items."); } return __pListModel->SetItemChecked(DEFAULT_GROUP_INDEX, index, check); @@ -533,10 +503,10 @@ _IconListPresenter::IsItemChecked(int index) const } int -_IconListPresenter::GetItemIndexFromPosition(int x, int y) const +_IconListPresenter::GetItemIndexFromPosition(float x, float y) const { ClearLastResult(); - if (__unitLengthOfAxis <= 0 || __unitScrollLength <= 0) + if (_FloatCompareLE(__unitLengthOfAxis, 0.0f) || _FloatCompareLE(__unitScrollLength, 0.0f)) { return -1; } @@ -552,36 +522,36 @@ _IconListPresenter::GetItemIndexFromPosition(int x, int y) const if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { x -= __startPosOfAxis; - if (x < 0) + if (!_FloatCompareGE(x, 0.0f)) { return -1; } - col = x / __unitLengthOfAxis; + col = static_cast (x / __unitLengthOfAxis); if (col >= __itemCountPerAxis) { return -1; } - modX = x % __unitLengthOfAxis; - if (modX >= GetItemSize().width) + modX = x - (static_cast (x / __unitLengthOfAxis) * __unitLengthOfAxis); + if (_FloatCompareGE(modX, GetItemSize().width)) { return -1; } y += __scrollPosition - __topMargin; - if (y < 0) + if (!_FloatCompareGE(y, 0.0f)) { return -1; } - modY = y % __unitScrollLength; - if (modY >= GetItemSize().height) + modY = y - (static_cast (y / __unitScrollLength) * __unitScrollLength); + if (_FloatCompareGE(modY, GetItemSize().height)) { return -1; } - row = y / __unitScrollLength; + row = static_cast (y / __unitScrollLength); index = row * __itemCountPerAxis + col; if (index >= __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX)) { @@ -591,36 +561,36 @@ _IconListPresenter::GetItemIndexFromPosition(int x, int y) const else { y -= __startPosOfAxis; - if (y < 0) + if (!_FloatCompareGE(y, 0.0f)) { return -1; } - row = y / __unitLengthOfAxis; + row = static_cast (y / __unitLengthOfAxis); if (row >= __itemCountPerAxis) { return -1; } - modY = y % __unitLengthOfAxis; - if (modY >= GetItemSize().height) + modY = y - (static_cast (y / __unitLengthOfAxis) * __unitLengthOfAxis); + if (_FloatCompareGE(modY, GetItemSize().height)) { return -1; } x += __scrollPosition - __leftMargin; - if (x < 0) + if (!_FloatCompareGE(x, 0.0f)) { return -1; } - modX = x % __unitScrollLength; - if (modX >= GetItemSize().width) + modX = x - (static_cast (x - __unitScrollLength) * __unitScrollLength); + if (_FloatCompareGE(modX, GetItemSize().width)) { return -1; } - col = x / __unitScrollLength; + col = static_cast (x / __unitScrollLength); index = col * __itemCountPerAxis + row; if (index >= __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX)) { @@ -632,7 +602,7 @@ _IconListPresenter::GetItemIndexFromPosition(int x, int y) const } int -_IconListPresenter::GetItemIndexFromPosition(const Point& position) const +_IconListPresenter::GetItemIndexFromPosition(const FloatPoint& position) const { return GetItemIndexFromPosition(position.x, position.y); } @@ -697,14 +667,14 @@ _IconListPresenter::GetItemTextColor(IconListViewItemDrawingStatus status) const } result -_IconListPresenter::SetItemTextSize(int size) +_IconListPresenter::SetItemTextSize(float size) { - int itemHeight = __pItemDrawingProperty->GetItemSize().height; + float itemHeight = __pItemDrawingProperty->GetItemSize().height; result r = __pItemDrawingProperty->SetTextSize(size); InitializeFont(); - if (itemHeight != __pItemDrawingProperty->GetItemSize().height) + if (!_FloatCompare(itemHeight, __pItemDrawingProperty->GetItemSize().height)) { AdjustLayout(); } @@ -712,7 +682,7 @@ _IconListPresenter::SetItemTextSize(int size) return r; } -int +float _IconListPresenter::GetItemTextSize(void) const { return __pItemDrawingProperty->GetTextSize(); @@ -752,11 +722,11 @@ _IconListPresenter::ScrollToItem(int index) { int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); SysTryReturn(NID_UI_CTRL, (index >= 0 && index < itemCount), E_OUT_OF_RANGE, E_OUT_OF_RANGE, - "[E_OUT_OF_RANGE] Index must be non-negative integer, and less count of whole items."); + "[E_OUT_OF_RANGE] Index must be non-negative integer, and less count of whole items."); SysTryReturn(NID_UI_CTRL, (__itemCountPerAxis > 0), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Unable to get ItemCount per axis."); - int scrollPosition = (index / __itemCountPerAxis) * __unitScrollLength; + float scrollPosition = (index / __itemCountPerAxis) * __unitScrollLength; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { scrollPosition += __topMargin; @@ -776,9 +746,9 @@ _IconListPresenter::ScrollToItem(int index) } result -_IconListPresenter::ScrollByPixel(int pixel) +_IconListPresenter::ScrollByPixel(float pixel) { - if (pixel == 0) + if (_FloatCompare(pixel, 0.0f)) { return E_SUCCESS; } @@ -812,11 +782,12 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) "[E_OUT_OF_RANGE] Index must be non-negative integer, and less count of whole items."); SysTryReturn(NID_UI_CTRL, (type >= LIST_REFRESH_TYPE_ITEM_ADD && type <= LIST_REFRESH_TYPE_ITEM_MODIFY), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has been occured. Refresh type is invalid."); + "[E_SYSTEM] A system error has been occurred. Refresh type is invalid."); if (__pAnimationTimer != null) { ResetAnimationTimer(); + StopAllAnimations(); Draw(); } @@ -826,19 +797,24 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) { case LIST_REFRESH_TYPE_ITEM_ADD: { + _IconListItem* pItem = dynamic_cast <_IconListItem*>(__pItemProviderAdaptor->LoadItem(DEFAULT_GROUP_INDEX, index)); + SysTryReturn(NID_UI_CTRL, (pItem != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + if ((__firstDrawnIndex <= index) && (__lastDrawnIndex >= index)) { MoveBackward(index); } + else if (__firstDrawnIndex > index) + { + MoveBackward(__firstDrawnIndex - 1); + usingAnimation = true; + } if (__pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX) == 0) { __listStatusChanged = true; } - _IconListItem* pItem = dynamic_cast <_IconListItem*>(__pItemProviderAdaptor->LoadItem(DEFAULT_GROUP_INDEX, index)); - SysTryReturn(NID_UI_CTRL, (pItem != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - r = InsertItemAt(index, pItem); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -874,7 +850,11 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) { RemoveAnimation(*pItem, index); MoveForward(index + 1); - + usingAnimation = true; + } + else if (__firstDrawnIndex > index) + { + MoveForward(__firstDrawnIndex); usingAnimation = true; } @@ -893,6 +873,9 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) case LIST_REFRESH_TYPE_ITEM_MODIFY: { + if(__pListModel->IsLoadedItem(DEFAULT_GROUP_INDEX , index) == false) + return r; + _IconListItem* pItem = dynamic_cast <_IconListItem*>(__pItemProviderAdaptor->LoadItem(DEFAULT_GROUP_INDEX, index)); SysTryReturn(NID_UI_CTRL, (pItem != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -909,28 +892,7 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) } } - if (!usingAnimation) - { - if ((type == LIST_REFRESH_TYPE_ITEM_ADD) && (index < __firstDrawnIndex)) - { - int scrollPosition = __scrollPosition + __unitScrollLength; - if (SetScrollPosition(scrollPosition)) - { - ScrollFadeOut(); - } - } - else if ((type == LIST_REFRESH_TYPE_ITEM_REMOVE) && (index < __firstDrawnIndex)) - { - int scrollPosition = __scrollPosition - __unitScrollLength; - if (SetScrollPosition(scrollPosition)) - { - ScrollFadeOut(); - } - - } - __pIconListView->Invalidate(); - } - else + if (usingAnimation) { AdjustLayout(); InitializeFont(); @@ -946,23 +908,22 @@ _IconListPresenter::UpdateDrawnIndex(void) { int drawingLine = 0; int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); - Rectangle itemRect(0, 0, GetItemSize().height, GetItemSize().width); + FloatRectangle itemRect(0.0f, 0.0f, GetItemSize().height, GetItemSize().width); if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - int endXPos = __endPosOfAxis; - int endYPos = __pIconListView->GetBounds().height; + float endXPos = __endPosOfAxis; + float endYPos = __pIconListView->GetBounds().height; - drawingLine = (__scrollPosition > __topMargin) ? - (__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength : 0; + drawingLine = (__scrollPosition > __topMargin) ? (__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength : 0; itemRect.y = __topMargin + drawingLine * __unitScrollLength - __scrollPosition; int index = drawingLine * __itemCountPerAxis; __firstDrawnIndex = index; - while(itemRect.y < endYPos) + while(!_FloatCompareGE(itemRect.y, endYPos)) { itemRect.x = __startPosOfAxis; - while ((itemRect.x < endXPos) && (index < itemCount)) + while (!_FloatCompareGE(itemRect.x, endXPos) && (index < itemCount)) { ++index; itemRect.x += __unitLengthOfAxis; @@ -973,19 +934,18 @@ _IconListPresenter::UpdateDrawnIndex(void) } else { - int endXPos = __pIconListView->GetBounds().width; - int endYPos = __endPosOfAxis; + float endXPos = __pIconListView->GetBounds().width; + float endYPos = __endPosOfAxis; - drawingLine = (__scrollPosition > __leftMargin) ? - (__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength : 0; + drawingLine = (__scrollPosition > __leftMargin) ? (__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength : 0; itemRect.x = __leftMargin + drawingLine * __unitScrollLength - __scrollPosition; int index = drawingLine * __itemCountPerAxis; __firstDrawnIndex = index; - while(itemRect.x < endXPos) + while(!_FloatCompareGE(itemRect.x, endXPos)) { itemRect.y = __startPosOfAxis; - while ((itemRect.y < endYPos) && (index < itemCount)) + while (!_FloatCompareGE(itemRect.y, endYPos) && (index < itemCount)) { ++index; itemRect.y += __unitLengthOfAxis; @@ -1000,14 +960,13 @@ result _IconListPresenter::UpdateList(void) { SysTryReturn(NID_UI_CTRL, (__pItemProviderAdaptor != null), E_INVALID_STATE, E_INVALID_STATE, - "[E_INVALID_STATE] IconListViewItemProvider isn't added."); + "[E_INVALID_STATE] IconListViewItemProvider isn't added."); - ResetFlickAnimationTimer(); ResetTouchActionTimer(); ResetAnimationTimer(); ResetCheckAnimationTimer(); - __pVE->RemoveAllAnimations(); + StopAllAnimations(); result r = RemoveAllItems(); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1024,7 +983,7 @@ _IconListPresenter::UpdateList(void) } result -_IconListPresenter::SetItemBitmapBounds(const Rectangle& bounds) +_IconListPresenter::SetItemBitmapBounds(const FloatRectangle& bounds) { result r = __pItemDrawingProperty->SetItemBitmapBounds(bounds); @@ -1036,52 +995,52 @@ _IconListPresenter::SetItemBitmapBounds(const Rectangle& bounds) return r; } -const Rectangle +FloatRectangle _IconListPresenter::GetItemBitmapBounds(void) const { return __pItemDrawingProperty->GetItemBitmapBounds(); } result -_IconListPresenter::GetItemBitmapSize(int& width, int& height) const +_IconListPresenter::GetItemBitmapSize(float& width, float& height) const { - Dimension itemSize = __pItemDrawingProperty->GetItemBitmapSize(); + FloatDimension itemSize = __pItemDrawingProperty->GetItemBitmapSize(); width = itemSize.width; height = itemSize.height; return E_SUCCESS; } -const Dimension +FloatDimension _IconListPresenter::GetItemBitmapSize(void) const { return __pItemDrawingProperty->GetItemBitmapSize(); } result -_IconListPresenter::SetItemSize(const Dimension& size) +_IconListPresenter::SetItemSize(const FloatDimension& size) { SysTryReturn(NID_UI_CTRL, (__pItemDrawingProperty != null), E_INVALID_STATE, E_INVALID_STATE, - "[E_INVALID_STATE] This instance isn't constructed."); + "[E_INVALID_STATE] This instance isn't constructed."); - SysTryReturn(NID_UI_CTRL, (size.width > 0 && size.height > 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. Width and Height size should be larger than 0."); + SysTryReturn(NID_UI_CTRL, !_FloatCompareLE(size.width, 0.0f) && !_FloatCompareLE(size.height, 0.0f), E_INVALID_ARG, + E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. Width and Height should be larger than 0."); __isLayoutChanged = true; return __pItemDrawingProperty->SetItemSize(size); } result -_IconListPresenter::GetItemSize(int& width, int& height) const +_IconListPresenter::GetItemSize(float& width, float& height) const { - Dimension itemSize = __pItemDrawingProperty->GetItemSize(); + FloatDimension itemSize = __pItemDrawingProperty->GetItemSize(); width = itemSize.width; height = itemSize.height; return E_SUCCESS; } -const Dimension +FloatDimension _IconListPresenter::GetItemSize(void) const { return __pItemDrawingProperty->GetItemSize(); @@ -1091,11 +1050,11 @@ result _IconListPresenter::SetMagneticScrollSize(int scrollSize) { SysTryReturn(NID_UI_CTRL, (__pItemProviderAdaptor != null), E_INVALID_STATE, E_INVALID_STATE, - "[E_INVALID_STATE] This instance isn't constructed."); + "[E_INVALID_STATE] This instance isn't constructed."); - int rowCount = static_cast(Math::Ceiling(((double) __pItemProviderAdaptor->GetItemCount()) / ((double) __itemCountPerAxis))); + int rowCount = static_cast (Math::Ceiling(((double) __pItemProviderAdaptor->GetItemCount()) / ((double) __itemCountPerAxis))); SysTryReturn(NID_UI_CTRL, ((scrollSize >= 0) && (scrollSize <= rowCount)), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. ScrollSize is a non-negative integer and less than the number of rows."); + "[E_INVALID_ARG] Invalid argument is used. ScrollSize is a non-negative integer and less than the number of rows."); __magneticScrollSize = scrollSize; @@ -1113,7 +1072,7 @@ void _IconListPresenter::SetItemCountPerAxis(int itemCountPerAxis) { SysTryReturnVoidResult(NID_UI_CTRL, (itemCountPerAxis >= 0), E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argumet is used. itemCountPerAxis is a non-negative integer."); + "[E_INVALID_ARG] Invalid argument is used. itemCountPerAxis is a non-negative integer."); ClearLastResult(); __itemCountPerAxis = itemCountPerAxis; @@ -1388,20 +1347,20 @@ _IconListPresenter::Draw(void) const Bitmap* pBackgroundBitmap = __pIconListView->GetBackgroundBitmap(); if (pBackgroundBitmap != null) { - Rectangle bounds; Canvas* pCanvas = __pVE->GetCanvasN(); SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); pCanvas->SetBackgroundColor(backgroundColor); pCanvas->Clear(); - bounds = __pIconListView->GetBounds(); + FloatRectangle bounds(__pIconListView->GetBoundsF()); + bounds.SetPosition(0.0f, 0.0f); if (pBackgroundBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); } else { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBackgroundBitmap); + pCanvas->DrawBitmap(bounds, *pBackgroundBitmap); } delete pCanvas; @@ -1413,7 +1372,6 @@ _IconListPresenter::Draw(void) __pVE->SetBackgroundColor(_Colorf((float) backgroundColor.GetRed() / 255, (float) backgroundColor.GetGreen() / 255, (float) backgroundColor.GetBlue() / 255, (float) backgroundColor.GetAlpha() / 255)); __needBaseCanvas = false; } - } itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); @@ -1460,15 +1418,14 @@ _IconListPresenter::Draw(void) _Scroll* pScroll = __pIconListView->GetScroll(); if (pScroll != null) { - int scrollViewRange = 0; - int scrollRange = 0; + float scrollViewRange = 0.0f; + float scrollRange = 0.0f; pScroll->GetScrollRange(&scrollViewRange, &scrollRange); - if (scrollViewRange < scrollRange) + if (!_FloatCompareGE(scrollViewRange, scrollRange)) { ScrollFadeOut(); } } - InitializeAccessibilityElement(); } @@ -1512,24 +1469,22 @@ _IconListPresenter::DrawEmptyList(void) Canvas* pCanvas = null; TextObject* pTextObject = null; - Dimension textDimension; - Rectangle bounds(0, 0, 0, 0); - Rectangle viewBounds = __pIconListView->GetBounds(); - viewBounds.x = 0; - viewBounds.y = 0; + FloatDimension textDimension; + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle viewBounds = __pIconListView->GetBoundsF(); + viewBounds.x = 0.0f; + viewBounds.y = 0.0f; - int emptyTextHeight = 0; + float emptyTextHeight = 0.0f; Font* pFont = null; const String emptyText = __pIconListView->GetTextOfEmptyList(); - int gap = 0; - int bitmapXPosition = 0; - int bitmapHeight = 0; - int bitmapWidth = 0; + float bitmapXPosition = 0.0f; + float bitmapHeight = 0.0f; + float bitmapWidth = 0.0f; const Bitmap* pBitmap = __pIconListView->GetBitmapOfEmptyList(); - // set visual element or canvas for empty list if (!__needBaseCanvas && __pEmptyListVE == null) { @@ -1550,10 +1505,10 @@ _IconListPresenter::DrawEmptyList(void) SysTryCatch(NID_UI, pCanvas != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); } - GET_SHAPE_CONFIG(ICONLIST::EMPTY_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, emptyTextHeight); - if (!emptyText.IsEmpty()) { + GET_SHAPE_CONFIG(ICONLIST::EMPTY_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, emptyTextHeight); + pFont = __pIconListView->GetFallbackFont(); SysTryCatch(NID_UI, pFont != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -1571,19 +1526,19 @@ _IconListPresenter::DrawEmptyList(void) pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - pTextObject->SetBounds(Rectangle(0, 0, viewBounds.width, 1)); + pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, viewBounds.width, 1.0f)); pTextObject->Compose(); - textDimension.height = pTextObject->GetTotalHeight(); - textDimension.width = pTextObject->GetLineWidthAt(0); + textDimension.height = pTextObject->GetTotalHeightF(); + textDimension.width = pTextObject->GetLineWidthAtF(0); for (int i = 1; i < pTextObject->GetTotalLineCount(); i++) { - int tempWidth = pTextObject->GetLineWidthAt(i); + float tempWidth = pTextObject->GetLineWidthAtF(i); textDimension.width = textDimension.width > tempWidth ? textDimension.width : tempWidth; } // calculate bounds with text - if (viewBounds.width >= textDimension.width) + if (_FloatCompareGE(viewBounds.width, textDimension.width)) { bounds.x = (viewBounds.width - textDimension.width) / 2; bounds.width = textDimension.width; @@ -1593,7 +1548,7 @@ _IconListPresenter::DrawEmptyList(void) bounds.width = viewBounds.width; } - if (viewBounds.height >= textDimension.height) + if (_FloatCompareGE(viewBounds.height, textDimension.height)) { bounds.y = (viewBounds.height - textDimension.height) / 2; bounds.height = textDimension.height; @@ -1606,54 +1561,38 @@ _IconListPresenter::DrawEmptyList(void) if (pBitmap != null) { - int originalHeight = pBitmap->GetHeight(); - bitmapHeight = originalHeight; - bitmapWidth = pBitmap->GetWidth(); + bitmapHeight = pBitmap->GetHeightF(); + bitmapWidth = pBitmap->GetWidthF(); - // calculate bounds with bitmap - if (!emptyText.IsEmpty()) - { - gap = emptyTextHeight; - } + bounds.height += bitmapHeight + emptyTextHeight; - if (bounds.height + bitmapHeight + gap < viewBounds.height) - { - bounds.height += (bitmapHeight + gap); - } - else - { - bitmapHeight = viewBounds.height - gap - textDimension.height; - if (bitmapHeight < 0) - { - bitmapHeight = 0; - bitmapWidth = 0; - } - else if (bitmapHeight != originalHeight) - { - bitmapWidth = bitmapWidth * (double)((double)bitmapHeight / (double)originalHeight); - } + bounds.y = (viewBounds.height - bounds.height) / 2; - bounds.height = bitmapHeight + gap + textDimension.height; + if (!_FloatCompareGE(bounds.y, 0.0f)) + { + bounds.y = 0.0f; } - bounds.y = (viewBounds.height - bounds.height) / 2; - - if (bounds.width > bitmapWidth) + if (!_FloatCompareLE(bounds.width, bitmapWidth)) { bitmapXPosition = (bounds.width - bitmapWidth) / 2; } - else if (viewBounds.width > bitmapWidth) + else if (!_FloatCompareLE(viewBounds.width, bitmapWidth)) { bounds.x = (viewBounds.width - bitmapWidth) / 2; bounds.width = bitmapWidth; } + else + { + bounds.x = 0.0f; + bounds.width = bitmapWidth; + } } - // draw emtpy list + // draw empty list if (!__needBaseCanvas) { - FloatRectangle visualElementBounds(bounds.x, bounds.y, bounds.width, bounds.height); - __pEmptyListVE->SetBounds(visualElementBounds); + __pEmptyListVE->SetBounds(bounds); __pEmptyListVE->SetShowState(true); pCanvas = __pEmptyListVE->GetCanvasN(); @@ -1663,25 +1602,31 @@ _IconListPresenter::DrawEmptyList(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - bounds.x = 0; - bounds.y = 0; + bounds.x = 0.0f; + bounds.y = 0.0f; } if (pBitmap != null) { + FloatRectangle bitmapBounds(bounds.x + bitmapXPosition, bounds.y, bitmapWidth, bitmapHeight); if (pBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(bounds.x + bitmapXPosition, bounds.y, bitmapWidth, bitmapHeight), *pBitmap); + pCanvas->DrawNinePatchedBitmap(bitmapBounds, *pBitmap); } else { - pCanvas->DrawBitmap(Rectangle(bounds.x + bitmapXPosition, bounds.y, bitmapWidth, bitmapHeight), *pBitmap); + pCanvas->DrawBitmap(bitmapBounds, *pBitmap); } } if (!emptyText.IsEmpty()) { - pTextObject->SetBounds(Rectangle(bounds.x, bounds.y + gap + bitmapHeight, bounds.width, textDimension.height)); + if (!_FloatCompare(bitmapHeight, 0.0f)) + { + bounds.y += emptyTextHeight + bitmapHeight; + } + bounds.height = textDimension.height; + pTextObject->SetBounds(bounds); pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); } @@ -1713,24 +1658,23 @@ result _IconListPresenter::DrawHorizontalScrollList(void) { int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); - int itemHeight = GetItemSize().height; - int itemWidth = GetItemSize().width; - Rectangle itemRect(0, 0, itemWidth, itemHeight); - int drawingLine = (__scrollPosition > __leftMargin) ? - (__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength : 0; + float itemHeight = GetItemSize().height; + float itemWidth = GetItemSize().width; + FloatRectangle itemRect(0.0f, 0.0f, itemWidth, itemHeight); + int drawingLine = !_FloatCompareGE(__scrollPosition, __leftMargin) ? + static_cast ((__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength) : 0; int index = drawingLine * __itemCountPerAxis; - int endXPos = __pIconListView->GetBounds().width; - int endYPos = __endPosOfAxis; - int unitWidth = __unitScrollLength; - int unitHeight = __unitLengthOfAxis; - _IconListItem* pItem = null; + float endXPos = __pIconListView->GetBounds().width; + float endYPos = __endPosOfAxis; + float unitWidth = __unitScrollLength; + float unitHeight = __unitLengthOfAxis; itemRect.x = __leftMargin + drawingLine * unitWidth - __scrollPosition; // Hide Items if (__lastDrawnIndex >= 0) { - int scroll = endXPos - itemRect.x; - int lastIndex = index + ((scroll - 1) / unitWidth + 1) * __itemCountPerAxis - 1; + float scroll = endXPos - itemRect.x; + int lastIndex = index + (static_cast ((scroll - 1.0f) / unitWidth) + 1) * __itemCountPerAxis - 1; if (lastIndex >= itemCount) { lastIndex = itemCount - 1; @@ -1750,7 +1694,7 @@ _IconListPresenter::DrawHorizontalScrollList(void) // Preload Items if (__firstDrawnIndex > index) { - int topIndex = __firstDrawnIndex - __itemCountPerAxis * (__pIconListView->GetBounds().width / __unitScrollLength + 1); + int topIndex = __firstDrawnIndex - __itemCountPerAxis * (static_cast (__pIconListView->GetBounds().width / __unitScrollLength) + 1); if (topIndex <= index) { while (--__firstDrawnIndex > index) @@ -1761,11 +1705,12 @@ _IconListPresenter::DrawHorizontalScrollList(void) } // Draw Items + _IconListItem* pItem = null; __firstDrawnIndex = index; - while (itemRect.x < endXPos) + while (!_FloatCompareGE(itemRect.x, endXPos)) { itemRect.y = __startPosOfAxis; - while (itemRect.y < endYPos && index < itemCount) + while (!_FloatCompareGE(itemRect.y, endYPos) && index < itemCount) { // Draw Item pItem = dynamic_cast <_IconListItem*>(__pListModel->LoadItem(DEFAULT_GROUP_INDEX, index)); @@ -1812,24 +1757,23 @@ result _IconListPresenter::DrawVerticalScrollList(void) { int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); - int itemHeight = GetItemSize().height; - int itemWidth = GetItemSize().width; - Rectangle itemRect(0, 0, itemWidth, itemHeight); - int drawingLine = (__scrollPosition > __topMargin) ? - (__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength : 0; + float itemHeight = GetItemSize().height; + float itemWidth = GetItemSize().width; + FloatRectangle itemRect(0.0f, 0.0f, itemWidth, itemHeight); + int drawingLine = !_FloatCompareGE(__scrollPosition, __topMargin) ? + static_cast ((__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength) : 0; int index = drawingLine * __itemCountPerAxis; - int endXPos = __endPosOfAxis; - int endYPos = __pIconListView->GetBounds().height; - int unitWidth = __unitLengthOfAxis; - int unitHeight = __unitScrollLength; - _IconListItem* pItem = null; + float endXPos = __endPosOfAxis; + float endYPos = __pIconListView->GetBounds().height; + float unitWidth = __unitLengthOfAxis; + float unitHeight = __unitScrollLength; itemRect.y = __topMargin + drawingLine * unitHeight - __scrollPosition; // Hide Items if (__lastDrawnIndex >= 0) { - int scroll = endYPos - itemRect.y; - int lastIndex = index + ((scroll - 1) / unitHeight + 1) * __itemCountPerAxis - 1; + float scroll = endYPos - itemRect.y; + int lastIndex = index + (static_cast ((scroll - 1.0f) / unitHeight) + 1) * __itemCountPerAxis - 1; if (lastIndex >= itemCount) { lastIndex = itemCount - 1; @@ -1849,7 +1793,7 @@ _IconListPresenter::DrawVerticalScrollList(void) // Preload Items if (__firstDrawnIndex > index) { - int topIndex = __firstDrawnIndex - __itemCountPerAxis * (__pIconListView->GetBounds().height / __unitScrollLength + 1); + int topIndex = __firstDrawnIndex - __itemCountPerAxis * (static_cast (__pIconListView->GetBounds().height / __unitScrollLength) + 1); if (topIndex <= index) { while (--__firstDrawnIndex > index) @@ -1860,11 +1804,12 @@ _IconListPresenter::DrawVerticalScrollList(void) } // Draw Items + _IconListItem* pItem = null; __firstDrawnIndex = index; - while (itemRect.y < endYPos) + while (!_FloatCompareGE(itemRect.y, endYPos)) { itemRect.x = __startPosOfAxis; - while (itemRect.x < endXPos && index < itemCount) + while (!_FloatCompareGE(itemRect.x, endXPos) && index < itemCount) { // Draw Item pItem = dynamic_cast <_IconListItem*>(__pListModel->LoadItem(DEFAULT_GROUP_INDEX, index)); @@ -1905,10 +1850,10 @@ _IconListPresenter::DrawVerticalScrollList(void) void _IconListPresenter::AdjustLayout(void) { - Dimension itemSize = __pIconListView->GetItemSize(); - Rectangle bounds = __pIconListView->GetBounds(); + FloatDimension itemSize = __pIconListView->GetItemSize(); + FloatRectangle bounds = __pIconListView->GetBoundsF(); int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX); - int oldScrollLength = __scrollLength; + float oldScrollLength = __scrollLength; // Reset layout changed flag __isLayoutChanged = false; @@ -1930,15 +1875,15 @@ _IconListPresenter::AdjustLayout(void) { __scrollLength = __topMargin + __bottomMargin - __verticalSpacing + __unitScrollLength * ((itemCount - 1) / __itemCountPerAxis + 1) - bounds.height; - if (__scrollLength < 0) + if (!_FloatCompareGE(__scrollLength, 0.0f)) { - __scrollLength = 0; + __scrollLength = 0.0f; } } else { __itemCountPerAxis = 0; - __scrollLength = 0; + __scrollLength = 0.0f; } // startPosOfAxis @@ -1949,9 +1894,8 @@ _IconListPresenter::AdjustLayout(void) break; case ALIGNMENT_CENTER: - __startPosOfAxis = - (bounds.width + __leftMargin - __rightMargin - __itemCountPerAxis * __unitLengthOfAxis + - __horizontalSpacing) >> 1; + __startPosOfAxis = (bounds.width + __leftMargin - __rightMargin - __itemCountPerAxis * __unitLengthOfAxis + + __horizontalSpacing) / 2; break; case ALIGNMENT_RIGHT: @@ -1962,7 +1906,7 @@ _IconListPresenter::AdjustLayout(void) // endPosOfAxis __endPosOfAxis = __startPosOfAxis + __itemCountPerAxis * __unitLengthOfAxis - __horizontalSpacing; - if (__scrollLength != oldScrollLength) + if (!_FloatCompare(__scrollLength, oldScrollLength)) { // Set Scroll Range & Position _Scroll* pScroll = __pIconListView->GetScroll(); @@ -1970,7 +1914,7 @@ _IconListPresenter::AdjustLayout(void) { pScroll->SetScrollRange(bounds.height, __scrollLength + bounds.height); - if (__scrollLength <= 0) + if (_FloatCompareLE(__scrollLength, 0.0f)) { pScroll->EnableScrollingEffect(false); } @@ -1980,7 +1924,7 @@ _IconListPresenter::AdjustLayout(void) } } - if ((__scrollLength < oldScrollLength) && (__scrollPosition > __scrollLength)) + if (!_FloatCompareGE(__scrollLength, oldScrollLength) && !_FloatCompareLE(__scrollPosition, __scrollLength)) { if (SetScrollPosition(__scrollLength)) { @@ -1993,8 +1937,8 @@ _IconListPresenter::AdjustLayout(void) } // CachingSize = # of items of view * ITEM_CACHE_SIZE_MULTIPLIER - __pListModel->SetMaxCachingSize( - (bounds.height / __unitScrollLength + 1) * __itemCountPerAxis * ITEM_CACHE_SIZE_MULTIPLIER); + __pListModel->SetMaxCachingSize((static_cast (bounds.height / __unitScrollLength) + 1) * + __itemCountPerAxis * ITEM_CACHE_SIZE_MULTIPLIER); } else { @@ -2002,7 +1946,7 @@ _IconListPresenter::AdjustLayout(void) __unitLengthOfAxis = itemSize.height + __verticalSpacing; // ItemCountPerAxis - __itemCountPerAxis = (bounds.height - __topMargin - __bottomMargin + __verticalSpacing) / __unitLengthOfAxis; + __itemCountPerAxis = static_cast ((bounds.height - __topMargin - __bottomMargin + __verticalSpacing) / __unitLengthOfAxis); // Unit Scroll Length(= Item Width + Horizontal Spacing) __unitScrollLength = itemSize.width + __horizontalSpacing; @@ -2012,15 +1956,15 @@ _IconListPresenter::AdjustLayout(void) { __scrollLength = __leftMargin + __rightMargin - __horizontalSpacing + __unitScrollLength * ((itemCount - 1) / __itemCountPerAxis + 1) - bounds.width; - if (__scrollLength < 0) + if (!_FloatCompareGE(__scrollLength, 0.0f)) { - __scrollLength = 0; + __scrollLength = 0.0f; } } else { __itemCountPerAxis = 0; - __scrollLength = 0; + __scrollLength = 0.0f; } // startPosOfAxis @@ -2031,9 +1975,8 @@ _IconListPresenter::AdjustLayout(void) break; case ALIGNMENT_MIDDLE: - __startPosOfAxis = - (bounds.height + __topMargin - __bottomMargin - __itemCountPerAxis * __unitLengthOfAxis + - __verticalSpacing) >> 1; + __startPosOfAxis = (bounds.height + __topMargin - __bottomMargin - __itemCountPerAxis * __unitLengthOfAxis + + __verticalSpacing) / 2; break; case ALIGNMENT_BOTTOM: @@ -2044,7 +1987,7 @@ _IconListPresenter::AdjustLayout(void) // endPosOfAxis __endPosOfAxis = __startPosOfAxis + __itemCountPerAxis * __unitLengthOfAxis - __verticalSpacing; - if (__scrollLength != oldScrollLength) + if (!_FloatCompare(__scrollLength, oldScrollLength)) { // Set Scroll Range & Position _Scroll* pScroll = __pIconListView->GetScroll(); @@ -2052,7 +1995,7 @@ _IconListPresenter::AdjustLayout(void) { pScroll->SetScrollRange(bounds.width, __scrollLength + bounds.width); - if (__scrollLength <= 0) + if (_FloatCompareLE(__scrollLength, 0.0f)) { pScroll->EnableScrollingEffect(false); } @@ -2062,7 +2005,7 @@ _IconListPresenter::AdjustLayout(void) } } - if ((__scrollLength < oldScrollLength) && (__scrollPosition > __scrollLength)) + if (!_FloatCompareGE(__scrollLength, oldScrollLength) && !_FloatCompareLE(__scrollPosition, __scrollLength)) { if (SetScrollPosition(__scrollLength)) { @@ -2075,7 +2018,8 @@ _IconListPresenter::AdjustLayout(void) } // CachingSize = # of items of view * ITEM_CACHE_SIZE_MULTIPLIER - __pListModel->SetMaxCachingSize((bounds.width / __unitScrollLength + 1) * __itemCountPerAxis * ITEM_CACHE_SIZE_MULTIPLIER); + __pListModel->SetMaxCachingSize(static_cast (bounds.width / __unitScrollLength + 1) * + __itemCountPerAxis * ITEM_CACHE_SIZE_MULTIPLIER); } } @@ -2125,7 +2069,7 @@ _IconListPresenter::RedrawItem(int index, float ratio, bool doShow, float checkR return E_SUCCESS; } - Rectangle itemRect = GetItemBounds(index); + FloatRectangle itemRect = GetItemBounds(index); pItem->SetDrawingProperty(*__pItemDrawingProperty); pItem->ClearVisualElement(); @@ -2154,8 +2098,7 @@ _IconListPresenter::RedrawItem(int index, float ratio, bool doShow, float checkR } _VisualElement* pBase = pItem->GetVisualElement(); - FloatRectangle itemRectf(itemRect.x, itemRect.y, itemRect.width, itemRect.height); - pBase->InvalidateRectangle(&itemRectf); + pBase->InvalidateRectangle(&itemRect); pBase->Draw(); if (doShow) @@ -2171,16 +2114,17 @@ _IconListPresenter::FireIconListViewItemEvent(_IconListViewItemEventType eventTy { // Create EventArg _IconListViewItemEventArg* pArg = new (std::nothrow) _IconListViewItemEventArg(index, eventType); - SysTryReturn(NID_UI_CTRL, (pArg != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] Memroy allcation failed."); + SysTryReturn(NID_UI_CTRL, (pArg != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); switch (eventType) { case EVENT_TYPE_ITEM_SELECTED: - pArg->SetStatus(static_cast(arg)); + pArg->SetStatus(static_cast (arg)); break; + case EVENT_TYPE_OVERLAY_BITMAP_SELECTED: pArg->SetOverlayBitmapId(arg); break; + case EVENT_TYPE_ITEM_REORDERED: pArg->SetToIndex(arg); break; @@ -2207,7 +2151,7 @@ CATCH: } result -_IconListPresenter::FireScrollPositionChangedEvent(int scrollPosition) +_IconListPresenter::FireScrollPositionChangedEvent(float scrollPosition) { // Create EventArg _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollEventArgN(*__pIconListView, scrollPosition); @@ -2243,12 +2187,12 @@ _IconListPresenter::FireScrollEvent() { result r = E_SUCCESS; - if ((__pFlickAnimationTimer != null) || (__pMagneticScrollTimer != null)) + if ((__flickRunning) || (__pMagneticScrollTimer != null)) { return r; } - if (__scrollPosition == 0) + if (_FloatCompare(__scrollPosition, 0.0f)) { if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { @@ -2264,7 +2208,7 @@ _IconListPresenter::FireScrollEvent() ScrollFadeOut(); } } - else if (__scrollPosition == __scrollLength) + else if (_FloatCompare(__scrollPosition, __scrollLength)) { if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { @@ -2288,25 +2232,25 @@ _IconListPresenter::FireScrollEvent() } bool -_IconListPresenter::SetScrollPosition(int position, bool enableFadeEffect) +_IconListPresenter::SetScrollPosition(float position, bool enableFadeEffect) { - if ((__scrollLength <= 0) && (position != 0)) + if (_FloatCompareLE(__scrollLength, 0.0f) && (!_FloatCompare(position, 0.0f))) { return false; } - if (__scrollPosition == position) + if (_FloatCompare(__scrollPosition, position)) { return false; } - if (position > __scrollLength) + if (!_FloatCompareLE(position, __scrollLength)) { __scrollPosition = __scrollLength; } - else if (position < 0) + else if (!_FloatCompareGE(position, 0.0f)) { - __scrollPosition = 0; + __scrollPosition = 0.0f; } else { @@ -2362,19 +2306,24 @@ _IconListPresenter::ScrollFadeOut(bool showEffect) } } -int +float _IconListPresenter::GetMagneticScrollPosition(void) const { + return GetMagneticScrollPosition(__scrollPosition); +} + +float +_IconListPresenter::GetMagneticScrollPosition(float scrollPosition) const +{ if (__magneticScrollSize <= 0) { return __scrollPosition; } - int scrollPosition = __scrollPosition; - int leftScrollLength = __scrollLength - scrollPosition; + float leftScrollLength = __scrollLength - scrollPosition; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - if (scrollPosition < __topMargin) + if (!_FloatCompareGE(scrollPosition, __topMargin)) { return 0; } @@ -2383,7 +2332,7 @@ _IconListPresenter::GetMagneticScrollPosition(void) const } else { - if (scrollPosition < __leftMargin) + if (!_FloatCompareGE(scrollPosition, __leftMargin)) { return 0; } @@ -2391,29 +2340,29 @@ _IconListPresenter::GetMagneticScrollPosition(void) const scrollPosition -= __leftMargin; } - int unitMagneticScrollSize = __unitScrollLength * __magneticScrollSize; - scrollPosition %= unitMagneticScrollSize; - if (scrollPosition > leftScrollLength) + float unitMagneticScrollSize = __unitScrollLength * __magneticScrollSize; + float leftMagneticScrollPosition = scrollPosition - (static_cast (scrollPosition / unitMagneticScrollSize) * unitMagneticScrollSize); + if (!_FloatCompareLE(leftMagneticScrollPosition, leftScrollLength)) { scrollPosition = __scrollLength + OVERSCROLLING_MAX_DISTANCE; } - else if (scrollPosition > (unitMagneticScrollSize >> 1)) + else if (!_FloatCompareLE(leftMagneticScrollPosition, unitMagneticScrollSize / 2)) { - scrollPosition = __scrollPosition - scrollPosition + unitMagneticScrollSize; + scrollPosition = scrollPosition - leftMagneticScrollPosition + unitMagneticScrollSize; } else { - scrollPosition = __scrollPosition - scrollPosition; + scrollPosition = scrollPosition - leftMagneticScrollPosition; } return scrollPosition; } -Rectangle +FloatRectangle _IconListPresenter::GetItemBounds(int index) const { // Absolute Coordinate Base - Rectangle rect(0, 0, GetItemSize().width, GetItemSize().height); + FloatRectangle rect(0.0f, 0.0f, GetItemSize().width, GetItemSize().height); if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { rect.x = __startPosOfAxis + __unitLengthOfAxis * (index % __itemCountPerAxis); @@ -2428,6 +2377,12 @@ _IconListPresenter::GetItemBounds(int index) const return rect; } +int +_IconListPresenter::CalculateFlickAmount(int distance, int duration) +{ + return ((((distance * SCROLL_FLICK_IN_PIXEL_UNIT) / duration) * SCROLL_FLICK_WEIGHT_VELOCITY) + (distance * SCROLL_FLICK_WEIGHT_DISTANCE)) / SCROLL_FLICK_ALPHA_PER_PIXEL; +} + void _IconListPresenter::InitializeAccessibilityElement(void) { @@ -2443,19 +2398,17 @@ _IconListPresenter::InitializeAccessibilityElement(void) int endIndex = INVALID_INDEX; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - int firstLine = (__scrollPosition > __topMargin) ? - (__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength : 0; + int firstLine = !_FloatCompareLE(__scrollPosition, __topMargin) ? static_cast (__scrollPosition - __topMargin + __verticalSpacing) / __unitScrollLength : 0; firstIndex = firstLine * __itemCountPerAxis; - endIndex = firstIndex + ((__pIconListView->GetBounds().height + __verticalSpacing) / __unitScrollLength) * __itemCountPerAxis; + endIndex = firstIndex + (static_cast (__pIconListView->GetBounds().height + __verticalSpacing) / __unitScrollLength) * __itemCountPerAxis; } else { - int firstLine = (__scrollPosition > __leftMargin) ? - (__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength : 0; + int firstLine = !_FloatCompareLE(__scrollPosition, __leftMargin) ? static_cast (__scrollPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength : 0; firstIndex = firstLine * __itemCountPerAxis; - endIndex = firstIndex + ((__pIconListView->GetBounds().width + __horizontalSpacing) / __unitScrollLength) * __itemCountPerAxis; + endIndex = firstIndex + (static_cast (__pIconListView->GetBounds().width + __horizontalSpacing) / __unitScrollLength) * __itemCountPerAxis; } endIndex = itemCount > endIndex ? endIndex : (itemCount - 1); @@ -2468,16 +2421,14 @@ _IconListPresenter::InitializeAccessibilityElement(void) _VisualElement* pVE = pItem->GetItemVisualElement(); if (pVE != null) { - FloatRectangle floatRectangle = pVE->GetBounds(); - Rectangle rect(floatRectangle.x, floatRectangle.y, floatRectangle.width, floatRectangle.height); - AddAccessibilityElement(*pItem, rect); + AddAccessibilityElement(*pItem, pVE->GetBounds()); } } } } void -_IconListPresenter::AddAccessibilityElement(_IconListItem& item, const Tizen::Graphics::Rectangle& rect) +_IconListPresenter::AddAccessibilityElement(_IconListItem& item, const FloatRectangle& rect) { if (likely(!(_AccessibilityManager::IsActivated()))) { @@ -2488,11 +2439,11 @@ _IconListPresenter::AddAccessibilityElement(_IconListItem& item, const Tizen::Gr if (pContainer != null) { _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, (pElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allocation failed."); + SysTryReturnVoidResult(NID_UI_CTRL, (pElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pElement->SetLabel(item.GetText()); pElement->SetTrait(ACCESSIBILITY_TRAITS_IMAGE); pElement->SetValue(item.IsChecked() ? L"selected" : L""); - pElement->SetBounds(rect); + pElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(rect)); pContainer->AddElement(*pElement); } } @@ -2513,58 +2464,58 @@ _IconListPresenter::RemoveAllAccessibilityElements(void) } void -_IconListPresenter::TranslateIconListItemPosition(int& x, int& y) +_IconListPresenter::TranslateIconListItemPosition(float& x, float& y) { - if (__unitLengthOfAxis <= 0 || __unitScrollLength <= 0) + if (_FloatCompareLE(__unitLengthOfAxis, 0.0f) || _FloatCompareLE(__unitScrollLength, 0.0f)) { - x = -1; - y = -1; + x = -1.0f; + y = -1.0f; return; } if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { x -= __startPosOfAxis; - if (x < 0) + if (!_FloatCompareGE(x, 0.0f)) { - x = -1; - y = -1; + x = -1.0f; + y = -1.0f; return; } - x = x % __unitLengthOfAxis; + x = x - static_cast (x / __unitLengthOfAxis) * __unitLengthOfAxis; y += __scrollPosition - __topMargin; - if (y < 0) + if (!_FloatCompareGE(y, 0.0f)) { - x = -1; - y = -1; + x = -1.0f; + y = -1.0f; return; } - y = y % __unitScrollLength; + y = y - static_cast (y / __unitScrollLength) * __unitScrollLength; } else { y -= __startPosOfAxis; - if (y < 0) + if (!_FloatCompareGE(y, 0.0f)) { - x = -1; - y = -1; + x = -1.0f; + y = -1.0f; return; } - y = y % __unitLengthOfAxis; + y = y - static_cast (y - __unitLengthOfAxis) * __unitLengthOfAxis; x += __scrollPosition - __leftMargin; - if (x < 0) + if (!_FloatCompareGE(x, 0.0f)) { - x = -1; - y = -1; + x = -1.0f; + y = -1.0f; return; } - x = x % __unitScrollLength; + x = x - static_cast (x / __unitScrollLength) * __unitScrollLength; } } @@ -2576,7 +2527,8 @@ _IconListPresenter::StartSelectionAnimationTimer(void) if (__pSelectionAnimationTimer == null) { __pSelectionAnimationTimer = new (std::nothrow) Timer; - SysTryReturn(NID_UI_CTRL, (__pSelectionAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allocation failed."); + SysTryReturn(NID_UI_CTRL, (__pSelectionAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, + "[E_OUT_OF_MEMORY] Memory allocation failed."); r = __pSelectionAnimationTimer->Construct(*this); SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -2628,7 +2580,7 @@ _IconListPresenter::StartCheckAnimationTimer(void) if (__pCheckAnimationTimer == null) { __pCheckAnimationTimer = new (std::nothrow) Timer; - SysTryReturn(NID_UI_CTRL, (__pCheckAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allocation failed."); + SysTryReturn(NID_UI_CTRL, (__pCheckAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); r = __pCheckAnimationTimer->Construct(*this); SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -2701,48 +2653,6 @@ _IconListPresenter::ResetTouchActionTimer(void) } result -_IconListPresenter::StartFlickAnimationTimer(void) -{ - result r = E_SUCCESS; - - if (__pFlickAnimationTimer == null) - { - __pFlickAnimationTimer = new (std::nothrow) Timer; - SysTryReturn(NID_UI_CTRL, (__pFlickAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = __pFlickAnimationTimer->Construct(*this); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - } - else - { - __pFlickAnimationTimer->Cancel(); - } - - r = __pFlickAnimationTimer->Start(FLICK_ANIMATION_TIMER_PERIOD); - SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - return r; - -CATCH: - ResetFlickAnimationTimer(); - return r; -} - -result -_IconListPresenter::ResetFlickAnimationTimer(void) -{ - if (__pFlickAnimationTimer != null) - { - FireScrollStoppedEvent(); - } - - delete __pFlickAnimationTimer; - __pFlickAnimationTimer = null; - - return E_SUCCESS; -} - -result _IconListPresenter::StartMagneticScrollTimer(void) { result r = E_SUCCESS; @@ -2874,7 +2784,7 @@ _IconListPresenter::OnBoundsChanged(void) } void -_IconListPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_IconListPresenter::OnFontInfoRequested(unsigned long& style, float& size) { style = FONT_STYLE_PLAIN; @@ -2948,9 +2858,9 @@ _IconListPresenter::OnPreviewTouchReleased(const _Control& source, const _TouchI if (pScroll != null && pScroll->IsEnabledHandler()) { // Trigger Magnetic Scroll Effect - if ((__pMagneticScrollTimer == null) && (__pFlickAnimationTimer == null) && (__magneticScrollSize > 0)) + if ((__pMagneticScrollTimer == null) && (!__flickRunning) && (__magneticScrollSize > 0)) { - int diff = GetMagneticScrollPosition() - __scrollPosition; + float diff = GetMagneticScrollPosition() - __scrollPosition; if (diff != 0) { ResetMagneticScrollTimer(); @@ -2965,7 +2875,7 @@ _IconListPresenter::OnPreviewTouchReleased(const _Control& source, const _TouchI } } - if ((__pMagneticScrollTimer == null) && (__pFlickAnimationTimer == null)) + if ((__pMagneticScrollTimer == null) && (!__flickRunning)) { ScrollFadeOut(); } @@ -2985,18 +2895,19 @@ _IconListPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& tou _Scroll* pScroll = __pIconListView->GetScroll(); if (pScroll != null) { - int scrollPosition = pScroll->GetScrollPosition(); - if (scrollPosition != __scrollPosition) + float scrollPosition = pScroll->GetScrollPosition(); + if (!_FloatCompare(scrollPosition, __scrollPosition)) { pScroll->SetScrollPosition(__scrollPosition); } } + StopAllAnimations(); + // Reset Timer ResetAnimationTimer(); ResetSelectionAnimationTimer(); ResetTouchActionTimer(); - ResetFlickAnimationTimer(); ResetMagneticScrollTimer(); ResetCheckAnimationTimer(); @@ -3009,18 +2920,19 @@ bool _IconListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { __isTouchPressed = false; + __firstTouchMove = true; if (__onReordering) { FinishReordering(); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_LIST_REORDER); } else { - Point touchPressedPosition = touchinfo.GetCurrentPosition(); if (__selectedIndex >= 0) { - __isSelectionDelayed = true; - StartSelectionAnimationTimer(); + __isSelectionDelayed = false; + ProcessAfterTouchRelease(__selectedIndex); } else if (__pTouchActionTimer != null) { @@ -3030,13 +2942,14 @@ _IconListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to __isSelectionDelayed = true; StartSelectionAnimationTimer(); } + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); } // Trigger Magnetic Scroll Effect - if ((__pMagneticScrollTimer == null) && (__pFlickAnimationTimer == null) && (__magneticScrollSize > 0)) + if ((__pMagneticScrollTimer == null) && (!__flickRunning) && (__magneticScrollSize > 0)) { - int diff = GetMagneticScrollPosition() - __scrollPosition; - if (diff != 0) + float diff = GetMagneticScrollPosition() - __scrollPosition; + if (!_FloatCompare(diff, 0.0f)) { ResetMagneticScrollTimer(); @@ -3050,7 +2963,7 @@ _IconListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to } } - if ((__pMagneticScrollTimer == null) && (__pFlickAnimationTimer == null)) + if ((__pMagneticScrollTimer == null) && (!__flickRunning)) { if (__pIconListView->GetScroll()->GetScrollVisibility()) { @@ -3256,14 +3169,13 @@ _IconListPresenter::FireEventAfterTouchRelease(int index) bool _IconListPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - const Point movedPosition = touchinfo.GetCurrentPosition(); + const FloatPoint movedPosition = touchinfo.GetCurrentPosition(); if (__pTouchActionTimer != null) { ResetAnimationTimer(); ResetSelectionAnimationTimer(); ResetTouchActionTimer(); - ResetFlickAnimationTimer(); ResetCheckAnimationTimer(); int revertIndex = __selectedIndex; @@ -3278,7 +3190,7 @@ _IconListPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return true; } - Point pressedPosition = __currentTouchInfo.GetCurrentPosition(); + FloatPoint pressedPosition = __currentTouchInfo.GetCurrentPosition(); if (__onReordering) { @@ -3286,7 +3198,57 @@ _IconListPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touch return true; } - int scrollPosition = __scrollPosition; + if (__pIconListView->GetScrollInputMode() == SCROLL_INPUT_MODE_RESTRICT_TO_INITIAL_DIRECTION) + { + float scrollDistanceX = _Abs(pressedPosition.x - movedPosition.x); + float scrollDistanceY = _Abs(pressedPosition.y - movedPosition.y); + + bool isVerticalDirection = scrollDistanceY > scrollDistanceX; + bool isHorizontalDirection = scrollDistanceX > scrollDistanceY; + + if (__firstTouchMove) + { + if (isVerticalDirection) + { + __firstTouchMoveDirection = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL; + } + else if (isHorizontalDirection) + { + __firstTouchMoveDirection = ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL; + } + else + { + __firstTouchMoveDirection = __scrollDirection; + } + __firstTouchMove = false; + } + + if (__scrollDirection != __firstTouchMoveDirection) + { + if (__firstTouchMoveDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL && !isHorizontalDirection) + { + return false; + } + else if (__firstTouchMoveDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL && !isVerticalDirection) + { + return false; + } + return true; + } + else + { + if (__firstTouchMoveDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL && isHorizontalDirection) + { + return true; + } + else if (__firstTouchMoveDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL && isVerticalDirection) + { + return true; + } + } + } + + float scrollPosition = __scrollPosition; _Scroll* pScroll = __pIconListView->GetScroll(); if (pScroll != null) @@ -3337,7 +3299,7 @@ _IconListPresenter::OnTouchActionActivated(const _Control& source, const _TouchI } else { - Point touchPressedPosition = touchinfo.GetCurrentPosition(); + FloatPoint touchPressedPosition = touchinfo.GetCurrentPosition(); int index = GetItemIndexFromPosition(touchPressedPosition); if (index >= 0 && __pListModel->IsItemEnabled(DEFAULT_GROUP_INDEX, index)) { @@ -3349,7 +3311,7 @@ _IconListPresenter::OnTouchActionActivated(const _Control& source, const _TouchI pItem->SetDrawingProperty(*__pItemDrawingProperty); TranslateIconListItemPosition(touchPressedPosition.x, touchPressedPosition.y); - if (touchPressedPosition.x >= 0 && touchPressedPosition.y >= 0) + if (_FloatCompareGE(touchPressedPosition.x, 0.0f) && _FloatCompareGE(touchPressedPosition.y, 0.0f)) { __selectedOverlayBitmapId = pItem->GetOverlayBitmapIdFromPosition(touchPressedPosition); } @@ -3365,24 +3327,24 @@ _IconListPresenter::OnTouchActionActivated(const _Control& source, const _TouchI __isTouchAnimationEnabled = true; } } - } - return true; } bool _IconListPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) { + StopScrollToAnimation(); + ResetAnimationTimer(); ResetSelectionAnimationTimer(); ResetTouchActionTimer(); - ResetFlickAnimationTimer(); ResetMagneticScrollTimer(); ResetReorderScrollTimer(); ResetCheckAnimationTimer(); __isTouchPressed = false; + __firstTouchMove = true; ScrollFadeOut(); return true; @@ -3393,91 +3355,73 @@ _IconListPresenter::OnFlickGestureDetected(bool isFlicked, const Point& flickPos { if (isFlicked) { - int velX = 0; - int velY = 0; - int moveX = 0; - int moveY = 0; - int scrollPosition = __pIconListView->GetScroll()->GetScrollPosition(); - if (flickTime < MINIMUM_FLICK_EFFECT_TIME) - { - flickTime = MINIMUM_FLICK_EFFECT_TIME; - } + StopAllAnimations(); - __flickAnimation.SetAlignInformation(__unitScrollLength, __unitScrollLength); + ResetAnimationTimer(); + ResetSelectionAnimationTimer(); + ResetTouchActionTimer(); + ResetMagneticScrollTimer(); + ResetCheckAnimationTimer(); + + __flickRunning = true; + + float targetPosition = __scrollPosition; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL && flickPosition.y != 0) { - __flickAnimation.CalculateInitializeVelocity(0, flickPosition.y, flickTime, &velX, &velY); - __flickAnimation.InitializeFlickAmount(velY); - __flickAnimation.CalculateNextMove(&moveX, &moveY); - scrollPosition -= moveY; + targetPosition -= CalculateFlickAmount(flickPosition.y, flickTime); } else if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_HORIZONTAL && flickPosition.x != 0) { - __flickAnimation.CalculateInitializeVelocity(flickPosition.x, 0, flickTime, &velX, &velY); - __flickAnimation.InitializeFlickAmount(velX); - __flickAnimation.CalculateNextMove(&moveX, &moveY); - scrollPosition -= moveX; + targetPosition -= CalculateFlickAmount(flickPosition.x, flickTime); } // 3-flicking move to top or bottom if (__flickCount >= (NEEDED_FLICK_COUNT_FOR_FINGER_FASTSCROLL - 1)) { - if ((__scrollPosition < scrollPosition) && __isFlickDown) + if (!_FloatCompareGE(__scrollPosition, targetPosition) && __isFlickDown) { __flickCount = 0; - ResetAnimationTimer(); - ResetSelectionAnimationTimer(); - ResetTouchActionTimer(); - ResetMagneticScrollTimer(); - ResetFlickAnimationTimer(); - ResetCheckAnimationTimer(); - - __magneticScrollAnimation.StartAnimation(__scrollLength + OVERSCROLLING_MAX_DISTANCE - __scrollPosition); - StartMagneticScrollTimer(); + + StartScrollToAnimation(__scrollLength + OVERSCROLLING_MAX_DISTANCE); return true; } - else if ((__scrollPosition > scrollPosition) && !__isFlickDown) + else if (!_FloatCompareLE(__scrollPosition, targetPosition) && !__isFlickDown) { __flickCount = 0; - ResetAnimationTimer(); - ResetSelectionAnimationTimer(); - ResetTouchActionTimer(); - ResetMagneticScrollTimer(); - ResetFlickAnimationTimer(); - ResetCheckAnimationTimer(); - - __magneticScrollAnimation.StartAnimation((-1 * OVERSCROLLING_MAX_DISTANCE) - __scrollPosition); - StartMagneticScrollTimer(); + + StartScrollToAnimation((OVERSCROLLING_MAX_DISTANCE * -1)); return true; } } - int oldScrollPosition = __scrollPosition; - if (SetScrollPosition(scrollPosition)) + if (_FloatCompareLE(targetPosition, OVERSCROLLING_MAX_DISTANCE * -1)) { - if (((oldScrollPosition < __scrollPosition) && __isFlickDown) || - ((oldScrollPosition > __scrollPosition) && !__isFlickDown)) - { - __flickCount++; - } - else - { - __flickCount = 1; - __isFlickDown = !__isFlickDown; - } - - ResetAnimationTimer(); - ResetSelectionAnimationTimer(); - ResetTouchActionTimer(); - ResetMagneticScrollTimer(); - ResetCheckAnimationTimer(); - StartFlickAnimationTimer(); - __pIconListView->Invalidate(); - - FireScrollPositionChangedEvent(__scrollPosition); + targetPosition = (OVERSCROLLING_MAX_DISTANCE * -1); + } + else if (_FloatCompareGE(targetPosition, __scrollLength + OVERSCROLLING_MAX_DISTANCE)) + { + targetPosition = (__scrollLength + OVERSCROLLING_MAX_DISTANCE); + } + else if (__magneticScrollSize > 0) + { + targetPosition = GetMagneticScrollPosition(targetPosition); + } - return true; + if (_FloatCompareLE(__scrollPosition,targetPosition) && __isFlickDown) + { + __flickCount++; + } + else if (_FloatCompareGE(__scrollPosition, targetPosition) && !__isFlickDown) + { + __flickCount++; + } + else + { + __isFlickDown = !__isFlickDown; + __flickCount = 1; } + + StartScrollToAnimation(targetPosition); } return true; } @@ -3520,13 +3464,9 @@ _IconListPresenter::OnTimerExpired(Timer& timer) { OnTouchActionActivated(*__pIconListView, __currentTouchInfo); } - else if (&timer == __pFlickAnimationTimer) - { - StartFlickAnimation(); - } else if (&timer == __pMagneticScrollTimer) { - int scrollPosition = 0; + float scrollPosition = 0.0f; if (__magneticScrollAnimation.GetMagneticScrollAnimationFrame(scrollPosition)) { scrollPosition += __pIconListView->GetScroll()->GetScrollPosition(); @@ -3542,7 +3482,7 @@ _IconListPresenter::OnTimerExpired(Timer& timer) { ResetMagneticScrollTimer(); - if (__pFlickAnimationTimer == null) + if (!__flickRunning) { ScrollFadeOut(); FireScrollEvent(); @@ -3582,63 +3522,9 @@ _IconListPresenter::OnTimerExpired(Timer& timer) } void -_IconListPresenter::StartFlickAnimation(void) -{ - int moveX = 0; - int moveY = 0; - int movement = 0; - int scrollPosition = __pIconListView->GetScroll()->GetScrollPosition(); - - __flickAnimation.CalculateNextMove(&moveX, &moveY); - if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) - { - scrollPosition -= moveY; - movement = moveY; - } - else - { - scrollPosition -= moveX; - movement = moveX; - } - - if (SetScrollPosition(scrollPosition)) - { - if ((scrollPosition <= (OVERSCROLLING_MAX_DISTANCE * -1)) || - (scrollPosition >= (__scrollLength + OVERSCROLLING_MAX_DISTANCE)) || - ((movement <= 1) && (movement >= -1))) - { - ResetFlickAnimationTimer(); - __flickCount = 0; - - if (__magneticScrollSize > 0) - { - __magneticScrollAnimation.StartAnimation(GetMagneticScrollPosition() - __scrollPosition); - StartMagneticScrollTimer(); - } - else - { - ScrollFadeOut(); - - // Trigger ScrollEvent - FireScrollEvent(); - FireScrollStoppedEvent(); - } - } - else - { - StartFlickAnimationTimer(); - - __pIconListView->Invalidate(); - FireScrollPositionChangedEvent(__scrollPosition); - } - } -} - -void _IconListPresenter::StartReorderScrollAnimation(void) { - - int scrollPosition = __scrollPosition; + float scrollPosition = __scrollPosition; scrollPosition += __reorderScrollAnimationDistance; if (SetScrollPosition(scrollPosition)) @@ -3646,7 +3532,7 @@ _IconListPresenter::StartReorderScrollAnimation(void) __pIconListView->Invalidate(); FireScrollPositionChangedEvent(__scrollPosition); - if (__scrollPosition > 0 && __scrollPosition < __scrollLength) + if (!_FloatCompareLE(__scrollPosition, 0.0f) && !_FloatCompareGE(__scrollPosition, __scrollLength)) { StartReorderScrollTimer(); } @@ -3656,9 +3542,10 @@ _IconListPresenter::StartReorderScrollAnimation(void) void _IconListPresenter::OnVisibleStateChanged(void) { + StopScrollToAnimation(); + ResetAnimationTimer(); ResetSelectionAnimationTimer(); - ResetFlickAnimationTimer(); ResetTouchActionTimer(); ResetMagneticScrollTimer(); ResetReorderScrollTimer(); @@ -3674,14 +3561,11 @@ _IconListPresenter::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_IconListPresenter::OnScrollPositionChanged(_Control& source, int scrollPos) +_IconListPresenter::OnScrollPositionChanged(_Control& source, float scrollPosition) { - if (__pFlickAnimationTimer != null) - { - ResetFlickAnimationTimer(); - } + StopScrollToAnimation(); - if (SetScrollPosition(scrollPos)) + if (SetScrollPosition(scrollPosition)) { __flickCount = 0; __selectedIndex = INVALID_INDEX; @@ -3699,6 +3583,22 @@ _IconListPresenter::OnScrollStopped(_Control& source) InitializeAccessibilityElement(); } +void +_IconListPresenter::OnScrollJumpToTop(_Control& source) +{ + StopScrollToAnimation(); + + if (SetScrollPosition(0.0f)) + { + __flickCount = 0; + __selectedIndex = INVALID_INDEX; + __pIconListView->Invalidate(); + + ScrollFadeOut(); + FireScrollEvent(); + } +} + // Tizen::Ui::Animations::IAnimationTransactionEventListener void _IconListPresenter::OnAnimationTransactionStarted(int transactionId) @@ -3769,6 +3669,61 @@ _IconListPresenter::OnAnimationTransactionFinished(int transactionId) } } +// Tizen::Ui::Animations::IVisualElementAnimationTickEventListener +void +_IconListPresenter::OnTickOccurred(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, const Variant& currentValue) +{ + if (&target != __pIconListView->GetVisualElement()) + { + return; + } + + if (keyName == L"ScrollAnimation") + { + if (SetScrollPosition(currentValue.ToFloat())) + { + __pIconListView->Invalidate(); + FireScrollEvent(); + } + FireScrollPositionChangedEvent(__scrollPosition); + } +} + +// Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener +void +_IconListPresenter::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ + // nothing +} + +void +_IconListPresenter::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ + // nothing +} + +void +_IconListPresenter::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + if (&target != __pIconListView->GetVisualElement()) + { + return; + } + + if (keyName == L"ScrollAnimation") + { + if (completedNormally) + { + __flickCount = 0; + } + + __flickRunning = false; + ScrollFadeOut(); + FireScrollPositionChangedEvent(__scrollPosition); + FireScrollStoppedEvent(); + } +} + void _IconListPresenter::PrepareReordering(void) { @@ -3807,7 +3762,7 @@ _IconListPresenter::PrepareReordering(void) } void -_IconListPresenter::DoReordering(const Point& movedPosition) +_IconListPresenter::DoReordering(const FloatPoint& movedPosition) { if (__pListModel->IsValidItem(DEFAULT_GROUP_INDEX, __reorderToIndex)) { @@ -3824,16 +3779,17 @@ _IconListPresenter::DoReordering(const Point& movedPosition) if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - if (movedPosition.y < __topMargin) + if (!_FloatCompareGE(movedPosition.y, __topMargin)) { __reorderScrollAnimationDistance = -REORDER_SCROLL_ANIMATION_DISTANCE; - if (__pReorderScrollTimer == null && __scrollPosition > 0) + if (__pReorderScrollTimer == null && !_FloatCompareLE(__scrollPosition, 0.0f)) { __scrollPositionBeforeScrollAnimation = __scrollPosition; StartReorderScrollTimer(); } } - else if ((movedPosition.y + __lastReorderedDifferences.y) > __pIconListView->GetBounds().height - __bottomMargin && __scrollPosition < __scrollLength) + else if (!_FloatCompareLE(movedPosition.y + __lastReorderedDifferences.y, __pIconListView->GetBounds().height - __bottomMargin) && + !_FloatCompareGE(__scrollPosition, __scrollLength)) { __reorderScrollAnimationDistance = REORDER_SCROLL_ANIMATION_DISTANCE; if (__pReorderScrollTimer == null) @@ -3851,8 +3807,8 @@ _IconListPresenter::DoReordering(const Point& movedPosition) else { ResetReorderScrollTimer(); - int diff = __scrollPositionBeforeScrollAnimation - __scrollPosition; - int rowCount = diff / __unitScrollLength; + float diff = __scrollPositionBeforeScrollAnimation - __scrollPosition; + int rowCount = static_cast (diff / __unitScrollLength); int index = __reorderToIndex - rowCount * __itemCountPerAxis; __reorderItemBounds.y += diff; SwapReorderedItems(index, false); @@ -3862,7 +3818,7 @@ _IconListPresenter::DoReordering(const Point& movedPosition) } else { - if (movedPosition.x < __leftMargin && __scrollPosition > 0) + if (!_FloatCompareGE(movedPosition.x, __leftMargin) && !_FloatCompareLE(__scrollPosition, 0.0f)) { __reorderScrollAnimationDistance = -REORDER_SCROLL_ANIMATION_DISTANCE; if (__pReorderScrollTimer == null) @@ -3871,7 +3827,8 @@ _IconListPresenter::DoReordering(const Point& movedPosition) StartReorderScrollTimer(); } } - else if ((movedPosition.x + __lastReorderedDifferences.x) > __pIconListView->GetBounds().width - __rightMargin && __scrollPosition < __scrollLength) + else if (!_FloatCompareLE(movedPosition.x + __lastReorderedDifferences.x, __pIconListView->GetBounds().width - __rightMargin) && + !_FloatCompareGE(__scrollPosition, __scrollLength)) { __reorderScrollAnimationDistance = REORDER_SCROLL_ANIMATION_DISTANCE; if (__pReorderScrollTimer == null) @@ -3889,8 +3846,8 @@ _IconListPresenter::DoReordering(const Point& movedPosition) else { ResetReorderScrollTimer(); - int diff = __scrollPositionBeforeScrollAnimation - __scrollPosition; - int rowCount = diff / __unitScrollLength; + float diff = __scrollPositionBeforeScrollAnimation - __scrollPosition; + int rowCount = static_cast (diff / __unitScrollLength); int index = __reorderToIndex - rowCount * __itemCountPerAxis; __reorderItemBounds.x += diff; SwapReorderedItems(index, false); @@ -3904,7 +3861,7 @@ _IconListPresenter::DoReordering(const Point& movedPosition) } void -_IconListPresenter::CheckAndReorderItem(int movedX, int movedY) +_IconListPresenter::CheckAndReorderItem(float movedX, float movedY) { bool toUp = false; bool toDown = false; @@ -3913,12 +3870,12 @@ _IconListPresenter::CheckAndReorderItem(int movedX, int movedY) bool singleItemChanged = true; - int horizontalThreshold = (GetItemSize().width + __verticalSpacing) / 2; - int verticalThreshold = (GetItemSize().height + __verticalSpacing) / 2; + float horizontalThreshold = (GetItemSize().width + __verticalSpacing) / 2; + float verticalThreshold = (GetItemSize().height + __verticalSpacing) / 2; - if (Math::Abs(movedX) > horizontalThreshold) + if (!_FloatCompareLE(_Abs(movedX), horizontalThreshold)) { - if (movedX > 0) + if (!_FloatCompareLE(movedX, 0.0f)) { toRight = true; } @@ -3928,9 +3885,9 @@ _IconListPresenter::CheckAndReorderItem(int movedX, int movedY) } } - if (Math::Abs(movedY) > verticalThreshold) + if (!_FloatCompareLE(_Abs(movedY), verticalThreshold)) { - if (movedY > 0) + if (!_FloatCompareLE(movedY, 0.0f)) { toDown = true; } @@ -4059,9 +4016,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged) FloatRectangle bounds = pToItemVE->GetBounds(); if (bounds.IsEmpty()) { - Rectangle rect = GetItemBounds(toIndex); - bounds.SetPosition(rect.x, rect.y); - bounds.SetSize(rect.width, rect.height); + bounds = GetItemBounds(toIndex); pToItemVE->SetImplicitAnimationEnabled(false); pToItemVE->SetBounds(bounds); @@ -4093,9 +4048,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged) FloatRectangle temp = pToTempItemVE->GetBounds(); if (temp.IsEmpty()) { - Rectangle rect = GetItemBounds(i + 1); - temp.SetPosition(rect.x, rect.y); - temp.SetSize(rect.width, rect.height); + temp = GetItemBounds(i + 1); pToTempItemVE->SetImplicitAnimationEnabled(false); pToTempItemVE->SetBounds(temp); @@ -4106,9 +4059,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged) tempBounds = pToItemVE->GetBounds(); if (tempBounds.IsEmpty()) { - Rectangle rect = GetItemBounds(toIndex); - tempBounds.SetPosition(rect.x, rect.y); - tempBounds.SetSize(rect.width, rect.height); + tempBounds = GetItemBounds(toIndex); pToItemVE->SetImplicitAnimationEnabled(false); pToItemVE->SetBounds(tempBounds); @@ -4142,9 +4093,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged) FloatRectangle temp = pToTempItemVE->GetBounds(); if (temp.IsEmpty()) { - Rectangle rect = GetItemBounds(i - 1); - temp.SetPosition(rect.x, rect.y); - temp.SetSize(rect.width, rect.height); + temp = GetItemBounds(i - 1); pToTempItemVE->SetImplicitAnimationEnabled(false); pToTempItemVE->SetBounds(temp); @@ -4155,9 +4104,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged) tempBounds = pToItemVE->GetBounds(); if (tempBounds.IsEmpty()) { - Rectangle rect = GetItemBounds(toIndex); - tempBounds.SetPosition(rect.x, rect.y); - tempBounds.SetSize(rect.width, rect.height); + tempBounds = GetItemBounds(toIndex); pToItemVE->SetImplicitAnimationEnabled(false); pToItemVE->SetBounds(tempBounds); @@ -4189,7 +4136,7 @@ _IconListPresenter::FinishReordering(void) if (__reorderFromIndex != __reorderToIndex) { FireIconListViewItemEvent(EVENT_TYPE_ITEM_REORDERED , __reorderFromIndex, __reorderToIndex); - for (int i = Math::Min(__reorderFromIndex, __reorderToIndex); i <= Math::Max(__reorderFromIndex, __reorderToIndex); i++) + for (int i = _Min(__reorderFromIndex, __reorderToIndex); i <= _Max(__reorderFromIndex, __reorderToIndex); i++) { RedrawItem(i); } @@ -4209,11 +4156,35 @@ _IconListPresenter::ClearReorderingInformation(void) __onReordering = false; __reorderFromIndex = INVALID_INDEX; __reorderToIndex = INVALID_INDEX; - __reorderItemBounds.SetBounds(0, 0, 0, 0); + __reorderItemBounds.SetBounds(0.0f, 0.0f, 0.0f, 0.0f); } // visual interaction animation void +_IconListPresenter::StartScrollToAnimation(float targetPosition) +{ + __pVE->RemoveAnimation(L"ScrollAnimation"); + + VisualElementValueAnimation* pScrollingAnimation = __pIconListView->GetScrollingAnimation(); + pScrollingAnimation->SetStartValue(Variant(__scrollPosition)); + pScrollingAnimation->SetEndValue(Variant(targetPosition)); + pScrollingAnimation->SetDuration(FLICK_ANIMATION_DURATION); + __pVE->AddAnimation(L"ScrollAnimation", *pScrollingAnimation); +} + +void +_IconListPresenter::StopScrollToAnimation(void) +{ + __pVE->RemoveAnimation(L"ScrollAnimation"); +} + +void +_IconListPresenter::StopAllAnimations(void) +{ + __pVE->RemoveAllAnimations(); +} + +void _IconListPresenter::AddAnimation(_IconListItem& item, int index, int delay) { _VisualElement* pVE = item.GetItemVisualElement(); @@ -4221,9 +4192,8 @@ _IconListPresenter::AddAnimation(_IconListItem& item, int index, int delay) { pVE->SetImplicitAnimationEnabled(false); - Rectangle rect = GetItemBounds(index); - FloatRectangle endRect(rect.x, rect.y, rect.width, rect.height); - FloatRectangle startRect = FloatRectangle(endRect.x + (endRect.width * 0.15f), endRect.y + (endRect.height * 0.15f), endRect.width * 0.7f, endRect.height * 0.7f); + FloatRectangle endRect(GetItemBounds(index)); + FloatRectangle startRect(endRect.x + (endRect.width * 0.15f), endRect.y + (endRect.height * 0.15f), endRect.width * 0.7f, endRect.height * 0.7f); pVE->SetBounds(endRect); @@ -4265,7 +4235,7 @@ _IconListPresenter::AddAnimation(_IconListItem& item, int index, int delay) delete pScaleAnimation; pVE->SetImplicitAnimationEnabled(true); - item.DrawItem(rect, LIST_ITEM_STATE_NORMAL); + item.DrawItem(endRect, LIST_ITEM_STATE_NORMAL); pVE->SetImplicitAnimationEnabled(false); AnimationTransaction::Commit(); @@ -4310,7 +4280,7 @@ _IconListPresenter::RemoveAnimation(_IconListItem& item, int index) pCanvas->Clear(); pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); - r = pItemVE->Capture(*pCanvas, FloatRectangle(0, 0, startRect.width, startRect.height), false); + r = pItemVE->Capture(*pCanvas, FloatRectangle(0.0f, 0.0f, startRect.width, startRect.height), false); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); delete pCanvas; @@ -4388,6 +4358,12 @@ _IconListPresenter::MoveAnimation(_IconListItem& item, FloatRectangle& bounds, i void _IconListPresenter::MoveAnimation(_IconListItem& item, FloatRectangle& startBounds, FloatRectangle& endBounds, int delay) { + if (!item.IsDrawn()) + { + item.SetDrawingProperty(*__pItemDrawingProperty); + item.DrawItem(startBounds, LIST_ITEM_STATE_NORMAL); + } + _VisualElement* pVE = item.GetItemVisualElement(); if (pVE != null) { @@ -4411,7 +4387,6 @@ _IconListPresenter::MoveAnimation(_IconListItem& item, FloatRectangle& startBoun pVE->AddAnimation(moveAnimationName, *pMoveAnimation); delete pMoveAnimation; } - } void @@ -4487,12 +4462,12 @@ _IconListPresenter::MoveForward(int index) int bottomLine = 0; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - int bottomPosition = __scrollPosition + __pIconListView->GetBounds().height; + float bottomPosition = __scrollPosition + __pIconListView->GetBounds().height; bottomLine = (bottomPosition - __topMargin + __verticalSpacing) / __unitScrollLength; } else { - int bottomPosition = __scrollPosition + __pIconListView->GetBounds().width; + float bottomPosition = __scrollPosition + __pIconListView->GetBounds().width; bottomLine = (bottomPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength; } @@ -4515,13 +4490,13 @@ _IconListPresenter::MoveForward(int index) AnimationTransaction::Begin(__moveTransactionId); - Rectangle startRect; - Rectangle endRect; + FloatRectangle startBounds; + FloatRectangle endBounds; for (int i = startIndex; i <= endIndex; i++) { - startRect = GetItemBounds(i); - endRect = GetItemBounds(i - 1); - if (!endRect.IsEmpty() && !startRect.IsEmpty()) + startBounds = GetItemBounds(i); + endBounds = GetItemBounds(i - 1); + if (!endBounds.IsEmpty() && !startBounds.IsEmpty()) { pItem = static_cast<_IconListItem*>(__pListModel->LoadItem(DEFAULT_GROUP_INDEX, i)); if (pItem != null) @@ -4529,14 +4504,11 @@ _IconListPresenter::MoveForward(int index) pItemVE = pItem->GetItemVisualElement(); if (pItemVE != null) { - FloatRectangle originalBounds(startRect.x, startRect.y, startRect.width, startRect.height); - FloatRectangle moveToBounds(endRect.x, endRect.y, endRect.width, endRect.height); - MoveAnimation(*pItem, originalBounds, moveToBounds, ITEM_ANIMATION_DELAY); + MoveAnimation(*pItem, startBounds, endBounds, ITEM_ANIMATION_DELAY); } } } } - AnimationTransaction::Commit(); } @@ -4552,12 +4524,12 @@ _IconListPresenter::MoveBackward(int index) int bottomLine = 0; if (__scrollDirection == ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) { - int bottomPosition = __scrollPosition + __pIconListView->GetBounds().height; + float bottomPosition = __scrollPosition + __pIconListView->GetBounds().height; bottomLine = (bottomPosition - __topMargin + __verticalSpacing) / __unitScrollLength; } else { - int bottomPosition = __scrollPosition + __pIconListView->GetBounds().width; + float bottomPosition = __scrollPosition + __pIconListView->GetBounds().width; bottomLine = (bottomPosition - __leftMargin + __horizontalSpacing) / __unitScrollLength; } @@ -4581,13 +4553,13 @@ _IconListPresenter::MoveBackward(int index) AnimationTransaction::Begin(__moveTransactionId); - Rectangle startRect; - Rectangle endRect; + FloatRectangle startBounds; + FloatRectangle endBounds; for (int i = startIndex; i >= endIndex; i--) { - startRect = GetItemBounds(i); - endRect = GetItemBounds(i + 1); - if (!startRect.IsEmpty() && !endRect.IsEmpty()) + startBounds = GetItemBounds(i); + endBounds = GetItemBounds(i + 1); + if (!startBounds.IsEmpty() && !endBounds.IsEmpty()) { pItem = static_cast<_IconListItem*>(__pListModel->LoadItem(DEFAULT_GROUP_INDEX, i)); if (pItem != null) @@ -4595,16 +4567,12 @@ _IconListPresenter::MoveBackward(int index) pItemVE = pItem->GetItemVisualElement(); if (pItemVE != null) { - FloatRectangle originalBounds(startRect.x, startRect.y, startRect.width, startRect.height); - FloatRectangle moveToBounds(endRect.x, endRect.y, endRect.width, endRect.height); - MoveAnimation(*pItem, originalBounds, moveToBounds, 0); + MoveAnimation(*pItem, startBounds, endBounds, 0); } } } } - AnimationTransaction::Commit(); - } bool diff --git a/src/ui/controls/FUiCtrl_IconListUtils.cpp b/src/ui/controls/FUiCtrl_IconListUtils.cpp index 1b8cf01..931f326 100644 --- a/src/ui/controls/FUiCtrl_IconListUtils.cpp +++ b/src/ui/controls/FUiCtrl_IconListUtils.cpp @@ -20,6 +20,7 @@ * @brief This is the implementation file for the _IconListUtils. */ +#include "FUi_Math.h" #include "FUiCtrl_IconListUtils.h" namespace Tizen { namespace Ui { namespace Controls @@ -32,7 +33,7 @@ const float TouchAnimation::FRAME_RATIO[TouchAnimation::FRAME_COUNT] = {0.9375, 0.875, 0.8125, 0.75, 0.6875, 0.625, 0.5625, 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1.0}; TouchAnimation::TouchAnimation(void) - : __frame(0) + : __frame(0.0f) { } @@ -78,28 +79,28 @@ MagneticScrollAnimation::~MagneticScrollAnimation(void) } bool -MagneticScrollAnimation::GetMagneticScrollAnimationFrame(int& dif) +MagneticScrollAnimation::GetMagneticScrollAnimationFrame(float& diff) { - if (__scroll == 0) + if (_FloatCompare(__scroll, 0.0f)) { - dif = 0; + diff = 0.0f; return false; } - else if (__scroll > 0) + else if (!_FloatCompareLE(__scroll, 0.0f)) { - dif = (__scroll - 1) / MAGNETIC_SCROLL_EFFECT_DIVIDER + 1; + diff = (__scroll - 1) / MAGNETIC_SCROLL_EFFECT_DIVIDER + 1; } else { - dif = (__scroll + 1) / MAGNETIC_SCROLL_EFFECT_DIVIDER - 1; + diff = (__scroll + 1) / MAGNETIC_SCROLL_EFFECT_DIVIDER - 1; } - __scroll -= dif; + __scroll -= diff; return true; } void -MagneticScrollAnimation::StartAnimation(int scroll) +MagneticScrollAnimation::StartAnimation(float scroll) { __scroll = scroll; } @@ -130,13 +131,13 @@ CheckAnimation::GetCheckAnimationFrame(float& ratio) float CheckAnimation::GetCurrentAnimationFrame(void) const { - float frame = (float)__frame; + float frame = (float) __frame; if (__frame <= 0) { frame = 1.0f; } - return frame / (float)FRAME_COUNT; + return frame / (float) FRAME_COUNT; } void diff --git a/src/ui/controls/FUiCtrl_IconListView.cpp b/src/ui/controls/FUiCtrl_IconListView.cpp index 59a0eaa..ec443ee 100644 --- a/src/ui/controls/FUiCtrl_IconListView.cpp +++ b/src/ui/controls/FUiCtrl_IconListView.cpp @@ -21,11 +21,12 @@ */ //Includes -#include #include #include #include "FUi_AccessibilityContainer.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" #include "FUiAnim_VisualElement.h" #include "FUiCtrl_IconListItem.h" @@ -64,6 +65,8 @@ _IconListView::_IconListView(void) , __textSizeOfEmptyList(0) , __pBitmapOfEmptyList(null) , __reorderEnabled(false) + , __pScrollingAnimation(null) + , __scrollInputMode(SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION) { SetControlDelegate(*this); AddPropertyChangeEventListener(*this); @@ -85,6 +88,17 @@ _IconListView::Dispose(void) { AnimationTransaction::SetTransactionEventListener(null); + if (__pScrollingAnimation != null) + { + __pScrollingAnimation->SetVisualElementAnimationTickEventListener(null); + __pScrollingAnimation->SetVisualElementAnimationStatusEventListener(null); + + GetVisualElement()->RemoveAllAnimations(); + + delete __pScrollingAnimation; + __pScrollingAnimation = null; + } + delete __pIconListPresenter; __pIconListPresenter = null; @@ -94,17 +108,11 @@ _IconListView::Dispose(void) delete __pBitmapOfEmptyList; __pBitmapOfEmptyList = null; - if (__pIconListItemEvent != null) - { - delete __pIconListItemEvent; - __pIconListItemEvent = null; - } + delete __pIconListItemEvent; + __pIconListItemEvent = null; - if (__pScrollEvent != null) - { - delete __pScrollEvent; - __pScrollEvent = null; - } + delete __pScrollEvent; + __pScrollEvent = null; if (__pScroll != null) { @@ -187,7 +195,7 @@ _IconListView::Initialize(_IconListPresenter& presenter) { result r = E_SUCCESS; Color color; - int textSize = 0; + float textSize = 0.0f; // Set _IconListPresenter __pIconListPresenter = &presenter; @@ -198,7 +206,7 @@ _IconListView::Initialize(_IconListPresenter& presenter) // Create _UiIconListItemEvent __pIconListItemEvent = new (std::nothrow) _UiIconListItemEvent; SysTryCatch(NID_UI_CTRL, (__pIconListItemEvent != null), r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] Memory allocation failed."); + "[E_OUT_OF_MEMORY] Memory allocation failed."); r = __pIconListItemEvent->Construct(*this); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Unable to construct Event."); @@ -206,7 +214,7 @@ _IconListView::Initialize(_IconListPresenter& presenter) // Create _UiScrollEvent __pScrollEvent = new (std::nothrow) _UiScrollEvent; SysTryCatch(NID_UI_CTRL, (__pScrollEvent != null), r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] Memory allocation failed."); + "[E_OUT_OF_MEMORY] Memory allocation failed."); r = __pScrollEvent->Construct(*this); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Unable to construct Scroll Event."); @@ -220,13 +228,28 @@ _IconListView::Initialize(_IconListPresenter& presenter) GET_COLOR_CONFIG(ICONLIST::EMPTY_TEXT_NORMAL, color); SetTextColorOfEmptyList(color); - SetTextOfEmptyList(L"Empty List"); - // Set Touch move allowance config - SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_NORMAL); + SetTouchPressThreshold(0.08); AnimationTransaction::SetTransactionEventListener(this); + __pScrollingAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryCatch(NID_UI_CTRL, (__pScrollEvent != null), r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, + "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pScrollingAnimation->SetRepeatCount(SCROLL_ANIMATION_DEFAULT_REPEAT_COUNT); + __pScrollingAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseOut")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pScrollingAnimation->SetVisualElementAnimationTickEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pScrollingAnimation->SetVisualElementAnimationStatusEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + return r; CATCH: @@ -348,62 +371,30 @@ _IconListView::GetBackgroundBitmap(void) const } result -_IconListView::SetMargin(MarginType type, int value) +_IconListView::SetMargin(MarginType type, float value) { - switch (type) - { - case MARGIN_TYPE_TOP: - return __pIconListPresenter->SetTopMargin(value); - - case MARGIN_TYPE_BOTTOM: - return __pIconListPresenter->SetBottomMargin(value); - - case MARGIN_TYPE_LEFT: - return __pIconListPresenter->SetLeftMargin(value); - - case MARGIN_TYPE_RIGHT: - return __pIconListPresenter->SetRightMargin(value); - } - - SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid type is used."); - return E_INVALID_ARG; + return __pIconListPresenter->SetMargin(type, value); } -int +float _IconListView::GetMargin(MarginType type) const { - switch (type) - { - case MARGIN_TYPE_TOP: - return __pIconListPresenter->GetTopMargin(); - - case MARGIN_TYPE_BOTTOM: - return __pIconListPresenter->GetBottomMargin(); - - case MARGIN_TYPE_LEFT: - return __pIconListPresenter->GetLeftMargin(); - - case MARGIN_TYPE_RIGHT: - return __pIconListPresenter->GetRightMargin(); - } - - SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used."); - return -1; + return __pIconListPresenter->GetMargin(type); } result -_IconListView::SetItemSpacing(int horizontalSpacing, int verticalSpacing) +_IconListView::SetItemSpacing(float horizontalSpacing, float verticalSpacing) { return __pIconListPresenter->SetItemSpacing(horizontalSpacing, verticalSpacing); } -int +float _IconListView::GetItemHorizontalSpacing(void) const { return __pIconListPresenter->GetItemHorizontalSpacing(); } -int +float _IconListView::GetItemVerticalSpacing(void) const { return __pIconListPresenter->GetItemVerticalSpacing(); @@ -413,7 +404,7 @@ result _IconListView::SetItemChecked(int index, bool check) { SysTryReturn(NID_UI_CTRL, (__style == ICON_LIST_VIEW_STYLE_RADIO || __style == ICON_LIST_VIEW_STYLE_MARK), E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has been occurred. The style of IconListView is not available to check."); + "[E_SYSTEM] A system error has been occurred. The style of IconListView is not available to check."); return __pIconListPresenter->SetItemChecked(index, check); } @@ -422,13 +413,13 @@ bool _IconListView::IsItemChecked(int index) const { SysTryReturn(NID_UI_CTRL, (__style == ICON_LIST_VIEW_STYLE_RADIO || __style == ICON_LIST_VIEW_STYLE_MARK), false, E_SYSTEM, - "[E_SYSTEM] A system error has been occurred. The style of IconListView is not available to check."); + "[E_SYSTEM] A system error has been occurred. The style of IconListView is not available to check."); return __pIconListPresenter->IsItemChecked(index); } int -_IconListView::GetItemIndexFromPosition(int x, int y) const +_IconListView::GetItemIndexFromPosition(float x, float y) const { return __pIconListPresenter->GetItemIndexFromPosition(x, y); } @@ -436,6 +427,12 @@ _IconListView::GetItemIndexFromPosition(int x, int y) const int _IconListView::GetItemIndexFromPosition(const Point& position) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position)); +} + +int +_IconListView::GetItemIndexFromPosition(const FloatPoint& position) const +{ return __pIconListPresenter->GetItemIndexFromPosition(position); } @@ -494,10 +491,7 @@ _IconListView::SetPropertyTextOfEmptyList(const Variant& text) { __textOfEmptyList = text.ToString(); - if (__pIconListPresenter != null) - { - __pIconListPresenter->ClearVisualElement(); - } + __pIconListPresenter->ClearVisualElement(); return E_SUCCESS; } @@ -511,7 +505,6 @@ _IconListView::SetTextOfEmptyList(const String& text) Variant _IconListView::GetPropertyTextOfEmptyList(void) const { - ClearLastResult(); return Variant(__textOfEmptyList); } @@ -539,7 +532,6 @@ _IconListView::SetTextColorOfEmptyList(const Color& color) Variant _IconListView::GetPropertyTextColorOfEmptyList(void) const { - ClearLastResult(); return Variant(__textColorOfEmptyList); } @@ -551,19 +543,19 @@ _IconListView::GetTextColorOfEmptyList(void) const } result -_IconListView::SetTextSizeOfEmptyList(int size) +_IconListView::SetTextSizeOfEmptyList(float size) { - int minSize = 0; + float minSize = 0.0f; GET_FIXED_VALUE_CONFIG(ICONLIST::MINIMUM_FONT_SIZE, GetOrientation(), minSize); - SysTryReturn(NID_UI_CTRL, (size >= minSize), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument is used. Font size should be greater than or equal to the minimum size."); + SysTryReturn(NID_UI_CTRL, _FloatCompareGE(size, minSize), E_INVALID_ARG, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument is used. Font size should be greater than or equal to the minimum size."); __textSizeOfEmptyList = size; return E_SUCCESS; } -int +float _IconListView::GetTextSizeOfEmptyList(void) const { return __textSizeOfEmptyList; @@ -584,13 +576,13 @@ _IconListView::GetItemTextColor(IconListViewItemDrawingStatus status) const result _IconListView::SetPropertyItemTextSize(const Variant& size) { - return __pIconListPresenter->SetItemTextSize(size.ToInt()); + return __pIconListPresenter->SetItemTextSize(size.ToFloat()); } result -_IconListView::SetItemTextSize(int size) +_IconListView::SetItemTextSize(float size) { - return SetProperty("itemTextSize", Variant(size)); + return SetProperty("itemTextSize", Variant((size))); } Variant @@ -599,18 +591,18 @@ _IconListView::GetPropertyItemTextSize(void) const return Variant(__pIconListPresenter->GetItemTextSize()); } -int +float _IconListView::GetItemTextSize(void) const { Variant size = GetProperty("itemTextSize"); - return size.ToInt(); + return size.ToFloat(); } result _IconListView::SetPropertyCheckBoxPosition(const Variant& position) { SysTryReturn(NID_UI_CTRL, (__style == ICON_LIST_VIEW_STYLE_RADIO || __style == ICON_LIST_VIEW_STYLE_MARK), E_INVALID_OPERATION, - E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current style of IconListView is not available to check. So can not set position of checkbox."); + E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current style of IconListView is not available to check. So can not set position of check box."); return __pIconListPresenter->SetCheckBoxPosition(static_cast(position.ToInt())); } @@ -626,7 +618,7 @@ _IconListView::GetPropertyCheckBoxPosition(void) const { SysTryReturn(NID_UI_CTRL, (__style == ICON_LIST_VIEW_STYLE_RADIO || __style == ICON_LIST_VIEW_STYLE_MARK), Variant(static_cast(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT)), E_INVALID_OPERATION, - "[E_INVALID_OPERATION] The current style of IconListView is not available to check. So can not get position of checkBox."); + "[E_INVALID_OPERATION] The current style of IconListView is not available to check. So can not get position of check box."); return Variant(static_cast(__pIconListPresenter->GetCheckBoxPosition())); } @@ -670,7 +662,7 @@ _IconListView::ScrollToItem(int index) } result -_IconListView::ScrollByPixel(int pixel) +_IconListView::ScrollByPixel(float pixel) { return __pIconListPresenter->ScrollByPixel(pixel); } @@ -690,40 +682,46 @@ _IconListView::UpdateList(void) result _IconListView::SetItemBitmapBounds(const Rectangle& bounds) { + return SetItemBitmapBounds(_CoordinateSystemUtils::ConvertToFloat(bounds)); +} + +result +_IconListView::SetItemBitmapBounds(const FloatRectangle& bounds) +{ return __pIconListPresenter->SetItemBitmapBounds(bounds); } -const Rectangle +const FloatRectangle _IconListView::GetItemBitmapBounds(void) const { return __pIconListPresenter->GetItemBitmapBounds(); } result -_IconListView::GetItemBitmapSize(int& width, int& height) const +_IconListView::GetItemBitmapSize(float& width, float& height) const { return __pIconListPresenter->GetItemBitmapSize(width, height); } -const Dimension +const FloatDimension _IconListView::GetItemBitmapSize(void) const { return __pIconListPresenter->GetItemBitmapSize(); } result -_IconListView::SetItemSize(const Dimension& size) +_IconListView::SetItemSize(const FloatDimension& size) { return __pIconListPresenter->SetItemSize(size); } result -_IconListView::GetItemSize(int& width, int& height) const +_IconListView::GetItemSize(float& width, float& height) const { return __pIconListPresenter->GetItemSize(width, height); } -const Dimension +const FloatDimension _IconListView::GetItemSize(void) const { return __pIconListPresenter->GetItemSize(); @@ -904,7 +902,7 @@ _IconListView::RemoveAllItems(void) } result -_IconListView::SetScroll(const Rectangle& bounds, _ScrollDirection scrollDirection) +_IconListView::SetScroll(const FloatRectangle& bounds, _ScrollDirection scrollDirection) { if (__pScroll == null) { @@ -996,11 +994,22 @@ _IconListView::SetReorderModeEnabled(bool enable) bool _IconListView::IsInReorderingMode(void) const { - ClearLastResult(); return __reorderEnabled; } void +_IconListView::SetScrollInputMode(ScrollInputMode mode) +{ + __scrollInputMode = mode; +} + +ScrollInputMode +_IconListView::GetScrollInputMode(void) const +{ + return __scrollInputMode; +} + +void _IconListView::OnBoundsChanged(void) { __pIconListPresenter->OnBoundsChanged(); @@ -1039,6 +1048,14 @@ _IconListView::OnChangeLayout(_ControlOrientation orientation) void _IconListView::OnFontInfoRequested(unsigned long& style, int& size) { + float floatSize = 0.0f; + __pIconListPresenter->OnFontInfoRequested(style, floatSize); + size = _CoordinateSystemUtils::ConvertToInteger(floatSize); +} + +void +_IconListView::OnFontInfoRequested(unsigned long& style, float& size) +{ __pIconListPresenter->OnFontInfoRequested(style, size); } @@ -1152,13 +1169,11 @@ _IconListView::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gestur void _IconListView::OnPropertyChanging(_PropertyBase& source, const String& name, const Variant& oldValue, const Variant& newValue) { - } void _IconListView::OnPropertyChanged(_PropertyBase& source, const String& name, const Variant& oldValue, const Variant& newValue) { - } void @@ -1176,11 +1191,11 @@ _IconListView::OnVisibleStateChanged(void) } else if (enableFadeEffect) { - int scrollViewRange = 0; - int scrollRange = 0; + float scrollViewRange = 0.0f; + float scrollRange = 0.0f; __pScroll->GetScrollRange(&scrollViewRange, &scrollRange); - if (scrollViewRange < scrollRange) + if (!_FloatCompareGE(scrollViewRange, scrollRange)) { __pIconListPresenter->ScrollFadeOut(); } @@ -1198,9 +1213,9 @@ _IconListView::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_IconListView::OnScrollPositionChanged(_Control& source, int scrollPos) +_IconListView::OnScrollPositionChanged(_Control& source, float scrollPosition) { - __pIconListPresenter->OnScrollPositionChanged(source, scrollPos); + __pIconListPresenter->OnScrollPositionChanged(source, scrollPosition); } void @@ -1218,19 +1233,45 @@ _IconListView::OnAnimationTransactionStarted(int transactionId) void _IconListView::OnAnimationTransactionStopped(int transactionId) { - if (__pIconListPresenter != null) - { - __pIconListPresenter->OnAnimationTransactionStopped(transactionId); - } + __pIconListPresenter->OnAnimationTransactionStopped(transactionId); } void _IconListView::OnAnimationTransactionFinished(int transactionId) { - if (__pIconListPresenter != null) - { - __pIconListPresenter->OnAnimationTransactionFinished(transactionId); - } + __pIconListPresenter->OnAnimationTransactionFinished(transactionId); +} + +// Tizen::Ui::Animations::IVisualElementAnimationTickEventListener +void +_IconListView::OnTickOccurred(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, const Variant& currentValue) +{ + __pIconListPresenter->OnTickOccurred(animation, keyName, target, currentValue); +} + +// Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener +void +_IconListView::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ + __pIconListPresenter->OnVisualElementAnimationStarted(animation, keyName, target); +} + +void +_IconListView::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ + __pIconListPresenter->OnVisualElementAnimationRepeated(animation, keyName, target, currentRepeatCount); +} + +void +_IconListView::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + __pIconListPresenter->OnVisualElementAnimationFinished(animation, keyName, target, completedNormally); +} + +VisualElementValueAnimation* +_IconListView::GetScrollingAnimation(void) const +{ + return __pScrollingAnimation; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_IconListViewImpl.cpp b/src/ui/controls/FUiCtrl_IconListViewImpl.cpp index eb347f0..a4a0a8f 100644 --- a/src/ui/controls/FUiCtrl_IconListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_IconListViewImpl.cpp @@ -22,7 +22,6 @@ //Includes #include - #include "FUi_UiBuilder.h" #include "FUiCtrl_IconListView.h" #include "FUiCtrl_IconListViewImpl.h" @@ -111,13 +110,13 @@ _IconListViewImpl::Dispose(void) } result -_IconListViewImpl::Initialize(IconListView* pIconListView, const Dimension& itemBitmapSize, IconListViewStyle style, +_IconListViewImpl::Initialize(IconListView* pIconListView, const FloatDimension& itemBitmapSize, IconListViewStyle style, IconListViewScrollDirection scrollDirection, IconListViewScrollStyle scrollStyle) { SysTryReturn(NID_UI_CTRL, (__pIconListView != null), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Unable to create IconListView."); result r = E_SUCCESS; - Rectangle itemBitmapBounds(0, 0, itemBitmapSize.width, itemBitmapSize.height); + FloatRectangle itemBitmapBounds(0.0f, 0.0f, itemBitmapSize.width, itemBitmapSize.height); r = __pIconListView->SetStyle(style); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -169,7 +168,7 @@ _IconListViewImpl::AddIconListViewItemEventListener(IIconListViewItemEventListen result r = __pIconListViewItemEvent->AddListener(listener); if (r == E_OBJ_ALREADY_EXIST) { - SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The same instance alerady exists in the event listener list."); + SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The same instance already exists in the event listener list."); } else { @@ -201,7 +200,23 @@ _IconListViewImpl::AddScrollEventListener(IScrollEventListener& listener) result r = __pScrollEvent->AddListener(listener); if (r == E_OBJ_ALREADY_EXIST) { - SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The same instance alerady exists in the event listener list."); + SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The same instance already exists in the event listener list."); + } + else + { + SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); + } + + SetLastResult(r); +} + +void +_IconListViewImpl::AddScrollEventListener(IScrollEventListenerF& listener) +{ + result r = __pScrollEvent->AddListener(listener); + if (r == E_OBJ_ALREADY_EXIST) + { + SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The same instance already exists in the event listener list."); } else { @@ -227,6 +242,22 @@ _IconListViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) SetLastResult(r); } +void +_IconListViewImpl::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + result r = __pScrollEvent->RemoveListener(listener); + if (r == E_OBJ_NOT_FOUND) + { + SysLogException(NID_UI_CTRL, (r = E_SYSTEM), "[E_SYSTEM] A system error has been occurred. The specified listener does not exist in the event listener list."); + } + else + { + SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); + } + + SetLastResult(r); +} + result _IconListViewImpl::SetBackgroundBitmap(const Bitmap* pBitmap) { @@ -234,30 +265,30 @@ _IconListViewImpl::SetBackgroundBitmap(const Bitmap* pBitmap) } result -_IconListViewImpl::SetMargin(MarginType type, int value) +_IconListViewImpl::SetMargin(MarginType type, float value) { return __pIconListView->SetMargin(type, value); } -int +float _IconListViewImpl::GetMargin(MarginType type) const { return __pIconListView->GetMargin(type); } result -_IconListViewImpl::SetItemSpacing(int horizontalSpacing, int verticalSpacing) +_IconListViewImpl::SetItemSpacing(float horizontalSpacing, float verticalSpacing) { return __pIconListView->SetItemSpacing(horizontalSpacing, verticalSpacing); } -int +float _IconListViewImpl::GetItemHorizontalSpacing(void) const { return __pIconListView->GetItemHorizontalSpacing(); } -int +float _IconListViewImpl::GetItemVerticalSpacing(void) const { return __pIconListView->GetItemVerticalSpacing(); @@ -276,13 +307,13 @@ _IconListViewImpl::IsItemChecked(int index) const } int -_IconListViewImpl::GetItemIndexFromPosition(int x, int y) const +_IconListViewImpl::GetItemIndexFromPosition(float x, float y) const { return __pIconListView->GetItemIndexFromPosition(x, y); } int -_IconListViewImpl::GetItemIndexFromPosition(const Point& position) const +_IconListViewImpl::GetItemIndexFromPosition(const FloatPoint& position) const { return __pIconListView->GetItemIndexFromPosition(position); } @@ -352,12 +383,12 @@ _IconListViewImpl::GetItemTextColor(IconListViewItemDrawingStatus status) const } result -_IconListViewImpl::SetItemTextSize(int size) +_IconListViewImpl::SetItemTextSize(float size) { return __pIconListView->SetItemTextSize(size); } -int +float _IconListViewImpl::GetItemTextSize(void) const { ClearLastResult(); @@ -397,7 +428,7 @@ _IconListViewImpl::ScrollToItem(int index) } result -_IconListViewImpl::ScrollByPixel(int pixel) +_IconListViewImpl::ScrollByPixel(float pixel) { return __pIconListView->ScrollByPixel(pixel); } @@ -415,24 +446,24 @@ _IconListViewImpl::UpdateList(void) } result -_IconListViewImpl::GetItemBitmapSize(int& width, int& height) const +_IconListViewImpl::GetItemBitmapSize(float& width, float& height) const { return __pIconListView->GetItemBitmapSize(width, height); } -Dimension +FloatDimension _IconListViewImpl::GetItemBitmapSize(void) const { return __pIconListView->GetItemBitmapSize(); } result -_IconListViewImpl::GetItemSize(int& width, int& height) const +_IconListViewImpl::GetItemSize(float& width, float& height) const { return __pIconListView->GetItemSize(width, height); } -Dimension +FloatDimension _IconListViewImpl::GetItemSize(void) const { return __pIconListView->GetItemSize(); @@ -521,12 +552,24 @@ _IconListViewImpl::IsInReorderingMode(void) const } void +_IconListViewImpl::SetScrollInputMode(ScrollInputMode mode) +{ + __pIconListView->SetScrollInputMode(mode); +} + +ScrollInputMode +_IconListViewImpl::GetScrollInputMode(void) const +{ + return __pIconListView->GetScrollInputMode(); +} + +void _IconListViewImpl::OnIconListItemStateChanged(_IconListViewItemEventArg* pArg) { if (__pIconListViewItemEvent != null && pArg != null) { _IconListViewItemEventArg* pEventArg = new (std::nothrow) _IconListViewItemEventArg(pArg->GetIndex(), pArg->GetEventType()); - SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allcation failed."); + SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pEventArg->SetStatus(pArg->GetStatus()); __pIconListViewItemEvent->Fire(*pEventArg); } @@ -538,7 +581,7 @@ _IconListViewImpl::OnIconListViewOverlayBitmapSelected(_IconListViewItemEventArg if (__pIconListViewItemEvent != null && pArg != null) { _IconListViewItemEventArg* pEventArg = new (std::nothrow) _IconListViewItemEventArg(pArg->GetIndex(), pArg->GetEventType()); - SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allcation failed."); + SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pEventArg->SetOverlayBitmapId(pArg->GetOverlayBitmapId()); __pIconListViewItemEvent->Fire(*pEventArg); } @@ -550,7 +593,7 @@ _IconListViewImpl::OnIconListViewItemReordered(_IconListViewItemEventArg* pArg) if (__pIconListViewItemEvent != null && pArg != null) { _IconListViewItemEventArg* pEventArg = new (std::nothrow) _IconListViewItemEventArg(pArg->GetIndex(), pArg->GetEventType()); - SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allcation failed."); + SysTryReturnVoidResult(NID_UI_CTRL, (pEventArg != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pEventArg->SetToIndex(pArg->GetToIndex()); __pIconListViewItemEvent->Fire(*pEventArg); } @@ -576,14 +619,14 @@ CATCH: } void -_IconListViewImpl::OnScrollPositionChanged(_Control& source, int scrollPos) +_IconListViewImpl::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (__pScrollEvent == null) { return; } - _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPos); + _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPosition); result r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -638,7 +681,7 @@ protected: virtual Control* Make(_UiBuilderControl* pControl) { - SysTryReturn(NID_UI, (pControl != null), null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invaild parameter is used."); + SysTryReturn(NID_UI, (pControl != null), null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Invalid parameter is used."); _UiBuilderControlLayout* pControlProperty = null; GetProperty(pControl, &pControlProperty); SysTryReturn(NID_UI, (pControlProperty != null), null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred. Unable to read attributes."); @@ -648,27 +691,24 @@ protected: ClearLastResult(); - Rectangle bounds; - Rectangle rect; - Dimension itemBitmapSize(100, 100); IconListViewStyle style = ICON_LIST_VIEW_STYLE_NORMAL; IconListViewScrollDirection scrollDirection = ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL; // Get Bounds - rect = pControlProperty->GetRect(); - bounds.SetBounds(rect.x, rect.y, rect.width, rect.height); + FloatDimension itemBitmapSize(100.0f, 100.0f); + FloatRectangle bounds(pControlProperty->GetRectF()); Tizen::Base::String elementString; // Get ItemBitmapSize(width) if (pControl->GetElement("itemBitmapWidth", elementString)) { - Base::Integer::Parse(elementString,itemBitmapSize.width); + Base::Float::Parse(elementString, itemBitmapSize.width); } // Get ItemBitmapSize(height) if (pControl->GetElement("itemBitmapHeight", elementString)) { - Base::Integer::Parse(elementString,itemBitmapSize.height); + Base::Float::Parse(elementString, itemBitmapSize.height); } // Get style @@ -897,24 +937,24 @@ protected: // Set ItemHorizontalSpacing if (pControl->GetElement("itemHorizontalSpacing", elementString)) { - int spacing = 0; - Base::Integer::Parse(elementString, spacing); - pIconListView->SetItemSpacing(spacing, pIconListView->GetItemVerticalSpacing()); + float spacing = 0.0f; + Base::Float::Parse(elementString, spacing); + pIconListView->SetItemSpacing(spacing, pIconListView->GetItemVerticalSpacingF()); } // Set ItemVerticalSpacing if (pControl->GetElement("itemVerticalSpacing", elementString)) { - int spacing = 0; - Base::Integer::Parse(elementString, spacing); - pIconListView->SetItemSpacing(pIconListView->GetItemHorizontalSpacing(), spacing); + float spacing = 0.0f; + Base::Float::Parse(elementString, spacing); + pIconListView->SetItemSpacing(pIconListView->GetItemHorizontalSpacingF(), spacing); } // Set ItemTextSize if (pControl->GetElement("itemTextSize", elementString)) { - int size = 0; - Base::Integer::Parse(elementString, size); + float size = 0.0f; + Base::Float::Parse(elementString, size); _ICoordinateSystemTransformer* pTransform = GetTransformer(); if (pTransform) { @@ -972,7 +1012,6 @@ protected: CATCH: delete pIconListView; return null; - } }; diff --git a/src/ui/controls/FUiCtrl_IconListViewItemEvent.cpp b/src/ui/controls/FUiCtrl_IconListViewItemEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_IconListViewItemEventArg.cpp b/src/ui/controls/FUiCtrl_IconListViewItemEventArg.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_IconListViewItemImpl.cpp b/src/ui/controls/FUiCtrl_IconListViewItemImpl.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_Indicator.cpp b/src/ui/controls/FUiCtrl_Indicator.cpp index b10a97e..6207a33 100644 --- a/src/ui/controls/FUiCtrl_Indicator.cpp +++ b/src/ui/controls/FUiCtrl_Indicator.cpp @@ -28,6 +28,7 @@ #include "FUi_EcoreEvasMgr.h" #include "FUi_EcoreEvas.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_Window.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_Indicator.h" @@ -64,10 +65,9 @@ _Indicator::_Indicator(void) : __pPortraitIndicatorEvasObject(null) , __pLandscapeIndicatorEvasObject(null) , __pConnectionTimer(null) - , __pPortraitSurface(null) - , __pLandScapeSurface(null) - , __pCurrentSurface(null) - , __pVisualElement(null) + , __pPortraitVisualElement(null) + , __pLandscapeVisualElement(null) + , __pCurrentVisualElement(null) , __showstate(false) , __opacity(_INDICATOR_OPACITY_OPAQUE) { @@ -84,10 +84,6 @@ _Indicator::~_Indicator(void) delete __pConnectionTimer; __pConnectionTimer = null; } - - __pPortraitSurface = null; - __pLandScapeSurface = null; - __pCurrentSurface = null; } result @@ -181,18 +177,49 @@ _Indicator::GetIndicatorBounds(void) const return indicatorbounds; } +FloatRectangle +_Indicator::GetIndicatorBoundsF(void) const +{ + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); + + _ControlOrientation orientation = GetOrientation(); + + FloatRectangle indicatorbounds(0.0f, 0.0f, 0.0f, 0.0f); + + if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + { + indicatorbounds.width = portraitSize.width; + } + else + { + indicatorbounds.width = landscapeSize.width; + } + GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorbounds.height); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_UI_CTRL, pCoordSystem, FloatRectangle(-1.0, -1.0, -1.0, -1.0), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetTransformer(); + SysTryReturn(NID_UI_CTRL, pXformer, FloatRectangle(-1.0, -1.0, -1.0, -1.0), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed."); + + indicatorbounds = pXformer->Transform(indicatorbounds); + + return indicatorbounds; +} + result -_Indicator::AddEvasObject(_Form* pForm) +_Indicator::AddIndicatorObject(_Form* pForm) { result r = E_SUCCESS; _Window* pWindow = GetRootWindow(); SysTryReturn(NID_UI_CTRL, pWindow, null, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree."); - __pPortraitSurface = _IndicatorManager::GetInstance()->GetSurface(pWindow, _INDICATOR_ORIENTATION_PORTRAIT, pForm); - SysTryReturn(NID_UI_CTRL, __pPortraitSurface, null, E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface."); - __pLandScapeSurface = _IndicatorManager::GetInstance()->GetSurface(pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, pForm); - SysTryReturn(NID_UI_CTRL, __pLandScapeSurface, null, E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface."); + __pPortraitVisualElement = _IndicatorManager::GetInstance()->GetIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_PORTRAIT, pForm); + SysTryReturn(NID_UI_CTRL, __pPortraitVisualElement, null, E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface."); + __pLandscapeVisualElement = _IndicatorManager::GetInstance()->GetIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, pForm); + SysTryReturn(NID_UI_CTRL, __pLandscapeVisualElement, null, E_SYSTEM, "[E_SYSTEM] Indicator can not create the surface."); __pPortraitIndicatorEvasObject = _IndicatorManager::GetInstance()->GetEvasObject(pWindow, pForm, _INDICATOR_ORIENTATION_PORTRAIT); SysTryReturn(NID_UI_CTRL, __pPortraitIndicatorEvasObject, null, E_SYSTEM, "[E_SYSTEM] Indicator can not get the Evas_Object."); __pLandscapeIndicatorEvasObject = _IndicatorManager::GetInstance()->GetEvasObject(pWindow, pForm, _INDICATOR_ORIENTATION_LANDSCAPE); @@ -201,29 +228,13 @@ _Indicator::AddEvasObject(_Form* pForm) _ControlOrientation orientation = GetOrientation(); if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - __pCurrentSurface = __pPortraitSurface; + r = ChangeCurrentVisualElement(__pPortraitVisualElement); } else { - __pCurrentSurface = __pLandScapeSurface; - } - - if (!__pVisualElement) - { - __pVisualElement = new (std::nothrow) _VisualElement; - SysTryReturn(NID_UI_CTRL, __pVisualElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - r = __pVisualElement->Construct(); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, E_SYSTEM, "[E_SYSTEM] System error occurred."); - __pVisualElement->SetImplicitAnimationEnabled(false); - __pVisualElement->SetShowState(true); - - _VisualElement* pIndicatorVisualElement = GetVisualElement(); - pIndicatorVisualElement->AttachChild(*__pVisualElement); + r = ChangeCurrentVisualElement(__pLandscapeVisualElement); } - r = SetSurface(__pCurrentSurface); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, GetErrorMessage(r)); - Ecore_Evas *pEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject); SysTryReturn(NID_UI_CTRL, pEe, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to get evas."); @@ -236,36 +247,49 @@ _Indicator::AddEvasObject(_Form* pForm) } result -_Indicator::DeleteEvasObject(void) +_Indicator::DeleteIndicatorObject(void) { result r = E_SUCCESS; _Window* pWindow = GetRootWindow(); SysTryReturn(NID_UI_CTRL, pWindow, null, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree."); - r = _IndicatorManager::GetInstance()->ReleaseSurface(pWindow, _INDICATOR_ORIENTATION_PORTRAIT, __pPortraitSurface); - r = _IndicatorManager::GetInstance()->ReleaseSurface(pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, __pLandScapeSurface); + r = _IndicatorManager::GetInstance()->ReleaseIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_PORTRAIT, __pPortraitVisualElement); + r = _IndicatorManager::GetInstance()->ReleaseIndicatorVisualElement(pWindow, _INDICATOR_ORIENTATION_LANDSCAPE, __pLandscapeVisualElement); - r = SetSurface(null); + _VisualElement* pIndicatorVisualElement = GetVisualElement(); + if (__pPortraitVisualElement) + { + r = pIndicatorVisualElement->DetachChild(*__pPortraitVisualElement); + } + if (__pLandscapeVisualElement) + { + r = pIndicatorVisualElement->DetachChild(*__pLandscapeVisualElement); + } __pPortraitIndicatorEvasObject = null; __pLandscapeIndicatorEvasObject = null; - __pPortraitSurface = null; - __pLandScapeSurface = null; - __pCurrentSurface = null; + __pPortraitVisualElement = null; + __pLandscapeVisualElement = null; + __pCurrentVisualElement = null; return r; } result -_Indicator::SetSurface(VisualElementSurface* pSurface) +_Indicator::ChangeCurrentVisualElement(Tizen::Ui::Animations::_VisualElement* pVisualElement) { result r = E_SUCCESS; - if (__pVisualElement) + if (!(__pCurrentVisualElement == pVisualElement)) { - r = __pVisualElement->SetBounds(FloatRectangle(0, 0, GetSize().width, GetSize().height)); - r = __pVisualElement->SetSurface(pSurface); + _VisualElement* pIndicatorVisualElement = GetVisualElement(); + r = pIndicatorVisualElement->AttachChild(*pVisualElement); + if (__pCurrentVisualElement) + { + r = pIndicatorVisualElement->DetachChild(*__pCurrentVisualElement); + } + __pCurrentVisualElement = pVisualElement; } return r; @@ -276,21 +300,11 @@ _Indicator::OnChangeLayout(_ControlOrientation orientation) { if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - __pCurrentSurface = __pPortraitSurface; - SetSurface(__pCurrentSurface); - - evas_object_smart_member_del(__pLandscapeIndicatorEvasObject); - evas_object_show(__pPortraitIndicatorEvasObject); - evas_object_hide(__pLandscapeIndicatorEvasObject); + ChangeCurrentVisualElement(__pPortraitVisualElement); } else { - __pCurrentSurface = __pLandScapeSurface; - SetSurface(__pCurrentSurface); - - evas_object_smart_member_del(__pPortraitIndicatorEvasObject); - evas_object_show(__pLandscapeIndicatorEvasObject); - evas_object_hide(__pPortraitIndicatorEvasObject); + ChangeCurrentVisualElement(__pLandscapeVisualElement); } } @@ -299,9 +313,9 @@ _Indicator::OnAttachedToMainTree(void) { result r = E_SUCCESS; - if (__pCurrentSurface) + if (__pCurrentVisualElement) { - r = SetSurface(__pCurrentSurface); + r = ChangeCurrentVisualElement(__pCurrentVisualElement); } return r; diff --git a/src/ui/controls/FUiCtrl_IndicatorManager.cpp b/src/ui/controls/FUiCtrl_IndicatorManager.cpp index d057a1a..1f6a6ed 100644 --- a/src/ui/controls/FUiCtrl_IndicatorManager.cpp +++ b/src/ui/controls/FUiCtrl_IndicatorManager.cpp @@ -29,6 +29,7 @@ #include "FUi_Window.h" #include "FUi_ControlManager.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_IndicatorManager.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" @@ -92,21 +93,26 @@ _IndicatorManager::_IndicatorManager(void) // [ToDo] exception check. _IndicatorManager::~_IndicatorManager(void) { - IMapEnumeratorT<_Window*, IndicatorSurface*>* pEnumerator = __indicatorMap.GetMapEnumeratorN(); + IMapEnumeratorT<_Window*, IndicatorComponent*>* pEnumerator = __indicatorMap.GetMapEnumeratorN(); if (pEnumerator) { while(pEnumerator->MoveNext() == E_SUCCESS) { - IndicatorSurface* pIndicatorSurface = null; - pEnumerator->GetValue(pIndicatorSurface); + IndicatorComponent* pIndicatorComponent = null; + pEnumerator->GetValue(pIndicatorComponent); - if (pIndicatorSurface) + if (pIndicatorComponent) { - delete pIndicatorSurface[0].pPortraitSurface; - delete pIndicatorSurface[1].pPortraitSurface; - delete pIndicatorSurface[0].pLandscapeSurface; - delete pIndicatorSurface[1].pLandscapeSurface; - delete [] pIndicatorSurface; + delete pIndicatorComponent[0].pPortraitSurface; + delete pIndicatorComponent[1].pPortraitSurface; + delete pIndicatorComponent[0].pLandscapeSurface; + delete pIndicatorComponent[1].pLandscapeSurface; + pIndicatorComponent[0].pPortraitVisualElement->Destroy(); + pIndicatorComponent[0].pLandscapeVisualElement->Destroy(); + pIndicatorComponent[1].pPortraitVisualElement->Destroy(); + pIndicatorComponent[1].pLandscapeVisualElement->Destroy(); + + delete [] pIndicatorComponent; } } delete pEnumerator; @@ -115,32 +121,32 @@ _IndicatorManager::~_IndicatorManager(void) __indicatorMap.RemoveAll(); } -VisualElementSurface* -_IndicatorManager::GetSurface(_Window* pWindow, _IndicatorOrientation orientation, _Form* pForm) const +_VisualElement* +_IndicatorManager::GetIndicatorVisualElement(_Window* pWindow, _IndicatorOrientation orientation, _Form* pForm) const { result r = E_SUCCESS; - IndicatorSurface* pIndicatorSurfaceArray = null; - r = __indicatorMap.GetValue(pWindow, pIndicatorSurfaceArray); - SysTryReturn(NID_UI_CTRL, pIndicatorSurfaceArray, null, E_SYSTEM, "[E_SYSTEM] Unable to get Indicator"); + IndicatorComponent* pIndicatorComponentArray = null; + r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray); + SysTryReturn(NID_UI_CTRL, pIndicatorComponentArray, null, E_SYSTEM, "[E_SYSTEM] Unable to get Indicator"); for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { - if (pForm == pIndicatorSurfaceArray[i].pForm) + if (pForm == pIndicatorComponentArray[i].pForm) { - if ((orientation == _INDICATOR_ORIENTATION_PORTRAIT) && (pIndicatorSurfaceArray[i].portraitSurfaceUsed)) + if ((orientation == _INDICATOR_ORIENTATION_PORTRAIT) && (pIndicatorComponentArray[i].portraitVisualElementUsed)) { - return pIndicatorSurfaceArray[i].pPortraitSurface; + return pIndicatorComponentArray[i].pPortraitVisualElement; } - else if((orientation == _INDICATOR_ORIENTATION_LANDSCAPE) && (pIndicatorSurfaceArray[i].landscapeSurfaceUsed)) + else if((orientation == _INDICATOR_ORIENTATION_LANDSCAPE) && (pIndicatorComponentArray[i].landscapeVisualElementUsed)) { - return pIndicatorSurfaceArray[i].pLandscapeSurface; + return pIndicatorComponentArray[i].pLandscapeVisualElement; } } } - if (IsFull(pIndicatorSurfaceArray)) + if (IsFull(pIndicatorComponentArray)) { _Frame* pFrame = dynamic_cast<_Frame*>(pWindow); if (pFrame) @@ -156,9 +162,9 @@ _IndicatorManager::GetSurface(_Window* pWindow, _IndicatorOrientation orientatio { for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { - if (pIndicatorSurfaceArray[i].pForm != pCurrentForm) + if (pIndicatorComponentArray[i].pForm != pCurrentForm) { - pIndicatorSurfaceArray[i].pForm->DeleteIndicatorObject(); + pIndicatorComponentArray[i].pForm->DeleteIndicatorObject(); break; } } @@ -166,64 +172,69 @@ _IndicatorManager::GetSurface(_Window* pWindow, _IndicatorOrientation orientatio } } - VisualElementSurface* pSurface = null; - for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) + _VisualElement* pVisalElement = null; + if (pIndicatorComponentArray) { - if (orientation == _INDICATOR_ORIENTATION_PORTRAIT) + for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { - if (!(pIndicatorSurfaceArray[i].portraitSurfaceUsed)) + if (orientation == _INDICATOR_ORIENTATION_PORTRAIT) { - pSurface = pIndicatorSurfaceArray[i].pPortraitSurface; - pIndicatorSurfaceArray[i].portraitSurfaceUsed = true; - pIndicatorSurfaceArray[i].pForm = pForm; - break; + if (!(pIndicatorComponentArray[i].portraitVisualElementUsed)) + { + pVisalElement = pIndicatorComponentArray[i].pPortraitVisualElement; + pIndicatorComponentArray[i].portraitVisualElementUsed = true; + pIndicatorComponentArray[i].pForm = pForm; + break; + } } - } - else if(orientation == _INDICATOR_ORIENTATION_LANDSCAPE) - { - if (!(pIndicatorSurfaceArray[i].landscapeSurfaceUsed)) + else if(orientation == _INDICATOR_ORIENTATION_LANDSCAPE) { - pSurface = pIndicatorSurfaceArray[i].pLandscapeSurface; - pIndicatorSurfaceArray[i].landscapeSurfaceUsed = true; - pIndicatorSurfaceArray[i].pForm = pForm; - break; + if (!(pIndicatorComponentArray[i].landscapeVisualElementUsed)) + { + pVisalElement = pIndicatorComponentArray[i].pLandscapeVisualElement; + pIndicatorComponentArray[i].landscapeVisualElementUsed = true; + pIndicatorComponentArray[i].pForm = pForm; + break; + } } } } - - return pSurface; + return pVisalElement; } result -_IndicatorManager::ReleaseSurface(_Window* pWindow, _IndicatorOrientation orientation, VisualElementSurface* pSurface) +_IndicatorManager::ReleaseIndicatorVisualElement(_Window* pWindow, _IndicatorOrientation orientation, _VisualElement* pVisualElement) { result r = E_SUCCESS; - IndicatorSurface* pIndicatorSurfaceArray = null; - r = __indicatorMap.GetValue(pWindow, pIndicatorSurfaceArray); + IndicatorComponent* pIndicatorComponentArray = null; + r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray); - if (pIndicatorSurfaceArray) + if (pIndicatorComponentArray) { for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { if (orientation == _INDICATOR_ORIENTATION_PORTRAIT) { - if (pIndicatorSurfaceArray[i].portraitSurfaceUsed) + if (pIndicatorComponentArray[i].portraitVisualElementUsed) { - if (pSurface == pIndicatorSurfaceArray[i].pPortraitSurface) + if (pVisualElement == pIndicatorComponentArray[i].pPortraitVisualElement) { - pIndicatorSurfaceArray[i].portraitSurfaceUsed = false; - pIndicatorSurfaceArray[i].pForm = null; + pIndicatorComponentArray[i].portraitVisualElementUsed = false; + pIndicatorComponentArray[i].pForm = null; break; } } } else if(orientation == _INDICATOR_ORIENTATION_LANDSCAPE) { - if (pSurface == pIndicatorSurfaceArray[i].pLandscapeSurface) + if (pIndicatorComponentArray[i].landscapeVisualElementUsed) { - pIndicatorSurfaceArray[i].landscapeSurfaceUsed = false; - pIndicatorSurfaceArray[i].pForm = null; - break; + if (pVisualElement == pIndicatorComponentArray[i].pLandscapeVisualElement) + { + pIndicatorComponentArray[i].landscapeVisualElementUsed = false; + pIndicatorComponentArray[i].pForm = null; + break; + } } } } @@ -234,11 +245,17 @@ _IndicatorManager::ReleaseSurface(_Window* pWindow, _IndicatorOrientation orient result _IndicatorManager::AddWindow(_Window* pWindow) { - result r = E_SYSTEM; + result r = E_SUCCESS; + + _Frame* pFrame = dynamic_cast<_Frame*>(pWindow); + if (!pFrame) + { + return r; + } - IndicatorSurface* pIndicatorSurfaceArray = MakeEvasSurfaceArrayN(pWindow); + IndicatorComponent* pIndicatorComponentArray = MakeIndicatorComponentArrayN(pWindow); - r = __indicatorMap.Add(pWindow, pIndicatorSurfaceArray); + r = __indicatorMap.Add(pWindow, pIndicatorComponentArray); return r; } @@ -247,38 +264,48 @@ result _IndicatorManager::DeleteWindow(_Window* pWindow) { result r = E_SUCCESS; - IndicatorSurface* pIndicatorSurfaceArray = null; + IndicatorComponent* pIndicatorComponentArray = null; + + _Frame* pFrame = dynamic_cast<_Frame*>(pWindow); + if (!pFrame) + { + return r; + } - r = __indicatorMap.GetValue(pWindow, pIndicatorSurfaceArray); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && pIndicatorSurfaceArray, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The given binding ID is not registered."); + r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && pIndicatorComponentArray, r, r, "[%s] Propagating.", GetErrorMessage(r)); - delete [] pIndicatorSurfaceArray; + delete pIndicatorComponentArray[0].pPortraitSurface; + delete pIndicatorComponentArray[0].pLandscapeSurface; + delete pIndicatorComponentArray[1].pPortraitSurface; + delete pIndicatorComponentArray[1].pLandscapeSurface; + pIndicatorComponentArray[0].pPortraitVisualElement->Destroy(); + pIndicatorComponentArray[0].pLandscapeVisualElement->Destroy(); + pIndicatorComponentArray[1].pPortraitVisualElement->Destroy(); + pIndicatorComponentArray[1].pLandscapeVisualElement->Destroy(); + + delete [] pIndicatorComponentArray; __indicatorMap.Remove(pWindow); return r; } -IndicatorSurface* -_IndicatorManager::MakeEvasSurfaceArrayN(_Window* pWindow) +IndicatorComponent* +_IndicatorManager::MakeIndicatorComponentArrayN(_Window* pWindow) { - Eina_Bool result = EINA_TRUE; + result r = E_SUCCESS; + IndicatorComponent* pIndicatorComponentArray = new IndicatorComponent[NUMBER_OF_OBJECT]; - _Frame* pFrame = dynamic_cast<_Frame*>(pWindow); - if (!pFrame) - { - return null; - } + _RootVisualElement* pRootVisualElement = pWindow->GetRootVisualElement(); + _EflLayer* pEflLayer = static_cast<_EflLayer*>(pRootVisualElement->GetNativeLayer()); + Ecore_Evas* pEcore_Evas = pEflLayer->GetEcoreEvas(); + SysTryReturn(NID_UI, pEcore_Evas, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - IndicatorSurface* pIndicatorSurfaceArray = new IndicatorSurface[NUMBER_OF_OBJECT]; + Eina_Bool result = EINA_TRUE; Dimension portraitsize = GetIndicatorSize(_INDICATOR_ORIENTATION_PORTRAIT); Dimension landscapesize = GetIndicatorSize(_INDICATOR_ORIENTATION_LANDSCAPE); - _RootVisualElement* pRootVisualElement = pWindow->GetRootVisualElement(); - _EflLayer* pEflLayer = static_cast<_EflLayer*>(pRootVisualElement->GetNativeLayer()); - Ecore_Evas* pEcore_Evas = pEflLayer->GetEcoreEvas(); - SysTryCatch(NID_UI_CTRL, pEcore_Evas, , E_SYSTEM, "[E_SYSTEM] Unable to get Ecore_Evas object"); - //Get indicator Image Object for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { @@ -299,27 +326,47 @@ _IndicatorManager::MakeEvasSurfaceArrayN(_Window* pWindow) VisualElementSurface* pPortraitSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(*pWindow->GetDisplayContext(), reinterpret_cast(pPortraitEvasObject), portraitsize); VisualElementSurface* pLandScapeSurface = _VisualElementSurfaceImpl::CreateSurfaceUsingExistingObjectN(*pWindow->GetDisplayContext(), reinterpret_cast(pLandscapeEvasObject), landscapesize); - pIndicatorSurfaceArray[i].pPortraitEvasObject = pPortraitEvasObject; - pIndicatorSurfaceArray[i].pLandscapeEvasObject = pLandscapeEvasObject; - pIndicatorSurfaceArray[i].pPortraitSurface = pPortraitSurface; - pIndicatorSurfaceArray[i].pLandscapeSurface = pLandScapeSurface; - pIndicatorSurfaceArray[i].portraitSurfaceUsed = false; - pIndicatorSurfaceArray[i].landscapeSurfaceUsed = false; - pIndicatorSurfaceArray[i].pForm = null; + _VisualElement* pPortraitVisualElement = new (std::nothrow) _VisualElement; + SysTryReturn(NID_UI_CTRL, pPortraitVisualElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + r = pPortraitVisualElement->Construct(); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, E_SYSTEM, "[E_SYSTEM] System error occurred."); + pPortraitVisualElement->SetImplicitAnimationEnabled(false); + pPortraitVisualElement->SetShowState(true); + pPortraitVisualElement->SetSurface(pPortraitSurface); + pPortraitVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, portraitsize.width, portraitsize.height)); + + _VisualElement* pLandscapeVisualElement = new (std::nothrow) _VisualElement; + SysTryReturn(NID_UI_CTRL, pLandscapeVisualElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + r = pLandscapeVisualElement->Construct(); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, E_SYSTEM, "[E_SYSTEM] System error occurred."); + pLandscapeVisualElement->SetImplicitAnimationEnabled(false); + pLandscapeVisualElement->SetShowState(true); + pLandscapeVisualElement->SetSurface(pLandScapeSurface); + pLandscapeVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, landscapesize.width, landscapesize.height)); + + pIndicatorComponentArray[i].pPortraitEvasObject = pPortraitEvasObject; + pIndicatorComponentArray[i].pLandscapeEvasObject = pLandscapeEvasObject; + pIndicatorComponentArray[i].pPortraitSurface = pPortraitSurface; + pIndicatorComponentArray[i].pLandscapeSurface = pLandScapeSurface; + pIndicatorComponentArray[i].pPortraitVisualElement = pPortraitVisualElement; + pIndicatorComponentArray[i].pLandscapeVisualElement = pLandscapeVisualElement; + pIndicatorComponentArray[i].portraitVisualElementUsed = false; + pIndicatorComponentArray[i].landscapeVisualElementUsed = false; + pIndicatorComponentArray[i].pForm = null; } - return pIndicatorSurfaceArray; + return pIndicatorComponentArray; CATCH: - delete [] pIndicatorSurfaceArray; + delete [] pIndicatorComponentArray; return null; } bool -_IndicatorManager::IsFull(IndicatorSurface* pIndicatorSurfaceArray) const +_IndicatorManager::IsFull(IndicatorComponent* pIndicatorComponentArray) const { - if (pIndicatorSurfaceArray[0].portraitSurfaceUsed && pIndicatorSurfaceArray[0].landscapeSurfaceUsed - && pIndicatorSurfaceArray[1].portraitSurfaceUsed && pIndicatorSurfaceArray[1].landscapeSurfaceUsed) + if (pIndicatorComponentArray[0].portraitVisualElementUsed && pIndicatorComponentArray[0].landscapeVisualElementUsed + && pIndicatorComponentArray[1].portraitVisualElementUsed && pIndicatorComponentArray[1].landscapeVisualElementUsed) { return true; } @@ -333,21 +380,21 @@ _IndicatorManager::GetEvasObject(_Window* pWindow, _Form* pForm, _IndicatorOrien Evas_Object* pEvasObject = null; result r = E_SUCCESS; - IndicatorSurface* pIndicatorSurfaceArray = null; - r = __indicatorMap.GetValue(pWindow, pIndicatorSurfaceArray); - SysTryReturn(NID_UI_CTRL, pIndicatorSurfaceArray, null, r, "[%s] Propagating.", GetErrorMessage(r)); + IndicatorComponent* pIndicatorComponentArray = null; + r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray); + SysTryReturn(NID_UI_CTRL, pIndicatorComponentArray, null, r, "[%s] Propagating.", GetErrorMessage(r)); for(int i = 0 ; i < NUMBER_OF_OBJECT ; i++) { - if (pForm == pIndicatorSurfaceArray[i].pForm) + if (pForm == pIndicatorComponentArray[i].pForm) { if (orientation == _INDICATOR_ORIENTATION_PORTRAIT) { - pEvasObject = pIndicatorSurfaceArray[i].pPortraitEvasObject; + pEvasObject = pIndicatorComponentArray[i].pPortraitEvasObject; } else if(orientation == _INDICATOR_ORIENTATION_LANDSCAPE) { - pEvasObject = pIndicatorSurfaceArray[i].pLandscapeEvasObject; + pEvasObject = pIndicatorComponentArray[i].pLandscapeEvasObject; } } } @@ -379,4 +426,25 @@ _IndicatorManager::GetIndicatorSize(_IndicatorOrientation orientation) const return size; } +FloatDimension +_IndicatorManager::GetIndicatorSizeF(_IndicatorOrientation orientation) const +{ + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); + + FloatDimension indicatorSize(0.0f, 0.0f); + + if (orientation == _INDICATOR_ORIENTATION_PORTRAIT) + { + indicatorSize.width = portraitSize.width; + } + else + { + indicatorSize.width = landscapeSize.width; + } + GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, indicatorSize.height); + + return indicatorSize; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_InputPad.cpp b/src/ui/controls/FUiCtrl_InputPad.cpp index c8f5fd4..9d9bebe 100644 --- a/src/ui/controls/FUiCtrl_InputPad.cpp +++ b/src/ui/controls/FUiCtrl_InputPad.cpp @@ -54,15 +54,10 @@ _InputPad::~_InputPad(void) } result -_InputPad::Construct(const Rectangle& bounds) +_InputPad::Construct(const FloatRectangle& bounds) { result r = E_SUCCESS; - if(likely((_AccessibilityManager::IsActivated()))) - { - InitializeAccessebilityElementMonthNames(); - } - SetBounds(bounds); __pInputPadPresenter = new (std::nothrow) _InputPadPresenter(this); @@ -76,9 +71,12 @@ _InputPad::Construct(const Rectangle& bounds) if(likely((_AccessibilityManager::IsActivated()))) { - if (GetAccessibilityContainer() != null) + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + if (pContainer != null) { - GetAccessibilityContainer()->Activate(true); + InitializeAccessibilityElementMonthNames(); + pContainer->SetPriority(ACCESSIBILITY_PRIORITY_KEYPAD); + pContainer->Activate(true); } } @@ -133,7 +131,7 @@ _InputPad::SetInputPadStyle(const _InputPadStyle style) } String& -_InputPad::GetAccessebilityElementMonthName(int number) +_InputPad::GetAccessibilityElementMonthName(int number) { SysTryReturn(NID_UI_CTRL, (number >= 0), __pMonthNames[0], E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the month name."); @@ -303,7 +301,7 @@ _InputPad::RemoveAllAccessibilityElement(void) } void -_InputPad::InitializeAccessebilityElementMonthNames(void) +_InputPad::InitializeAccessibilityElementMonthNames(void) { __pMonthNames[0] = L"January"; __pMonthNames[1] = L"February"; diff --git a/src/ui/controls/FUiCtrl_InputPadPresenter.cpp b/src/ui/controls/FUiCtrl_InputPadPresenter.cpp index 7b7b927..352448a 100644 --- a/src/ui/controls/FUiCtrl_InputPadPresenter.cpp +++ b/src/ui/controls/FUiCtrl_InputPadPresenter.cpp @@ -29,6 +29,7 @@ #include "FUiCtrl_InputPad.h" #include "FUiCtrl_InputPadPresenter.h" #include "FUiCtrl_DateTimeUtils.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Ui::Controls; using namespace Tizen::Graphics; @@ -48,12 +49,12 @@ _InputPadPresenter::_InputPadPresenter(_InputPad* pInputPad) , __pKeypadButtonNormalEffectBitmap(null) , __pKeypadButtonPressedEffectBitmap(null) , __inputPadStyle(INPUTPAD_STYLE_NORMAL) - , __buttonWidth(0) - , __buttonHeight(0) - , __startX(0) - , __startY(0) - , __marginX(0) - , __marginY(0) + , __buttonWidth(0.0f) + , __buttonHeight(0.0f) + , __startX(0.0f) + , __startY(0.0f) + , __marginX(0.0f) + , __marginY(0.0f) , __pressedIndex(-1) , __isLayoutChanged(false) { @@ -81,7 +82,7 @@ _InputPadPresenter::~_InputPadPresenter(void) } result -_InputPadPresenter::Construct(const Rectangle& bounds) +_InputPadPresenter::Construct(const FloatRectangle& bounds) { result r = E_SUCCESS; @@ -103,7 +104,7 @@ _InputPadPresenter::Construct(const Rectangle& bounds) result _InputPadPresenter::LoadProperties(_ControlOrientation orientation) { - int marginTop = 0; + float marginTop = 0.0f; GET_SHAPE_CONFIG(INPUTPAD::BUTTON_WIDTH, orientation, __buttonWidth); GET_SHAPE_CONFIG(INPUTPAD::BUTTON_HEIGHT, orientation, __buttonHeight); @@ -233,10 +234,10 @@ _InputPadPresenter::GetInputPadStyle(void) const return __inputPadStyle; } -Rectangle +FloatRectangle _InputPadPresenter::GetButtonBounds(int index) const { - Rectangle buttonBounds; + FloatRectangle buttonBounds; buttonBounds.x = __startX + (index % INPUTPAD_BUTTON_COLUMN_MAX) * (__buttonWidth + __marginX); buttonBounds.y = __startY + (index / INPUTPAD_BUTTON_COLUMN_MAX) * (__buttonHeight + __marginY); @@ -250,13 +251,13 @@ result _InputPadPresenter::Draw(void) { result r = E_SUCCESS; - Rectangle bgBounds; + FloatRectangle bgBounds; Canvas* pCanvas = __pInputPad->GetCanvasN(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), r, "Propagating."); - bgBounds = pCanvas->GetBounds(); + bgBounds = pCanvas->GetBoundsF(); if(__pKeypadBackgroundBitmap != null) { @@ -325,7 +326,7 @@ _InputPadPresenter::DrawButton(Canvas& canvas, int index) result r = E_SUCCESS; Color textColor; - Rectangle buttonBounds = GetButtonBounds(index); + FloatRectangle buttonBounds = GetButtonBounds(index); int returnValue = GetReturnValue(index); // Do not Draw Extra Buttons in case of Numeric Keypad @@ -524,9 +525,9 @@ CATCH: } int -_InputPadPresenter::GetIndexFromTouchedPosition(const Point& point) const +_InputPadPresenter::GetIndexFromTouchedPosition(const FloatPoint& point) const { - int correctionValue = 0; + float correctionValue = 0.0f; GET_FIXED_VALUE_CONFIG(INPUTPAD::BUTTON_TOUCH_CORRECTION_Y, __pInputPad->GetOrientation(), correctionValue); @@ -535,8 +536,8 @@ _InputPadPresenter::GetIndexFromTouchedPosition(const Point& point) const return -1; } - int row = (point.y - __startY + __marginY + correctionValue) / (__buttonHeight + __marginY); - int col = (point.x - __startX + __marginX) / (__buttonWidth + __marginX); + int row = _CoordinateSystemUtils::ConvertToInteger((point.y - __startY + __marginY + correctionValue) / (__buttonHeight + __marginY)); + int col = _CoordinateSystemUtils::ConvertToInteger((point.x - __startX + __marginX) / (__buttonWidth + __marginX)); if (row >= INPUTPAD_BUTTON_ROW_MAX || col >= INPUTPAD_BUTTON_COLUMN_MAX) { return -1; diff --git a/src/ui/controls/FUiCtrl_Keypad.cpp b/src/ui/controls/FUiCtrl_Keypad.cpp old mode 100644 new mode 100755 index 25ff3a8..6c2ddf4 --- a/src/ui/controls/FUiCtrl_Keypad.cpp +++ b/src/ui/controls/FUiCtrl_Keypad.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Keypad.cpp * @brief This file contains implementation of _Keypad class @@ -22,7 +23,6 @@ */ #include -#include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_EcoreEvas.h" @@ -82,10 +82,8 @@ _Keypad::CreateKeypadN(void) SysTryCatch(NID_UI_CTRL, pKeypad, , r, "[%s] Propagating.", GetErrorMessage(r)); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#if defined(MULTI_WINDOW) r = pKeypad->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif pKeypad->AcquireHandle(); @@ -219,14 +217,11 @@ _Keypad::CreateHeaderForSIP(void) _Frame* pFrame = dynamic_cast <_Frame*>(pControlManager->GetCurrentFrame()); SysTryReturn(NID_UI_CTRL, pFrame, null, E_SYSTEM, "This instance is not constructed."); - Bitmap* pNormalBackgroundBitmap = null; - Bitmap* pReplacementColorBackgroundBitmap = null; - Color commandBackgroundColor; String doneText; String cancelText; - Rectangle bounds(0,0,0,0); + FloatRectangle bounds(0.0f,0.0f,0.0f,0.0f); - Dimension screenSize = pControlManager->GetScreenSize(); + FloatDimension screenSize = pControlManager->GetScreenSizeF(); pHeaderForSIP = _Toolbar::CreateToolbarN(true); SysTryReturn(NID_UI_CTRL, pHeaderForSIP, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance."); @@ -234,25 +229,6 @@ _Keypad::CreateHeaderForSIP(void) r = pHeaderForSIP->Construct(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); - - if (pNormalBackgroundBitmap) - { - GET_COLOR_CONFIG(FOOTER::BG_NORMAL, commandBackgroundColor); - pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pNormalBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), commandBackgroundColor); - - if (pReplacementColorBackgroundBitmap) - { - r = pHeaderForSIP->SetBackgroundBitmap(*pReplacementColorBackgroundBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - delete pReplacementColorBackgroundBitmap; - pReplacementColorBackgroundBitmap = null; - } - delete pNormalBackgroundBitmap; - pNormalBackgroundBitmap = null; - } - r = pHeaderForSIP->SetStyle(TOOLBAR_TEXT); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -270,7 +246,9 @@ _Keypad::CreateHeaderForSIP(void) bounds.width = screenSize.height; } - GET_SHAPE_CONFIG(HEADER::HEIGHT, orientation, bounds.height); + float height = 0.0f; + GET_SHAPE_CONFIG(HEADER::HEIGHT, orientation, height); + bounds.height = height; r = pHeaderForSIP->SetBounds(bounds); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -312,109 +290,14 @@ _Keypad::CreateButtonItemN(int actionId, const String& text) _Button* pButton = _Button::CreateButtonN(); SysTryReturn(NID_UI_CTRL, pButton, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create instance."); - Bitmap* pNormalBackgroundBitmap = null; - Bitmap* pPressedBackgroundBitmap = null; - Bitmap* pNormalBackgroundEffectBitmap = null; - Bitmap* pPressedBackgroundEffectBitmap = null; - Bitmap* pReplacementBitmap = null; - - int textSize = 0; - Color normalColor; - Color pressedColor; - r = pButton->SetActionId(actionId); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = pButton->SetText(text); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_SHAPE_CONFIG(FOOTER::ITEM_FONT_SIZE, GetOrientation(), textSize); - if (!IsFailed(r)) - { - r = pButton->SetTextSize(textSize); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - } - - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundEffectBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundEffectBitmap); - - GET_COLOR_CONFIG(FOOTER::ITEM_BG_NORMAL, normalColor); - - pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pNormalBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); - - if (pReplacementBitmap) - { - r = pButton->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *pReplacementBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pButton->SetBackgroundBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pReplacementBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pButton->SetBackgroundBitmap(_BUTTON_STATUS_DISABLED, *pReplacementBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - delete pReplacementBitmap; - pReplacementBitmap = null; - } - - if (pNormalBackgroundBitmap) - { - delete pNormalBackgroundBitmap; - pNormalBackgroundBitmap = null; - } - - GET_COLOR_CONFIG(FOOTER::BUTTON_BG_PRESSED, pressedColor); - - pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); - - if (pReplacementBitmap) - { - r = pButton->SetBackgroundBitmap(_BUTTON_STATUS_PRESSED, *pReplacementBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - delete pReplacementBitmap; - pReplacementBitmap = null; - } - - if (pPressedBackgroundBitmap) - { - delete pPressedBackgroundBitmap; - pPressedBackgroundBitmap = null; - } - - if (pNormalBackgroundEffectBitmap) - { - r = pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pNormalBackgroundEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, *pNormalBackgroundEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pNormalBackgroundEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - delete pNormalBackgroundEffectBitmap; - pNormalBackgroundEffectBitmap = null; - } - - if (pPressedBackgroundEffectBitmap) - { - r = pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pPressedBackgroundEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - delete pPressedBackgroundEffectBitmap; - pPressedBackgroundEffectBitmap = null; - } - return pButton; - CATCH: - delete pNormalBackgroundBitmap; - delete pPressedBackgroundBitmap; - delete pNormalBackgroundEffectBitmap; - delete pPressedBackgroundEffectBitmap; - delete pReplacementBitmap; - delete pButton; return null; @@ -426,13 +309,15 @@ _Keypad::ChangeLayoutInternal(void) result r = E_SUCCESS; _ControlManager* pControlManager = _ControlManager::GetInstance(); SysTryReturnResult(NID_UI_CTRL, pControlManager, E_SYSTEM, "Failed to get root."); - Dimension screenSize = pControlManager->GetScreenSize(); + FloatDimension screenSize = pControlManager->GetScreenSizeF(); _ControlOrientation orientation = GetOrientation(); _Frame* pFrame = dynamic_cast <_Frame*>(pControlManager->GetCurrentFrame()); SysTryReturn(NID_UI_CTRL, pFrame, null, E_SYSTEM, "This instance is not constructed."); - Rectangle bounds; + _Form* pForm = pFrame->GetCurrentForm(); + + FloatRectangle bounds; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { bounds.width = screenSize.width; @@ -444,6 +329,13 @@ _Keypad::ChangeLayoutInternal(void) bounds.height = screenSize.width; } + if (pForm && pForm->IsIndicatorVisible()) + { + float indicatorHeight = pForm->GetIndicatorBoundsF().height; + bounds.y += indicatorHeight; + bounds.height -= indicatorHeight; + } + SetResizable(true); SetMovable(true); r = SetBounds(bounds); @@ -453,17 +345,17 @@ _Keypad::ChangeLayoutInternal(void) __pChildEdit->ChangeLayout(orientation); - Rectangle editRect = bounds; + FloatRectangle editRect = bounds; - editRect.y = 0;//_keypad's client doesn't include indicator + editRect.y = 0.0f;//_keypad's client doesn't include indicator - int footerHeight = 0; + float footerHeight = 0.0f; GET_SHAPE_CONFIG(HEADER::HEIGHT, orientation, footerHeight); editRect.y += footerHeight; editRect.height -= footerHeight; - Rectangle keypadRect; + FloatRectangle keypadRect; if (__pChildEdit->IsKeypadExist()) { r = __pChildEdit->GetKeypadBounds(keypadRect); @@ -476,16 +368,16 @@ _Keypad::ChangeLayoutInternal(void) return r; } -Rectangle +FloatRectangle _Keypad::GetIndicatorBounds(void) const { - int indicatorwidth = 0; - int indicatorheight = 0; + float indicatorwidth = 0.0f; + float indicatorheight = 0.0f; GET_SHAPE_CONFIG(FORM::INDICATOR_WIDTH, GetOrientation(), indicatorwidth); GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight); - Rectangle rect (0, 0, indicatorwidth, indicatorheight); + FloatRectangle rect (0.0f, 0.0f, indicatorwidth, indicatorheight); return rect; } @@ -507,6 +399,8 @@ void _Keypad::OnNativeWindowActivated(void) { __pChildEdit->SetFocused(); + + return; } void @@ -525,25 +419,11 @@ _Keypad::OnDraw(void) return; } -#if defined(MULTI_WINDOW) -result -_Keypad::OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds) -{ - //Full-screen window - return E_SUCCESS; -} -bool -_Keypad::IsLayoutChangable(void) const -{ - //Full-screen window - return true; -} -#endif - result _Keypad::SetSingleLineEnabled(bool enabled) { SetProperty("singleLineEnabled", Variant(enabled)); + return E_SUCCESS; } @@ -621,6 +501,28 @@ _Keypad::RemoveTextEventListener(const _ITextEventListener& listener) } void +_Keypad::SetEditTextFilter(IEditTextFilter* pFilter) +{ + if (__pChildEdit) + { + __pChildEdit->SetEditTextFilter(pFilter); + } + + return; +} + +void +_Keypad::SendOpaqueCommand (const Tizen::Base::String& command) +{ + if (__pChildEdit) + { + __pChildEdit->SendOpaqueCommand(command); + } + + return; +} + +void _Keypad::OnActionPerformed(const _Control& source, int actionId) { if ((actionId != COMMAND_DONE_BUTTON_ID) && (actionId != COMMAND_CANCEL_BUTTON_ID)) @@ -653,9 +555,9 @@ _Keypad::OnActionPerformed(const _Control& source, int actionId) pParent->Invalidate(true); } - if (!__pCallerEdit->IsInputEnabled()) + if (!__pCallerEdit->IsInputEventEnabled()) { - __pCallerEdit->SetInputEnableState(true); + __pCallerEdit->SetInputEventEnableState(true); } __pCallerEdit->SendTextEvent(textEventStatus); } @@ -695,67 +597,23 @@ _Keypad::OnKeypadOpened(void) void _Keypad::OnKeypadClosed(void) { - if (__isCommandButtonPressed) - { - return; - } - - if (__pChildEdit->IsUsbKeyboardConnected()) - { - ChangeLayoutInternal(); - } - else - { - if (__isPredictionWindowOpendInUSBMode == true) - { - __isPredictionWindowOpendInUSBMode = false; - return; - } + ChangeLayoutInternal(); - Close(); - - CoreTextEventStatus textEventStatus = CORE_TEXT_EVENT_CHANGED; - - __text = __pChildEdit->GetText(); - - if (__pCallerEdit) - { - __pCallerEdit->SetText(__text); - __pCallerEdit->SendTextEvent(textEventStatus); - _Control* pParent = __pCallerEdit->GetParent(); - if (pParent) - { - pParent->Invalidate(true); - } - if (!__pCallerEdit->IsInputEnabled()) - { - __pCallerEdit->SetInputEnableState(true); - } - } - else - { - __pOwner->Invalidate(true); - if (__pTextEvent) - { - IEventArg* pEventArg = _TextEvent::CreateTextEventArgN(textEventStatus); - if (pEventArg) - { - __pTextEvent->Fire(*pEventArg); - } - } - } - } + return; } void _Keypad::OnKeypadBoundsChanged(void) { ChangeLayoutInternal();// predictive window show/hide + + return; } void _Keypad::OnKeypadActionPerformed(CoreKeypadAction keypadAction) { + return; } void @@ -765,6 +623,8 @@ _Keypad::OnChangeLayout(_ControlOrientation orientation) { ChangeLayoutInternal(); } + + return; } result diff --git a/src/ui/controls/FUiCtrl_KeypadEvent.cpp b/src/ui/controls/FUiCtrl_KeypadEvent.cpp old mode 100644 new mode 100755 index 9552c27..5d69c18 --- a/src/ui/controls/FUiCtrl_KeypadEvent.cpp +++ b/src/ui/controls/FUiCtrl_KeypadEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_KeypadEvent.cpp * @brief This file contains implementation of _KeypadEvent class diff --git a/src/ui/controls/FUiCtrl_KeypadImpl.cpp b/src/ui/controls/FUiCtrl_KeypadImpl.cpp index 647cbf8..24b3975 100644 --- a/src/ui/controls/FUiCtrl_KeypadImpl.cpp +++ b/src/ui/controls/FUiCtrl_KeypadImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_KeypadImpl.cpp * @brief This file contains implementation of _KeypadImpl class @@ -249,6 +250,22 @@ _KeypadImpl::SetText(const String& text) } void +_KeypadImpl::SetEditTextFilter(IEditTextFilter* pFilter) +{ + ClearLastResult(); + __pKeypad->SetEditTextFilter(pFilter); + return; +} + +void +_KeypadImpl::SendOpaqueCommand (const Tizen::Base::String& command) +{ + ClearLastResult(); + __pKeypad->SendOpaqueCommand(command); + return; +} + +void _KeypadImpl::OnTextValueChanged(const _Control& source) { IEventArg* pEventArg = _PublicTextEvent::CreateTextEventArgN(TEXT_EVENT_CHANGED); diff --git a/src/ui/controls/FUiCtrl_Label.cpp b/src/ui/controls/FUiCtrl_Label.cpp index e4fb939..c9d6a3c 100644 --- a/src/ui/controls/FUiCtrl_Label.cpp +++ b/src/ui/controls/FUiCtrl_Label.cpp @@ -25,6 +25,7 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_EflWindow.h" #include "FUiCtrl_Label.h" @@ -43,13 +44,15 @@ IMPLEMENT_PROPERTY(_Label); _Label::_Label(void) : __pLabelPresenter(null) , __text(L"") - , __textSize(0) + , __textSize(0.0f) , __horizontalAlignment(ALIGNMENT_CENTER) , __verticalAlignment(ALIGNMENT_MIDDLE) , __pBackgroundBitmap(null) , __pBackgroundEffectBitmap(null) - , __topMargin(0) - , __leftMargin(0) + , __leftMargin(0.0f) + , __topMargin(0.0f) + , __rightMargin(0.0f) + , __bottomMargin(0.0f) , __pTextElement(null) { result r = E_SUCCESS; @@ -72,8 +75,10 @@ _Label::_Label(void) GET_COLOR_CONFIG(LABEL::TEXT_NORMAL, __textColor); - GET_SHAPE_CONFIG(LABEL::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __topMargin); GET_SHAPE_CONFIG(LABEL::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __leftMargin); + GET_SHAPE_CONFIG(LABEL::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __topMargin); + GET_SHAPE_CONFIG(LABEL::RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __rightMargin); + GET_SHAPE_CONFIG(LABEL::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __bottomMargin); SetFocusable(false); @@ -82,6 +87,7 @@ _Label::_Label(void) if(pContainer) { pContainer->Activate(true); + InitializeAccessibilityElement(); } ClearLastResult(); @@ -154,7 +160,10 @@ _Label::OnDraw(void) result _Label::OnAttachedToMainTree(void) { - InitializeAccessibilityElement(); + if(__pTextElement) + { + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + } return E_SUCCESS; } @@ -162,25 +171,16 @@ _Label::OnAttachedToMainTree(void) void _Label::InitializeAccessibilityElement(void) { - if(__pTextElement) - { - return; - } - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if(pContainer) - { - __pTextElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pTextElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - - __pTextElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); - __pTextElement->SetLabel(GetText()); - __pTextElement->SetTrait(ACCESSIBILITY_TRAITS_LABEL); - __pTextElement->SetName(L"LabelText"); + __pTextElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, __pTextElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + __pTextElement->SetLabel(GetText()); + __pTextElement->SetTrait(ACCESSIBILITY_TRAITS_LABEL); + __pTextElement->SetName(L"LabelText"); pContainer->AddElement(*__pTextElement); - } return; } @@ -222,7 +222,7 @@ _Label::OnBoundsChanged(void) { if(__pTextElement) { - __pTextElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + __pTextElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); } return; @@ -247,7 +247,7 @@ _Label::OnFontInfoRequested(unsigned long& style, int& size) result _Label::SetText(const String& text) { - return SetProperty("text", Variant(text)); + return SetProperty(L"text", Variant(text)); } result @@ -269,7 +269,7 @@ _Label::SetPropertyText(const Variant& text) result _Label::SetTextColor(const Color& color) { - return SetProperty("textColor", Variant(color)); + return SetProperty(L"textColor", Variant(color)); } result @@ -353,15 +353,25 @@ _Label::SetTextVerticalAlignment(VerticalAlignment alignment) result _Label::SetTextConfig(int size, LabelTextStyle style) { + float floatSize = _CoordinateSystemUtils::ConvertToFloat(size); + + __pLabelPresenter->SetTextConfig(floatSize, style); + + return SetProperty(L"textSize", Variant(floatSize)); +} + +result +_Label::SetTextConfig(float size, LabelTextStyle style) +{ __pLabelPresenter->SetTextConfig(size, style); - return SetProperty("textSize", Variant(size)); + return SetProperty(L"textSize", Variant(size)); } result _Label::SetPropertyTextSize(const Variant& textSize) { - __textSize = textSize.ToInt(); + __textSize = textSize.ToFloat(); return E_SUCCESS; } @@ -369,7 +379,7 @@ _Label::SetPropertyTextSize(const Variant& textSize) String _Label::GetText(void) const { - Variant text = GetProperty("text"); + Variant text = GetProperty(L"text"); return text.ToString(); } @@ -395,7 +405,7 @@ _Label::GetTextVerticalAlignment(void) const Color _Label::GetTextColor(void) const { - Variant color = GetProperty("textColor"); + Variant color = GetProperty(L"textColor"); return color.ToColor(); } @@ -409,9 +419,15 @@ _Label::GetPropertyTextColor(void) const int _Label::GetTextSize(void) const { - Variant size = GetProperty("textSize"); + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_Label::GetTextSizeF(void) const +{ + Variant size = GetProperty(L"textSize"); - return size.ToInt(); + return size.ToFloat(); } Variant @@ -429,63 +445,136 @@ _Label::GetTextStyle(void) const result _Label::SetMargin(int topMargin, int leftMargin) { + float floatTopMargin = _CoordinateSystemUtils::ConvertToFloat(topMargin); + float floatLeftMargin = _CoordinateSystemUtils::ConvertToFloat(leftMargin); + + return SetMargin(floatTopMargin, floatLeftMargin); +} + +result +_Label::SetMargin(float topMargin, float leftMargin) +{ __topMargin = topMargin; __leftMargin = leftMargin; return E_SUCCESS; } +result +_Label::SetMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin) +{ + float floatLeftMargin = _CoordinateSystemUtils::ConvertToFloat(leftMargin); + float floatTopMargin = _CoordinateSystemUtils::ConvertToFloat(topMargin); + float floatRightMargin = _CoordinateSystemUtils::ConvertToFloat(rightMargin); + float floatBottomMargin = _CoordinateSystemUtils::ConvertToFloat(bottomMargin); + + return SetMargin(floatLeftMargin, floatTopMargin, floatRightMargin, floatBottomMargin); +} + +result +_Label::SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin) +{ + __leftMargin = leftMargin; + __topMargin = topMargin; + __rightMargin = rightMargin; + __bottomMargin = bottomMargin; + + return E_SUCCESS; +} + +int +_Label::GetLeftMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetLeftMarginF()); +} + +float +_Label::GetLeftMarginF(void) const +{ + return __leftMargin; +} + int _Label::GetTopMargin(void) const { + return _CoordinateSystemUtils::ConvertToInteger(GetTopMarginF()); +} + +float +_Label::GetTopMarginF(void) const +{ return __topMargin; } int -_Label::GetLeftMargin(void) const +_Label::GetRightMargin(void) const { - return __leftMargin; + return _CoordinateSystemUtils::ConvertToInteger(GetRightMarginF()); +} + +float +_Label::GetRightMarginF(void) const +{ + return __rightMargin; +} + +int +_Label::GetBottomMargin(void) const +{ + return _CoordinateSystemUtils::ConvertToInteger(GetBottomMarginF()); +} + +float +_Label::GetBottomMarginF(void) const +{ + return __bottomMargin; } -Tizen::Graphics::Dimension +Dimension _Label::GetContentSize(void) const { - return GetContentSizeInternal(); + return _CoordinateSystemUtils::ConvertToInteger(GetContentSizeInternalF()); +} + +FloatDimension +_Label::GetContentSizeF(void) const +{ + return GetContentSizeInternalF(); } -Tizen::Graphics::Dimension -_Label::GetContentSizeInternal(void) const +FloatDimension +_Label::GetContentSizeInternalF(void) const { if (__text.IsEmpty() && __pBackgroundBitmap == null) { - return Dimension(GetBounds().width, GetBounds().height); + return FloatDimension(GetBoundsF().width, GetBoundsF().height); } - Dimension dimension(0,0); - Rectangle contentRect(0,0,0,0); + FloatDimension dimension(0.0f, 0.0f); + FloatRectangle contentRect(0.0f, 0.0f, 0.0f , 0.0f); TextObject* pTextObject = __pLabelPresenter->GetTextObject(); TextObjectActionType previousActionType = pTextObject->GetAction(); TextObjectWrapType previousWrapType = pTextObject->GetWrap(); - Rectangle previousRect = pTextObject->GetBounds(); + FloatRectangle previousRect = pTextObject->GetBoundsF(); pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); pTextObject->Compose(); - dimension = pTextObject->GetTextExtent(0, pTextObject->GetTextLength()); + dimension = pTextObject->GetTextExtentF(0, pTextObject->GetTextLength()); - contentRect.width = _ControlManager::GetInstance()->GetScreenSize().width; + contentRect.width = _ControlManager::GetInstance()->GetScreenSizeF().width; - if (dimension.width > contentRect.width - GetBounds().x) + if (dimension.width > contentRect.width - GetBoundsF().x) { - dimension.width = contentRect.width - GetBounds().x; + dimension.width = contentRect.width - GetBoundsF().x; - pTextObject->SetBounds(Rectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height)); + pTextObject->SetBounds(FloatRectangle(previousRect.x, previousRect.y, dimension.width, previousRect.height)); pTextObject->Compose(); } - dimension.height = pTextObject->GetTotalHeight(); + dimension.height = pTextObject->GetTotalHeightF(); pTextObject->SetBounds(previousRect); pTextObject->SetAction(previousActionType); @@ -497,8 +586,8 @@ _Label::GetContentSizeInternal(void) const if (__pBackgroundBitmap != null) { - dimension.width = GetBounds().width; - dimension.height = GetBounds().height; + dimension.width = GetBoundsF().width; + dimension.height = GetBoundsF().height; } return dimension; diff --git a/src/ui/controls/FUiCtrl_LabelImpl.cpp b/src/ui/controls/FUiCtrl_LabelImpl.cpp index 7e8ffb7..61c5aa1 100644 --- a/src/ui/controls/FUiCtrl_LabelImpl.cpp +++ b/src/ui/controls/FUiCtrl_LabelImpl.cpp @@ -21,12 +21,15 @@ #include #include +#include +#include #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_LabelImpl.h" #include "FUiCtrl_Label.h" + using namespace Tizen::App; using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -48,6 +51,20 @@ _LabelImpl::LabelSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation return dimension; } +FloatDimension +_LabelImpl::LabelSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension dimension(0.0f, 0.0f); + + r = GET_DIMENSION_CONFIG(LABEL::MIN_SIZE, orientation, dimension); + SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); + + SetLastResult(r); + + return dimension; +} + _LabelImpl* _LabelImpl::GetInstance(Label& label) { @@ -100,6 +117,34 @@ CATCH: return null; } +_LabelImpl* +_LabelImpl::CreateLabelImplN(Label* pControl, const FloatRectangle& bounds) +{ + result r = E_SUCCESS; + r = GET_SIZE_INFO(Label).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The given size is not valid."); + + _Label* pCore = _Label::CreateLabelN(); + SysTryReturn(NID_UI_CTRL, pCore, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _LabelImpl* pImpl = new (std::nothrow) _LabelImpl(pControl, pCore); + r = _ControlImpl::CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Label), bounds, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pImpl->SetBackgroundColor(Color(0, 0, 0, 0)); // for transparent + + ClearLastResult(); + + return pImpl; + +CATCH: + delete pImpl; + return null; +} + Color _LabelImpl::GetColorOnError(void) { @@ -142,10 +187,22 @@ _LabelImpl::OnBoundsChanged(const Rectangle& oldRect, const Rectangle& newRect) return E_SUCCESS; } +result +_LabelImpl::OnBoundsChanged(const FloatRectangle& oldRect, const FloatRectangle& newRect) +{ + return E_SUCCESS; +} + Tizen::Graphics::Dimension _LabelImpl::GetContentSize(void) const { - return GetCore().GetContentSizeInternal(); + return GetCore().GetContentSize(); +} + +Tizen::Graphics::FloatDimension +_LabelImpl::GetContentSizeF(void) const +{ + return GetCore().GetContentSizeF(); } result @@ -202,12 +259,28 @@ _LabelImpl::SetTextConfig(int size, LabelTextStyle style) } result +_LabelImpl::SetTextConfig(float size, LabelTextStyle style) +{ + result r = GetCore().SetTextConfig(size, style); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result _LabelImpl::SetMargin(int topMargin, int leftMargin) { result r = GetCore().SetMargin(topMargin, leftMargin); SetLastResultReturn(r); } +result +_LabelImpl::SetMargin(float topMargin, float leftMargin) +{ + result r = GetCore().SetMargin(topMargin, leftMargin); + SetLastResultReturn(r); +} + String _LabelImpl::GetText(void) const { @@ -248,6 +321,14 @@ _LabelImpl::GetTextSize(void) const return GetCore().GetTextSize(); } +float +_LabelImpl::GetTextSizeF(void) const +{ + ClearLastResult(); + + return GetCore().GetTextSizeF(); +} + LabelTextStyle _LabelImpl::GetTextStyle(void) const { @@ -264,6 +345,14 @@ _LabelImpl::GetTopMargin(void) const return GetCore().GetTopMargin(); } +float +_LabelImpl::GetTopMarginF(void) const +{ + ClearLastResult(); + + return GetCore().GetTopMarginF(); +} + int _LabelImpl::GetLeftMargin(void) const { @@ -272,6 +361,14 @@ _LabelImpl::GetLeftMargin(void) const return GetCore().GetLeftMargin(); } +float +_LabelImpl::GetLeftMarginF(void) const +{ + ClearLastResult(); + + return GetCore().GetLeftMarginF(); +} + class _LabelMaker : public _UiBuilderControlMaker { @@ -295,13 +392,6 @@ protected: Label* pLabel = null; Rectangle rect; - AppResource* pAppResource = null; - UiApp* pUiApp = UiApp::GetInstance(); - if (pUiApp) - { - pAppResource = UiApp::GetInstance()->GetAppResource(); - } - HorizontalAlignment horizontalAlignment; VerticalAlignment verticalAlignment; Tizen::Base::String elementString; @@ -378,7 +468,8 @@ protected: if (pControl->GetElement(L"backgroundBitmapPath", elementString) || pControl->GetElement(L"BGBitmapPath", elementString)) { Bitmap* pBackgroundBitmap = null; - pBackgroundBitmap = pAppResource->GetBitmapN(elementString); + pBackgroundBitmap = LoadBitmapN(elementString); + if (pBackgroundBitmap != null) { pLabel->SetBackgroundBitmap(*pBackgroundBitmap); @@ -449,6 +540,19 @@ protected: (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(rect.x, rect.y, rect.width, rect.height); //---------end safety code------------------------ + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pLabel->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"LabelText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pLabel; } private: diff --git a/src/ui/controls/FUiCtrl_LabelPresenter.cpp b/src/ui/controls/FUiCtrl_LabelPresenter.cpp index c6b6aac..04e46f0 100644 --- a/src/ui/controls/FUiCtrl_LabelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_LabelPresenter.cpp @@ -27,6 +27,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiAnim_VisualElement.h" #include "FUiCtrl_LabelPresenter.h" @@ -51,7 +52,7 @@ _LabelPresenter::_LabelPresenter(void) , __pBase(null) , __textStyle(LABEL_TEXT_STYLE_NORMAL) , __fontStyle(0) - , __fontSize(0) + , __fontSize(0.0f) { } @@ -79,7 +80,7 @@ _LabelPresenter::Construct(const _Label& label) __pLabel = const_cast <_Label*>(&label); __fontStyle = FONT_STYLE_PLAIN; - __fontSize = __pLabel->GetTextSize(); + __fontSize = __pLabel->GetTextSizeF(); __pFont = __pLabel->GetFallbackFont(); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, __pFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -141,8 +142,9 @@ _LabelPresenter::InitTextObject(void) __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); - __pTextObject->SetBounds(Rectangle(__pLabel->GetLeftMargin(), __pLabel->GetTopMargin(), - __pLabel->GetBounds().width - __pLabel->GetLeftMargin() * 2, __pLabel->GetBounds().height - __pLabel->GetTopMargin() * 2)); + __pTextObject->SetBounds(FloatRectangle(__pLabel->GetLeftMargin(), __pLabel->GetTopMargin(), + __pLabel->GetBoundsF().width - (__pLabel->GetLeftMargin() + __pLabel->GetRightMargin()), + __pLabel->GetBoundsF().height - (__pLabel->GetTopMargin() + __pLabel->GetBottomMargin()))); __pTextObject->Compose(); return E_SUCCESS; @@ -156,6 +158,7 @@ _LabelPresenter::OnFontChanged(Font* pFont) return; } +#if 0 result _LabelPresenter::SetTextConfig(int size, LabelTextStyle style) { @@ -189,6 +192,41 @@ _LabelPresenter::SetTextConfig(int size, LabelTextStyle style) return E_SUCCESS; } +#endif + +result +_LabelPresenter::SetTextConfig(float size, LabelTextStyle style) +{ + result r = E_SUCCESS; + + unsigned long fontStyle = FONT_STYLE_PLAIN; + bool isStrikeOut = __pFont->IsStrikeOut(); + bool isUnderLine = __pFont->IsUnderlined(); + + __textStyle = style; + + if (__textStyle == LABEL_TEXT_STYLE_ITALIC) + { + fontStyle |= FONT_STYLE_ITALIC; + } + + if (__textStyle == LABEL_TEXT_STYLE_BOLD) + { + fontStyle |= FONT_STYLE_BOLD; + } + + __fontStyle = fontStyle; + __fontSize = size; + + __pFont = __pLabel->GetFallbackFont(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, __pFont, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pFont->SetStrikeOut(isStrikeOut); + __pFont->SetUnderline(isUnderLine); + + return E_SUCCESS; +} LabelTextStyle _LabelPresenter::GetTextStyle(void) const @@ -197,7 +235,7 @@ _LabelPresenter::GetTextStyle(void) const } void -_LabelPresenter::SetFontInfo(unsigned long style, int size) +_LabelPresenter::SetFontInfo(unsigned long style, float size) { __fontStyle = style; __fontSize = size; @@ -209,6 +247,15 @@ void _LabelPresenter::OnFontInfoRequested(unsigned long& style, int& size) { style = __fontStyle; + size = _CoordinateSystemUtils::ConvertToInteger(__fontSize); + + return; +} + +void +_LabelPresenter::OnFontInfoRequested(unsigned long& style, float& size) +{ + style = __fontStyle; size = __fontSize; return; @@ -235,7 +282,7 @@ _LabelPresenter::DrawBackground(void) Bitmap* pBitmap = __pLabel->GetBackgroundBitmap(); Bitmap* pEffectBitmap = __pLabel->GetBackgroundEffectBitmap(); - Rectangle bounds(0, 0, __pLabel->GetBounds().width, __pLabel->GetBounds().height); + FloatRectangle bounds(0.0f, 0.0f, __pLabel->GetBoundsF().width, __pLabel->GetBoundsF().height); Color bgColor = __pLabel->GetBackgroundColor(); @@ -256,22 +303,22 @@ _LabelPresenter::DrawBackground(void) if (pBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBitmap); } else { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pBitmap); } if (pEffectBitmap != null) { if (pEffectBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(bounds, *pEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pEffectBitmap); } else { - pCanvas->DrawBitmap(Rectangle(0, 0, bounds.width, bounds.height), *pEffectBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)), *pEffectBitmap); } } } @@ -319,9 +366,13 @@ _LabelPresenter::DrawText(void) TextObjectAlignment horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER; TextObjectAlignment verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE; - int topMargin = __pLabel->GetTopMargin(); - int leftMargin = __pLabel->GetLeftMargin(); - Rectangle rect(leftMargin, topMargin, __pLabel->GetBounds().width - leftMargin * 2, __pLabel->GetBounds().height - topMargin * 2 ); + float leftMargin = __pLabel->GetLeftMargin(); + float topMargin = __pLabel->GetTopMargin(); + float rightMargin = __pLabel->GetRightMargin(); + float bottomMargin = __pLabel->GetBottomMargin(); + + FloatRectangle rect(leftMargin, topMargin, __pLabel->GetBoundsF().width - (leftMargin + rightMargin), __pLabel->GetBoundsF().height - (topMargin + bottomMargin)); + if (rect.width <= 0 || rect.height <= 0) { SysLog(NID_UI_CTRL, "text display rectangle is wrong."); @@ -337,7 +388,7 @@ _LabelPresenter::DrawText(void) return; } - __pTextObject->RemoveAll(); + __pTextObject->RemoveAll(true); pSimpleText = new (std::nothrow) TextSimple(const_cast(__pLabel->GetText().GetPointer()), __pLabel->GetText().GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); __pTextObject->AppendElement(*pSimpleText); diff --git a/src/ui/controls/FUiCtrl_LanguageEvent.cpp b/src/ui/controls/FUiCtrl_LanguageEvent.cpp old mode 100644 new mode 100755 index b2e7bd0..6e5f0b4 --- a/src/ui/controls/FUiCtrl_LanguageEvent.cpp +++ b/src/ui/controls/FUiCtrl_LanguageEvent.cpp @@ -17,7 +17,7 @@ /** * @file FUiCtrl_LanguageEvent.cpp * @brief This is the implementation for the _LanguageEvent class. - * @version 1.0 + * @version 2.0 */ // includes diff --git a/src/ui/controls/FUiCtrl_LinkEvent.cpp b/src/ui/controls/FUiCtrl_LinkEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_ListBaseImpl.cpp b/src/ui/controls/FUiCtrl_ListBaseImpl.cpp index df1864c..5f15d8f 100644 --- a/src/ui/controls/FUiCtrl_ListBaseImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListBaseImpl.cpp @@ -264,9 +264,19 @@ _ListBaseImpl::IsItemNew(const CustomListItem& item) const result _ListBaseImpl::UpdateIndices(int groupIndex, int itemIndex, int updateBy) { + int index = 0; + if (updateBy == -1) + { + index = itemIndex; + } + else + { + index = itemIndex + 1; + } + if (groupIndex == -1) { - for (int index = itemIndex; index < _itemsList.GetCount(); index++) + for (; index < _itemsList.GetCount(); index++) { _TableViewItemData* pTableViewItemData = GetTableViewItemAt(-1, index); @@ -302,7 +312,7 @@ _ListBaseImpl::UpdateIndices(int groupIndex, int itemIndex, int updateBy) { int subItemCount = GetSubItemCountAt(groupIndex); - for (int index = itemIndex; index < subItemCount; index++) + for (; index < subItemCount; index++) { _TableViewItemData* pTableViewItemData = GetTableViewItemAt(groupIndex, index); @@ -322,13 +332,13 @@ _ListBaseImpl::UpdateIndices(int groupIndex, int itemIndex, int updateBy) } result -_ListBaseImpl::InsertIntoItemsList(const CustomListItem& item, int groupIndex, int itemIndex, bool updateIndexes) +_ListBaseImpl::InsertIntoItemsList(const CustomListItem& item, int groupIndex, int itemIndex, bool updateIndices) { result r = E_SUCCESS; if (GetCore().GetFirstDrawnFlag() == true) { - updateIndexes = false; + updateIndices = false; } if (groupIndex == -1) @@ -357,7 +367,7 @@ _ListBaseImpl::InsertIntoItemsList(const CustomListItem& item, int groupIndex, i pCustomListItem->__pCustomListItemImpl->__pSubItemsList->InsertAt(item, itemIndex); } - if (updateIndexes) + if (updateIndices) { return UpdateIndices(groupIndex, itemIndex, 1); } @@ -368,13 +378,13 @@ _ListBaseImpl::InsertIntoItemsList(const CustomListItem& item, int groupIndex, i } result -_ListBaseImpl::RemoveFromItemsList(int groupIndex, int itemIndex, bool updateIndexes) +_ListBaseImpl::RemoveFromItemsList(int groupIndex, int itemIndex, bool updateIndices) { result r = E_SUCCESS; if (GetCore().GetFirstDrawnFlag() == true) { - updateIndexes = false; + updateIndices = false; } if (groupIndex == -1) @@ -399,7 +409,7 @@ _ListBaseImpl::RemoveFromItemsList(int groupIndex, int itemIndex, bool updateInd SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "A system error has occurred. Failed to remove an item."); } - if (updateIndexes) + if (updateIndices) { return UpdateIndices(groupIndex, itemIndex, -1); } @@ -550,16 +560,20 @@ _ListBaseImpl::DrawItem(int groupIndex, int itemIndex) if (itemIndex == -1) { _TableViewGroupItemData* pTableViewGroupItemData = GetTableViewGroupItemAt(groupIndex); - SysTryReturnVoidResult(NID_UI_CTRL, pTableViewGroupItemData, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d)", groupIndex); - pTableViewGroupItemData->Invalidate(true); + if (pTableViewGroupItemData) + { + pTableViewGroupItemData->Invalidate(true); + } } else { _TableViewItemData* pTableViewItemData = GetTableViewItemAt(groupIndex, itemIndex); - SysTryReturnVoidResult(NID_UI_CTRL, pTableViewItemData, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get an item at groupIndex(%d), itemIndex(%d)", groupIndex, itemIndex); - pTableViewItemData->Invalidate(true); + if (pTableViewItemData) + { + pTableViewItemData->Invalidate(true); + } } } @@ -802,4 +816,10 @@ _ListBaseImpl::OnDraw(void) } } +void +_ListBaseImpl::OnBoundsChanged(void) +{ + GetCore().OnBoundsChanged(); +} + }}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ListContextItemImpl.cpp b/src/ui/controls/FUiCtrl_ListContextItemImpl.cpp index 7740e45..f7fbd64 100644 --- a/src/ui/controls/FUiCtrl_ListContextItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListContextItemImpl.cpp @@ -54,7 +54,7 @@ _ListContextItemImpl::_ListContextItemImpl(ListContextItem* pPublic) : __pPublic(pPublic) , __pContextItem(null) { - SysTryReturnVoidResult(NID_UI_CTRL, __pContextItem != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is not sufficient."); + // nothing } _ListContextItemImpl::~_ListContextItemImpl(void) @@ -106,11 +106,11 @@ CATCH: result _ListContextItemImpl::Construct(void) { - __pContextItem = _ListViewContextItem::CreateListViewContextItemN(0); + __pContextItem = _ListViewContextItem::CreateListViewContextItemN(0.0f); SysTryReturn(NID_UI_CTRL, (__pContextItem != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); Color bgColor(0, 0, 0, 0); - GET_COLOR_CONFIG(LISTVIEW::CONTEXTITEM_BG_NORMAL, bgColor); + GET_COLOR_CONFIG(TABLEVIEW::CONTEXTITEM_BG_NORMAL, bgColor); SetBackgroundColor(bgColor); return E_SUCCESS; diff --git a/src/ui/controls/FUiCtrl_ListImpl.cpp b/src/ui/controls/FUiCtrl_ListImpl.cpp index 323e846..842493a 100644 --- a/src/ui/controls/FUiCtrl_ListImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListImpl.cpp @@ -102,11 +102,13 @@ _ListItemDataProvider::CreateItem(int index, int itemWidth) bool _ListItemDataProvider::DeleteItem(const int itemIndex, TableViewItem* pItem) { - _TableViewItemData* pTableViewItemData = dynamic_cast<_TableViewItemData*>(pItem); - delete pTableViewItemData; + delete pItem; - CustomListItem* pCustomListItem = __pListImpl->GetCustomListItemAt(-1, itemIndex); - pCustomListItem->__pCustomListItemImpl->__pTableViewItemData = null; + if (__pListImpl->__directDelete == false) + { + CustomListItem* pCustomListItem = __pListImpl->GetCustomListItemAt(-1, itemIndex); + pCustomListItem->__pCustomListItemImpl->__pTableViewItemData = null; + } return true; } @@ -198,10 +200,10 @@ _ListImpl::_ListImpl(Control* pList, _TableView* pCore) , __pNumberElements(null) , __pItemFormat(null) , __pItemProvider(null) - , maxCount(0) - , divider(false) + , __maxCount(0) + , __isCheckStyle(true) + , __directDelete(false) { - } _ListImpl::~_ListImpl(void) @@ -293,7 +295,7 @@ _ListImpl::Initialize(ListItemFormat itemFormat, int row1Height, int row2Height, { result r = E_SUCCESS; - GET_FIXED_VALUE_CONFIG(LIST::LIST_ITEM_MAX_COUNT, GetCore().GetOrientation(), maxCount); + GET_FIXED_VALUE_CONFIG(LIST::LIST_ITEM_MAX_COUNT, GetCore().GetOrientation(), __maxCount); __pItemProvider = new (std::nothrow) _ListItemDataProvider(this); SysTryReturnResult(NID_UI_CTRL, (__pItemProvider != null), E_OUT_OF_MEMORY, "Memory allocation failed."); @@ -370,6 +372,7 @@ _ListImpl::SetStyle(ListStyle style) { case LIST_STYLE_NORMAL: case LIST_STYLE_NUMBER: + __isCheckStyle = false; _annexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL; break; @@ -379,7 +382,6 @@ _ListImpl::SetStyle(ListStyle style) break; case LIST_STYLE_RADIO: - divider = true; _annexStyle = TABLE_VIEW_ANNEX_STYLE_RADIO; break; @@ -389,7 +391,6 @@ _ListImpl::SetStyle(ListStyle style) break; case LIST_STYLE_MARK: - divider = true; _annexStyle = TABLE_VIEW_ANNEX_STYLE_MARK; break; @@ -399,7 +400,6 @@ _ListImpl::SetStyle(ListStyle style) break; case LIST_STYLE_ONOFF: - divider = true; _annexStyle = TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING; break; @@ -561,7 +561,7 @@ _ListImpl::AddItem(const String* pText1, const String* pText2, { if (__listStyle == LIST_STYLE_NUMBER) { - SysTryReturnResult(NID_UI_CTRL, (GetItemCount() < maxCount), + SysTryReturnResult(NID_UI_CTRL, (GetItemCount() < __maxCount), E_MAX_EXCEEDED, "AddItem operation exceeds the maximum limit for this list style"); } @@ -576,7 +576,7 @@ _ListImpl::InsertItemAt(int index, const String* pText1, const String* pText2, if (__listStyle == LIST_STYLE_NUMBER) { - SysTryReturnResult(NID_UI_CTRL, (GetItemCount() < maxCount), + SysTryReturnResult(NID_UI_CTRL, (GetItemCount() < __maxCount), E_MAX_EXCEEDED, "InsertItemAt operation exceeds the maximum limit for this list style"); } @@ -682,14 +682,18 @@ _ListImpl::RemoveItemAt(int index) SysTryReturnResult(NID_UI_CTRL, (index >= 0 && index < GetItemCount()), E_OUT_OF_RANGE, "The index(%d) is out of range.", index); + r = RemoveFromItemsList(-1, index); + SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "Failed to perform RemoveAt operation"); + + __directDelete = true; + if (GetCore().GetFirstDrawnFlag() == false) { r = GetCore().RefreshTableView(groupIndex, index, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Propagating."); } - r = RemoveFromItemsList(-1, index); - SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "Failed to perform RemoveAt operation"); + __directDelete = false; if (__listStyle == LIST_STYLE_NUMBER) { @@ -1405,12 +1409,12 @@ _ListImpl::GetItemMargins(int& leftMargin, int& numberStyleMargin, int& dividerM GET_SHAPE_CONFIG(LIST::LIST_ITEM_NUMBER_STYLE_MARGIN, GetCore().GetOrientation(), numberStyleMargin); } - if (_isDividerEnabled == true || divider == true) + if (__isCheckStyle) { GET_SHAPE_CONFIG(LIST::LIST_ITEM_DIVIDER_MARGIN, GetCore().GetOrientation(), dividerMargin); } - GET_SHAPE_CONFIG(LIST::LIST_ITEM_LEFT_MARGIN, GetCore().GetOrientation(), leftMargin); + GET_SHAPE_CONFIG(LIST::LIST_ITEM_LEFT_MARGIN, GetCore().GetOrientation(), leftMargin); GET_SHAPE_CONFIG(LIST::LIST_ITEM_LOWER_MARGIN, GetCore().GetOrientation(), lowerMargin); GET_SHAPE_CONFIG(LIST::LIST_ITEM_UPPER_MARGIN, GetCore().GetOrientation(), upperMargin); } @@ -1423,10 +1427,10 @@ _ListImpl::GetElementRects(Rectangle& text1Rect, Rectangle& text2Rect, Rectangle int leftMargin = 0; int numberStyleMargin = 0; int dividerMargin = 0; - int lowerMargin = 0; - int upperMargin = 0; + int lowerMargin = 0; + int upperMargin = 0; - GetItemMargins(leftMargin, numberStyleMargin, dividerMargin, lowerMargin, upperMargin); + GetItemMargins(leftMargin, numberStyleMargin, dividerMargin, lowerMargin, upperMargin); switch (__listItemFormat) { @@ -1516,7 +1520,7 @@ _ListImpl::GetElementRects(Rectangle& text1Rect, Rectangle& text2Rect, Rectangle case LIST_ITEM_DOUBLE_FULLTEXT_IMAGE_TEXT: - img1Rect.x = leftMargin + numberStyleMargin; + img1Rect.x = leftMargin + numberStyleMargin; img1Rect.y = __row1Height; img1Rect.width = __column1Width; img1Rect.height = __row2Height; @@ -1594,7 +1598,7 @@ _ListImpl::GetElementRects(Rectangle& text1Rect, Rectangle& text2Rect, Rectangle img1Rect.x = __column1Width + leftMargin + numberStyleMargin; img1Rect.y = upperMargin; - img1Rect.width = (__column1Width + __column2Width + dividerMargin <= listSize.width) ? (__column2Width) : (__column2Width - dividerMargin); + img1Rect.width = (__column1Width + __column2Width + dividerMargin <= listSize.width) ? (__column2Width) : (__column2Width - dividerMargin); img1Rect.height = __row1Height + __row2Height - lowerMargin; text1Rect.x = leftMargin + numberStyleMargin; diff --git a/src/ui/controls/FUiCtrl_ListItemBaseImpl.cpp b/src/ui/controls/FUiCtrl_ListItemBaseImpl.cpp index efe1526..fc78d46 100644 --- a/src/ui/controls/FUiCtrl_ListItemBaseImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListItemBaseImpl.cpp @@ -25,6 +25,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_ListContextItemImpl.h" #include "FUiCtrl_ListItemBaseImpl.h" @@ -69,11 +70,6 @@ _ListItemBaseImpl::~_ListItemBaseImpl(void) { if (__pListViewItem != null) { - __pListViewItem->RemoveTouchLongPressGestureEventListener(*this); - } - - if (__pListViewItem != null) - { __pListViewItem->Release(); } @@ -100,7 +96,7 @@ _ListItemBaseImpl::GetPublic(void) } _ListItemBaseImpl* -_ListItemBaseImpl::CreateListItemBaseImplN(ListItemBase* pPublic, const Dimension& itemSize, ListAnnexStyle style) +_ListItemBaseImpl::CreateListItemBaseImplN(ListItemBase* pPublic, const FloatDimension& itemSize, ListAnnexStyle style) { _ListItemBaseImpl* pImpl = new (std::nothrow) _ListItemBaseImpl(pPublic); SysTryReturn(NID_UI_CTRL, (pImpl != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -118,19 +114,18 @@ CATCH: } result -_ListItemBaseImpl::Construct(const Dimension& itemSize, ListAnnexStyle style) +_ListItemBaseImpl::Construct(const FloatDimension& itemSize, ListAnnexStyle style) { - SysTryReturn(NID_UI_CTRL, (itemSize.width >= 0) && (itemSize.height >= 0), E_INVALID_ARG, E_INVALID_ARG, - ("[E_INVALID_ARG] The item size should be greater than 0.")); + SysTryReturn(NID_UI_CTRL, (itemSize.width >= 0.0f) && (itemSize.height >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, + ("[E_INVALID_ARG] The item size should be greater than 0.0f")); __pListViewItem = _ListViewItem::CreateListViewItemN(itemSize.height); SysTryReturn(NID_UI_CTRL, (__pListViewItem != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); __pListViewItem->SetSize(itemSize); - __pListViewItem->SetBounds(Rectangle(0, 0, itemSize.width, itemSize.height)); + __pListViewItem->SetBounds(FloatRectangle(0.0f, 0.0f, itemSize.width, itemSize.height)); __pListViewItem->SetBackgroundColor(Color(0, 0, 0, 0)); __pListViewItem->SetProgressValue(-1); - __pListViewItem->AddTouchLongPressGestureEventListener(*this); __pListViewItem->SetSelectionStyle(TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE); __itemSize = itemSize; @@ -145,7 +140,7 @@ _ListItemBaseImpl::GetListViewItem(void) const return __pListViewItem; } -Dimension +FloatDimension _ListItemBaseImpl::GetItemSize(void) const { return __itemSize; @@ -287,9 +282,9 @@ _ListItemBaseImpl::SetProgressValue(int value) } result -_ListItemBaseImpl::SetProgressMargins(int leftMargin, int rightMargin) +_ListItemBaseImpl::SetProgressMargins(float leftMargin, float rightMargin) { - SysTryReturn(NID_UI_CTRL, (leftMargin >= 0) && (rightMargin >= 0), E_INVALID_ARG, E_INVALID_ARG, + SysTryReturn(NID_UI_CTRL, (leftMargin >= 0.0f) && (rightMargin >= 0.0f), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] It is invalid argument.")); SysTryReturn(NID_UI_CTRL, (leftMargin < (__itemSize.width - rightMargin)), E_INVALID_ARG, E_INVALID_ARG, @@ -301,25 +296,21 @@ _ListItemBaseImpl::SetProgressMargins(int leftMargin, int rightMargin) return E_SUCCESS; } -int +float _ListItemBaseImpl::GetAnnexWidth(ListAnnexStyle style) { - int annexWidth = 0; + float annexWidth = 0.0f; switch (style) { case LIST_ANNEX_STYLE_NORMAL: - annexWidth = 0; + annexWidth = 0.0f; break; case LIST_ANNEX_STYLE_MARK: GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); break; - case LIST_ANNEX_STYLE_RADIO: - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); - break; - case LIST_ANNEX_STYLE_ONOFF_SLIDING: GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); break; @@ -328,6 +319,14 @@ _ListItemBaseImpl::GetAnnexWidth(ListAnnexStyle style) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); break; + case LIST_ANNEX_STYLE_RADIO: + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + break; + + case LIST_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER: + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + break; + default: break; } @@ -393,29 +392,4 @@ _ListItemBaseImpl::OnActionPerformed(const _Control& source, int actionId) } } -bool -_ListItemBaseImpl::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture) -{ - if (__pEvent != null) - { - int elementId = __pListViewItem->GetElementIdFromCurrentTouchPosition(); - int groupIndex = -1; - int itemIndex = -1; - - __pListViewItem->GetItemIndex(groupIndex, itemIndex); - __pEvent->SetSource(__pListViewItem); - - _UiListViewItemEventArg* pArg = new (std::nothrow) _UiListViewItemEventArg(groupIndex, itemIndex, elementId, NOTIFY_TYPE_ITEM_LONGPRESSED); - __pEvent->Fire(*pArg); - } - - return true; -} - -bool -_ListItemBaseImpl::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture) -{ - return true; -} - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ListViewContextItem.cpp b/src/ui/controls/FUiCtrl_ListViewContextItem.cpp index 23648d3..2ad0619 100644 --- a/src/ui/controls/FUiCtrl_ListViewContextItem.cpp +++ b/src/ui/controls/FUiCtrl_ListViewContextItem.cpp @@ -23,6 +23,7 @@ */ #include +#include "FUi_Math.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_ListViewContextItem.h" @@ -36,8 +37,9 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { -_ListViewContextItem::_ListViewContextItem(int itemHeight) +_ListViewContextItem::_ListViewContextItem(float itemHeight) : _TableViewItem(itemHeight) + , __itemWidth(0.0f) { GET_SHAPE_CONFIG(LISTVIEW::CONTEXTITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __margin); GET_SHAPE_CONFIG(LISTVIEW::CONTEXTITEM_ELEMENT_SPACING, _CONTROL_ORIENTATION_PORTRAIT, __elementSpacing); @@ -65,7 +67,7 @@ _ListViewContextItem::~_ListViewContextItem(void) } _ListViewContextItem* -_ListViewContextItem::CreateListViewContextItemN(int itemHeight) +_ListViewContextItem::CreateListViewContextItemN(float itemHeight) { _ListViewContextItem* pItem = new (std::nothrow) _ListViewContextItem(itemHeight); SysTryReturn(NID_UI_CTRL, (pItem != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -100,11 +102,11 @@ _ListViewContextItem::AddElement(int elementId, const String& text, bool enable) __elements.push_back(contextElement); - AdjustElementLayout(); + AdjustElementLayout(GetBoundsF()); contextElement.pButton->SetActionId(elementId); contextElement.pButton->SetEnableState(enable); - //contextElement.pButton->SetMargin(0, 0); + //contextElement.pButton->SetMargin(0.0f, 0.0f); contextElement.pButton->SetTextSize(__textSize); contextElement.pButton->SetText(text); @@ -131,7 +133,7 @@ _ListViewContextItem::AddElement(int elementId, const Bitmap* pNormalBitmap, con __elements.push_back(contextElement); - AdjustElementLayout(); + AdjustElementLayout(GetBoundsF()); contextElement.pButton->SetActionId(elementId); contextElement.pButton->SetEnableState(enable); @@ -166,11 +168,11 @@ _ListViewContextItem::AddElement(int elementId, const String& text, const Bitmap __elements.push_back(contextElement); - AdjustElementLayout(); + AdjustElementLayout(GetBoundsF()); contextElement.pButton->SetActionId(elementId); contextElement.pButton->SetEnableState(enable); - contextElement.pButton->SetMargin(0, 0); + contextElement.pButton->SetMargin(0.0f, 0.0f, 0.0f, 0.0f); contextElement.pButton->SetTextSize(__textSize); contextElement.pButton->SetText(text); contextElement.pButton->SetBackgroundBitmap(_BUTTON_STATUS_NORMAL, *pNormalBitmap); @@ -187,34 +189,33 @@ _ListViewContextItem::AddElement(int elementId, const String& text, const Bitmap } void -_ListViewContextItem::AdjustElementLayout(void) +_ListViewContextItem::AdjustElementLayout(FloatRectangle bounds) { - if (__elements.size() == 0) + int elementCount = __elements.size(); + FloatRectangle elementBounds; + + if ((elementCount <= 0) || (bounds.width <= 0.0f) || (bounds.height <= 0.0f)) { return; } - int elementCount = __elements.size(); - Rectangle itemBounds = GetBounds(); - Rectangle elementBounds; - // Calculate horizontal value if (elementCount == 1) { - int margin = 0; + float margin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::CONTEXTITEM_LEFT_MARGIN_ONE, _CONTROL_ORIENTATION_PORTRAIT, margin); elementBounds.x = __margin + margin; - elementBounds.width = (itemBounds.width - ((__margin + margin) * 2)); + elementBounds.width = (bounds.width - ((__margin + margin) * 2.0f)); } else { elementBounds.x = __margin; - elementBounds.width = ((itemBounds.width - __margin * 2) - (__elementSpacing * (elementCount - 1))) / elementCount; + elementBounds.width = ((bounds.width - __margin * 2.0f) - (__elementSpacing * (elementCount - 1))) / elementCount; } // Calculate vertical value - elementBounds.y = (itemBounds.height - __elementHeight) / 2; + elementBounds.y = (bounds.height - __elementHeight) / 2.0f; elementBounds.height = __elementHeight; _LinkedList <_ListViewContextItemElement>::_Iterator iter; @@ -255,13 +256,13 @@ _ListViewContextItem::HasElement(int elementId) } int -_ListViewContextItem::GetElementIdFromPosition(const Point& position) const +_ListViewContextItem::GetElementIdFromPosition(const FloatPoint& position) const { _LinkedList <_ListViewContextItemElement>::_ReverseIterator reverseIter; for (reverseIter = __elements.rbegin(); reverseIter != __elements.rend(); reverseIter++) { - if ((*reverseIter).pButton->GetBounds().Contains(position)) + if ((*reverseIter).pButton->GetBoundsF().Contains(position)) { return (*reverseIter).elementId; } @@ -299,20 +300,24 @@ _ListViewContextItem::RemoveContextItemEventListener(_IActionEventListener& list } void -_ListViewContextItem::AdjustItemBounds(Rectangle& bounds) +_ListViewContextItem::AdjustItemBounds(FloatRectangle& bounds) { - Rectangle newBounds = bounds; - Dimension itemDimension = GetSize(); - int margin = 0; - - GET_SHAPE_CONFIG(TABLEVIEW::CONTEXTITEM_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); - newBounds.width -= margin; + if (!_FloatCompare(bounds.width, __itemWidth) || !_FloatCompare(GetSizeF().height, bounds.height)) + { + AdjustElementLayout(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); + __itemWidth = bounds.width; + } +} - if ((itemDimension.width != newBounds.width) || (itemDimension.height != newBounds.height)) +result +_ListViewContextItem::OnBoundsChanging(const FloatRectangle& bounds) +{ + if (!_FloatCompare(GetSizeF().height, bounds.height)) { - SetBounds(Rectangle(0, 0,newBounds.width, newBounds.height)); - AdjustElementLayout(); + AdjustElementLayout(FloatRectangle(0.0f, 0.0f, __itemWidth, bounds.height)); } + + return E_SUCCESS; } void diff --git a/src/ui/controls/FUiCtrl_ListViewImpl.cpp b/src/ui/controls/FUiCtrl_ListViewImpl.cpp index b300f6e..2ea6f87 100644 --- a/src/ui/controls/FUiCtrl_ListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListViewImpl.cpp @@ -25,8 +25,9 @@ #include #include #include "FApp_AppInfo.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" -#include "FUi_TouchManager.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_FastScrollEvent.h" #include "FUiCtrl_FastScrollEventArg.h" @@ -75,41 +76,41 @@ _ListViewImpl::_ListViewImpl(ListView* pList, _TableView* pCore) , __pEmptyText(null) , __redrawListView(true) , __pItemNeedsLazyDeletion(null) - , __pItemSwept(null) + , __pTouchEventHandler(null) + , __pLongPressedGesture(null) { - GET_COLOR_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_NORMAL, __emptyTextColor); + GET_COLOR_CONFIG(TABLEVIEW::EMPTY_CONTENTS_TEXT_NORMAL, __emptyTextColor); + + // Add _TouchLongPressGestureDetector + __pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector(); + SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + pCore->AddGestureDetector(*__pLongPressedGesture); + __pLongPressedGesture->AddGestureListener(*this); } _ListViewImpl::~_ListViewImpl() { if (__pListItemEvent != null) { - //__pListItemEvent->RemoveListener(*this); - delete __pListItemEvent; __pListItemEvent = null; } if (__pLinkEvent != null) { - //__pLinkEvent->RemoveListener(*this); - delete __pLinkEvent; __pLinkEvent = null; } if (__pScrollEvent != null) { - //__pScrollEvent->RemoveListener(*this); - delete __pScrollEvent; __pScrollEvent = null; } if (__pFastScrollEvent != null) { - //__pFastScrollEvent->RemoveListener(*this); - delete __pFastScrollEvent; __pFastScrollEvent = null; } @@ -129,6 +130,21 @@ _ListViewImpl::~_ListViewImpl() delete __pEmptyText; __pEmptyText = null; } + + if (__pTouchEventHandler != null) + { + delete __pTouchEventHandler; + __pTouchEventHandler = null; + } + + if (__pLongPressedGesture != null) + { + __pLongPressedGesture->RemoveGestureListener(*this); + GetCore().RemoveGestureDetector(*__pLongPressedGesture); + + delete __pLongPressedGesture; + __pLongPressedGesture = null; + } } const char* @@ -172,18 +188,23 @@ _ListViewImpl::CreateListViewImplN(ListView* pControl, bool itemDivider, ListScr case SCROLL_STYLE_FADE_OUT: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT; break; + case SCROLL_STYLE_FIXED: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FIXED; break; + case SCROLL_STYLE_FAST_SCROLL: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL; break; + case SCROLL_STYLE_JUMP_TO_TOP: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_JUMP_TO_TOP; break; + case SCROLL_STYLE_THUMB: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_THUMB; break; + default: scrollBarStyle = TABLE_VIEW_SCROLL_BAR_STYLE_NONE; break; @@ -217,13 +238,13 @@ _ListViewImpl::SetItemProvider(IListViewItemProvider& provider) pProviderAdaptor->SetListViewItemEventListener(*this); - r = pProviderAdaptor->SetListWidth(GetCore().GetBounds().width); + r = pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width); GetCore().SetItemProviderAdaptor(pProviderAdaptor); } else { pProviderAdaptor->SetItemProvider(provider); - r = pProviderAdaptor->SetListWidth(GetCore().GetBounds().width); + r = pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width); UpdateList(); } @@ -233,6 +254,41 @@ _ListViewImpl::SetItemProvider(IListViewItemProvider& provider) SetLastResultReturn(r); } +result +_ListViewImpl::SetItemProvider(IListViewItemProviderF& provider) +{ + // hmkim + result r = E_SUCCESS; + + _ListViewItemProviderAdaptor* pProviderAdaptor = + static_cast <_ListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor()); + + if (pProviderAdaptor == null) + { + pProviderAdaptor = new (std::nothrow) _ListViewItemProviderAdaptor(provider); + SysTryReturn(NID_UI_CTRL, (pProviderAdaptor != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, + "[E_OUT_OF_MEMORY] The memory is insufficient."); + + pProviderAdaptor->SetListViewItemEventListener(*this); + + r = pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width); + GetCore().SetItemProviderAdaptor(pProviderAdaptor); + } + else + { + pProviderAdaptor->SetItemProvider(provider); + r = pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width); + + UpdateList(); + } + + __redrawListView = true; + + SetLastResultReturn(r); + + return E_SUCCESS; +} + void _ListViewImpl::AddListViewItemEventListener(IListViewItemEventListener& listener) { @@ -323,6 +379,27 @@ _ListViewImpl::AddScrollEventListener(IScrollEventListener& listener) } void +_ListViewImpl::AddScrollEventListener(IScrollEventListenerF& listener) +{ + result r = E_SUCCESS; + + if (__pScrollEvent == null) + { + __pScrollEvent = new (std::nothrow) _ScrollEvent(); + SysTryReturnVoidResult(NID_UI_CTRL, (__pScrollEvent != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = __pScrollEvent->Construct(GetPublic()); + SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, "[E_SYSTEM] Unable to construct Scroll Event."); + } + + __pScrollEvent->AddListener(listener); + + GetCore().AddScrollEventListener(*this); + + SetLastResult(r); +} + +void _ListViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) { result r = E_SUCCESS; @@ -336,6 +413,19 @@ _ListViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) } void +_ListViewImpl::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + result r = E_SUCCESS; + + if (__pScrollEvent != null) + { + r = __pScrollEvent->RemoveListener(listener); + } + + SetLastResult(r); +} + +void _ListViewImpl::AddUiLinkEventListener(const IUiLinkEventListener& listener) { result r = E_SUCCESS; @@ -522,16 +612,18 @@ _ListViewImpl::RefreshList(int index, ListRefreshType type) } } - if ((__pItemSwept != null) && (type != LIST_REFRESH_TYPE_ITEM_ADD)) + if (type == LIST_REFRESH_TYPE_ITEM_MODIFY) { - if (__pItemSwept == pListViewItem) + int sweepGroupIndex = -1; + int sweepItemIndex = -1; + + GetCore().GetSweepItemIndex(sweepGroupIndex, sweepItemIndex); + + if ((sweepGroupIndex == 0) && (sweepItemIndex == index)) { GetCore().ResetSweepItem(); } - } - if (type == LIST_REFRESH_TYPE_ITEM_MODIFY) - { int topGroupIndex = -1; int topItemIndex = -1; int bottomGroupIndex = -1; @@ -544,13 +636,13 @@ _ListViewImpl::RefreshList(int index, ListRefreshType type) { TableViewItemDrawingStatus itemDrawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; bool itemSelected = false; - Point touchPosition(-1, -1); + FloatPoint touchPosition(-1.0f, -1.0f); if (pListViewItem != null) { itemDrawingStatus = pListViewItem->GetDrawingStatus(); itemSelected = pListViewItem->GetSelectionState(); - touchPosition = pListViewItem->GetLastTouchPressedPosition(); + touchPosition = pListViewItem->GetLastTouchPressedPositionF(); pListViewItem = null; } @@ -574,7 +666,7 @@ _ListViewImpl::RefreshList(int index, ListRefreshType type) for (int i = 0; i < pListViewItem->GetChildCount(); i++) { - if (pListViewItem->GetChild(i)->GetBounds().Contains(touchPosition)) + if (pListViewItem->GetChild(i)->GetBoundsF().Contains(touchPosition)) { target = pListViewItem->GetChild(i); } @@ -661,6 +753,12 @@ _ListViewImpl::UpdateList(void) int _ListViewImpl::GetItemIndexFromPosition(const Point& position) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position)); +} + +int +_ListViewImpl::GetItemIndexFromPosition(const FloatPoint& position) const +{ int groupIndex = -1; int itemIndex = -1; @@ -672,6 +770,12 @@ _ListViewImpl::GetItemIndexFromPosition(const Point& position) const result _ListViewImpl::GetItemIndexFromPosition(const Point& position, int& itemIndex, int& elementId) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), itemIndex, elementId); +} + +result +_ListViewImpl::GetItemIndexFromPosition(const FloatPoint& position, int& itemIndex, int& elementId) const +{ int groupIndex = -1; elementId = -1; @@ -682,10 +786,10 @@ _ListViewImpl::GetItemIndexFromPosition(const Point& position, int& itemIndex, i if (pListViewItem != null) { - Point originPosition = pListViewItem->GetPosition(); + FloatPoint originPosition = pListViewItem->GetPositionF(); originPosition.y -= GetCore().GetScrollPosition(); - elementId = pListViewItem->GetElementIdFromPosition(Point(position.x - originPosition.x, position.y - originPosition.y)); + elementId = pListViewItem->GetElementIdFromPosition(FloatPoint(position.x - originPosition.x, position.y - originPosition.y)); } SetLastResultReturn(r); @@ -706,44 +810,45 @@ _ListViewImpl::GetItemDividerColor(void) const void _ListViewImpl::AdjustLayoutOfEmptyList(void) { - Dimension listDimension = GetCore().GetSize(); - Dimension emptyBitmap; - Dimension emptyText; - Point bitmapPos; - Point textPos; - int totalHeight = 0; + FloatDimension listDimension = GetCore().GetSizeF(); + FloatDimension emptyBitmap; + FloatDimension emptyText; + FloatPoint bitmapPos; + FloatPoint textPos; + float totalHeight = 0.0f; if (__pEmptyBitmap != null) { - emptyBitmap = __pEmptyBitmap->GetSize(); + emptyBitmap = __pEmptyBitmap->GetSizeF(); } + if (__pEmptyText != null) { - emptyText = __pEmptyText->GetSize(); + emptyText = __pEmptyText->GetSizeF(); } totalHeight = emptyBitmap.height + emptyText.height; if ((__pEmptyBitmap != null) && (__pEmptyText != null) && (totalHeight < listDimension.height)) { - bitmapPos.x = ((listDimension.width == emptyBitmap.width) ? 0 : (listDimension.width - emptyBitmap.width) / 2); - bitmapPos.y = (listDimension.height - totalHeight) / 2; + bitmapPos.x = ((_FloatCompare(listDimension.width, emptyBitmap.width)) ? 0.0f : (listDimension.width - emptyBitmap.width) / 2.0f); + bitmapPos.y = (listDimension.height - totalHeight) / 2.0f; - textPos.x = ((listDimension.width == emptyText.width) ? 0 : (listDimension.width - emptyText.width) / 2); + textPos.x = ((_FloatCompare(listDimension.width, emptyText.width)) ? 0.0f : (listDimension.width - emptyText.width) / 2.0f); textPos.y = bitmapPos.y + emptyBitmap.height; } else { if (__pEmptyBitmap != null) { - bitmapPos.x = ((listDimension.width == emptyBitmap.width) ? 0 : (listDimension.width - emptyBitmap.width) / 2); - bitmapPos.y = ((listDimension.height == emptyBitmap.height) ? 0 : (listDimension.height - emptyBitmap.height) / 2); + bitmapPos.x = ((_FloatCompare(listDimension.width, emptyBitmap.width)) ? 0.0f : (listDimension.width - emptyBitmap.width) / 2.0f); + bitmapPos.y = ((_FloatCompare(listDimension.height, emptyBitmap.height)) ? 0.0f : (listDimension.height - emptyBitmap.height) / 2.0f); } if (__pEmptyText != null) { - textPos.x = ((listDimension.width == emptyText.width) ? 0 : (listDimension.width - emptyText.width) / 2); - textPos.y = ((listDimension.height == emptyText.height) ? 0 : (listDimension.height - emptyText.height) / 2); + textPos.x = ((_FloatCompare(listDimension.width, emptyText.width)) ? 0.0f : (listDimension.width - emptyText.width) / 2.0f); + textPos.y = ((_FloatCompare(listDimension.height, emptyText.height)) ? 0.0f : (listDimension.height - emptyText.height) / 2.0f); } } @@ -795,19 +900,12 @@ _ListViewImpl::SetBitmapOfEmptyList(const Bitmap* pBitmap) SysTryReturn(NID_UI_CTRL, (__pEmptyBitmap != null), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pEmptyBitmap->SetVisibleState(false); - __pEmptyBitmap->SetMargin(0, 0); + __pEmptyBitmap->SetMargin(0.0f, 0.0f); GetCore().AttachChild(*__pEmptyBitmap); } - Dimension bitmapSize(pBitmap->GetWidth(), pBitmap->GetHeight()); - Dimension listDimension = GetCore().GetSize(); - Dimension labelDimension; - - labelDimension.width = ((listDimension.width < bitmapSize.width) ? listDimension.width : bitmapSize.width); - labelDimension.height = ((listDimension.height < bitmapSize.height) ? listDimension.height : bitmapSize.height); - - __pEmptyBitmap->SetSize(labelDimension); + __pEmptyBitmap->SetSize(FloatDimension(pBitmap->GetWidthF(), pBitmap->GetHeightF())); __pEmptyBitmap->SetBackgroundColor(Color(0, 0, 0, 0)); __pEmptyBitmap->SetBackgroundBitmap(*pBitmap); } @@ -838,7 +936,7 @@ _ListViewImpl::SetTextOfEmptyList(const String& text) SysTryReturn(NID_UI_CTRL, (__pEmptyText != null), E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pEmptyText->SetVisibleState(false); - __pEmptyText->SetMargin(0, 0); + __pEmptyText->SetMargin(0.0f, 0.0f); GetCore().AttachChild(*__pEmptyText); } @@ -853,27 +951,27 @@ _ListViewImpl::SetTextOfEmptyList(const String& text) pText->AppendElement(*pSimpleText); - int textSize = 0; + float textSize = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, textSize); Font font; font.Construct(GetFont(), FONT_STYLE_PLAIN, textSize); pText->SetFont(&font, 0, pText->GetTextLength()); - Dimension listDimension = GetCore().GetSize(); + FloatDimension listDimension = GetCore().GetSizeF(); - pText->SetBounds(Rectangle(0, 0, listDimension.width, 1)); + pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f)); pText->Compose(); - Dimension labelDimension = pText->GetTextExtent(0, pText->GetTextLength()); - labelDimension.height = pText->GetTotalHeight(); + FloatDimension labelDimension = pText->GetTextExtentF(0, pText->GetTextLength()); + labelDimension.height = pText->GetTotalHeightF(); if (labelDimension.width > listDimension.width) { - pText->SetBounds(Rectangle(0, 0, listDimension.width, 1)); + pText->SetBounds(FloatRectangle(0.0f, 0.0f, listDimension.width, 1.0f)); pText->Compose(); - int labelHeight = pText->GetTotalHeight(); + float labelHeight = pText->GetTotalHeightF(); labelDimension.width = listDimension.width; labelDimension.height = ((listDimension.height < labelHeight) ? listDimension.height : labelHeight); @@ -958,30 +1056,28 @@ _ListViewImpl::IsInReorderingMode(void) const } void -_ListViewImpl::OnListViewContextItemStateChanged(_Control& source, int groupIndex, int itemIndex, int elementId, - ListContextItemStatus status) +_ListViewImpl::SetScrollInputMode(ScrollInputMode mode) { - if (__pListItemEvent != null) - { - GetCore().ResetSweepItem(); - - __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex)); - - _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM); - __pListItemEvent->Fire(*pArg); + GetCore().SetScrollInputMode(mode); +} - __pItemNeedsLazyDeletion = null; - } +ScrollInputMode +_ListViewImpl::GetScrollInputMode(void) const +{ + return GetCore().GetScrollInputMode(); } void -_ListViewImpl::OnListViewItemLongPressed(_Control& source, int groupIndex, int itemIndex, int elementId) +_ListViewImpl::OnListViewContextItemStateChanged(_Control& source, int groupIndex, int itemIndex, int elementId, + ListContextItemStatus status) { if (__pListItemEvent != null) { + GetCore().ResetSweepItem(); + __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex)); - _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM); + _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_SELCTED_CONTEXT_ITEM); __pListItemEvent->Fire(*pArg); __pItemNeedsLazyDeletion = null; @@ -1032,8 +1128,6 @@ _ListViewImpl::OnTableViewContextItemActivationStateChanged(_TableView& tableVie if (pListViewItem != null) { - __pItemSwept = (activated ? pListViewItem : null); - pListViewItem->SetContextItemActivationState(activated); } } @@ -1076,11 +1170,11 @@ _ListViewImpl::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_ListViewImpl::OnScrollPositionChanged(_Control& source, int scrollPos) +_ListViewImpl::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (__pScrollEvent != null) { - _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPos); + _ScrollEventArg* pEventArg = _ScrollEventArg::GetScrollEventArgN(GetPublic(), scrollPosition); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1145,7 +1239,7 @@ _ListViewImpl::OnBoundsChanged(void) if (pProviderAdaptor != null) { - pProviderAdaptor->SetListWidth(GetCore().GetBounds().width); + pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width); } } @@ -1196,7 +1290,16 @@ _ListViewImpl::OnFontChanged(Font* pFont) void _ListViewImpl::OnFontInfoRequested(unsigned long& style, int& size) { - int textSize = 0; + float textSize = 0.0f; + OnFontInfoRequested(style, textSize); + + size = _CoordinateSystemUtils::ConvertToInteger(textSize); +} + +void +_ListViewImpl::OnFontInfoRequested(unsigned long& style, float& size) +{ + float textSize = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::EMPTY_LIST_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, textSize); style = FONT_STYLE_PLAIN; @@ -1206,170 +1309,100 @@ _ListViewImpl::OnFontInfoRequested(unsigned long& style, int& size) bool _ListViewImpl::OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _ListViewImpl::OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _ListViewImpl::OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } bool _ListViewImpl::OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo) { - FirePublicTouchEvent(touchinfo); - return false; + return (__pTouchEventHandler != null) ? __pTouchEventHandler->ProcessTouchEventListener(touchinfo) : false; } -void -_ListViewImpl::FirePublicTouchEvent(const _TouchInfo& touchInfo) +bool +_ListViewImpl::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture) { - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - TouchEventInfo publicTouchInfo; + bool filtered = false; - _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); - SysTryReturnVoidResult(NID_UI, pEventArg, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + if (__pTouchEventHandler != null) + { + filtered = __pTouchEventHandler->ProcessTouchEventListener(); + } - publicTouchInfo.Construct(*pEventArg); + if (!filtered && (__pListItemEvent != null)) + { + _TouchManager* pTouchManager = _TouchManager::GetInstance(); + FloatPoint currentTouchPos = pTouchManager->GetScreenPoint(0); + FloatRectangle bounds = GetCore().GetAbsoluteBoundsF(); + int itemIndex = -1; + int elementId = -1; - _Control* pDraggedControl = pTouchManager->GetTouchControlSource(); + currentTouchPos.x -= bounds.x; + currentTouchPos.y -= bounds.y; - IEnumeratorT* pEnumerator = GetTouchEventListener()->GetEnumeratorN(); - if (pEnumerator) - { - while (pEnumerator->MoveNext() == E_SUCCESS) + if (GetItemIndexFromPosition(currentTouchPos, itemIndex, elementId) == E_SUCCESS) { - IEventListener* pListener = null; - pEnumerator->GetCurrent(pListener); + __pItemNeedsLazyDeletion = static_cast<_ListViewItem*>(GetCore().FindItem(0, itemIndex)); - ITouchEventListener* pTouchEventListener = dynamic_cast (pListener); - if (pTouchEventListener) + if ((__pItemNeedsLazyDeletion != null) && (!__pItemNeedsLazyDeletion->IsContextItem())) { - FirePublicListener(*pTouchEventListener, publicTouchInfo); + _ListItemEventArg* pArg = new (std::nothrow) _ListItemEventArg(itemIndex, elementId, 0, 0, NOTIFY_TYPE_LONG_PRESSED_ITEM); + __pListItemEvent->Fire(*pArg); - if (touchInfo.GetTouchStatus() == _TOUCH_RELEASED) - { - if (pDraggedControl == null) //if exist dragged control, don't send focus event - { - FireFocusListener(*pTouchEventListener, publicTouchInfo); - } - } - else if (touchInfo.GetTouchStatus() == _TOUCH_MOVED) - { - FireFocusListener(*pTouchEventListener, publicTouchInfo); - } + __pItemNeedsLazyDeletion = null; } } - - delete pEnumerator; } - delete pEventArg; + return filtered; } -void -_ListViewImpl::FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +bool +_ListViewImpl::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture) { - switch (touchEventInfo.GetTouchStatus()) - { - case TOUCH_PRESSED: - listener.OnTouchPressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_LONG_PRESSED: - listener.OnTouchLongPressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_RELEASED: - listener.OnTouchReleased(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_MOVED: - listener.OnTouchMoved(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_DOUBLE_PRESSED: - listener.OnTouchDoublePressed(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_FOCUS_IN: - listener.OnTouchFocusIn(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_FOCUS_OUT: - listener.OnTouchFocusOut(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - case TOUCH_CANCELED: - listener.OnTouchCanceled(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - break; - default: - break; - } + return false; } -void -_ListViewImpl::FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +result +_ListViewImpl::OnTouchEventListenerAdded(void) { - _ControlManager* pControlManager = _ControlManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); - - Point screenPoint(pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).x, - pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).y); - - _Control* pTouchedControl = pControlManager->GetTopmostTouchedControl(screenPoint); - SysTryReturnVoidResult(NID_UI, pTouchedControl, E_INVALID_CONDITION, "[E_INVALID_CONDITION] pTouchedControl is null."); - - if (pTouchManager->GetFocusedControlSource() != pTouchedControl) + // support ITouchEventListener + if (GetTouchEventListener()->GetCount() == 1) { - if (&(GetCore()) != pTouchedControl) - { - if (pTouchManager->GetFocusedControlSource() == &(GetCore())) - { - listener.OnTouchFocusOut(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - } - } - else - { - listener.OnTouchFocusIn(GetPublic(), touchEventInfo.GetCurrentPosition(), touchEventInfo); - } - - pTouchManager->SetFocusedControlSource(*pTouchedControl); + __pTouchEventHandler = new (std::nothrow) _ListViewTouchEventHandler(*this, LIST_VIEW_STYLE_SIMPLE); } + + return E_SUCCESS; } -_TouchEventArg* -_ListViewImpl::GetTouchEventArgN(const _TouchInfo& touchInfo) +result +_ListViewImpl::OnTouchEventListenerRemoved(void) { - Point startPoint; - - _TouchEventArg* pEventArg = new (std::nothrow) _TouchEventArg(GetPublic(), touchInfo.GetTouchStatus()); - SysTryReturn(NID_UI, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - - _TouchManager* pTouchManager = _TouchManager::GetInstance(); - SysTryCatch(NID_UI, pTouchManager, , E_SYSTEM, "[E_SYSTEM] System error occurred."); - - startPoint.SetPosition(pTouchManager->GetStartPoint(touchInfo.GetPointId()).x - GetCore().GetAbsoluteBounds().x, - pTouchManager->GetStartPoint(touchInfo.GetPointId()).y - GetCore().GetAbsoluteBounds().y); - - pEventArg->SetTouchPosition(touchInfo.GetPointId(), startPoint.x, startPoint.y, - touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); + return E_SUCCESS; +} - // need to flick distance setting +bool +_ListViewImpl::GetInputEventConsumeState(void) +{ + bool filtered = IsInputEventConsumed(); - return pEventArg; + if (filtered) + { + ResetInputEventConsumed(); + } -CATCH: - delete pEventArg; - return null; + return filtered; } class _ListViewMaker @@ -1417,6 +1450,7 @@ protected: } rect = pControlProperty->GetRect(); + //Construct if (pControl->GetElement(L"itemDivider", elementString)) { diff --git a/src/ui/controls/FUiCtrl_ListViewItem.cpp b/src/ui/controls/FUiCtrl_ListViewItem.cpp index aea29ae..8aba846 100644 --- a/src/ui/controls/FUiCtrl_ListViewItem.cpp +++ b/src/ui/controls/FUiCtrl_ListViewItem.cpp @@ -32,9 +32,9 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" -#include "FUi_ITouchLongPressGestureEventListener.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUi_ResourceManager.h" -#include "FUi_TouchLongPressGestureDetector.h" #include "FUiAnim_VisualElement.h" #include "FUiCtrl_Label.h" #include "FUiCtrl_ListViewContextItem.h" @@ -58,25 +58,26 @@ using namespace Tizen::Ui::Animations; namespace Tizen { namespace Ui { namespace Controls { -_ListViewItem::_ListViewItem(int itemHeight) +_ListViewItem::_ListViewItem(float itemHeight) : _TableViewItem(itemHeight) + , __needAlignContextItem(false) , __touchPressed(false) , __selectedElementId(-1) - , __progressLeftMargin(0) - , __progressRightMargin(0) + , __progressLeftMargin(0.0f) + , __progressRightMargin(0.0f) , __pProgress(null) , __descriptionTextShowState(false) , __pDescriptionText(null) , __pDivider(null) , __selectionEabled(false) , __fontStyle(0) - , __fontSize(0) + , __fontSize(0.0f) , __fontName(L"") - , __prevTouchPos(-1, -1) + , __prevTouchPos(-1.0f, -1.0f) , __pTextSlideTimer(null) - , __pLongPressedGesture(null) + , __pAccessibilityElement(null) { - GET_COLOR_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_NORMAL, __descriptionTextColor); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_DESCRIPTION_TEXT_NORMAL, __descriptionTextColor); ___stateChangedInfo.selectionType = LISTVIEW_ITEM_SELECTED; ___stateChangedInfo.elementId = -1; @@ -93,14 +94,6 @@ _ListViewItem::~_ListViewItem(void) delete __pTextSlideTimer; __pTextSlideTimer = null; - if (__pLongPressedGesture != null) - { - RemoveGestureDetector(*__pLongPressedGesture); - - delete __pLongPressedGesture; - __pLongPressedGesture = null; - } - if (__pProgress != null) { DetachChild(*__pProgress); @@ -124,10 +117,18 @@ _ListViewItem::~_ListViewItem(void) delete __pDivider; __pDivider = null; } + + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + + if ((__pAccessibilityElement != null) && (pContainer != null)) + { + pContainer->RemoveAllElement(); + __pAccessibilityElement = null; + } } _ListViewItem* -_ListViewItem::CreateListViewItemN(int itemHeight) +_ListViewItem::CreateListViewItemN(float itemHeight) { _ListViewItem* pItem = new (std::nothrow) _ListViewItem(itemHeight); SysTryReturn(NID_UI_CTRL, (pItem != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -151,34 +152,8 @@ _ListViewItem::SetListViewItemType(ListViewItemType type) __itemType = type; } -void -_ListViewItem::AddTouchLongPressGestureEventListener(_ITouchLongPressGestureEventListener& listener) -{ - if (__pLongPressedGesture == null) - { - __pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector(); - SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] The memory is insufficient."); - - __pLongPressedGesture->SetDuration(TOUCH_LONGPRESSED_EVENT_DURATION); - AddGestureDetector(*__pLongPressedGesture); - } - - result r = __pLongPressedGesture->AddGestureListener(listener); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Failed to add gesture listener.", GetErrorMessage(r)); -} - -void -_ListViewItem::RemoveTouchLongPressGestureEventListener(_ITouchLongPressGestureEventListener& listener) -{ - if (__pLongPressedGesture != null) - { - __pLongPressedGesture->RemoveGestureListener(listener); - } -} - result -_ListViewItem::AddElement(Rectangle& rect, int elementId, const String& text, bool textSliding) +_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const String& text, bool textSliding) { result r = E_SUCCESS; @@ -213,9 +188,9 @@ _ListViewItem::AddElement(Rectangle& rect, int elementId, const String& text, bo element.pTextElement->textSlidingEnabled = textSliding; GET_SHAPE_CONFIG(LISTVIEW::ITEM_DEFAULT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, element.pTextElement->textSize); - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]); - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]); - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]); // Set Visual element for this element _VisualElement* pVE = new (std::nothrow) _VisualElement(); @@ -230,7 +205,7 @@ _ListViewItem::AddElement(Rectangle& rect, int elementId, const String& text, bo } result -_ListViewItem::AddElement(Rectangle& rect, int elementId, const EnrichedText* pEnrichedText, bool textSliding) +_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const EnrichedText* pEnrichedText, bool textSliding) { SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] This elementId already exists.")); @@ -260,9 +235,9 @@ _ListViewItem::AddElement(Rectangle& rect, int elementId, const EnrichedText* pE element.pTextElement->pEnrichedText = pCloneText; element.pTextElement->textSlidingEnabled = textSliding; - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]); - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]); - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_NORMAL, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_NORMAL]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_PRESSED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_PRESSED]); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_HIGHLIGHTED, element.pTextElement->textColor[LISTVIEW_ITEM_STATUS_HIGHLIGHTED]); // Set Visual element for this element _VisualElement* pVE = new (std::nothrow) _VisualElement(); @@ -277,7 +252,7 @@ _ListViewItem::AddElement(Rectangle& rect, int elementId, const EnrichedText* pE } result -_ListViewItem::AddElement(Rectangle& rect, int elementId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap) +_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap) { SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] This elementId already exists.")); @@ -338,7 +313,7 @@ CATCH: } result -_ListViewItem::AddElement(Rectangle& rect, int elementId, const _ICustomElement* pCustom) +_ListViewItem::AddElement(FloatRectangle& rect, int elementId, const _ICustomElement* pCustom) { SysTryReturn(NID_UI_CTRL, (HasElement(elementId) == false), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] This elementId already exists.")); @@ -368,7 +343,7 @@ _ListViewItem::AddElement(Rectangle& rect, int elementId, const _ICustomElement* { GetVisualElement()->AttachChild(*(pVE)); pVE->SetShowState(true); - pVE->SetBounds(FloatRectangle(rect.x, rect.y, rect.width, rect.height)); + pVE->SetBounds(rect); } __elements.push_back(element); @@ -434,12 +409,6 @@ _ListViewItem::DeleteElement(_ListViewItemElement* pElement) pElement->pTextElement->pVE = null; } - if (pElement->pTextElement->pAccessibilityElement) - { - pElement->pTextElement->pAccessibilityElement->Activate(false); - pElement->pTextElement->pAccessibilityElement = null; - } - delete pElement->pTextElement; pElement->pTextElement = null; } @@ -570,7 +539,7 @@ _ListViewItem::ClearLastStateChangedInfo(void) } int -_ListViewItem::GetElementIdFromPosition(const Point& position) const +_ListViewItem::GetElementIdFromPosition(const FloatPoint& position) const { _LinkedList <_ListViewItemElement>::_ReverseIterator reverseIter; @@ -771,11 +740,11 @@ _ListViewItem::SetTextWrapType(int elementId, TextObjectWrapType wrapType) } bool -_ListViewItem::SetTextSize(int elementId, int textSize) +_ListViewItem::SetTextSize(int elementId, float textSize) { _ListViewItemElementText* pElement = GetElementText(elementId); - if ((pElement != null) && (textSize > 0)) + if ((pElement != null) && (textSize > 0.0f)) { pElement->textSize = textSize; @@ -834,6 +803,7 @@ _ListViewItem::SetProgressValue(int value) SysTryReturn(NID_UI_CTRL, (__pProgress != null), false, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pProgress->SetRange(0, 100); + AttachChild(*__pProgress); AdjustProgressBounds(); @@ -846,9 +816,9 @@ _ListViewItem::SetProgressValue(int value) } bool -_ListViewItem::SetProgressMargins(int leftMargin, int rightMargin) +_ListViewItem::SetProgressMargins(float leftMargin, float rightMargin) { - if ((leftMargin < 0) || (rightMargin < 0) || (GetBounds().width - leftMargin - rightMargin <= 0)) + if ((leftMargin < 0.0f) || (rightMargin < 0.0f) || (GetBoundsF().width - leftMargin - rightMargin <= 0.0f)) { return false; } @@ -866,20 +836,21 @@ _ListViewItem::AdjustProgressBounds(void) { if (__pProgress != null) { - Rectangle progressRect = GetBounds(); - int progressHeight = 0; - int bottomMargin = 0; + FloatRectangle progressRect = GetBoundsF(); + float progressHeight = 0.0f; + float bottomMargin = 0.0f; // Calculate progress position GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, progressHeight); - GET_SHAPE_CONFIG(LISTVIEW::ITEM_PROGRESS_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, bottomMargin); + GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, bottomMargin); + progressHeight = progressHeight + (bottomMargin * 2.0f); progressRect.x = __progressLeftMargin; - progressRect.y = progressRect.height - progressHeight - bottomMargin; - progressRect.width = progressRect.width - __progressLeftMargin - __progressRightMargin; + progressRect.y = progressRect.height - progressHeight; progressRect.height = progressHeight; + progressRect.width = progressRect.width - __progressLeftMargin - __progressRightMargin; - progressRect.y -= ((__descriptionTextShowState) ? GetDescriptionTextHeight() : 0); + progressRect.y -= ((__descriptionTextShowState) ? GetDescriptionTextHeight() : 0.0f); __pProgress->SetBounds(progressRect); } @@ -909,24 +880,22 @@ _ListViewItem::SetDescriptionText(const String& text) SysTryReturn(NID_UI_CTRL, (__pDescriptionText != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); __pDescriptionText->SetVisibleState(false); - __pDescriptionText->SetMargin(0, 0); + __pDescriptionText->SetMargin(0.0f, 0.0f); __pDescriptionText->SetTextHorizontalAlignment(ALIGNMENT_LEFT); - SetAccessibilityElement(); - AttachChild(*__pDescriptionText); } - Rectangle bounds = GetBounds(); - Rectangle textBounds; - int textSize = 0; + FloatRectangle bounds = GetBoundsF(); + FloatRectangle textBounds; + float textSize = 0.0f; bool ret = true; GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, textBounds.x); GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, textBounds.y); GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_FONT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, textSize); - textBounds.width = bounds.width - (textBounds.x * 2); + textBounds.width = bounds.width - (textBounds.x * 2.0f); TextObject* pText = new (std::nothrow) TextObject(); SysTryReturn(NID_UI_CTRL, (pText != null), false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -940,12 +909,12 @@ _ListViewItem::SetDescriptionText(const String& text) pText->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP); pText->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); pText->SetFont(GetFont(FONT_STYLE_PLAIN, textSize), 0, pText->GetTextLength()); - pText->SetBounds(Rectangle(0, 0, textBounds.width, 1)); + pText->SetBounds(FloatRectangle(0.0f, 0.0f, textBounds.width, 1.0f)); pText->Compose(); textBounds.height = pText->GetTotalHeight(); - __pDescriptionText->SetBounds(Rectangle(textBounds.x, bounds.height + textBounds.y, textBounds.width, textBounds.height)); + __pDescriptionText->SetBounds(FloatRectangle(textBounds.x, bounds.height + textBounds.y, textBounds.width, textBounds.height)); __pDescriptionText->SetBackgroundColor(Color(0, 0, 0, 0)); __pDescriptionText->SetTextColor(__descriptionTextColor); __pDescriptionText->SetTextConfig(textSize, LABEL_TEXT_STYLE_NORMAL); @@ -964,18 +933,18 @@ _ListViewItem::SetDescriptionTextColor(const Color& color) __descriptionTextColor = color; } -int +float _ListViewItem::GetDescriptionTextHeight(void) { if (__pDescriptionText != null) { - int margin = 0; + float margin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::ITEM_DESCRIPTION_TEXT_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); - return ((margin * 2) + __pDescriptionText->GetBounds().height); + return ((margin * 2.0f) + __pDescriptionText->GetBoundsF().height); } - return 0; + return 0.0f; } void @@ -989,16 +958,25 @@ _ListViewItem::SetDescriptionTextShowState(bool show) { __pDescriptionText->SetVisibleState(__descriptionTextShowState); - Dimension itemDimension = GetSize(); - int descriptionTextHeight = GetDescriptionTextHeight(); + FloatDimension itemDimension = GetSizeF(); + float descriptionTextHeight = GetDescriptionTextHeight(); itemDimension.height += ((__descriptionTextShowState) ? (descriptionTextHeight) : (-descriptionTextHeight)); // Set position & item height - SetItemCustomHeight((__descriptionTextShowState ? (itemDimension.height - descriptionTextHeight) : 0)); + SetItemCustomHeight((__descriptionTextShowState ? (itemDimension.height - descriptionTextHeight) : 0.0f)); SetItemHeight(itemDimension.height); SetSize(itemDimension); + + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + + if ((__pAccessibilityElement != null) && (pContainer != null)) + { + SetAccessibilityElement(); + + _AccessibilityManager::GetInstance()->RequestToDrawFocusUi(); + } } } } @@ -1030,8 +1008,6 @@ _ListViewItem::SetContextItemActivationState(bool activate) bool _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - _TableViewItem::OnTouchPressed(source, touchinfo); - if ((&source != this) && (source.GetParent() != this)) { return false; @@ -1040,7 +1016,7 @@ _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinf ClearLastStateChangedInfo(); StopTextSlideTimer(); - Point pos = touchinfo.GetCurrentPosition(); + FloatPoint pos = touchinfo.GetCurrentPosition(); __prevTouchPos.SetPosition(pos.x, pos.y); __selectedElementId = GetElementIdFromPosition(pos); @@ -1077,7 +1053,8 @@ _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinf __touchPressed = true; SetLastStateChangedInfo(); - Invalidate(); + + _TableViewItem::OnTouchPressed(source, touchinfo); return false; } @@ -1085,8 +1062,6 @@ _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinf bool _ListViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - _TableViewItem::OnTouchReleased(source, touchinfo); - if ((&source != this) && (source.GetParent() != this)) { return false; @@ -1104,7 +1079,7 @@ _ListViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchin __selectedElementId = -1; __touchPressed = false; - Invalidate(); + _TableViewItem::OnTouchReleased(source, touchinfo); return false; } @@ -1112,8 +1087,6 @@ _ListViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchin bool _ListViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - _TableViewItem::OnTouchMoved(source, touchinfo); - if (__touchPressed) { ClearLastStateChangedInfo(); @@ -1124,7 +1097,7 @@ _ListViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) __selectedElementId = -1; __touchPressed = false; - Invalidate(); + _TableViewItem::OnTouchMoved(source, touchinfo); return false; } @@ -1132,8 +1105,6 @@ _ListViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) bool _ListViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) { - _TableViewItem::OnTouchCanceled(source, touchinfo); - ResetTextSlide(); if (__selectionEabled) @@ -1142,7 +1113,7 @@ _ListViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchin __selectionEabled = false; } - Invalidate(); + _TableViewItem::OnTouchCanceled(source, touchinfo); return false; } @@ -1156,17 +1127,35 @@ _ListViewItem::OnDraw(void) DrawDivider(); } +result +_ListViewItem::OnBoundsChanging(const FloatRectangle& bounds) +{ + FloatDimension currentSize = GetSizeF(); + + if (!_FloatCompare(currentSize.width, bounds.width) || !_FloatCompare(currentSize.height, bounds.height)) + { + __needAlignContextItem = true; + } + + return E_SUCCESS; +} + void _ListViewItem::OnBoundsChanged(void) { _TableViewItem::OnBoundsChanged(); - _ListViewContextItem* pContextItem = static_cast<_ListViewContextItem*>(GetContextItem()); - - if (pContextItem != null) + if (__needAlignContextItem) { - Rectangle bounds = GetBounds(); - pContextItem->AdjustItemBounds(bounds); + _ListViewContextItem* pContextItem = static_cast<_ListViewContextItem*>(GetContextItem()); + + if (pContextItem != null) + { + FloatRectangle bounds = GetBoundsF(); + pContextItem->AdjustItemBounds(bounds); + + __needAlignContextItem = false; + } } } @@ -1199,7 +1188,7 @@ _ListViewItem::DrawElement(_ListViewItemElement* pElement) { // Get Current TableViewItem drawing status ListViewItemDrawingStatus status = GetItemDrawingStatus(); - Rectangle elementRect; + FloatRectangle elementRect; // Check element selection enabled if (status != LISTVIEW_ITEM_STATUS_NORMAL) @@ -1211,18 +1200,14 @@ _ListViewItem::DrawElement(_ListViewItemElement* pElement) status = LISTVIEW_ITEM_STATUS_NORMAL; } } - else if (__selectedElementId == pElement->elementId) + else if (__selectedElementId != pElement->elementId) { - if ((pElement->actionElement) && (pElement->selectionEnabled)) + bool enabled = false; + if (GetElementSelectionEnabled(__selectedElementId, enabled) && enabled) { status = LISTVIEW_ITEM_STATUS_NORMAL; } - } - else - { - bool enabled = false; - - if (GetElementSelectionEnabled(__selectedElementId, enabled) && enabled) + else if ((pElement->actionElement) && (pElement->selectionEnabled)) { status = LISTVIEW_ITEM_STATUS_NORMAL; } @@ -1248,7 +1233,7 @@ _ListViewItem::DrawElement(_ListViewItemElement* pElement) { pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - elementRect.SetBounds(0, 0, pElement->bounds.width, pElement->bounds.height); + elementRect.SetBounds(0.0f, 0.0f, pElement->bounds.width, pElement->bounds.height); pElement->pCustomElement->pCustom->DrawElement(pCanvas, elementRect, status); } @@ -1273,11 +1258,11 @@ _ListViewItem::DrawElements(void) } bool -_ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementText* pText) +_ListViewItem::DrawText(FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementText* pText) { SysTryReturn(NID_UI_CTRL, (pText != null), false, E_INVALID_ARG, "[E_INVALID_ARG] This Text element is null."); - Rectangle bounds(rect.x, rect.y, rect.width, rect.height); + FloatRectangle bounds(rect.x, rect.y, rect.width, rect.height); if (pText->pVE->GetParent() == null) { @@ -1293,7 +1278,7 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List // Calculate Text element bounds if (pText->pEnrichedText == null) { - Dimension textDimension = pText->pTextObject->GetTextExtent(0, pText->pTextObject->GetTextLength()); + FloatDimension textDimension = pText->pTextObject->GetTextExtentF(0, pText->pTextObject->GetTextLength()); TextObjectAlignment textAlign = pText->pTextObject->GetAlignment(); if (__itemType == LISTVIEW_ITEM_TYPE_CUSTOM) @@ -1304,7 +1289,7 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List if ((0x0007 & textAlign) == TEXT_OBJECT_ALIGNMENT_CENTER) { - bounds.x = rect.x + ((rect.width - bounds.width) / 2); + bounds.x = rect.x + ((rect.width - bounds.width) / 2.0f); } else if ((0x0007 & textAlign) == TEXT_OBJECT_ALIGNMENT_RIGHT) { @@ -1317,7 +1302,7 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List if ((0x0700 & textAlign) == TEXT_OBJECT_ALIGNMENT_MIDDLE) { - bounds.y = rect.y + ((rect.height - bounds.height) / 2); + bounds.y = rect.y + ((rect.height - bounds.height) / 2.0f); } else if ((0x0700 & textAlign) == TEXT_OBJECT_ALIGNMENT_BOTTOM) { @@ -1327,12 +1312,12 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List } else { - if ((bounds.width != textDimension.width) || (bounds.height != textDimension.height)) + if ((!_FloatCompare(bounds.width, textDimension.width)) || (!_FloatCompare(bounds.height, textDimension.height))) { - int itemWidth = GetBounds().width; + float itemWidth = GetBoundsF().width; bounds.x = rect.x; - bounds.y = rect.y + ((rect.height - textDimension.height) / 2); + bounds.y = rect.y + ((rect.height - textDimension.height) / 2.0f); bounds.width = ((itemWidth > bounds.x + textDimension.width) ? textDimension.width : (itemWidth - bounds.x)); bounds.height = textDimension.height; @@ -1341,34 +1326,34 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List } } - pText->pVE->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); + pText->pVE->SetBounds(bounds); // Check to EnrichedText contains Cutlink - if ((pText->cutlinkViewModeEnabled == true) && (pText->cutlinkParseEnabled == true) + if ((pText->pEnrichedText != null) && (pText->cutlinkViewModeEnabled) && (pText->cutlinkParseEnabled) && (pText->pTextObject->GetTotalCutLinkElementCount() <= 0)) { - if (ParseCutlinkText(pText) == true) + if (ParseCutlinkText(pText)) { pText->pTextObject->SetCutLinkViewMode(true); } } - else if (pText->pEnrichedText == null) + else { - if (IsItemEnabled() == true) + if (IsItemEnabled()) { pText->pTextObject->SetForegroundColor(pText->textColor[status], 0, pText->pTextObject->GetTextLength()); } else { Color disableTextColor; - GET_COLOR_CONFIG(LISTVIEW::ITEM_TEXT_DISABLED, disableTextColor); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_TEXT_DISABLED, disableTextColor); pText->pTextObject->SetForegroundColor(disableTextColor, 0, pText->pTextObject->GetTextLength()); } } pText->pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - pText->pTextObject->SetBounds(Rectangle(0, 0, bounds.width, bounds.height)); + pText->pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); Canvas* pCanvas = pText->pVE->GetCanvasN(); SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -1384,7 +1369,7 @@ _ListViewItem::DrawText(Rectangle& rect, ListViewItemDrawingStatus status, _List } bool -_ListViewItem::DrawBitmap(Rectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementBitmap* pBitmap) +_ListViewItem::DrawBitmap(FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementBitmap* pBitmap) { SysTryReturn(NID_UI_CTRL, (pBitmap != null), false, E_INVALID_ARG, "[E_INVALID_ARG] This Bitmap element is null."); @@ -1402,7 +1387,7 @@ _ListViewItem::DrawBitmap(Rectangle& rect, ListViewItemDrawingStatus status, _Li pBitmap->pVE->SetShowState(true); } - pBitmap->pVE->SetBounds(FloatRectangle(rect.x, rect.y, rect.width, rect.height)); + pBitmap->pVE->SetBounds(rect); Canvas* pCanvas = pBitmap->pVE->GetCanvasN(); SysTryReturn(NID_UI_CTRL, (pCanvas != null), false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -1412,11 +1397,11 @@ _ListViewItem::DrawBitmap(Rectangle& rect, ListViewItemDrawingStatus status, _Li if (pDrawBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, rect.width, rect.height), *pDrawBitmap); + pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap); } else { - pCanvas->DrawBitmap(Rectangle(0, 0, rect.width, rect.height), *pDrawBitmap); + pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rect.width, rect.height), *pDrawBitmap); } delete pCanvas; @@ -1429,26 +1414,38 @@ _ListViewItem::DrawDivider(void) { if ((__itemType == LISTVIEW_ITEM_TYPE_GROUP) && (GetItemBackgroundBitmap(LIST_ITEM_STATE_NORMAL) == null)) { - int lineHeight = 0; - int lineLeftMargin = 0; - int lineBottomMargin = 0; - int lineTopMargin = 0; + float lineHeight = 0.0f; + float lineLeftMargin = 0.0f; + float lineBottomMargin = 0.0f; + float lineTopMargin = 0.0f; GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight); GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin); GET_SHAPE_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineBottomMargin); - Rectangle bounds = GetBounds(); + FloatRectangle textBounds; + FloatRectangle bitmapBounds; _ListViewItemElementText* pElementText = GetElementText(LIST_ITEM_RESERVED_ID_3); + _ListViewItemElementBitmap* pElementBitmap = GetElementBitmap(LIST_ITEM_RESERVED_ID_2); + if ((pElementText != null) && (pElementText->pVE != null)) { - FloatRectangle textBounds = pElementText->pVE->GetBounds(); - lineTopMargin = (int)(textBounds.y + textBounds.height); + textBounds = pElementText->pVE->GetBounds(); } - else + + if ((pElementBitmap != null) && (pElementBitmap->pVE != null)) { - lineTopMargin = bounds.height - lineBottomMargin; + bitmapBounds = pElementBitmap->pVE->GetBounds(); } + float textBottomPos = textBounds.y + textBounds.height; + float bitmapBottomPos = bitmapBounds.y + bitmapBounds.height; + + lineTopMargin = (textBottomPos > bitmapBottomPos) ? textBottomPos : bitmapBottomPos; + + FloatRectangle bounds = GetBoundsF(); + float defaultMargin = bounds.height - lineBottomMargin; + lineTopMargin = (lineTopMargin > defaultMargin) ? lineTopMargin : defaultMargin; + if (bounds.height <= lineTopMargin) { return; @@ -1460,12 +1457,18 @@ _ListViewItem::DrawDivider(void) SysTryReturnVoidResult(NID_UI_CTRL, __pDivider != null, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult())); AttachSystemChild(*__pDivider); + + _AccessibilityContainer* pContainer = __pDivider->GetAccessibilityContainer(); + if (pContainer != null) + { + pContainer->Activate(false); + } } Color underLineColor; - GET_COLOR_CONFIG(LISTVIEW::GROUPITEM_DIVIDER_NORMAL, underLineColor); + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_NORMAL, underLineColor); - __pDivider->SetBounds(Rectangle(lineLeftMargin, lineTopMargin, bounds.width - lineLeftMargin * 2, lineHeight)); + __pDivider->SetBounds(FloatRectangle(lineLeftMargin, lineTopMargin, bounds.width - lineLeftMargin * 2.0f, lineHeight)); __pDivider->SetBackgroundColor(underLineColor); __pDivider->Invalidate(); } @@ -1532,7 +1535,7 @@ _ListViewItem::OnTextSlideTimerExpired(void) pTextObject->Compose(); pTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas)); - pCanvas->Show(pElement->bounds); + pCanvas->Show(_CoordinateSystemUtils::ConvertToInteger(pElement->bounds)); StartTextSlideTimer(); delete pCanvas; @@ -1722,7 +1725,7 @@ CATCH: } bool -_ListViewItem::IsCutlinkTextSelected(const Point& position, int* index, _ListViewItemUiLinkInfo** ppInfo) const +_ListViewItem::IsCutlinkTextSelected(const FloatPoint& position, int* index, _ListViewItemUiLinkInfo** ppInfo) const { int elementId = GetElementIdFromPosition(position); _ListViewItemElementText* pElement = GetElementText(elementId); @@ -1730,7 +1733,7 @@ _ListViewItem::IsCutlinkTextSelected(const Point& position, int* index, _ListVie if ((pElement != null) && (pElement->pTextObject) && (pElement->cutlinkViewModeEnabled)) { TextObject* pTextObject = pElement->pTextObject; - Rectangle displayRect = pTextObject->GetBounds(); + FloatRectangle displayRect = pTextObject->GetBoundsF(); int selectedIndex = pTextObject->GetCutLinkIndexFromPositionData(position.x - displayRect.x, position.y - displayRect.y); if (selectedIndex >= 0) @@ -1764,7 +1767,7 @@ _ListViewItem::IsCutlinkTextSelected(const Point& position, int* index, _ListVie } bool -_ListViewItem::SetCutlinkTextFocus(const Point& position) +_ListViewItem::SetCutlinkTextFocus(const FloatPoint& position) { int elementId = GetElementIdFromPosition(position); _ListViewItemElementText* pElement = GetElementText(elementId); @@ -1772,7 +1775,7 @@ _ListViewItem::SetCutlinkTextFocus(const Point& position) if ((pElement != null) && (pElement->pTextObject != null) && (pElement->cutlinkViewModeEnabled)) { TextObject* pTextObject = pElement->pTextObject; - Rectangle displayRect = pTextObject->GetBounds(); + FloatRectangle displayRect = pTextObject->GetBoundsF(); int index = pTextObject->GetCutLinkIndexFromPositionData(position.x - displayRect.x, position.y - displayRect.y); @@ -1803,7 +1806,7 @@ _ListViewItem::ResetCutlinkFocus(void) } Font* -_ListViewItem::GetFont(unsigned long fontStyle, int fontSize) +_ListViewItem::GetFont(unsigned long fontStyle, float fontSize) { __fontStyle = fontStyle; __fontSize = fontSize; @@ -1831,10 +1834,16 @@ void _ListViewItem::OnFontInfoRequested(unsigned long& style, int& size) { style = __fontStyle; - size = __fontSize; + size = _CoordinateSystemUtils::ConvertToInteger(__fontSize); } void +_ListViewItem::OnFontInfoRequested(unsigned long& style, float& size) +{ + style = __fontStyle; + size = __fontSize; +} +void _ListViewItem::OnAncestorEnableStateChanged(const _Control& control) { _LinkedList <_ListViewItemElement>::_Iterator iter; @@ -1851,7 +1860,7 @@ _ListViewItem::OnAncestorEnableStateChanged(const _Control& control) bool CompareAccessibilityElement(_ListViewItemElement* a, _ListViewItemElement* b) { - if (a->bounds.y == b->bounds.y) + if (_FloatCompare(a->bounds.y, b->bounds.y)) { return (a->bounds.x < b->bounds.x); } @@ -1862,67 +1871,84 @@ CompareAccessibilityElement(_ListViewItemElement* a, _ListViewItemElement* b) void _ListViewItem::SetAccessibilityElement(void) { - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - - if (pContainer) + if (!_AccessibilityManager::IsActivated()) { - pContainer->RemoveAllElement(); - - _LinkedList <_ListViewItemElement*> accessibilityElementList; + return; + } - _LinkedList <_ListViewItemElement>::_Iterator iter; + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - for (iter = __elements.begin(); iter != __elements.end(); iter++) + if (pContainer != null) + { + if (__pAccessibilityElement == null) { - if (iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT) + _LinkedList <_ListViewItemElement*> accessibilityElementList; + _LinkedList <_ListViewItemElement>::_Iterator iter; + + for (iter = __elements.begin(); iter != __elements.end(); iter++) { - accessibilityElementList.push_back(&(*iter)); + if (iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT) + { + accessibilityElementList.push_back(&(*iter)); + } } - } - accessibilityElementList.sort(CompareAccessibilityElement); + accessibilityElementList.sort(CompareAccessibilityElement); - _LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter; - _ListViewItemElement* pElement = null; + _LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter; + _ListViewItemElement* pElement = null; + String accessibilityLable; - for (accessibilityIter = accessibilityElementList.begin(); accessibilityIter != accessibilityElementList.end(); accessibilityIter++) - { - pElement = *accessibilityIter; + for (accessibilityIter = accessibilityElementList.begin(); accessibilityIter != accessibilityElementList.end(); accessibilityIter++) + { + pElement = *accessibilityIter; - int textLength = pElement->pTextElement->pTextObject->GetTextLength(); + int textLength = pElement->pTextElement->pTextObject->GetTextLength(); - wchar_t* pAccessibilityText = new (std::nothrow) wchar_t[textLength + 1]; - SysTryReturnVoidResult(NID_UI_CTRL, (pAccessibilityText != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + if (textLength > 0) + { + wchar_t* pAccessibilityText = new (std::nothrow) wchar_t[textLength + 1]; + SysTryReturnVoidResult(NID_UI_CTRL, (pAccessibilityText != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength); + pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength); - pElement->pTextElement->pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, (pElement->pTextElement->pAccessibilityElement != null), E_OUT_OF_MEMORY, - "[E_OUT_OF_MEMORY] The memory is insufficient."); + accessibilityLable += String(pAccessibilityText); - pElement->pTextElement->pAccessibilityElement->SetBounds(pElement->bounds); - pElement->pTextElement->pAccessibilityElement->SetLabel(String(pAccessibilityText)); - pElement->pTextElement->pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_LIST); - pElement->pTextElement->pAccessibilityElement->SetName(L"ListViewItemText"); + delete[] pAccessibilityText; + } + } - pContainer->AddElement(*(pElement->pTextElement->pAccessibilityElement)); + accessibilityElementList.clear(); - delete[] pAccessibilityText; - } + __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - accessibilityElementList.clear(); + __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height))); + __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); + __pAccessibilityElement->SetName(L"ListViewItem"); - if (__pDivider != null) - { - _AccessibilityContainer* pDividerContainer = __pDivider->GetAccessibilityContainer(); - if (pDividerContainer != null) + if (accessibilityLable.IsEmpty()) { - pDividerContainer->Activate(false); + accessibilityLable = L"ListViewItem"; } + + __pAccessibilityElement->SetLabel(accessibilityLable); + + pContainer->AddElement(*__pAccessibilityElement); + } + else + { + __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height))); } } } +void +_ListViewItem::SetAccessibilityElementLabel(void) +{ + // nothing +} + _ListViewItemHitTestVEDelegator::_ListViewItemHitTestVEDelegator(void) { } diff --git a/src/ui/controls/FUiCtrl_ListViewItemProviderAdaptor.cpp b/src/ui/controls/FUiCtrl_ListViewItemProviderAdaptor.cpp index a1c5d30..710816b 100644 --- a/src/ui/controls/FUiCtrl_ListViewItemProviderAdaptor.cpp +++ b/src/ui/controls/FUiCtrl_ListViewItemProviderAdaptor.cpp @@ -23,6 +23,7 @@ */ #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_IListItemCommon.h" #include "FUiCtrl_ListItemBaseImpl.h" @@ -43,12 +44,27 @@ namespace Tizen { namespace Ui { namespace Controls _ListViewItemProviderAdaptor::_ListViewItemProviderAdaptor(const IListViewItemProvider& provider) : __pListViewProvider(const_cast(&provider)) + , __pListViewProviderF(null) , __pEventListener(null) , __fontName(L"") - , __itemAverageHeight(0) + , __itemAverageHeight(0.0f) , __itemLoadedCount(0) , __countOfAllItems(0) , __pItemNeedsLazyDeletion(null) + , __usingFloatingPoint(false) +{ +} + +_ListViewItemProviderAdaptor::_ListViewItemProviderAdaptor(const IListViewItemProviderF& provider) + : __pListViewProvider(null) + , __pListViewProviderF(const_cast(&provider)) + , __pEventListener(null) + , __fontName(L"") + , __itemAverageHeight(0.0f) + , __itemLoadedCount(0) + , __countOfAllItems(0) + , __pItemNeedsLazyDeletion(null) + , __usingFloatingPoint(false) { } @@ -63,6 +79,18 @@ void _ListViewItemProviderAdaptor::SetItemProvider(const IListViewItemProvider& provider) { __pListViewProvider = const_cast(&provider); + __pListViewProviderF = null; + + __usingFloatingPoint = false; +} + +void +_ListViewItemProviderAdaptor::SetItemProvider(const IListViewItemProviderF& provider) +{ + __pListViewProvider = null; + __pListViewProviderF = const_cast(&provider); + + __usingFloatingPoint = true; } _IListItemCommon* @@ -80,7 +108,15 @@ _ListViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) return pTableViewItem; } - ListItemBase* pItemBase = __pListViewProvider->CreateItem(itemIndex, GetListWidth()); + ListItemBase* pItemBase = null; + if (__usingFloatingPoint) + { + pItemBase = __pListViewProviderF->CreateItem(itemIndex, GetListWidth()); + } + else + { + pItemBase = __pListViewProvider->CreateItem(itemIndex, _CoordinateSystemUtils::ConvertToInteger(GetListWidth())); + } if (pItemBase == null) { @@ -105,7 +141,7 @@ _ListViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) pListViewItem->SetItemStyle(static_cast(pItemBaseImpl->GetListItemAnnexStyle())); pListViewItem->SetItemWidth(GetListWidth()); - if (IsDescriptionTextShown(itemIndex) == true) + if (IsDescriptionTextShown(itemIndex)) { pListViewItem->SetDescriptionTextShowState(true); } @@ -152,9 +188,20 @@ _ListViewItemProviderAdaptor::UnloadItem(_IListItemCommon* pListItem, int groupI // add ListViewItem event listener //pItemBaseImpl->RemoveListViewItemEventListener(*__pEventListener); - if (__pListViewProvider->DeleteItem(itemIndex, pItemBase, GetListWidth()) == false) + if (__usingFloatingPoint) { - delete pItemBase; + if (!__pListViewProviderF->DeleteItem(itemIndex, pItemBase, GetListWidth())) + { + delete pItemBase; + } + } + else + { + if (!__pListViewProvider->DeleteItem(itemIndex, pItemBase, _CoordinateSystemUtils::ConvertToInteger(GetListWidth()))) + { + delete pItemBase; + } + } } @@ -211,7 +258,14 @@ _ListViewItemProviderAdaptor::GetItemCount(int groupIndex) const { _ListViewItemProviderAdaptor* pItemProviderAdaptor = const_cast<_ListViewItemProviderAdaptor*>(this); - pItemProviderAdaptor->__countOfAllItems = __pListViewProvider->GetItemCount(); + if (__usingFloatingPoint) + { + pItemProviderAdaptor->__countOfAllItems = __pListViewProviderF->GetItemCount(); + } + else + { + pItemProviderAdaptor->__countOfAllItems = __pListViewProvider->GetItemCount(); + } return __countOfAllItems; } @@ -222,16 +276,16 @@ _ListViewItemProviderAdaptor::GetGroupCount(void) const return 1; } -int +float _ListViewItemProviderAdaptor::GetDefaultItemHeight(void) { return __itemAverageHeight; } -int +float _ListViewItemProviderAdaptor::GetDefaultGroupItemHeight(void) { - return 0; + return 0.0f; } bool diff --git a/src/ui/controls/FUiCtrl_ListViewModel.cpp b/src/ui/controls/FUiCtrl_ListViewModel.cpp index 06184ec..61c4c46 100644 --- a/src/ui/controls/FUiCtrl_ListViewModel.cpp +++ b/src/ui/controls/FUiCtrl_ListViewModel.cpp @@ -44,6 +44,7 @@ _ListViewModel::_ListViewModel(void) , __indexOfFocusedItem(-1) , __sizeOfCachingItems(CACHE_SIZE) , __overflowItemsRemovingEnabled(true) + , __onRemovingAllItems(false) { } @@ -123,6 +124,11 @@ _ListViewModel::IsGroupExpanded(int groupIndex) const _IListItemCommon* _ListViewModel::GetItemFromTemporaryBuffer(int groupIndex, int itemIndex) { + if (__onRemovingAllItems) + { + return null; + } + int temporaryGroupIndex = -1; int temporaryItemIndex = -1; if (__pTemporaryItemBuffer != null) @@ -201,6 +207,11 @@ _ListViewModel::GetItemFromContainer(int groupIndex, int itemIndex) const _IListItemCommon* _ListViewModel::LoadItem(int groupIndex, int itemIndex) { + if (__onRemovingAllItems) + { + return null; + } + // check validation of groupIndex SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __countOfAllGroups), null, E_INVALID_ARG, "[E_INVALID_ARG] Wrong group index.(%d)", groupIndex); @@ -530,6 +541,8 @@ _ListViewModel::RemoveAllItem(bool internalDestroy, bool backupItemStatus) return E_SUCCESS; } + __onRemovingAllItems = true; + int groupCount = GetAllGroupCount(); int itemCount = 0; @@ -590,6 +603,7 @@ _ListViewModel::RemoveAllItem(bool internalDestroy, bool backupItemStatus) __backupGroupNodes = __groupNodes; } + __onRemovingAllItems = false; return E_SUCCESS; } @@ -603,6 +617,7 @@ _ListViewModel::RestoreItemStatus(void) _ListViewGroupNode* pListGroupNode = null; _ListViewGroupNode* pBackupedListGroupNode = null; + for (int i = 0; i < __backupGroupNodes.size(); i++) { pListGroupNode = GetGroupNode(i); @@ -643,6 +658,7 @@ _ListViewModel::UnloadItem(int groupIndex, int itemIndex) _IListItemCommon* pItem = null; int temporaryGroupIndex = -1; int temporaryItemIndex = -1; + while (theIter != pListGroupNode->__items.end()) { pItem = *theIter; @@ -1319,8 +1335,6 @@ _ListViewModel::AddItemToGroup(_IListItemCommon* pItem, int groupIndex) result _ListViewModel::InsertItemToGroup(_IListItemCommon* pItem, int groupIndex, int itemIndex) { - SysTryReturn(NID_UI_CTRL, pItem != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pItem is null."); - // check validation of groupIndex SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __countOfAllGroups), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Wrong group index(%d).", groupIndex); @@ -1335,8 +1349,6 @@ _ListViewModel::InsertItemToGroup(_IListItemCommon* pItem, int groupIndex, int i SysTryReturn(NID_UI_CTRL, pListGroupNode != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - pItem->SetItemIndex(groupIndex, itemIndex); - _IListItemCommon* pTemporaryItem = null; int temporaryGroupIndex = -1; int temporaryItemIndex = -1; @@ -1397,7 +1409,15 @@ _ListViewModel::InsertItemToGroup(_IListItemCommon* pItem, int groupIndex, int i pListGroupNode->__itemCountInGroup++; __countOfAllItems++; - return LoadItemToContainer(groupIndex, itemIndex, *pItem); + result r = E_SUCCESS; + + if (pItem !=null) + { + pItem->SetItemIndex(groupIndex, itemIndex); + r = LoadItemToContainer(groupIndex, itemIndex, *pItem); + } + + return r; } result diff --git a/src/ui/controls/FUiCtrl_ListViewTouchEventHandler.cpp b/src/ui/controls/FUiCtrl_ListViewTouchEventHandler.cpp new file mode 100644 index 0000000..309e0c0 --- /dev/null +++ b/src/ui/controls/FUiCtrl_ListViewTouchEventHandler.cpp @@ -0,0 +1,257 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrl_ListViewTouchEventHandler.cpp + * @brief This is the implementation file for _ListViewTouchEventHandler class. + * + * This file contains the implementation of _ListViewTouchEventHandler class. + */ + +#include +#include "FUiCtrl_GroupedListViewImpl.h" +#include "FUiCtrl_ListViewImpl.h" +#include "FUiCtrl_ListViewTouchEventHandler.h" + +#ifdef MEMORY_LEAK_CHECK +#include "mem_leak_check.h" +#endif + +using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Runtime; +using namespace Tizen::Base::Utility; +using namespace Tizen::Graphics; + +namespace Tizen { namespace Ui { namespace Controls +{ +_ListViewTouchEventHandler::_ListViewTouchEventHandler(_ControlImpl& impl, ListViewStyle style) + : __impl(impl) + , __core(impl.GetCore()) + , __public(impl.GetPublic()) + , __style(style) + , __oldPreviousPressedTime(0) + , __previousPressedTime(0) + , __currentPressedTime(0) + , __previousPressedPoint(0.0f, 0.0f) + , __currentPressedPoint(0.0f, 0.0f) +{ + __pTouchManager = _TouchManager::GetInstance(); + SysTryReturnVoidResult(NID_UI, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred."); +} + +_ListViewTouchEventHandler::~_ListViewTouchEventHandler(void) +{ +} + +bool +_ListViewTouchEventHandler::ProcessTouchEventListener(const _TouchInfo& touchInfo) +{ + bool filtered = false; + + if (touchInfo.GetTouchStatus() == _TOUCH_PRESSED) + { + filtered = ProcessTouchDoublePressed(touchInfo); + } + + if (!filtered) + { + ProcessTouchEvent(touchInfo); + } + + if (__style == LIST_VIEW_STYLE_SIMPLE) + { + filtered = dynamic_cast<_ListViewImpl*>(&__impl)->GetInputEventConsumeState(); + } + else if (__style == LIST_VIEW_STYLE_GROUPED) + { + filtered = dynamic_cast<_GroupedListViewImpl*>(&__impl)->GetInputEventConsumeState(); + } + + return filtered; +} + + +bool +_ListViewTouchEventHandler::ProcessTouchEventListener(void) +{ + // for TouchLongPressed + _TouchInfo touchInfo(0, _TOUCH_LONG_PRESSED, __currentPressedPoint, false, 0); + + return ProcessTouchEventListener(touchInfo); +} + +void +_ListViewTouchEventHandler::ProcessTouchEvent(const _TouchInfo& touchInfo) +{ + TouchEventInfo publicTouchInfo; + + _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo); + SysTryReturnVoidResult(NID_UI, pEventArg, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + publicTouchInfo.Construct(*pEventArg); + + _Control* pDraggedControl = __pTouchManager->GetTouchControlSource(); + + IEnumeratorT* pEnumerator = __impl.GetTouchEventListener()->GetEnumeratorN(); + if (pEnumerator) + { + while (pEnumerator->MoveNext() == E_SUCCESS) + { + IEventListener* pListener = null; + pEnumerator->GetCurrent(pListener); + + ITouchEventListener* pTouchEventListener = dynamic_cast (pListener); + if (pTouchEventListener != null) + { + FirePublicListener(*pTouchEventListener, publicTouchInfo); + + if (touchInfo.GetTouchStatus() == _TOUCH_RELEASED) + { + if (pDraggedControl == null) //if exist dragged control, don't send focus event + { + FireFocusListener(*pTouchEventListener, publicTouchInfo); + } + } + else if (touchInfo.GetTouchStatus() == _TOUCH_MOVED) + { + FireFocusListener(*pTouchEventListener, publicTouchInfo); + } + } + } + + delete pEnumerator; + } + + delete pEventArg; +} + +bool +_ListViewTouchEventHandler::ProcessTouchDoublePressed(const _TouchInfo& touchinfo) +{ + if (__pTouchManager->GetPointCount() == 1) + { + __oldPreviousPressedTime = __previousPressedTime; + __previousPressedTime = __currentPressedTime; + __currentPressedTime = touchinfo.GetTimeStamp(); + __previousPressedPoint.x = __currentPressedPoint.x; + __previousPressedPoint.y = __currentPressedPoint.y; + __currentPressedPoint.x = touchinfo.GetCurrentPosition().x; + __currentPressedPoint.y = touchinfo.GetCurrentPosition().y; + + if (Math::Abs(__previousPressedTime - __currentPressedTime) < DOUBLE_PRESS_TIME) + { + if (Math::Abs(__previousPressedTime - __oldPreviousPressedTime) > DOUBLE_PRESS_TIME) + { + if ((Math::Abs(__previousPressedPoint.x - __currentPressedPoint.x) < DOUBLE_PRESS_MOVE_ALLOWANCE) + && (Math::Abs(__previousPressedPoint.y - __currentPressedPoint.y) < DOUBLE_PRESS_MOVE_ALLOWANCE)) + { + _TouchInfo touchInfo(0, _TOUCH_DOUBLE_PRESSED, __currentPressedPoint, false, 0); + ProcessTouchEvent(touchInfo); + + return true; + } + } + } + } + + return false; +} + +void +_ListViewTouchEventHandler::FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +{ + switch (touchEventInfo.GetTouchStatus()) + { + case TOUCH_PRESSED: + listener.OnTouchPressed(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_LONG_PRESSED: + listener.OnTouchLongPressed(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_RELEASED: + listener.OnTouchReleased(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_MOVED: + listener.OnTouchMoved(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_DOUBLE_PRESSED: + listener.OnTouchDoublePressed(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_FOCUS_IN: + listener.OnTouchFocusIn(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_FOCUS_OUT: + listener.OnTouchFocusOut(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + case TOUCH_CANCELED: + listener.OnTouchCanceled(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + break; + default: + break; + } +} + +void +_ListViewTouchEventHandler::FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo) +{ + _ControlManager* pControlManager = _ControlManager::GetInstance(); + SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] System error occurred."); + + Point screenPoint(__pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).x, + __pTouchManager->GetScreenPoint(touchEventInfo.GetPointId()).y); + + _Control* pTouchedControl = pControlManager->GetTopmostTouchedControl(screenPoint); + SysTryReturnVoidResult(NID_UI, pTouchedControl, E_INVALID_CONDITION, "[E_INVALID_CONDITION] pTouchedControl is null."); + + if (__pTouchManager->GetFocusedControlSource() != pTouchedControl) + { + if (&(__core) != pTouchedControl) + { + if (__pTouchManager->GetFocusedControlSource() == &(__core)) + { + listener.OnTouchFocusOut(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + } + } + else + { + listener.OnTouchFocusIn(__public, touchEventInfo.GetCurrentPosition(), touchEventInfo); + } + + __pTouchManager->SetFocusedControlSource(*pTouchedControl); + } +} + +_TouchEventArg* +_ListViewTouchEventHandler::GetTouchEventArgN(const _TouchInfo& touchInfo) +{ + Point startPoint; + + _TouchEventArg* pEventArg = new (std::nothrow) _TouchEventArg(__public, touchInfo.GetTouchStatus()); + SysTryReturn(NID_UI, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + startPoint.SetPosition(__pTouchManager->GetStartPoint(touchInfo.GetPointId()).x - __core.GetAbsoluteBounds().x, + __pTouchManager->GetStartPoint(touchInfo.GetPointId()).y - __core.GetAbsoluteBounds().y); + + pEventArg->SetTouchPosition(touchInfo.GetPointId(), startPoint.x, startPoint.y, + touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); + + // need to flick distance setting + + return pEventArg; +} + +}}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_MessageBox.cpp b/src/ui/controls/FUiCtrl_MessageBox.cpp old mode 100644 new mode 100755 index 23df460..e57b8f6 --- a/src/ui/controls/FUiCtrl_MessageBox.cpp +++ b/src/ui/controls/FUiCtrl_MessageBox.cpp @@ -25,6 +25,7 @@ #include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" @@ -75,22 +76,18 @@ _MessageBox::CreateMessageBoxN(void) _MessageBox* pMsgbox = new (std::nothrow) _MessageBox(); SysTryReturn(NID_UI, pMsgbox != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -#if defined(MULTI_WINDOW) result r = pMsgbox->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif // for taking touch event pMsgbox->AcquireHandle(); return pMsgbox; -#if defined(MULTI_WINDOW) CATCH: delete pMsgbox; return null; -#endif } result @@ -98,7 +95,7 @@ _MessageBox::Initialize(const String& title, const String& text, MessageBoxStyle { result r = E_SUCCESS; - int titleHeight = 0; + float titleHeight = 0.0f; _titleText = title; _titleState = !(title.Equals(L"", false)); @@ -154,7 +151,7 @@ _MessageBox::Initialize(const String& title, const String& text, MessageBoxStyle pContainer->Activate(true); } - SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_NORMAL); + SetTouchPressThreshold(0.08); return r; } @@ -171,7 +168,10 @@ void _MessageBox::OnDraw() { __pMsgboxPresenter->Draw(); - + if(unlikely((_AccessibilityManager::IsActivated()))) + { + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); + } return; } @@ -251,49 +251,51 @@ _MessageBox::GetMsgBoxStyle(void) const return __msgboxStyle; } -int +float _MessageBox::GetTotalHeight(void) const { - int titleHeight = 0; - int btnHeight = 0; + float titleHeight = 0.0f; + float btnHeight = 0.0f; - int textTopMargin = 0; - int textTopMarginNoButton = 0; + float textTopMargin = 0.0f; + float textTopMarginNoButton = 0.0f; - int btnGap = 0; - int btnTopMargin = 0; - int btnBottomMargin = 0; + float btnGap = 0.0f; + float btnTopMargin = 0.0f; + float btnBottomMargin = 0.0f; - int transTopMargin = 0; - int transBottomMargin = 0; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, GetOrientation(), btnHeight); + _ControlOrientation orientation; + orientation = GetOrientation(); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, GetOrientation(), textTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN_NO_BUTTON, GetOrientation(), textTopMarginNoButton); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN_NO_BUTTON, orientation, textTopMarginNoButton); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_INTERNAL_GAP, GetOrientation(), btnGap); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, GetOrientation(), btnTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, GetOrientation(), btnBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_INTERNAL_GAP, orientation, btnGap); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, btnTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, orientation, btnBottomMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, GetOrientation(), transBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); if (HasTitle() == false) { - titleHeight = 0; + titleHeight = 0.0f; } - int totalH = titleHeight - + __pMsgboxPresenter->GetBodyTextHeight() + float totalH = titleHeight + transTopMargin - + transBottomMargin; + + transBottomMargin + + __pMsgboxPresenter->GetBodyTextHeight(); switch (__msgboxStyle) { case MSGBOX_STYLE_NONE: - totalH += textTopMarginNoButton * 2; + totalH += textTopMarginNoButton * 2.0f; break; case MSGBOX_STYLE_OK: @@ -311,7 +313,7 @@ _MessageBox::GetTotalHeight(void) const case MSGBOX_STYLE_ABORTRETRYIGNORE: // fall through case MSGBOX_STYLE_CANCELTRYCONTINUE: - totalH += textTopMargin * 2 + totalH += textTopMargin * 2.0f + btnHeight + btnTopMargin + btnBottomMargin; @@ -337,7 +339,7 @@ _MessageBox::OnChangeLayout(_ControlOrientation orientation) void _MessageBox::OnBoundsChanged(void) { - SetClientBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + SetClientBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); return; } diff --git a/src/ui/controls/FUiCtrl_MessageBoxImpl.cpp b/src/ui/controls/FUiCtrl_MessageBoxImpl.cpp index 9836a1e..931bd65 100644 --- a/src/ui/controls/FUiCtrl_MessageBoxImpl.cpp +++ b/src/ui/controls/FUiCtrl_MessageBoxImpl.cpp @@ -24,6 +24,7 @@ // Includes #include #include "FUi_ControlImplManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_MessageBoxImpl.h" @@ -85,17 +86,20 @@ _MessageBoxImpl::Initialize(const Tizen::Base::String& title, const Tizen::Base: { result r = E_SUCCESS; - Rectangle bounds; - int totalH = -1; + FloatRectangle bounds; + float totalH = -1.0f; - int maxHeight = 0; - int defaultWidth = 0; + float maxHeight = 0.0f; + float defaultWidth = 0.0f; + + _ControlOrientation orientation; r = GetCore().Initialize(title, text, style, timeout); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, GetCore().GetOrientation(), maxHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, GetCore().GetOrientation(), defaultWidth); + orientation = GetCore().GetOrientation(); + GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); totalH = GetCore().GetTotalHeight(); @@ -224,25 +228,25 @@ _MessageBoxImpl::GetMaxTextLength(void) const return maxLength; } -Rectangle -_MessageBoxImpl::GetCenterAlignRect(int width, int height) const +FloatRectangle +_MessageBoxImpl::GetCenterAlignRect(float width, float height) const { - int x = 0; - int y = 0; + float x = 0.0f; + float y = 0.0f; - Dimension screenRect = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screenRect = _ControlManager::GetInstance()->GetScreenSizeF(); if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) { - int temp = screenRect.width; + float temp = screenRect.width; screenRect.width = screenRect.height; screenRect.height = temp; } - x = (screenRect.width - width) / 2; - y = (screenRect.height - height) / 2; + x = (screenRect.width - width) / 2.0f; + y = (screenRect.height - height) / 2.0f; - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); } @@ -250,18 +254,18 @@ void _MessageBoxImpl::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - Dimension portraitSize; - Dimension landscapeSize; + FloatDimension portraitSize; + FloatDimension landscapeSize; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - portraitSize = Dimension(GetBounds().width, GetBounds().height); - landscapeSize = Dimension(portraitSize.height, portraitSize.width); + portraitSize = FloatDimension(GetBoundsF().width, GetBoundsF().height); + landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); } else { - portraitSize = Dimension(GetBounds().height, GetBounds().width); - landscapeSize = Dimension(portraitSize.height, portraitSize.width); + portraitSize = FloatDimension(GetBoundsF().height, GetBoundsF().width); + landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); } if (orientation == _CONTROL_ORIENTATION_PORTRAIT) diff --git a/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp b/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp old mode 100755 new mode 100644 index 2b3676c..cb895f0 --- a/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp +++ b/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp @@ -27,9 +27,11 @@ #include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_Math.h" #include "FUi_ModalLoopManager.h" #include "FUi_ResourceManager.h" #include "FUi_TouchManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_ButtonImpl.h" #include "FUiCtrl_Button.h" #include "FUiCtrl_Scroll.h" @@ -56,15 +58,15 @@ _MessageBoxPresenter::_MessageBoxPresenter(void) , __pTextAccessibilityElement(null) , __pTitleTextObject(null) , __pBodyTextObject(null) - , __titleBounds(0, 0, 0, 0) - , __textBounds(0, 0, 0, 0) + , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __textBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pScroll(null) , __fontStyle(0) , __fontSize(0) - , __scrollPos(0) + , __scrollPos(0.0f) , __buttonNum(0) - , __prevPositionY(-1) - , __textObjHeight(0) + , __prevPositionY(-1.0f) + , __textObjHeight(0.0f) , __touchPressFlag(false) , __scrollStart(false) , __btnClickFlag(false) @@ -124,54 +126,58 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) String bodyText = L""; TextSimple* pSimpleTextForBodyText = null; - int titleTextSize = 0; - int bodyTextSize = 0; + float titleTextSize = 0.0f; + float bodyTextSize = 0.0f; - int defaultWidth = 0; - int titleHeight = 0; - int bottomHeight = 0; - int maxHeight = 0; + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float bottomHeight = 0.0f; + float maxHeight = 0.0f; - int btnBottomMargin = 0; - int textTopMargin = 0; - int textLeftMargin = 0; - int textRightMargin = 0; + float btnBottomMargin = 0.0f; + float textTopMargin = 0.0f; + float textLeftMargin = 0.0f; + float textRightMargin = 0.0f; - int titleTopMargin = 0; - int titleLeftMargin = 0; - int titleRightMargin = 0; + float titleTopMargin = 0.0f; + float titleLeftMargin = 0.0f; + float titleRightMargin = 0.0f; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; - int totalHeightExceptTextObj = 0; - int tempHeight = 0; + float totalHeightExceptTextObj = 0.0f; + float tempHeight = 0.0f; + + _ControlOrientation orientation; __pMessageBox = &msgbox; - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_SIZE, __pMessageBox->GetOrientation(), titleTextSize); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, __pMessageBox->GetOrientation(), bodyTextSize); + orientation = __pMessageBox->GetOrientation(); + + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, bodyTextSize); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pMessageBox->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, __pMessageBox->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, __pMessageBox->GetOrientation(), bottomHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, __pMessageBox->GetOrientation(), maxHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, __pMessageBox->GetOrientation(), btnBottomMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, __pMessageBox->GetOrientation(), textTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_LEFT_MARGIN, __pMessageBox->GetOrientation(), textLeftMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_RIGHT_MARGIN, __pMessageBox->GetOrientation(), textRightMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, orientation, btnBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_LEFT_MARGIN, orientation, textLeftMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_RIGHT_MARGIN, orientation, textRightMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_TOP_MARGIN, __pMessageBox->GetOrientation(), titleTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_LEFT_MARGIN, __pMessageBox->GetOrientation(), titleLeftMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_RIGHT_MARGIN, __pMessageBox->GetOrientation(), titleRightMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_LEFT_MARGIN, orientation, titleLeftMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pMessageBox->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pMessageBox->GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pMessageBox->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pMessageBox->GetOrientation(), transRightMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); // TitleText if (__pMessageBox->HasTitle() == true) @@ -196,16 +202,16 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength()); __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pTitleTextObject->SetBounds(Rectangle(titleLeftMargin + transLeftMargin, + __pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin + transTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin)); __pTitleTextObject->Compose(); - __titleBounds = Rectangle(titleLeftMargin + transLeftMargin, + __titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin + transTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), - __pTitleTextObject->GetTotalHeight()); + __pTitleTextObject->GetTotalHeightF()); } else @@ -232,21 +238,21 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) __pBodyTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); __pBodyTextObject->SetFont(_pFont, 0, __pBodyTextObject->GetTextLength()); __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pBodyTextObject->SetBounds(Rectangle(textLeftMargin + transLeftMargin, + __pBodyTextObject->SetBounds(FloatRectangle(textLeftMargin + transLeftMargin, titleHeight + textTopMargin + transTopMargin, defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin), maxHeight - titleHeight)); __pBodyTextObject->Compose(); - __textObjHeight = __pBodyTextObject->GetTotalHeight(); + __textObjHeight = __pBodyTextObject->GetTotalHeightF(); // Text bounds - totalHeightExceptTextObj = titleHeight + (textTopMargin * 2) + bottomHeight + (transTopMargin + transBottomMargin); + totalHeightExceptTextObj = titleHeight + (textTopMargin * 2.0f) + bottomHeight + (transTopMargin + transBottomMargin); tempHeight = maxHeight - (totalHeightExceptTextObj + __textObjHeight); - __textObjHeight = (tempHeight > 0) ? __textObjHeight : __textObjHeight + tempHeight; + __textObjHeight = (tempHeight > 0.0f) ? __textObjHeight : __textObjHeight + tempHeight; - __textBounds.SetBounds(textLeftMargin+ transLeftMargin, + __textBounds.SetBounds(textLeftMargin + transLeftMargin, titleHeight + textTopMargin + transTopMargin, defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin), __textObjHeight); @@ -254,9 +260,9 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) __pBodyTextObject->SetBounds(__textBounds); // Scroll in Text - if (__pBodyTextObject->GetTotalHeight() > __textObjHeight) + if (__pBodyTextObject->GetTotalHeightF() > __textObjHeight) { - int maxH = __pBodyTextObject->GetTotalHeight(); + float maxH = __pBodyTextObject->GetTotalHeightF(); __pScroll = _Scroll::CreateScrollN(*__pMessageBox, SCROLL_DIRECTION_VERTICAL, @@ -266,7 +272,7 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) false, __textObjHeight, maxH, - 0); + 0.0f); SysTryCatch(NID_UI_CTRL, __pScroll != null, , E_OUT_OF_MEMORY, "[E_SYSTEM] Failed to create the scroll."); @@ -321,41 +327,49 @@ _MessageBoxPresenter::Draw(void) { result r = E_SUCCESS; - int defaultWidth = 0; - int titleHeight = 0; - int titleTextSize = 0; - int titleTopMargin = 0; + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float titleTextSize = 0.0f; + float titleTopMargin = 0.0f; - int btnHeight = 0; - int btnTopMargin = 0; - int btnBottomMargin = 0; + float btnHeight = 0.0f; + float btnTopMargin = 0.0f; + float btnBottomMargin = 0.0f; - int textSize = 0; - int textTopMarginNoButton = 0; - int textTopMargin = 0; + float textSize = 0.0f; + float textTopMarginNoButton = 0.0f; + float textTopMargin = 0.0f; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pMessageBox->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, __pMessageBox->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_SIZE, __pMessageBox->GetOrientation(), titleTextSize); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_TOP_MARGIN, __pMessageBox->GetOrientation(), titleTopMargin); + bool isCustomBitmap = false; - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, __pMessageBox->GetOrientation(), textSize); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, __pMessageBox->GetOrientation(), textTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN_NO_BUTTON, __pMessageBox->GetOrientation(), textTopMarginNoButton); + _ControlOrientation orientation; - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __pMessageBox->GetOrientation(), btnHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, __pMessageBox->GetOrientation(), btnTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, __pMessageBox->GetOrientation(), btnBottomMargin); + isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_NORMAL); + + orientation = __pMessageBox->GetOrientation(); + + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); + + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, textSize); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN_NO_BUTTON, orientation, textTopMarginNoButton); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pMessageBox->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pMessageBox->GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pMessageBox->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pMessageBox->GetOrientation(), transRightMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, btnTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, orientation, btnBottomMargin); + + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); Canvas* pCanvas = __pMessageBox->GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas."); @@ -363,23 +377,36 @@ _MessageBoxPresenter::Draw(void) pCanvas->SetBackgroundColor(Color(0x00000000)); pCanvas->Clear(); - bool hasBgBitmap = (__pMessageBox->GetBackgroundBitmap() != null); + float totalH = __pMessageBox->GetTotalHeight(); + + FloatRectangle bgBounds(0.0f, 0.0f, _CoordinateSystemUtils::ConvertToFloat(defaultWidth), totalH); - int totalH = __pMessageBox->GetTotalHeight(); + const Bitmap* pBackgroundBitmap = __pMessageBox->GetBackgroundBitmap(); + const Bitmap* pOutlineBitmap = __pMessageBox->GetOutlineBitmap(); // Draw BG - if (hasBgBitmap == true) + if (pBackgroundBitmap != null) { - Rectangle bounds(0, 0, defaultWidth, totalH); - - const Bitmap* pBackgroundBitmap = __pMessageBox->GetBackgroundBitmap(); if (pBackgroundBitmap->IsNinePatchedBitmap() == true) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bgBounds, *pBackgroundBitmap); + } + else + { + pCanvas->DrawBitmap(bgBounds, *pBackgroundBitmap); + } + } + + // Draw Outline + if (!isCustomBitmap && pOutlineBitmap != null) + { + if (pOutlineBitmap->IsNinePatchedBitmap() == true) + { + pCanvas->DrawNinePatchedBitmap(bgBounds, *pOutlineBitmap); } else { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap); + pCanvas->DrawBitmap(bgBounds, *pOutlineBitmap); } } @@ -450,7 +477,6 @@ _MessageBoxPresenter::ShowAndWait(int& modalResult) __pMessageBox->Close(); - modalResult = GetReturnValue(); return r; @@ -467,7 +493,7 @@ _MessageBoxPresenter::ProcessEvent(void) _Control* pControl = pTouchManager->GetTouchControlSource(); if (pControl) { - pControl->SetEventReceivable(false); + pControl->SetEventEnableState(false); } } @@ -579,7 +605,7 @@ _MessageBoxPresenter::CreateButtons(void) if (pButtonCore != null) { - pButtonCore->SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE); + pButtonCore->SetTouchPressThreshold(0.16); } } @@ -598,61 +624,63 @@ CATCH: return r; } -Rectangle +FloatRectangle _MessageBoxPresenter::CalculateButtonPositionAndSize(int buttonIndex) { - int x = 0; - int y = 0; - int w = 0; - int h = 0; + float x = 0.0f; + float y = 0.0f; + float w = 0.0f; + float h = 0.0f; - int defaultWidth = 0; - int btnHeight = 0; + float defaultWidth = 0.0f; + float btnHeight = 0.0f; - int btnSideMargin1 = 0; - int btnSideMargin2 = 0; - int btnSideMargin3 = 0; - int btnTopMargin = 0; + float btnSideMargin1 = 0.0f; + float btnSideMargin2 = 0.0f; + float btnSideMargin3 = 0.0f; + float btnTopMargin = 0.0f; - int btnGap = 0; - int textTopMargin = 0; + float btnGap = 0.0f; + float textTopMargin = 0.0f; - int titleHeight = 0; - int transTopMargin = 0; + float titleHeight = 0.0f; + float transTopMargin = 0.0f; - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pMessageBox->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __pMessageBox->GetOrientation(), btnHeight); + _ControlOrientation orientation; + orientation = __pMessageBox->GetOrientation(); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, __pMessageBox->GetOrientation(), btnSideMargin1); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, __pMessageBox->GetOrientation(), btnSideMargin2); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_03, __pMessageBox->GetOrientation(), btnSideMargin3); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, __pMessageBox->GetOrientation(), btnTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, orientation, btnSideMargin1); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, btnSideMargin2); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_03, orientation, btnSideMargin3); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, btnTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_INTERNAL_GAP, __pMessageBox->GetOrientation(), btnGap); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, __pMessageBox->GetOrientation(), textTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_INTERNAL_GAP, orientation, btnGap); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_TOP_MRAGIN, orientation, textTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, __pMessageBox->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pMessageBox->GetOrientation(), transTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); if (__pMessageBox->HasTitle() == false) { - titleHeight = 0; + titleHeight = 0.0f; } switch (__buttonNum) { case 1: - w = defaultWidth - (btnSideMargin1 * 2); + w = defaultWidth - (btnSideMargin1 * 2.0f); h = btnHeight; x = btnSideMargin1; - y = transTopMargin + titleHeight + (textTopMargin * 2) + __textObjHeight + btnTopMargin; + y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin; break; case 2: - w = (defaultWidth - (btnSideMargin2 * 2) - btnGap) / 2; + w = (defaultWidth - (btnSideMargin2 * 2.0f) - btnGap) / 2.0f; h = btnHeight; x = btnSideMargin2 + (buttonIndex * (w + btnGap)); - y = transTopMargin + titleHeight + (textTopMargin * 2) + __textObjHeight + btnTopMargin; + y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin; break; case 3: @@ -664,10 +692,10 @@ _MessageBoxPresenter::CalculateButtonPositionAndSize(int buttonIndex) case 1: // fall through case 2: - w = (defaultWidth - ((btnSideMargin3 + btnGap) * 2)) / 3; + w = (defaultWidth - ((btnSideMargin3 + btnGap) * 2.0f)) / 3.0f; h = btnHeight; x = btnSideMargin3 + (buttonIndex * (w + btnGap)); - y = transTopMargin + titleHeight + (textTopMargin * 2) + __textObjHeight + btnTopMargin; + y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin; break; } break; @@ -676,7 +704,7 @@ _MessageBoxPresenter::CalculateButtonPositionAndSize(int buttonIndex) break; } - return Rectangle(x, y, w, h); + return FloatRectangle(x, y, w, h); } void @@ -803,10 +831,10 @@ _MessageBoxPresenter::FindButtonAndResult(const _ControlHandle handle) } } -int +float _MessageBoxPresenter::CalculateButtonAreaHeight(void) { - int btnHeight = 0; + float btnHeight = 0.0f; GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __pMessageBox->GetOrientation(), btnHeight); @@ -833,22 +861,22 @@ _MessageBoxPresenter::CalculateButtonAreaHeight(void) return btnHeight; } - return -1; + return -1.0f; } -int +float _MessageBoxPresenter::GetBodyTextHeight(void) const { - return (__pBodyTextObject == null) ? 0 : __pBodyTextObject->GetTotalHeight(); + return (__pBodyTextObject == null) ? 0.0f : __pBodyTextObject->GetTotalHeightF(); } -Rectangle +FloatRectangle _MessageBoxPresenter::GetTitleBounds(void) const { return __titleBounds; } -Rectangle +FloatRectangle _MessageBoxPresenter::GetTextBounds(void) const { return __textBounds; @@ -886,7 +914,7 @@ _MessageBoxPresenter::OnAttachedToMainTree(void) _AccessibilityContainer* pContainer = __pMessageBox->GetAccessibilityContainer(); if (pContainer != null) { - int titleHeight = 0; + float titleHeight = 0.0f; GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, __pMessageBox->GetOrientation(), titleHeight); if (pTitleTextAccessibility == null) @@ -955,12 +983,12 @@ _MessageBoxPresenter::OnAttachedToMainTree(void) bool _MessageBoxPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point = touchinfo.GetCurrentPosition(); - Rectangle rect(0, 0, __pMessageBox->GetBounds().width, __pMessageBox->GetBounds().height); + FloatRectangle rect(0.0f, 0.0f, __pMessageBox->GetBoundsF().width, __pMessageBox->GetBoundsF().height); // Touch-event's starting point is MessageBox's leftTop - if (rect.Contains(touchinfo.GetCurrentPosition()) == false) + if (rect.Contains(point) == false) { __touchOutBounds = true; } @@ -971,7 +999,7 @@ _MessageBoxPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& t __touchPressFlag = true; - if ((__pScroll != null) && (__textBounds.Contains(touchinfo.GetCurrentPosition()) == true)) + if ((__pScroll != null) && (__textBounds.Contains(point) == true)) { __pScroll->SetScrollVisibility(true); @@ -995,7 +1023,7 @@ _MessageBoxPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& if (__touchPressFlag == false) { - __prevPositionY = -1; + __prevPositionY = -1.0f; __scrollStart = false; } @@ -1015,24 +1043,24 @@ _MessageBoxPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou if ((__pScroll != null) && (__scrollStart == true)) { - int scrollAmountView = -1; - int scrollAmountData = -1; - int currentPosition = touchinfo.GetCurrentPosition().y; + float scrollAmountView = 0.0f; + float scrollAmountData = 0.0f; + float currentPosition = touchinfo.GetCurrentPosition().y; // TextObject - if (__prevPositionY == -1) + if (_FloatCompare(__prevPositionY, -1.0f)) { - __prevPositionY = touchinfo.GetCurrentPosition().y; + __prevPositionY = currentPosition; } - int distance = __prevPositionY - currentPosition; + float distance = __prevPositionY - currentPosition; - int newFirstDspY = __pBodyTextObject->GetFirstDisplayPositionY(); + float newFirstDspY = __pBodyTextObject->GetFirstDisplayPositionYF(); newFirstDspY += distance; - if (newFirstDspY < 0) + if (newFirstDspY < 0.0f) { - newFirstDspY = 0; + newFirstDspY = 0.0f; } if (newFirstDspY > __textBounds.height) @@ -1049,9 +1077,9 @@ _MessageBoxPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou __pScroll->GetScrollRange(&scrollAmountView, &scrollAmountData); __scrollPos += distance; - if (__scrollPos < 0) + if (__scrollPos < 0.0f) { - __scrollPos = 0; + __scrollPos = 0.0f; } else if (__scrollPos > scrollAmountView) { @@ -1081,7 +1109,7 @@ _MessageBoxPresenter::_MessageBoxButtonListener::_MessageBoxButtonListener(void) : __buttonHandle() , __buttonPressFlag(false) , __buttonReleaseState(false) - , __point(0, 0) + , __point(0.0f, 0.0f) { // empty statement } @@ -1110,7 +1138,7 @@ _MessageBoxPresenter::_MessageBoxButtonListener::OnTouchPressed(const Control& s __buttonPressFlag = true; __buttonReleaseState = false; - Point point = touchInfo.GetCurrentPosition(); + FloatPoint point = touchInfo.GetCurrentPositionF(); __point = point; } @@ -1118,7 +1146,7 @@ void _MessageBoxPresenter::_MessageBoxButtonListener::OnTouchMoved(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo) { - Point point = touchInfo.GetCurrentPosition(); + //FloatPoint point = touchInfo.GetCurrentPositionF(); __buttonPressFlag = false; } diff --git a/src/ui/controls/FUiCtrl_OptionMenu.cpp b/src/ui/controls/FUiCtrl_OptionMenu.cpp index 5ef3ff9..4eda197 100644 --- a/src/ui/controls/FUiCtrl_OptionMenu.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenu.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenu.cpp * @brief This is the implementation file for the _OptionMenu class. @@ -30,6 +31,7 @@ #include "FUiAnim_VisualElement.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" using namespace Tizen::Base; @@ -81,10 +83,8 @@ _OptionMenu::CreateOptionMenuN(void) result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, r, "[%s] Propagating.", GetErrorMessage(r)); -#if defined(MULTI_WINDOW) r = pOptionMenu->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif pOptionMenu->AcquireHandle(); @@ -375,7 +375,9 @@ _OptionMenu::ShowSubMenu(int mainIndex, _OptionMenuItem& item) Rectangle itemBounds = __pOptionMenuPresenter->GetItemBounds(mainIndex); Point anchorPosition(GetBounds().x + itemBounds.x + itemBounds.width / 2, GetBounds().y + itemBounds.y + itemBounds.height / 2 - textSize / 2); - __pSubMenu = _ContextMenu::CreateContextMenuN(anchorPosition, + FloatPoint floatAnchorPosition = _CoordinateSystemUtils::ConvertToFloat(anchorPosition); + + __pSubMenu = _ContextMenu::CreateContextMenuN(floatAnchorPosition, CONTEXT_MENU_CORE_STYLE_LIST, CONTEXT_MENU_CORE_ALIGN_UP); if (__pSubMenu == null) @@ -511,9 +513,7 @@ _OptionMenu::OnDetachingFromMainTree(void) void _OptionMenu::OnVisibleStateChanged(void) { -#if defined(MULTI_WINDOW) _Window::OnVisibleStateChanged(); -#endif __pOptionMenuPresenter->OnVisibleStateChanged(); } diff --git a/src/ui/controls/FUiCtrl_OptionMenuImpl.cpp b/src/ui/controls/FUiCtrl_OptionMenuImpl.cpp index 67898ca..a0c913a 100644 --- a/src/ui/controls/FUiCtrl_OptionMenuImpl.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuImpl.cpp * @brief This is the implementation file for the _OptionMenuImpl class. diff --git a/src/ui/controls/FUiCtrl_OptionMenuItem.cpp b/src/ui/controls/FUiCtrl_OptionMenuItem.cpp index c71816c..aa05ea8 100644 --- a/src/ui/controls/FUiCtrl_OptionMenuItem.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuItem.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuItem.cpp * @brief This is the implementation file for the _OptionMenuItem class. diff --git a/src/ui/controls/FUiCtrl_OptionMenuModel.cpp b/src/ui/controls/FUiCtrl_OptionMenuModel.cpp index 6a3178b..a3dc390 100644 --- a/src/ui/controls/FUiCtrl_OptionMenuModel.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuModel.cpp * @brief This is the implementation file for the _OptionMenuModel class. diff --git a/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp b/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp index 360583a..2d551a6 100644 --- a/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp +++ b/src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuPresenter.cpp * @brief This is the implementation file for the _OptionMenuPresenter class. @@ -38,6 +39,7 @@ #include "FUi_TouchManager.h" #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Base::Runtime; @@ -117,8 +119,10 @@ _OptionMenuPresenter::_OptionMenuPresenter(_OptionMenu* optionMenu) , __pHandleEffectBitmap(null) , __pHandlePressedBitmap(null) , __pHandlePressedEffectBitmap(null) + , __pHandleDisabledBitmap(null) , __pHandleArrowNormalBitmap(null) , __pHandleArrowPressedBitmap(null) + , __pHandleArrowDisabledBitmap(null) , __textObject() , __pFont(null) , __maxColumnCount(0) @@ -180,12 +184,18 @@ _OptionMenuPresenter::~_OptionMenuPresenter(void) delete __pHandlePressedEffectBitmap; __pHandlePressedEffectBitmap = null; + delete __pHandleDisabledBitmap; + __pHandleDisabledBitmap = null; + delete __pHandleArrowNormalBitmap; __pHandleArrowNormalBitmap = null; delete __pHandleArrowPressedBitmap; __pHandleArrowPressedBitmap = null; + delete __pHandleArrowDisabledBitmap; + __pHandleArrowDisabledBitmap = null; + if (__pOptionMenuVE != null) { __pOptionMenuVE->RemoveAllAnimations(); @@ -423,12 +433,20 @@ _OptionMenuPresenter::DrawHandler(Canvas& canvas) result r = E_SUCCESS; _ControlOrientation orientation = __pOptionMenu->GetOrientation(); int arrowYPos = 0; + Bitmap *pHandleBitmap = null; + Bitmap *pHandleArrowBitmap = null; + Bitmap *pHandleEffectBitmap = null; + r = GET_SHAPE_CONFIG(OPTIONMENU::HANDLE_ARROW_Y_POSITION, orientation, arrowYPos); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); Rectangle bounds = __pOptionMenu->GetBounds(); bounds.x = 0; bounds.y = 0; + Rectangle arrowBounds(0,0,0,0); + arrowBounds.y = arrowYPos; + + bool isCustomHandleBitmap = false; r = GET_SHAPE_CONFIG(OPTIONMENU::HANDLE_HEIGHT, orientation, bounds.height); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -436,34 +454,44 @@ _OptionMenuPresenter::DrawHandler(Canvas& canvas) canvas.SetBackgroundColor(Color(0x00000000)); canvas.Clear(bounds); - if (__isHandlerPressed == true) + if (!__pOptionMenu->IsEnabled()) { - // Draw Handle Pressed Bitmap - r = DrawResourceBitmap(canvas, bounds, __pHandlePressedBitmap); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomHandleBitmap = IS_CUSTOM_BITMAP(OPTIONMENU::HANDLE_BG_DISABLED); - // Draw Handle Pressed Effect Bitmap - r = DrawResourceBitmap(canvas, bounds, __pHandlePressedEffectBitmap); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + pHandleBitmap = __pHandleDisabledBitmap; + pHandleArrowBitmap = __pHandleArrowDisabledBitmap; + pHandleEffectBitmap = __pHandleEffectBitmap; + } + else if (__isHandlerPressed) + { + isCustomHandleBitmap = IS_CUSTOM_BITMAP(OPTIONMENU::HANDLE_BG_PRESSED); - // Draw Arrow for Handle - r = canvas.DrawBitmap(Point((bounds.width - __pHandleArrowPressedBitmap->GetWidth()) >> 1, arrowYPos), - *__pHandleArrowPressedBitmap); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + pHandleBitmap = __pHandlePressedBitmap; + pHandleArrowBitmap = __pHandleArrowPressedBitmap; + pHandleEffectBitmap = __pHandlePressedEffectBitmap; } else { - // Draw Handle Bitmap - r = DrawResourceBitmap(canvas, bounds, __pHandleBitmap); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomHandleBitmap = IS_CUSTOM_BITMAP(OPTIONMENU::HANDLE_BG_NORMAL); - // Draw Handle Effect Bitmap - r = DrawResourceBitmap(canvas, bounds, __pHandleEffectBitmap); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + pHandleBitmap = __pHandleBitmap; + pHandleArrowBitmap = __pHandleArrowNormalBitmap; + pHandleEffectBitmap = __pHandleEffectBitmap; + } + r = DrawResourceBitmap(canvas, bounds, pHandleBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + // Draw Arrow for Handle + arrowBounds.x = (bounds.width - pHandleArrowBitmap->GetWidth()) >> 1; + arrowBounds.width = pHandleArrowBitmap->GetWidth(); + arrowBounds.height = pHandleArrowBitmap->GetHeight(); - // Draw Arrow for Handle - r = canvas.DrawBitmap(Point((bounds.width - __pHandleArrowNormalBitmap->GetWidth()) >> 1, arrowYPos), - *__pHandleArrowNormalBitmap); + r = DrawResourceBitmap(canvas, arrowBounds, pHandleArrowBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!isCustomHandleBitmap && (pHandleEffectBitmap!= null)) + { + r = DrawResourceBitmap(canvas, bounds, pHandleEffectBitmap); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -492,8 +520,17 @@ _OptionMenuPresenter::DrawItem(Canvas& canvas, int index) } Color textColor; + bool isCustomItemBitmap = false; + Color arrowColor; + Bitmap *pArrowBitmap = null; + _AccessibilityElement* pElement = null; _ControlOrientation orientation = __pOptionMenu->GetOrientation(); - if (index == __selectedIndex) + + if (!__pOptionMenu->IsEnabled()) + { + GET_COLOR_CONFIG(OPTIONMENU::ITEM_TEXT_DISABLED, textColor); + } + else if (index == __selectedIndex) { Rectangle pressedBounds = bounds; int margin = 0; @@ -526,12 +563,21 @@ _OptionMenuPresenter::DrawItem(Canvas& canvas, int index) GET_SHAPE_CONFIG(OPTIONMENU::ITEM_PRESS_BOTTOM_MARGIN, orientation, margin); pressedBounds.height -= margin; + isCustomItemBitmap = IS_CUSTOM_BITMAP(OPTIONMENU::ITEM_BG_PRESSED); + DrawResourceBitmap(canvas, pressedBounds, __pItemPressedBitmap); - DrawResourceBitmap(canvas, pressedBounds, __pItemPressedEffectBitmap); + if (isCustomItemBitmap == false) + { + DrawResourceBitmap(canvas, pressedBounds, __pItemPressedEffectBitmap); + } GET_COLOR_CONFIG(OPTIONMENU::ITEM_TEXT_PRESSED, textColor); } + else if (!__pOptionMenu->IsEnabled()) + { + GET_COLOR_CONFIG(OPTIONMENU::ITEM_TEXT_DISABLED, textColor); + } else { GET_COLOR_CONFIG(OPTIONMENU::ITEM_TEXT_NORMAL, textColor); @@ -568,10 +614,29 @@ _OptionMenuPresenter::DrawItem(Canvas& canvas, int index) if (pItem->HasSubItem() == true) { textRect.width -= __arrowMargin; + if (!__pOptionMenu->IsEnabled()) + { + if (__pArrowBitmap) + { + delete __pArrowBitmap; + __pArrowBitmap = null; + } + + r = GET_BITMAP_CONFIG_N(OPTIONMENU::CONTEXTUAL_POPUP_ARROW, BITMAP_PIXEL_FORMAT_ARGB8888, pArrowBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM, r, "[%s] Propagating.", GetErrorMessage(r)); + + GET_COLOR_CONFIG(OPTIONMENU::CONTEXTUAL_POPUP_ARROW_DISABLED, arrowColor); + __pArrowBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pArrowBitmap, Color::GetColor(COLOR_ID_MAGENTA), arrowColor); + SysTryCatch(NID_UI_CTRL, (__pArrowBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r)); + + delete pArrowBitmap; + pArrowBitmap = null; + } // Draw Arrow if item has subItem if (__pArrowBitmap != null) { + Point arrowPosition(bounds.x + bounds.width - __arrowMargin - __rightMargin, bounds.y + ((bounds.height - __pArrowBitmap->GetHeight()) / 2)); @@ -589,13 +654,19 @@ _OptionMenuPresenter::DrawItem(Canvas& canvas, int index) __textObject.SetBounds(textRect); __textObject.Draw(*_CanvasImpl::GetInstance(canvas)); - _AccessibilityElement* pElement = __pOptionMenu->GetAccessibilityElement(index); + pElement = __pOptionMenu->GetAccessibilityElement(index); if (pElement != null) { pElement->SetBounds(bounds); } return E_SUCCESS; + +CATCH: + delete pArrowBitmap; + pArrowBitmap = null; + + return r; } result @@ -606,7 +677,7 @@ _OptionMenuPresenter::DrawItemLine(Canvas& canvas) return E_SUCCESS; } - Color lineColor(0xFF8995AE); + Color lineColor(0xFFB4B4B4); int lineWidth = __lineWidth - 1; Color lineColorEF(0xFFFFFFFF); Color foreGroundColor = canvas.GetForegroundColor(); @@ -796,13 +867,13 @@ _OptionMenuPresenter::CalculateBounds(void) __columnCount = 0; } - bounds.height += (__itemHeight + __lineWidth) * __rowCount - __lineWidth; + bounds.height += (__itemHeight + __lineWidth) * __rowCount; } if ((__pOptionMenu != null) && (__pOptionMenu->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)) { bounds.width = screenSize.width; - bounds.y = screenSize.height - bounds.height; + bounds.y = (screenSize.height - bounds.height) + __lineWidth; } else { @@ -896,62 +967,93 @@ _OptionMenuPresenter::LoadBitmap(void) { result r = E_SUCCESS; Color color; + + Bitmap* pTempBitmap = null; + // Load Item Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pItemBitmap); + r = GET_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); GET_COLOR_CONFIG(OPTIONMENU::ITEM_BG_NORMAL, color); - __pItemBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pItemBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + __pItemBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; + // Load Item Pressed Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pItemPressedBitmap); + r = GET_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); GET_COLOR_CONFIG(OPTIONMENU::ITEM_BG_PRESSED, color); - __pItemPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pItemPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + __pItemPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; + // Load Item Pressed r = GET_BITMAP_CONFIG_N(OPTIONMENU::ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pItemPressedEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - // Load Arrow Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::CONTEXTUAL_POPUP_ARROW, BITMAP_PIXEL_FORMAT_ARGB8888, __pArrowBitmap); + // Load Contextual Popup Arrow Bitmap + r = GET_BITMAP_CONFIG_N(OPTIONMENU::CONTEXTUAL_POPUP_ARROW, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_COLOR_CONFIG(OPTIONMENU::ARROW_NORMAL, color); - __pArrowBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pArrowBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + GET_COLOR_CONFIG(OPTIONMENU::CONTEXTUAL_POPUP_ARROW_NORMAL, color); + __pArrowBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; - // Load Arrow Pressed Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::CONTEXTUAL_POPUP_ARROW, BITMAP_PIXEL_FORMAT_ARGB8888, __pArrowPressedBitmap); + // Load Contextual Popup Arrow Pressed Bitmap + r = GET_BITMAP_CONFIG_N(OPTIONMENU::CONTEXTUAL_POPUP_ARROW, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_COLOR_CONFIG(OPTIONMENU::ARROW_PRESSED, color); - __pArrowPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pArrowPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + + GET_COLOR_CONFIG(OPTIONMENU::CONTEXTUAL_POPUP_ARROW_PRESSED, color); + __pArrowPressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; + // Load Handle Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleBitmap); + r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_COLOR_CONFIG(OPTIONMENU::HANDLE_NORMAL, color); - __pHandleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pHandleBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + GET_COLOR_CONFIG(OPTIONMENU::HANDLE_BG_NORMAL, color); + __pHandleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; + // Load Handle Effect Bitmap r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); // Load Handle Pressed Bitmap - r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlePressedBitmap); + r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_COLOR_CONFIG(OPTIONMENU::HANDLE_PRESSED, color); - __pHandlePressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pHandlePressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + GET_COLOR_CONFIG(OPTIONMENU::HANDLE_BG_PRESSED, color); + __pHandlePressedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; + pTempBitmap = null; + + //Load Handle Disabled Bitmap + r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + GET_COLOR_CONFIG(OPTIONMENU::HANDLE_BG_DISABLED, color); + __pHandleDisabledBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + delete pTempBitmap; + pTempBitmap = null; // Load Handle Pressed Effect Bitmap r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlePressedEffectBitmap); @@ -964,8 +1066,15 @@ _OptionMenuPresenter::LoadBitmap(void) r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_ARROW_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleArrowPressedBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_BITMAP_CONFIG_N(OPTIONMENU::HANDLE_ARROW_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleArrowDisabledBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + return E_SUCCESS; CATCH: + + delete pTempBitmap; + pTempBitmap = null; + delete __pItemBitmap; __pItemBitmap = null; @@ -990,9 +1099,18 @@ CATCH: delete __pHandlePressedBitmap; __pHandlePressedBitmap = null; + delete __pHandleDisabledBitmap; + __pHandleDisabledBitmap = null; + delete __pHandlePressedEffectBitmap; __pHandlePressedEffectBitmap = null; + delete __pHandleArrowNormalBitmap; + __pHandleArrowNormalBitmap = null; + + delete __pHandleArrowPressedBitmap; + __pHandleArrowPressedBitmap = null; + return r; } @@ -1261,7 +1379,7 @@ _OptionMenuPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& t return true; } - Point position = touchinfo.GetCurrentPosition(); + Point position = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); __selectedIndex = GetItemIndexFromPosition(position); if (__selectedIndex >= 0) { @@ -1290,6 +1408,7 @@ _OptionMenuPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& if (__isHandlerPressed == true) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); __isHandlerPressed = false; Hide(); return true; @@ -1297,6 +1416,7 @@ _OptionMenuPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& if (__selectedIndex >= 0) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); int selectedIndex = __selectedIndex; __selectedIndex = -1; RefreshItem(selectedIndex); @@ -1329,7 +1449,7 @@ _OptionMenuPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou return false; } - Point position = touchinfo.GetCurrentPosition(); + Point position = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); int selectedIndex = GetItemIndexFromPosition(position); if (__isHandlerPressed == true) { diff --git a/src/ui/controls/FUiCtrl_OverlayAgent.cpp b/src/ui/controls/FUiCtrl_OverlayAgent.cpp index 0fd2472..53f91da 100644 --- a/src/ui/controls/FUiCtrl_OverlayAgent.cpp +++ b/src/ui/controls/FUiCtrl_OverlayAgent.cpp @@ -14,20 +14,20 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OverlayAgent.cpp - * @brief This file contains implementation of _OverlayAgent class + * @brief This file contains implementation of _OverlayAgent class */ -#include #include +#include +#include #define OVERLAY_PIXMAP_DUMP 0 #if OVERLAY_PIXMAP_DUMP - -extern "C" { - +extern "C"{ #include #include #include @@ -35,13 +35,10 @@ extern "C" { #include #include #include -#define virtual UICTRL_INTERNAL_VIRTUAL_REDEFINE -#define private UICTRL_INTERNAL_PRIVATE_REDEFINE -#include -#undef virtual -#undef private +#include +#include } -#endif +#endif //OVERLAY_PIXMAP_DUMP #include @@ -49,69 +46,69 @@ extern "C" { #include #include #include -#include #include -#include #include +#include #include - -#include "FUiCtrlOverlayRegion.h" -#include "FUi_CoordinateSystemUtils.h" +#include #include "FUi_Control.h" -#include "FUiCtrl_OverlayAgent.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_EcoreEvas.h" +#include "FUi_EcoreEvasMgr.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_ControlVisualElement.h" #include "FUiAnim_VisualElementSurfaceImpl.h" #include "FUiAnim_VisualElementImpl.h" +#include "FUiCtrl_OverlayAgent.h" #define B(c,s) ((((unsigned int)(c)) & 0xff) << (s)) #define FOURCC(a,b,c,d) (B(d,24) | B(c,16) | B(b,8) | B(a,0)) +using namespace std; using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; -using namespace Tizen::Ui::Animations; -using namespace Tizen::System; -using namespace Tizen::Media; using namespace Tizen::Io; +using namespace Tizen::Media; +using namespace Tizen::System; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Ui::Animations; namespace { - const int _ROTATION_0 = 0; const int _ROTATION_90 = 90; const int _ROTATION_180 = 180; const int _ROTATION_270 = 270; const int _ROTATION_360 = 360; -const wchar_t* _UI_REGISTRY_PATH = L"/usr/etc/system-info.ini"; -const wchar_t* _UI_INFO_SESSION = L"UiControlInfo"; - #if OVERLAY_PIXMAP_DUMP -drm_slp_bufmgr gBufmgr = null; +tbm_bufmgr gTbmBufmgr = null; int gFileCount = 0; +int gDrmFd = -1; -static void +void dump_bmp(const char* pFileName, const void* pData, int width, int height) { - int i = 0; + FILE* pFile = null; struct { unsigned char magic[2]; } bmpfile_magic = { {'B', 'M'} }; - struct - { + struct + { unsigned int filesz; unsigned short creator1; unsigned short creator2; unsigned int bmp_offset; - } bmpfile_header = { 0, 0, 0, 0x36 }; + } bmpfile_header = { 0, 0, 0, 0x36 }; - struct - { + struct + { unsigned int header_sz; unsigned int width; unsigned int height; @@ -123,167 +120,159 @@ dump_bmp(const char* pFileName, const void* pData, int width, int height) unsigned int vres; unsigned int ncolors; unsigned int nimpcolors; - } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0 }; - - unsigned int* pBlocks = null; - - FILE* pFile = fopen(pFileName, "w+"); - if (pFile == null) - { - SysLog(NID_UI_CTRL, "failed to fopen [%s]", pFileName); - return; - } - else - { - bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header) + sizeof(bmp_dib_v3_header_t) + width * height * 3; - bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t); - bmp_dib_v3_header_t.width = width; - bmp_dib_v3_header_t.height = -height; - bmp_dib_v3_header_t.nplanes = 1; - bmp_dib_v3_header_t.bmp_bytesz = width * height * 3; - - fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, pFile); - fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, pFile); - fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, pFile); - - pBlocks = (unsigned int*)pData; - for (i = 0; i < (height * width); i++) - fwrite(&pBlocks[i], 3, 1, pFile); - - fclose(pFile); - } - - return; + } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0 }; + + if (pFileName != null) + { + pFile = fopen(pFileName, "w+"); + } + + if (pFile == null) + { + SysLog(NID_UI_CTRL,"Failed to open %s", pFileName); + return; + } + + bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header) + sizeof(bmp_dib_v3_header_t) + width * height * 3; + bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t); + bmp_dib_v3_header_t.width = width; + bmp_dib_v3_header_t.height = -height; + bmp_dib_v3_header_t.nplanes = 1; + bmp_dib_v3_header_t.bmp_bytesz = width * height * 3; + + fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, pFile); + fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, pFile); + fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, pFile); + + unsigned int* pBlocks = (unsigned int*)pData; + + for (int i = 0; i < (height * width); i++) + { + fwrite(&pBlocks[i], 3, 1, pFile); + } + fclose(pFile); + + return; } -static drm_slp_bufmgr +tbm_bufmgr bufmgr_get(Display* pDisplay, Pixmap pixmap) { - int screen; - int drm_fd; - drm_slp_bufmgr bufmgr; - int eventBase, errorBase; - int dri2Major, dri2Minor; - char* pDriverName, *pDeviceName; - drm_magic_t magic; + int screen = DefaultScreen(pDisplay); - screen = DefaultScreen(pDisplay); - - /* DRI2 */ - if (!DRI2QueryExtension (pDisplay, &eventBase, &errorBase)) + // DRI2 + int eventBase = 0; + int errorBase = 0; + if (!DRI2QueryExtension(pDisplay, &eventBase, &errorBase)) { - SysLog(NID_UI_CTRL, "!!Error : DRI2QueryExtension !!\n"); + SysLog(NID_UI_CTRL, "Failed to get value of DRI2QueryExtension."); return null; } - if (!DRI2QueryVersion (pDisplay, &dri2Major, &dri2Minor)) + int dri2Major = 0; + int dri2Minor = 0; + if (!DRI2QueryVersion(pDisplay, &dri2Major, &dri2Minor)) { - SysLog(NID_UI_CTRL, "!!Error : DRI2QueryVersion !!\n"); + SysLog(NID_UI_CTRL, "Failed to get value of DRI2QueryVersion."); return null; } - if (!DRI2Connect (pDisplay, RootWindow(pDisplay, screen), &pDriverName, &pDeviceName)) + char* pDriverName = null; + char* pDeviceName = null; + if (!DRI2Connect(pDisplay, RootWindow(pDisplay, screen), &pDriverName, &pDeviceName)) { - SysLog(NID_UI_CTRL, "!!Error : DRI2Connect !!\n"); + SysLog(NID_UI_CTRL, "Failed to get value of DRI2Connect."); return null; } - SysLog(NID_UI_CTRL, "Open drm device : %s\n", pDeviceName); + SysLog(NID_UI_CTRL, "The current name of open drm device is %s.", pDeviceName); - /* get the drm_fd though opening the deviceName */ - drm_fd = open (pDeviceName, O_RDWR); - if (drm_fd < 0) + // Get the drm_fd though opening the deviceName + gDrmFd = open(pDeviceName, O_RDWR); + if (gDrmFd < 0) { - SysLog(NID_UI_CTRL, "!!Error : cannot open drm device (%s)\n", pDeviceName); + SysLog(NID_UI_CTRL, "Failed to open drm device (%s)", pDeviceName); return null; } - /* get the drm magic */ - drmGetMagic(drm_fd, &magic); - - if (!DRI2Authenticate(pDisplay, RootWindow(pDisplay, screen), magic)) - { - SysLog(NID_UI_CTRL, "!!Error : DRI2Authenticate !!\n"); - close (drm_fd); + // Get the drm magic + drm_magic_t magic; + drmGetMagic(gDrmFd, &magic); + if (!DRI2Authenticate(pDisplay, RootWindow(pDisplay, screen), magic)) + { + SysLog(NID_UI_CTRL, "Failed to get value of DRI2Authenticate."); + close(gDrmFd); + gDrmFd = -1; return null; - } + } - /* drm slp buffer manager init */ - bufmgr = drm_slp_bufmgr_init (drm_fd, null); + // tbm buffer manager init + tbm_bufmgr bufmgr = tbm_bufmgr_init(gDrmFd); if (!bufmgr) { - SysLog(NID_UI_CTRL, "!!Error : failed to init buffer manager \n"); - close (drm_fd); + SysLog(NID_UI_CTRL, "Failed to initialize buffer manager."); + close(gDrmFd); + gDrmFd = -1; return null; } - DRI2CreateDrawable (pDisplay, pixmap); + DRI2CreateDrawable(pDisplay, pixmap); return bufmgr; } static void -pixmap_update (Display* pDisplay, drm_slp_bufmgr bufmgr, Pixmap pixmap, - int x, int y, int width, int height) +pixmap_update (Display* pDisplay, tbm_bufmgr bufmgr, Pixmap pixmap, int x, int y, int width, int height) { - DRI2Buffer* pDri2_buffers = null; - unsigned int attachments[1]; - int dri2_count, dri2_out_count; - int dri2_width, dri2_height, dri2_stride; - drm_slp_bo bo; - int opt; - void* pVirtualBuf = null; + int dri2_width = 0; + int dri2_height = 0; + unsigned int attachments[1] = { DRI2BufferFrontLeft }; + int dri2_count = 1; + int dri2_out_count = 0; + + int opt = TBM_OPTION_READ|TBM_OPTION_WRITE; char imgFile[100] = {0,}; - attachments[0] = DRI2BufferFrontLeft; - dri2_count = 1; - pDri2_buffers = DRI2GetBuffers (pDisplay, pixmap, &dri2_width, &dri2_height, - attachments, dri2_count, &dri2_out_count); + tbm_bo bo; + tbm_bo_handle bo_handle; - if (!pDri2_buffers) - { - SysLog(NID_UI_CTRL, "!!Error : failed to get buffers\n"); - goto update_done; - } + DRI2Buffer* pDri2_buffers = DRI2GetBuffers (pDisplay, pixmap, &dri2_width, &dri2_height, attachments, dri2_count, &dri2_out_count); + SysTryLogCatch(NID_UI_CTRL, pDri2_buffers != null, , "Failed to get buffers."); + SysTryLogCatch(NID_UI_CTRL, pDri2_buffers[0].name != null, , "Failed to get a handle of the dri2 buffer."); - if (!pDri2_buffers[0].name) - { - SysLog(NID_UI_CTRL, "!!Error : a handle of the dri2 buffer is null \n "); - goto update_done; - } + SysLog(NID_UI_CTRL, "The current name of Dri2_buffers[0] is %d.", pDri2_buffers[0].name); - SysLog(NID_UI_CTRL, "pDri2_buffers[0].name : %d", pDri2_buffers[0].name); + bo = tbm_bo_import(bufmgr, pDri2_buffers[0].name); + SysTryLogCatch(NID_UI_CTRL, bo != null, , "Failed to import bo (key : %d).", pDri2_buffers[0].name); - bo = drm_slp_bo_import(bufmgr, pDri2_buffers[0].name); - if (!bo) - { - SysLog(NID_UI_CTRL, "!!Error : cannot import bo (key:%d)\n", pDri2_buffers[0].name); - goto update_done; - } + bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, opt); + SysTryLogCatch(NID_UI_CTRL, bo_handle.ptr != null, , "Failed to get map."); - dri2_stride = pDri2_buffers[0].pitch; + memset(imgFile, 0, sizeof(imgFile)); + sprintf(imgFile,"./dump%d.bmp", gFileCount++); - opt = DRM_SLP_OPTION_READ|DRM_SLP_OPTION_WRITE; - pVirtualBuf = (void*)drm_slp_bo_map (bo, DRM_SLP_DEVICE_CPU, opt); - if (!pVirtualBuf) + if (gFileCount == 5 || gFileCount == 20) { - SysLog(NID_UI_CTRL, "!!Error : failed to map \n"); - goto update_done; + dump_bmp(imgFile, bo_handle.ptr, dri2_width, dri2_height); } - memset(imgFile, 0, sizeof(imgFile)); - sprintf(imgFile,"./dump%d.bmp", gFileCount++); - dump_bmp(imgFile, pVirtualBuf, dri2_width, dri2_height); +CATCH: + if (bo_handle.ptr) + { + tbm_bo_unmap(bo); + } -update_done: - if (pVirtualBuf) - drm_slp_bo_unmap(bo, DRM_SLP_DEVICE_CPU); if (bo) - drm_slp_bo_unref(bo); + { + tbm_bo_unref(bo); + } + if (pDri2_buffers) + { free(pDri2_buffers); + } } -#endif +#endif // OVERLAY_PIXMAP_DUMP bool _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) @@ -293,27 +282,22 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) unsigned int requestBase = 0; unsigned int eventBase = 0; unsigned int errorBase = 0; - unsigned int i = 0; - unsigned int adaptors = 0; - XvAdaptorInfo* pAdaptorInfo = null; - int ret = Success; - int port = -1; - // query and print Xvideo properties - ret = XvQueryExtension(pDisplay, &version, &release, &requestBase, &eventBase, &errorBase); - if (ret != Success) + // Query and print Xvideo properties + int returnValue = XvQueryExtension(pDisplay, &version, &release, &requestBase, &eventBase, &errorBase); + if (returnValue != Success) { - if (ret == XvBadExtension) + if (returnValue == XvBadExtension) { SysLog(NID_UI_CTRL, "XvBadExtension returned at XvQueryExtension!"); } - else if (ret == XvBadAlloc) + else if (returnValue == XvBadAlloc) { SysLog(NID_UI_CTRL, "XvBadAlloc returned at XvQueryExtension!"); } else { - SysLog(NID_UI_CTRL, "other error happened at XvQueryExtension!"); + SysLog(NID_UI_CTRL, "Other error happened at XvQueryExtension!"); } return false; @@ -328,20 +312,22 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) // SysLog(NID_UI_CTRL, "error_base : %u", errorBase); // SysLog(NID_UI_CTRL, "========================================"); - ret = XvQueryAdaptors(pDisplay, DefaultRootWindow(pDisplay), &adaptors, &pAdaptorInfo); - if (ret != Success) + unsigned int adaptors = 0; + XvAdaptorInfo* pAdaptorInfo = null; + returnValue = XvQueryAdaptors(pDisplay, DefaultRootWindow(pDisplay), &adaptors, &pAdaptorInfo); + if (returnValue != Success) { - if (ret == XvBadExtension) + if (returnValue == XvBadExtension) { SysLog(NID_UI_CTRL, "XvBadExtension returned at XvQueryExtension."); } - else if (ret == XvBadAlloc) + else if (returnValue == XvBadAlloc) { SysLog(NID_UI_CTRL, "XvBadAlloc returned at XvQueryExtension."); } else { - SysLog(NID_UI_CTRL, "other error happaned at XvQueryAdaptors."); + SysLog(NID_UI_CTRL, "Other error happaned at XvQueryAdaptors."); } if (pAdaptorInfo != null) @@ -355,9 +341,10 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) // SysLog(NID_UI_CTRL, "XvQueryAdaptors returned the following:"); // SysLog(NID_UI_CTRL, "%d adaptors available.", adaptors); + int port = -1; if (adaptors > 0 && pAdaptorInfo != null) { - for (i = 0; i < adaptors; i++) + for (unsigned int i = 0; i < adaptors; i++) { // SysLog(NID_UI_CTRL, " name: %s" // " type: %s%s%s%s%s" @@ -371,24 +358,20 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) // (pAdaptorInfo[i].type & XvImageMask) ? "image | " : "", // pAdaptorInfo[i].base_id, // pAdaptorInfo[i].num_ports); - // // SysLog(NID_UI_CTRL, " format list: %d", i); for (unsigned int j = 0; j < pAdaptorInfo[i].num_formats; j++) { - SysLog(NID_UI_CTRL, "depth=%d, visual=%ld", - pAdaptorInfo[i].formats[j].depth, - pAdaptorInfo[i].formats[j].visual_id); + SysLog(NID_UI_CTRL, "The current value of depth is %d and visual is %ld.", + pAdaptorInfo[i].formats[j].depth, pAdaptorInfo[i].formats[j].visual_id); } - } port = pAdaptorInfo[0].base_id; *pFirstPort = port; *pCountPort = pAdaptorInfo[0].num_ports; - - SysLog(NID_UI_CTRL, "port : %d", port); + SysLog(NID_UI_CTRL, "The current value of port is %d", port); } if (pAdaptorInfo != null) @@ -404,92 +387,124 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) return true; } -Tizen::Graphics::FloatRectangle -ConvertToFloat(const Rectangle& rect) -{ - return Tizen::Graphics::FloatRectangle((float) rect.x, (float) rect.y, (float) rect.width, (float) rect.height); -} - Eina_Bool OnPixmapDamaged(void* pData, int type, void* pEvent) { Tizen::Ui::Controls::_OverlayAgent* pOverlayAgent = static_cast(pData); Ecore_X_Event_Damage* pDamageEvent = (Ecore_X_Event_Damage*)pEvent; - SysTryReturn(NID_UI_CTRL, pDamageEvent != null, ECORE_CALLBACK_PASS_ON, E_INVALID_DATA, "[E_INVALID_DATA] pDamageEvent is null."); + SysTryReturn(NID_UI_CTRL, pDamageEvent != null, ECORE_CALLBACK_PASS_ON, E_INVALID_DATA, "[E_INVALID_DATA] The current value of DamageEvent is an invalid."); Pixmap pixmap = pOverlayAgent->GetPixmap(); if (pDamageEvent->drawable != pixmap) { - SysLog(NID_UI_CTRL, "this drawable[%d] is not for my pixmap[%d]", pDamageEvent->drawable, pixmap); + SysLog(NID_UI_CTRL, "The current drawable[%d] is not for this overlay agent's pixmap[%d]", pDamageEvent->drawable, pixmap); return ECORE_CALLBACK_PASS_ON; } - int w = 0; - int h = 0; Evas_Object* pImageObject = pOverlayAgent->GetPixmapImageObject(); - SysTryReturn(NID_UI_CTRL, pImageObject != null, ECORE_CALLBACK_PASS_ON, E_INVALID_DATA, "[E_INVALID_DATA] pImageObject is null."); + SysTryReturn(NID_UI_CTRL, pImageObject != null, ECORE_CALLBACK_PASS_ON, E_INVALID_DATA, "[E_INVALID_DATA] The current value of ImageObject is an invalid."); + int w = 0; + int h = 0; evas_object_geometry_get(pImageObject, null, null, &w, &h); //evas_object_image_pixels_dirty_set(pImageObject, 1); - evas_object_image_fill_set(pImageObject, 0, 0, w, h); + //evas_object_image_fill_set(pImageObject, 0, 0, w, h); + evas_object_image_filled_set(pImageObject, EINA_TRUE); evas_object_image_data_update_add(pImageObject, 0, 0, w, h); #if OVERLAY_PIXMAP_DUMP - if (gBufmgr) - { - drm_slp_bufmgr_destroy(gBufmgr); - gBufmgr = null; - } - if (gBufmgr == null) - gBufmgr = bufmgr_get((Display*)ecore_x_display_get(), pixmap); + if (gDrmFd > -1) + { + close(gDrmFd); + gDrmFd = -1; + } - if (gBufmgr != null) - { - pixmap_update((Display*)ecore_x_display_get(), gBufmgr, pixmap, 0, 0, w, h); - } - else - SysLog(NID_UI_CTRL, "can't get pixmap gBufmgr"); + if (gTbmBufmgr) + { + tbm_bufmgr_deinit(gTbmBufmgr); + gTbmBufmgr = null; + } - SysLog(NID_UI_CTRL, "dump pixmap[%d]", pixmap); + if (gTbmBufmgr == null) + { + gTbmBufmgr = bufmgr_get((Display*)ecore_x_display_get(), pixmap); + } -#endif + if (gTbmBufmgr != null) + { + pixmap_update((Display*)ecore_x_display_get(), gTbmBufmgr, pixmap, 0, 0, w, h); + } + else + { + SysLog(NID_UI_CTRL, "can't get pixmap gBufmgr"); + } + + SysLog(NID_UI_CTRL, "dump pixmap[%d]", pixmap); + +#endif // OVERLAY_PIXMAP_DUMP return ECORE_CALLBACK_DONE; } +void +OnEvasImageDamaged(void* pData, Evas_Object* pImageObject) +{ + Tizen::Ui::Controls::_OverlayAgent* pOverlayAgent = static_cast(pData); + + Evas_Object* pMyImageObject = pOverlayAgent->GetPixmapImageObject(); + SysTryReturn(NID_UI_CTRL, pMyImageObject != null, , E_INVALID_DATA, "[E_INVALID_DATA] The current value of ImageObject is an invalid."); + + if (pMyImageObject == pImageObject) + { + Dimension curImgDim(0,0); + evas_object_image_size_get(pImageObject, &curImgDim.width, &curImgDim.height); + + Dimension orgImgDim = pOverlayAgent->GetPrevCbImageDimension(); + if (!orgImgDim.Equals(curImgDim)) + { + SysLog(NID_UI_CTRL,"org[%d, %d] cur[%d, %d]", orgImgDim.width, orgImgDim.height, curImgDim.width, curImgDim.height); + pOverlayAgent->SetPrevCbImageDimension(curImgDim); + pOverlayAgent->SetEvasImageDirtyFlag(false); + } + + if(!(pOverlayAgent->GetEvasImageDirtyFlag())) + { + pOverlayAgent->AdjustImageObject(); + pOverlayAgent->SetEvasImageDirtyFlag(true); + } + } +} + } // Anonymous namespace Tizen { namespace Ui { namespace Controls { - -int _OverlayAgent::overlayAgentcount = 0; -int _OverlayAgent::overlayAgentXvPortCount = 0; -int _OverlayAgent::baseXvPort = 0; -bool _OverlayAgent::isPortGrapped[]={false,}; - -int _OverlayAgent::dstRectMinWidth = -1; -int _OverlayAgent::dstRectMinHegith = -1; -int _OverlayAgent::srcRectMinWidth = -1; -int _OverlayAgent::srcRectMinHegith = -1; +int _OverlayAgent::__overlayAgentXvPortCount = 0; +int _OverlayAgent::__baseXvPort = 0; +bool _OverlayAgent::__isPortGrapped[]={false,}; + +int _OverlayAgent::__overlayAgentcount = 0; +int _OverlayAgent::__dstRectMinWidth = -1; +int _OverlayAgent::__dstRectMinHegith = -1; +int _OverlayAgent::__srcRectMinWidth = -1; +int _OverlayAgent::__srcRectMinHegith = -1; +int _OverlayAgent::__overlayWidthUnit = -1; +int _OverlayAgent::__overlayHeightUnit = -1; +int _OverlayAgent::__overlayMaxCount = -1; +bool _OverlayAgent::__OverlayAgentBufferPixelFormat[] = {false, }; _OverlayAgent* _OverlayAgent::CreateInstanceN(_OverlayAgentStyle style, const _Control& control, const Rectangle& phyBounds) { - _OverlayAgent* pOverlayAgent = new (std::nothrow) _OverlayAgent(style, control, phyBounds); + unique_ptr<_OverlayAgent> pOverlayAgent(new (std::nothrow) _OverlayAgent(style, control, phyBounds)); SysTryReturn(NID_UI_CTRL, pOverlayAgent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); result r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - SetLastResult(E_SUCCESS); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - return pOverlayAgent; - -CATCH: - delete pOverlayAgent; - return null; + return pOverlayAgent.release(); } _OverlayAgent::_OverlayAgent(_OverlayAgentStyle style, const _Control& control, const Rectangle& bounds) @@ -510,49 +525,50 @@ _OverlayAgent::_OverlayAgent(_OverlayAgentStyle style, const _Control& control, , __lrMirroring(0) , __aspectRatio(false) , __srcDimension(0, 0) - , __destDimension(0, 0) , __pixmapPhyRect(0, 0, 0, 0) , __resizeRect(0, 0, 0, 0) - , __style(style) + , __style(style) , __pXvImage(null) - , __newColorFormat(0) + , __newColorFormat(0) , __pShmInfo(null) , __overlayAgentColorFormat(_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888) , __pRefUserByteBuffer(null) , __pOrgUserByteBuffer(null) - , __orgImgDimension(0, 0) + , __orgUsrImgDimension(0, 0) + , __orgCbImgDimension(0, 0) + , __evasImageDamaged(false) { result r = E_SUCCESS; switch(style) { case _OVERLAY_AGENT_STYLE_REGION_SW: + //fall through case _OVERLAY_AGENT_STYLE_REGION_GL: r = CreateImageObjectForOverlayRegion(control, bounds); break; + case _OVERLAY_AGENT_STYLE_PANEL_GL: + //fall through case _OVERLAY_AGENT_STYLE_PANEL_SW: r = CreateImageObject(control, bounds); break; + default: r = E_INVALID_ARG; } SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - SysTryReturnVoidResult(NID_UI_CTRL, __pVisualElement != null, E_SYSTEM, "[E_SYSTEM] __pVisualElement is null"); + SysTryReturnVoidResult(NID_UI_CTRL, __pVisualElement != null, E_SYSTEM, "[E_SYSTEM] The VisualElement is null."); - SetLastResult(E_SUCCESS); - - overlayAgentcount++; - - SysLog(NID_UI_CTRL, "Constructor: overlayAgentcount is [%d]", overlayAgentcount); + __overlayAgentcount++; + SysLog(NID_UI_CTRL, "The overlayAgentcount in Constructor is [%d]", __overlayAgentcount); } _OverlayAgent::~_OverlayAgent(void) { - overlayAgentcount--; - - SysLog(NID_UI_CTRL, "Destructor: overlayAgentcount is [%d]", overlayAgentcount); + SysLog(NID_UI_CTRL, "The overlayAgentcount in Destructor is [%d] and deleted.", __overlayAgentcount); + __overlayAgentcount--; UngrabXvPort(); @@ -616,30 +632,42 @@ _OverlayAgent::~_OverlayAgent(void) } #if OVERLAY_PIXMAP_DUMP - if (gBufmgr) - drm_slp_bufmgr_destroy (gBufmgr); -#endif + + if (gDrmFd > -1) + { + close(gDrmFd); + gDrmFd = -1; + } + + if (gTbmBufmgr) + { + tbm_bufmgr_deinit(gTbmBufmgr); + gTbmBufmgr = null; + } + +#endif //OVERLAY_PIXMAP_DUMP } result _OverlayAgent::Draw(void) { - result r = E_SUCCESS; - - SysTryReturnResult(NID_UI_CTRL, __pRefUserByteBuffer->GetPointer() != null, r, "nothing to draw... userBuffer is null!"); + SysTryReturnResult(NID_UI_CTRL, __pRefUserByteBuffer->GetPointer() != null, E_SYSTEM, "The current user buffer is null. (nothing to draw)"); + result r = E_SUCCESS; if(__style == _OVERLAY_AGENT_STYLE_REGION_SW || __style == _OVERLAY_AGENT_STYLE_PANEL_SW) + { r = PutEvasImage(); + } else + { r = PutXvImage(); - + } SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); return r; } - result _OverlayAgent::GetBufferInfo(BufferInfo& bufferInfo) const { @@ -668,17 +696,14 @@ _OverlayAgent::GetBufferInfo(BufferInfo& bufferInfo) const pBufferInfoImpl->SetBounds(Rectangle(0, 0, w, h)); return E_SUCCESS; - } result -_OverlayAgent::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuffer, - const Dimension& srcDim, _OverlayAgentBufferPixelFormat srcFormat) +_OverlayAgent::SetInputBuffer(const ByteBuffer& srcBuffer, const Dimension& srcDim, _OverlayAgentBufferPixelFormat srcFormat) { - SysTryReturn(NID_UI_CTRL, srcBuffer.GetPointer() != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); - SysTryReturn(NID_UI_CTRL, srcBuffer.GetCapacity() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); - SysTryReturn(NID_UI_CTRL, IsValidSourceDimension(srcDim), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); - SysTryReturn(NID_UI_CTRL, IsValidDestinationDimension(destDim), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); + SysTryReturn(NID_UI_CTRL, srcBuffer.GetPointer() != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The srcBuffer which is input parameter is invalid."); + SysTryReturn(NID_UI_CTRL, srcBuffer.GetCapacity() > 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The srcBuffer which is input parameter is invalid."); + SysTryReturn(NID_UI_CTRL, IsValidSourceDimension(srcDim), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The srcDim which is input parameter is invalid."); switch (srcFormat) { @@ -705,13 +730,11 @@ _OverlayAgent::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuf __srcDimension.width = srcDim.width; __srcDimension.height = srcDim.height; - __destDimension.width = destDim.width; - __destDimension.height = destDim.height; - __overlayAgentColorFormat = srcFormat; __pRefUserByteBuffer = &srcBuffer; - SysLog(NID_UI_CTRL,"pBuffer : %x, size : %d, __newColorFormat : %x", __pRefUserByteBuffer->GetPointer(), __pRefUserByteBuffer->GetCapacity(), __newColorFormat); + SysLog(NID_UI_CTRL,"The current value of buffer is %x, size is %d, new color format is %x", + __pRefUserByteBuffer->GetPointer(), __pRefUserByteBuffer->GetCapacity(), __newColorFormat); return E_SUCCESS; } @@ -719,8 +742,8 @@ _OverlayAgent::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuf result _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) { - SysTryReturn(NID_UI_CTRL, (rotation < _OVERLAY_AGENT_ROTATION_MAX), - E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG)] A specified input parameter [%d] is invalid.", rotation); + SysTryReturnResult(NID_UI_CTRL, (rotation < _OVERLAY_AGENT_ROTATION_MAX), E_INVALID_ARG, + "[E_INVALID_ARG)] The rotation which is input parameter(%d) is invalid.", rotation); int rotate = _ROTATION_0; @@ -733,6 +756,7 @@ _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) case _OVERLAY_AGENT_ROTATION_NONE_UD: rotate = _ROTATION_0; break; + case _OVERLAY_AGENT_ROTATION_90: // fall through case _OVERLAY_AGENT_ROTATION_90_LR: @@ -740,6 +764,7 @@ _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) case _OVERLAY_AGENT_ROTATION_90_UD: rotate = _ROTATION_90; break; + case _OVERLAY_AGENT_ROTATION_180: // fall through case _OVERLAY_AGENT_ROTATION_180_LR: @@ -747,6 +772,7 @@ _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) case _OVERLAY_AGENT_ROTATION_180_UD: rotate = _ROTATION_180; break; + case _OVERLAY_AGENT_ROTATION_270: // fall through case _OVERLAY_AGENT_ROTATION_270_LR: @@ -754,6 +780,7 @@ _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) case _OVERLAY_AGENT_ROTATION_270_UD: rotate = _ROTATION_270; break; + default: rotate = _ROTATION_0; break; @@ -795,28 +822,27 @@ _OverlayAgent::SetRotation(_OverlayAgentRotation rotation) __lrMirroring = lrMirroring; __flushRotate = true; - AdjustImageObject(); - - SysLog(NID_UI_CTRL, "__userRotation[%d], __udMirroring [%d] , __lrMirroring [%d]", __userRotation, __udMirroring, __lrMirroring); + result r = AdjustImageObject(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + SysLog(NID_UI_CTRL, "The current value of userRotation is %d, udMirroring is %d, lrMirroring is %d", __userRotation, __udMirroring, __lrMirroring); return E_SUCCESS; } result -_OverlayAgent::SetDestination(const Dimension& dimension) +_OverlayAgent::SetDestination(const FloatDimension& dimension) { - SysTryReturn(NID_UI_CTRL, IsValidDestinationDimension(dimension), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); - - Dimension phy = _CoordinateSystemUtils::Transform(Dimension(dimension.width, dimension.height)); + FloatDimension phyDimF = _CoordinateSystemUtils::Transform(dimension); + Dimension phyDim = _CoordinateSystemUtils::ConvertToInteger(phyDimF); - __resizeRect.width = phy.width; - __resizeRect.height = phy.height; + __resizeRect.width = phyDim.width; + __resizeRect.height = phyDim.height; + SysLog(NID_UI_CTRL, "The current value of resizeRect is (%d, %d, %d, %d)",__resizeRect.x, __resizeRect.y, __resizeRect.width, __resizeRect.height); - SysLog(NID_UI_CTRL, "resizeRect is [%d, %d, %d, %d]",__resizeRect.x, __resizeRect.y, __resizeRect.width, __resizeRect.height); - - AdjustImageObject(); + result r = AdjustImageObject(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - return E_SUCCESS; + return r; } result @@ -865,7 +891,7 @@ _OverlayAgent::CreateImageObjectForOverlayRegion(const _Control& control, const logBounds = _CoordinateSystemUtils::InverseTransform(phyBounds); SysLog(NID_UI_CTRL, "logBounds [%d, %d, %d, %d]", logBounds.x, logBounds.y, logBounds.width, logBounds.height); - pVisualElement->SetBounds(ConvertToFloat(logBounds)); + pVisualElement->SetBounds(_CoordinateSystemUtils::ConvertToFloat(logBounds)); // 2. remove origin VE image object buffer pVisualElementSurface = pVisualElementImpl->GetSurfaceN(); @@ -897,6 +923,7 @@ _OverlayAgent::CreateImageObjectForOverlayRegion(const _Control& control, const __pImageObject = evas_object_image_add(pEvas); SysTryCatch(NID_UI_CTRL, __pImageObject != null, , E_SYSTEM, "[E_SYSTEM] __pImageObject is null" ); + evas_object_name_set(__pImageObject, "OverlayRegionImageObj"); // 4. add image obj to smart object evas_object_smart_member_add(__pImageObject, pSmartObject); @@ -983,6 +1010,7 @@ _OverlayAgent::CreateImageObject(const _Control& control, const Rectangle& phyBo // create renderRect object __pRenderImageObject = evas_object_rectangle_add(pEvas); + evas_object_name_set(__pRenderImageObject, "OverlayPanelRenderRect"); SysTryReturn(NID_UI_CTRL, __pRenderImageObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] __pRenderImageObject is null"); evas_object_smart_member_add(__pRenderImageObject, pSmartObject); evas_object_color_set(__pRenderImageObject, 0, 0, 0, 255); // 100% opaque black @@ -996,8 +1024,9 @@ _OverlayAgent::CreateImageObject(const _Control& control, const Rectangle& phyBo SysTryCatch(NID_UI_CTRL, __pImageObject != null, , E_SYSTEM, "[E_SYSTEM] __pImageObject is null"); evas_object_smart_member_add(__pImageObject, pSmartObject); + evas_object_name_set(__pImageObject, "OverlayPanelImageObj"); evas_object_image_size_set(__pImageObject, phyBounds.width, phyBounds.height); - evas_object_image_fill_set(__pImageObject, 0, 0, phyBounds.width, phyBounds.height); + //evas_object_image_fill_set(__pImageObject, 0, 0, phyBounds.width, phyBounds.height); evas_object_image_alpha_set(__pImageObject, false); evas_object_image_filled_set(__pImageObject, EINA_TRUE); evas_object_resize(__pImageObject, phyBounds.width, phyBounds.height); @@ -1147,12 +1176,12 @@ _OverlayAgent::GrabXvPort(void) SysTryReturn(NID_UI_CTRL, firstXvPort != -1, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] first XvPort[%d] is invalid.", firstXvPort); SysTryReturn(NID_UI_CTRL, portCount >= 1 && portCount <= _OVERLAYAGENT_XV_PORT , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] portCount[%d] is invalid.", portCount); - _OverlayAgent::baseXvPort = firstXvPort; + _OverlayAgent::__baseXvPort = firstXvPort; int i, tempPort = 0; for (i = 0; i < portCount; i++) { - if(!isPortGrapped[i]) + if(!__isPortGrapped[i]) { tempPort = firstXvPort + i; if (XvGrabPort(pDisplay, tempPort, 0) != Success) @@ -1163,7 +1192,7 @@ _OverlayAgent::GrabXvPort(void) { __xvPort = tempPort; __grabXvPort = true; - isPortGrapped[i] = true; + __isPortGrapped[i] = true; break; } } @@ -1173,7 +1202,7 @@ _OverlayAgent::GrabXvPort(void) SysLog(NID_UI_CTRL, "XvGrabPort port: %d pixmap: %d style: %d", __xvPort, __pixmap, __style); - overlayAgentXvPortCount++; + __overlayAgentXvPortCount++; return E_SUCCESS; } @@ -1189,7 +1218,10 @@ _OverlayAgent::PutXvImage(void) GC gc = DefaultGCOfScreen(DefaultScreenOfDisplay(pDisplay)); bool needRealloc = false; - if (__pXvImage == null || __newColorFormat != __colorFormat /*|| __pXvImage->data_size != __pRefUserByteBuffer->GetCapacity()*/) + Dimension usrDim(__srcDimension.width,__srcDimension.height); + if (__pXvImage == null + || __newColorFormat != __colorFormat + || !usrDim.Equals(__orgUsrImgDimension) /*|| __pXvImage->data_size != __pRefUserByteBuffer->GetCapacity()*/) { needRealloc = true; @@ -1265,9 +1297,7 @@ _OverlayAgent::PutXvImage(void) memcpy(__pXvImage->data, __pRefUserByteBuffer->GetPointer(), __pXvImage->data_size); __pRefUserByteBuffer = null; - - Atom rotation = XInternAtom(pDisplay, "_USER_WM_PORT_ATTRIBUTE_ROTATION", False); - XvSetPortAttribute(pDisplay, __xvPort, rotation, 0); + __orgUsrImgDimension = usrDim; XvShmPutImage(pDisplay, __xvPort, __pixmap, gc, __pXvImage, 0, 0, __srcDimension.width, __srcDimension.height, __pixmapPhyRect.x, __pixmapPhyRect.y, __pixmapPhyRect.width, __pixmapPhyRect.height, False); @@ -1288,9 +1318,7 @@ _OverlayAgent::PutEvasImage(void) result r = E_SYSTEM; Dimension usrDim(__srcDimension.width,__srcDimension.height); - if(!usrDim.Equals(__orgImgDimension) - || __pOrgUserByteBuffer == null - || __pOrgUserByteBuffer->GetCapacity() != __pRefUserByteBuffer->GetCapacity()) + if(!usrDim.Equals(__orgUsrImgDimension) || __pOrgUserByteBuffer == null) { if(__pOrgUserByteBuffer) { @@ -1368,7 +1396,7 @@ _OverlayAgent::PutEvasImage(void) __pVisualElement->SetFlushNeeded(); - __orgImgDimension = usrDim; + __orgUsrImgDimension = usrDim; __pRefUserByteBuffer = null; return E_SUCCESS; @@ -1384,20 +1412,20 @@ _OverlayAgent::UngrabXvPort(void) XvSetPortAttribute(pDisplay, __xvPort, atom, 1); XvUngrabPort(pDisplay, __xvPort, 0); - SysLog(NID_UI_CTRL, "UngrabXvPort port: %d pixmap: %d style: %d", __xvPort, __pixmap, __style); + SysLog(NID_UI_CTRL, "The current value of UngrabXvPort port is %d, pixmap is %d and style is %d", __xvPort, __pixmap, __style); - isPortGrapped[__xvPort-baseXvPort] = false; + __isPortGrapped[__xvPort-__baseXvPort] = false; __xvPort = -1; __grabXvPort = false; - overlayAgentXvPortCount--; + __overlayAgentXvPortCount--; } } bool _OverlayAgent::IsValidSourceDimension(const Dimension& dimension) const { - SysTryReturn(NID_UI_CTRL, dimension.width >= GetSrcRectMinWidth(), false, E_INVALID_ARG, "[E_INVALID_ARG] src width [%d] is invalid.", dimension.width); - SysTryReturn(NID_UI_CTRL, dimension.height >= GetSrcRectMinHeight(), false, E_INVALID_ARG, "[E_INVALID_ARG] src width [%d] is invalid.", dimension.height); + SysTryReturn(NID_UI_CTRL, dimension.width >= GetSrcRectMinWidth(), false, E_INVALID_ARG, "[E_INVALID_ARG] The width of dimension [%d] is under the minimum size.", dimension.width); + SysTryReturn(NID_UI_CTRL, dimension.height >= GetSrcRectMinHeight(), false, E_INVALID_ARG, "[E_INVALID_ARG] The height of dimension [%d] is under the minimum size.", dimension.height); SetLastResult(E_SUCCESS); @@ -1405,19 +1433,22 @@ _OverlayAgent::IsValidSourceDimension(const Dimension& dimension) const } bool -_OverlayAgent::IsValidDestinationDimension(const Dimension& dimension) const +_OverlayAgent::IsValidDestinationDimension(const FloatDimension& dimension) const { - Dimension phyDim = _CoordinateSystemUtils::Transform(dimension); + FloatDimension phyDimF = _CoordinateSystemUtils::Transform(dimension); + Dimension phyDim = _CoordinateSystemUtils::ConvertToInteger(phyDimF); + SysTryReturn(NID_UI_CTRL, (phyDim.width >= GetDstRectMinWidth() && phyDim.height >= GetDstRectMinHeight()), false, E_INVALID_ARG, - "[E_INVALID_ARG] Dimension L[%d, %d] P[%d,%d] is over minimun size.", dimension.width, dimension.height, phyDim.width, phyDim.height); + "[E_INVALID_ARG] Dimension L[%.3f, %.3f] P[%d,%d] is over minimun size.", dimension.width, dimension.height, phyDim.width, phyDim.height); SysTryReturn(NID_UI_CTRL, __pSmartObject != null, false, E_SYSTEM, "[E_SYSTEM] __pSmartObject is null"); FloatRectangle testRect = __pVisualElement->GetBounds(); - Dimension containerDim = _CoordinateSystemUtils::Transform(Dimension(static_cast(testRect.width), static_cast(testRect.height))); + FloatRectangle containerPhyRectF = _CoordinateSystemUtils::Transform(testRect); + Dimension containerDim = _CoordinateSystemUtils::ConvertToInteger(FloatDimension(containerPhyRectF.width, containerPhyRectF.height)); SysTryReturn(NID_UI_CTRL, (phyDim.width <= containerDim.width && phyDim.height <= containerDim.height), false, E_INVALID_ARG, - "[E_INVALID_ARG] RenderRect L[%d, %d] P[%d,%d] is bigger than container size [%d, %d]", dimension.width, dimension.height, phyDim.width, phyDim.height, containerDim.width, containerDim.height); + "[E_INVALID_ARG] RenderRect L[%.3f, %.3f] P[%d,%d] is bigger than container size [%d, %d]", dimension.width, dimension.height, phyDim.width, phyDim.height, containerDim.width, containerDim.height); return true; } @@ -1425,9 +1456,9 @@ _OverlayAgent::IsValidDestinationDimension(const Dimension& dimension) const result _OverlayAgent::AdjustImageObject(void) { - SysTryReturn(NID_UI_CTRL, __pSmartObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] __pSmartObject is null"); - SysTryReturn(NID_UI_CTRL, __pImageObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] __pImageObject is null"); - SysTryReturn(NID_UI_CTRL, __pVisualElement != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] __pVisualElement is null"); + SysTryReturn(NID_UI_CTRL, __pSmartObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The SmartObject is null"); + SysTryReturn(NID_UI_CTRL, __pImageObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The ImageObject is null"); + SysTryReturn(NID_UI_CTRL, __pVisualElement != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] The VisualElement is null"); int x = 0; int y = 0; @@ -1438,11 +1469,13 @@ _OverlayAgent::AdjustImageObject(void) int resizeRectW = 0; int resizeRectH = 0; int noImage = false; + int imgWidth = 0, imgHeight = 0; //int orgX, orgY, orgW, orgH; - FloatRectangle curRect = __pVisualElement->GetBounds(); - SysLog(NID_UI_CTRL,"curRect [%f, %f, %f, %f]", curRect.x, curRect.y, curRect.width, curRect.height); - Rectangle curPhyRect = _CoordinateSystemUtils::Transform(Rectangle(static_cast(curRect.x), static_cast(curRect.y), static_cast(curRect.width), static_cast(curRect.height))); + FloatRectangle curRectF = __pVisualElement->GetBounds(); + FloatRectangle curPhyRectF = _CoordinateSystemUtils::Transform(curRectF); + Rectangle curPhyRect = _CoordinateSystemUtils::ConvertToInteger(curPhyRectF); + SysLog(NID_UI_CTRL, "The current value of curPhyRect [%d, %d]", curPhyRect.width, curPhyRect.height); if (__srcDimension.width == 0 || __srcDimension.height == 0) { @@ -1579,8 +1612,8 @@ _OverlayAgent::AdjustImageObject(void) pMap = evas_map_new(4); evas_map_util_points_populate_from_object(pMap, __pImageObject); - int imgWidth = 0, imgHeight = 0; evas_object_image_size_get(__pImageObject, &imgWidth, &imgHeight); + SysLog(NID_UI_CTRL, "image object size is [%d, %d]", imgWidth, imgHeight); switch(__userRotation) { @@ -1739,6 +1772,9 @@ _OverlayAgent::AdjustImageObject(void) { SysLog(NID_UI_CTRL, "Ratio off"); + evas_object_image_size_get(__pImageObject, &imgWidth, &imgHeight); + SysLog(NID_UI_CTRL, "image object size is [%d, %d]", imgWidth, imgHeight); + Evas_Map* pMap = evas_map_new(4); evas_map_util_points_populate_from_object(pMap, __pImageObject); @@ -1747,6 +1783,14 @@ _OverlayAgent::AdjustImageObject(void) evas_map_point_coord_set(pMap, 2, resizeRectX+resizeRectW, resizeRectY+resizeRectH, 0); evas_map_point_coord_set(pMap, 3, resizeRectX, resizeRectY+resizeRectH, 0); + if(imgWidth > 0 && imgHeight > 0) + { + evas_map_point_image_uv_set(pMap, 0, 0, 0); + evas_map_point_image_uv_set(pMap, 1, imgWidth, 0); + evas_map_point_image_uv_set(pMap, 2, imgWidth, imgHeight); + evas_map_point_image_uv_set(pMap, 3, 0, imgHeight); + } + evas_object_map_set(__pImageObject, pMap); evas_object_map_enable_set(__pImageObject, EINA_TRUE); evas_map_free(pMap); @@ -1764,133 +1808,409 @@ _OverlayAgent::AdjustImageObject(void) int _OverlayAgent::GetOverlayAgentCount(void) { - return overlayAgentcount; + return __overlayAgentcount; } -int -_OverlayAgent::GetDstRectMinWidth(void) +IListT* +_OverlayAgent::GetPixelFormatListN(void) { - ClearLastResult(); + if (!__OverlayAgentBufferPixelFormat[0]) + { + const wchar_t* _UI_REGISTRY_PATH = L"/usr/etc/system-info.ini"; + const wchar_t* _UI_INFO_SESSION = L"UiControlInfo"; + + _RegistryImpl registry; + result r = registry.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - if (dstRectMinWidth == -1) + String pixelFormatList(null); + r = registry.GetValue(_UI_INFO_SESSION, L"OverlayRegionBufferPixelFormat", pixelFormatList); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + bool set = false; + if (pixelFormatList.Contains(L"ARGB8888")) + { + __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888] = true; + set = true; + } + + if (pixelFormatList.Contains(L"RGB565")) + { + __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_RGB565] = true; + set = true; + } + + if (pixelFormatList.Contains(L"YCbCr420P")) + { + __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR] = true; + set = true; + } + + if (pixelFormatList.Contains(L"NV12")) + { + __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_NV12] = true; + set = true; + } + + if (pixelFormatList.Contains(L"UYVY")) + { + __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_UYVY] = true; + set = true; + } + + SysAssertf(set, "The registry file is an invalid."); + + __OverlayAgentBufferPixelFormat[0] = set; + } + + std::unique_ptr< ArrayListT > pFormatList( new (std::nothrow) ArrayListT()); + SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); + + result r = pFormatList->Construct(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + for (int index = 0; index < _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX; index++) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; + if (__OverlayAgentBufferPixelFormat[index + 1]) + { + r = pFormatList->Add(true); + } + } + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); + return pFormatList.release(); +} - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayDstMinWidth", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); +result +_OverlayAgent::EvaluateBounds(OverlayAgentEvaluationOption option, Rectangle& rect, bool& modified) +{ + modified = false; + SysTryReturnResult(NID_UI_CTRL, rect.width > 0 && rect.height > 0, E_INVALID_ARG, "[E_INVALID_ARG] The size of input rectangle(%d, %d) is invalid.", rect.width, rect.height); - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); + int screenWidth = _Screen::GetWidth(); + int screenHeight = _Screen::GetHeight(); + SysTryReturnResult(NID_UI_CTRL, screenWidth > 0 && screenHeight > 0, E_INVALID_ARG, "[E_SYSTEM] The value of screen size is invalid."); - dstRectMinWidth = val; + // if orientation status of screen is landscape mode, swap width and height. + { + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + int orientation = ecore_evas_rotation_get(pEcoreEvas->GetEcoreEvas()); - SysLog(NID_UI_CTRL, "overlayDstMinWidth : %d", dstRectMinWidth); + if (orientation == 90 || orientation == 270) + { + int temp = screenWidth; + screenWidth = screenHeight; + screenHeight = temp; + SysLog(NID_UI_CTRL, "The current value of device screen width is %d, device screen height is %d and orientation is %d", screenWidth, screenHeight, orientation); + } } + const int widthUnit = GetWidthUnit(); + const int heightUnit = GetHeightUnit(); + SysTryReturnResult(NID_UI_CTRL, widthUnit > 0 && heightUnit > 0, E_SYSTEM, "[E_SYSTEM] The value of overlay control's width Unit and height Unit are invalid."); - SetLastResult(E_SUCCESS); + int physicalMaxWidth= screenWidth - (screenWidth % widthUnit); + int physicalMaxHeight = screenHeight - (screenHeight % heightUnit); + int logicalMaxWidth = _CoordinateSystemUtils::InverseHorizontalTransform(physicalMaxWidth); + int logicalMaxHeight = _CoordinateSystemUtils::InverseVerticalTransform(physicalMaxHeight); + SysLog(NID_UI_CTRL, "The physical Max size of overlay control is (%d, %d) and logical Max size of overlay control is (%d, %d)", physicalMaxWidth, physicalMaxHeight, logicalMaxWidth, logicalMaxHeight); + + int dstMinWidth = GetDstRectMinWidth(); + int dstMinHeight = GetDstRectMinHeight(); + SysTryReturnResult(NID_UI_CTRL, dstMinWidth > 0 && dstMinHeight > 0, E_SYSTEM, "[E_SYSTEM] The value of overlay control's Min width and Min height are invalid."); + + Rectangle physicalRect(_CoordinateSystemUtils::Transform(rect)); + int widthReminder = physicalRect.width % widthUnit; + int heightReminder = physicalRect.height % heightUnit; + + switch (option) + { + case OVERLAY_AGENT_EVALUATION_OPTION_GREATER_THAN: + { + if (physicalRect.width > physicalMaxWidth || physicalRect.height > physicalMaxHeight) + { + modified = false; + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] The size of input rect exceeds physical maximun size."); + + return E_UNSUPPORTED_OPTION; + } + + if (rect.width > logicalMaxWidth || rect.height > logicalMaxHeight) + { + modified = false; + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] The size of input rect exceeds logical maximun size."); + + return E_UNSUPPORTED_OPTION; + } + + if (widthReminder != 0) + { + widthReminder -= widthUnit; + } + + if (heightReminder != 0) + { + heightReminder -= heightUnit; + } + + physicalRect.width -= widthReminder; + physicalRect.height -= heightReminder; + + if (physicalRect.width < dstMinWidth) + { + physicalRect.width = dstMinWidth; + } + + if (physicalRect.height < dstMinHeight) + { + physicalRect.height = dstMinHeight; + } + } + break; + case OVERLAY_AGENT_EVALUATION_OPTION_LESS_THAN: + { + if (physicalRect.width < dstMinWidth || physicalRect.height < dstMinHeight) + { + modified = false; + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] The size of input rect is under minimun size."); + + return E_UNSUPPORTED_OPTION; + } + + if (physicalRect.width > physicalMaxWidth) + { + physicalRect.width = physicalMaxWidth + widthReminder; + } + + if (physicalRect.height > physicalMaxHeight) + { + physicalRect.height = physicalMaxHeight + heightReminder; + } + + physicalRect.width -= widthReminder; + physicalRect.height -= heightReminder; + } + break; + default: + { + modified = false; + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_OPTION, "[E_UNSUPPORTED_OPTION] The input option is an invalid."); + + return E_UNSUPPORTED_OPTION; + } + } + + Rectangle originalInputRect(rect); + rect = _CoordinateSystemUtils::InverseTransform(physicalRect); + + if (rect != originalInputRect) + { + SysLog(NID_UI_CTRL, "The rect as a input parameter is adjusted. original rect(%d, %d, %d, %d) is changed to (%d, %d, %d, %d)", + originalInputRect.x, originalInputRect.y, originalInputRect.width, originalInputRect.height, + rect.x, rect.y, rect.width, rect.height); + modified = true; + } + + SysLog(NID_UI_CTRL, "The current size of valid bounds that is evaluated is (%d, %d, %d, %d)", rect.x, rect.y, rect.width, rect.height); - return dstRectMinWidth; + result r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; } int -_OverlayAgent::GetDstRectMinHeight(void) +_OverlayAgent::GetValueFromRegistry(const String& key) { - ClearLastResult(); + const wchar_t* _UI_REGISTRY_PATH = L"/usr/etc/system-info.ini"; + const wchar_t* _UI_INFO_SESSION = L"UiControlInfo"; + + _RegistryImpl registry; + result r = registry.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); + + String strValue(null); + r = registry.GetValue(_UI_INFO_SESSION, key, strValue); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); - if (dstRectMinHegith == -1) + int value; + r = Integer::Parse(strValue, value); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r)); + + return value; +} + +int +_OverlayAgent::GetDstRectMinWidth(void) +{ + if (__dstRectMinWidth < 0) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; + int value = GetValueFromRegistry(L"OverlayDstMinWidth"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); + __dstRectMinWidth = value; + SysLog(NID_UI_CTRL, "overlayDstMinWidth : %d", __dstRectMinWidth); + } - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayDstMinHeight", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); + SetLastResult(E_SUCCESS); - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); + return __dstRectMinWidth; +} - dstRectMinHegith = val; +int +_OverlayAgent::GetDstRectMinHeight(void) +{ + if (__dstRectMinHegith < 0) + { + int value = GetValueFromRegistry(L"OverlayDstMinHeight"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - SysLog(NID_UI_CTRL, "overlayDstMinHeight: %d", dstRectMinHegith); + __dstRectMinHegith = value; + SysLog(NID_UI_CTRL, "overlayDstMinHeight: %d", __dstRectMinHegith); } SetLastResult(E_SUCCESS); - return dstRectMinHegith; + return __dstRectMinHegith; } int _OverlayAgent::GetSrcRectMinWidth(void) { - ClearLastResult(); - - if (srcRectMinWidth == -1) + if (__srcRectMinWidth < 0) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; + int value = GetValueFromRegistry(L"OverlaySrcMinWidth"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); + __srcRectMinWidth = value; + SysLog(NID_UI_CTRL, "overlayDstMinWidth : %d", __srcRectMinWidth); + } - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlaySrcMinWidth", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); + SetLastResult(E_SUCCESS); - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); + return __srcRectMinWidth; +} - srcRectMinWidth = val; +int +_OverlayAgent::GetSrcRectMinHeight(void) +{ + if (__srcRectMinHegith < 0) + { + int value = GetValueFromRegistry(L"OverlaySrcMinHeight"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - SysLog(NID_UI_CTRL, "overlayDstMinWidth : %d", srcRectMinWidth); + __srcRectMinHegith = value; + SysLog(NID_UI_CTRL, "overlaySrcMinHeight: %d", __srcRectMinHegith); } SetLastResult(E_SUCCESS); - return srcRectMinWidth; + return __srcRectMinHegith; } int -_OverlayAgent::GetSrcRectMinHeight(void) +_OverlayAgent::GetWidthUnit(void) { - ClearLastResult(); + if (__overlayWidthUnit < 0) + { + int value = GetValueFromRegistry(L"OverlayRegionWidthUnit"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); + + __overlayWidthUnit = value; + SysLog(NID_UI_CTRL, "OverlayRegionWidthUnit : %d", __overlayWidthUnit); + } + + SetLastResult(E_SUCCESS); - if (srcRectMinHegith == -1) + return __overlayWidthUnit; +} + +int +_OverlayAgent::GetHeightUnit(void) +{ + if (__overlayHeightUnit < 0) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; + int value = GetValueFromRegistry(L"OverlayRegionHeightUnit"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); + __overlayHeightUnit = value; + SysLog(NID_UI_CTRL, "OverlayRegionHeightUnit : %d", __overlayHeightUnit); + } - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlaySrcMinHeight", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); + SetLastResult(E_SUCCESS); - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); + return __overlayHeightUnit; +} - srcRectMinHegith = val; +int +_OverlayAgent::GetMaxCount(void) +{ + if (__overlayMaxCount < 0) + { + int value = GetValueFromRegistry(L"MaxOverlayRegionCount"); + SysTryReturn(NID_UI_CTRL, value > 0, -1, E_SYSTEM, "[E_SYSTEM] Failed to get Overlay info from registry"); - SysLog(NID_UI_CTRL, "overlaySrcMinHeight: %d", srcRectMinHegith); + __overlayMaxCount = value; + SysLog(NID_UI_CTRL, "MaxOverlayRegionCount : %d", __overlayMaxCount); } SetLastResult(E_SUCCESS); - return srcRectMinHegith; + return __overlayMaxCount; +} + +void +_OverlayAgent::SetEvasImageDirtyCallback(void) +{ + if (__pImageObject) + { + evas_object_image_pixels_get_callback_set(__pImageObject, OnEvasImageDamaged,(void*)this); + } +} + +bool +_OverlayAgent::GetEvasImageDirtyFlag(void) const +{ + return __evasImageDamaged; +} + +void +_OverlayAgent::SetEvasImageDirtyFlag(bool dirty) +{ + __evasImageDamaged = dirty; +} + +result +_OverlayAgent::MoveChildToTop(const _Control& child) +{ + _EflNode* pEflNode = null; + Evas_Object* pSmartObject = null; + + _VisualElement* pChildVE = child.GetVisualElement(); + SysTryReturn(NID_UI_CTRL, pChildVE != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pChildVE is null."); + + pEflNode = dynamic_cast<_EflNode*>(pChildVE->GetNativeNode()); + SysTryReturn(NID_UI_CTRL, pEflNode != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] pEflNode is null" ); + + pSmartObject = (Evas_Object*)pEflNode->GetGroupContainer(); + SysTryReturn(NID_UI_CTRL, pSmartObject != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] pSmartObject is null" ); + + evas_object_raise(pSmartObject); + + return E_SUCCESS; +} + +Dimension +_OverlayAgent::GetPrevCbImageDimension(void) const +{ + return __orgCbImgDimension; } +result +_OverlayAgent::SetPrevCbImageDimension(const Dimension& imgDim) +{ + __orgCbImgDimension = imgDim; + return E_SUCCESS; +} }}} // Tizen::Ui diff --git a/src/ui/controls/FUiCtrl_OverlayPanel.cpp b/src/ui/controls/FUiCtrl_OverlayPanel.cpp old mode 100644 new mode 100755 index 9baf225..b5b33de --- a/src/ui/controls/FUiCtrl_OverlayPanel.cpp +++ b/src/ui/controls/FUiCtrl_OverlayPanel.cpp @@ -16,15 +16,15 @@ // /** * @file FUiCtrl_OverlayPanel.cpp -* @brief This file contains implementation of _OverlayPanel class +* @brief This file contains implementation of _OverlayPanel class */ #include - +#include #include -#include #include +#include #include #include "FUi_CoordinateSystemUtils.h" @@ -43,27 +43,21 @@ namespace Tizen { namespace Ui { namespace Controls { _OverlayPanel* -_OverlayPanel::CreateOverlayPanelN(const Rectangle& bounds) +_OverlayPanel::CreateOverlayPanelN() { - _OverlayPanel* pOverlayPanel = new (std::nothrow) _OverlayPanel(bounds); + std::unique_ptr<_OverlayPanel> pOverlayPanel(new (std::nothrow) _OverlayPanel()); SysTryReturn(NID_UI_CTRL, pOverlayPanel != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); result r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); pOverlayPanel->AcquireHandle(); - SetLastResult(E_SUCCESS); - return pOverlayPanel; - -CATCH: - delete pOverlayPanel; - - return null; + return pOverlayPanel.release(); } -_OverlayPanel::_OverlayPanel(const Rectangle& bounds) +_OverlayPanel::_OverlayPanel(void) : __pOverlayAgent(null) { SetLastResult(E_SUCCESS); @@ -71,8 +65,6 @@ _OverlayPanel::_OverlayPanel(const Rectangle& bounds) _OverlayPanel::~_OverlayPanel(void) { - SysLog(NID_UI_CTRL, "Destructor ~~~~~~"); - if (__pOverlayAgent) { delete __pOverlayAgent; @@ -81,11 +73,10 @@ _OverlayPanel::~_OverlayPanel(void) } result -_OverlayPanel::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuffer, const Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat) +_OverlayPanel::SetInputBuffer(const FloatDimension& destDim, const ByteBuffer& srcBuffer, const Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat) { - result r = E_SYSTEM; - - SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, r, "[E_SYSTEM] __pOverlayAgent is null."); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent->IsValidDestinationDimension(destDim), E_INVALID_ARG, "[E_INVALID_ARG] A specified input paramete is invalid."); _OverlayAgentBufferPixelFormat format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888; switch (srcFormat) @@ -100,11 +91,11 @@ _OverlayPanel::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuf format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR; break; default: - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "The specified pixel format is not supported."); + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "The specified pixel format is unsupported."); return E_UNSUPPORTED_FORMAT; } - r = __pOverlayAgent->SetInputBuffer(destDim, srcBuffer, srcDim, format); + result r = __pOverlayAgent->SetInputBuffer(srcBuffer, srcDim, format); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); r = __pOverlayAgent->Draw(); @@ -119,43 +110,43 @@ _OverlayPanel::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuf result _OverlayPanel::SetRendererRotation(OverlayPanel::Rotation rotation) { - result r = E_SYSTEM; - SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, r, "[E_SYSTEM] __pOverlayAgent is null."); - - r = __pOverlayAgent->SetRotation((_OverlayAgentRotation)rotation); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); - return r; + return __pOverlayAgent->SetRotation((_OverlayAgentRotation)rotation); } result _OverlayPanel::SetRendererAspectRatio(bool aspectRatio) { - result r = E_SYSTEM; - SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, r, "[E_SYSTEM] __pOverlayAgent is null."); - - r = __pOverlayAgent->SetAspectRatio(aspectRatio); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); - return r; + return __pOverlayAgent->SetAspectRatio(aspectRatio); } result _OverlayPanel::SetRendererSize(const Dimension& dimension) { - result r = E_SYSTEM; - SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, r, "[E_SYSTEM] __pOverlayAgent is null."); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); - r = __pOverlayAgent->SetDestination(dimension); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + FloatDimension floatDimension = _CoordinateSystemUtils::ConvertToFloat(dimension); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent->IsValidDestinationDimension(floatDimension), E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); - return r; + return __pOverlayAgent->SetDestination(floatDimension); +} + +result +_OverlayPanel::SetRendererSize(const FloatDimension& dimension) +{ + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent->IsValidDestinationDimension(dimension), E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); + + return __pOverlayAgent->SetDestination(dimension); } result _OverlayPanel::GetBackgroundBufferInfo(BufferInfo& info) const { - SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] __pOverlayAgent is null."); + SysTryReturnResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); return __pOverlayAgent->GetBufferInfo(info); } @@ -163,18 +154,14 @@ _OverlayPanel::GetBackgroundBufferInfo(BufferInfo& info) const Color _OverlayPanel::GetMaskingColor(void) const { -// Suspend return Color(0x00000000); -// --- } void _OverlayPanel::OnDraw(void) { - SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] __pOverlayAgent is null."); + SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); __pOverlayAgent->AdjustImageObject(); - - return; } void @@ -182,43 +169,44 @@ _OverlayPanel::OnVisibleStateChanged(void) { if (IsVisible()) { - SysLog(NID_UI_CTRL, " visible true"); + SysLog(NID_UI_CTRL, "Visible state is set to TRUE"); } else { - SysLog(NID_UI_CTRL, " visible false"); + SysLog(NID_UI_CTRL, " Visible state is set to FALSE"); } } result _OverlayPanel::OnAttachedToMainTree(void) { - byte* pBuf = null; - int maxCount = OverlayRegion::GetMaxCount(); - SysTryReturn(NID_UI_CTRL, maxCount > 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] maxCount [%d] is invalid", maxCount); + SysTryReturnResult(NID_UI_CTRL, maxCount > 0, E_SYSTEM, "[E_SYSTEM] The current value of maxCount(%d) is in an invalid state.", maxCount); + // 1. check for overlayAgent maximum count - SysTryReturn(NID_UI_CTRL, _OverlayAgent::GetOverlayAgentCount() < maxCount, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] already used permitted maximum number of OverlayAgent!"); + SysTryReturnResult(NID_UI_CTRL, _OverlayAgent::GetOverlayAgentCount() < maxCount, E_SYSTEM, "[E_SYSTEM] OverlayAgent already exceeds the maximum limit."); _Control* pParent = GetParent(); - SysTryReturn(NID_UI_CTRL, pParent != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Parent is invalid"); + SysTryReturnResult(NID_UI_CTRL, pParent != null, E_SYSTEM, "[E_SYSTEM] The parent(_Control) must not be null."); _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(pParent->GetUserData()); - SysTryReturn(NID_UI_CTRL, pControlImpl != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] pControlImpl is null"); + SysTryReturnResult(NID_UI_CTRL, pControlImpl != null, E_SYSTEM, "[E_SYSTEM] The impl of parent (_ControlImpl) must not be null."); _FormImpl* pFormImpl = dynamic_cast<_FormImpl*>(pControlImpl); - SysTryReturn(NID_UI_CTRL, pFormImpl != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] pFormImpl is null"); + SysTryReturnResult(NID_UI_CTRL, pFormImpl != null, E_SYSTEM, "[E_SYSTEM] The form impl (_FormImpl) must not be null."); + // 2. check for using OverlayRegion simutaneously in the same form _Form& form = pFormImpl->GetCore(); - SysTryReturn(NID_UI_CTRL, form.GetOverlayRegionCount() == 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Using OverlayPanel mixed with OverlayRegion is not supported"); + SysTryReturnResult(NID_UI_CTRL, form.GetOverlayRegionCount() == 0, E_SYSTEM, "[E_SYSTEM] Using OverlayPanel mixed with OverlayRegion is unsupported."); - int idx, panelCount = 0;; - _OverlayPanel* pOverlayPanel = null; // 3. check for overlayPanel maximum count - for (idx = 0 ; idx < form.GetChildCount() ; idx++) + int panelCount = 0; + _OverlayPanel* pOverlayPanel = null; + + for (int idx = 0 ; idx < form.GetChildCount(); idx++) { pOverlayPanel = dynamic_cast <_OverlayPanel*>(form.GetChild(idx)); if(pOverlayPanel != null) @@ -227,26 +215,26 @@ _OverlayPanel::OnAttachedToMainTree(void) pOverlayPanel = null; } } + SysTryReturn(NID_UI_CTRL, panelCount <= maxCount, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] OverlayPanel already exceeds the maximum limit."); - SysTryReturn(NID_UI_CTRL, panelCount <= maxCount, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] already used permitted maximum number of OverlayPanel"); // 4. make OverlayPanel object - Rectangle clientRect = pParent->GetClientBounds(); //GetClientBounds(); - Rectangle GeneralRect = GetBounds(); - Rectangle overlayRect(clientRect.x + GeneralRect.x, clientRect.y + GeneralRect.y, GeneralRect.width, GeneralRect.height); + FloatRectangle clientRectF = pParent->GetClientBoundsF(); + FloatRectangle generalRectF = GetBoundsF(); + FloatRectangle overlayRectF(clientRectF.x + generalRectF.x, clientRectF.y + generalRectF.y, generalRectF.width, generalRectF.height); + SysLog(NID_UI_CTRL,"The current value of logical overlayRect is [%.3f, %.3f, %.3f, %.3f]", overlayRectF.x, overlayRectF.y, overlayRectF.width, overlayRectF.height); - SysLog(NID_UI_CTRL,"clientRect is [%d, %d, %d, %d] userRect is [%d, %d, %d, %d]", - clientRect.x, clientRect.y, clientRect.width, clientRect.height, GeneralRect.x, GeneralRect.y, GeneralRect.width, GeneralRect.height); - SysLog(NID_UI_CTRL,"logical overlayRect is [%d, %d, %d, %d]", overlayRect.x, overlayRect.y, overlayRect.width, overlayRect.height); // 5. Adjust - Rectangle devBounds = _CoordinateSystemUtils::Transform(overlayRect); + FloatRectangle devBoundsF = _CoordinateSystemUtils::Transform(overlayRectF); + Rectangle devBounds = _CoordinateSystemUtils::ConvertToInteger(devBoundsF); if (devBounds.width % 2 != 0) { - SysLog(NID_UI_CTRL,"physical overlayRect width is revised [%d]->[%d]", devBounds.width, devBounds.width - 1); devBounds.width -= 1; } - SysLog(NID_UI_CTRL, "physical overlayRect is [%d,%d,%d,%d]", devBounds.x, devBounds.y, devBounds.width, devBounds.height); + + SysLog(NID_UI_CTRL, "The current value of physical overlayRect is [%d,%d,%d,%d]", devBounds.x, devBounds.y, devBounds.width, devBounds.height); + // 6. create OverlayAgent Instance _OverlayAgentStyle overlayAgentType = _OVERLAY_AGENT_STYLE_PANEL_SW; @@ -254,12 +242,12 @@ _OverlayPanel::OnAttachedToMainTree(void) if(preferredEngineConfig.Equals("opengl_x11", true)) { overlayAgentType = _OVERLAY_AGENT_STYLE_PANEL_GL; - SysLog(NID_UI_CTRL,"xml : HwAcceleration was set to On"); + SysLog(NID_UI_CTRL, "xml : HwAcceleration was set to On"); } else if(preferredEngineConfig.Equals("software_x11", true)) { overlayAgentType = _OVERLAY_AGENT_STYLE_PANEL_SW; - SysLog(NID_UI_CTRL,"xml : HwAcceleration was set to Off"); + SysLog(NID_UI_CTRL, "xml : HwAcceleration was set to Off"); } else { @@ -267,32 +255,31 @@ _OverlayPanel::OnAttachedToMainTree(void) if(engineConfig.Equals("opengl_x11", true)) { overlayAgentType = _OVERLAY_AGENT_STYLE_PANEL_GL; - SysLog(NID_UI_CTRL,"dev setting option : gl backend"); + SysLog(NID_UI_CTRL,"Dev setting option is gl backend"); } } __pOverlayAgent = _OverlayAgent::CreateInstanceN(overlayAgentType, *this, devBounds); result r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && __pOverlayAgent != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS && __pOverlayAgent != null, r, "[%s] Propagating.", GetErrorMessage(r)); if (overlayAgentType == _OVERLAY_AGENT_STYLE_PANEL_GL) { r = __pOverlayAgent->CreatePixmap(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } else { - SysLog(NID_UI_CTRL, "not need to make a pixmap"); + SysLog(NID_UI_CTRL,"The current type of OverlayAgent is _OVERLAY_AGENT_STYLE_PANEL_SW, and it don't need to make a pixmap"); - int i, j; - int size = devBounds.width * devBounds.height * 4; - pBuf = new (std::nothrow) byte[size]; - SysTryCatch(NID_UI_CTRL, pBuf != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pBuf is null."); + int size = (devBounds.width * 2) * (devBounds.height * 2); + std::unique_ptr pBuf(new (std::nothrow) byte[size]); + SysTryReturnResult(NID_UI_CTRL, pBuf != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Buffer must not be null."); - unsigned long* pPos = (unsigned long*)pBuf; - for(i=0; iSetEvasImageDirtyCallback(); } return E_SUCCESS; - -CATCH: - delete[] pBuf; - delete __pOverlayAgent; - __pOverlayAgent = null; - return GetLastResult(); } void _OverlayPanel::OnBoundsChanged(void) { - SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] __pOverlayAgent is null."); + SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); - Rectangle clientRect = GetParent()->GetClientBounds(); //GetClientBounds(); - Rectangle GeneralRect = GetBounds(); - Rectangle overlayRect(clientRect.x + GeneralRect.x, clientRect.y + GeneralRect.y, GeneralRect.width, GeneralRect.height); + Rectangle clientRect = GetParent()->GetClientBounds(); + Rectangle generalRect = GetBounds(); + Rectangle overlayRect(clientRect.x + generalRect.x, clientRect.y + generalRect.y, generalRect.width, generalRect.height); SetRendererSize(Dimension(overlayRect.width, overlayRect.height)); - - return; } void _OverlayPanel::OnChildDetached(const _Control& child) { - return; + } +void +_OverlayPanel::OnChildAttached(const _Control& child) +{ + SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null."); + __pOverlayAgent->MoveChildToTop(child); +} }}} // Tizen::Ui::Controls - diff --git a/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp b/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp index cbb0c64..0b26781 100644 --- a/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp +++ b/src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp @@ -14,90 +14,109 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /* * @file FUiCtrl_OverlayPanelImpl.cpp * @brief This is the implementation file for _OverlayPanelImpl class. - * */ - +#include #include #include -#include #include - +#include +#include +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_ResourceSizeInfo.h" #include "FUi_UiBuilder.h" +#include "FUiCtrl_OverlayAgent.h" #include "FUiCtrl_OverlayPanelImpl.h" -#include "FUi_ResourceSizeInfo.h" -#include "FUi_ResourceManager.h" + using namespace Tizen::Base; +using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; -using namespace Tizen::Ui::Animations; using namespace Tizen::Io; using namespace Tizen::System; - -#ifndef _OSP_EMUL_ -namespace -{ - const wchar_t* _UI_REGISTRY_PATH = L"/usr/etc/system-info.ini"; - const wchar_t* _UI_INFO_SESSION = L"UiControlInfo"; -} -#endif +using namespace Tizen::Ui; +using namespace Tizen::Ui::Animations; +using namespace Tizen::Ui::Controls; namespace Tizen { namespace Ui { namespace Controls { -bool _OverlayPanelImpl::overlayPanelPixelFomatList[]= {false,}; +bool _OverlayPanelImpl::__overlayPanelPixelFomatList[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX]= {false,}; -Tizen::Graphics::Dimension +Dimension _OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const { - // [ToDo] - Dimension dimension(0, 0); + Dimension overlayPanelMinSize = _CoordinateSystemUtils::InverseTransform(Dimension(_OverlayAgent::GetDstRectMinWidth(), _OverlayAgent::GetDstRectMinHeight())); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Dimension(-1, -1), r,"[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, overlayPanelMinSize.width > 0 && overlayPanelMinSize.height > 0, Dimension(-1, -1), E_SYSTEM, + "[E_SYSTEM] The minimum size of overlay panel in system-info(%d, %d) is invalid.", overlayPanelMinSize.width, overlayPanelMinSize.height); - int minimumSize = 0; - result r = GET_SHAPE_CONFIG("OVERLAYPANEL::MIN_RENDERER_SIZE", orientation, minimumSize); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, dimension, r, "[%s] Propagating.", GetErrorMessage(r)); + return overlayPanelMinSize; +} - dimension.width = minimumSize; - dimension.height = minimumSize; +Dimension +_OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const +{ + Dimension screenSize = Dimension(_Screen::GetWidth(), _Screen::GetHeight()); + Dimension overlayPanelMaxSize = screenSize; - SetLastResult(E_SUCCESS); + if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + { + overlayPanelMaxSize.width = screenSize.height; + overlayPanelMaxSize.height = screenSize.width; + } - return dimension; + return overlayPanelMaxSize; } _OverlayPanelImpl* _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangle& bounds) { result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid."); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height); - _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN(bounds); + _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN(); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); - _OverlayPanelImpl* pImpl = new (std::nothrow) _OverlayPanelImpl(pPublic, pCore); - r = _ControlImpl::CheckConstruction(pCore, pImpl); + std::unique_ptr<_OverlayPanelImpl> pImpl(new (std::nothrow) _OverlayPanelImpl(pPublic, pCore)); + r = _ControlImpl::CheckConstruction(pCore, pImpl.get()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl.release(); +} + +_OverlayPanelImpl* +_OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const FloatRectangle& bounds) +{ + result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height); - SetLastResult(E_SUCCESS); + _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); - return pImpl; + std::unique_ptr<_OverlayPanelImpl> pImpl(new (std::nothrow) _OverlayPanelImpl(pPublic, pCore)); + r = _ControlImpl::CheckConstruction(pCore, pImpl.get()); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); -CATCH: - delete pImpl; - return null; + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl.release(); } _OverlayPanelImpl::~_OverlayPanelImpl(void) { - } void @@ -118,18 +137,33 @@ _OverlayPanelImpl::SetRendererSize(const Dimension& dimension) GetCore().SetRendererSize(dimension); } +void +_OverlayPanelImpl::SetRendererSize(const FloatDimension& dimension) +{ + GetCore().SetRendererSize(dimension); +} + result _OverlayPanelImpl::SetInputBuffer(const Dimension& destDim, const ByteBuffer& srcBuffer, const Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat) { - if (!_OverlayPanelImpl::overlayPanelPixelFomatList[0]) + FloatDimension destFloatDim = _CoordinateSystemUtils::ConvertToFloat(destDim); + result r = SetInputBuffer(destFloatDim, srcBuffer, srcDim, srcFormat); + + return r; +} + +result +_OverlayPanelImpl::SetInputBuffer(const FloatDimension& destDim, const ByteBuffer& srcBuffer, const Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat) +{ + if (!__overlayPanelPixelFomatList[0]) { result r = _OverlayPanelImpl::SetPixelFormatList(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } - if (!_OverlayPanelImpl::overlayPanelPixelFomatList[srcFormat]) + if (!__overlayPanelPixelFomatList[srcFormat]) { - SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] srcFormat [%d] is not supported!", srcFormat); + SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] The Source format(%d) is unsupported.", srcFormat); return E_UNSUPPORTED_FORMAT; } @@ -160,7 +194,7 @@ _OverlayPanelImpl::GetBackgroundBufferInfo(BufferInfo& bufferInfo) const else if (r != E_SUCCESS) { r = E_OPERATION_FAILED; - SysLogException(NID_UI_CTRL, r, "[E_OPERATION_FAILED] The operation has failed."); + SysLogException(NID_UI_CTRL, r, "[E_OPERATION_FAILED] failed to GetBackgroundBufferInfo."); } return r; @@ -222,56 +256,88 @@ _OverlayPanelImpl::GetInstance(const OverlayPanel& overlayPanel) result _OverlayPanelImpl::SetPixelFormatList(void) { -#ifndef _OSP_EMUL_ - String formatList; + if (__overlayPanelPixelFomatList[0]) + { + return E_SUCCESS; + } - result r = E_SUCCESS; - _RegistryImpl _reg; + std::unique_ptr< IListT > pFormatList(_OverlayAgent::GetPixelFormatListN()); + SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - if (IsFailed(r)) + bool set = false; + for (int formatIndex = 1; formatIndex < pFormatList->GetCount(); formatIndex++) { - if (r == E_OUT_OF_MEMORY) - { - SysTryReturn(NID_UI_CTRL, r != E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - else + bool value = false; + pFormatList->GetAt(formatIndex, value); + + if (value) { - SysAssertf(0, "failed to Construct the _RegistryImpl"); + __overlayPanelPixelFomatList[formatIndex] = true; + set = true; } } - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayRegionBufferPixelFormat", formatList); - SysAssertf(!IsFailed(r), "Failed to get a registry value"); + SysAssertf(set, "The list of supported pixel formats is an invalid."); -#else - String formatList(L"ARGB8888/RGB565/YCbCr420P"); -#endif + __overlayPanelPixelFomatList[0] = set; - bool set = false; - if (formatList.Contains(L"ARGB8888")) - { - overlayPanelPixelFomatList[OverlayPanel::BUFFER_PIXEL_FORMAT_ARGB8888+1] = true; - set = true; - } + return E_SUCCESS; +} - if (formatList.Contains(L"RGB565")) +IListT* +_OverlayPanelImpl::GetSupportedBufferPixelFormatListN(void) +{ + result r = E_SUCCESS; + + if (!__overlayPanelPixelFomatList[0]) { - overlayPanelPixelFomatList[OverlayPanel::BUFFER_PIXEL_FORMAT_RGB565+1] = true; - set = true; + r = _OverlayPanelImpl::SetPixelFormatList(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); } - if (formatList.Contains(L"YCbCr420P")) + std::unique_ptr< ArrayListT > pFormatList( new (std::nothrow) ArrayListT()); + SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); + + r = pFormatList->Construct(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + for (int index = 0; index < _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX; index++) { - overlayPanelPixelFomatList[OverlayPanel::BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR+1] = true; - set = true; + if (__overlayPanelPixelFomatList[index + 1]) + { + r = pFormatList->Add(static_cast(index)); + } } + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pFormatList.release(); +} + +int +_OverlayPanelImpl::GetWidthUnit(void) +{ + int widthUnit = _OverlayAgent::GetWidthUnit(); + SysAssertf(widthUnit > 0, "Failed to get a OverlayAgent's WidthUnit"); - SysAssertf(set, "registry file is something wrong"); + return widthUnit; +} - overlayPanelPixelFomatList[0] = set; +int +_OverlayPanelImpl::GetHeightUnit(void) +{ + int heightUnit = _OverlayAgent::GetHeightUnit(); + SysAssertf(heightUnit > 0, "Failed to get a OverlayAgent's HeightUnit"); - return E_SUCCESS; + return heightUnit; +} + +int +_OverlayPanelImpl::GetMaxCount(void) +{ + int maxCount = _OverlayAgent::GetMaxCount(); + SysAssertf(maxCount > 0, "Failed to get a OverlayAgent's MaxCount"); + + return maxCount; } class _OverlayPanelMaker @@ -279,8 +345,13 @@ class _OverlayPanelMaker { public: _OverlayPanelMaker(_UiBuilder* uibuilder) - :_UiBuilderControlMaker(uibuilder){}; - virtual ~_OverlayPanelMaker(){}; + :_UiBuilderControlMaker(uibuilder) + { + }; + + virtual ~_OverlayPanelMaker() + { + }; static _UiBuilderControlMaker* GetInstance(_UiBuilder* uibuilder) { @@ -291,34 +362,20 @@ public: protected: virtual Tizen::Ui::Control* Make(_UiBuilderControl* pControl) { - result r = E_SYSTEM; - _UiBuilderControlLayout* pControlProperty = NULL; - OverlayPanel* pOverlayPanel = NULL; - Tizen::Graphics::Rectangle rect; + _UiBuilderControlLayout* pControlProperty = null; GetProperty(pControl, &pControlProperty); - if (pControlProperty == null) - { - return null; - } + SysTryReturn(NID_UI, pControlProperty != null, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - rect = pControlProperty->GetRect(); + std::unique_ptr pOverlayPanel(new (std::nothrow) OverlayPanel()); + SysTryReturn(NID_UI, pOverlayPanel != null, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - pOverlayPanel = new (std::nothrow) OverlayPanel(); - if (pOverlayPanel == null) - { - return null; - } + Rectangle rect = pControlProperty->GetRect(); - //Construct - r = pOverlayPanel->Construct(rect); - if (r != E_SUCCESS) - { - delete pOverlayPanel; - return null; - } + result r = pOverlayPanel->Construct(rect); + SysTryReturn(NID_UI, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error occurred."); - return pOverlayPanel; + return pOverlayPanel.release(); } }; diff --git a/src/ui/controls/FUiCtrl_OverlayRegionImpl.cpp b/src/ui/controls/FUiCtrl_OverlayRegionImpl.cpp index 47ba0d9..c3a7eee 100644 --- a/src/ui/controls/FUiCtrl_OverlayRegionImpl.cpp +++ b/src/ui/controls/FUiCtrl_OverlayRegionImpl.cpp @@ -22,10 +22,10 @@ */ #include - +#include #include #include - +#include #include #include @@ -39,30 +39,36 @@ #include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_FormImpl.h" -#include "FUiCtrl_OverlayRegionImpl.h" #include "FUiCtrl_OverlayAgent.h" +#include "FUiCtrl_OverlayRegionImpl.h" using namespace Tizen::Base; -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Media; +using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; using namespace Tizen::Io; +using namespace Tizen::Media; using namespace Tizen::System; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; namespace { const int _ROTATION_COUNT = 4; - const wchar_t* _UI_REGISTRY_PATH = L"/usr/etc/system-info.ini"; - const wchar_t* _UI_INFO_SESSION = L"UiControlInfo"; - const char* _MEDIA_CAPABILITY_FILE_PATH = "/usr/etc/media-capability.xml"; const char* _CAM_PRIMARY_DIRECTION = "Camera.Primary.Direction"; const char* _CAM_PRIMARY_ROTATION = "Camera.Primary.Rotation"; const char* _CAM_SECONDARY_DIRECTION = "Camera.Secondary.Direction"; const char* _CAM_SECONDARY_ROTATION = "Camera.Secondary.Rotation"; + struct xmlParserDeleter + { + void operator()(xmlDoc* pXmlDoc) + { + xmlFreeDoc(pXmlDoc); + } + }; + class _OverlayRegionMediaCapability { public: @@ -84,10 +90,7 @@ namespace namespace Tizen { namespace Ui { namespace Controls { -int _OverlayRegionImpl::overlayRegionWidthUnit = -1; -int _OverlayRegionImpl::overlayRegionHeightUnit = -1; -int _OverlayRegionImpl::overlayRegionMaxCount = -1; -bool _OverlayRegionImpl::overlayRegionPixelFomatList[]= {false,}; +bool _OverlayRegionImpl::__overlayRegionPixelFomatList[]= {false,}; result _IsValidSrcDim(const Tizen::Graphics::Dimension& srcDim, int multipleValueW, int multipleValueH) @@ -194,13 +197,13 @@ _ConvertCamToOverlayRegionRotation(OverlayRegionType type, int camDir, int camRo _OverlayRegionImpl::_OverlayRegionImpl(void) : __pParentForm(null) , __pOverlayRegion(null) - , __destRect(0, 0, 0, 0) , __overlayRegionType(OVERLAY_REGION_TYPE_MIN) - , __showState(true) + , __pOverlayAgent(null) + , __destRect(0.0f, 0.0f, 0.0f, 0.0f) , __myIdx(-1) , __cameraDirection(2/*CAMERA_DIRECTION_BACK*/) , __cameraRotation(1/*CAMERA_ROTATION_NONE*/) - , __pOverlayAgent(null) + , __showState(true) { } @@ -225,14 +228,14 @@ _OverlayRegionImpl::~_OverlayRegionImpl(void) } } -Tizen::Graphics::Rectangle +Tizen::Graphics::FloatRectangle _OverlayRegionImpl::GetBounds(void) const { return __destRect; } void -_OverlayRegionImpl::GetBounds(int& x, int& y, int& width, int& height) const +_OverlayRegionImpl::GetBounds(float& x, float& y, float& width, float& height) const { x = __destRect.x; y = __destRect.y; @@ -240,21 +243,19 @@ _OverlayRegionImpl::GetBounds(int& x, int& y, int& width, int& height) const height = __destRect.height; } -int test = 1; - result _OverlayRegionImpl::SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayRegionBufferPixelFormat srcFormat, bool isUserInput) { result r = _IsValidSrcDim(srcDim, OverlayRegion::GetWidthUnit(), OverlayRegion::GetHeightUnit()); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - if (!_OverlayRegionImpl::overlayRegionPixelFomatList[0]) + if (!__overlayRegionPixelFomatList[0]) { result r = _OverlayRegionImpl::SetPixelFormatList(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - _OverlayAgentBufferPixelFormat format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888; + _OverlayAgentBufferPixelFormat format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888; switch (srcFormat) { @@ -278,7 +279,7 @@ _OverlayRegionImpl::SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, con return E_UNSUPPORTED_FORMAT; } - if (!_OverlayRegionImpl::overlayRegionPixelFomatList[srcFormat]) + if (!__overlayRegionPixelFomatList[srcFormat]) { SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "[E_UNSUPPORTED_FORMAT] srcFormat [%d] is not supported!", srcFormat); return E_UNSUPPORTED_FORMAT; @@ -287,7 +288,7 @@ _OverlayRegionImpl::SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, con int size = srcBuffer.GetCapacity(); SysTryReturnResult(NID_UI_CTRL, size > 0, E_INVALID_ARG, "[E_INVALID_ARG] source size[%d] is invalid!", size); - r = __pOverlayAgent->SetInputBuffer(Dimension(__destRect.width, __destRect.height), srcBuffer, srcDim, format); + r = __pOverlayAgent->SetInputBuffer(srcBuffer, srcDim, format); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); SysTryReturnResult(NID_UI_CTRL, __showState, E_SYSTEM, "[E_SYSTEM]__showState is false! don't draw now.."); @@ -359,10 +360,9 @@ _OverlayRegionImpl::Show(void) const } result -_OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegionType, const Point& leftTopPos, const Rectangle& userDestRect, const Rectangle& finalPhyRect) +_OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegionType, const FloatRectangle& userDestRect, const Rectangle& finalPhyRect) { result r = E_SUCCESS; - byte* pBuf = null; switch (overlayRegionType) { @@ -370,7 +370,7 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio { _OverlayRegionMediaCapability capability; r = capability.Construct(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] pPropagating.", GetErrorMessage(r)); __cameraDirection = capability.cameraPrimaryDirection; __cameraRotation = capability.cameraPrimaryRotation; @@ -381,7 +381,7 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio { _OverlayRegionMediaCapability capability; r = capability.Construct(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] pPropagating.", GetErrorMessage(r)); __cameraDirection = capability.cameraSecondaryDirection; __cameraRotation = capability.cameraSecondaryRotation; @@ -395,6 +395,7 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio return E_UNSUPPORTED_FORMAT; } + SysTryReturnResult(NID_UI_CTRL, pParentForm != null, E_SYSTEM, "[E_SYSTEM] pParentForm impl is null."); Tizen::Ui::Controls::_FormImpl* pFormImpl = static_cast<_FormImpl*>(pParentForm->GetUserData()); @@ -406,6 +407,7 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio //Rectangle overlayRect(leftTopPos.x, leftTopPos.y, destRect.width, destRect.height); //SysLog(NID_UI_CTRL,"overlayAgentRect[%d, %d, %d, %d]", overlayRect.x, overlayRect.y, overlayRect.width, overlayRect.height); + _OverlayAgentStyle overlayAgentType = _OVERLAY_AGENT_STYLE_REGION_SW; String preferredEngineConfig(elm_config_preferred_engine_get()); if(preferredEngineConfig.Equals("opengl_x11", true)) @@ -424,17 +426,18 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio if(engineConfig.Equals("opengl_x11", true)) { overlayAgentType = _OVERLAY_AGENT_STYLE_REGION_GL; - SysLog(NID_UI_CTRL,"dev setting option : gl backend"); + SysLog(NID_UI_CTRL,"dev setting option is gl backend"); } else { - SysLog(NID_UI_CTRL,"dev setting option : sw backend"); + SysLog(NID_UI_CTRL,"dev setting option is sw backend"); } } + __pOverlayAgent = _OverlayAgent::CreateInstanceN(overlayAgentType, *pParentForm, finalPhyRect); r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && __pOverlayAgent != null, r, r, "[%s] pPropagating.", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS && __pOverlayAgent != null, r, "[%s] pPropagating.", GetErrorMessage(r)); __pParentForm = pParentForm; __overlayRegionType = overlayRegionType; @@ -447,7 +450,7 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio } else { - SysLog(NID_UI_CTRL,"not need to make a pixmap"); + SysLog(NID_UI_CTRL,"The current type of OverlayAgent is _OVERLAY_AGENT_STYLE_REGION_SW, and it don't need to make a pixmap"); } switch(rotation) @@ -465,21 +468,20 @@ _OverlayRegionImpl::Construct(_Form* pParentForm, OverlayRegionType overlayRegio __pOverlayAgent->SetRotation(_OVERLAY_AGENT_ROTATION_270); break; default: - SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] rotate value[%d] is invalid.", rotation); + SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] The current orientation(%d) is invalid.", rotation); return E_SYSTEM; } if (overlayAgentType == _OVERLAY_AGENT_STYLE_REGION_SW) { - int i, j; - int size = finalPhyRect.width * finalPhyRect.height * 4; - pBuf = new (std::nothrow) byte[size]; - SysTryCatch(NID_UI_CTRL, pBuf != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pBuf is null."); + int size = (finalPhyRect.width * 2) * (finalPhyRect.height * 2); + std::unique_ptr pBuf(new (std::nothrow) byte[size]); + SysTryCatch(NID_UI_CTRL, pBuf != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Buffer must not be null."); - unsigned long* pPos = (unsigned long*)pBuf; - for(i=0;iSetEvasImageDirtyCallback(); } return r; CATCH: - delete[] pBuf; delete __pOverlayAgent; __pOverlayAgent = null; + return GetLastResult(); } OverlayRegion* _OverlayRegionImpl::CreateOverlayRegionN(void) { - OverlayRegion* pOverlayRegion = null; - pOverlayRegion = new (std::nothrow) OverlayRegion(); + OverlayRegion* pOverlayRegion = new (std::nothrow) OverlayRegion(); SysTryReturn(NID_UI_CTRL, pOverlayRegion != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pOverlayRegion is null."); __pOverlayRegion = pOverlayRegion; @@ -566,15 +565,17 @@ _OverlayRegionImpl::IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tiz if ((overlayPhysicalRect.width < _OverlayAgent::GetDstRectMinWidth()) || (overlayPhysicalRect.height < _OverlayAgent::GetDstRectMinHeight())) { - SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] size of OverlayRegoin is invalid [w : %4d, h : %4d].", + SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] The current size of OverlayRegoin is invalid [w : %4d, h : %4d].", overlayPhysicalRect.width, overlayPhysicalRect.height); return E_INVALID_ARG; } - int base = overlayRegionWidthUnit / 2; + int overlayWidthUnit = _OverlayAgent::GetWidthUnit(); + int base = overlayWidthUnit / 2; + if (base != 0) { - int modW = overlayPhysicalRect.width % overlayRegionWidthUnit; + int modW = overlayPhysicalRect.width % overlayWidthUnit; if (modW != 0) { if (modW <= base) @@ -583,16 +584,18 @@ _OverlayRegionImpl::IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tiz } else { - overlayPhysicalRect.width += (overlayRegionWidthUnit - modW); + overlayPhysicalRect.width += (overlayWidthUnit - modW); } modified = true; } } - base = overlayRegionHeightUnit / 2; + int overlayHeightUnit = _OverlayAgent::GetHeightUnit(); + base = overlayHeightUnit / 2; + if (base != 0) { - int modH = overlayPhysicalRect.height % overlayRegionHeightUnit; + int modH = overlayPhysicalRect.height % overlayHeightUnit; if (modH != 0) { if (modH <= base) @@ -601,7 +604,7 @@ _OverlayRegionImpl::IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tiz } else { - overlayPhysicalRect.height += (overlayRegionHeightUnit - modH); + overlayPhysicalRect.height += (overlayHeightUnit - modH); } modified = true; } @@ -612,20 +615,22 @@ _OverlayRegionImpl::IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tiz { SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] __InvR(overlayPhysicalRect [%d, %d, %d, %d]) (w : %4d, h : %4d) org (w : %4d, h : %4d) is not same", overlayPhysicalRect.x, overlayPhysicalRect.y, overlayPhysicalRect.width, overlayPhysicalRect.height, rect.width, rect.height, userRect.width, userRect.height); + return E_INVALID_ARG; } // First, overlayPhysicalRect's x, y position should be positive value or zero. if (!((overlayPhysicalRect.x >= 0) && (overlayPhysicalRect.y >= 0) && - // Second, Check if it is clipping or not. (OverlayRegion cannot be clipped) - (overlayPhysicalRect.x + overlayPhysicalRect.width <= basePhysicalRect.x + basePhysicalRect.width) && - (overlayPhysicalRect.y + overlayPhysicalRect.height <= basePhysicalRect.y + basePhysicalRect.height))) + // Second, Check if it is clipping or not. (OverlayRegion cannot be clipped) + (overlayPhysicalRect.x + overlayPhysicalRect.width <= basePhysicalRect.x + basePhysicalRect.width) && + (overlayPhysicalRect.y + overlayPhysicalRect.height <= basePhysicalRect.y + basePhysicalRect.height))) { SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] The bounds of OverlayRegion is now outside of the current form " - "overlayPhysicalRect (x : %4d, y: %4d, w : %4d, h : %4d), " - "basePhysicalRect (x : %4d, y: %4d, w : %4d, h : %4d).", - overlayPhysicalRect.x, overlayPhysicalRect.y, overlayPhysicalRect.width, overlayPhysicalRect.height, - basePhysicalRect.x, basePhysicalRect.y, basePhysicalRect.width, basePhysicalRect.height); + "overlayPhysicalRect (x : %4d, y: %4d, w : %4d, h : %4d), " + "basePhysicalRect (x : %4d, y: %4d, w : %4d, h : %4d).", + overlayPhysicalRect.x, overlayPhysicalRect.y, overlayPhysicalRect.width, overlayPhysicalRect.height, + basePhysicalRect.x, basePhysicalRect.y, basePhysicalRect.width, basePhysicalRect.height); + r = E_INVALID_ARG; } @@ -633,171 +638,73 @@ _OverlayRegionImpl::IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tiz // overlayPhysicalRect.x, overlayPhysicalRect.y, overlayPhysicalRect.width, overlayPhysicalRect.height, // basePhysicalRect.x, basePhysicalRect.y, basePhysicalRect.width, basePhysicalRect.height, modified ); + r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + return r; } result _OverlayRegionImpl::SetPixelFormatList(void) { -#ifndef _OSP_EMUL_ - String formatList; - - result r = E_SUCCESS; - _RegistryImpl _reg; - - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - if (IsFailed(r)) + if (__overlayRegionPixelFomatList[0]) { - if (r == E_OUT_OF_MEMORY) - { - SysTryReturn(NID_UI_CTRL, r != E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - } - else - { - SysAssertf(0, "failed to Construct the _RegistryImpl"); - } + return E_SUCCESS; } - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayRegionBufferPixelFormat", formatList); - SysAssertf(!IsFailed(r), "Failed to get a registry value"); - - SysLog(NID_UI_CTRL,"FormatList: %ls", formatList.GetPointer()); -#else - String formatList(L"ARGB8888/RGB565/YCbCr420P"); -#endif + std::unique_ptr< IListT > pFormatList(_OverlayAgent::GetPixelFormatListN()); + SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); bool set = false; - if (formatList.Contains(L"ARGB8888")) - { - overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_ARGB8888] = true; - set = true; - } - - if (formatList.Contains(L"RGB565")) - { - overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_RGB565] = true; - set = true; - } - - if (formatList.Contains(L"YCbCr420P")) - { - overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR] = true; - set = true; - } - - if (formatList.Contains(L"NV12")) + for (int formatIndex = 1; formatIndex < pFormatList->GetCount(); formatIndex++) { - overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_NV12] = true; - set = true; - } + bool value = false; + pFormatList->GetAt(formatIndex, value); - if (formatList.Contains(L"UYVY")) - { - overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_UYVY] = true; - set = true; + if (value) + { + __overlayRegionPixelFomatList[formatIndex] = true; + set = true; + } } - SysAssertf(set, "registry file is something wrong"); + SysAssertf(set, "The list of supported pixel formats is an invalid."); - overlayRegionPixelFomatList[0] = set; + __overlayRegionPixelFomatList[0] = set; return E_SUCCESS; } -int -_OverlayRegionImpl::GetWidthUnit(void) -{ - ClearLastResult(); - - if (_OverlayRegionImpl::overlayRegionWidthUnit == -1) - { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; - - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); - - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayRegionWidthUnit", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); - - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); - - _OverlayRegionImpl::overlayRegionWidthUnit = val; - - SysLog(NID_UI_CTRL, "overlayRegionWidthUnit : %d", _OverlayRegionImpl::overlayRegionWidthUnit); - } - - SetLastResult(E_SUCCESS); - - return _OverlayRegionImpl::overlayRegionWidthUnit; -} - -int -_OverlayRegionImpl::GetHeightUnit(void) +IListT* +_OverlayRegionImpl::GetSupportedBufferPixelFormatListN(void) { - ClearLastResult(); + result r = E_SUCCESS; - if (_OverlayRegionImpl::overlayRegionHeightUnit == -1) + if (!_OverlayRegionImpl::__overlayRegionPixelFomatList[0]) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; - - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); - - r = _reg.GetValue(_UI_INFO_SESSION, L"OverlayRegionHeightUnit", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); - - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); - - _OverlayRegionImpl::overlayRegionHeightUnit = val; - - SysLog(NID_UI_CTRL, "overlayRegionHeightUnit : %d", _OverlayRegionImpl::overlayRegionHeightUnit); + r = _OverlayRegionImpl::SetPixelFormatList(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); } - SetLastResult(E_SUCCESS); + std::unique_ptr< ArrayListT > pFormatList( new (std::nothrow) ArrayListT()); + SysTryReturn(NID_UI_CTRL, pFormatList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] failed to create a list instance"); - return _OverlayRegionImpl::overlayRegionHeightUnit; -} + r = pFormatList->Construct(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); -int -_OverlayRegionImpl::GetMaxCount(void) -{ - ClearLastResult(); - - if (_OverlayRegionImpl::overlayRegionMaxCount == -1) + for (int index = 0; index < _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX; index++) { - result r = E_SUCCESS; - _RegistryImpl _reg; - String value; - int val; - - r = _reg.Construct(_UI_REGISTRY_PATH, REG_OPEN_READ_ONLY, null); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] RegistryImpl construct Failed"); - - r = _reg.GetValue(_UI_INFO_SESSION, L"MaxOverlayRegionCount", value); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Registry GetValue Failed"); - - r = Integer::Parse(value, val); - SysTryReturn(NID_UI_CTRL, !IsFailed(r), -1, E_SYSTEM, "[E_SYSTEM] Parse Failed"); - - _OverlayRegionImpl::overlayRegionMaxCount = val; - - SysLog(NID_UI_CTRL, "overlayRegionMaxCount : %d", _OverlayRegionImpl::overlayRegionMaxCount); + if (_OverlayRegionImpl::__overlayRegionPixelFomatList[index + 1]) + { + r = pFormatList->Add(static_cast(index)); + } } + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - SetLastResult(E_SUCCESS); - - return _OverlayRegionImpl::overlayRegionMaxCount; + return pFormatList.release(); } - _OverlayRegionImpl* +_OverlayRegionImpl* _OverlayRegionImpl::GetInstance(OverlayRegion& overlayRegion) { return (&overlayRegion != null) ? overlayRegion.__pOverlayRegionImpl : null; @@ -812,7 +719,7 @@ _OverlayRegionImpl::GetInstance(const OverlayRegion& overlayRegion) } } } // Tizen::Ui::Controls -////////////////////////////////////////////////////////////////////////////////////// + namespace { @@ -831,50 +738,29 @@ _OverlayRegionMediaCapability::~_OverlayRegionMediaCapability(void) result _OverlayRegionMediaCapability::Construct(void) { - result r = E_SUCCESS; - long long length = 0; - int readLen = 0; - char* pXmlBuffer = null; - Tizen::Base::String key; - Tizen::Base::String fileName; - FileAttributes attributes; - File fileObj; + String fileName = _MEDIA_CAPABILITY_FILE_PATH; - fileName = _MEDIA_CAPABILITY_FILE_PATH; - SysLog(NID_UI_CTRL, "Capability XML path:%ls", fileName.GetPointer()); - - r = File::GetAttributes(fileName, attributes); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r) ); + FileAttributes attributes; + result r = File::GetAttributes(fileName, attributes); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - length = attributes.GetFileSize(); - SysTryReturnResult(NID_UI_CTRL, length > 0, E_SYSTEM, "[E_SYSTEM] the file[%s] size is zero.", fileName.GetPointer()); + long long length = attributes.GetFileSize(); + SysTryReturnResult(NID_UI_CTRL, length > 0, E_SYSTEM, "[E_SYSTEM] The size of file(%s) is zero.", fileName.GetPointer()); - pXmlBuffer = new (std::nothrow) char[length]; + std::unique_ptr pXmlBuffer(new (std::nothrow) char[length]); SysTryReturnResult(NID_UI_CTRL, pXmlBuffer != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pXmlBuffer is null"); + File fileObj; r = fileObj.Construct(fileName, L"r"); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - -// read the capability xml file content as parse the capability - readLen = fileObj.Read(pXmlBuffer, length); - SysTryCatch(NID_UI_CTRL, readLen == length, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] length:%d, readLen:%d", length, readLen); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); -// parse the capability file buffer all the parse key value pair shall be added in __pMap object - r = ParseCapability(pXmlBuffer, readLen); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - if (pXmlBuffer) - { - delete[] pXmlBuffer; - } - - return E_SUCCESS; + //read the capability xml file content as parse the capability + int readLen = fileObj.Read(pXmlBuffer.get(), length); + SysTryReturnResult(NID_UI_CTRL, readLen == length, E_SYSTEM, "[E_SYSTEM] Failed to read xml file. (length is %d and readLen is %d)", length, readLen); -CATCH: - if (pXmlBuffer) - { - delete[] pXmlBuffer; - } + //parse the capability file buffer all the parse key value pair shall be added in __pMap object + r = ParseCapability(pXmlBuffer.get(), readLen); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); return r; } @@ -895,16 +781,18 @@ _OverlayRegionMediaCapability::ParseSection(xmlNodePtr pRoot, const String& sect { if (key.Equals(String(_CAM_PRIMARY_DIRECTION))) { - //SysLog(NID_UI_CTRL,"@@@@@ key:%ls, %s", key.GetPointer(), (wchar_t*)pNode->children->content); String direction((char*)pNode->children->content); if (direction.Equals(String("Back"))) - cameraPrimaryDirection = 2;//CAMERA_DIRECTION_BACK; + { + cameraPrimaryDirection = 2; //CAMERA_DIRECTION_BACK; + } else - cameraPrimaryDirection = 1;//CAMERA_DIRECTION_FRONT; + { + cameraPrimaryDirection = 1; //CAMERA_DIRECTION_FRONT; + } } else if (key.Equals(String(_CAM_PRIMARY_ROTATION))) { - //SysLog(NID_UI_CTRL,"@@@@@ key:%ls, %s", key.GetPointer(), (wchar_t*)pNode->children->content ); String rot((char*)pNode->children->content); int ret = 0 ; Integer::Decode(rot, ret); @@ -912,16 +800,18 @@ _OverlayRegionMediaCapability::ParseSection(xmlNodePtr pRoot, const String& sect } else if (key.Equals(String(_CAM_SECONDARY_DIRECTION))) { - //SysLog(NID_UI_CTRL,"@@@@@ key:%ls, %s", key.GetPointer(), (wchar_t*)pNode->children->content ); String direction((char*)pNode->children->content); if (direction.Equals(String("Back"))) - cameraSecondaryDirection = 2;//CAMERA_DIRECTION_BACK; + { + cameraSecondaryDirection = 2; //CAMERA_DIRECTION_BACK; + } else - cameraSecondaryDirection = 1;//CAMERA_DIRECTION_FRONT; + { + cameraSecondaryDirection = 1; //CAMERA_DIRECTION_FRONT; + } } else if (key.Equals(String(_CAM_SECONDARY_ROTATION))) { - //SysLog(NID_UI_CTRL,"@@@@@ key:%ls, %s", key.GetPointer(), (wchar_t*)pNode->children->content ); String rot((char*)pNode->children->content); int ret = 0 ; Integer::Decode(rot, ret); @@ -936,22 +826,16 @@ _OverlayRegionMediaCapability::ParseSection(xmlNodePtr pRoot, const String& sect result _OverlayRegionMediaCapability::ParseCapability(const char* xmlBuffer, int length) { - xmlDoc* pDoc = null; - xmlNode* pRoot = null; - xmlNode* pNode = null; - - result r = E_SUCCESS; - String name; - - pDoc = xmlParseMemory(xmlBuffer, length); + std::unique_ptr pDoc(xmlParseMemory(xmlBuffer, length)); SysTryReturnResult(NID_UI_CTRL, pDoc != null, E_SYSTEM, "[E_SYSTEM] xmlParseMemory failed %s %d", xmlBuffer, length); - pRoot = xmlDocGetRootElement(pDoc); - SysTryCatch(NID_UI_CTRL, pRoot != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] xmlDocGetRootElement failed"); + xmlNode* pRoot = xmlDocGetRootElement(pDoc.get()); + SysTryReturnResult(NID_UI_CTRL, pRoot != null, E_SYSTEM, "[E_SYSTEM] xmlDocGetRootElement failed"); - name = (const char*) (pRoot->name); - SysTryCatch(NID_UI_CTRL, name.Equals("MediaCapability", true), r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Invalid Root Name %ls", name.GetPointer()); + String name = (const char*) (pRoot->name); + SysTryReturnResult(NID_UI_CTRL, name.Equals("MediaCapability", true), E_SYSTEM, "[E_SYSTEM] Invalid Root Name %ls", name.GetPointer()); + xmlNode* pNode = null; for (pNode = pRoot->children; pNode; pNode = pNode->next) { if (pNode->type == XML_ELEMENT_NODE) @@ -961,16 +845,7 @@ _OverlayRegionMediaCapability::ParseCapability(const char* xmlBuffer, int length } } - xmlFreeDoc(pDoc); return E_SUCCESS; - -CATCH: - if (pDoc) - { - xmlFreeDoc(pDoc); - } - - return r; } } diff --git a/src/ui/controls/FUiCtrl_Panel.cpp b/src/ui/controls/FUiCtrl_Panel.cpp index c31ce86..4591350 100644 --- a/src/ui/controls/FUiCtrl_Panel.cpp +++ b/src/ui/controls/FUiCtrl_Panel.cpp @@ -25,10 +25,11 @@ #include #include #include +#include "FUi_AccessibilityContainer.h" +#include "FUi_DataBindingContext.h" #include "FUi_ResourceManager.h" #include "FUiAnim_VisualElement.h" #include "FUiCtrl_Panel.h" -#include "FUi_DataBindingContext.h" using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -47,7 +48,7 @@ _Panel::_Panel(void) , __backgroundBitmapVerticalAlign(PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_MIDDLE) , __pBackgroundBitmap(null) { - // Nothing + GetAccessibilityContainer()->Activate(true); } _Panel::~_Panel(void) @@ -66,7 +67,7 @@ _Panel::~_Panel(void) } _Panel* -_Panel::CreatePanelN(const Rectangle& rect, GroupStyle groupStyle) +_Panel::CreatePanelN(const FloatRectangle& rect, GroupStyle groupStyle) { ClearLastResult(); result r = E_SUCCESS; @@ -87,6 +88,13 @@ _Panel::CreatePanelN(const Rectangle& rect, GroupStyle groupStyle) r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + if (groupStyle != GROUP_STYLE_NONE) + { + Color defaultGroupStyleBackgroundColor = 0x00000000; + GET_COLOR_CONFIG(PANEL::GROUPED_STYLE_BG_NORMAL, defaultGroupStyleBackgroundColor); + pPanel->SetBackgroundColor(defaultGroupStyleBackgroundColor); + } + pPanel->AcquireHandle(); return pPanel; @@ -123,8 +131,6 @@ _Panel::Initialize(const _PanelPresenter& presenter) SetDataBindingContext(pContext); - SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_NORMAL); - return r; CATCH: @@ -156,7 +162,7 @@ _Panel::OnDraw(void) } void -_Panel::SetBackgroundColor(const Tizen::Graphics::Color& color) +_Panel::SetBackgroundColor(const Color& color) { ClearLastResult(); @@ -197,27 +203,27 @@ _Panel::SetGroupStyle(GroupStyle groupStyle) switch (__groupStyle) { case GROUP_STYLE_TOP: - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); break; case GROUP_STYLE_MIDDLE: - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); break; case GROUP_STYLE_BOTTOM: - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); break; case GROUP_STYLE_SINGLE: - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(Panel::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pGroupStyleBackgroundBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); break; case GROUP_STYLE_NONE: diff --git a/src/ui/controls/FUiCtrl_PanelImpl.cpp b/src/ui/controls/FUiCtrl_PanelImpl.cpp index 2d18939..583b14c 100644 --- a/src/ui/controls/FUiCtrl_PanelImpl.cpp +++ b/src/ui/controls/FUiCtrl_PanelImpl.cpp @@ -25,6 +25,7 @@ #include #include #include "FUi_LayoutImpl.h" +#include "FUi_LayoutLayoutMaker.h" #include "FUi_DataBindingContextImpl.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_PanelImpl.h" @@ -47,7 +48,7 @@ _PanelImpl::~_PanelImpl(void) } _PanelImpl* -_PanelImpl::CreatePanelImplN(Panel* pControl, const Rectangle& rect, GroupStyle groupStyle, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) +_PanelImpl::CreatePanelImplN(Panel* pControl, const FloatRectangle& rect, GroupStyle groupStyle, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) { ClearLastResult(); @@ -169,9 +170,9 @@ _PanelImpl::OnAttachedToMainTree(void) { SetFocusable(false); - Rectangle builderBounds; + FloatRectangle builderBounds; _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT; - bool exist = GetBuilderBounds(controlOrientation, builderBounds); + bool exist = GetBuilderBoundsF(controlOrientation, builderBounds); if (exist) { @@ -199,7 +200,7 @@ _PanelImpl::OnAttachedToMainTree(void) || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE) { controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE; - GetBuilderBounds(controlOrientation, builderBounds); + GetBuilderBoundsF(controlOrientation, builderBounds); } SetBounds(builderBounds); SetChildBuilderBouds(this, controlOrientation); @@ -214,12 +215,12 @@ _PanelImpl::OnAttachedToMainTree(void) void _PanelImpl::SetChildBuilderBouds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation) { - Rectangle builderBounds; + FloatRectangle builderBounds; _ContainerImpl* pTempContainerImpl; for(int i = 0; i < pContainerImpl->GetChildCount(); i++) { _ControlImpl* pControlImpl = pContainerImpl->GetChild(i); - pControlImpl->GetBuilderBounds(controlOrientation, builderBounds); + pControlImpl->GetBuilderBoundsF(controlOrientation, builderBounds); pControlImpl->SetBounds(builderBounds); pTempContainerImpl = dynamic_cast<_ContainerImpl*>(pControlImpl); if (pTempContainerImpl != null) @@ -259,7 +260,7 @@ protected: result r = E_SYSTEM; _UiBuilderControlLayout* pControlProperty = null; Panel* pPanel = null; - Rectangle rect; + FloatRectangle rect; Tizen::Base::String elementString; int opacity = 0; Color color; @@ -280,7 +281,7 @@ protected: pPanel = new (std::nothrow) Panel(); } SysTryReturn(NID_UI_CTRL, pPanel != null, null, E_OUT_OF_MEMORY, "[%s] UiBuilder failed to create Panel object.", GetErrorMessage(E_OUT_OF_MEMORY)); - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); if (pControl->GetElement(L"groupStyle", elementString) || pControl->GetElement(L"GroupStyle", elementString)) { @@ -308,7 +309,7 @@ protected: // Construct _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - GetLayoutType(pControlProperty, layoutType); + __pLayoutMaker->GetLayoutType(pControlProperty, layoutType); if (layoutType == UIBUILDER_LAYOUT_NONE) { r = pPanel->Construct(rect, panelGroupStyle); @@ -318,7 +319,7 @@ protected: Layout* pPortraitLayout = null; Layout* pLandscapeLayout = null; result tempResult = E_SUCCESS; - tempResult = GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); + tempResult = __pLayoutMaker->GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); if (E_SUCCESS == tempResult) { r = pPanel->Construct(*pPortraitLayout, *pLandscapeLayout, rect, panelGroupStyle); @@ -329,7 +330,7 @@ protected: } _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - if (GetLayoutType(pControlProperty, layoutType) == false) + if (__pLayoutMaker->GetLayoutType(pControlProperty, layoutType) == false) { delete pPanel; return null; @@ -350,7 +351,7 @@ protected: { pGridLayout = dynamic_cast(pLandscapeLayout); } - SetGridLayoutContainerProperty(pGridLayout, pControlProperty); + __pLayoutMaker->SetGridLayoutContainerProperty(pGridLayout, pControlProperty); } } delete pPortraitLayout; diff --git a/src/ui/controls/FUiCtrl_PanelPresenter.cpp b/src/ui/controls/FUiCtrl_PanelPresenter.cpp index 104a9c3..f07a1e3 100644 --- a/src/ui/controls/FUiCtrl_PanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PanelPresenter.cpp @@ -25,8 +25,8 @@ #include #include #include -#include "FUiAnim_VisualElement.h" #include "FUi_ResourceManager.h" +#include "FUiAnim_VisualElement.h" #include "FUiCtrl_PanelPresenter.h" #include "FUiCtrl_Panel.h" @@ -64,21 +64,15 @@ _PanelPresenter::Draw(void) return E_SUCCESS; } + bool customBackground = false; + Canvas* pCanvas = __pPanel->GetVisualElement()->GetCanvasN(); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - if (__pPanel->GetGroupStyle() == GROUP_STYLE_NONE) - { - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); - } - else - { - Color panelGroupBackgroundColor; - GET_COLOR_CONFIG(Panel::BG_NORMAL, panelGroupBackgroundColor); - pCanvas->SetBackgroundColor(panelGroupBackgroundColor); - } + pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -93,9 +87,30 @@ _PanelPresenter::Draw(void) r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - DrawGroupStyleBitmap(pCanvas); - r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + switch (__pPanel->GetGroupStyle()) + { + case GROUP_STYLE_TOP: + customBackground = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_NORMAL); + break; + case GROUP_STYLE_MIDDLE: + customBackground = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_NORMAL); + break; + case GROUP_STYLE_BOTTOM: + customBackground = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_NORMAL); + break; + case GROUP_STYLE_SINGLE: + customBackground = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_NORMAL); + break; + default: + break; + } + + if (!customBackground) + { + DrawGroupStyleBitmap(pCanvas); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } // fall throw CATCH: @@ -111,9 +126,9 @@ _PanelPresenter::DrawBackgrounBitmap(Canvas* pCanvas) if (pBackgroundBitmap != null) { - Rectangle bounds = __pPanel->GetBounds(); - bounds.x = 0; - bounds.y = 0; + FloatRectangle bounds = __pPanel->GetBoundsF(); + bounds.x = 0.0f; + bounds.y = 0.0f; if (!__pPanel->IsBackgroundBitmapStretch()) { @@ -126,7 +141,7 @@ _PanelPresenter::DrawBackgrounBitmap(Canvas* pCanvas) bounds.x = bounds.width - bitmapWidth; break; case PANEL_BACKGROUND_BITMAP_HORIZONTAL_ALIGN_CENTER: - bounds.x = (bounds.width / 2) - (bitmapWidth / 2); + bounds.x = (bounds.width / 2.0f) - (bitmapWidth / 2.0f); break; case PANEL_BACKGROUND_BITMAP_HORIZONTAL_ALIGN_LEFT: // fall through @@ -140,7 +155,7 @@ _PanelPresenter::DrawBackgrounBitmap(Canvas* pCanvas) bounds.y = bounds.height - bitmapHeight; break; case PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_MIDDLE: - bounds.y = (bounds.height / 2) - (bitmapHeight / 2); + bounds.y = (bounds.height / 2.0f) - (bitmapHeight / 2.0f); break; case PANEL_BACKGROUND_BITMAP_VERTICAL_ALIGN_TOP: // fall through @@ -176,9 +191,9 @@ _PanelPresenter::DrawGroupStyleBitmap(Canvas* pCanvas) if (pGroupStyleBitmap != null) { - Rectangle bounds = __pPanel->GetBounds(); - bounds.x = 0; - bounds.y = 0; + FloatRectangle bounds = __pPanel->GetBoundsF(); + bounds.x = 0.0f; + bounds.y = 0.0f; pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pGroupStyleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pPanel->GetBackgroundColor()); if (pColorReplacedBitmap != null) @@ -213,9 +228,9 @@ _PanelPresenter::DrawGroupStyleBackgroundBitmap(Tizen::Graphics::Canvas* pCanvas if (pGroupStyleBackgroundBitmap != null) { - Rectangle bounds = __pPanel->GetBounds(); - bounds.x = 0; - bounds.y = 0; + FloatRectangle bounds = __pPanel->GetBoundsF(); + bounds.x = 0.0f; + bounds.y = 0.0f; pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pGroupStyleBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pPanel->GetBackgroundColor()); r = GetLastResult(); diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp old mode 100644 new mode 100755 index 4efb769..593bc01 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -26,6 +26,7 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ModalLoopManager.h" #include "FUi_ResourceManager.h" #include "FUi_DataBindingContext.h" @@ -57,7 +58,7 @@ _Popup::_Popup(void) , _pDimmingLayer(null) , _pTitleTextAccessibilityElement(null) , __pPopupPresenter(null) - , __bounds(0, 0, 0, 0) + , __bounds(0.0f, 0.0f, 0.0f, 0.0f) , __popupResult(POPUP_RESULT_NONE) { // empty statement @@ -68,7 +69,7 @@ _Popup::~_Popup(void) _Control* pOwner = GetOwner(); if (pOwner != null) { - pOwner->SetInputEnableState(_ownerEnableState); + pOwner->SetInputEventEnableState(_ownerEnableState); } ReleaseTouchCapture(); @@ -101,25 +102,21 @@ _Popup::CreatePopupN(void) _Popup* pPopup = new (std::nothrow) _Popup(); SysTryReturn(NID_UI_CTRL, pPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -#if defined(MULTI_WINDOW) result r = pPopup->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif // for taking touch event pPopup->AcquireHandle(); - + return pPopup; -#if defined(MULTI_WINDOW) CATCH: delete pPopup; return null; -#endif } result -_Popup::Initialize(bool hasTitle, const Tizen::Graphics::Rectangle& bounds) +_Popup::Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds) { result r = E_SUCCESS; @@ -160,6 +157,8 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::Rectangle& bounds) r = GetVisualElement()->SetSurfaceOpaque(false); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + GetVisualElement()->SetClipChildrenEnabled(true); + //create data binding context _DataBindingContext* pContext = new (std::nothrow) _DataBindingContext(*this); SysTryCatch(NID_UI_CTRL, pContext != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -172,6 +171,7 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::Rectangle& bounds) if(pContainer != null) { pContainer->Activate(true); + InitializeAccessibilityElement(); } return r; @@ -230,30 +230,30 @@ _Popup::HasTitle(void) const return _titleState; } -Point -_Popup::TranslateFromClientAreaPosition(const Point& clientPosition) const +FloatPoint +_Popup::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const { - Rectangle leftTop = GetClientBounds(); + FloatRectangle leftTop = GetClientBoundsF(); result r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Point(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatPoint(-1.0f, -1.0f), r, "[%s] Propagating.", GetErrorMessage(r)); - return Point(clientPosition.x + leftTop.x, clientPosition.y + leftTop.y); + return FloatPoint(clientPosition.x + leftTop.x, clientPosition.y + leftTop.y); } -Point -_Popup::TranslateToClientAreaPosition(const Point& position) const +FloatPoint +_Popup::TranslateToClientAreaPosition(const FloatPoint& position) const { - Rectangle leftTop = GetClientBounds(); + FloatRectangle leftTop = GetClientBoundsF(); result r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Point(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatPoint(-1.0f, -1.0f), r, "[%s] Propagating.", GetErrorMessage(r)); - return Point(position.x - leftTop.x, position.y - leftTop.y); + return FloatPoint(position.x - leftTop.x, position.y - leftTop.y); } Canvas* _Popup::GetClientAreaCanvasN(void) const { - Canvas* pCanvas = GetCanvasN(GetClientBounds()); + Canvas* pCanvas = GetCanvasN(GetClientBoundsF()); if ((pCanvas == null) || (GetLastResult() != E_SUCCESS)) { SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -311,7 +311,7 @@ _Popup::SetTitleText(const String& title) if (_pTitleTextAccessibilityElement != null) { - _pTitleTextAccessibilityElement->SetLabel(title); + _pTitleTextAccessibilityElement->SetLabel(title); } return E_SUCCESS; @@ -340,45 +340,48 @@ _Popup::GetOutlineBitmap(void) const return _pOutlineBitmap; } -Rectangle +FloatRectangle _Popup::GetPopupClientArea(void) const { - int x = 0; - int y = 0; - int width = 0; - int height = 0; + float x = 0.0f; + float y = 0.0f; + float width = 0.0f; + float height = 0.0f; + + float titleHeight = 0.0f; + float titleLetfMargin = 0.0f; + float titleRightMargin = 0.0f; - int titleHeight = 0; - int titleLetfMargin = 0; - int titleRightMargin = 0; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + _ControlOrientation orientation; + orientation = GetOrientation(); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, GetOrientation(), titleLetfMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, GetOrientation(), titleRightMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, GetOrientation(), transRightMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); x = titleLetfMargin; - width = GetBounds().width - (titleLetfMargin + titleRightMargin); + width = GetBoundsF().width - (titleLetfMargin + titleRightMargin); if (HasTitle() == false) { - titleHeight = 0; + titleHeight = 0.0f; } y = titleHeight; - height = GetBounds().height - y; + height = GetBoundsF().height - y; - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); } _AccessibilityElement* @@ -393,7 +396,10 @@ _Popup::OnDraw(void) __pPopupPresenter->OnDraw(); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - + if(unlikely((_AccessibilityManager::IsActivated()))) + { + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); + } return; } @@ -429,8 +435,11 @@ _Popup::OnActivated(void) if (GetVisibleState()) { - r = _pDimmingLayer->SetDimmingEnabled(true); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + if (_pDimmingLayer->GetDimmingEnabled() == false) + { + r = _pDimmingLayer->SetDimmingEnabled(true); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } SetTouchCapture(); } @@ -443,7 +452,7 @@ _Popup::OnActivated(void) if (GetOwner() == null) { _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); - SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM,"[E_SYSTEM] This instance is not constructed."); + SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); _Form* pForm = pFrame->GetCurrentForm(); if (pForm != null) @@ -461,7 +470,7 @@ _Popup::OnActivated(void) if (pOwner != null) { _ownerEnableState = pOwner->GetInputEnableState(); - pOwner->SetInputEnableState(false); + pOwner->SetInputEventEnableState(false); } _Window::OnActivated(); @@ -472,20 +481,18 @@ _Popup::OnDeactivated(void) { SysTryReturnVoidResult(NID_UI_CTRL, _pDimmingLayer != null, E_SYSTEM, "[E_SYSTEM] There is no Dimming Layer."); -#if !defined(MULTI_WINDOW) result r = E_SUCCESS; - if (IsAttached() == false) + if (_pDimmingLayer->GetDimmingEnabled()) { r = _pDimmingLayer->SetDimmingEnabled(false); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } -#endif _Control* pOwner = GetOwner(); if (pOwner != null) { - pOwner->SetInputEnableState(_ownerEnableState); + pOwner->SetInputEventEnableState(_ownerEnableState); } ReleaseTouchCapture(); @@ -524,36 +531,23 @@ _Popup::OnAttachedToMainTree(void) SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'"); - InitializeAccessibilityElement(); - return E_SUCCESS; } void _Popup::InitializeAccessibilityElement(void) { - if (likely(!(_AccessibilityManager::IsActivated()))) - { - return; - } - - if (_pTitleTextAccessibilityElement != null) - { - return; - } - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); if (pContainer != null) { - int titleHeight = 0; + float titleHeight = 0.0f; GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); _pTitleTextAccessibilityElement->Construct(L"PopupTitleText", __pPopupPresenter->GetTitleTextBounds()); _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); - _pTitleTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + _pTitleTextAccessibilityElement->SetTrait(L"Popup Title"); pContainer->AddElement(*_pTitleTextAccessibilityElement); @@ -591,7 +585,6 @@ void _Popup::OnBoundsChanged(void) { SetClientBounds(GetPopupClientArea()); - if (__pPopupPresenter != null) { __pPopupPresenter->UpdateEffectBounds(); @@ -599,28 +592,24 @@ _Popup::OnBoundsChanged(void) if (_pTitleTextAccessibilityElement != null) { - int titleHeight = 0; + float titleHeight = 0.0f; GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - _pTitleTextAccessibilityElement->SetBounds(Rectangle(0, 0, GetPopupClientArea().width, titleHeight)); + _pTitleTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetPopupClientArea().width, titleHeight)); } } -#if defined(MULTI_WINDOW) result _Popup::OnBoundsChanging(const Rectangle& bounds) { - // Full-screen window return E_SUCCESS; } bool _Popup::IsLayoutChangable(void) const { - // Full-screen window return true; } -#endif bool _Popup::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) diff --git a/src/ui/controls/FUiCtrl_PopupImpl.cpp b/src/ui/controls/FUiCtrl_PopupImpl.cpp index d2203b4..160ac4d 100644 --- a/src/ui/controls/FUiCtrl_PopupImpl.cpp +++ b/src/ui/controls/FUiCtrl_PopupImpl.cpp @@ -23,6 +23,9 @@ #include #include +#include +#include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUi_DataBindingContextImpl.h" #include "FUi_ResourceSizeInfo.h" @@ -44,11 +47,11 @@ namespace Tizen { namespace Ui { namespace Controls { -Dimension -_PopupImpl::PopupSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const +FloatDimension +_PopupImpl::PopupSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const { result r = E_SUCCESS; - Dimension dimension(0, 0); + FloatDimension dimension(0, 0); r = GET_DIMENSION_CONFIG(POPUP::MIN_SIZE, orientation, dimension); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); @@ -57,20 +60,6 @@ _PopupImpl::PopupSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation return dimension; } -Dimension -_PopupImpl::PopupSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - Dimension dimension(0, 0); - - r = GET_DIMENSION_CONFIG(POPUP::MAX_SIZE, orientation, dimension); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); - - SetLastResult(r); - - return dimension; -} - _PopupImpl* _PopupImpl::GetInstance(Popup& pPopup) { @@ -86,8 +75,8 @@ _PopupImpl::GetInstance(const Popup& pPopup) _PopupImpl::_PopupImpl(Popup* pPublic, _Popup* pCore, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) : _WindowImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout) , _isModal(false) + , _centerAlign(false) , __init(false) - , __centerAlign(false) , __callBoundsChange(false) { //empty statement @@ -99,11 +88,11 @@ _PopupImpl::~_PopupImpl(void) } _PopupImpl* -_PopupImpl::CreatePopupImplN(Popup* pControl, const Tizen::Graphics::Dimension& dim, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) +_PopupImpl::CreatePopupImplN(Popup* pControl, const Tizen::Graphics::FloatDimension& dim, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) { result r = E_SUCCESS; - r = GET_SIZE_INFO(Popup).CheckInitialSizeValid(dim, _ControlManager::GetInstance()->GetOrientation()); + r = GET_SIZE_INFO(Popup).CheckInitialSizeValidF(dim, _CONTROL_ORIENTATION_PORTRAIT); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The given size is not valid."); _PopupImpl* pImpl = null; @@ -116,7 +105,7 @@ _PopupImpl::CreatePopupImplN(Popup* pControl, const Tizen::Graphics::Dimension& r = CheckConstruction(pCore, pImpl); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(Popup), dim, _ControlManager::GetInstance()->GetOrientation()); + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Popup), dim, pCore->GetOrientation()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); ClearLastResult(); @@ -130,31 +119,31 @@ CATCH: } result -_PopupImpl::Initialize(bool hasTitle, const Tizen::Graphics::Dimension& dim) +_PopupImpl::Initialize(bool hasTitle, const Tizen::Graphics::FloatDimension& dim) { result r = E_SUCCESS; if (hasTitle) { - Dimension minSize(0, 0); + FloatDimension minSize(0.0f, 0.0f); - r = GET_DIMENSION_CONFIG(POPUP::MIN_SIZE_WITH_TITLE, _ControlManager::GetInstance()->GetOrientation(), minSize); + r = GET_DIMENSION_CONFIG(POPUP::MIN_SIZE_WITH_TITLE, GetCore().GetOrientation(), minSize); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] A system error occurred.", GetErrorMessage(r)); SysTryReturn(NID_UI_CTRL, (minSize.width <= dim.width && minSize.height <= dim.height), E_INVALID_ARG, - E_INVALID_ARG, "[E_INVALID_ARG] The size is out of minium size(%d, %d)", - minSize.width, minSize.width); + E_INVALID_ARG, "[E_INVALID_ARG] The size is out of minimum size(%f, %f)", + minSize.width, minSize.height); r = GetCore().SetMinimumSize(minSize); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] SetMinimumSize is failed.", GetErrorMessage(r)); } - Rectangle bounds = GetCenterAlignedRect(dim.width, dim.height); + FloatRectangle bounds = GetCenterAlignedRect(dim.width, dim.height); __init = true; - __centerAlign = true; + _centerAlign = true; r = SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -192,31 +181,33 @@ _PopupImpl::GetCore(void) return static_cast <_Popup&>(_ControlImpl::GetCore()); } -Rectangle -_PopupImpl::GetCenterAlignedRect(int width, int height) const +FloatRectangle +_PopupImpl::GetCenterAlignedRect(float width, float height) const { - int x = 0; - int y = 0; + float x = 0.0f; + float y = 0.0f; - Dimension screenRect = _ControlManager::GetInstance()->GetScreenSize(); + _ControlManager* pControlManager = _ControlManager::GetInstance(); + + FloatDimension screenRect = pControlManager->GetScreenSizeF(); if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) { - int temp = screenRect.width; + float temp = screenRect.width; screenRect.width = screenRect.height; screenRect.height = temp; } - x = (screenRect.width - width) / 2; - y = (screenRect.height - height) / 2; + x = (screenRect.width - width) / 2.0f; + y = (screenRect.height - height) / 2.0f; - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); } -Rectangle +FloatRectangle _PopupImpl::GetClientAreaBounds(void) const { - return _ControlImpl::GetClientBounds(); + return _ControlImpl::GetClientBoundsF(); } Canvas* @@ -225,14 +216,14 @@ _PopupImpl::GetClientAreaCanvasN(void) const return GetCore().GetClientAreaCanvasN(); } -Point -_PopupImpl::TranslateFromClientAreaPosition(const Point& clientPosition) const +FloatPoint +_PopupImpl::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) const { return GetCore().TranslateFromClientAreaPosition(clientPosition); } -Point -_PopupImpl::TranslateToClientAreaPosition(const Point& position) const +FloatPoint +_PopupImpl::TranslateToClientAreaPosition(const FloatPoint& position) const { return GetCore().TranslateToClientAreaPosition(position); } @@ -297,77 +288,57 @@ _PopupImpl::GetTitleTextColor() const return GetCore().GetTitleTextColor(); } -int -_PopupImpl::GetMinWidth(void) const -{ - Dimension dimMin(0, 0); - - GET_DIMENSION_CONFIG(POPUP::MIN_SIZE, GetCore().GetOrientation(), dimMin); - - return dimMin.width; -} - -int -_PopupImpl::GetMinHeight(void) const +DataBindingContext* +_PopupImpl::GetDataBindingContextN(void) const { - Dimension dimMin(0, 0); - - GET_DIMENSION_CONFIG(POPUP::MIN_SIZE, GetCore().GetOrientation(), dimMin); - - return dimMin.height; + return Tizen::Ui::_DataBindingContextImpl::GetDataBindingContextN(*this); } -int -_PopupImpl::GetMaxWidth(void) const +bool +_PopupImpl::GetXmlBounds(Tizen::Graphics::FloatRectangle& rect) { - Dimension dimMax(0, 0); - - GET_DIMENSION_CONFIG(POPUP::MAX_SIZE, GetCore().GetOrientation(), dimMax); + Rectangle builderBounds; + _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT; + bool exist = GetBuilderBounds(controlOrientation, builderBounds); + if(!exist) + { + return false; + } - return dimMax.width; -} + _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance(); + OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this); -int -_PopupImpl::GetMaxHeight(void) const -{ - Dimension dimMax(0, 0); + if (orientation == ORIENTATION_STATUS_LANDSCAPE + || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE) + { + controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE; + this->GetBuilderBounds(controlOrientation, builderBounds); + } - GET_DIMENSION_CONFIG(POPUP::MAX_SIZE, GetCore().GetOrientation(), dimMax); + rect = _CoordinateSystemUtils::ConvertToFloat(builderBounds); - return dimMax.height; + return true; } - -DataBindingContext* -_PopupImpl::GetDataBindingContextN(void) const -{ - return Tizen::Ui::_DataBindingContextImpl::GetDataBindingContextN(*this); -} - void _PopupImpl::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - Dimension newMaxSize(0, 0); - Dimension maxSize = GetCore().GetMaximumSize(); - - r = GET_DIMENSION_CONFIG(POPUP::MAX_SIZE, orientation, newMaxSize); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] A system error occurred.", GetErrorMessage(r)); - - if (maxSize.width == newMaxSize.height && maxSize.height == newMaxSize.width) - { - r = GetCore().SetMaximumSize(newMaxSize); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] SetMinimumSize is failed.", GetErrorMessage(r)); - } - if (!__callBoundsChange) { - Rectangle bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height); - __centerAlign = true; + FloatRectangle bounds; + _centerAlign = true; + if(GetXmlBounds(bounds)) + { + bounds = GetCenterAlignedRect(bounds.width, bounds.height); + } + else + { + bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height); + } r = SetBounds(bounds); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - } return GetCore().OnChangeLayout(orientation); @@ -376,14 +347,13 @@ _PopupImpl::OnChangeLayout(_ControlOrientation orientation) void _PopupImpl::OnBoundsChanged(void) { - Rectangle rect = GetBounds(); - + FloatRectangle rect = GetBoundsF(); if (__init) { - if (__centerAlign) + if (_centerAlign) { - rect = GetCenterAlignedRect(GetSize().width, GetSize().height); - __centerAlign = false; + rect = GetCenterAlignedRect(GetSizeF().width, GetSizeF().height); + _centerAlign = false; } else { @@ -391,12 +361,13 @@ _PopupImpl::OnBoundsChanged(void) } } -#if !defined(MULTI_WINDOW) - result r = SetBounds(rect, false); -#else - result r = SetBounds(rect, true); -#endif + if(GetXmlBounds(rect)) + { + rect = GetCenterAlignedRect(rect.width, rect.height); + } + + result r = SetBounds(rect, true); if (IsFailed(r)) { // Error propagation fall through @@ -474,7 +445,7 @@ protected: // } _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - GetLayoutType(pControlProperty, layoutType); + __pLayoutMaker->GetLayoutType(pControlProperty, layoutType); if (layoutType == UIBUILDER_LAYOUT_NONE) { @@ -486,7 +457,7 @@ protected: Layout* pLandscapeLayout = null; result tempResult = E_SUCCESS; - tempResult = GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); + tempResult = __pLayoutMaker->GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); if (E_SUCCESS == tempResult) { @@ -499,7 +470,7 @@ protected: _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; - if (GetLayoutType(pControlProperty, layoutType) == false) + if (__pLayoutMaker->GetLayoutType(pControlProperty, layoutType) == false) { return null; } @@ -519,7 +490,7 @@ protected: { pGridLayout = dynamic_cast(pLandscapeLayout); } - SetGridLayoutContainerProperty(pGridLayout, pControlProperty); + __pLayoutMaker->SetGridLayoutContainerProperty(pGridLayout, pControlProperty); } } @@ -556,7 +527,20 @@ protected: pPopup->SetTitleTextColor(color); } - //-------safety for Minimum size------------------- + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pPopup->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"PopupTitleText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + +//-------safety for Minimum size------------------- // rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRect(); // if (rect.width < __BaseProperty(PROPERTY_POPUP_MIN_WIDTH)) // { diff --git a/src/ui/controls/FUiCtrl_PopupPresenter.cpp b/src/ui/controls/FUiCtrl_PopupPresenter.cpp index fd84468..4fa5b8a 100644 --- a/src/ui/controls/FUiCtrl_PopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PopupPresenter.cpp @@ -28,6 +28,7 @@ #include #include #include "FUi_ControlManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ModalLoopManager.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" @@ -55,7 +56,7 @@ _PopupPresenter::_PopupPresenter(void) , __pBackgroundVE(null) , __pTextObject(null) , __pLabelCore(null) - , __titleBounds(0, 0, 0, 0) + , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) { //empty statement } @@ -79,71 +80,37 @@ _PopupPresenter::~_PopupPresenter(void) } void -_PopupPresenter::UpdateEffectBounds(void) -{ - Dimension screenRect; - Rectangle bounds; - - int bgOutlineEffectTopMargin = 0; - int bgOutlineEffectBottomMargin = 0; - int bgOutlineEffectLeftMargin = 0; - int bgOutlineEffectRightMargin = 0; - int temp = 0; - - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectRightMargin); - - bounds = __pPopup->GetBounds(); - - screenRect = _ControlManager::GetInstance()->GetScreenSize(); - if (__pPopup->GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) - { - temp = screenRect.width; - screenRect.width = screenRect.height; - screenRect.height = temp; - } - - bounds.x = (screenRect.width - (bounds.width)) / 2 - bgOutlineEffectLeftMargin; - bounds.y = (screenRect.height - (bounds.height)) / 2 - bgOutlineEffectTopMargin; - - __pBackgroundVE->SetBounds(FloatRectangle((float)bounds.x, - (float)bounds.y, - (float)(bounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin), - (float)(bounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin))); -} - -void _PopupPresenter::Initialize(_Popup& popup) { result r = E_SUCCESS; - Dimension screenRect; - Rectangle bounds; - int temp = 0; + FloatRectangle bounds; + + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + float bgOutlineEffectTopMargin = 0.0f; + float bgOutlineEffectBottomMargin = 0.0f; + float bgOutlineEffectLeftMargin = 0.0f; + float bgOutlineEffectRightMargin = 0.0f; - int bgOutlineEffectTopMargin = 0; - int bgOutlineEffectBottomMargin = 0; - int bgOutlineEffectLeftMargin = 0; - int bgOutlineEffectRightMargin = 0; + _ControlOrientation orientation; __pPopup = &popup; - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pPopup->GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pPopup->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pPopup->GetOrientation(), transRightMargin); + orientation = __pPopup->GetOrientation(); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectRightMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); + + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, orientation, bgOutlineEffectTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, orientation, bgOutlineEffectBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin); // system label to cover non-client area __pLabelCore = _Label::CreateLabelN(); @@ -162,28 +129,21 @@ _PopupPresenter::Initialize(_Popup& popup) r = __pBackgroundVE->Construct(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - bounds = __pPopup->GetBounds(); + bounds = __pPopup->GetBoundsF(); - screenRect = _ControlManager::GetInstance()->GetScreenSize(); - if (__pPopup->GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) - { - temp = screenRect.width; - screenRect.width = screenRect.height; - screenRect.height = temp; - } + bounds.x -= bgOutlineEffectLeftMargin; + bounds.y -= bgOutlineEffectTopMargin; - bounds.x = (screenRect.width - (bounds.width)) / 2 - bgOutlineEffectLeftMargin; - bounds.y = (screenRect.height - (bounds.height)) / 2 - bgOutlineEffectTopMargin; - - __pBackgroundVE->SetBounds(FloatRectangle((float)bounds.x, - (float)bounds.y, - (float)(bounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin), - (float)(bounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin))); + __pBackgroundVE->SetBounds(FloatRectangle(bounds.x, + bounds.y, + bounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, + bounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin)); r = __pBackgroundVE->SetSurfaceOpaque(false); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); __pBackgroundVE->SetShowState(true); + __pBackgroundVE->SetImplicitAnimationEnabled(false); __pPopupVE = __pPopup->GetVisualElement(); SysTryCatch(NID_UI_CTRL, (__pPopupVE != null), r = E_SYSTEM, E_SYSTEM, @@ -201,6 +161,7 @@ CATCH: return; } + _Label* _PopupPresenter::GetSystemLabel(void) const { @@ -229,25 +190,29 @@ _PopupPresenter::SetTitleTextObject(const String &title) result r = E_SUCCESS; TextSimple* pSimpleText = null; - int textSize = 0; - int titleHeight = 0; - int titleTopMargin = 0; - int titleLeftMargin = 0; - int titleRightMargin = 0; - int transTopMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + float textSize = 0.0f; + float titleHeight = 0.0f; + float titleTopMargin = 0.0f; + float titleLeftMargin = 0.0f; + float titleRightMargin = 0.0f; + float transTopMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, __pPopup->GetOrientation(), textSize); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pPopup->GetOrientation(), titleHeight); + _ControlOrientation orientation; + + orientation = __pPopup->GetOrientation(); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, __pPopup->GetOrientation(), titleTopMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, __pPopup->GetOrientation(), titleLeftMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, __pPopup->GetOrientation(), titleRightMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, textSize); + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pPopup->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pPopup->GetOrientation(), transRightMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLeftMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); + + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); // Title font _pFont = __pPopup->GetFallbackFont(); @@ -278,9 +243,9 @@ _PopupPresenter::SetTitleTextObject(const String &title) __pTextObject->SetFont(_pFont, 0, __pTextObject->GetTextLength()); __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pTextObject->SetBounds(Rectangle(titleLeftMargin + transLeftMargin, + __pTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin, - __pPopup->GetBounds().width - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), + __pPopup->GetBoundsF().width - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin)); __pTextObject->Compose(); @@ -308,7 +273,7 @@ _PopupPresenter::OnDraw(void) Draw(); } -Rectangle +FloatRectangle _PopupPresenter::GetTitleTextBounds(void) const { return __titleBounds; @@ -319,28 +284,32 @@ _PopupPresenter::DrawSystemLabel(void) { result r = E_SUCCESS; - int titleHeight = 0; - int transTopMargin = 0; - int transBottomMargin = 0; + float titleHeight = 0.0f; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + + _ControlOrientation orientation; + + orientation = __pPopup->GetOrientation(); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pPopup->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pPopup->GetOrientation(), transBottomMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); - Rectangle systemBounds; - Rectangle clientBounds = __pPopup->GetPopupClientArea(); - Rectangle bounds = __pPopup->GetBounds(); + FloatRectangle systemBounds; + FloatRectangle clientBounds = __pPopup->GetPopupClientArea(); + FloatRectangle bounds = __pPopup->GetBoundsF(); systemBounds.x = clientBounds.x + clientBounds.width; if (__pPopup->HasTitle() == false) { - titleHeight = 0; + titleHeight = 0.0f; } systemBounds.y = clientBounds.y + POPUP_LABEL_GAP; - systemBounds.width = (bounds.width - systemBounds.x) - POPUP_LABEL_GAP / 2; - systemBounds.height = clientBounds.height -POPUP_LABEL_GAP * 2; + systemBounds.width = (bounds.width - systemBounds.x) - POPUP_LABEL_GAP / 2.0f; + systemBounds.height = clientBounds.height -POPUP_LABEL_GAP * 2.0f; r = __pLabelCore->SetBounds(systemBounds); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -359,29 +328,65 @@ CATCH: } void +_PopupPresenter::UpdateEffectBounds(void) +{ + FloatRectangle bounds; + + float bgOutlineEffectTopMargin = 0.0f; + float bgOutlineEffectBottomMargin = 0.0f; + float bgOutlineEffectLeftMargin = 0.0f; + float bgOutlineEffectRightMargin = 0.0f; + + _ControlOrientation orientation; + + orientation = __pPopup->GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, orientation, bgOutlineEffectTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, orientation, bgOutlineEffectBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin); + + bounds = __pPopup->GetBoundsF(); + + bounds.x -= bgOutlineEffectLeftMargin; + bounds.y -= bgOutlineEffectTopMargin; + __pBackgroundVE->SetBounds(FloatRectangle(bounds.x, + bounds.y, + bounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, + bounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin)); +} + +void _PopupPresenter::Draw(void) { result r = E_SUCCESS; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; + + float bgOutlineEffectTopMargin = 0.0f; + float bgOutlineEffectBottomMargin = 0.0f; + float bgOutlineEffectLeftMargin = 0.0f; + float bgOutlineEffectRightMargin = 0.0f; + bool isCustomBitmap = false; + + _ControlOrientation orientation; - int bgOutlineEffectTopMargin = 0; - int bgOutlineEffectBottomMargin = 0; - int bgOutlineEffectLeftMargin = 0; - int bgOutlineEffectRightMargin = 0; + orientation = __pPopup->GetOrientation(); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pPopup->GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pPopup->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pPopup->GetOrientation(), transRightMargin); + isCustomBitmap = IS_CUSTOM_BITMAP(POPUP::BG_NORMAL); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, __pPopup->GetOrientation(), bgOutlineEffectRightMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); + + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_TOP_MARGIN, orientation, bgOutlineEffectTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_BOTTOM_MARGIN, orientation, bgOutlineEffectBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin); // Get canvas Canvas* pCanvas = __pPopup->GetCanvasN(); @@ -399,10 +404,10 @@ _PopupPresenter::Draw(void) // Draw BG if (__pPopup->GetBackgroundBitmap() != null) { - Rectangle bounds(-transLeftMargin, + FloatRectangle bounds(-transLeftMargin, -transTopMargin, - __pPopup->GetBounds().width + transLeftMargin + transRightMargin, - __pPopup->GetBounds().height + transTopMargin + transBottomMargin); + __pPopup->GetBoundsF().width + transLeftMargin + transRightMargin, + __pPopup->GetBoundsF().height + transTopMargin + transBottomMargin); const Bitmap* pBackgroundBitmap = __pPopup->GetBackgroundBitmap(); if (pBackgroundBitmap->IsNinePatchedBitmap() == true) @@ -432,14 +437,13 @@ _PopupPresenter::Draw(void) } } - // Draw Outline - if (__pPopup->GetOutlineBitmap() != null) + if (!isCustomBitmap && __pPopup->GetOutlineBitmap() != null) { - Rectangle bounds(0, - 0, - __pPopup->GetBounds().width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, - __pPopup->GetBounds().height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin); + FloatRectangle bounds(0.0f, + 0.0f, + __pPopup->GetBoundsF().width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin, + __pPopup->GetBoundsF().height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin); const Bitmap* pOutlineBitmap = __pPopup->GetOutlineBitmap(); @@ -466,13 +470,8 @@ _PopupPresenter::OnActivated(void) { result r = E_SUCCESS; -#if !defined(MULTI_WINDOW) - VisualElement* pParent = __pPopupVE->GetParent(); -#else - _Window* pWindow = __pPopup->GetRootWindow(); - _RootVisualElement* pParent = pWindow->GetRootVisualElement(); -#endif - + _Window* pWindow = __pPopup->GetRootWindow(); + _RootVisualElement* pParent = pWindow->GetRootVisualElement(); if (pParent) { r = pParent->InsertChild(*__pBackgroundVE, __pPopupVE, false); @@ -519,16 +518,12 @@ _PopupPresenter::ProcessEvent(void) bool _PopupPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Point point = touchinfo.GetCurrentPosition(); - return true; } bool _PopupPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - Point point = touchinfo.GetCurrentPosition(); - return true; } diff --git a/src/ui/controls/FUiCtrl_Progress.cpp b/src/ui/controls/FUiCtrl_Progress.cpp index e11e6ee..984327a 100644 --- a/src/ui/controls/FUiCtrl_Progress.cpp +++ b/src/ui/controls/FUiCtrl_Progress.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Progress.cpp * @brief This is the implementation file for the _Progress class. @@ -54,6 +55,7 @@ _Progress::_Progress(void) if (pContainer) { pContainer->Activate(true); + InitializeAccessibilityElement(); } } } @@ -85,6 +87,9 @@ _Progress::CreateProgressN() r = GET_COLOR_CONFIG(SLIDER::BAR_NORMAL, pProgress->__barColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to get progress colorconfig", GetErrorMessage(r)); + r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, pProgress->__barBgColor); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to get progress colorconfig", GetErrorMessage(r)); + pProgress->AcquireHandle(); pProgress->SetFocusable(false); @@ -118,7 +123,7 @@ _Progress::InitializeAccessibilityElement(void) __pAccessibilityElement = new _AccessibilityElement(true); SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); __pAccessibilityElement->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); - + __pAccessibilityElement->SetName(L"ProgressingImage"); __pAccessibilityElement->SetLabel(L"Progressing"); String string; @@ -135,7 +140,10 @@ _Progress::InitializeAccessibilityElement(void) result _Progress::OnAttachedToMainTree(void) { - InitializeAccessibilityElement(); + if (__pAccessibilityElement) + { + __pAccessibilityElement->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + } return E_SUCCESS; } @@ -322,6 +330,7 @@ _Progress::SetPropertyBarColor(const Variant& barColor) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __barColor = tempColor; + __barColor.SetAlpha(0xFF); return r; } @@ -342,6 +351,42 @@ _Progress::GetPropertyBarColor(void) const return Variant(__barColor); } +result +_Progress::SetBarBackgroundColor(const Color& color) +{ + return SetProperty("barBackgroundColor", Variant(color)); +} + +result +_Progress::SetPropertyBarBackgroundColor(const Variant& barBgColor) +{ + result r = E_SUCCESS; + + Color tempColor = barBgColor.ToColor(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __barBgColor = tempColor; + __barBgColor.SetAlpha(0xFF); + + return r; +} + +Color +_Progress::GetBarBackgroundColor(void) const +{ + Variant barBackgroundColor = GetProperty("barBackgroundColor"); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(), r, "[%s] Propagating.", GetErrorMessage(r)); + + return barBackgroundColor.ToColor(); +} + +Variant +_Progress::GetPropertyBarBackgroundColor(void) const +{ + return Variant(__barBgColor); +} void _Progress::OnDraw(void) { diff --git a/src/ui/controls/FUiCtrl_ProgressImpl.cpp b/src/ui/controls/FUiCtrl_ProgressImpl.cpp index 75ffec8..3c648d5 100644 --- a/src/ui/controls/FUiCtrl_ProgressImpl.cpp +++ b/src/ui/controls/FUiCtrl_ProgressImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressImpl.cpp * @brief This is the implementation file for the _ProgressImpl class. @@ -21,6 +22,8 @@ #include #include +#include +#include #include "FUi_UiBuilder.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" @@ -88,6 +91,36 @@ CATCH: return null; } +_ProgressImpl* +_ProgressImpl::CreateProgressImplFN(Progress* pControl, const FloatRectangle& bounds) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + r = GET_SIZE_INFO(Progress).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _Progress* pCore = _Progress::CreateProgressN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _ProgressImpl* pImpl = new (std::nothrow) _ProgressImpl(pControl, pCore); + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Progress), bounds, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; + +CATCH: + delete pImpl; //This deletes pCore as well + pImpl = null; + + return null; +} + result _ProgressImpl::SetValue(int value) { @@ -148,6 +181,23 @@ _ProgressImpl::GetBarColor() const return GetCore().GetPropertyBarColor().ToColor(); } +result +_ProgressImpl::SetBarBackgroundColor(const Color& color) +{ + ClearLastResult(); + + Variant barBackgroundColor(color); + + return GetCore().SetPropertyBarBackgroundColor(barBackgroundColor); +} + +Color +_ProgressImpl::GetBarBackgroundColor() const +{ + ClearLastResult(); + + return GetCore().GetPropertyBarBackgroundColor().ToColor(); +} const char* _ProgressImpl::GetPublicClassName(void) const { @@ -209,7 +259,7 @@ protected: int tempMax = 0; int temp = 0; - Rectangle rect; + FloatRectangle rect; GetProperty(pControl, &pControlProperty); if (pControlProperty == null) @@ -222,7 +272,7 @@ protected: { return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); if (pControl->GetElement(L"min", elementString) && pControl->GetElement(L"max", elementString1)) { @@ -263,6 +313,25 @@ protected: pProgress->SetBarColor(color); } + if (pControl->GetElement(L"barBackgroundColor", elementString)) + { + ConvertStringToColor(elementString, color); + pProgress->SetBarBackgroundColor(color); + } + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pProgress->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"ProgressingImage"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pProgress; } diff --git a/src/ui/controls/FUiCtrl_ProgressModel.cpp b/src/ui/controls/FUiCtrl_ProgressModel.cpp index 007b980..0210b37 100644 --- a/src/ui/controls/FUiCtrl_ProgressModel.cpp +++ b/src/ui/controls/FUiCtrl_ProgressModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressModel.cpp * @brief This is the implementation file for the _ProgressModel class. diff --git a/src/ui/controls/FUiCtrl_ProgressPopup.cpp b/src/ui/controls/FUiCtrl_ProgressPopup.cpp old mode 100644 new mode 100755 index d136c38..10bd553 --- a/src/ui/controls/FUiCtrl_ProgressPopup.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopup.cpp @@ -26,6 +26,7 @@ #include #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_DataBindingContext.h" #include "FUiCtrl_ButtonImpl.h" @@ -52,11 +53,11 @@ _ProgressPopup::_ProgressPopup(void) , __pButton(null) , __text(L"") , __textColor(Color(0xFFFFFFFF)) - , __animationRect(0, 0, 0, 0) + , __animationRect(0.0f, 0.0f, 0.0f, 0.0f) , __pTextAccessibilityElement(null) , __textState(false) , __buttonState(false) - , __isTranslucent(false) + , __isTransparent(false) { // empty statement } @@ -100,26 +101,21 @@ _ProgressPopup::CreateProgressPopupN(void) _ProgressPopup* pProgressPopup = new (std::nothrow) _ProgressPopup(); SysTryReturn(NID_UI_CTRL, pProgressPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); -#if defined(MULTI_WINDOW) result r = pProgressPopup->CreateRootVisualElement(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); -#endif // for taking touch event pProgressPopup->AcquireHandle(); - return pProgressPopup; -#if defined(MULTI_WINDOW) CATCH: delete pProgressPopup; return null; -#endif } result -_ProgressPopup::Initialize(bool cancelButton, bool translucent, const Rectangle& animationRect) +_ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRectangle& animationRect) { result r = E_SUCCESS; @@ -127,14 +123,14 @@ _ProgressPopup::Initialize(bool cancelButton, bool translucent, const Rectangle& __animationRect = animationRect; __buttonState = cancelButton; - __isTranslucent = translucent; + __isTransparent = transparent; _ProgressPopupPresenter* pPresenter = new (std::nothrow) _ProgressPopupPresenter(); SysTryReturn(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); SetPresenter(*pPresenter); - r = pPresenter->Initialize(*this, cancelButton, translucent, animationRect); + r = pPresenter->Initialize(*this, cancelButton, transparent, animationRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); GET_COLOR_CONFIG(POPUP::TITLE_TEXT_NORMAL, _titleTextColor); @@ -159,7 +155,7 @@ _ProgressPopup::Initialize(bool cancelButton, bool translucent, const Rectangle& GetVisualElement()->SetSurfaceOpaque(false); } - if (__isTranslucent) + if (__isTransparent) { GetVisualElement()->SetOpacity(0.6f); // FIXME : temp } @@ -170,7 +166,7 @@ _ProgressPopup::Initialize(bool cancelButton, bool translucent, const Rectangle& r = _pDimmingLayer->Construct(*this); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - if (__buttonState && !__isTranslucent) + if (__buttonState && !__isTransparent) { __pButton = new (std::nothrow) Button(); SysTryCatch(NID_UI_CTRL, __pButton != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -193,6 +189,7 @@ _ProgressPopup::Initialize(bool cancelButton, bool translucent, const Rectangle& if(pContainer != null) { pContainer->Activate(true); + InitializeAccessibilityElement(); } return r; @@ -340,57 +337,61 @@ _ProgressPopup::GetText(void) const return __text; } -int +float _ProgressPopup::GetTotalHeight(void) const { - int transTopMargin = 0; - int transBottomMargin = 0; - int titleHeight = 0; - int noTitleHeigth = 0; - int animationWidth = 0; - int textTopGap = 0; - int textBottomGap = 0; - int bottomHeight = 0; - - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, GetOrientation(), noTitleHeigth); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, GetOrientation(), animationWidth); - GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, GetOrientation(), textTopGap); - GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, GetOrientation(), textBottomGap); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - - GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, GetOrientation(), bottomHeight); + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float titleHeight = 0.0f; + float noTitleHeigth = 0.0f; + float animationWidth = 0.0f; + float textTopGap = 0.0f; + float textBottomGap = 0.0f; + float bottomHeight = 0.0f; + + _ControlOrientation orientation; + + orientation = GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeigth); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopGap); + GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomGap); + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + + GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight); if (HasTitle()) { - noTitleHeigth = 0; + noTitleHeigth = 0.0f; } else { - titleHeight = 0; + titleHeight = 0.0f; } if (!HasText()) { - textTopGap = 0; - textBottomGap = 0; + textTopGap = 0.0f; + textBottomGap = 0.0f; } if (!HasButton()) { - bottomHeight = 0; + bottomHeight = 0.0f; } - int totalH = transTopMargin + float totalH = transTopMargin + transBottomMargin + titleHeight + noTitleHeigth + animationWidth + textTopGap + textBottomGap - + __pProgressPopupPresenter->GetBodyTextHeight() - + bottomHeight; + + bottomHeight + + __pProgressPopupPresenter->GetBodyTextHeight(); return totalH; } @@ -409,31 +410,35 @@ _ProgressPopup::GetTextColor() const return __textColor; } -Rectangle +FloatRectangle _ProgressPopup::GetAnimationRect(void) const { - Rectangle animationBounds; + FloatRectangle animationBounds; + + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float animationWidth = 0.0f; + float noTitleProcessTop = 0.0f; + float transTopMargin = 0.0f; - int defaultWidth = 0; - int titleHeight = 0; - int animationWidth = 0; - int noTitleProcessTop = 0; - int transTopMargin = 0; + _ControlOrientation orientation; - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, GetOrientation(), defaultWidth); + orientation = GetOrientation(); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, GetOrientation(), animationWidth); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, GetOrientation(), noTitleProcessTop); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, GetOrientation(), transTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleProcessTop); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); if (HasTitle()) { - animationBounds = Rectangle((defaultWidth - animationWidth) / 2, titleHeight + transTopMargin, animationWidth, animationWidth); + animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f, titleHeight + transTopMargin, animationWidth, animationWidth); } else if (HasText() || HasButton()) { - animationBounds = Rectangle((defaultWidth - animationWidth) / 2, noTitleProcessTop + transTopMargin, animationWidth, animationWidth); + animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f, noTitleProcessTop + transTopMargin, animationWidth, animationWidth); } else { @@ -452,13 +457,13 @@ _ProgressPopup::HasText(void) const bool _ProgressPopup::HasButton(void) const { - return (__buttonState && !__isTranslucent); + return (__buttonState && !__isTransparent); } bool -_ProgressPopup::IsTranslucent(void) const +_ProgressPopup::IsTransparent(void) const { - return __isTranslucent; + return __isTransparent; } void @@ -478,6 +483,10 @@ void _ProgressPopup::OnDraw(void) { __pProgressPopupPresenter->Draw(); + if(unlikely((_AccessibilityManager::IsActivated()))) + { + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM); + } } void @@ -512,7 +521,7 @@ _ProgressPopup::OnActionPerformed(const Tizen::Ui::_Control& source, int actionI void _ProgressPopup::OnBoundsChanged(void) { - SetClientBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + SetClientBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); return; } @@ -520,27 +529,75 @@ _ProgressPopup::OnBoundsChanged(void) void _ProgressPopup::OnVisibleStateChanged(void) { - _Popup::OnVisibleStateChanged(); + result r = E_SUCCESS; + + if (GetVisibleState() && !__isTransparent) + { + r = _pDimmingLayer->SetDimmingEnabled(true); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = _pDimmingLayer->SetDimmingEnabled(false); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + _Window::OnVisibleStateChanged(); } result _ProgressPopup::OnAttachedToMainTree(void) { - SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'"); - InitializeAccessibilityElement(); - return E_SUCCESS; } void _ProgressPopup::OnActivated(void) { + result r = E_SUCCESS; __pProgressPopupPresenter->PlayProcessAnimation(); - _Popup::OnActivated(); + if (GetVisibleState() && !__isTransparent) + { + r = _pDimmingLayer->SetDimmingEnabled(true); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + SetTouchCapture(); + } + else + { + r = _pDimmingLayer->SetDimmingEnabled(false); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + if (GetOwner() == null) + { + _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame()); + SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); + + _Form* pForm = pFrame->GetCurrentForm(); + if (pForm != null) + { + SetOwner(pForm); + } + else + { + SetOwner(pFrame); + } + } + + _Control* pOwner = GetOwner(); + + if (pOwner != null) + { + _ownerEnableState = pOwner->GetInputEnableState(); + pOwner->SetInputEventEnableState(false); + } + + _Window::OnActivated(); } void @@ -554,70 +611,55 @@ _ProgressPopup::OnDeactivated(void) void _ProgressPopup::InitializeAccessibilityElement(void) { - if (likely(!(_AccessibilityManager::IsActivated()))) + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + if (_pTitleTextAccessibilityElement == null) { - return; - } + _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); - if ((_pTitleTextAccessibilityElement != null) && (__pTextAccessibilityElement != null)) - { - return; + _pTitleTextAccessibilityElement->Construct(L"ProgressPopupTitleText", __pProgressPopupPresenter->GetTitleBounds()); + _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); + _pTitleTextAccessibilityElement->SetTrait("Popup Title Text"); + + pContainer->AddElement(*_pTitleTextAccessibilityElement); } - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if (pContainer != null) + if (__pTextAccessibilityElement == null) { - if (_pTitleTextAccessibilityElement == null) - { - _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); + __pTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, __pTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); - _pTitleTextAccessibilityElement->Construct(L"ProgressPopupTitleText", __pProgressPopupPresenter->GetTitleBounds()); - _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); - _pTitleTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + __pTextAccessibilityElement->Construct(L"ProgressPopupText", __pProgressPopupPresenter->GetTextBounds()); + __pTextAccessibilityElement->SetLabel(GetText()); + __pTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); - pContainer->AddElement(*_pTitleTextAccessibilityElement); - } + pContainer->AddElement(*__pTextAccessibilityElement); + } - if (__pTextAccessibilityElement == null) - { - __pTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); + if (HasButton() == true) + { + _ControlImpl* pImpl = null; + _Button* pButtonCore = null; - __pTextAccessibilityElement->Construct(L"ProgressPopupText", __pProgressPopupPresenter->GetTextBounds()); - __pTextAccessibilityElement->SetLabel(GetText()); - __pTextAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TEXT_FIELD); + pImpl = _ControlImpl::GetInstance(*__pButton); - pContainer->AddElement(*__pTextAccessibilityElement); - } + pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore()); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, pButtonCore != null, r, "[%s] Propagating.", GetErrorMessage(r)); - if (HasButton() == true) + _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer(); + if (pButtonContainer != null) { - _ControlImpl* pImpl = null; - _Button* pButtonCore = null; - - pImpl = _ControlImpl::GetInstance(*__pButton); - - pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore()); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, pButtonCore != null, r, "[%s] Propagating.", GetErrorMessage(r)); - - _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer(); - if (pButtonContainer != null) + _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); + if (pButtonElement != null) { - _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - if (pButtonElement != null) - { - pButtonElement->SetName(L"ProgressPopupButton1"); - } - - // Add Container - pContainer->AddChildContainer(*pButtonContainer); + pButtonElement->SetName(L"ProgressPopupButton1"); } - } + // Add Container + pContainer->AddChildContainer(*pButtonContainer); + } } - return; } diff --git a/src/ui/controls/FUiCtrl_ProgressPopupEvent.cpp b/src/ui/controls/FUiCtrl_ProgressPopupEvent.cpp index ebfdb6a..e1ce9d9 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopupEvent.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopupEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressPopupEvent.cpp * @brief This is the implementation for the ActionEvent class. diff --git a/src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp b/src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp old mode 100644 new mode 100755 index fc1a3a8..7d23304 --- a/src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopupImpl.cpp @@ -24,7 +24,9 @@ #include #include #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ControlImplManager.h" +#include "FUi_Math.h" #include "FUiCtrl_FrameImpl.h" #include "FUiCtrl_Form.h" #include "FUiCtrl_ProgressPopupImpl.h" @@ -56,6 +58,7 @@ _ProgressPopupImpl::_ProgressPopupImpl(ProgressPopup* pPublic, _ProgressPopup* p : _PopupImpl(pPublic, pCore) , __pPublicProgressPopupEvent(null) { + _centerAlign = true; //empty statement } @@ -88,36 +91,41 @@ _ProgressPopupImpl::CreateProgressPopupImplN(ProgressPopup* pControl) } result -_ProgressPopupImpl::Initialize(bool cancelButton, bool translucent) +_ProgressPopupImpl::Initialize(bool cancelButton, bool transparent) { result r = E_SUCCESS; - int animationWidth = 0; - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, GetCore().GetOrientation(), animationWidth); + float animationWidth = 0.0f; - Rectangle animationRect; + _ControlOrientation orientation; + + orientation = GetCore().GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + + FloatRectangle animationRect; animationRect = GetCenterAlignedRect(animationWidth, animationWidth); - r = GetCore().Initialize(cancelButton, translucent, animationRect); + r = GetCore().Initialize(cancelButton, transparent, animationRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - if (!cancelButton || translucent) + if (!cancelButton || transparent) { r = SetBounds(animationRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } else { - int maxHeight = 0; - int defaultWidth = 0; + float maxHeight = 0.0f; + float defaultWidth = 0.0f; - GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, GetCore().GetOrientation(), maxHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, GetCore().GetOrientation(), defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); - int totalH = -1; + float totalH = -1.0f; totalH = GetCore().GetTotalHeight(); - Rectangle bounds; + FloatRectangle bounds; if (totalH > maxHeight) { bounds = GetCenterAlignedRect(defaultWidth, maxHeight); @@ -131,7 +139,6 @@ _ProgressPopupImpl::Initialize(bool cancelButton, bool translucent) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - SetMovable(false); SetResizable(false); return r; @@ -233,19 +240,24 @@ _ProgressPopupImpl::SetTitleText(const String& title) { result r = E_SUCCESS; + if (GetCore().IsTransparent()) + { + return r; + } + r = GetCore().SetTitleText(title); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - int maxHeight = 0; - int defaultWidth = 0; + float maxHeight = 0.0f; + float defaultWidth = 0.0f; GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, GetCore().GetOrientation(), maxHeight); GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, GetCore().GetOrientation(), defaultWidth); - int totalH = -1; + float totalH = -1.0f; totalH = GetCore().GetTotalHeight(); - Rectangle bounds; + FloatRectangle bounds; if (totalH > maxHeight) { bounds = GetCenterAlignedRect(defaultWidth, maxHeight); @@ -255,13 +267,11 @@ _ProgressPopupImpl::SetTitleText(const String& title) bounds = GetCenterAlignedRect(defaultWidth, totalH); } - SetMovable(true); SetResizable(true); r = SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - SetMovable(false); SetResizable(false); r = GetCore().UpdateBounds(); @@ -277,6 +287,11 @@ _ProgressPopupImpl::SetText(const String& text) result r = E_SUCCESS; int maxLength = 0; + if (GetCore().IsTransparent()) + { + return r; + } + maxLength = GetMaxTextLength(); SysTryReturn(NID_UI_CTRL, text.GetLength() <= maxLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] Text length is too long to create ProgressPopup."); @@ -284,16 +299,17 @@ _ProgressPopupImpl::SetText(const String& text) r = GetCore().SetText(text); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - int maxHeight = 0; - int defaultWidth = 0; + float maxHeight = 0.0f; + float defaultWidth = 0.0f; GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, GetCore().GetOrientation(), maxHeight); GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, GetCore().GetOrientation(), defaultWidth); - int totalH = -1; + float totalH = -1.0f; totalH = GetCore().GetTotalHeight(); - Rectangle bounds; + FloatRectangle bounds; + if (totalH > maxHeight) { bounds = GetCenterAlignedRect(defaultWidth, maxHeight); @@ -303,13 +319,11 @@ _ProgressPopupImpl::SetText(const String& text) bounds = GetCenterAlignedRect(defaultWidth, totalH); } - SetMovable(true); SetResizable(true); r = SetBounds(bounds); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - SetMovable(false); SetResizable(false); r = GetCore().UpdateBounds(); @@ -349,25 +363,25 @@ _ProgressPopupImpl::GetMaxTextLength(void) const return maxLength; } -Rectangle -_ProgressPopupImpl::GetCenterAlignedRect(int width, int height) const +FloatRectangle +_ProgressPopupImpl::GetCenterAlignedRect(float width, float height) const { - int x = 0; - int y = 0; + float x = 0.0f; + float y = 0.0f; - Dimension screenRect = _ControlManager::GetInstance()->GetScreenSize(); + FloatDimension screenRect = _ControlManager::GetInstance()->GetScreenSizeF(); if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) { - int temp = screenRect.width; + float temp = screenRect.width; screenRect.width = screenRect.height; screenRect.height = temp; } - x = (screenRect.width - width) / 2; - y = (screenRect.height - height) / 2; + x = (screenRect.width - width) / 2.0f; + y = (screenRect.height - height) / 2.0f; - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); } void @@ -387,45 +401,38 @@ void _ProgressPopupImpl::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; - Dimension portraitSize; - Dimension landscapeSize; - - if (orientation == _CONTROL_ORIENTATION_PORTRAIT) - { - portraitSize = Dimension(GetBounds().width, GetBounds().height); - landscapeSize = Dimension(portraitSize.height, portraitSize.width); - } - else - { - portraitSize = Dimension(GetBounds().height, GetBounds().width); - landscapeSize = Dimension(portraitSize.height, portraitSize.width); - } - if (orientation == _CONTROL_ORIENTATION_PORTRAIT) + if(_centerAlign) { SetResizable(true); - SetMovable(true); - r = SetBounds(GetCenterAlignedRect(portraitSize.width, portraitSize.height)); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + r = SetBounds(GetCenterAlignedRect(GetBoundsF().width, GetBoundsF().height)); - SetMovable(false); - SetResizable(false); - } - else - { - SetResizable(true); - SetMovable(true); - - r = SetBounds(GetCenterAlignedRect(landscapeSize.width, landscapeSize.height)); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - SetMovable(false); SetResizable(false); } return GetCore().OnChangeLayout(orientation); } +void +_ProgressPopupImpl::OnBoundsChanged(void) +{ + FloatRectangle rect; + FloatRectangle pRect = GetBoundsF(); + + if(_centerAlign) + { + rect = GetCenterAlignedRect(pRect.width, pRect.height); + + if (!_FloatCompare(rect.x, pRect.x) || !_FloatCompare(rect.y, pRect.y)) + { + _centerAlign = false; + } + } + + _ControlImpl::OnBoundsChanged(); +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp index e9cc938..aeaaf9c 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUiCtrl_ProgressPopupPresenter.h" @@ -49,33 +50,23 @@ _ProgressPopupPresenter::_ProgressPopupPresenter(void) : __pProgressPopup(null) , __pTitleTextObject(null) , __pBodyTextObject(null) - , __titleBounds(0, 0, 0, 0) - , __textBounds(0, 0, 0, 0) - , __animationBounds(0, 0, 0, 0) + , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __textBounds(0.0f, 0.0f, 0.0f, 0.0f) + , __animationBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pAnimation(null) , __pAnimationFrameList(null) , __fontStyle(0) , __fontSize(0) - , __textObjectHeight(0) + , __textObjectHeight(0.0f) , __currentIndex(0) , __buttonPressState(false) , __cancelButton(false) - , __translucent(false) + , __transparent(false) { - for (int i = 0; i < MAX_PROCESS_IMAGE_COUNT; i++) - { - __pProcessImage[i] = null; - } } _ProgressPopupPresenter::~_ProgressPopupPresenter(void) { - for (int i = 0; i < MAX_PROCESS_IMAGE_COUNT; i++) - { - delete __pProcessImage[i]; - __pProcessImage[i] = null; - } - if (__pTitleTextObject != null) { __pTitleTextObject->RemoveAll(); @@ -92,7 +83,6 @@ _ProgressPopupPresenter::~_ProgressPopupPresenter(void) if (__pAnimationFrameList != null) { - __pAnimationFrameList->RemoveAll(true); delete __pAnimationFrameList; __pAnimationFrameList = null; } @@ -106,12 +96,12 @@ _ProgressPopupPresenter::~_ProgressPopupPresenter(void) } result -_ProgressPopupPresenter::Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool translucent, const Rectangle& animationRect) +_ProgressPopupPresenter::Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool transparent, const FloatRectangle& animationRect) { result r = E_SUCCESS; __cancelButton = cancelButton; - __translucent = translucent; + __transparent = transparent; __pProgressPopup = &ProgressPopup; return r; @@ -120,27 +110,31 @@ _ProgressPopupPresenter::Initialize(_ProgressPopup& ProgressPopup, bool cancelBu void _ProgressPopupPresenter::SetTitleTextObject(void) { - int titleTextSize = 0; - int defaultWidth = 0; - int titleHeight = 0; - int titleTopMargin = 0; - int titleLeftMargin = 0; - int titleRightMargin = 0; - - int transTopMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; - - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, __pProgressPopup->GetOrientation(), titleTextSize); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pProgressPopup->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pProgressPopup->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, __pProgressPopup->GetOrientation(), titleTopMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, __pProgressPopup->GetOrientation(), titleLeftMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, __pProgressPopup->GetOrientation(), titleRightMargin); - - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pProgressPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pProgressPopup->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pProgressPopup->GetOrientation(), transRightMargin); + float titleTextSize = 0.0f; + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float titleTopMargin = 0.0f; + float titleLeftMargin = 0.0f; + float titleRightMargin = 0.0f; + + float transTopMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; + + _ControlOrientation orientation; + + orientation = __pProgressPopup->GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLeftMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); + + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); if (__pProgressPopup->HasTitle()) { @@ -166,13 +160,13 @@ _ProgressPopupPresenter::SetTitleTextObject(void) __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength()); __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pTitleTextObject->SetBounds(Rectangle(titleLeftMargin + transLeftMargin, + __pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin)); __pTitleTextObject->Compose(); - __titleBounds = Rectangle(titleLeftMargin + transLeftMargin, + __titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin); @@ -190,51 +184,55 @@ CATCH: void _ProgressPopupPresenter::SetTextObject(void) { - int bodyTextSize = 0; - int defaultWidth = 0; - int titleHeight = 0; - int maxHeight = 0; - int btnBottomMargin = 0; - int textLeftMargin = 0; - int textRightMargin = 0; - int bottomHeight = 0; - int transTopMargin = 0; - int transBottomMargin = 0; - int transLeftMargin = 0; - int transRightMargin = 0; - int animationWidth = 0; - int textTopMargin = 0; - int textBottomMargin = 0; - int noTitleHeight = 0; - - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pProgressPopup->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, __pProgressPopup->GetOrientation(), noTitleHeight); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, __pProgressPopup->GetOrientation(), animationWidth); - - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pProgressPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, __pProgressPopup->GetOrientation(), transBottomMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, __pProgressPopup->GetOrientation(), transLeftMargin); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, __pProgressPopup->GetOrientation(), transRightMargin); - - GET_SHAPE_CONFIG(MESSAGEBOX::PROCESS_TEXT_TOP_MARGIN, __pProgressPopup->GetOrientation(), textTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::PROCESS_TEXT_BOTTOM_MARGIN, __pProgressPopup->GetOrientation(), textBottomMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_LEFT_MARGIN, __pProgressPopup->GetOrientation(), textLeftMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_RIGHT_MARGIN, __pProgressPopup->GetOrientation(), textRightMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, __pProgressPopup->GetOrientation(), bodyTextSize); - - GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, __pProgressPopup->GetOrientation(), maxHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pProgressPopup->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, __pProgressPopup->GetOrientation(), bottomHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, __pProgressPopup->GetOrientation(), btnBottomMargin); + float bodyTextSize = 0.0f; + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float maxHeight = 0.0f; + float btnBottomMargin = 0.0f; + float textLeftMargin = 0.0f; + float textRightMargin = 0.0f; + float bottomHeight = 0.0f; + float transTopMargin = 0.0f; + float transBottomMargin = 0.0f; + float transLeftMargin = 0.0f; + float transRightMargin = 0.0f; + float animationWidth = 0.0f; + float textTopMargin = 0.0f; + float textBottomMargin = 0.0f; + float noTitleHeight = 0.0f; + + _ControlOrientation orientation; + + orientation = __pProgressPopup->GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeight); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); + + GET_SHAPE_CONFIG(MESSAGEBOX::PROCESS_TEXT_TOP_MARGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_LEFT_MARGIN, orientation, textLeftMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_RIGHT_MARGIN, orientation, textRightMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, bodyTextSize); + + GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, orientation, btnBottomMargin); if (__pProgressPopup->HasTitle()) { - noTitleHeight = 0; + noTitleHeight = 0.0f; } else { - titleHeight = 0; + titleHeight = 0.0f; } if (__pProgressPopup->HasText()) @@ -246,7 +244,7 @@ _ProgressPopupPresenter::SetTextObject(void) if (__pProgressPopup->HasButton()) { - GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, __pProgressPopup->GetOrientation(), bottomHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight); } r = SetFontInfo(FONT_STYLE_PLAIN, bodyTextSize); @@ -263,7 +261,7 @@ _ProgressPopupPresenter::SetTextObject(void) __pBodyTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); __pBodyTextObject->SetFont(_pFont, 0, __pBodyTextObject->GetTextLength()); __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pBodyTextObject->SetBounds(Rectangle(textLeftMargin + transLeftMargin, + __pBodyTextObject->SetBounds(FloatRectangle(textLeftMargin + transLeftMargin, titleHeight + animationWidth + noTitleHeight, defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin), maxHeight - titleHeight - bottomHeight - animationWidth)); @@ -272,10 +270,10 @@ _ProgressPopupPresenter::SetTextObject(void) // Calculate Text bounds __textObjectHeight = __pBodyTextObject->GetTotalHeight(); - int totalHeightExceptTextObj = titleHeight + animationWidth + textTopMargin + textBottomMargin + bottomHeight + (transTopMargin + transBottomMargin); - int tmpH = maxHeight - (totalHeightExceptTextObj + __textObjectHeight); + float totalHeightExceptTextObj = titleHeight + animationWidth + textTopMargin + textBottomMargin + bottomHeight + (transTopMargin + transBottomMargin); + float tmpH = maxHeight - (totalHeightExceptTextObj + __textObjectHeight); - __textObjectHeight = (tmpH > 0) ? __textObjectHeight : __textObjectHeight + tmpH; + __textObjectHeight = (tmpH > 0.0f) ? __textObjectHeight : __textObjectHeight + tmpH; __textBounds.SetBounds(textLeftMargin + transLeftMargin, titleHeight + textTopMargin + transTopMargin + animationWidth + noTitleHeight, @@ -344,35 +342,15 @@ _ProgressPopupPresenter::SetProcessAnimation(void) } } - // Create AnimationFrames - long duration = 1500 / 30; - Rectangle animationBounds; - AnimationFrame* pAniFrame[MAX_PROCESS_IMAGE_COUNT]; - - r = LoadImages(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - for (int i = 0; i < MAX_PROCESS_IMAGE_COUNT; i++) + if (__pAnimationFrameList) { - pAniFrame[i] = null; - - pAniFrame[i] = new (std::nothrow) AnimationFrame(*__pProcessImage[i], duration); - SysTryCatch(NID_UI_CTRL, pAniFrame[i] != null, ,E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + __pAnimationFrameList->RemoveAll(true); + delete __pAnimationFrameList; + __pAnimationFrameList = null; } - __pAnimationFrameList = new (std::nothrow) ArrayList(); - SysTryCatch(NID_UI_CTRL, __pAnimationFrameList != null, ,E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - if (__pAnimationFrameList != null) - { - __pAnimationFrameList->Construct(); - - for (int i = 0; i < MAX_PROCESS_IMAGE_COUNT; i++) - { - r = __pAnimationFrameList->Add(*pAniFrame[i]); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - } - } + r = GET_ANIMATION_CONFIG_N(POPUP::PROCESSING_ANIMATION, __pAnimationFrameList); + SysTryReturnResult(NID_UI, r == E_SUCCESS, E_SYSTEM,"System error is occured."); delete __pAnimation; __pAnimation = null; @@ -386,11 +364,11 @@ _ProgressPopupPresenter::SetProcessAnimation(void) __pAnimation->SetAnimationFrames(*__pAnimationFrameList); } - __pAnimation->SetImageCount(MAX_PROCESS_IMAGE_COUNT); + __pAnimation->SetImageCount(__pAnimationFrameList->GetCount()); __pAnimation->SetRepeatCount(ANIMATION_REPEAT_COUNT); __pAnimation->AddAnimationEventListener(*this); - animationBounds = __pProgressPopup->GetAnimationRect(); + FloatRectangle animationBounds = __pProgressPopup->GetAnimationRect(); if (__pProgressPopup->HasTitle() || __pProgressPopup->HasText() || __pProgressPopup->HasButton()) { __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height)); @@ -398,22 +376,13 @@ _ProgressPopupPresenter::SetProcessAnimation(void) else { __pAnimation->GetVisualElement()->SetOpacity(0.6f); - __pAnimation->SetBounds(FloatRectangle(0, 0, animationBounds.width, animationBounds.height)); + __pAnimation->SetBounds(FloatRectangle(0.0f, 0.0f, animationBounds.width, animationBounds.height)); } __pProgressPopup->AttachChild(*__pAnimation); } return r; - -CATCH: - for (int i = 0; i < MAX_PROCESS_IMAGE_COUNT; i++) - { - delete __pProcessImage[i]; - __pProcessImage[i] = null; - } - - return r; } void @@ -455,31 +424,26 @@ _ProgressPopupPresenter::Draw(void) { result r = E_SUCCESS; - int titleTextSize = 0; - int bodyTextSize = 0; - int defaultWidth = 0; - int titleHeight = 0; + float titleTextSize = 0.0f; + float bodyTextSize = 0.0f; + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + + float btnHeight = 0.0f; + float btnTopMargin = 0.0f; + float btnBottomMargin = 0.0f; - int btnHeight = 0; - int btnTopMargin = 0; - int btnBottomMargin = 0; + float transTopMargin = 0.0f; + float titleTopMargin = 0.0f; + float animationWidth = 0.0f; - int transTopMargin = 0; - int titleTopMargin = 0; - int animationWidth = 0; + bool isCustomBitmap = false; - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, __pProgressPopup->GetOrientation(), titleTextSize); - GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, __pProgressPopup->GetOrientation(), bodyTextSize); + _ControlOrientation orientation; - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pProgressPopup->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pProgressPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, __pProgressPopup->GetOrientation(), titleTopMargin); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, __pProgressPopup->GetOrientation(), animationWidth); + isCustomBitmap = IS_CUSTOM_BITMAP(POPUP::BG_NORMAL); - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pProgressPopup->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __pProgressPopup->GetOrientation(), btnHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, __pProgressPopup->GetOrientation(), btnTopMargin); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, __pProgressPopup->GetOrientation(), btnBottomMargin); + orientation = __pProgressPopup->GetOrientation(); Canvas* pCanvas = __pProgressPopup->GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas."); @@ -487,23 +451,55 @@ _ProgressPopupPresenter::Draw(void) pCanvas->SetBackgroundColor(Color(0x00000000)); pCanvas->Clear(); - bool hasBgBitmap = (__pProgressPopup->GetBackgroundBitmap() != null); + if (__transparent) + { + return; + } - int totalH = __pProgressPopup->GetTotalHeight(); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, bodyTextSize); + + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, btnTopMargin); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, orientation, btnBottomMargin); + + + float totalH = __pProgressPopup->GetTotalHeight(); + + const Bitmap* pBackgroundBitmap = __pProgressPopup->GetBackgroundBitmap(); + const Bitmap* pOutlineBitmap = __pProgressPopup->GetOutlineBitmap(); + + FloatRectangle bgBounds(0.0f, 0.0f, defaultWidth, totalH); // Draw BG - if (hasBgBitmap && (__pProgressPopup->HasTitle() || __pProgressPopup->HasText() || __pProgressPopup->HasButton())) + if (pBackgroundBitmap != null) { - Rectangle bounds(0, 0, defaultWidth, totalH); - - const Bitmap* pBackgroundBitmap = __pProgressPopup->GetBackgroundBitmap(); if (pBackgroundBitmap->IsNinePatchedBitmap() == true) { - pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); + pCanvas->DrawNinePatchedBitmap(bgBounds, *pBackgroundBitmap); + } + else + { + pCanvas->DrawBitmap(bgBounds, *pBackgroundBitmap); + } + } + + // Draw Outline + if (!isCustomBitmap && pOutlineBitmap != null) + { + if (pOutlineBitmap->IsNinePatchedBitmap() == true) + { + pCanvas->DrawNinePatchedBitmap(bgBounds, *pOutlineBitmap); } else { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap); + pCanvas->DrawBitmap(bgBounds, *pOutlineBitmap); } } @@ -550,76 +546,80 @@ _ProgressPopupPresenter::DoModal(int& modalResult) return E_SUCCESS; } -int +float _ProgressPopupPresenter::GetBodyTextHeight(void) const { - return (__pBodyTextObject == null) ? 0 : __pBodyTextObject->GetTotalHeight(); + return (__pBodyTextObject == null) ? 0.0f : __pBodyTextObject->GetTotalHeightF(); } -Rectangle +FloatRectangle _ProgressPopupPresenter::GetTitleBounds(void) const { return __titleBounds; } -Rectangle +FloatRectangle _ProgressPopupPresenter::GetTextBounds(void) const { return __textBounds; } -Rectangle +FloatRectangle _ProgressPopupPresenter::GetButtonBounds(void) const { - int width = 0; - int height = 0; - int x = 0; - int y = 0; - - int defaultWidth = 0; - int titleHeight = 0; - int btnHeight = 0; - int btnSideMargin1 = 0; - int btnTopMargin = 0; - int transTopMargin = 0; - int animationWidth = 0; - int noTitleHeight = 0; - int textTopMargin = 0; - int textBottomMargin = 0; - - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, __pProgressPopup->GetOrientation(), titleHeight); - GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, __pProgressPopup->GetOrientation(), transTopMargin); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, __pProgressPopup->GetOrientation(), animationWidth); - GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, __pProgressPopup->GetOrientation(), noTitleHeight); - GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, __pProgressPopup->GetOrientation(), textTopMargin); - GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, __pProgressPopup->GetOrientation(), textBottomMargin); - - GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __pProgressPopup->GetOrientation(), defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __pProgressPopup->GetOrientation(), btnHeight); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, __pProgressPopup->GetOrientation(), btnSideMargin1); - GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, __pProgressPopup->GetOrientation(), btnTopMargin); + float width = 0; + float height = 0; + float x = 0; + float y = 0; + + float defaultWidth = 0.0f; + float titleHeight = 0.0f; + float btnHeight = 0.0f; + float btnSideMargin1 = 0.0f; + float btnTopMargin = 0.0f; + float transTopMargin = 0.0f; + float animationWidth = 0.0f; + float noTitleHeight = 0.0f; + float textTopMargin = 0.0f; + float textBottomMargin = 0.0f; + + _ControlOrientation orientation; + + orientation = __pProgressPopup->GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); + GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth); + GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, noTitleHeight); + GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopMargin); + GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin); + + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, orientation, btnSideMargin1); + GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, btnTopMargin); if (!__pProgressPopup->HasButton()) { - return Rectangle(0, 0, 0, 0); + return FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); } if (__pProgressPopup->HasTitle()) { - noTitleHeight = 0; + noTitleHeight = 0.0f; } else { - titleHeight = 0; + titleHeight = 0.0f; } if (!__pProgressPopup->HasText()) { - textTopMargin = 0; - textBottomMargin = 0; + textTopMargin = 0.0f; + textBottomMargin = 0.0f; } - width = defaultWidth - (btnSideMargin1 * 2); + width = defaultWidth - (btnSideMargin1 * 2.0f); height = btnHeight; x = btnSideMargin1; @@ -629,10 +629,10 @@ _ProgressPopupPresenter::GetButtonBounds(void) const + animationWidth + textTopMargin + textBottomMargin - + GetBodyTextHeight() - + btnTopMargin; + + btnTopMargin + + GetBodyTextHeight(); - return Rectangle(x, y, width, height); + return FloatRectangle(x, y, width, height); } bool @@ -654,110 +654,11 @@ _ProgressPopupPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& bool _ProgressPopupPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - Point touchPoint = touchinfo.GetCurrentPosition(); + Point touchPoint = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); return true; } -result -_ProgressPopupPresenter::LoadImages(void) -{ - result r = E_SUCCESS; - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_01, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[0]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_02, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[1]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_03, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[2]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_04, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[3]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_05, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[4]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_06, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[5]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_07, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[6]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_08, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[7]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_09, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[8]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_10, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[9]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_11, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[10]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_12, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[11]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_13, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[12]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_14, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[13]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_15, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[14]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_16, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[15]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_17, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[16]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_18, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[17]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_19, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[18]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_20, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[19]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_21, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[20]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_22, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[21]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_23, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[22]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_24, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[23]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_25, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[24]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_26, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[25]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_27, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[26]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_28, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[27]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_29, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[28]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - r = GET_BITMAP_CONFIG_N(POPUP::PROCESS_ICON_IMAGE_NORMAL_30, BITMAP_PIXEL_FORMAT_ARGB8888, __pProcessImage[29]); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - return r; -} - - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ProgressPresenter.cpp b/src/ui/controls/FUiCtrl_ProgressPresenter.cpp index 5e76678..24ba3c8 100644 --- a/src/ui/controls/FUiCtrl_ProgressPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressPresenter.cpp * @brief This is the implementation file for the _ProgressPresenter class. @@ -36,6 +37,7 @@ _ProgressPresenter::_ProgressPresenter(void) : __pProgress(null) , __pProgressModel(null) , __pResourceBitmap(null) + , __pResourceBarBgBitmap(null) , __pBarResourceEffectBitmap(null) , __pBarBgResourceEffectBitmap(null) , __pBarColorReplacementBitmap(null) @@ -51,6 +53,9 @@ _ProgressPresenter::~_ProgressPresenter(void) delete __pResourceBitmap; __pResourceBitmap = null; + delete __pResourceBarBgBitmap; + __pResourceBarBgBitmap = null; + delete __pBarResourceEffectBitmap; __pBarResourceEffectBitmap = null; @@ -179,39 +184,37 @@ _ProgressPresenter::LoadResource(void) Color bgColor; Color barColor; - r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, bgColor); + r = GET_COLOR_CONFIG(PROGRESS::BAR_BG_NORMAL, bgColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_COLOR_CONFIG(SLIDER::BAR_NORMAL, barColor); + r = GET_COLOR_CONFIG(PROGRESS::BAR_NORMAL, barColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBitmap); + r = GET_BITMAP_CONFIG_N(PROGRESS::BAR_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBgBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - __pBarBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBitmap,Color::GetColor(COLOR_ID_MAGENTA), bgColor); + __pBarBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap,Color::GetColor(COLOR_ID_MAGENTA), bgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - delete __pResourceBitmap; - __pResourceBitmap = null; - - r = GET_BITMAP_CONFIG_N(SLIDER::PROGRESS_BAR_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBitmap); + r = GET_BITMAP_CONFIG_N(PROGRESS::BAR_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); __pBarColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBitmap,Color::GetColor(COLOR_ID_MAGENTA), barColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarBgResourceEffectBitmap); + r = GET_BITMAP_CONFIG_N(PROGRESS::BAR_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarBgResourceEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::PROGRESS_BAR_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarResourceEffectBitmap); + r = GET_BITMAP_CONFIG_N(PROGRESS::BAR_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarResourceEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); opacity = barColor.GetAlpha(); __pBarColorReplacementBitmap->SetAlphaConstant(opacity); __currentBarColor = barColor; + __currentBarBgColor = bgColor; return r; @@ -220,6 +223,9 @@ CATCH: delete __pResourceBitmap; __pResourceBitmap = null; + delete __pResourceBarBgBitmap; + __pResourceBarBgBitmap = null; + delete __pBarResourceEffectBitmap; __pBarResourceEffectBitmap = null; @@ -236,7 +242,7 @@ CATCH: } result -_ProgressPresenter::DrawBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pBitmap) +_ProgressPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap) { result r = E_SUCCESS; @@ -258,38 +264,43 @@ _ProgressPresenter::Draw(void) { result r = E_SUCCESS; - Rectangle bounds = __pProgress->GetBounds(); + FloatRectangle bounds = __pProgress->GetBoundsF(); Canvas* pCanvas = __pProgress->GetCanvasN(); SysTryReturn(NID_UI_CTRL, pCanvas != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get a canvas."); int minValue = __pProgressModel->GetMinValue(); int maxValue = __pProgressModel->GetMaxValue(); - int width = 0; - int height = 0; + float width = 0.0f; + float height = 0.0f; int opacity = 0; - int leftMargin = 0; - int topMargin = 0; - int minimumWidth = 0; - int minimumHeight = 0; - int offset = 0; + float leftMargin = 0.0f; + float topMargin = 0.0f; + float minimumWidth = 0.0f; + float minimumHeight = 0.0f; + float offset = 0.0f; Bitmap* pReplacementBitmap = null; + bool isCustomBarBitmap = false; + Color bgColor; - GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); + r = GET_COLOR_CONFIG(PROGRESS::BAR_BG_NORMAL, bgColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_SHAPE_CONFIG(SLIDER::BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); + r = GET_SHAPE_CONFIG(PROGRESS::BAR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_SHAPE_CONFIG(SLIDER::MINIMUM_SIZE_WITHOUT_ICON, _CONTROL_ORIENTATION_PORTRAIT, minimumWidth); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_SHAPE_CONFIG(PROGRESS::BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_SHAPE_CONFIG(PROGRESS::MINIMUM_SIZE, _CONTROL_ORIENTATION_PORTRAIT, minimumWidth); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_SHAPE_CONFIG(SLIDER::BAR_OFFSET, _CONTROL_ORIENTATION_PORTRAIT, offset); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_SHAPE_CONFIG(PROGRESS::BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_SHAPE_CONFIG(PROGRESS::BAR_OFFSET, _CONTROL_ORIENTATION_PORTRAIT, offset); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - minimumHeight = 2 * topMargin + height; + minimumHeight = 2.0f * topMargin + height; if (bounds.width < minimumWidth) { @@ -304,31 +315,49 @@ _ProgressPresenter::Draw(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - width = bounds.width - (2 * leftMargin) - (2 * offset); + width = bounds.width - (2.0f * leftMargin) - (2.0f * offset); if (maxValue == __pProgressModel->GetValue()) { - width = bounds.width - (2 * leftMargin) - (2 * offset); + width = bounds.width - (2.0f * leftMargin) - (2.0f * offset); } else { - width = (width) * ((__pProgressModel->GetValue() - minValue) * 100 / (maxValue - minValue)) / 100; + width = (width) * ((__pProgressModel->GetValue() - minValue) * 100.0f / (maxValue - minValue)) / 100.0f; } if (__pProgress->IsEnabled() == false) // disabled { - __pBarBgColorReplacementBitmap->SetAlphaConstant(0x4C); + __pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF); + + r = DrawBitmap(*pCanvas, FloatRectangle(leftMargin, (bounds.height - height) / 2.0f, (bounds.width - (2.0f * leftMargin)), height), __pBarBgColorReplacementBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } - else + + opacity = bgColor.GetAlpha(); + __pBarBgColorReplacementBitmap->SetAlphaConstant(opacity); + + isCustomBarBitmap = IS_CUSTOM_BITMAP(PROGRESS::BAR_BG_NORMAL); + + if (__pProgress->GetBarBackgroundColor() != __currentBarBgColor) { - opacity = __pProgress->GetBarColor().GetAlpha(); - __pBarBgColorReplacementBitmap->SetAlphaConstant(opacity); + pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pProgress->GetBarBackgroundColor()); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to get replacement color.", GetErrorMessage(r)); + delete __pBarBgColorReplacementBitmap; + __pBarBgColorReplacementBitmap = null; + + __pBarBgColorReplacementBitmap = pReplacementBitmap; + __currentBarBgColor = __pProgress->GetBarBackgroundColor(); } - r = DrawBitmap(*pCanvas, Rectangle(leftMargin, (bounds.height - height) / 2, (bounds.width - (2 * leftMargin)), height), __pBarBgColorReplacementBitmap); + r = DrawBitmap(*pCanvas, FloatRectangle(leftMargin, (bounds.height - height) / 2.0f, (bounds.width - (2.0f * leftMargin)), height), __pBarBgColorReplacementBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = DrawBitmap(*pCanvas, Rectangle(leftMargin, (bounds.height - height) / 2, (bounds.width - (2 * leftMargin)), height), __pBarBgResourceEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + if (isCustomBarBitmap == false) + { + r = DrawBitmap(*pCanvas, FloatRectangle(leftMargin, (bounds.height - height) / 2.0f, (bounds.width - (2.0f * leftMargin)), height), __pBarBgResourceEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } if (width > 0) { @@ -353,12 +382,17 @@ _ProgressPresenter::Draw(void) __pBarColorReplacementBitmap->SetAlphaConstant(opacity); } - r = DrawBitmap(*pCanvas, Rectangle((leftMargin + offset), (bounds.height - height) / 2, width, height), __pBarColorReplacementBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + isCustomBarBitmap = IS_CUSTOM_BITMAP(PROGRESS::BAR_NORMAL); - r = DrawBitmap(*pCanvas, Rectangle((leftMargin + offset), (bounds.height - height) / 2, width, height), __pBarResourceEffectBitmap); + r = DrawBitmap(*pCanvas, FloatRectangle((leftMargin + offset), (bounds.height - height) / 2.0f, width, height), __pBarColorReplacementBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + if (isCustomBarBitmap == false) + { + r = DrawBitmap(*pCanvas, FloatRectangle((leftMargin + offset), (bounds.height - height) / 2.0f, width, height), __pBarResourceEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + } delete pCanvas; diff --git a/src/ui/controls/FUiCtrl_PublicAdjustmentEvent.cpp b/src/ui/controls/FUiCtrl_PublicAdjustmentEvent.cpp index 8496a9b..7b5a342 100644 --- a/src/ui/controls/FUiCtrl_PublicAdjustmentEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicAdjustmentEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicAdjustmentEvent.cpp * @brief This is the implementation for the _AdjustmentEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicAnimationEvent.cpp b/src/ui/controls/FUiCtrl_PublicAnimationEvent.cpp index ca1a2f3..5fc6df3 100644 --- a/src/ui/controls/FUiCtrl_PublicAnimationEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicAnimationEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicAnimationEvent.cpp * @brief This is the implementation for the AnimationEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicColorChangeEvent.cpp b/src/ui/controls/FUiCtrl_PublicColorChangeEvent.cpp index c826f7d..2407ddf 100644 --- a/src/ui/controls/FUiCtrl_PublicColorChangeEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicColorChangeEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicColorChangeEvent.cpp * @brief This is the implementation for the _PublicColorChangeEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicDateTimeChangeEvent.cpp b/src/ui/controls/FUiCtrl_PublicDateTimeChangeEvent.cpp index 13399f4..0b4c153 100644 --- a/src/ui/controls/FUiCtrl_PublicDateTimeChangeEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicDateTimeChangeEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicDateTimeChangeEvent.cpp * @brief This is the implementation file for the _PublicDateTimeChangeEvent and _PublicDateTimeChangeEventArg classes. diff --git a/src/ui/controls/FUiCtrl_PublicFrameEvent.cpp b/src/ui/controls/FUiCtrl_PublicFrameEvent.cpp index d62649b..c5920d6 100644 --- a/src/ui/controls/FUiCtrl_PublicFrameEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicFrameEvent.cpp @@ -165,6 +165,12 @@ _PublicFrameEvent::FireImpl(IEventListener& listener, const IEventArg& arg) case FRAME_STATE_DEACTIVATED : pFrameListener->OnFrameDeactivated(*pArg->GetSource()); break; + case FRAME_STATE_MINIMIZED: + pFrameListener->OnFrameMinimized(*pArg->GetSource()); + break; + case FRAME_STATE_RESTORED: + pFrameListener->OnFrameRestored(*pArg->GetSource()); + break; default : SysLogException(NID_UI_CTRL, E_INVALID_ARG, "[E_INVALID_ARG] The invalid event argument was given."); break; diff --git a/src/ui/controls/FUiCtrl_PublicKeypadEvent.cpp b/src/ui/controls/FUiCtrl_PublicKeypadEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_PublicLanguageEvent.cpp b/src/ui/controls/FUiCtrl_PublicLanguageEvent.cpp old mode 100644 new mode 100755 index 1f5591d..fb525a9 --- a/src/ui/controls/FUiCtrl_PublicLanguageEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicLanguageEvent.cpp @@ -17,7 +17,7 @@ /** * @file FUiCtrl_PublicLanguageEvent.cpp * @brief This is the implementation for the _LanguageEvent class. - * @version 1.0 + * @version 2.0 */ // includes diff --git a/src/ui/controls/FUiCtrl_PublicLinkEvent.cpp b/src/ui/controls/FUiCtrl_PublicLinkEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_PublicProgressPopupEvent.cpp b/src/ui/controls/FUiCtrl_PublicProgressPopupEvent.cpp old mode 100644 new mode 100755 index de9e548..9ee831d --- a/src/ui/controls/FUiCtrl_PublicProgressPopupEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicProgressPopupEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicProgressPopupEvent.cpp * @brief This is the implementation for the _PublicProgressPopupEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicScrollPanelEvent.cpp b/src/ui/controls/FUiCtrl_PublicScrollPanelEvent.cpp index bc844da..d5420e1 100644 --- a/src/ui/controls/FUiCtrl_PublicScrollPanelEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicScrollPanelEvent.cpp @@ -14,10 +14,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicScrollPanelEvent.cpp * @brief This is the implementation for the _PublicScrollPanelEvent class. -* @version 1.0 +* @version 2.0 */ // includes diff --git a/src/ui/controls/FUiCtrl_PublicSliderEvent.cpp b/src/ui/controls/FUiCtrl_PublicSliderEvent.cpp index 4ab77c1..e65f2c6 100644 --- a/src/ui/controls/FUiCtrl_PublicSliderEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicSliderEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicSliderEvent.cpp * @brief This is the implementation for the _PublicSliderEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicSplitPanelEvent.cpp b/src/ui/controls/FUiCtrl_PublicSplitPanelEvent.cpp index 5d9510a..9115a3f 100644 --- a/src/ui/controls/FUiCtrl_PublicSplitPanelEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicSplitPanelEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicSplitPanelEvent.cpp * @brief This is the implementation for the _PublicSplitPanelEvent class. @@ -143,7 +144,8 @@ _PublicSplitPanelEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, { // cast to IActionEventListener ISplitPanelEventListener* pSplitPanelEventListener = dynamic_cast (&listener); - SysTryReturnVoidResult(NID_UI_CTRL, pSplitPanelEventListener != null, E_INVALID_ARG, "[E_INVALID_ARG] The invalid listener was given."); + ISplitPanelEventListenerF* pSplitPanelEventListenerF = dynamic_cast (&listener); + SysTryReturnVoidResult(NID_UI_CTRL, pSplitPanelEventListener != null || pSplitPanelEventListenerF != null, E_INVALID_ARG, "[E_INVALID_ARG] The invalid listener was given."); // cast to _PublicSplitPanelEventArg const _PublicSplitPanelEventArg* pArg = dynamic_cast (&arg); @@ -156,11 +158,27 @@ _PublicSplitPanelEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, SplitPanelEventStatus status = pArg->GetStatus(); if (status == SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE) { - pSplitPanelEventListener->OnDividerPositionChanged(*pSource, pSource->GetDividerPosition()); + if (pSplitPanelEventListener) + { + pSplitPanelEventListener->OnDividerPositionChanged(*pSource, pSource->GetDividerPosition()); + } + + if (pSplitPanelEventListenerF) + { + pSplitPanelEventListenerF->OnDividerPositionChanged(*pSource, pSource->GetDividerPositionF()); + } } else { - pSplitPanelEventListener->OnDividerDoublePressed(*pSource); + if (pSplitPanelEventListener) + { + pSplitPanelEventListener->OnDividerDoublePressed(*pSource); + } + + if (pSplitPanelEventListenerF) + { + pSplitPanelEventListenerF->OnDividerDoublePressed(*pSource); + } } } diff --git a/src/ui/controls/FUiCtrl_PublicTextBlockEvent.cpp b/src/ui/controls/FUiCtrl_PublicTextBlockEvent.cpp index d51ffd7..a209425 100644 --- a/src/ui/controls/FUiCtrl_PublicTextBlockEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicTextBlockEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicTextBlockEvent.cpp * @brief This is the implementation for the _PublicTextBlockEvent class. diff --git a/src/ui/controls/FUiCtrl_PublicTextEvent.cpp b/src/ui/controls/FUiCtrl_PublicTextEvent.cpp index a5275ed..133a482 100644 --- a/src/ui/controls/FUiCtrl_PublicTextEvent.cpp +++ b/src/ui/controls/FUiCtrl_PublicTextEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicTextEvent.cpp * @brief This is the implementation for the _PublicTextEvent class. diff --git a/src/ui/controls/FUiCtrl_RadioGroupImpl.cpp b/src/ui/controls/FUiCtrl_RadioGroupImpl.cpp index c91c640..952827c 100644 --- a/src/ui/controls/FUiCtrl_RadioGroupImpl.cpp +++ b/src/ui/controls/FUiCtrl_RadioGroupImpl.cpp @@ -47,6 +47,20 @@ _RadioGroupImpl::RadioGroupSizeInfo::GetDefaultMinimumSize(_ControlOrientation o return dimension; } +FloatDimension +_RadioGroupImpl::RadioGroupSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + result r = E_SUCCESS; + FloatDimension dimension(0.0f, 0.0f); + + r = GET_DIMENSION_CONFIG(RADIOGROUP::MIN_SIZE, orientation, dimension); + SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] A system error occurred.", GetErrorMessage(r)); + + SetLastResult(r); + + return dimension; +} + _RadioGroupImpl* _RadioGroupImpl::GetInstance(RadioGroup& radioGroup) { @@ -127,10 +141,9 @@ _RadioGroupImpl::GetCore(void) result _RadioGroupImpl::OnAttachedToMainTree(void) { - result r = SetFocusable(false); _ControlImpl::OnAttachedToMainTree(); - return r; + return E_SUCCESS; } result @@ -143,6 +156,7 @@ _RadioGroupImpl::Add(const CheckButton& checkButton) return r; } + result _RadioGroupImpl::Remove(const CheckButton& checkButton) { diff --git a/src/ui/controls/FUiCtrl_Scroll.cpp b/src/ui/controls/FUiCtrl_Scroll.cpp index 18716b1..8be0ef2 100644 --- a/src/ui/controls/FUiCtrl_Scroll.cpp +++ b/src/ui/controls/FUiCtrl_Scroll.cpp @@ -49,9 +49,9 @@ _Scroll::CreateScrollN(Tizen::Ui::_Control& parentCtrl, bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition) + float viewRange, + float scrollRange, + float scrollPosition) { result r = E_SUCCESS; ClearLastResult(); @@ -85,9 +85,9 @@ _Scroll::Construct(Tizen::Ui::_Control& parentCtrl, bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition) + float viewRange, + float scrollRange, + float scrollPosition) { _ScrollPresenter* pPresenter = _ScrollPresenter::CreateScrollPresenterN(parentCtrl, *this, @@ -133,24 +133,24 @@ _Scroll::GetScrollDirection(void) const } result -_Scroll::SetScrollRange(int viewRange, int scrollRange) +_Scroll::SetScrollRange(float viewRange, float scrollRange) { return GetPresenter().SetScrollRange(viewRange, scrollRange); } void -_Scroll::GetScrollRange(int* pViewRange, int* pScrollRange) const +_Scroll::GetScrollRange(float* pViewRange, float* pScrollRange) const { GetPresenter().GetScrollRange(pViewRange, pScrollRange); } result -_Scroll::SetScrollPosition(int scrollPosition) +_Scroll::SetScrollPosition(float scrollPosition) { return GetPresenter().SetScrollPosition(scrollPosition); } -int +float _Scroll::GetScrollPosition(void) const { return GetPresenter().GetScrollPosition(); diff --git a/src/ui/controls/FUiCtrl_ScrollEvent.cpp b/src/ui/controls/FUiCtrl_ScrollEvent.cpp index a14c325..1285b9e 100644 --- a/src/ui/controls/FUiCtrl_ScrollEvent.cpp +++ b/src/ui/controls/FUiCtrl_ScrollEvent.cpp @@ -21,6 +21,7 @@ */ #include +#include #include #include #include "FUiCtrl_ScrollEvent.h" @@ -76,7 +77,12 @@ void _ScrollEvent::FireImpl(IEventListener& listener, const IEventArg& arg) { IScrollEventListener* pScrollEventListener = dynamic_cast (&listener); - SysTryReturnVoidResult(NID_UI_CTRL, (pScrollEventListener != null), E_INVALID_ARG, "[%s] The invalid listener was given.", GetErrorMessage(E_INVALID_ARG)); + IScrollEventListenerF* pScrollEventListenerF = null; + if (pScrollEventListener == null) + { + pScrollEventListenerF = dynamic_cast (&listener); + SysTryReturnVoidResult(NID_UI_CTRL, (pScrollEventListenerF != null), E_INVALID_ARG, "[%s] The invalid listener was given.", GetErrorMessage(E_INVALID_ARG)); + } const _ScrollEventArg* pArg = dynamic_cast (&arg); SysTryReturnVoidResult(NID_UI_CTRL, (pArg != null), E_INVALID_ARG, "[%s] The invalid Event Argument was given.", GetErrorMessage(E_INVALID_ARG)); @@ -84,13 +90,34 @@ _ScrollEvent::FireImpl(IEventListener& listener, const IEventArg& arg) switch (pArg->GetEventType()) { case SCROLL_EVENT_ON_SCROLL_STOPPED: - pScrollEventListener->OnScrollStopped(*pArg->GetSource()); + if (pScrollEventListener != null) + { + pScrollEventListener->OnScrollStopped(*pArg->GetSource()); + } + else + { + pScrollEventListenerF->OnScrollStopped(*pArg->GetSource()); + } break; case SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED: - pScrollEventListener->OnScrollPositionChanged(*pArg->GetSource(), pArg->GetScrollPosition()); + if (pScrollEventListener != null) + { + pScrollEventListener->OnScrollPositionChanged(*pArg->GetSource(), pArg->GetScrollPosition()); + } + else + { + pScrollEventListenerF->OnScrollPositionChanged(*pArg->GetSource(), pArg->GetScrollPosition()); + } break; case SCROLL_EVENT_ON_SCROLL_END_REACHED: - pScrollEventListener->OnScrollEndReached(*pArg->GetSource(), pArg->GetScrollType()); + if (pScrollEventListener != null) + { + pScrollEventListener->OnScrollEndReached(*pArg->GetSource(), pArg->GetScrollType()); + } + else + { + pScrollEventListenerF->OnScrollEndReached(*pArg->GetSource(), pArg->GetScrollType()); + } break; default: SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "[%s] The invalid Event Argument was given.", GetErrorMessage(E_INVALID_ARG)); diff --git a/src/ui/controls/FUiCtrl_ScrollEventArg.cpp b/src/ui/controls/FUiCtrl_ScrollEventArg.cpp index c6c4c8e..78154f5 100644 --- a/src/ui/controls/FUiCtrl_ScrollEventArg.cpp +++ b/src/ui/controls/FUiCtrl_ScrollEventArg.cpp @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui { namespace Controls //////////////////////////////////////////////////////////////////////////////// /// _ScrollEventArg class Lifecycle -_ScrollEventArg::_ScrollEventArg(_ScrollEventType eventType, const Control& source, int scrollPosition, ScrollEndEvent scrollType) +_ScrollEventArg::_ScrollEventArg(_ScrollEventType eventType, const Control& source, float scrollPosition, ScrollEndEvent scrollType) : __eventType(eventType) , __pSource(const_cast (&source)) , __scrollPosition(scrollPosition) @@ -56,7 +56,7 @@ _ScrollEventArg::GetScrollEventArgN(const Control& source) } _ScrollEventArg* -_ScrollEventArg::GetScrollEventArgN(const Control& source, int scrollPosition) +_ScrollEventArg::GetScrollEventArgN(const Control& source, float scrollPosition) { _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED, source, scrollPosition); SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); @@ -67,7 +67,7 @@ _ScrollEventArg::GetScrollEventArgN(const Control& source, int scrollPosition) _ScrollEventArg* _ScrollEventArg::GetScrollEventArgN(const Control& source, ScrollEndEvent scrollType) { - _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1, scrollType); + _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1.0f, scrollType); SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); return pEventArg; @@ -88,7 +88,7 @@ _ScrollEventArg::GetSource(void) const return __pSource; } -int +float _ScrollEventArg::GetScrollPosition(void) const { return __scrollPosition; diff --git a/src/ui/controls/FUiCtrl_ScrollPanel.cpp b/src/ui/controls/FUiCtrl_ScrollPanel.cpp index 55ce022..e311347 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanel.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanel.cpp @@ -56,7 +56,7 @@ _ScrollPanel::_ScrollPanel(void) , __scrollInputMode(SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION) , __autoResizingEnable(true) , __pageScrollEnabled(false) - , __pageScrollAlignSize(Dimension(0, 0)) + , __pageScrollAlignSize(FloatDimension(0.0f, 0.0f)) , __pageScrollMoveOnlyOnePageOnFlick(true) , __scrollBarVisible(true) , __pHorizontalScrollBar(null) @@ -115,7 +115,7 @@ _ScrollPanel::~_ScrollPanel(void) } _ScrollPanel* -_ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, bool pageScrollEnabled) +_ScrollPanel::CreateScrollPanelN(const FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, bool pageScrollEnabled) { ClearLastResult(); result r = E_SUCCESS; @@ -123,7 +123,7 @@ _ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirecti _Scroll* pHorizontalScrollBar = null; _Scroll* pVerticalScrollBar = null; - Rectangle areaBounds = const_cast(rect); + FloatRectangle areaBounds = const_cast(rect); _ScrollPanel* pScrollPanel = new (std::nothrow) _ScrollPanel; SysTryReturn(NID_UI_CTRL, pScrollPanel != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); @@ -145,7 +145,7 @@ _ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirecti r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL && rect.height > 0) + if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL && rect.height > 0.0f) { pVerticalScrollBar = _Scroll::CreateScrollN(*pScrollPanel, SCROLL_DIRECTION_VERTICAL, @@ -155,7 +155,7 @@ _ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirecti false, rect.height, rect.height, - 0); + 0.0f); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r ==E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -171,7 +171,7 @@ _ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirecti pScrollPanel->SetVerticalScrollBar(pVerticalScrollBar); } - if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL && rect.width > 0) + if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL && rect.width > 0.0f) { pHorizontalScrollBar = _Scroll::CreateScrollN(*pScrollPanel, SCROLL_DIRECTION_HORIZONTAL, @@ -181,7 +181,7 @@ _ScrollPanel::CreateScrollPanelN(const Rectangle& rect, ScrollPanelScrollDirecti false, rect.width, rect.width, - 0); + 0.0f); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r ==E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -301,7 +301,7 @@ _ScrollPanel::OnDraw(void) } result -_ScrollPanel::OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds) +_ScrollPanel::OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds) { ClearLastResult(); @@ -393,11 +393,18 @@ _ScrollPanel::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& c } bool -_ScrollPanel::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_ScrollPanel::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { ClearLastResult(); - return __pScrollPanelPresenter->OnAccessibilityReadElement(control, element); + return __pScrollPanelPresenter->OnAccessibilityReadingElement(control, element); +} +bool +_ScrollPanel::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + ClearLastResult(); + + return __pScrollPanelPresenter->OnAccessibilityReadedElement(control, element); } bool @@ -433,6 +440,13 @@ _ScrollPanel::OnAccessibilityValueDecreased(const _AccessibilityContainer& contr { return true; } +bool +_ScrollPanel::OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction) +{ + ClearLastResult(); + + return __pScrollPanelPresenter->OnAccessibilityItemRefreshed(control, element, direction); +} _UiTouchEventDelivery _ScrollPanel::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { @@ -514,11 +528,27 @@ _ScrollPanel::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_ScrollPanel::OnScrollPositionChanged(_Control& source, int scrollPos) +_ScrollPanel::OnScrollPositionChanged(_Control& source, float scrollPosition) +{ + ClearLastResult(); + + __pScrollPanelPresenter->OnScrollPositionChanged(source, scrollPosition); +} + +void +_ScrollPanel::OnScrollStopped(_Control& source) +{ + ClearLastResult(); + + __pScrollPanelPresenter->OnScrollStopped(source); +} + +void +_ScrollPanel::OnScrollJumpToTop(_Control& source) { ClearLastResult(); - __pScrollPanelPresenter->OnScrollPositionChanged(source, scrollPos); + __pScrollPanelPresenter->OnScrollJumpToTop(source); } void @@ -584,7 +614,7 @@ _ScrollPanel::SetScrollAreaAutoResizingEnabled(bool autoResizingEnable) __autoResizingEnable = autoResizingEnable; } -Rectangle +FloatRectangle _ScrollPanel::GetScrollAreaBounds(void) const { ClearLastResult(); @@ -593,7 +623,7 @@ _ScrollPanel::GetScrollAreaBounds(void) const } result -_ScrollPanel::SetClientAreaHeight(int height) +_ScrollPanel::SetClientAreaHeight(float height) { ClearLastResult(); @@ -601,7 +631,7 @@ _ScrollPanel::SetClientAreaHeight(int height) } result -_ScrollPanel::SetClientAreaWidth(int width) +_ScrollPanel::SetClientAreaWidth(float width) { ClearLastResult(); @@ -609,7 +639,7 @@ _ScrollPanel::SetClientAreaWidth(int width) } result -_ScrollPanel::SetScrollAreaBounds(Rectangle& bounds) +_ScrollPanel::SetScrollAreaBounds(FloatRectangle& bounds) { ClearLastResult(); @@ -632,7 +662,7 @@ _ScrollPanel::SetPageScrollEnabled(bool enable) __pageScrollEnabled = enable; } -Dimension +FloatDimension _ScrollPanel::GetPageScrollAlignSize(void) const { ClearLastResult(); @@ -641,7 +671,7 @@ _ScrollPanel::GetPageScrollAlignSize(void) const } void -_ScrollPanel::SetPageScrollAlignSize(Dimension size) +_ScrollPanel::SetPageScrollAlignSize(FloatDimension size) { ClearLastResult(); @@ -655,14 +685,14 @@ _ScrollPanel::IsPageScrollFlickMoveLimitedOnePage(void) const } void -_ScrollPanel::SetScrollPosition(int position, bool withAnimation) +_ScrollPanel::SetScrollPosition(float position, bool withAnimation) { ClearLastResult(); __pScrollPanelPresenter->SetScrollPosition(position, withAnimation); } -int +float _ScrollPanel::GetScrollPosition(void) const { ClearLastResult(); @@ -670,7 +700,7 @@ _ScrollPanel::GetScrollPosition(void) const return __pScrollPanelPresenter->GetScrollPosition(); } -int +float _ScrollPanel::GetVerticalScrollPosition(void) const { ClearLastResult(); @@ -679,14 +709,14 @@ _ScrollPanel::GetVerticalScrollPosition(void) const } void -_ScrollPanel::SetVerticalScrollPosition(int position) +_ScrollPanel::SetVerticalScrollPosition(float position) { ClearLastResult(); __pScrollPanelPresenter->SetVerticalScrollPosition(position); } -int +float _ScrollPanel::GetHorizontalScrollPosition(void) const { ClearLastResult(); @@ -695,7 +725,7 @@ _ScrollPanel::GetHorizontalScrollPosition(void) const } void -_ScrollPanel::SetHorizontalScrollPosition(int position) +_ScrollPanel::SetHorizontalScrollPosition(float position) { ClearLastResult(); @@ -917,13 +947,13 @@ _ScrollPanel::SetHorizontalScrollBar(const _Scroll* pHorizontalScrollBar) } bool -_ScrollPanel::IsFixingClientBoundsEnable(void) const +_ScrollPanel::IsFixingClientBoundsEnabled(void) const { return __fixingClientBoundsEnable; } void -_ScrollPanel::SetFixingClientBoundsEnable(bool enable) +_ScrollPanel::SetFixingClientBoundsEnabled(bool enable) { __fixingClientBoundsEnable = enable; } @@ -960,7 +990,7 @@ _ScrollPanel::FireOnScrollPositionChangedEvent(void) } result -_ScrollPanel::FireOnScrollPositionChangedEvent(int scrollPosition) +_ScrollPanel::FireOnScrollPositionChangedEvent(float scrollPosition) { ClearLastResult(); diff --git a/src/ui/controls/FUiCtrl_ScrollPanelEvent.cpp b/src/ui/controls/FUiCtrl_ScrollPanelEvent.cpp index 7da9030..bfc32ea 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanelEvent.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanelEvent.cpp @@ -18,7 +18,7 @@ /** * @file FUiCtrl_ScrollPanelEvent.cpp * @brief This is the implementation for the _ScrollPanelEvent class. -* @version 1.0 +* @version 2.0 */ // includes diff --git a/src/ui/controls/FUiCtrl_ScrollPanelImpl.cpp b/src/ui/controls/FUiCtrl_ScrollPanelImpl.cpp index 0310536..924d70d 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanelImpl.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanelImpl.cpp @@ -27,6 +27,7 @@ #include #include "FApp_AppInfo.h" #include "FUi_LayoutImpl.h" +#include "FUi_LayoutLayoutMaker.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_Edit.h" #include "FUiCtrl_ScrollEvent.h" @@ -55,7 +56,7 @@ _ScrollPanelImpl::~_ScrollPanelImpl(void) } _ScrollPanelImpl* -_ScrollPanelImpl::CreateScrollPanelImplN(ScrollPanel* pControl, const Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) +_ScrollPanelImpl::CreateScrollPanelImplN(ScrollPanel* pControl, const FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) { ClearLastResult(); @@ -84,7 +85,7 @@ _ScrollPanelImpl::CreateScrollPanelImplN(ScrollPanel* pControl, const Rectangle& r = pImpl->SetBounds(rect); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - pCore->SetFixingClientBoundsEnable(!_AppInfo::IsOspCompat()); + pCore->SetFixingClientBoundsEnabled(!_AppInfo::IsOspCompat()); return pImpl; @@ -162,6 +163,30 @@ _ScrollPanelImpl::AddScrollEventListener(IScrollEventListener& listener) } void +_ScrollPanelImpl::AddScrollEventListener(IScrollEventListenerF& listener) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + if (__pScrollEvent == null) + { + __pScrollEvent = new (std::nothrow) _ScrollEvent(); + SysTryReturnVoidResult(NID_UI_CTRL, __pScrollEvent != null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient", GetErrorMessage(E_OUT_OF_MEMORY)); + + r = __pScrollEvent->Construct(GetPublic()); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + r = __pScrollEvent->AddListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + GetCore().AddScrollEventListener(*this); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} + +void _ScrollPanelImpl::RemoveScrollEventListener(IScrollEventListener& listener) { ClearLastResult(); @@ -174,6 +199,18 @@ _ScrollPanelImpl::RemoveScrollEventListener(IScrollEventListener& listener) } void +_ScrollPanelImpl::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + ClearLastResult(); + + if (__pScrollEvent != null) + { + result r = __pScrollEvent->RemoveListener(listener); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } +} + +void _ScrollPanelImpl::OnScrollEndReached(_Control& source, ScrollEndEvent type) { if (__pScrollEvent == null) @@ -193,7 +230,7 @@ CATCH: } void -_ScrollPanelImpl::OnScrollPositionChanged(_Control& source, int scrollPosition) +_ScrollPanelImpl::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (__pScrollEvent == null) { @@ -230,14 +267,14 @@ CATCH: delete pEventArg; } -int +float _ScrollPanelImpl::GetScrollPosition(void) const { return GetCore().GetScrollPosition(); } void -_ScrollPanelImpl::SetScrollPosition(int position, bool withAnimation) +_ScrollPanelImpl::SetScrollPosition(float position, bool withAnimation) { GetCore().SetScrollPosition(position, withAnimation); } @@ -290,20 +327,20 @@ _ScrollPanelImpl::CloseOverlayWindow(void) return E_SUCCESS; } -Rectangle +FloatRectangle _ScrollPanelImpl::GetClientAreaBounds(void) const { return GetCore().GetScrollAreaBounds(); } result -_ScrollPanelImpl::SetClientAreaHeight(int height) +_ScrollPanelImpl::SetClientAreaHeight(float height) { return GetCore().SetClientAreaHeight(height); } result -_ScrollPanelImpl::SetClientAreaWidth(int width) +_ScrollPanelImpl::SetClientAreaWidth(float width) { return GetCore().SetClientAreaWidth(width); } @@ -380,7 +417,7 @@ protected: result r = E_SYSTEM; ScrollPanel* pScrollPanel = null; - Rectangle rect; + FloatRectangle rect; _UiBuilderControlLayout* pControlProperty = null; _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; @@ -404,10 +441,10 @@ protected: pScrollPanel = new (std::nothrow) ScrollPanel; } SysTryReturn(NID_UI_CTRL, pScrollPanel != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); // Construct - GetLayoutType(pControlProperty, layoutType); + __pLayoutMaker->GetLayoutType(pControlProperty, layoutType); // ScrollDirection if (pControl->GetElement(L"scrollDirection", elementString) || pControl->GetElement(L"ScrollDirection", elementString)) @@ -444,7 +481,7 @@ protected: Layout* pPortraitLayout = null; Layout* pLandscapeLayout = null; result tempResult = E_SUCCESS; - tempResult = GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); + tempResult = __pLayoutMaker->GetLayoutN(pControl, pPortraitLayout, pLandscapeLayout); if (E_SUCCESS == tempResult) { //CONSTRUCT_WITH_LAYOUT_ARG1(pScrollPanel, rect); @@ -490,8 +527,8 @@ protected: // ClientAreaWidth if (pControl->GetElement(L"clientAreaWidth", elementString) || pControl->GetElement(L"ClientAreaWidth", elementString)) { - int width = 0; - Base::Integer::Parse(elementString, width); + float width = 0.0f; + Base::Float::Parse(elementString, width); pScrollPanel->SetClientAreaWidth(width); } } @@ -500,8 +537,8 @@ protected: // ClientAreaHeight if (pControl->GetElement(L"clientAreaHeight", elementString) || pControl->GetElement(L"ClientAreaHeight", elementString)) { - int height = 0; - Base::Integer::Parse(elementString, height); + float height = 0.0f; + Base::Float::Parse(elementString, height); pScrollPanel->SetClientAreaWidth(height); } } diff --git a/src/ui/controls/FUiCtrl_ScrollPanelModel.cpp b/src/ui/controls/FUiCtrl_ScrollPanelModel.cpp index 85b407f..0495877 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanelModel.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanelModel.cpp @@ -21,9 +21,9 @@ * */ -#include -#include -#include +#include +#include +#include #include "FUiCtrl_ScrollPanelModel.h" using namespace Tizen::Graphics; @@ -32,8 +32,8 @@ namespace Tizen { namespace Ui { namespace Controls { _ScrollPanelModel::_ScrollPanelModel(void) - : __currentScrollPosition(Point(0, 0)) - , __scrollAreaBounds(Rectangle(0, 0, 0, 0)) + : __currentScrollPosition(FloatPoint(0.0f, 0.0f)) + , __scrollAreaBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) { // nothing } @@ -44,55 +44,55 @@ _ScrollPanelModel::~_ScrollPanelModel(void) } void -_ScrollPanelModel::SetCurrentScrollPosition(int currentScrollHorizontalPosition, int currentScrollVerticalPosition) +_ScrollPanelModel::SetCurrentScrollPosition(float currentScrollHorizontalPosition, float currentScrollVerticalPosition) { SetCurrentHorizontalScrollPosition(currentScrollHorizontalPosition); SetCurrentVerticalScrollPosition(currentScrollVerticalPosition); } void -_ScrollPanelModel::SetCurrentScrollPosition(Point& currentScrollPosition) +_ScrollPanelModel::SetCurrentScrollPosition(FloatPoint& currentScrollPosition) { __currentScrollPosition = currentScrollPosition; } -Point +FloatPoint _ScrollPanelModel::GetCurrentScrollPosition(void) const { return __currentScrollPosition; } void -_ScrollPanelModel::SetCurrentVerticalScrollPosition(int currentVerticalScrollPosition) +_ScrollPanelModel::SetCurrentVerticalScrollPosition(float currentVerticalScrollPosition) { __currentScrollPosition.y = currentVerticalScrollPosition; } -int +float _ScrollPanelModel::GetCurrentVerticalScrollPosition(void) const { return __currentScrollPosition.y; } void -_ScrollPanelModel::SetCurrentHorizontalScrollPosition(int currentHorizontalScrollPosition) +_ScrollPanelModel::SetCurrentHorizontalScrollPosition(float currentHorizontalScrollPosition) { __currentScrollPosition.x = currentHorizontalScrollPosition; } -int +float _ScrollPanelModel::GetCurrentHorizontalScrollPosition(void) const { return __currentScrollPosition.x; } void -_ScrollPanelModel::SetScrollAreaBounds(Rectangle& areaBounds) +_ScrollPanelModel::SetScrollAreaBounds(FloatRectangle& areaBounds) { __scrollAreaBounds = areaBounds; } -Rectangle +FloatRectangle _ScrollPanelModel::GetScrollAreaBounds(void) const { return __scrollAreaBounds; diff --git a/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp b/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp old mode 100644 new mode 100755 index d346973..d86e3f8 --- a/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp @@ -28,6 +28,7 @@ #include #include #include +#include "FUi_Math.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" #include "FUi_IAccessibilityListener.h" @@ -46,14 +47,13 @@ using namespace Tizen::Ui::Animations; namespace { -const int SCROLL_PANEL_SCROLLING_ANIMATION_DURATION = 1000; -const int SCROLL_PANEL_OVERSCROLLING_MAX_DISTANCCE = 100; - -const int SCROLL_PANEL_FLICK_IN_PIXEL_UNIT = 1000; +const float SCROLL_PANEL_OVERSCROLLING_MAX_DISTANCCE = 100.0f; +const float SCROLL_PANEL_FLICK_IN_PIXEL_UNIT = 1000.0f; const int SCROLL_PANEL_FLICK_WEIGHT_VELOCITY = 1; -const int SCROLL_PANEL_FLICK_WEIGHT_DISTANCE = 5; -const int SCROLL_PANEL_FLICK_ALPHA_PER_PIXEL = 3; +const float SCROLL_PANEL_FLICK_WEIGHT_DISTANCE = 5.0f; +const float SCROLL_PANEL_FLICK_ALPHA_PER_PIXEL = 3.0f; +const int SCROLL_PANEL_SCROLLING_ANIMATION_DURATION = 1000; const int SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_TIMER_DURATION = 1000; const int SCROLL_PANEL_FLICK_SCROLL_EFFECT_TIMER_DURATION = 2000; @@ -76,10 +76,12 @@ _ScrollPanelPresenter::_ScrollPanelPresenter(void) , __flickDirection(_FLICK_DIRECTION_NONE) , __flickCount(0) , __pScrollBarLoadEffectTimer(null) - , __scrollBarFirstLoaded(true) + , __scrollBarLoadEffectStatus(_SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_UNLOAD) + , __firstDrawn(false) , __bouncing(false) , __firstTouchMove(true) , __firstScrollMoveDirection(SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL) + , __jumpToTopRunning(false) { // nothing } @@ -116,6 +118,17 @@ _ScrollPanelPresenter::Initialize(_ScrollPanel& scrollPanel) result _ScrollPanelPresenter::Draw(void) { + + if (!__firstDrawn) + { + if (__scrollBarLoadEffectStatus == _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADING) + { + DoScrollBarLoadEffect(); + } + + __firstDrawn = true; + } + if (__pScrollPanel->GetBackgroundBitmap() == null) { return E_SUCCESS; @@ -145,10 +158,21 @@ CATCH: } result -_ScrollPanelPresenter::OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds) +_ScrollPanelPresenter::OnBoundsChanging(const FloatRectangle& bounds) { + if (__scrollAnimationRunning) + { + StopScrollingAnimation(); + } + else + { + RollbackBouncing(false); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); - Rectangle scrollArea = GetScrollAreaBounds(); + FloatRectangle scrollArea = GetScrollAreaBounds(); if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { if (scrollArea.width < bounds.width) @@ -163,9 +187,9 @@ _ScrollPanelPresenter::OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds scrollArea.height = bounds.height; } } - int scrollPosition = GetScrollPosition(); - int fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, bounds, scrollArea); - if (scrollPosition != fixedScrollPosition) + float scrollPosition = GetScrollPosition(); + float fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, bounds, scrollArea); + if (!_FloatCompare(scrollPosition, fixedScrollPosition)) { ScrollTo(fixedScrollPosition, false); result r = GetLastResult(); @@ -230,7 +254,7 @@ _ScrollPanelPresenter::OnChildBoundsChanged(const _Control& child) } void -_ScrollPanelPresenter::SetScrollPosition(int position, bool withAnimation) +_ScrollPanelPresenter::SetScrollPosition(float position, bool withAnimation) { // change scroll position if (withAnimation) @@ -246,40 +270,40 @@ _ScrollPanelPresenter::SetScrollPosition(int position, bool withAnimation) SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } -int +float _ScrollPanelPresenter::GetScrollPosition(void) const { - int scrollPosition = GetScrollPositionInternal(); + float scrollPosition = GetScrollPositionInternal(); return FixScrollPositionIntoScrollAreaBounds(scrollPosition); } -int +float _ScrollPanelPresenter::GetVerticalScrollPosition(void) const { - int scrollPosition = GetVerticalScrollPositionInternal(); + float scrollPosition = GetVerticalScrollPositionInternal(); return FixScrollPositionIntoScrollAreaBounds(scrollPosition); } void -_ScrollPanelPresenter::SetVerticalScrollPosition(int position) +_ScrollPanelPresenter::SetVerticalScrollPosition(float position) { SetScrollPosition(position, true); } -int +float _ScrollPanelPresenter::GetHorizontalScrollPosition(void) const { - int scrollPosition = GetHorizontalScrollPositionInternal(); + float scrollPosition = GetHorizontalScrollPositionInternal(); return FixScrollPositionIntoScrollAreaBounds(scrollPosition); } void -_ScrollPanelPresenter::SetHorizontalScrollPosition(int position) +_ScrollPanelPresenter::SetHorizontalScrollPosition(float position) { SetScrollPosition(position, true); } -int +float _ScrollPanelPresenter::GetScrollPositionInternal(void) const { ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); @@ -295,7 +319,7 @@ _ScrollPanelPresenter::GetScrollPositionInternal(void) const } void -_ScrollPanelPresenter::SetScrollPositionInternal(int position) +_ScrollPanelPresenter::SetScrollPositionInternal(float position) { ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) @@ -308,26 +332,26 @@ _ScrollPanelPresenter::SetScrollPositionInternal(int position) } } -int +float _ScrollPanelPresenter::GetVerticalScrollPositionInternal(void) const { return __pScrollPanelModel->GetCurrentVerticalScrollPosition(); } void -_ScrollPanelPresenter::SetVerticalScrollPositionInternal(int position) +_ScrollPanelPresenter::SetVerticalScrollPositionInternal(float position) { __pScrollPanelModel->SetCurrentVerticalScrollPosition(position); } -int +float _ScrollPanelPresenter::GetHorizontalScrollPositionInternal(void) const { return __pScrollPanelModel->GetCurrentHorizontalScrollPosition(); } void -_ScrollPanelPresenter::SetHorizontalScrollPositionInternal(int position) +_ScrollPanelPresenter::SetHorizontalScrollPositionInternal(float position) { __pScrollPanelModel->SetCurrentHorizontalScrollPosition(position); } @@ -339,17 +363,17 @@ _ScrollPanelPresenter::StopScrollingAnimation(void) __pScrollPanel->GetVisualElement()->RemoveAnimation(SCROLLING_ANIMATION_NAME); } -int -_ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(int position) const +float +_ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(float position) const { - return FixScrollPositionIntoScrollAreaBounds(position, __pScrollPanel->GetBounds(), GetScrollAreaBounds()); + return FixScrollPositionIntoScrollAreaBounds(position, __pScrollPanel->GetBoundsF(), GetScrollAreaBounds()); } -int -_ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(int position, Rectangle bounds, Rectangle scrollArea) const +float +_ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(float position, FloatRectangle bounds, FloatRectangle scrollArea) const { - int minScrollPos = 0; - int maxScrollPos = 0; + float minScrollPos = 0.0f; + float maxScrollPos = 0.0f; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { minScrollPos = scrollArea.x; @@ -375,7 +399,7 @@ _ScrollPanelPresenter::ScrollToTop(void) void _ScrollPanelPresenter::ScrollToBottom(void) { - SetVerticalScrollPosition(GetScrollAreaBounds().height - __pScrollPanel->GetBounds().height); + SetVerticalScrollPosition(GetScrollAreaBounds().height - __pScrollPanel->GetBoundsF().height); } void @@ -387,28 +411,31 @@ _ScrollPanelPresenter::ScrollToLeft(void) void _ScrollPanelPresenter::ScrollToRight(void) { - SetHorizontalScrollPosition(GetScrollAreaBounds().width - __pScrollPanel->GetBounds().width); + SetHorizontalScrollPosition(GetScrollAreaBounds().width - __pScrollPanel->GetBoundsF().width); } result -_ScrollPanelPresenter::RunPreviewTouchPressed(const _Control& source, const _TouchInfo& touchInfo) +_ScrollPanelPresenter::RunTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { - result r = E_SUCCESS; - // stop flick, stop scroll animation if (__flickRunning || __scrollAnimationRunning) { - StopScrollingAnimation(); + if (!__jumpToTopRunning) + { + StopScrollingAnimation(); + } + + __jumpToTopRunning = false; } - __currentMovedPosition = touchInfo.GetCurrentPosition(); + __currentMovedPosition = FloatPoint(touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); __previousTouchedPosition = __currentMovedPosition; __pPressedControl = &(const_cast<_Control&>(source)); __subControlMoved = false; __touchPressed = true; __firstTouchMove = true; - return r; + return E_SUCCESS; } result @@ -417,7 +444,7 @@ _ScrollPanelPresenter::RunPreviewTouchMoved(const _Control& source, const _Touch if (__pPressedControl == &source && __touchPressed) { __previousTouchedPosition = __currentMovedPosition; - __currentMovedPosition = touchInfo.GetCurrentPosition(); + __currentMovedPosition = FloatPoint(touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); if (__pScrollPanel != &source) { @@ -427,14 +454,14 @@ _ScrollPanelPresenter::RunPreviewTouchMoved(const _Control& source, const _Touch if (__firstTouchMove) { ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); - int scrollDistanceX = __previousTouchedPosition.x - __currentMovedPosition.x; - int scrollDistanceY = __previousTouchedPosition.y - __currentMovedPosition.y; + float scrollDistanceX = __previousTouchedPosition.x - __currentMovedPosition.x; + float scrollDistanceY = __previousTouchedPosition.y - __currentMovedPosition.y; - if (abs(scrollDistanceY) < abs(scrollDistanceX)) + if (_Abs(scrollDistanceY) < _Abs(scrollDistanceX)) { __firstScrollMoveDirection = SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL; } - else if (abs(scrollDistanceY) > abs(scrollDistanceX)) + else if (_Abs(scrollDistanceY) > _Abs(scrollDistanceX)) { __firstScrollMoveDirection = SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL; } @@ -451,23 +478,18 @@ _ScrollPanelPresenter::RunPreviewTouchMoved(const _Control& source, const _Touch } result -_ScrollPanelPresenter::RunPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) +_ScrollPanelPresenter::RunTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - result r = E_SUCCESS; - - if (__pPressedControl != &source) - { - return r; - } + SysTryReturn(NID_UI_CTRL, __pPressedControl == &source, E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] source has changed during touch process.", GetErrorMessage(E_INVALID_OPERATION)); __touchPressed = false; __firstTouchMove = true; if (__pScrollPanel->IsPageScrollEnabled() && !__flickRunning) { - int currentPosition = 0; - int maxPosition = 0; - int pageSize = 0; + float currentPosition = 0.0f; + float maxPosition = 0.0f; + float pageSize = 0.0f; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { @@ -482,11 +504,11 @@ _ScrollPanelPresenter::RunPreviewTouchReleased(const _Control& source, const _To currentPosition = GetVerticalScrollPosition(); } - int targetPosition = 0; - int pageGap = currentPosition % pageSize; + float targetPosition = 0.0f; + float pageGap = currentPosition - (((int)(currentPosition / pageSize)) * pageSize); int lowerPageIndex = currentPosition / pageSize; - int currentPageMin = pageSize * lowerPageIndex; - int currentPageMax = currentPageMin + pageSize; + float currentPageMin = pageSize * lowerPageIndex; + float currentPageMax = currentPageMin + pageSize; currentPageMin = currentPageMax > maxPosition ? (maxPosition / pageSize) * pageSize : currentPageMin; currentPageMax = currentPageMax > maxPosition ? maxPosition : currentPageMax; @@ -499,10 +521,10 @@ _ScrollPanelPresenter::RunPreviewTouchReleased(const _Control& source, const _To targetPosition = currentPageMax; } - if (targetPosition != currentPosition) + if (!_FloatCompare(targetPosition, currentPosition)) { SetScrollPosition(targetPosition, true); - r = GetLastResult(); + result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } } @@ -523,7 +545,7 @@ _ScrollPanelPresenter::RunPreviewTouchReleased(const _Control& source, const _To if (!__scrollAnimationRunning) { RollbackBouncing(true); - r = GetLastResult(); + result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); FadeOutScrollBar(); @@ -537,18 +559,13 @@ _ScrollPanelPresenter::RunPreviewTouchReleased(const _Control& source, const _To } } - return r; + return E_SUCCESS; } result -_ScrollPanelPresenter::RunPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) +_ScrollPanelPresenter::RunTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) { - result r = E_SUCCESS; - - if (__pPressedControl != &source) - { - return r; - } + SysTryReturn(NID_UI_CTRL, __pPressedControl == &source, E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] source has changed during touch process.", GetErrorMessage(E_INVALID_OPERATION)); __touchPressed = false; __firstTouchMove = true; @@ -559,7 +576,7 @@ _ScrollPanelPresenter::RunPreviewTouchCanceled(const _Control& source, const _To if (!__scrollAnimationRunning) { RollbackBouncing(true); - r = GetLastResult(); + result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); FadeOutScrollBar(); @@ -573,15 +590,12 @@ _ScrollPanelPresenter::RunPreviewTouchCanceled(const _Control& source, const _To __pScrollPanel->FireOnScrollStoppedEvent(); } - return r; + return E_SUCCESS; } _UiTouchEventDelivery _ScrollPanelPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { - result r = RunPreviewTouchPressed(source, touchInfo); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, _UI_TOUCH_EVENT_DELIVERY_YES, r, "[%s] Propagating.", GetErrorMessage(r)); - return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } @@ -596,30 +610,19 @@ _ScrollPanelPresenter::OnPreviewTouchMoved(const _Control& source, const _TouchI _UiTouchEventDelivery _ScrollPanelPresenter::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - result r = RunPreviewTouchReleased(source, touchInfo); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, _UI_TOUCH_EVENT_DELIVERY_YES, r, "[%s] Propagating.", GetErrorMessage(r)); - return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } _UiTouchEventDelivery _ScrollPanelPresenter::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { - result r = RunPreviewTouchCanceled(source, touchInfo); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, _UI_TOUCH_EVENT_DELIVERY_YES, r, "[%s] Propagating.", GetErrorMessage(r)); - - return _UI_TOUCH_EVENT_DELIVERY_YES; + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } bool _ScrollPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { - if (__pScrollPanel != &source) - { - return false; - } - - result r = RunPreviewTouchPressed(source, touchInfo); + result r = RunTouchPressed(source, touchInfo); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); return true; @@ -643,7 +646,9 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to return false; } - if (__currentMovedPosition != touchInfo.GetCurrentPosition()) + FloatPoint touchPoint = FloatPoint(touchInfo.GetCurrentPosition().x, touchInfo.GetCurrentPosition().y); + if (!_FloatCompare(__currentMovedPosition.x, touchPoint.x) + || !_FloatCompare(__currentMovedPosition.y, touchPoint.y)) { RunPreviewTouchMoved(source, touchInfo); } @@ -651,9 +656,9 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to // calculate move distance ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); ScrollInputMode scrollInputMode = __pScrollPanel->GetScrollInputMode(); - int scrollDistance = 0; - int scrollDistanceX = __previousTouchedPosition.x - __currentMovedPosition.x; - int scrollDistanceY = __previousTouchedPosition.y - __currentMovedPosition.y; + float scrollDistance = 0.0f; + float scrollDistanceX = __previousTouchedPosition.x - __currentMovedPosition.x; + float scrollDistanceY = __previousTouchedPosition.y - __currentMovedPosition.y; if (scrollInputMode == SCROLL_INPUT_MODE_RESTRICT_TO_INITIAL_DIRECTION) { @@ -678,8 +683,8 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); - if ((__firstScrollMoveDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL && abs(scrollDistanceY) > abs(scrollDistanceX)) - || (__firstScrollMoveDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL && abs(scrollDistanceY) < abs(scrollDistanceX))) + if ((__firstScrollMoveDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL && _Abs(scrollDistanceY) > _Abs(scrollDistanceX)) + || (__firstScrollMoveDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL && _Abs(scrollDistanceY) < _Abs(scrollDistanceX))) { return true; } @@ -693,7 +698,7 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to { if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - if (abs(scrollDistanceY) <= abs(scrollDistanceX)) + if (_Abs(scrollDistanceY) <= _Abs(scrollDistanceX)) { scrollDistance = scrollDistanceX; } @@ -704,7 +709,7 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to } else if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL) { - if (abs(scrollDistanceY) >= abs(scrollDistanceX)) + if (_Abs(scrollDistanceY) >= _Abs(scrollDistanceX)) { scrollDistance = scrollDistanceY; } @@ -715,24 +720,24 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to } } - if (scrollDistance != 0) + if (!_FloatCompare(scrollDistance, 0.0f)) { FadeInScrollBar(); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); - int realMoveDistance = ScrollTo(scrollDistance + GetScrollPositionInternal()); + float realMoveDistance = ScrollTo(scrollDistance + GetScrollPositionInternal()); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); - if (realMoveDistance == 0) + if (_FloatCompare(realMoveDistance, 0.0f)) { // not moved and bubbling if (scrollInputMode == SCROLL_INPUT_MODE_RESTRICT_TO_INITIAL_DIRECTION) { if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - if (abs(scrollDistanceY) < abs(scrollDistanceX)) + if (_Abs(scrollDistanceY) < _Abs(scrollDistanceX)) { return false; } @@ -743,7 +748,7 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to } else if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL) { - if (abs(scrollDistanceY) > abs(scrollDistanceX)) + if (_Abs(scrollDistanceY) > _Abs(scrollDistanceX)) { return false; } @@ -758,6 +763,7 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to return false; } } + } else { @@ -770,17 +776,7 @@ _ScrollPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& to bool _ScrollPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) { - if (__pPressedControl != &source) - { - return false; - } - - if (__pScrollPanel != &source) - { - return false; - } - - result r = RunPreviewTouchReleased(source, touchInfo); + result r = RunTouchReleased(source, touchInfo); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); return true; @@ -789,17 +785,7 @@ _ScrollPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& bool _ScrollPanelPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) { - if (__pPressedControl != &source) - { - return false; - } - - if (__pScrollPanel != &source) - { - return false; - } - - result r = RunPreviewTouchCanceled(source, touchInfo); + result r = RunTouchCanceled(source, touchInfo); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); return true; @@ -823,26 +809,43 @@ _ScrollPanelPresenter::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_ScrollPanelPresenter::OnScrollPositionChanged(_Control& source, int scrollPos) +_ScrollPanelPresenter::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (&source != __pScrollPanel->GetScrollBar()) { return; } - // JumpToTop - if (scrollPos == 0) + FadeInScrollBar(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + SetScrollPosition(scrollPosition, false); +} + +void +_ScrollPanelPresenter::OnScrollStopped(_Control& source) +{ + if (&source != __pScrollPanel->GetScrollBar()) { - SetScrollPosition(scrollPos, true); + return; } - else - { - FadeInScrollBar(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - SetScrollPosition(scrollPos, false); + FadeOutScrollBar(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); +} + +void +_ScrollPanelPresenter::OnScrollJumpToTop(_Control& source) +{ + if (&source != __pScrollPanel->GetScrollBar()) + { + return; } + + __jumpToTopRunning = true; + SetScrollPosition(0, true); } bool @@ -853,85 +856,90 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest return false; } - Rectangle scrollArea = GetScrollAreaBounds(); - Rectangle scrollPanelBounds = __pScrollPanel->GetBounds(); + FloatRectangle scrollArea = GetScrollAreaBounds(); + FloatRectangle scrollPanelBounds = __pScrollPanel->GetBoundsF(); - int distanceX = 0; - int distanceY = 0; + float distanceX = 0.0f; + float distanceY = 0.0f; gesture.GetDistance(distanceX, distanceY); - _FlickDirection moveDirection = gesture.GetDirection(); + _FlickDirection moveDirection = _FLICK_DIRECTION_NONE; - if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) + if (_Abs(distanceX) > _Abs(distanceY)) { - if (moveDirection != _FLICK_DIRECTION_RIGHT && moveDirection != _FLICK_DIRECTION_LEFT) - { - return false; - } - - if (distanceX < 0) + if (distanceX < 0.0f) { moveDirection = _FLICK_DIRECTION_LEFT; } - else if (distanceX > 0) + else if (distanceX > 0.0f) { moveDirection = _FLICK_DIRECTION_RIGHT; } } else { - if (moveDirection != _FLICK_DIRECTION_DOWN && moveDirection != _FLICK_DIRECTION_UP) + if (distanceY < 0.0f) { - return false; + moveDirection = _FLICK_DIRECTION_UP; } + else if (distanceY > 0.0f) + { + moveDirection = _FLICK_DIRECTION_DOWN; + } + } - if (distanceY < 0) + if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) + { + if (moveDirection != _FLICK_DIRECTION_RIGHT && moveDirection != _FLICK_DIRECTION_LEFT) { - moveDirection = _FLICK_DIRECTION_UP; + return false; } - else if (distanceY > 0) + } + else + { + if (moveDirection != _FLICK_DIRECTION_DOWN && moveDirection != _FLICK_DIRECTION_UP) { - moveDirection = _FLICK_DIRECTION_DOWN; + return false; } } if (__pScrollPanel->IsPageScrollEnabled() && __pScrollPanel->IsPageScrollFlickMoveLimitedOnePage()) { - int targetPosition = 0; - int currentScrollPosition = GetScrollPosition(); + float currentScrollPosition = GetScrollPosition(); + float targetPosition = currentScrollPosition; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - int pageSize = __pScrollPanel->GetPageScrollAlignSize().width; + float pageSize = __pScrollPanel->GetPageScrollAlignSize().width; // to right page - if (distanceX < 0) + if (moveDirection == _FLICK_DIRECTION_LEFT) { - targetPosition = currentScrollPosition - (currentScrollPosition % pageSize) + pageSize; + targetPosition = (((int)(currentScrollPosition / pageSize)) + 1) * pageSize; } // to left page - else if (distanceX > 0) + else if (moveDirection == _FLICK_DIRECTION_RIGHT) { - targetPosition = currentScrollPosition - (currentScrollPosition % pageSize); + targetPosition = ((int)(currentScrollPosition / pageSize)) * pageSize; } } else { - int pageSize = __pScrollPanel->GetPageScrollAlignSize().height; + float pageSize = __pScrollPanel->GetPageScrollAlignSize().height; - // to up page - if (distanceX < 0) + // to down page + if (moveDirection == _FLICK_DIRECTION_UP) { - targetPosition = currentScrollPosition - (currentScrollPosition % pageSize) + pageSize; + targetPosition = (((int)(currentScrollPosition / pageSize)) + 1) * pageSize; } - // to down page - else if (distanceX > 0) + // to up page + else if (moveDirection == _FLICK_DIRECTION_DOWN) { - targetPosition = currentScrollPosition - (currentScrollPosition % pageSize); + targetPosition = ((int)(currentScrollPosition / pageSize)) * pageSize; } } targetPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); - if (targetPosition == currentScrollPosition) + if (_FloatCompare(targetPosition, currentScrollPosition)) { return false; } @@ -950,8 +958,8 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest } else { - int moveAmount = 0; - int flickAmount = 0; + float moveAmount = 0.0f; + float flickAmount = 0.0f; // calculate flick amount if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) @@ -968,9 +976,9 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest // page align if (__pScrollPanel->IsPageScrollEnabled()) { - int scrollPosition = 0; - int maxPosition = 0; - int pageSize = 0; + float scrollPosition = 0.0f; + float maxPosition = 0.0f; + float pageSize = 0.0f; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { @@ -985,10 +993,10 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest scrollPosition = __pScrollPanelModel->GetCurrentVerticalScrollPosition(); } - int pageGap = (scrollPosition + moveAmount) % pageSize; + float pageGap = scrollPosition - (((int)(scrollPosition / pageSize)) * pageSize); int lowerPageIndex = (scrollPosition + moveAmount) / pageSize; - int targetPageMin = pageSize * lowerPageIndex; - int targetPageMax = targetPageMin + pageSize; + float targetPageMin = pageSize * lowerPageIndex; + float targetPageMax = targetPageMin + pageSize; targetPageMin = targetPageMax > maxPosition ? (maxPosition / pageSize) * pageSize : targetPageMin; targetPageMax = targetPageMax > maxPosition ? maxPosition : targetPageMax; @@ -1002,7 +1010,7 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest } } - if (moveAmount != 0) + if (!_FloatCompare(moveAmount, 0.0f)) { // scroll with animation __flickRunning = true; @@ -1059,9 +1067,9 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest } // limited flick amount - int targetPosition = moveAmount + GetScrollPositionInternal(); - int scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); - if (abs(scrollToPosition - targetPosition) > SCROLL_PANEL_OVERSCROLLING_MAX_DISTANCCE) + float targetPosition = moveAmount + GetScrollPositionInternal(); + float scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); + if (_Abs(scrollToPosition - targetPosition) > SCROLL_PANEL_OVERSCROLLING_MAX_DISTANCCE) { switch (moveDirection) { @@ -1112,6 +1120,8 @@ _ScrollPanelPresenter::OnFlickGestureCanceled(_TouchFlickGestureDetector& gestur { StopScrollingAnimation(); RollbackBouncing(true); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); return false; } @@ -1119,20 +1129,20 @@ _ScrollPanelPresenter::OnFlickGestureCanceled(_TouchFlickGestureDetector& gestur bool _ScrollPanelPresenter::IsControlOutOfView(const _Control& control) const { - Rectangle controlBounds = control.GetBounds(); - int scrollPos = __pScrollPanel->GetScrollPosition(); + FloatRectangle controlBounds = control.GetBoundsF(); + float scrollPosition = __pScrollPanel->GetScrollPosition(); // is control out of view area if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - if (controlBounds.x < scrollPos || controlBounds.x + controlBounds.width > scrollPos + __pScrollPanel->GetBounds().width) + if (controlBounds.x < scrollPosition || controlBounds.x + controlBounds.width > scrollPosition + __pScrollPanel->GetBoundsF().width) { return true; } } else { - if (controlBounds.y < scrollPos || controlBounds.y + controlBounds.height > scrollPos + __pScrollPanel->GetBounds().height) + if (controlBounds.y < scrollPosition || controlBounds.y + controlBounds.height > scrollPosition + __pScrollPanel->GetBoundsF().height) { return true; } @@ -1160,9 +1170,13 @@ _ScrollPanelPresenter::RollbackBouncing(bool withAnimation) return; } - int scrollPosition = GetScrollPositionInternal(); - int fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition); - if (scrollPosition != fixedScrollPosition) + float scrollPosition = GetScrollPositionInternal(); + float fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition); + + // there are no rollbacking animation + withAnimation = false; + + if (!_FloatCompare(scrollPosition, fixedScrollPosition)) { FadeInScrollBar(); result r = GetLastResult(); @@ -1171,6 +1185,13 @@ _ScrollPanelPresenter::RollbackBouncing(bool withAnimation) ScrollTo(fixedScrollPosition, withAnimation); r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!__scrollAnimationRunning) + { + FadeOutScrollBar(); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } } } @@ -1197,11 +1218,15 @@ _ScrollPanelPresenter::OnAccessibilityFocusMovedPrevious(const _AccessibilityCon } bool -_ScrollPanelPresenter::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_ScrollPanelPresenter::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} +bool +_ScrollPanelPresenter::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } - bool _ScrollPanelPresenter::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) { @@ -1220,12 +1245,18 @@ _ScrollPanelPresenter::OnAccessibilityActionPerformed(const _AccessibilityContai return false; } +bool +_ScrollPanelPresenter::OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction) +{ + return false; +} + void _ScrollPanelPresenter::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) { if (&timer == __pScrollBarLoadEffectTimer) { - __scrollBarFirstLoaded = false; + __scrollBarLoadEffectStatus = _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADED; StopScrollBarLoadEffectTimer(); @@ -1239,10 +1270,10 @@ _ScrollPanelPresenter::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) } } -int -_ScrollPanelPresenter::CalculateFlickAmount(int flickDistance, int flickDuration) +float +_ScrollPanelPresenter::CalculateFlickAmount(float flickDistance, float flickDuration) { - int flickAmount = ((((flickDistance * SCROLL_PANEL_FLICK_IN_PIXEL_UNIT) / flickDuration) * SCROLL_PANEL_FLICK_WEIGHT_VELOCITY) + (flickDistance * SCROLL_PANEL_FLICK_WEIGHT_DISTANCE)) / SCROLL_PANEL_FLICK_ALPHA_PER_PIXEL; + float flickAmount = ((((flickDistance * SCROLL_PANEL_FLICK_IN_PIXEL_UNIT) / flickDuration) * SCROLL_PANEL_FLICK_WEIGHT_VELOCITY) + (flickDistance * SCROLL_PANEL_FLICK_WEIGHT_DISTANCE)) / SCROLL_PANEL_FLICK_ALPHA_PER_PIXEL; return flickAmount; } @@ -1271,26 +1302,16 @@ _ScrollPanelPresenter::OnVisualElementAnimationFinished(const VisualElementAnima __pScrollPanel->FireOnScrollStoppedEvent(); } - if (completedNormally) + RollbackBouncing(completedNormally); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!__scrollAnimationRunning) { - RollbackBouncing(true); + FadeOutScrollBar(); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } - else - { - int scrollPosition = GetScrollPositionInternal(); - int targetPosition = GetScrollPosition(); - if (scrollPosition != targetPosition) - { - ChangeScrollBarPosition(targetPosition); - SetScrollPositionInternal(targetPosition); - } - } - - FadeOutScrollBar(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } void @@ -1310,7 +1331,7 @@ _ScrollPanelPresenter::OnTickOccurred(const VisualElementAnimation& animation, c return; } - ScrollToInternal(currentValue.ToInt()); + ScrollToInternal(currentValue.ToFloat()); } } @@ -1326,11 +1347,9 @@ _ScrollPanelPresenter::AdjustModel() _Scroll* pHorizontalScrollBar = __pScrollPanel->GetHorizontalScrollBar(); _Scroll* pVerticalScrollBar = __pScrollPanel->GetVerticalScrollBar(); - Rectangle scrollPanelBounds = __pScrollPanel->GetBounds(); + FloatRectangle scrollPanelBounds = __pScrollPanel->GetBoundsF(); ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); - - - Rectangle scrollArea = Rectangle(0, 0, scrollPanelBounds.width, scrollPanelBounds.height); + FloatRectangle scrollArea = FloatRectangle(0.0f, 0.0f, scrollPanelBounds.width, scrollPanelBounds.height); if (__pScrollPanel->IsScrollAreaAutoResizingEnabled()) { @@ -1348,7 +1367,7 @@ _ScrollPanelPresenter::AdjustModel() continue; } - int targetMaxPos = pControl->GetBounds().GetBottomRight().y; + float targetMaxPos = pControl->GetBoundsF().GetBottomRight().y; scrollArea.height = (scrollArea.height < targetMaxPos) ? targetMaxPos : scrollArea.height; } } @@ -1364,7 +1383,7 @@ _ScrollPanelPresenter::AdjustModel() continue; } - int targetMaxPos = pControl->GetBounds().GetBottomRight().x; + float targetMaxPos = pControl->GetBoundsF().GetBottomRight().x; scrollArea.width = (scrollArea.width < targetMaxPos) ? targetMaxPos : scrollArea.width; } } @@ -1385,9 +1404,9 @@ _ScrollPanelPresenter::AdjustModel() } // before change model ScrollPosition fix - int scrollPosition = GetScrollPosition(); - int fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, scrollPanelBounds, scrollArea); - if (scrollPosition != fixedScrollPosition) + float scrollPosition = GetScrollPosition(); + float fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, scrollPanelBounds, scrollArea); + if (!_FloatCompare(scrollPosition, fixedScrollPosition)) { ScrollTo(fixedScrollPosition, false); result r = GetLastResult(); @@ -1396,53 +1415,50 @@ _ScrollPanelPresenter::AdjustModel() // change model values SetScrollAreaBoundsInternal(scrollArea); - Dimension alignSize = Dimension(scrollPanelBounds.width, scrollPanelBounds.height); + FloatDimension alignSize = FloatDimension(scrollPanelBounds.width, scrollPanelBounds.height); __pScrollPanel->SetPageScrollAlignSize(alignSize); // Adjust ScrollBar if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - if (scrollPanelBounds.width > 0 && scrollArea.width > scrollPanelBounds.width) + if (scrollPanelBounds.width > 0) { if (pHorizontalScrollBar != null) { pHorizontalScrollBar->OnParentBoundsChanged(); + } - // update scrollbar range - ChangeScrollBarRange(); + if (!IsScrollable()) + { + SetScrollPosition(scrollArea.x, false); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } } - else - { - SetScrollPosition(scrollArea.x, false); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - } } else { - if (scrollPanelBounds.height > 0 && scrollArea.height > scrollPanelBounds.height) + if (scrollPanelBounds.height > 0) { if (pVerticalScrollBar != null) { pVerticalScrollBar->OnParentBoundsChanged(); + } - // update scrollbar range - ChangeScrollBarRange(); + if (!IsScrollable()) + { + SetScrollPosition(scrollArea.y, false); result r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } } - else - { - SetScrollPosition(scrollArea.y, false); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - } } + // update scrollbar range + ChangeScrollBarRange(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + if (!__scrollAnimationRunning) { FadeOutScrollBar(); @@ -1471,14 +1487,14 @@ _ScrollPanelPresenter::ScrollToControl(const _Control& source) if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { //align source control to left position. - SetHorizontalScrollPosition(source.GetBounds().x); + SetHorizontalScrollPosition(source.GetBoundsF().x); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); } else { //align source control to top position. - SetVerticalScrollPosition(source.GetBounds().y); + SetVerticalScrollPosition(source.GetBoundsF().y); result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -1486,24 +1502,23 @@ _ScrollPanelPresenter::ScrollToControl(const _Control& source) return true; } -int -_ScrollPanelPresenter::ScrollTo(int targetPosition) +float +_ScrollPanelPresenter::ScrollTo(float targetPosition) { return ScrollTo(targetPosition, false); } - -int -_ScrollPanelPresenter::ScrollTo(int targetPosition, bool withAnimation) +float +_ScrollPanelPresenter::ScrollTo(float targetPosition, bool withAnimation) { StopScrollingAnimation(); if (withAnimation) { // Calculate real move distance - int scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); + float scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); - int oldPosition = GetScrollPositionInternal(); + float oldPosition = GetScrollPositionInternal(); VisualElementValueAnimation* pScrollingAnimation = __pScrollPanel->GetScrollingAnimation(); pScrollingAnimation->SetStartValue(Variant(oldPosition)); pScrollingAnimation->SetEndValue(Variant(targetPosition)); @@ -1520,17 +1535,16 @@ _ScrollPanelPresenter::ScrollTo(int targetPosition, bool withAnimation) } } - -int -_ScrollPanelPresenter::ScrollToInternal(int targetPosition) +float +_ScrollPanelPresenter::ScrollToInternal(float targetPosition) { ScrollPanelScrollDirection scrollDirection = __pScrollPanel->GetScrollDirection(); _VisualElement* pVisualElement = __pScrollPanel->GetVisualElement(); - int previousScrollPosition = GetScrollPositionInternal(); - int distance = 0; + float previousScrollPosition = GetScrollPositionInternal(); + float distance = 0.0f; FloatPoint floatPointDistance; - int scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); + float scrollToPosition = FixScrollPositionIntoScrollAreaBounds(targetPosition); if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { @@ -1543,7 +1557,7 @@ _ScrollPanelPresenter::ScrollToInternal(int targetPosition) floatPointDistance.SetPosition(0.0f, -distance); } - if (distance != 0) + if (!_FloatCompare(distance, 0)) { result r = pVisualElement->ScrollByPoint(floatPointDistance, false); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, 0, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1554,17 +1568,17 @@ _ScrollPanelPresenter::ScrollToInternal(int targetPosition) ChangeScrollBarPosition(targetPosition); SetScrollPositionInternal(targetPosition); - if (distance != 0) + if (!_FloatCompare(distance, 0)) { - Rectangle scrollPanelBounds = __pScrollPanel->GetBounds(); - Rectangle scrollArea = GetScrollAreaBounds(); + FloatRectangle scrollPanelBounds = __pScrollPanel->GetBoundsF(); + FloatRectangle scrollArea = GetScrollAreaBounds(); if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { if (scrollArea.width > scrollPanelBounds.width) { - int minScrollPos = scrollArea.x; - int maxScrollPos = scrollArea.width - scrollPanelBounds.width; + float minScrollPos = scrollArea.x; + float maxScrollPos = scrollArea.width - scrollPanelBounds.width; if ((targetPosition >= minScrollPos && targetPosition <= maxScrollPos) || (previousScrollPosition > minScrollPos || previousScrollPosition < maxScrollPos)) @@ -1589,8 +1603,8 @@ _ScrollPanelPresenter::ScrollToInternal(int targetPosition) { if (scrollArea.height > scrollPanelBounds.height) { - int minScrollPos = scrollArea.y; - int maxScrollPos = scrollArea.height - scrollPanelBounds.height; + float minScrollPos = scrollArea.y; + float maxScrollPos = scrollArea.height - scrollPanelBounds.height; if ((targetPosition >= minScrollPos && targetPosition <= maxScrollPos) || (previousScrollPosition > minScrollPos || previousScrollPosition < maxScrollPos)) @@ -1617,7 +1631,7 @@ _ScrollPanelPresenter::ScrollToInternal(int targetPosition) } void -_ScrollPanelPresenter::ChangeScrollBarPosition(int position) +_ScrollPanelPresenter::ChangeScrollBarPosition(float position) { _Scroll* pScrollBar = __pScrollPanel->GetScrollBar(); @@ -1643,17 +1657,17 @@ _ScrollPanelPresenter::ChangeScrollBarRange(void) if (pScrollBar != null) { - int viewRange = 0; - int scrollRange = 0; + float viewRange = 0.0f; + float scrollRange = 0.0f; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - viewRange = __pScrollPanel->GetBounds().width; + viewRange = __pScrollPanel->GetBoundsF().width; scrollRange = GetScrollAreaBounds().width; } else { - viewRange = __pScrollPanel->GetBounds().height; + viewRange = __pScrollPanel->GetBoundsF().height; scrollRange = GetScrollAreaBounds().height; } @@ -1662,26 +1676,51 @@ _ScrollPanelPresenter::ChangeScrollBarRange(void) result r = pScrollBar->SetScrollRange(viewRange, scrollRange); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - if (viewRange != scrollRange && __scrollBarFirstLoaded) + if (!_FloatCompare(viewRange, scrollRange)) { - FadeInScrollBar(); - result r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + if (__scrollBarLoadEffectStatus == _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_UNLOAD) + { + __scrollBarLoadEffectStatus = _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADING; - StartScrollBarLoadEffectTimer(); - r = GetLastResult(); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + if (__firstDrawn) + { + DoScrollBarLoadEffect(); + } + } + } + else + { + __scrollBarLoadEffectStatus = _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_UNLOAD; } } } } void +_ScrollPanelPresenter::DoScrollBarLoadEffect(void) +{ + if (__pScrollPanel->IsScrollBarVisible()) + { + FadeInScrollBar(); + result r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + StartScrollBarLoadEffectTimer(); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + __scrollBarLoadEffectStatus = _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_UNLOAD; + } +} + +void _ScrollPanelPresenter::StartScrollBarLoadEffectTimer(void) { result r = E_SUCCESS; - if (__pScrollBarLoadEffectTimer == null) + if (__pScrollBarLoadEffectTimer == null && __scrollBarLoadEffectStatus == _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADING) { __pScrollBarLoadEffectTimer = new (std::nothrow) Tizen::Base::Runtime::Timer; SysTryReturnVoidResult(NID_UI_CTRL, __pScrollBarLoadEffectTimer != null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient", GetErrorMessage(E_OUT_OF_MEMORY)); @@ -1748,12 +1787,12 @@ _ScrollPanelPresenter::StopFlickScrollEffectTimer(void) void _ScrollPanelPresenter::FadeOutScrollBar(void) { - if (!__scrollAnimationRunning && !__scrollBarFirstLoaded) + if (!__scrollAnimationRunning && __scrollBarLoadEffectStatus == _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADED) { _Scroll* pScrollBar = __pScrollPanel->GetScrollBar(); if (pScrollBar != null) { - if (!pScrollBar->IsEnabledHandler()) + if (!pScrollBar->IsEnabledHandler() || !IsScrollable()) { result r = pScrollBar->SetScrollVisibility(false); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -1804,44 +1843,44 @@ _ScrollPanelPresenter::IsScrollable(void) const { if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - return __pScrollPanel->GetBounds().width >0 && __pScrollPanel->GetBounds().width < GetScrollAreaBounds().width; + return __pScrollPanel->GetBoundsF().width >0 && __pScrollPanel->GetBoundsF().width < GetScrollAreaBounds().width; } else { - return __pScrollPanel->GetBounds().height > 0 && __pScrollPanel->GetBounds().height < GetScrollAreaBounds().height; + return __pScrollPanel->GetBoundsF().height > 0 && __pScrollPanel->GetBoundsF().height < GetScrollAreaBounds().height; } } -Rectangle +FloatRectangle _ScrollPanelPresenter::GetScrollAreaBounds(void) const { return __pScrollPanelModel->GetScrollAreaBounds(); } result -_ScrollPanelPresenter::SetClientAreaHeight(int height) +_ScrollPanelPresenter::SetClientAreaHeight(float height) { SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] The height of the client area cannot be set when the scroll direction is horizontal.", GetErrorMessage(E_INVALID_OPERATION)); - Rectangle bounds = GetScrollAreaBounds(); + FloatRectangle bounds = GetScrollAreaBounds(); bounds.height = height; return SetScrollAreaBounds(bounds); } result -_ScrollPanelPresenter::SetClientAreaWidth(int width) +_ScrollPanelPresenter::SetClientAreaWidth(float width) { SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL, E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] The width of the client area cannot be set when the scroll direction is vertical.", GetErrorMessage(E_INVALID_OPERATION)); - Rectangle bounds = GetScrollAreaBounds(); + FloatRectangle bounds = GetScrollAreaBounds(); bounds.width = width; return SetScrollAreaBounds(bounds); } void -_ScrollPanelPresenter::SetScrollAreaBoundsInternal(Rectangle& bounds) +_ScrollPanelPresenter::SetScrollAreaBoundsInternal(FloatRectangle& bounds) { - if (__pScrollPanel->IsFixingClientBoundsEnable()) + if (__pScrollPanel->IsFixingClientBoundsEnabled()) { __pScrollPanel->SetClientBounds(bounds); } @@ -1849,7 +1888,7 @@ _ScrollPanelPresenter::SetScrollAreaBoundsInternal(Rectangle& bounds) } result -_ScrollPanelPresenter::SetScrollAreaBounds(Rectangle& bounds) +_ScrollPanelPresenter::SetScrollAreaBounds(FloatRectangle& bounds) { SysTryReturn(NID_UI_CTRL, !__pScrollPanel->IsScrollAreaAutoResizingEnabled(), E_INVALID_OPERATION, E_INVALID_OPERATION, "[%s] The width of the client area cannot be set when auto resizing of the client area is off.", GetErrorMessage(E_INVALID_OPERATION)); @@ -1858,30 +1897,34 @@ _ScrollPanelPresenter::SetScrollAreaBounds(Rectangle& bounds) if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetBounds().width <= bounds.width, E_INVALID_ARG, E_INVALID_ARG, "[%s] width is less than the width of ScrollPanel", GetErrorMessage(E_INVALID_ARG)); - bounds.height = __pScrollPanel->GetBounds().height; + SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetBoundsF().width <= bounds.width, E_INVALID_ARG, E_INVALID_ARG, "[%s] width is less than the width of ScrollPanel", GetErrorMessage(E_INVALID_ARG)); + bounds.height = __pScrollPanel->GetBoundsF().height; } else { - SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetBounds().height <= bounds.height, E_INVALID_ARG, E_INVALID_ARG, "[%s] height is less than the height of ScrollPanel", GetErrorMessage(E_INVALID_ARG)); - bounds.width = __pScrollPanel->GetBounds().width; + SysTryReturn(NID_UI_CTRL, __pScrollPanel->GetBoundsF().height <= bounds.height, E_INVALID_ARG, E_INVALID_ARG, "[%s] height is less than the height of ScrollPanel", GetErrorMessage(E_INVALID_ARG)); + bounds.width = __pScrollPanel->GetBoundsF().width; } // before change model ScrollPosition fix - Rectangle scrollPanelBounds = __pScrollPanel->GetBounds(); - int scrollPosition = GetScrollPosition(); - int fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, scrollPanelBounds, bounds); - if (scrollPosition != fixedScrollPosition) + RollbackBouncing(false); + result r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + FloatRectangle scrollPanelBounds = __pScrollPanel->GetBoundsF(); + float scrollPosition = GetScrollPosition(); + float fixedScrollPosition = FixScrollPositionIntoScrollAreaBounds(scrollPosition, scrollPanelBounds, bounds); + if (!_FloatCompare(scrollPosition, fixedScrollPosition)) { ScrollTo(fixedScrollPosition, false); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } SetScrollAreaBoundsInternal(bounds); AdjustModel(); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -1893,13 +1936,13 @@ _ScrollPanelPresenter::GetPressedControl(void) const return __pPressedControl; } -Point +FloatPoint _ScrollPanelPresenter::GetPreviousTouchPosition(void) const { return __previousTouchedPosition; } -Point +FloatPoint _ScrollPanelPresenter::GetCurrentTouchPosition(void) const { return __currentMovedPosition; diff --git a/src/ui/controls/FUiCtrl_ScrollPresenter.cpp b/src/ui/controls/FUiCtrl_ScrollPresenter.cpp index 5bf0861..6e80593 100644 --- a/src/ui/controls/FUiCtrl_ScrollPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPresenter.cpp @@ -30,6 +30,8 @@ #include #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" #include "FUiAnim_TransformMatrix3Df.h" #include "FUiAnim_MatrixUtil.h" #include "FUiAnim_VisualElement.h" @@ -71,12 +73,9 @@ _ScrollPresenter::_ScrollPresenter(void) , __enableScrollingEffect(false) , __enableOverScrollingEffect(false) , __parentUsingViewport(true) - , __positionMin(0) - , __positionMax(0) - , __viewRange(0) - , __scrollRange(0) - , __scrollPositionCurr(0) - , __scrollPositionPrev(0) + , __viewRange(0.0f) + , __scrollRange(0.0f) + , __scrollPositionCurr(0.0f) , __fadeIn(false) , __fadeOut(false) , __scrollVisibility(false) @@ -88,7 +87,7 @@ _ScrollPresenter::_ScrollPresenter(void) , __needUpdateHandler(false) , __needUpdateScrollingEffect(false) , __handlerTouched(false) - , __handlerTouchedPosition(0) + , __handlerTouchedPosition(0.0f) , __jumpToTopPressed(false) , __pScrollEvent(null) , __pCtrlVe(null) @@ -98,7 +97,6 @@ _ScrollPresenter::_ScrollPresenter(void) , __pFrontScrollingEffectVe(null) , __pReerScrollingEffectVe(null) , __thumbColor(0x00000000) - , __jumpToTopBgColor(0x00000000) , __jumpToTopColor(0x00000000) , __jumpToTopColorPressed(0x00000000) , __buttonColor(0x00000000) @@ -106,31 +104,29 @@ _ScrollPresenter::_ScrollPresenter(void) , __pThumbBitmap(null) , __pThumbEffectBitmap(null) , __pJumpToTopBitmap(null) + , __pJumpToTopPressBitmap(null) , __pJumpToTopEfBitmap(null) - , __pJumpToTopLeftBitmap(null) - , __pJumpToTopLeftEfBitmap(null) , __pButtonBitmap(null) , __pButtonEfBitmap(null) , __pButtonPressBitmap(null) - , __pHandlerBgBitmap(null) - , __pHandlerBgEffectBitmap(null) + , __pButtonPressEfBitmap(null) , __pHandlerBitmap(null) , __pFrontScrollingEffectBitmap(null) , __pReerScrollingEffectBitmap(null) - , __thumbSizeMin(0, 0) - , __thumbMargin(0) - , __jumpToTopSize(0, 0) - , __jumpToTopMarginRight(0) - , __jumpToTopMarginTop(0) - , __handlerSizeMin(0, 0) - , __handlerMarginLeft(0) - , __handlerMarginRight(0) - , __handlerMarginTop(0) - , __handlerMarginBottom(0) - , __scrollingEffectWidthLeft(0) - , __scrollingEffectWidthRight(0) - , __scrollingEffectHeightTop(0) - , __scrollingEffectHeightBottom(0) + , __thumbSizeMin(0.0f, 0.0f) + , __thumbMargin(0.0f) + , __jumpToTopSize(0.0f, 0.0f) + , __jumpToTopMarginRight(0.0f) + , __jumpToTopMarginTop(0.0f) + , __handlerSizeMin(0.0f, 0.0f) + , __handlerMarginLeft(0.0f) + , __handlerMarginRight(0.0f) + , __handlerMarginTop(0.0f) + , __handlerMarginBottom(0.0f) + , __scrollingEffectWidthLeft(0.0f) + , __scrollingEffectWidthRight(0.0f) + , __scrollingEffectHeightTop(0.0f) + , __scrollingEffectHeightBottom(0.0f) , __beforeBouncingMatrixHash() { } @@ -193,9 +189,9 @@ _ScrollPresenter::CreateScrollPresenterN(_Control& parentCtrl, bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition) + float viewRange, + float scrollRange, + float scrollPosition) { SysTryReturn(NID_UI_CTRL, ((scrollRange >= viewRange) && (scrollRange != 0)), null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid arguments"); SysTryReturn(NID_UI_CTRL, scrollPosition >= 0, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid arguments"); @@ -238,8 +234,8 @@ _ScrollPresenter::SetScrollDirection(_ScrollDirection scrollDirection) __scrollDirection = scrollDirection; // reset the bounds of scroll control - Rectangle bounds = GetParentCtrl().GetBounds(); - bounds.SetPosition(0, 0); + FloatRectangle bounds = GetParentCtrl().GetBoundsF(); + bounds.SetPosition(0.0f, 0.0f); r = GetControl().SetBounds(bounds); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set the bounds of _Scroll."); @@ -257,17 +253,15 @@ _ScrollPresenter::GetScrollDirection(void) const } result -_ScrollPresenter::SetScrollRange(int viewRange, int scrollRange) +_ScrollPresenter::SetScrollRange(float viewRange, float scrollRange) { SysTryReturn(NID_UI_CTRL, ((scrollRange >= viewRange) && (scrollRange != 0)), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid arguments"); result r = E_SUCCESS; - // reset scroll range. __viewRange = viewRange; __scrollRange = scrollRange; - // relayout scroll children. r = RelayoutScrollChildren(__scrollDirection); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to relayout scroll chilren"); @@ -276,7 +270,7 @@ _ScrollPresenter::SetScrollRange(int viewRange, int scrollRange) } void -_ScrollPresenter::GetScrollRange(int* pViewRange, int* pScrollRange) const +_ScrollPresenter::GetScrollRange(float* pViewRange, float* pScrollRange) const { SysTryReturnVoidResult(NID_UI_CTRL, !((pViewRange == null) && (pScrollRange == null)), @@ -289,7 +283,7 @@ _ScrollPresenter::GetScrollRange(int* pViewRange, int* pScrollRange) const } result -_ScrollPresenter::SetScrollPosition(int scrollPosition) +_ScrollPresenter::SetScrollPosition(float scrollPosition) { result r = E_SUCCESS; @@ -298,21 +292,20 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) if (!__enableScrollingEffect) { - if (scrollPosition < 0) + if (scrollPosition < 0.0f) { - scrollPosition = 0; + scrollPosition = 0.0f; } else if (scrollPosition > (__scrollRange - __viewRange)) { - scrollPosition = (__scrollRange -__viewRange); + scrollPosition = (__scrollRange - __viewRange); } } - __scrollPositionPrev = __scrollPositionCurr; __scrollPositionCurr = scrollPosition; if (__enableJumpToTop) { - if ((__scrollPositionCurr <= 0) && (__pJumpToTopVe->GetOpacity() > 0.0f)) + if ((_FloatCompare(__scrollPositionCurr, 0.0f) || __scrollPositionCurr < 0.0f) && (__pJumpToTopVe->GetOpacity() > 0.0f)) { __pCtrlVe->SetImplicitAnimationEnabled(true); __pJumpToTopVe->SetImplicitAnimationEnabled(true); @@ -322,7 +315,7 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) __pJumpToTopVe->SetImplicitAnimationEnabled(false); __pCtrlVe->SetImplicitAnimationEnabled(false); } - else if ((__scrollPositionCurr > 0) && (__pJumpToTopVe->GetOpacity() < 1.0f)) + else if ((__scrollPositionCurr > 0.0f) && (__pJumpToTopVe->GetOpacity() < 1.0f)) { __pCtrlVe->SetImplicitAnimationEnabled(true); __pJumpToTopVe->SetImplicitAnimationEnabled(true); @@ -338,14 +331,15 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) if (__enableHandler) { - Point handlerPosition = CalculateHandlerPosition(__scrollDirection); - Rectangle handlerBounds(handlerPosition.x, handlerPosition.y, __pHandlerVe->GetBounds().width, __pHandlerVe->GetBounds().height); + FloatPoint handlerPosition = CalculateHandlerPosition(__scrollDirection); + FloatRectangle handlerBounds(handlerPosition.x, handlerPosition.y, __pHandlerVe->GetBounds().width, __pHandlerVe->GetBounds().height); FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); + if (__scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { - if (handlerPosition.x < 0) + if (handlerPosition.x < 0.0f) { - handlerBounds.x = 0; + handlerBounds.x = 0.0f; } else if (handlerPosition.x > scrollCtrlBounds.width - handlerBounds.width) { @@ -354,9 +348,9 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) } else { - if (handlerPosition.y < 0) + if (handlerPosition.y < 0.0f) { - handlerBounds.y = 0; + handlerBounds.y = 0.0f; } else if (handlerPosition.y > scrollCtrlBounds.height - handlerBounds.height) { @@ -364,19 +358,19 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) } } - r = SetScrollChildBounds(*__pHandlerVe, handlerBounds); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set the bounds of the __pHandlerVe"); + __pHandlerVe->SetBounds(handlerBounds); } else { - Point thumbPosition = CalculateThumbPosition(__scrollDirection); - Rectangle thumbBounds(thumbPosition.x, thumbPosition.y, __pThumbVe->GetBounds().width, __pThumbVe->GetBounds().height); + FloatPoint thumbPosition = CalculateThumbPosition(__scrollDirection); + FloatRectangle thumbBounds(thumbPosition.x, thumbPosition.y, __pThumbVe->GetBounds().width, __pThumbVe->GetBounds().height); FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); + if (__scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { - if (thumbPosition.x < 0) + if (thumbPosition.x < 0.0f) { - thumbBounds.x = 0; + thumbBounds.x = 0.0f; } else if (thumbPosition.x > scrollCtrlBounds.width - thumbBounds.width) { @@ -385,9 +379,9 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) } else { - if (thumbPosition.y < 0) + if (thumbPosition.y < 0.0f) { - thumbBounds.y = 0; + thumbBounds.y = 0.0f; } else if (thumbPosition.y > scrollCtrlBounds.height - thumbBounds.height) { @@ -395,14 +389,13 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) } } - r = SetScrollChildBounds(*__pThumbVe, thumbBounds); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set the bounds of the __pThumbVe"); + __pThumbVe->SetBounds(thumbBounds); } if (__enableScrollingEffect || __enableOverScrollingEffect) { float ratio = 0.0f; - if (__scrollPositionCurr < 0) + if (__scrollPositionCurr < 0.0f) { ratio = -__scrollPositionCurr / SCROLLING_EFFECT_MAX_POSITION; ratio = ratio > 1.0f ? 1.0f : ratio; @@ -411,9 +404,9 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) { SetScrollingEffectOpacity(*__pFrontScrollingEffectVe, true, ratio); SetScrollingEffectOpacity(*__pReerScrollingEffectVe, false, ratio); - } - __scrollingEffectVisibility = true; + __scrollingEffectVisibility = true; + } } else if (__scrollPositionCurr > (__scrollRange - __viewRange)) { @@ -424,9 +417,19 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) { SetScrollingEffectOpacity(*__pFrontScrollingEffectVe, false, ratio); SetScrollingEffectOpacity(*__pReerScrollingEffectVe, true, ratio); - } - __scrollingEffectVisibility = true; + __scrollingEffectVisibility = true; + } + } + else + { + if (__scrollingEffectVisibility && __enableScrollingEffect) + { + if (__pFrontScrollingEffectVe->GetOpacity() != SCROLL_OPACITY_DARK_DIM) + { + SetScrollingEffectOpacity(SCROLL_OPACITY_DARK_DIM); + } + } } if (__enableOverScrollingEffect) @@ -440,7 +443,7 @@ _ScrollPresenter::SetScrollPosition(int scrollPosition) return r; } -int +float _ScrollPresenter::GetScrollPosition(void) const { return __scrollPositionCurr; @@ -616,7 +619,7 @@ _ScrollPresenter::EnableJumpToTop(bool enable) r = AttachScrollChild(&__pJumpToTopVe, CalculateJumpToTopBounds(__scrollDirection), true); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to attach the __pJumpToTopVe to _Scroll"); - if (__scrollPositionCurr != 0) + if (!(_FloatCompare(__scrollPositionCurr, 0.0f))) { __pJumpToTopVe->SetOpacity(SCROLL_OPACITY_ON); } @@ -801,14 +804,11 @@ _ScrollPresenter::RemoveScrollEventListener(const Controls::_IScrollEventListene void _ScrollPresenter::OnParentBoundsChanged(void) { - // reset the bounds of scroll control - Rectangle bounds = GetParentCtrl().GetBounds(); - bounds.SetPosition(0, 0); + FloatRectangle bounds = GetParentCtrl().GetBoundsF(); + bounds.SetPosition(0.0f, 0.0f); GetControl().SetBounds(bounds); - // relayout scroll children. RelayoutScrollChildren(__scrollDirection); - return; } @@ -863,10 +863,10 @@ _ScrollPresenter::HitTest(const FloatPoint& point) if (__enableJumpToTop && IsScrollVisible()) { - Rectangle jumpToTopBounds = GetScrollChildBounds(*__pJumpToTopVe); + FloatRectangle jumpToTopBounds = __pJumpToTopVe->GetBounds(); jumpToTopBounds.x += ctrlBounds.x; jumpToTopBounds.y += ctrlBounds.y; - if (jumpToTopBounds.Contains(Point(point.x, point.y))) + if (jumpToTopBounds.Contains(point)) { return HIT_TEST_MATCH; } @@ -874,10 +874,10 @@ _ScrollPresenter::HitTest(const FloatPoint& point) if (__enableHandler) { - Rectangle handlerBounds = GetScrollChildBounds(*__pHandlerVe); + FloatRectangle handlerBounds = __pHandlerVe->GetBounds(); handlerBounds.x += ctrlBounds.x; handlerBounds.y += ctrlBounds.y; - if (handlerBounds.Contains(Point(point.x, point.y))) + if (handlerBounds.Contains(point)) { return HIT_TEST_MATCH; } @@ -930,9 +930,9 @@ _ScrollPresenter::Construct(_Control& parentCtrl, bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition) + float viewRange, + float scrollRange, + float scrollPosition) { result r = E_SUCCESS; @@ -954,8 +954,8 @@ _ScrollPresenter::Construct(_Control& parentCtrl, _VisualElement* pVe = null; // initialize the scroll control - Rectangle bounds = GetParentCtrl().GetBounds(); - bounds.SetPosition(0, 0); + FloatRectangle bounds = GetParentCtrl().GetBoundsF(); + bounds.SetPosition(0.0f, 0.0f); GetControl().SetBounds(bounds); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set the bounds of _Scroll.", GetErrorMessage(r)); @@ -979,9 +979,7 @@ _ScrollPresenter::Construct(_Control& parentCtrl, r = pVe->AttachChild(*__pCtrlVe); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach child to the control VisualElement.", GetErrorMessage(r)); - r = SetScrollChildBounds(*__pCtrlVe, CalculateScrollCtrlBounds(scrollDirection)); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r)); - + __pCtrlVe->SetBounds(CalculateScrollCtrlBounds(scrollDirection)); __pCtrlVe->SetAnimationProvider(this); __pCtrlVe->SetShowState(true); @@ -1000,7 +998,7 @@ _ScrollPresenter::Construct(_Control& parentCtrl, r = AttachScrollChild(&__pJumpToTopVe, CalculateJumpToTopBounds(scrollDirection), true); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach the __pJumpToTopVe to _Scroll.", GetErrorMessage(r)); - if ((scrollDirection != SCROLL_DIRECTION_VERTICAL) || (scrollPosition == 0)) + if ((scrollDirection != SCROLL_DIRECTION_VERTICAL) || (_FloatCompare(scrollPosition, 0.0f))) { __pJumpToTopVe->SetOpacity(SCROLL_OPACITY_OFF); } @@ -1043,9 +1041,7 @@ _ScrollPresenter::Construct(_Control& parentCtrl, r = pVe->AttachChild(*__pFrontScrollingEffectVe); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach child to the control VisualElement.", GetErrorMessage(r)); - r = SetScrollChildBounds(*__pFrontScrollingEffectVe, CalculateScrollingEffectFrontBounds(scrollDirection)); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r)); - + __pFrontScrollingEffectVe->SetBounds(CalculateScrollingEffectFrontBounds(scrollDirection)); __pFrontScrollingEffectVe->SetShowState(true); __pFrontScrollingEffectVe->SetOpacity(SCROLL_OPACITY_OFF); @@ -1064,9 +1060,7 @@ _ScrollPresenter::Construct(_Control& parentCtrl, r = pVe->AttachChild(*__pReerScrollingEffectVe); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach child to the control VisualElement.", GetErrorMessage(r)); - r = SetScrollChildBounds(*__pReerScrollingEffectVe, CalculateScrollCtrlBounds(scrollDirection)); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r)); - + __pReerScrollingEffectVe->SetBounds(CalculateScrollCtrlBounds(scrollDirection)); __pReerScrollingEffectVe->SetShowState(true); __pReerScrollingEffectVe->SetOpacity(SCROLL_OPACITY_OFF); @@ -1090,12 +1084,10 @@ CATCH: __enableScrollingEffect = false; __enableOverScrollingEffect = false; - __positionMin = 0; - __positionMax = 0; - __viewRange = 0; - __scrollRange = 0; + __viewRange = 0.0f; + __scrollRange = 0.0f; - __scrollPositionCurr = 0; + __scrollPositionCurr = 0.0f; __needUpdateThumb = false; __needUpdateJumpTopTop = false; __needUpdateHandler = false; @@ -1103,7 +1095,6 @@ CATCH: __jumpToTopPressed = false; __thumbColor = 0x00000000; - __jumpToTopBgColor = 0x00000000; __jumpToTopColor = 0x00000000; __jumpToTopColorPressed = 0x00000000; __buttonColor= 0x00000000; @@ -1111,20 +1102,20 @@ CATCH: ReleaseBitmapResources(); - __thumbSizeMin.SetSize(0, 0); - __thumbMargin = 0; - __jumpToTopSize.SetSize(0, 0); - __jumpToTopMarginRight = 0; - __jumpToTopMarginTop = 0; - __handlerSizeMin.SetSize(0, 0); - __handlerMarginLeft = 0; - __handlerMarginRight = 0; - __handlerMarginTop = 0; - __handlerMarginBottom = 0; - __scrollingEffectWidthLeft = 0; - __scrollingEffectWidthRight = 0; - __scrollingEffectHeightTop = 0; - __scrollingEffectHeightBottom = 0; + __thumbSizeMin.SetSize(0.0f, 0.0f); + __thumbMargin = 0.0f; + __jumpToTopSize.SetSize(0.0f, 0.0f); + __jumpToTopMarginRight = 0.0f; + __jumpToTopMarginTop = 0.0f; + __handlerSizeMin.SetSize(0.0f, 0.0f); + __handlerMarginLeft = 0.0f; + __handlerMarginRight = 0.0f; + __handlerMarginTop = 0.0f; + __handlerMarginBottom = 0.0f; + __scrollingEffectWidthLeft = 0.0f; + __scrollingEffectWidthRight = 0.0f; + __scrollingEffectHeightTop = 0.0f; + __scrollingEffectHeightBottom = 0.0f; if (__pThumbVe != null) { @@ -1187,7 +1178,6 @@ _ScrollPresenter::LoadResources(_ScrollDirection scrollDirection, _ControlOrient CATCH: __thumbColor = 0x00000000; - __jumpToTopBgColor = 0x00000000; __jumpToTopColor = 0x00000000; __jumpToTopColorPressed = 0x00000000; __buttonColor= 0x00000000; @@ -1220,10 +1210,7 @@ _ScrollPresenter::LoadColorConfig(void) result r = E_SUCCESS; // load color configuration - r = GET_COLOR_CONFIG(SCROLL::THUMB, __thumbColor); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - - r = GET_COLOR_CONFIG(SCROLL::JUMP_TO_TOP_BG, __jumpToTopBgColor); + r = GET_COLOR_CONFIG(SCROLL::THUMB_BG_NORMAL, __thumbColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); r = GET_COLOR_CONFIG(SCROLL::JUMP_TO_TOP_NORMAL, __jumpToTopColor); @@ -1232,7 +1219,7 @@ _ScrollPresenter::LoadColorConfig(void) r = GET_COLOR_CONFIG(SCROLL::JUMP_TO_TOP_PRESSED, __jumpToTopColorPressed); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); - r = GET_COLOR_CONFIG(SCROLL::BUTTON_BG, __buttonColor); + r = GET_COLOR_CONFIG(SCROLL::BUTTON_BG_NORMAL, __buttonColor); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] Failed to get resource."); r = GET_COLOR_CONFIG(SCROLL::BUTTON_BG_PRESSED, __buttonColorPressed); @@ -1242,7 +1229,6 @@ _ScrollPresenter::LoadColorConfig(void) CATCH: __thumbColor = 0x00000000; - __jumpToTopBgColor = 0x00000000; __jumpToTopColor = 0x00000000; __jumpToTopColorPressed = 0x00000000; __buttonColor= 0x00000000; @@ -1261,41 +1247,35 @@ _ScrollPresenter::LoadBitmapResources(_ScrollDirection scrollDirection) ReleaseBitmapResources(); // load bitmap resources - r = GET_BITMAP_CONFIG_N(SCROLL::THUMB, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - - r = GET_BITMAP_CONFIG_N(SCROLL::THUMB_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - - r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopBitmap); + r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopEfBitmap); + r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_NORMAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonEfBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopLeftBitmap); + r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonPressBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_LEFT_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopLeftEfBitmap); + r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonPressEfBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) + { + r = GET_BITMAP_CONFIG_N(SCROLL::THUMB_HORIZONTAL_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonEfBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + r = GET_BITMAP_CONFIG_N(SCROLL::THUMB_HORIZONTAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonPressBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_LEFT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::HANDLER_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBgBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_LEFT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopPressBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - r = GET_BITMAP_CONFIG_N(SCROLL::HANDLER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBgEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_LEFT_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopEfBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); - if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) - { r = GET_BITMAP_CONFIG_N(SCROLL::HANDLER_HORIZONTAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); @@ -1307,6 +1287,21 @@ _ScrollPresenter::LoadBitmapResources(_ScrollDirection scrollDirection) } else // if (__scrollDirection == SCROLL_DIRECTION_VERTICAL) { + r = GET_BITMAP_CONFIG_N(SCROLL::THUMB_VERTICAL_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + + r = GET_BITMAP_CONFIG_N(SCROLL::THUMB_VERTICAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pThumbEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + + r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + + r = GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopPressBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + + GET_BITMAP_CONFIG_N(SCROLL::JUMP_TO_TOP_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pJumpToTopEfBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + r = GET_BITMAP_CONFIG_N(SCROLL::HANDLER_VERTICAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlerBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); @@ -1315,6 +1310,7 @@ _ScrollPresenter::LoadBitmapResources(_ScrollDirection scrollDirection) r = GET_BITMAP_CONFIG_N(SCROLL::OVERSCROLLING_BOTTOM_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pReerScrollingEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] failed to load image."); + } return E_SUCCESS; @@ -1394,20 +1390,20 @@ _ScrollPresenter::LoadShapeConfig(_ScrollDirection scrollDirection, _ControlOrie return E_SUCCESS; CATCH: - __thumbSizeMin.SetSize(0, 0); - __thumbMargin = 0; - __jumpToTopSize.SetSize(0, 0); - __jumpToTopMarginRight = 0; - __jumpToTopMarginTop = 0; - __handlerSizeMin.SetSize(0, 0); - __handlerMarginLeft = 0; - __handlerMarginRight = 0; - __handlerMarginTop = 0; - __handlerMarginBottom = 0; - __scrollingEffectWidthLeft = 0; - __scrollingEffectWidthRight = 0; - __scrollingEffectHeightTop = 0; - __scrollingEffectHeightBottom = 0; + __thumbSizeMin.SetSize(0.0f, 0.0f); + __thumbMargin = 0.0f; + __jumpToTopSize.SetSize(0.0f, 0.0f); + __jumpToTopMarginRight = 0.0f; + __jumpToTopMarginTop = 0.0f; + __handlerSizeMin.SetSize(0.0f, 0.0f); + __handlerMarginLeft = 0.0f; + __handlerMarginRight = 0.0f; + __handlerMarginTop = 0.0f; + __handlerMarginBottom = 0.0f; + __scrollingEffectWidthLeft = 0.0f; + __scrollingEffectWidthRight = 0.0f; + __scrollingEffectHeightTop = 0.0f; + __scrollingEffectHeightBottom = 0.0f; return E_SYSTEM; @@ -1425,15 +1421,12 @@ _ScrollPresenter::ReleaseBitmapResources(void) delete __pJumpToTopBitmap; __pJumpToTopBitmap = null; + delete __pJumpToTopPressBitmap; + __pJumpToTopPressBitmap = null; + delete __pJumpToTopEfBitmap; __pJumpToTopEfBitmap = null; - delete __pJumpToTopLeftBitmap; - __pJumpToTopLeftBitmap = null; - - delete __pJumpToTopLeftEfBitmap; - __pJumpToTopLeftEfBitmap = null; - delete __pButtonBitmap; __pButtonBitmap = null; @@ -1443,11 +1436,8 @@ _ScrollPresenter::ReleaseBitmapResources(void) delete __pButtonPressBitmap; __pButtonPressBitmap = null; - delete __pHandlerBgBitmap; - __pHandlerBgBitmap = null; - - delete __pHandlerBgEffectBitmap; - __pHandlerBgEffectBitmap = null; + delete __pButtonPressEfBitmap; + __pButtonPressEfBitmap = null; delete __pHandlerBitmap; __pHandlerBitmap = null; @@ -1461,11 +1451,11 @@ _ScrollPresenter::ReleaseBitmapResources(void) return; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateScrollCtrlBounds(_ScrollDirection scrollDirection) { - Rectangle scrollCtrlBounds; - Rectangle parentBounds = GetParentCtrl().GetBounds(); + FloatRectangle scrollCtrlBounds; + FloatRectangle parentBounds = GetParentCtrl().GetBoundsF(); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { @@ -1490,18 +1480,18 @@ _ScrollPresenter::CalculateScrollCtrlBounds(_ScrollDirection scrollDirection) return scrollCtrlBounds; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateThumbBounds(_ScrollDirection scrollDirection) { - Dimension thumbSize = CalculateThumbSize(scrollDirection); - Point thumbPosition = CalculateThumbPosition(scrollDirection); + FloatDimension thumbSize = CalculateThumbSize(scrollDirection); + FloatPoint thumbPosition = CalculateThumbPosition(scrollDirection); FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { - if (thumbPosition.x < 0) + if (thumbPosition.x < 0.0f) { - thumbPosition.x = 0; + thumbPosition.x = 0.0f; } else if (thumbPosition.x > scrollCtrlBounds.width - thumbSize.width) { @@ -1510,9 +1500,9 @@ _ScrollPresenter::CalculateThumbBounds(_ScrollDirection scrollDirection) } else { - if (thumbPosition.y < 0) + if (thumbPosition.y < 0.0f) { - thumbPosition.y = 0; + thumbPosition.y = 0.0f; } else if (thumbPosition.y > scrollCtrlBounds.height - thumbSize.height) { @@ -1520,122 +1510,122 @@ _ScrollPresenter::CalculateThumbBounds(_ScrollDirection scrollDirection) } } - return Rectangle(thumbPosition.x, thumbPosition.y, thumbSize.width, thumbSize.height); + return FloatRectangle(thumbPosition.x, thumbPosition.y, thumbSize.width, thumbSize.height); } -Point +FloatPoint _ScrollPresenter::CalculateThumbPosition(_ScrollDirection scrollDirection) { - Point thumbPosition; + FloatPoint thumbPosition; FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { thumbPosition.x = scrollCtrlBounds.width - (__thumbSizeMin.width + __thumbMargin); - if (thumbPosition.x < 0) + if (thumbPosition.x < 0.0f) { - thumbPosition.x = 0; + thumbPosition.x = 0.0f; } - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - thumbPosition.y = (int)((scrollCtrlBounds.height * __scrollPositionCurr) / __scrollRange); - if (__scrollPositionCurr < 0) + thumbPosition.y = (scrollCtrlBounds.height * __scrollPositionCurr) / __scrollRange; + if (__scrollPositionCurr < 0.0f) { - thumbPosition.y = 0; + thumbPosition.y = 0.0f; } } else { - thumbPosition.y = 0; + thumbPosition.y = 0.0f; } } else { thumbPosition.y = scrollCtrlBounds.height - (__thumbSizeMin.height + __thumbMargin); - if (thumbPosition.y < 0) + if (thumbPosition.y < 0.0f) { - thumbPosition.y = 0; + thumbPosition.y = 0.0f; } - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - thumbPosition.x = (int)((scrollCtrlBounds.width * __scrollPositionCurr) / __scrollRange); - if (__scrollPositionCurr < 0) + thumbPosition.x = (scrollCtrlBounds.width * __scrollPositionCurr) / __scrollRange; + if (__scrollPositionCurr < 0.0f) { - thumbPosition.x = 0; + thumbPosition.x = 0.0f; } } else { - thumbPosition.x = 0; + thumbPosition.x = 0.0f; } } return thumbPosition; } -Dimension +FloatDimension _ScrollPresenter::CalculateThumbSize(_ScrollDirection scrollDirection) { - Dimension thumbSize; + FloatDimension thumbSize; FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { thumbSize.width = MIN(__thumbSizeMin.width, scrollCtrlBounds.width); - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - thumbSize.height = (int)((scrollCtrlBounds.height * __viewRange) / __scrollRange); + thumbSize.height = (scrollCtrlBounds.height * __viewRange) / __scrollRange; thumbSize.height = MAX(__thumbSizeMin.height, thumbSize.height); thumbSize.height = MIN(scrollCtrlBounds.height, thumbSize.height); } else { - thumbSize.height = 0; + thumbSize.height = 0.0f; } } else { thumbSize.height = MIN(__thumbSizeMin.height, scrollCtrlBounds.height); - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - thumbSize.width = (int)((scrollCtrlBounds.width * __viewRange) / __scrollRange); + thumbSize.width = (scrollCtrlBounds.width * __viewRange) / __scrollRange; thumbSize.width = MAX(__thumbSizeMin.width, thumbSize.width); thumbSize.width = MIN(scrollCtrlBounds.width, thumbSize.width); } else { - thumbSize.width = 0; + thumbSize.width = 0.0f; } } return thumbSize; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateHandlerBounds(_ScrollDirection scrollDirection) { - Dimension handlerSize = CalculateHandlerSize(scrollDirection); - Point handlerPosition = CalculateHandlerPosition(scrollDirection); + FloatDimension handlerSize = CalculateHandlerSize(scrollDirection); + FloatPoint handlerPosition = CalculateHandlerPosition(scrollDirection); FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { - if (handlerPosition.x < 0) + if (handlerPosition.x < 0.0f) { - handlerPosition.x = 0; + handlerPosition.x = 0.0f; } else if (handlerPosition.x > scrollCtrlBounds.width - handlerSize.width) { - handlerPosition.x =scrollCtrlBounds.width - handlerSize.width; + handlerPosition.x = scrollCtrlBounds.width - handlerSize.width; } } else { - if (handlerPosition.y < 0) + if (handlerPosition.y < 0.0f) { - handlerPosition.y = 0; + handlerPosition.y = 0.0f; } else if (handlerPosition.y > scrollCtrlBounds.height - handlerSize.height) { @@ -1643,99 +1633,99 @@ _ScrollPresenter::CalculateHandlerBounds(_ScrollDirection scrollDirection) } } - return Rectangle(handlerPosition.x, handlerPosition.y, handlerSize.width, handlerSize.height); + return FloatRectangle(handlerPosition.x, handlerPosition.y, handlerSize.width, handlerSize.height); } -Point +FloatPoint _ScrollPresenter::CalculateHandlerPosition(_ScrollDirection scrollDirection) { - Point handlerPosition; + FloatPoint handlerPosition; FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { handlerPosition.x = scrollCtrlBounds.width - (__handlerSizeMin.width + __handlerMarginRight); - if (handlerPosition.x < 0) + if (handlerPosition.x < 0.0f) { - handlerPosition.x = 0; + handlerPosition.x = 0.0f; } - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - handlerPosition.y = (int)((scrollCtrlBounds.height * __scrollPositionCurr) / __scrollRange); + handlerPosition.y = (scrollCtrlBounds.height * __scrollPositionCurr) / __scrollRange; } else { - handlerPosition.y = 0; + handlerPosition.y = 0.0f; } } else { handlerPosition.y = scrollCtrlBounds.height - (__handlerSizeMin.width + __handlerMarginRight); - if (handlerPosition.y < 0) + if (handlerPosition.y < 0.0f) { - handlerPosition.y = 0; + handlerPosition.y = 0.0f; } - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - handlerPosition.x = (int)((scrollCtrlBounds.width * __scrollPositionCurr) / __scrollRange); + handlerPosition.x = (scrollCtrlBounds.width * __scrollPositionCurr) / __scrollRange; } else { - handlerPosition.x = 0; + handlerPosition.x = 0.0f; } } return handlerPosition; } -Dimension +FloatDimension _ScrollPresenter::CalculateHandlerSize(_ScrollDirection scrollDirection) { - Dimension handlerSize; + FloatDimension handlerSize; FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { handlerSize.width = MIN(__handlerSizeMin.width, scrollCtrlBounds.width); - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - handlerSize.height = (int)((scrollCtrlBounds.height * __viewRange) / __scrollRange); + handlerSize.height = (scrollCtrlBounds.height * __viewRange) / __scrollRange; } else { - handlerSize.height = 0; + handlerSize.height = 0.0f; } } else { handlerSize.height = MIN(__handlerSizeMin.width, scrollCtrlBounds.height); - if (__scrollRange > 0) + if (__scrollRange > 0.0f) { - handlerSize.width = (int)((scrollCtrlBounds.width * __viewRange) / __scrollRange); + handlerSize.width = (scrollCtrlBounds.width * __viewRange) / __scrollRange; } else { - handlerSize.width = 0; + handlerSize.width = 0.0f; } } return handlerSize; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateJumpToTopBounds(_ScrollDirection scrollDirection) { FloatRectangle scrollCtrlBounds = __pCtrlVe->GetBounds(); - Rectangle jumpToTopBounds(0, 0, 0, 0); + FloatRectangle jumpToTopBounds(0.0f, 0.0f, 0.0f, 0.0f); if (scrollDirection == SCROLL_DIRECTION_VERTICAL) { jumpToTopBounds.width = MIN(__jumpToTopSize.width, scrollCtrlBounds.width); jumpToTopBounds.height = MIN(__jumpToTopSize.height, scrollCtrlBounds.height); jumpToTopBounds.x = scrollCtrlBounds.width - (__jumpToTopSize.width + __jumpToTopMarginRight); - if (jumpToTopBounds.x < 0) + if (jumpToTopBounds.x < 0.0f) { - jumpToTopBounds.x = 0; + jumpToTopBounds.x = 0.0f; } jumpToTopBounds.y = __jumpToTopMarginTop; } @@ -1744,9 +1734,9 @@ _ScrollPresenter::CalculateJumpToTopBounds(_ScrollDirection scrollDirection) jumpToTopBounds.width = MIN(__jumpToTopSize.width, scrollCtrlBounds.width); jumpToTopBounds.height = MIN(__jumpToTopSize.height, scrollCtrlBounds.height); jumpToTopBounds.y = scrollCtrlBounds.height - (__jumpToTopSize.height + __jumpToTopMarginRight); - if (jumpToTopBounds.y < 0) + if (jumpToTopBounds.y < 0.0f) { - jumpToTopBounds.y = 0; + jumpToTopBounds.y = 0.0f; } jumpToTopBounds.x = __jumpToTopMarginTop; } @@ -1754,11 +1744,11 @@ _ScrollPresenter::CalculateJumpToTopBounds(_ScrollDirection scrollDirection) return jumpToTopBounds; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateScrollingEffectFrontBounds(_ScrollDirection scrollDirection) { - Rectangle scrollCtrlBounds = GetControl().GetBounds(); - Rectangle scrollEffectFrontBounds(0, 0, 0, 0); + FloatRectangle scrollCtrlBounds = GetControl().GetBoundsF(); + FloatRectangle scrollEffectFrontBounds(0.0f, 0.0f, 0.0f, 0.0f); if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { @@ -1770,15 +1760,14 @@ _ScrollPresenter::CalculateScrollingEffectFrontBounds(_ScrollDirection scrollDir scrollEffectFrontBounds.width = scrollCtrlBounds.width; scrollEffectFrontBounds.height = __scrollingEffectHeightTop; } - return scrollEffectFrontBounds; } -Rectangle +FloatRectangle _ScrollPresenter::CalculateScrollingEffectReerBounds(_ScrollDirection scrollDirection) { - Rectangle scrollCtrlBounds = GetControl().GetBounds(); - Rectangle scrollEffectReerBounds(0, 0, 0, 0); + FloatRectangle scrollCtrlBounds = GetControl().GetBoundsF(); + FloatRectangle scrollEffectReerBounds(0.0f, 0.0f, 0.0f, 0.0f); if (scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { @@ -1797,7 +1786,7 @@ _ScrollPresenter::CalculateScrollingEffectReerBounds(_ScrollDirection scrollDire } result -_ScrollPresenter::AttachScrollChild(_VisualElement** ppScrollVe, const Rectangle& bounds, bool visibility) +_ScrollPresenter::AttachScrollChild(_VisualElement** ppScrollVe, const FloatRectangle& bounds, bool visibility) { result r = E_SUCCESS; _VisualElement* pScrollVe = *ppScrollVe; @@ -1821,9 +1810,7 @@ _ScrollPresenter::AttachScrollChild(_VisualElement** ppScrollVe, const Rectangle *ppScrollVe = pScrollVe; } - r = SetScrollChildBounds(*pScrollVe, bounds); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set bounds.", GetErrorMessage(r)); - + pScrollVe->SetBounds(bounds); pScrollVe->SetShowState(visibility); return E_SUCCESS; @@ -1859,57 +1846,31 @@ _ScrollPresenter::DetachScrollChild(_VisualElement** ppScrollVe, bool destroy) } } -Rectangle -_ScrollPresenter::GetScrollChildBounds(_VisualElement& scrollVe) const -{ - FloatRectangle veBounds = scrollVe.GetBounds(); - return Rectangle(veBounds.x, veBounds.y, veBounds.width, veBounds.height); -} - -result -_ScrollPresenter::SetScrollChildBounds(_VisualElement& scrollVe, const Rectangle& bounds) -{ - FloatRectangle veBounds(bounds.x, bounds.y, bounds.width, bounds.height); - return scrollVe.SetBounds(veBounds); -} - result _ScrollPresenter::RelayoutScrollChildren(_ScrollDirection scrollDirection) { result r = E_SUCCESS; - r = SetScrollChildBounds(*__pCtrlVe, CalculateScrollCtrlBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pCtrlVe."); - + __pCtrlVe->SetBounds(CalculateScrollCtrlBounds(scrollDirection)); if (__enableJumpToTop) { - r = SetScrollChildBounds(*__pJumpToTopVe, CalculateJumpToTopBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pJumpToTopVe."); - + __pJumpToTopVe->SetBounds(CalculateJumpToTopBounds(scrollDirection)); __needUpdateJumpTopTop = true; } if (__enableHandler) { - r = SetScrollChildBounds(*__pHandlerVe, CalculateHandlerBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pHandlerVe."); - + __pHandlerVe->SetBounds(CalculateHandlerBounds(scrollDirection)); __needUpdateHandler = true; } else { - r = SetScrollChildBounds(*__pThumbVe, CalculateThumbBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pThumbVe."); - + __pThumbVe->SetBounds(CalculateThumbBounds(scrollDirection)); __needUpdateThumb = true; } - r = SetScrollChildBounds(*__pFrontScrollingEffectVe, CalculateScrollingEffectFrontBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pFrontScrollingEffectVe."); - - r = SetScrollChildBounds(*__pReerScrollingEffectVe, CalculateScrollingEffectReerBounds(scrollDirection)); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to set bounds the __pReerScrollingEffectVe."); - + __pFrontScrollingEffectVe->SetBounds(CalculateScrollingEffectFrontBounds(scrollDirection)); + __pReerScrollingEffectVe->SetBounds(CalculateScrollingEffectReerBounds(scrollDirection)); __needUpdateScrollingEffect = true; r = (GetControl().GetVisualElement())->InvalidateRectangle(null); @@ -1930,7 +1891,7 @@ _ScrollPresenter::SetParentBouncing(float rate) IList* pChildrenVeList = null; result r = E_SUCCESS; - if (__parentBouncingRate <= 0.0f) + if (_FloatCompare(__parentBouncingRate, 0.0f) || __parentBouncingRate < 0.0f) { __beforeBouncingMatrixHash.RemoveAll(true); @@ -1982,14 +1943,14 @@ _ScrollPresenter::SetParentBouncing(float rate) float scaleRate = 1.0f - (rate * (1.0f - SCROLLING_EFFECT_MIN_SCALE_RATE)); float centerX = 0.0f; float centerY = 0.0f; - Rectangle parentBounds = __pParentCtrl->GetBounds(); - int fixedScrollPosition = __scrollPositionCurr; + FloatRectangle parentBounds = __pParentCtrl->GetBoundsF(); + float fixedScrollPosition = __scrollPositionCurr; if (__parentUsingViewport) { - if (fixedScrollPosition < 0) + if (fixedScrollPosition < 0.0f) { - fixedScrollPosition = 0; + fixedScrollPosition = 0.0f; } else if (fixedScrollPosition > (__scrollRange - __viewRange)) { @@ -1998,7 +1959,7 @@ _ScrollPresenter::SetParentBouncing(float rate) } else { - fixedScrollPosition = 0; + fixedScrollPosition = 0.0f; } if (__scrollDirection == SCROLL_DIRECTION_HORIZONTAL) @@ -2132,16 +2093,21 @@ _ScrollPresenter::DrawThumb(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + FloatRectangle thumbBounds = __pThumbVe->GetBounds(); + thumbBounds.SetPosition(0.0f, 0.0f); + bool isCustomBitmap = IS_CUSTOM_BITMAP(SCROLL::THUMB_BG_NORMAL); + pThumbBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pThumbBitmap, Color::GetColor(COLOR_ID_MAGENTA), __thumbColor); SysTryCatch(NID_UI_CTRL, pThumbBitmap, , GetLastResult(), "[%s] Failed to draw bitmap.", GetErrorMessage(GetLastResult())); - Rectangle thumbBounds = GetScrollChildBounds(*__pThumbVe); - thumbBounds.SetPosition(0, 0); - r = DrawBitmap(*pCanvas, thumbBounds, *__pThumbEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + if (isCustomBitmap == false) + { + r = DrawBitmap(*pCanvas, thumbBounds, *__pThumbEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + } r = DrawBitmap(*pCanvas, thumbBounds, *pThumbBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); @@ -2170,17 +2136,28 @@ _ScrollPresenter::DrawJumpToTop(void) if (__enableJumpToTop) { - Bitmap* pBitmap = __pJumpToTopBitmap; - Bitmap* pEfBitmap = __pJumpToTopEfBitmap; + String bitmapId = L"SCROLL::JUMP_TO_TOP_NORMAL"; if (__scrollDirection == SCROLL_DIRECTION_HORIZONTAL) { - pBitmap = __pJumpToTopLeftBitmap; - pEfBitmap = __pJumpToTopLeftEfBitmap; + bitmapId = L"SCROLL::JUMP_TO_LEFT_NORMAL"; } - Color jumpToTopColor = (__jumpToTopPressed) ? __jumpToTopColorPressed : __jumpToTopColor; - Color buttonColor = (__jumpToTopPressed) ? __buttonColorPressed : __buttonColor; - Bitmap* pButtonEfBitmap = (__jumpToTopPressed) ? __pButtonPressBitmap : __pButtonEfBitmap; + Color jumpToTopColor = __jumpToTopColor; + Color buttonColor = __buttonColor; + Bitmap* pJumpToTopBitmap = __pJumpToTopBitmap; + Bitmap* pButtonBitmap = __pButtonBitmap; + Bitmap* pButtonEfBitmap = __pButtonEfBitmap; + String buttonBitmapId = L"SCROLL::BUTTON_BG_NORMAL"; + + if (__jumpToTopPressed) + { + jumpToTopColor = __jumpToTopColorPressed; + buttonColor = __buttonColorPressed; + pJumpToTopBitmap = __pJumpToTopPressBitmap; + pButtonBitmap = __pButtonPressBitmap; + pButtonEfBitmap = __pButtonPressEfBitmap; + buttonBitmapId = L"SCROLL::BUTTON_BG_PRESSED"; + } pCanvas = __pJumpToTopVe->GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, GetLastResult(), "Failed to get the canvas of __pJumpToTopVe"); @@ -2188,14 +2165,18 @@ _ScrollPresenter::DrawJumpToTop(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle jumpToTopBounds = GetScrollChildBounds(*__pJumpToTopVe); - jumpToTopBounds.SetPosition(0, 0); + FloatRectangle jumpToTopBounds = __pJumpToTopVe->GetBounds(); + jumpToTopBounds.SetPosition(0.0f, 0.0f); //Draw Button - r = DrawBitmap(*pCanvas, jumpToTopBounds, *pButtonEfBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + bool isCustomBitmap = IS_CUSTOM_BITMAP(buttonBitmapId); + if (isCustomBitmap == false) + { + r = DrawBitmap(*pCanvas, jumpToTopBounds, *pButtonEfBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pButtonBitmap, + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonColor); SysTryCatch(NID_UI_CTRL, pColorReplacedBitmap, , GetLastResult(), "[%s] Failed to draw bitmap.", GetErrorMessage(GetLastResult())); @@ -2203,10 +2184,14 @@ _ScrollPresenter::DrawJumpToTop(void) r = DrawBitmap(*pCanvas, jumpToTopBounds, *pColorReplacedBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); - r = DrawBitmap(*pCanvas, jumpToTopBounds, *pEfBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + isCustomBitmap = IS_CUSTOM_BITMAP(bitmapId); + if (isCustomBitmap == false) + { + r = DrawBitmap(*pCanvas, jumpToTopBounds, *__pJumpToTopEfBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + } - pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pJumpToTopBitmap, Color::GetColor(COLOR_ID_MAGENTA), jumpToTopColor); SysTryCatch(NID_UI_CTRL, pColorReplacedBitmap, , GetLastResult(), "[%s] Failed to draw bitmap.", GetErrorMessage(GetLastResult())); @@ -2247,19 +2232,8 @@ _ScrollPresenter::DrawHandler(void) pCanvas->Clear(); // draw handler bg bitmap - pHandlerBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pHandlerBgBitmap, - Color::GetColor(COLOR_ID_MAGENTA), - __thumbColor); - SysTryCatch(NID_UI_CTRL, pHandlerBgBitmap, , GetLastResult(), "[%s] Failed to draw bitmap.", GetErrorMessage(GetLastResult())); - - Rectangle handlerBounds = GetScrollChildBounds(*__pHandlerVe); - handlerBounds.SetPosition(0, 0); - - r = DrawBitmap(*pCanvas, handlerBounds, *__pHandlerBgEffectBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); - - r = DrawBitmap(*pCanvas, handlerBounds, *pHandlerBgBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); + FloatRectangle handlerBounds = __pHandlerVe->GetBounds(); + handlerBounds.SetPosition(0.0f, 0.0f); r = DrawBitmap(*pCanvas, handlerBounds, *__pHandlerBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); @@ -2294,8 +2268,8 @@ _ScrollPresenter::DrawScrollingEffect(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle effectBounds = GetScrollChildBounds(*__pFrontScrollingEffectVe); - effectBounds.SetPosition(0, 0); + FloatRectangle effectBounds = __pFrontScrollingEffectVe->GetBounds(); + effectBounds.SetPosition(0.0f, 0.0f); r = DrawBitmap(*pCanvas, effectBounds, *__pFrontScrollingEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); @@ -2311,8 +2285,8 @@ _ScrollPresenter::DrawScrollingEffect(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - Rectangle effectBounds = GetScrollChildBounds(*__pReerScrollingEffectVe); - effectBounds.SetPosition(0, 0); + FloatRectangle effectBounds = __pReerScrollingEffectVe->GetBounds(); + effectBounds.SetPosition(0.0f, 0.0f); r = DrawBitmap(*pCanvas, effectBounds, *__pReerScrollingEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to draw bitmap.", GetErrorMessage(r)); @@ -2328,7 +2302,7 @@ CATCH: } result -_ScrollPresenter::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitmap& bitmap) +_ScrollPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -2338,7 +2312,7 @@ _ScrollPresenter::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitm } else { - Point pos((bounds.width - bitmap.GetWidth()) / 2, (bounds.height - bitmap.GetHeight()) / 2); + FloatPoint pos((bounds.width - bitmap.GetWidthF()) / 2.0f, (bounds.height - bitmap.GetHeightF()) / 2.0f); r = canvas.DrawBitmap(pos, bitmap); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Failed to draw bitmap"); } @@ -2352,18 +2326,20 @@ _ScrollPresenter::OnTouchPressedJumpToTop(const _Control& source, const _TouchIn if (__enableJumpToTop && IsScrollVisible()) { FloatRectangle ctrlBounds = __pCtrlVe->GetBounds(); - Rectangle jumpToTopBounds = GetScrollChildBounds(*__pJumpToTopVe); + FloatRectangle jumpToTopBounds = __pJumpToTopVe->GetBounds(); jumpToTopBounds.x += ctrlBounds.x; jumpToTopBounds.y += ctrlBounds.y; - if (jumpToTopBounds.Contains(touchinfo.GetCurrentPosition())) + FloatPoint touchedPosition = touchinfo.GetCurrentPosition(); + if (jumpToTopBounds.Contains(touchedPosition)) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); __needUpdateJumpTopTop = true; __jumpToTopPressed = true; (GetControl().GetVisualElement())->InvalidateRectangle(null); if (__pScrollEvent) { - _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollEventArgN(*__pScrollCtrl, 0); + _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollJumpToTopEventArgN(*__pScrollCtrl); SysTryReturn(NID_UI_CTRL, pEventArg, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); __pScrollEvent->Fire(*pEventArg); @@ -2395,10 +2371,11 @@ _ScrollPresenter::OnTouchMovedJumpToTop(const _Control& source, const _TouchInfo if (__jumpToTopPressed) { FloatRectangle ctrlBounds = __pCtrlVe->GetBounds(); - Rectangle jumpToTopBounds = GetScrollChildBounds(*__pJumpToTopVe); + FloatRectangle jumpToTopBounds = __pJumpToTopVe->GetBounds(); jumpToTopBounds.x += ctrlBounds.x; jumpToTopBounds.y += ctrlBounds.y; - if (!(jumpToTopBounds.Contains(touchinfo.GetCurrentPosition()))) + FloatPoint touchedPosition = touchinfo.GetCurrentPosition(); + if (!(jumpToTopBounds.Contains(touchedPosition))) { __needUpdateJumpTopTop = true; __jumpToTopPressed = false; @@ -2415,10 +2392,11 @@ _ScrollPresenter::OnTouchPressedHandler(const _Control& source, const _TouchInfo if (__enableHandler) { FloatRectangle ctrlBounds = __pCtrlVe->GetBounds(); - Rectangle handlerBounds = GetScrollChildBounds(*__pHandlerVe); + FloatRectangle handlerBounds = __pHandlerVe->GetBounds(); handlerBounds.x += ctrlBounds.x; handlerBounds.y += ctrlBounds.y; - if (handlerBounds.Contains(touchinfo.GetCurrentPosition())) + FloatPoint touchedPosition = touchinfo.GetCurrentPosition(); + if (handlerBounds.Contains(touchedPosition)) { __handlerTouched = true; if (__scrollDirection == SCROLL_DIRECTION_VERTICAL) @@ -2442,8 +2420,15 @@ _ScrollPresenter::OnTouchReleasedHandler(const _Control& source, const _TouchInf if (__enableHandler) { __handlerTouched = false; - __handlerTouchedPosition = 0; + __handlerTouchedPosition = 0.0f; + if (__pScrollEvent) + { + _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollEventArgN(*__pScrollCtrl); + SysTryReturn(NID_UI_CTRL, pEventArg, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + __pScrollEvent->Fire(*pEventArg); + } return true; } @@ -2456,10 +2441,10 @@ _ScrollPresenter::OnTouchMovedHandler(const _Control& source, const _TouchInfo& { if (__enableHandler && __handlerTouched) { - int scrollPosition = GetScrollPosition(); - Rectangle scrollCtrlBounds = GetControl().GetBounds(); - int touchPosition = 0; - int scrollBoundsRange = 0; + float scrollPosition = GetScrollPosition(); + FloatRectangle scrollCtrlBounds = GetControl().GetBoundsF(); + float touchPosition = 0.0f; + float scrollBoundsRange = 0.0f; if (__scrollDirection == SCROLL_DIRECTION_VERTICAL) { @@ -2472,17 +2457,16 @@ _ScrollPresenter::OnTouchMovedHandler(const _Control& source, const _TouchInfo& scrollBoundsRange = scrollCtrlBounds.width; } - //1. move handler - int touchDistance = touchPosition - __handlerTouchedPosition; - int scrollDistance = (int)(( __scrollRange * touchDistance) / scrollBoundsRange); + float touchDistance = touchPosition - __handlerTouchedPosition; + float scrollDistance = ( __scrollRange * touchDistance) / scrollBoundsRange; scrollPosition += scrollDistance; int scrollType = -1; - if (scrollPosition <= 0) + if (_FloatCompare(scrollPosition, 0.0f) || scrollPosition < 0.0f) { scrollType = (__scrollDirection == SCROLL_DIRECTION_VERTICAL) ? SCROLL_END_EVENT_END_TOP : SCROLL_END_EVENT_END_LEFT; - scrollPosition = 0; + scrollPosition = 0.0f; } else if (scrollPosition >= __scrollRange - __viewRange) { @@ -2496,7 +2480,6 @@ _ScrollPresenter::OnTouchMovedHandler(const _Control& source, const _TouchInfo& __handlerTouchedPosition = touchPosition; - //2. fire event if (__pScrollEvent) { _UiScrollEventArg* pEventArg = null; diff --git a/src/ui/controls/FUiCtrl_SearchBar.cpp b/src/ui/controls/FUiCtrl_SearchBar.cpp old mode 100644 new mode 100755 index e5673c0..c2783f6 --- a/src/ui/controls/FUiCtrl_SearchBar.cpp +++ b/src/ui/controls/FUiCtrl_SearchBar.cpp @@ -39,6 +39,7 @@ #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Ui; @@ -86,6 +87,7 @@ _SearchBar::_SearchBar(void) { __color[i] = Color(0); __textColor[i] = Color(0); + __guideTextColor[i] = Color(0); } _AccessibilityContainer* pContainer = GetAccessibilityContainer(); @@ -192,9 +194,9 @@ _SearchBar::Initialize(bool enableSearchBarButton, CoreKeypadAction keypadAction // Setting Button color GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_NORMAL, __buttonColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]); - GET_COLOR_CONFIG(SEARCHBAR::BUTTON_PRESSED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]); - GET_COLOR_CONFIG(SEARCHBAR::BUTTON_HIGHLIGHTED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]); - GET_COLOR_CONFIG(SEARCHBAR::BUTTON_DISABLED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]); + GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_PRESSED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]); + GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_HIGHLIGHTED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(SEARCHBAR::BUTTON_BG_DISABLED, __buttonColor[SEARCH_BAR_BUTTON_STATUS_DISABLED]); GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_NORMAL, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_NORMAL]); GET_COLOR_CONFIG(SEARCHBAR::BUTTON_TEXT_PRESSED, __buttonTextColor[SEARCH_BAR_BUTTON_STATUS_PRESSED]); @@ -209,16 +211,16 @@ _SearchBar::Initialize(bool enableSearchBarButton, CoreKeypadAction keypadAction { case SEARCH_FIELD_STATUS_DISABLED: GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_DISABLED, __color[i]); - GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_DISABLED, __textColor[i]); + GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_DISABLED, __guideTextColor[i]); break; case SEARCH_FIELD_STATUS_HIGHLIGHTED: GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]); - GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_HIGHLIGHTED, __textColor[i]); + GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_HIGHLIGHTED, __guideTextColor[i]); break; default: GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]); - GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_NORMAL, __textColor[i]); + GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]); break; } } @@ -269,7 +271,7 @@ _SearchBar::CreateSearchField(void) { result r = E_SUCCESS; - Rectangle editBounds; + FloatRectangle editBounds; int horizontalMargin = 0; int verticalMargin = 0; int iconHorizontalMargin = 0; @@ -277,9 +279,9 @@ _SearchBar::CreateSearchField(void) int iconWidth = 0; int textSize = 0; int searchFieldMinWidth = 0; - int searchFieldMinHeight = 0; + int searchBarMinHeight = 0; - Rectangle searchBarBounds = GetBounds(); + FloatRectangle searchBarBounds = GetBoundsF(); _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); _AccessibilityContainer* pSearchBarContainer = null; @@ -289,12 +291,14 @@ _SearchBar::CreateSearchField(void) GET_SHAPE_CONFIG(SEARCHBAR::ICON_WIDTH, orientation, iconWidth); GET_SHAPE_CONFIG(SEARCHBAR::TEXT_HORIZONTAL_MARGIN, orientation, textHorizontalMargin); GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth); - GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_HEIGHT, orientation, searchFieldMinHeight); + GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight); - editBounds.x = horizontalMargin; - editBounds.y = verticalMargin; - editBounds.width = searchBarBounds.width - (editBounds.x * 2); - editBounds.height = searchBarBounds.height - (editBounds.y * 2); + int searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2); + + editBounds.x = _CoordinateSystemUtils::ConvertToFloat(horizontalMargin); + editBounds.y = _CoordinateSystemUtils::ConvertToFloat(verticalMargin); + editBounds.width = searchBarBounds.width - (editBounds.x * 2.0f); + editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f); editBounds.width = (editBounds.width > searchFieldMinWidth) ? editBounds.width : searchFieldMinWidth; editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight; @@ -310,7 +314,6 @@ _SearchBar::CreateSearchField(void) __pEdit->SetKeypadCommandButtonVisible(false); __pEdit->SetBounds(editBounds); - __pEdit->AddKeypadEventListener(*this); __pEdit->AddTextBlockEventListener(*this); __pEdit->AddTextEventListener(*this); @@ -328,11 +331,8 @@ _SearchBar::CreateSearchField(void) __pEdit->SetColor(editStatus, __color[status]); } - __pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, __textColor[SEARCH_FIELD_STATUS_NORMAL]); - __pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, __textColor[SEARCH_FIELD_STATUS_DISABLED]); - __pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]); - __pEdit->ReplaceDefaultBackgroundBitmapForSearchBar(); + __pEdit->SetPressedGuideTextColor(__guideTextColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]); __pEdit->SetKeypadAction(__keypadAction); @@ -340,7 +340,7 @@ _SearchBar::CreateSearchField(void) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to attach edit as child."); - if(likely(!(_AccessibilityManager::IsActivated()))) + if (likely(!(_AccessibilityManager::IsActivated()))) { return E_SUCCESS; } @@ -416,7 +416,7 @@ _SearchBar::CreateCancelButton(void) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to attach button as child."); - if(likely(!(_AccessibilityManager::IsActivated()))) + if (likely(!(_AccessibilityManager::IsActivated()))) { return E_SUCCESS; } @@ -473,18 +473,19 @@ _SearchBar::SetContentsArea(void) return; } - Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize(); - int width = screenSize.width; - int height = screenSize.height; + FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); + float width = screenSize.width; + float height = screenSize.height; + _Control* pParent = GetParentForm(); if (pParent != null) { - width = pParent->GetClientBounds().width; - height = pParent->GetClientBounds().height; + width = pParent->GetClientBoundsF().width; + height = pParent->GetClientBoundsF().height; } - __contentAreaBounds = GetBounds(); - __contentAreaBounds.x = 0; + __contentAreaBounds = GetBoundsF(); + __contentAreaBounds.x = 0.0f; __contentAreaBounds.y = __contentAreaBounds.height; __contentAreaBounds.width = width; __contentAreaBounds.height = height - __contentAreaBounds.height; @@ -494,15 +495,6 @@ _SearchBar::SetContentsArea(void) result r = E_SUCCESS; r = __pContainer->SetBounds(__contentAreaBounds); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - - if (pParent) - { - _Form* pForm = dynamic_cast<_Form*>(pParent); - if (pForm) - { - pForm->Invalidate(true); - } - } } return; } @@ -799,8 +791,8 @@ _SearchBar::SetText(const String& text) int limitLength = __pEdit->GetTextLimitLength(); int textLength = text.GetLength(); - SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, - "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength); + SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_SYSTEM, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. textLength exceeds the limitLength"); r = __pEdit->SetText(text); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, @@ -826,11 +818,11 @@ _SearchBar::InsertCharacterAt(int index, const Character& character) limitLength = __pEdit->GetTextLimitLength(); textLength = __pEdit->GetTextLength() + 1; - SysTryReturn(NID_UI_CTRL, limitLength > textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, + SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength); - SysTryReturn(NID_UI_CTRL, textLength >= index, E_OUT_OF_RANGE, E_OUT_OF_RANGE, - "[E_OUT_OF_RANGE] index(%d) is out of range textLength(%d).", index, textLength); + SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, + "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength()); r = __pEdit->InsertCharacterAt(index, character); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, @@ -847,17 +839,23 @@ _SearchBar::InsertTextAt(int index, const String& text) SysTryReturn(NID_UI_CTRL, index > -1, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] index(%d) is out of range.", index); + result r = E_SUCCESS; + int textLength = 0; int limitLength = 0; limitLength = __pEdit->GetTextLimitLength(); textLength = __pEdit->GetTextLength() + text.GetLength(); - SysTryReturn(NID_UI_CTRL, limitLength > textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, + SysTryReturn(NID_UI_CTRL, limitLength >= textLength, E_MAX_EXCEEDED, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] limitLength(%d) exceeds the maximum limit textLength(%d).", limitLength, textLength); - SysTryReturn(NID_UI_CTRL, textLength >= index, E_OUT_OF_RANGE, E_OUT_OF_RANGE, - "[E_OUT_OF_RANGE] index(%d) is out of range textLength(%d).", index, textLength); + SysTryReturn(NID_UI_CTRL, index <= __pEdit->GetTextLength(), E_OUT_OF_RANGE, E_OUT_OF_RANGE, + "[E_OUT_OF_RANGE] index(%d) is out of range of current textLength(%d).", index, __pEdit->GetTextLength()); + + r = __pEdit->InsertTextAt(index, text); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to insert text."); - return __pEdit->InsertTextAt(index, text); + return r; } result @@ -868,13 +866,18 @@ _SearchBar::DeleteCharacterAt(int index) SysTryReturn(NID_UI_CTRL, index > -1, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. index = %d", index); + result r = E_SUCCESS; int textLength = 0; textLength = __pEdit->GetTextLength(); SysTryReturn(NID_UI_CTRL, textLength > index, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] index(%d) is out of range. textLength(%d)", index, textLength); - return __pEdit->DeleteCharacterAt(index); + r = __pEdit->DeleteCharacterAt(index); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, + "[E_SYSTEM] A system error has occured. Failed to delete character."); + + return r; } result @@ -974,17 +977,17 @@ _SearchBar::HideKeypad(void) return r; } -int -_SearchBar::GetSearchFieldTextSize(void) const +float +_SearchBar::GetSearchFieldTextSizeF(void) const { SysTryReturn(NID_UI_CTRL, __pEdit, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The edit instance is null."); - return __pEdit->GetTextSize(); + return __pEdit->GetTextSizeF(); } result -_SearchBar::SetSearchFieldTextSize(int size) +_SearchBar::SetSearchFieldTextSize(float size) { SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The edit instance is null."); @@ -1002,11 +1005,11 @@ _SearchBar::GetBlockRange(int& start, int& end) const int endIndex = -1; __pEdit->GetBlockRange(startIndex, endIndex); - SysTryReturn(NID_UI_CTRL, (startIndex > -1 && endIndex > -1), E_SYSTEM, E_SYSTEM, + SysTryReturn(NID_UI_CTRL, (startIndex > -1 && endIndex > 0), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get text block range."); start = startIndex; - end = endIndex; + end = endIndex - 1; return E_SUCCESS; } @@ -1038,10 +1041,9 @@ _SearchBar::SetBlockRange(int start, int end) int textLength = 0; textLength = __pEdit->GetTextLength(); - SysTryReturn(NID_UI_CTRL, (textLength > start && textLength > end), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument(s) is used. textLength = %d, start = %d, end = %d", start, end); - SysTryReturn(NID_UI_CTRL, (start <= end && start >= 0), E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument(s) is used. start = %d, end = %d", start, end); + + SysTryReturn(NID_UI_CTRL, (start < end && start >= 0 && textLength >= end), E_OUT_OF_RANGE, E_OUT_OF_RANGE, + "[E_OUT_OF_RANGE] start (%d) and end (%d) is out of range.", start, end - 1); r = SetCursorPosition(start); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); @@ -1065,18 +1067,9 @@ _SearchBar::RemoveTextBlock(void) result r = E_SUCCESS; - int start = 0; - int end = 0; - - r = GetBlockRange(start, end); + r = __pEdit->RemoveTextBlock(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - for (int index = start; index < end; index++) - { - r = __pEdit->DeleteCharacterAt(start); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - } - return r; } @@ -1296,7 +1289,7 @@ _SearchBar::SetLowerCaseModeEnabled(bool enable) EllipsisPosition _SearchBar::GetEllipsisPosition(void) const { - SysTryReturn(NID_UI_CTRL, __pEdit, ELLIPSIS_POSITION_START, ELLIPSIS_POSITION_START, + SysTryReturn(NID_UI_CTRL, __pEdit, ELLIPSIS_POSITION_START, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The edit instance is null."); return __pEdit->GetEllipsisPosition(); @@ -1543,8 +1536,17 @@ _SearchBar::OnBoundsChanged(void) } void +_SearchBar::OnChangeLayout(_ControlOrientation orientation) +{ + SetContentsArea(); +} + +void _SearchBar::OnDraw(void) { + SearchFieldStatus searchFieldStatus = GetCurrentStatus(); + SetGuideTextColor(__guideTextColor[searchFieldStatus]); + __pSearchBarPresenter->Draw(); return; } @@ -1629,6 +1631,8 @@ _SearchBar::OnKeypadClosed(void) __pKeypadEvent->Fire(*pEventArg); } + + SetContentsArea(); return; } @@ -1643,6 +1647,8 @@ _SearchBar::OnKeypadBoundsChanged(void) __pKeypadEvent->Fire(*pEventArg); } + + SetContentsArea(); return; } @@ -2298,18 +2304,18 @@ _SearchBar::GetPropertyColor(void) const result _SearchBar::SetPropertyContentAreaSize(const Variant& size) { - Dimension contentAreaSize = size.ToDimension(); + FloatDimension contentAreaSize = size.ToFloatDimension(); SysTryReturn(NID_UI_CTRL, contentAreaSize.width >= 0 && contentAreaSize.height >= 0, E_INVALID_ARG, E_INVALID_ARG, - "[E_INVALID_ARG] Invalid argument(s) is used. contentAreaSize.width = %d, contenAreaSize.height = %d", + "[E_INVALID_ARG] Invalid argument(s) is used. contentAreaSize.width = %f, contenAreaSize.height = %f", contentAreaSize.width, contentAreaSize.height); result r = E_SUCCESS; // Todo - Rectangle bounds = GetBounds(); - Rectangle contentAreaBounds(0, 0, 0, 0); + FloatRectangle bounds = GetBoundsF(); + FloatRectangle contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); - contentAreaBounds.x = 0; + contentAreaBounds.x = 0.0f; contentAreaBounds.y = bounds.height; contentAreaBounds.width = contentAreaSize.width; contentAreaBounds.height = contentAreaSize.height; @@ -2330,7 +2336,7 @@ _SearchBar::SetPropertyContentAreaSize(const Variant& size) Variant _SearchBar::GetPropertyContentAreaSize(void) const { - Dimension contentAreaSize(__contentAreaBounds.width, __contentAreaBounds.height); + FloatDimension contentAreaSize(__contentAreaBounds.width, __contentAreaBounds.height); return Variant(contentAreaSize); } @@ -2339,8 +2345,7 @@ result _SearchBar::CreateClippedGroupControl(void) { result r = E_SUCCESS; - Rectangle clippedGroupControlBounds(Point(0, 0), GetSize()); - + FloatRectangle clippedGroupControlBounds(FloatPoint(0.0f, 0.0f), GetSizeF()); __pClippedGroupControl = _Control::CreateControlN(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); @@ -2369,7 +2374,7 @@ CATCH: void _SearchBar::SetContentDimming(void) { - if(__pContainer != NULL) + if (__pContainer != NULL) { if (!GetTextLength()) { @@ -2410,45 +2415,99 @@ _SearchBar::ResizeCancelButton(void) int buttonRightMargin = 0; int buttonMinWidth = 0; int searchFieldMinWidth = 0; + int buttonVerticalMargin = 0; + int searchBarMinHeight = 0; + int buttonWidth = 0; + int buttonHeight = 0; - Rectangle cancelButtonBounds; - Rectangle searchBarBounds = GetBounds(); + FloatRectangle cancelButtonBounds; + FloatRectangle searchBarBounds = GetBoundsF(); _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin); GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_LEFT_MARGIN, orientation, buttonLeftMargin); GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin); - GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, cancelButtonBounds.width); - GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, cancelButtonBounds.height); + GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth); + GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_HEIGHT, orientation, buttonHeight); GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_MIN_WIDTH, orientation, buttonMinWidth); GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth); + GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin); + GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight); - int buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth + + cancelButtonBounds.width = _CoordinateSystemUtils::ConvertToFloat(buttonWidth); + cancelButtonBounds.height = _CoordinateSystemUtils::ConvertToFloat(buttonHeight); + + float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth + cancelButtonBounds.width + buttonLeftMargin + buttonRightMargin); - if(searchBarBounds.width < buttonResizableSearchBarWidth) + if (searchBarBounds.width < buttonResizableSearchBarWidth) { cancelButtonBounds.width = searchBarBounds.width -(searchFieldMinWidth + buttonLeftMargin + buttonRightMargin + horizontalMargin); } cancelButtonBounds.x = searchBarBounds.width - cancelButtonBounds.width - buttonRightMargin; - cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2; + cancelButtonBounds.y = (searchBarBounds.height - cancelButtonBounds.height)/2.0f; + if (searchBarBounds.height < searchBarMinHeight) + { + cancelButtonBounds.y = buttonVerticalMargin; + } - if(cancelButtonBounds.width < buttonMinWidth) + if (cancelButtonBounds.width < buttonMinWidth) { cancelButtonBounds.width = buttonMinWidth; } - cancelButtonBounds.width = (cancelButtonBounds.width > 0) ? cancelButtonBounds.width : 0; - cancelButtonBounds.height = (cancelButtonBounds.height > 0) ? cancelButtonBounds.height : 0; - + cancelButtonBounds.width = (cancelButtonBounds.width > 0.0f) ? cancelButtonBounds.width : 0.0f; + cancelButtonBounds.height = (cancelButtonBounds.height > 0.0f) ? cancelButtonBounds.height : 0.0f; r = __pCancelButton->SetBounds(cancelButtonBounds); return r; } +SearchFieldStatus +_SearchBar::GetCurrentStatus(void) +{ + SearchFieldStatus searchFieldStatus = SEARCH_FIELD_STATUS_NORMAL; + + if (IsEnabled()) + { + if (__pEdit->IsFocused()) + { + searchFieldStatus = SEARCH_FIELD_STATUS_HIGHLIGHTED; + } + } + else + { + searchFieldStatus = SEARCH_FIELD_STATUS_DISABLED; + } + + return searchFieldStatus; +} + +void +_SearchBar::SetEditTextFilter(IEditTextFilter* pFilter) +{ + SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. The edit instance is null."); + + __pEdit->SetEditTextFilter(pFilter); + + return; +} + +void +_SearchBar::SendOpaqueCommand(const String& command) +{ + SysTryReturnVoidResult(NID_UI_CTRL, __pEdit, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. The edit instance is null."); + + __pEdit->SendOpaqueCommand(command); + + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_SearchBarImpl.cpp b/src/ui/controls/FUiCtrl_SearchBarImpl.cpp old mode 100644 new mode 100755 index 7a76d8d..5227180 --- a/src/ui/controls/FUiCtrl_SearchBarImpl.cpp +++ b/src/ui/controls/FUiCtrl_SearchBarImpl.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" #include "FUi_UiBuilder.h" @@ -30,6 +32,7 @@ #include "FUiCtrl_PublicTextBlockEvent.h" #include "FUiCtrl_PublicTextEvent.h" #include "FUiCtrl_SearchBarImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::App; using namespace Tizen::Base; @@ -124,6 +127,37 @@ CATCH: return null; } +_SearchBarImpl* +_SearchBarImpl::CreateSearchBarImplFN(SearchBar* pControl, const FloatRectangle& bounds, bool enableSearchBarButton, KeypadAction keypadAction) +{ + ClearLastResult(); + result r = E_SUCCESS; + + r = GET_SIZE_INFO(SearchBar).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, + "[E_INVALID_ARG] Invalid argument(s) is used. The given size is not valid."); + + _SearchBar* pCore = _SearchBar::CreateSearchBarN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _SearchBarImpl* pImpl = new (std::nothrow) _SearchBarImpl(pControl, pCore); + + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(SearchBar), bounds, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->Initialize(enableSearchBarButton, keypadAction); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +CATCH: + delete pImpl; + return null; +} + const char* _SearchBarImpl::GetPublicClassName(void) const { @@ -307,7 +341,7 @@ _SearchBarImpl::SetContent(const Control* pContent) { pContainer->DetachChild(contentControl); - if(_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) + if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat()) { delete __pContentControl; } @@ -355,8 +389,19 @@ _SearchBarImpl::SetContentAreaSize(const Dimension& size) { ClearLastResult(); - Variant var(size); + FloatDimension contentSize; + contentSize = _CoordinateSystemUtils::ConvertToFloat(size); + Variant var(contentSize); + + return __pSearchBar->SetPropertyContentAreaSize(var); +} + +result +_SearchBarImpl::SetContentAreaSize(const FloatDimension& size) +{ + ClearLastResult(); + Variant var(size); return __pSearchBar->SetPropertyContentAreaSize(var); } @@ -365,7 +410,18 @@ _SearchBarImpl::GetContentAreaSize(void) const { ClearLastResult(); - return __pSearchBar->GetPropertyContentAreaSize().ToDimension(); + Dimension size; + size = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetPropertyContentAreaSize().ToFloatDimension()); + + return size; +} + +FloatDimension +_SearchBarImpl::GetContentAreaSizeF(void) const +{ + ClearLastResult(); + + return __pSearchBar->GetPropertyContentAreaSize().ToFloatDimension(); } SearchBarMode @@ -607,7 +663,12 @@ _SearchBarImpl::Clear(void) { ClearLastResult(); - return __pSearchBar->Clear(); + result r = E_SUCCESS; + r = __pSearchBar->Clear(); + + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, + "[E_SYSTEM] A system error has occured. Failed to clear the text."); + return r; } int @@ -671,7 +732,16 @@ _SearchBarImpl::GetSearchFieldTextSize(void) const { ClearLastResult(); - return __pSearchBar->GetSearchFieldTextSize(); + int textSize = _CoordinateSystemUtils::ConvertToInteger(__pSearchBar->GetSearchFieldTextSizeF()); + return textSize; +} + +float +_SearchBarImpl::GetSearchFieldTextSizeF(void) const +{ + ClearLastResult(); + + return __pSearchBar->GetSearchFieldTextSizeF(); } result @@ -679,6 +749,15 @@ _SearchBarImpl::SetSearchFieldTextSize(int size) { ClearLastResult(); + float textSize = _CoordinateSystemUtils::ConvertToFloat(size); + return SetSearchFieldTextSize(textSize); +} + +result +_SearchBarImpl::SetSearchFieldTextSize(float size) +{ + ClearLastResult(); + return __pSearchBar->SetSearchFieldTextSize(size); } @@ -703,17 +782,7 @@ _SearchBarImpl::SetBlockRange(int start, int end) { ClearLastResult(); - int tempTextLength = 0; - - tempTextLength = __pSearchBar->GetTextLength(); - SysTryReturnResult(NID_UI_CTRL, tempTextLength > start && tempTextLength > end, E_INVALID_ARG, - "Invalid argument(s) is used. tempTextLength(%d),start(%d), end(%d)", - tempTextLength, start, end); - - SysTryReturnResult(NID_UI_CTRL, (start <= end && start >= 0), E_INVALID_ARG, - "Invalid argument(s) is used. start(%d), end(%d)", start, end); - - return __pSearchBar->SetBlockRange(start, end); + return __pSearchBar->SetBlockRange(start, end + 1); } result @@ -1145,6 +1214,22 @@ _SearchBarImpl::RemoveLanguageEventListener(ILanguageEventListener& listener) } void +_SearchBarImpl::SetEditTextFilter(IEditTextFilter* pFilter) +{ + __pSearchBar->SetEditTextFilter(pFilter); + + return; +} + +void +_SearchBarImpl::SendOpaqueCommand (const String& command) +{ + __pSearchBar->SendOpaqueCommand(command); + + return; +} + +void _SearchBarImpl::OnActionPerformed(const _Control& source, int actionId) { ClearLastResult(); @@ -1412,7 +1497,7 @@ protected: { result r = E_SUCCESS; - Rectangle rect; + FloatRectangle rect; SearchBar* pSearchBar = null; _UiBuilderControlLayout* pControlProperty = null; bool showSearchBarButton = true; @@ -1425,7 +1510,7 @@ protected: int limitLength = SEARCHBAR_TEXT_LENGTH_MAX; int buttonActionId = -1; String buttonText; - int searchFieldTextSize = 0; + float searchFieldTextSize = 0.0f; bool lowercaseEnable = false; String elementString; @@ -1441,7 +1526,7 @@ protected: return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); if (pControl->GetElement("showSearchBarButton", elementString)) { if (elementString.Equals(L"false", false)) @@ -1522,7 +1607,7 @@ protected: if (pControl->GetElement("searchFieldTextSize", elementString)) { - Base::Integer::Parse(elementString, searchFieldTextSize); + Base::Float::Parse(elementString, searchFieldTextSize); _ICoordinateSystemTransformer* pTransform = GetTransformer(); if (pTransform) { @@ -1636,7 +1721,7 @@ protected: if (pControl->GetElement("disabledSearchFieldTextColor", elementString)) { ConvertStringToColor32(elementString, opacity, color); - r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_DISABLED, color); + r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_DISABLED, color); } if (pControl->GetElement("highlightedButtonColor", elementString)) @@ -1660,7 +1745,7 @@ protected: if (pControl->GetElement("highlightedSearchFieldTextColor", elementString)) { ConvertStringToColor32(elementString, opacity, color); - r = pSearchBar->SetSearchFieldColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color); + r = pSearchBar->SetSearchFieldTextColor(SEARCH_FIELD_STATUS_HIGHLIGHTED, color); } if (pControl->GetElement("pressedButtonColor", elementString)) @@ -1681,6 +1766,19 @@ protected: r = pSearchBar->SetGuideTextColor(color); } + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pSearchBar->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pSearchBar; } }; diff --git a/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp b/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp old mode 100644 new mode 100755 index b8b551a..6d17d86 --- a/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SearchBarPresenter.cpp @@ -31,10 +31,12 @@ #include "FUiCtrl_SearchBarModel.h" #include "FUiCtrl_SearchBarPresenter.h" #include "FUiCtrl_Toolbar.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; using namespace Tizen::Ui::Animations; using namespace Tizen::Base; +using namespace Tizen::Ui; namespace Tizen { namespace Ui { namespace Controls { @@ -44,7 +46,7 @@ _SearchBarPresenter::_SearchBarPresenter(void) , __pCancelButton(null) , __pEdit(null) , __pContainer(null) - , __searchFieldBounds(Rectangle()) + , __searchFieldBounds(FloatRectangle()) , __pIconElement(null) , __pReplacedSearchFieldNormalBitmap(null) , __pReplacedSearchFieldDisabledBitmap(null) @@ -158,13 +160,13 @@ _SearchBarPresenter::LoadSearchFieldIcon() r = GET_BITMAP_CONFIG_N(SEARCHBAR::ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pSearchFieldEffectBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r,"[%s] Propagating.", GetErrorMessage(r)); - GET_COLOR_CONFIG(SEARCHBAR::ICON_COLOR_NORMAL, searchFieldIconColor); + GET_COLOR_CONFIG(SEARCHBAR::ICON_BG_NORMAL, searchFieldIconColor); __pReplacedSearchFieldNormalBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSearchFieldBitmap, Color::GetColor(COLOR_ID_MAGENTA), searchFieldIconColor); SysTryCatch(NID_UI_CTRL, __pReplacedSearchFieldNormalBitmap != null, r = GetLastResult(), GetLastResult(),"[%s] Propagating.", GetErrorMessage(GetLastResult())); - GET_COLOR_CONFIG(SEARCHBAR::ICON_COLOR_DISABLED, searchFieldIconColor); + GET_COLOR_CONFIG(SEARCHBAR::ICON_BG_DISABLED, searchFieldIconColor); __pReplacedSearchFieldDisabledBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSearchFieldBitmap, Color::GetColor(COLOR_ID_MAGENTA), searchFieldIconColor); SysTryCatch(NID_UI_CTRL, __pReplacedSearchFieldDisabledBitmap != null, r = GetLastResult(), GetLastResult(),"[%s] Propagating.", @@ -278,8 +280,7 @@ _SearchBarPresenter::Draw(void) Color bgColor = __pSearchBar->GetColor(); - Rectangle bounds(0, 0, __pSearchBar->GetBounds().width, __pSearchBar->GetBounds().height); - __pSearchBar->SetBackgroundColor(__pSearchBar->GetColor()); + FloatRectangle bounds(0, 0, __pSearchBar->GetBoundsF().width, __pSearchBar->GetBoundsF().height); Bitmap* pBackgroundBitmap = __pSearchBar->GetBackgroundBitmap(); @@ -289,6 +290,9 @@ _SearchBarPresenter::Draw(void) r = GetLastResult(); SysTryReturn(NID_UI_CTRL, (pCanvas != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); + pCanvas->SetBackgroundColor(bgColor); + pCanvas->Clear(); + if (pBackgroundBitmap->IsNinePatchedBitmap()) { pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap); @@ -300,6 +304,10 @@ _SearchBarPresenter::Draw(void) delete pCanvas; } + else + { + __pSearchBar->SetBackgroundColor(bgColor); + } r = DrawIcon(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -350,7 +358,11 @@ _SearchBarPresenter::DrawIcon(void) result r = E_SUCCESS; Canvas* pIconCanvas = null; - Rectangle iconBounds; + FloatRectangle iconBounds; + + bool isCustomBitmap = false; + + isCustomBitmap = IS_CUSTOM_BITMAP(SEARCHBAR::ICON_NORMAL); int iconMarginH = 0; int iconWidth = 0; @@ -361,29 +373,29 @@ _SearchBarPresenter::DrawIcon(void) GET_SHAPE_CONFIG(SEARCHBAR::ICON_WIDTH, orientation, iconWidth); GET_SHAPE_CONFIG(SEARCHBAR::ICON_HEIGHT, orientation, iconHeight); - iconBounds.x = iconMarginH; - iconBounds.y = (__pEdit->GetBounds().height - iconWidth) / 2; - iconBounds.width = iconWidth; - iconBounds.height = iconHeight; + iconBounds.x = _CoordinateSystemUtils::ConvertToFloat(iconMarginH); + iconBounds.y = (__pEdit->GetBoundsF().height - iconWidth) / 2.0f; + iconBounds.width = _CoordinateSystemUtils::ConvertToFloat(iconWidth); + iconBounds.height = _CoordinateSystemUtils::ConvertToFloat(iconHeight); __pIconElement->SetBounds(FloatRectangle(iconBounds.x, iconBounds.y, iconBounds.width, iconBounds.height)); - pIconCanvas = __pIconElement->GetCanvasN(Rectangle(0, 0, iconBounds.width, iconBounds.height)); + pIconCanvas = __pIconElement->GetCanvasN(FloatRectangle(0, 0, iconBounds.width, iconBounds.height)); SysTryReturnResult(NID_UI_CTRL, pIconCanvas != null, GetLastResult(), "Propagating."); pIconCanvas->SetBackgroundColor(Color(0)); pIconCanvas->Clear(); - if(__pSearchBar->IsEnabled()) + if (__pSearchBar->IsEnabled()) { if (__pReplacedSearchFieldNormalBitmap != null) { if (__pReplacedSearchFieldNormalBitmap->IsNinePatchedBitmap()) { - pIconCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldNormalBitmap); + pIconCanvas->DrawNinePatchedBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldNormalBitmap); } else { - pIconCanvas->DrawBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldNormalBitmap); + pIconCanvas->DrawBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldNormalBitmap); } } } @@ -393,24 +405,24 @@ _SearchBarPresenter::DrawIcon(void) { if (__pReplacedSearchFieldDisabledBitmap->IsNinePatchedBitmap()) { - pIconCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldDisabledBitmap); + pIconCanvas->DrawNinePatchedBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldDisabledBitmap); } else { - pIconCanvas->DrawBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldDisabledBitmap); + pIconCanvas->DrawBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pReplacedSearchFieldDisabledBitmap); } } } - if (__pSearchFieldEffectBitmap != null) + if (!isCustomBitmap && __pSearchFieldEffectBitmap != null) { if (__pSearchFieldEffectBitmap->IsNinePatchedBitmap()) { - pIconCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pSearchFieldEffectBitmap); + pIconCanvas->DrawNinePatchedBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pSearchFieldEffectBitmap); } else { - pIconCanvas->DrawBitmap(Rectangle(0, 0, iconBounds.width, iconBounds.height), *__pSearchFieldEffectBitmap); + pIconCanvas->DrawBitmap(FloatRectangle(0, 0, iconBounds.width, iconBounds.height), *__pSearchFieldEffectBitmap); } } @@ -453,10 +465,6 @@ _SearchBarPresenter::ChangeMode(SearchBarMode mode) InitializeInputModeLayout(); SetCancelButtonVisible(true); __pSearchBar->SetContentDimming(); - __pSearchBar->SetContentsArea(); - SetContainerVisible(true); - - __pSearchBar->Invalidate(); if (__pEdit) { @@ -464,6 +472,14 @@ _SearchBarPresenter::ChangeMode(SearchBarMode mode) __pEdit->SetBounds(__searchFieldBounds); __pEdit->ShowKeypad(); } + __pSearchBar->SetContentsArea(); + + if (IsContentAreaVisible()) + { + SetContainerVisible(true); + } + + __pSearchBar->Invalidate(); } return E_SUCCESS; @@ -494,18 +510,18 @@ _SearchBarPresenter::InitializeInputModeLayout(void) int buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth + buttonWidth + buttonLeftMargin + buttonRightMargin); - if(__pSearchBar->GetBounds().width < buttonResizableSearchBarWidth) + if (__pSearchBar->GetBoundsF().width < buttonResizableSearchBarWidth) { __searchFieldBounds.width = searchFieldMinWidth; } else { - __searchFieldBounds.width = __pSearchBar->GetBounds().width - (buttonRightMargin + + __searchFieldBounds.width = __pSearchBar->GetBoundsF().width - (buttonRightMargin + buttonWidth + buttonLeftMargin + horizontalMargin); } - __searchFieldBounds.width = (__pSearchBar->GetBounds().width > searchFieldMinWidth) ? __searchFieldBounds.width : searchFieldMinWidth; + __searchFieldBounds.width = (__pSearchBar->GetBoundsF().width > searchFieldMinWidth) ? __searchFieldBounds.width : searchFieldMinWidth; return; } @@ -516,18 +532,20 @@ _SearchBarPresenter::InitializeViewModeLayout(void) int horizontalMargin = 0; int verticalMargin = 0; int searchFieldMinWidth = 0; - int searchFieldMinHeight = 0; + int searchBarMinHeight = 0; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin); GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, verticalMargin); GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth); - GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_HEIGHT, orientation, searchFieldMinHeight); + GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight); + + int searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2); - __searchFieldBounds.x = horizontalMargin; - __searchFieldBounds.y = verticalMargin; - __searchFieldBounds.width = __pSearchBar->GetBounds().width - (horizontalMargin * 2); - __searchFieldBounds.height = __pSearchBar->GetBounds().height - (verticalMargin * 2); + __searchFieldBounds.x = _CoordinateSystemUtils::ConvertToFloat(horizontalMargin); + __searchFieldBounds.y = _CoordinateSystemUtils::ConvertToFloat(verticalMargin); + __searchFieldBounds.width = __pSearchBar->GetBoundsF().width - (horizontalMargin * 2); + __searchFieldBounds.height = __pSearchBar->GetBoundsF().height - (verticalMargin * 2); __searchFieldBounds.width = (__searchFieldBounds.width > searchFieldMinWidth) ? __searchFieldBounds.width : searchFieldMinWidth; __searchFieldBounds.height = (__searchFieldBounds.height > searchFieldMinHeight) ? __searchFieldBounds.height : searchFieldMinHeight; @@ -540,9 +558,9 @@ _SearchBarPresenter::OnBoundsChanged(void) { _Control* pClippedGroupControl = __pSearchBar->GetClippedGroupControl(); - if(pClippedGroupControl != null) + if (pClippedGroupControl != null) { - pClippedGroupControl->SetBounds(Rectangle(Point(0, 0), __pSearchBar->GetSize())); + pClippedGroupControl->SetBounds(FloatRectangle(FloatPoint(0.0f, 0.0f), __pSearchBar->GetSizeF())); } if (GetMode() == SEARCH_BAR_MODE_NORMAL) diff --git a/src/ui/controls/FUiCtrl_SimpleItemImpl.cpp b/src/ui/controls/FUiCtrl_SimpleItemImpl.cpp index fd016d5..dae13cf 100644 --- a/src/ui/controls/FUiCtrl_SimpleItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_SimpleItemImpl.cpp @@ -24,6 +24,7 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_ListViewItem.h" #include "FUiCtrl_SimpleItemImpl.h" @@ -69,7 +70,7 @@ _SimpleItemImpl::GetPublicClassName(void) const } _SimpleItemImpl* -_SimpleItemImpl::CreateSimpleItemImplN(SimpleItem* pPublic, const Dimension& itemSize, ListAnnexStyle style) +_SimpleItemImpl::CreateSimpleItemImplN(SimpleItem* pPublic, const FloatDimension& itemSize, ListAnnexStyle style) { result r = E_SUCCESS; @@ -89,7 +90,7 @@ CATCH: } result -_SimpleItemImpl::Construct(const Dimension& itemSize, ListAnnexStyle style) +_SimpleItemImpl::Construct(const FloatDimension& itemSize, ListAnnexStyle style) { result r = _ListItemBaseImpl::Construct(itemSize, style); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -117,14 +118,14 @@ _SimpleItemImpl::SetElement(const String& text, const Bitmap* pBitmap) SysTryReturn(NID_UI_CTRL, (ret == true), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to delete text element."); } - Rectangle bitmapRect = Rectangle(0, 0, 0, 0); - Rectangle textRect = Rectangle(0, 0, 0, 0); + FloatRectangle bitmapRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle textRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); ListAnnexStyle style = GetListItemAnnexStyle(); - int leftMargin = 0; - int itemHeight = GetItemSize().height; - int annexWidth = GetAnnexWidth(style); - int elementSpacing = 0; - int textSize = 0; + float leftMargin = 0.0f; + float itemHeight = GetItemSize().height; + float annexWidth = GetAnnexWidth(style); + float elementSpacing = 0.0f; + float textSize = 0.0f; result r = E_SUCCESS; GET_SHAPE_CONFIG(LISTVIEW::ITEM_ELEMENT_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); @@ -141,10 +142,10 @@ _SimpleItemImpl::SetElement(const String& text, const Bitmap* pBitmap) // Add Bitmap element (optional) if (pBitmap != null) { - int elementWidth = itemHeight * SIMPLE_ITEM_ELEMENT_BITMAP_SIZE_RATIO; - int elementHeight = elementWidth; + float elementWidth = itemHeight * SIMPLE_ITEM_ELEMENT_BITMAP_SIZE_RATIO; + float elementHeight = elementWidth; - bitmapRect.y = (itemHeight - elementHeight) / 2; + bitmapRect.y = (itemHeight - elementHeight) / 2.0f; bitmapRect.width = elementWidth; bitmapRect.height = elementHeight; @@ -153,13 +154,13 @@ _SimpleItemImpl::SetElement(const String& text, const Bitmap* pBitmap) } else { - elementSpacing = 0; + elementSpacing = 0.0f; } // Add Text element textRect.x = bitmapRect.x + bitmapRect.width + elementSpacing; - textRect.y = 0; - textRect.width = GetItemSize().width - textRect.x - ((annexWidth > 0) ? (annexWidth + leftMargin) : 0); + textRect.y = 0.0f; + textRect.width = GetItemSize().width - textRect.x - ((annexWidth > 0.0f) ? (annexWidth + leftMargin) : 0.0f); textRect.height = itemHeight; r = pItem->AddElement(textRect, LIST_ITEM_RESERVED_ID_3, text); diff --git a/src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp b/src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp index e487acd..0a62041 100644 --- a/src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp +++ b/src/ui/controls/FUiCtrl_SlidableGroupedListImpl.cpp @@ -15,6 +15,7 @@ // limitations under the License. // + /** * @file FUiCtrl_SlidableGroupedListImpl.cpp * @brief This is the implementation file for the _SlidableGroupedListImpl class. @@ -88,9 +89,10 @@ _SlidableGroupedListItemProvider::GetGroupCount(void) firstTime = false; } + return __pListImpl->GetGroupCount(); } + return 0; - return __pListImpl->GetGroupCount(); } int @@ -212,21 +214,43 @@ _SlidableGroupedListItemProvider::CallLoadToTopCb(int groupIndex, int itemIndex) } result -_SlidableGroupedListItemProvider::UpdateCheckStatus(_TableViewItemData* pTableViewItemData, int groupIndex, int itemIndex) +_SlidableGroupedListItemProvider::UpdateCheckStatus(int groupIndex, int itemIndex) { _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__pListImpl->__groupsList.GetAt(groupIndex)); SysTryReturn(NID_UI_CTRL, pGroupObject, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); - if (pTableViewItemData && pGroupObject->__pCheckedList) + if (__pListImpl->_annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) + { + if (__pListImpl->_currentRadioGroupIndex == groupIndex && __pListImpl->_currentRadioIndex == itemIndex) + { + _CheckElementModel* pCheckElement = __pListImpl->GetCheckElementAt(groupIndex, itemIndex - pGroupObject->__topIndex); + + if (pCheckElement) + { + pCheckElement->SetCheckBoxStatus(CHECK_BOX_CHECKED); + } + else + { + SysLog(NID_UI_CTRL, "Group item with index %d is not loaded.", itemIndex); + } + } + } + else if (pGroupObject->__pCheckedList) { Boolean* pChecked = dynamic_cast(pGroupObject->__pCheckedList->GetAt(itemIndex)); SysTryReturn(NID_UI_CTRL, pChecked, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); - _CheckElementModel* pCheckElement = __pListImpl->GetCheckElementAt(groupIndex, 0); - SysTryReturn(NID_UI_CTRL, pCheckElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get check element"); + _CheckElementModel* pCheckElement = __pListImpl->GetCheckElementAt(groupIndex, itemIndex - pGroupObject->__topIndex); - pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)pChecked->ToBool()); + if (pCheckElement) + { + pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)pChecked->ToBool()); + } + else + { + SysLog(NID_UI_CTRL, "Group item with index %d is not loaded.", itemIndex); + } } return E_SUCCESS; @@ -235,21 +259,6 @@ _SlidableGroupedListItemProvider::UpdateCheckStatus(_TableViewItemData* pTableVi result _SlidableGroupedListItemProvider::ModifyIndicesAfterTopLoad(void) { - if (__pListImpl->GetCurrentLoadedCount() > __pListImpl->__itemCacheSize) - { - int subItemCount = __pListImpl->GetSubItemCountAt(__pListImpl->__bottomGroup); - - result r = E_SUCCESS; - r = __pListImpl->RemoveFromItemsList(__pListImpl->__bottomGroup, subItemCount - 1); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - __pListImpl->CallUnloadItemCb(__pListImpl->__bottomGroup, subItemCount - 1); - - if ((subItemCount == 1) && (__pListImpl->__bottomGroup > 0)) - { - __pListImpl->__bottomGroup--; - } - } if (__pListImpl->GetCurrentLoadedCount() == 2) { @@ -274,8 +283,6 @@ _SlidableGroupedListItemProvider::LoadAtTop(int groupIndex, int itemIndex) SysTryReturn(NID_UI_CTRL, pGroupObject, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); - __pListImpl->__topGroup = groupIndex; - result r = E_SUCCESS; CustomListItem* pCustomListItem = null; @@ -284,37 +291,21 @@ _SlidableGroupedListItemProvider::LoadAtTop(int groupIndex, int itemIndex) pCustomListItem = __pListImpl->GetCustomListItemAt(groupIndex, itemIndex); } - pGroupObject->__topIndex = itemIndex; if (!pCustomListItem) { + __pListImpl->__topGroup = groupIndex; + pGroupObject->__topIndex = itemIndex; + r = CallLoadToTopCb(groupIndex, itemIndex); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); } - else - { - _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__pListImpl->__groupsList.GetAt(__pListImpl->__topGroup)); - SysTryReturn(NID_UI_CTRL, pGroupObject, null, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", __pListImpl->__topGroup); - - _TableViewItemParams tableViewItemParams; - tableViewItemParams.pItem = (const_cast(pCustomListItem)); - tableViewItemParams.width = __pListImpl->GetCore().GetBounds().width; - tableViewItemParams.itemIndex = pGroupObject->__topIndex; - tableViewItemParams.groupIndex = __pListImpl->__topGroup; - tableViewItemParams.isDividerEnabled = __pListImpl->_isDividerEnabled; - tableViewItemParams.pCheckBitmaps = __pListImpl->_pCheckBitmaps; - tableViewItemParams.annexStyle = __pListImpl->_annexStyle; - - result r = _CustomListItemImpl::CreateTableViewItem(tableViewItemParams); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - } pTableViewItemData = __pListImpl->GetTableViewItemAt(groupIndex, 0); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pTableViewItemData, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - r = UpdateCheckStatus(pTableViewItemData, groupIndex, pGroupObject->__topIndex); + r = UpdateCheckStatus(groupIndex, pGroupObject->__topIndex); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); r = ModifyIndicesAfterTopLoad(); @@ -356,11 +347,6 @@ _SlidableGroupedListItemProvider::ModifyIndicesAfterBottomLoad(int groupIndex, i SysTryReturn(NID_UI_CTRL, pTopGroupObject, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", __pListImpl->__topGroup); - if (__pListImpl->__topGroup != __pListImpl->__bottomGroup) - { - pTopGroupObject->__topIndex++; - } - if (__pListImpl->GetSubItemCountAt(__pListImpl->__topGroup) == 0) { __pListImpl->__topGroup++; @@ -396,46 +382,22 @@ _SlidableGroupedListItemProvider::LoadAtBottom(int groupIndex, int itemIndex) _TableViewItemData* pTableViewItemData = null; result r = E_SUCCESS; - __pListImpl->__bottomGroup = groupIndex; - CustomListItem* pCustomListItem = __pListImpl->GetCustomListItemAt(groupIndex, itemIndex - __pListImpl->GetTopItemIndex(groupIndex)); if (!pCustomListItem) { + __pListImpl->__bottomGroup = groupIndex; r = CallLoadToBottomCb(groupIndex, itemIndex); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - } - else - { - _TableViewItemParams tableViewItemParams; - tableViewItemParams.pItem = (const_cast(pCustomListItem)); - tableViewItemParams.width = __pListImpl->GetCore().GetBounds().width; - tableViewItemParams.groupIndex = __pListImpl->__bottomGroup; - tableViewItemParams.itemIndex = itemIndex; - tableViewItemParams.isDividerEnabled = __pListImpl->_isDividerEnabled; - tableViewItemParams.pCheckBitmaps = __pListImpl->_pCheckBitmaps; - tableViewItemParams.annexStyle = __pListImpl->_annexStyle; - result r = _CustomListItemImpl::CreateTableViewItem(tableViewItemParams); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - } + int subItemCount = __pListImpl->GetSubItemCountAt(groupIndex); - int subItemCount = __pListImpl->GetSubItemCountAt(groupIndex); - - if (subItemCount > __pListImpl->__itemCacheSize) - { - _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__pListImpl->__groupsList.GetAt(groupIndex)); - SysTryReturn(NID_UI_CTRL, pGroupObject, null, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); - - pGroupObject->__topIndex++; + pTableViewItemData = __pListImpl->GetTableViewItemAt(groupIndex, subItemCount - 1); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); } - pTableViewItemData = __pListImpl->GetTableViewItemAt(groupIndex, subItemCount - 1); - r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - - r = UpdateCheckStatus(pTableViewItemData, groupIndex, subItemCount - 1); + r = UpdateCheckStatus(groupIndex, itemIndex); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); r = ModifyIndicesAfterBottomLoad(groupIndex, itemIndex); @@ -492,11 +454,17 @@ _SlidableGroupedListItemProvider::DeleteItem(int groupIndex, int itemIndex, Tabl { if (((groupIndex == __pListImpl->__topGroup) && (itemIndex <= __pListImpl->GetTopItemIndex(__pListImpl->__topGroup))) || (__pListImpl->__forceScroll == true)) { - __pListImpl->RemoveFromItemsList(groupIndex, 0); + __pListImpl->RemoveFromItemsList(groupIndex, 0, false); + + _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__pListImpl->__groupsList.GetAt(groupIndex)); + SysTryReturn(NID_UI_CTRL, pGroupObject, null, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); + + pGroupObject->__topIndex++; } else { - __pListImpl->RemoveFromItemsList(groupIndex, itemIndex); + __pListImpl->RemoveFromItemsList(groupIndex, (__pListImpl->GetSubItemCountAt(groupIndex) - 1), false); } __pListImpl->CallUnloadItemCb(groupIndex, itemIndex); @@ -831,6 +799,8 @@ _SlidableGroupedListImpl::SetFastScrollSubIndex(const String& text, FastScrollIn SysTryReturn(NID_UI_CTRL, (__mainScrollIndex.GetLength() > 0), E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Main index of the fast scroll is not set."); + __subScrollIndex = text; + _FastScrollIndex* pRootIndex = pFastScroll->GetIndex(); SysTryReturn(NID_UI_CTRL, pRootIndex, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get rootIndex."); @@ -1062,12 +1032,6 @@ _SlidableGroupedListImpl::GetNextCheckedItemIndexAfter(int& groupIndex, int& ind return E_SUCCESS; } -Color -_SlidableGroupedListImpl::GetTextColorOfEmptyList(void) const -{ - return GetCore().GetTextColorOfEmptyTableView(); -} - result _SlidableGroupedListImpl::GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const { @@ -1083,17 +1047,31 @@ _SlidableGroupedListImpl::IsItemChecked(int groupIndex, int index) const SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __groupsList.GetCount()), false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. groupIndex (%d).", groupIndex); - _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast(__groupsList.GetAt(groupIndex))); - SysTryReturn(NID_UI_CTRL, pGroupObject, false, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); + if (_annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) + { + if (groupIndex == _currentRadioGroupIndex && index == _currentRadioIndex) + { + return true; + } + else + { + return false; + } + } + else + { + _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast(__groupsList.GetAt(groupIndex))); + SysTryReturn(NID_UI_CTRL, pGroupObject, false, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex); - SysTryReturn(NID_UI_CTRL, (index >= 0 && index < GetSubItemCountAt(groupIndex)), - false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. index (%d).", index); + SysTryReturn(NID_UI_CTRL, (index >= 0 && index < GetSubItemCountAt(groupIndex)), + false, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. index (%d).", index); - Boolean* pChecked = dynamic_cast(const_cast(pGroupObject->__pCheckedList->GetAt(index))); - SysTryReturn(NID_UI_CTRL, pChecked, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); + Boolean* pChecked = dynamic_cast(const_cast(pGroupObject->__pCheckedList->GetAt(index))); + SysTryReturn(NID_UI_CTRL, pChecked, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred."); - return pChecked->ToBool(); + return pChecked->ToBool(); + } } bool @@ -1153,12 +1131,26 @@ _SlidableGroupedListImpl::InsertItemAt(int groupIndex, int index, const CustomLi SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __groupsList.GetCount()), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. groupIndex (%d).", groupIndex); - SysTryReturn(NID_UI_CTRL, (index >= 0 && index <= GetSubItemCountAt(groupIndex)), E_INVALID_ARG, E_INVALID_ARG, + SysTryReturn(NID_UI_CTRL, (index >= GetTopItemIndex(groupIndex) && index <= (GetSubItemCountAt(groupIndex) + GetTopItemIndex(groupIndex))), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. index (%d).", index); + + _TableViewItemParams tableViewItemParams; + tableViewItemParams.pItem = (const_cast(&item)); + tableViewItemParams.width = GetCore().GetBounds().width; + tableViewItemParams.itemIndex = index; + tableViewItemParams.groupIndex = -1; + tableViewItemParams.isDividerEnabled = _isDividerEnabled; + tableViewItemParams.pCheckBitmaps = _pCheckBitmaps; + tableViewItemParams.annexStyle = _annexStyle; + item.__pCustomListItemImpl->itemId = itemId; - r = InsertIntoItemsList(item, groupIndex, index); + r = _CustomListItemImpl::CreateTableViewItem(tableViewItemParams); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, + "[%s] A system error has occurred. Failed to create an item.", GetErrorMessage(r)); + + r = InsertIntoItemsList(item, groupIndex, (index - GetTopItemIndex(groupIndex))); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast(__groupsList.GetAt(groupIndex))); @@ -1189,7 +1181,7 @@ CATCH: { pGroupObject->__pCheckedList->RemoveAt(index, true); } - RemoveFromItemsList(groupIndex, index); + RemoveFromItemsList(groupIndex, (index - GetTopItemIndex(groupIndex))); return E_SYSTEM; } @@ -1279,12 +1271,13 @@ _SlidableGroupedListImpl::LoadItemToBottom(const CustomListItem& item, int itemI "[E_SUCCESS] This operation is ignored during creation of list."); int itemIndex = GetSubItemCountAt(__bottomGroup); + int topIndex = GetTopItemIndex(__bottomGroup); _TableViewItemParams tableViewItemParams; tableViewItemParams.pItem = (const_cast(&item)); tableViewItemParams.width = GetCore().GetBounds().width; tableViewItemParams.groupIndex = __bottomGroup; - tableViewItemParams.itemIndex = itemIndex; + tableViewItemParams.itemIndex = (itemIndex + topIndex); tableViewItemParams.isDividerEnabled = _isDividerEnabled; tableViewItemParams.pCheckBitmaps = _pCheckBitmaps; tableViewItemParams.itemId = itemId; @@ -1788,34 +1781,37 @@ _SlidableGroupedListImpl::UpdateCheckedList(int groupIndex, int index, bool chec result _SlidableGroupedListImpl::SetItemCheckedRadio(int groupIndex, int index, bool check) { + + _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast(__groupsList.GetAt(groupIndex))); + SysTryReturn(NID_UI_CTRL, pGroupObject, INVALID_INDEX, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at groupIndex (%d).", groupIndex); + + _CheckElementModel* pCheckElement = GetCheckElementAt(groupIndex, (index - pGroupObject->__topIndex)); + SysTryReturnResult(NID_UI_CTRL, (pCheckElement != null), E_SYSTEM, "A system error has occurred. Checkbox element not created"); + if (check) { if (_currentRadioIndex != -1) { - _CheckElementModel* pOldCheckElement = GetCheckElementAt(_currentRadioGroupIndex, _currentRadioIndex); - SysTryReturnResult(NID_UI_CTRL, (pOldCheckElement != null), E_SYSTEM, "A system error has occurred."); - - pOldCheckElement->SetCheckBoxStatus(CHECK_BOX_UNCHECKED); + _CheckElementModel* pOldCheckElement = GetCheckElementAt(_currentRadioGroupIndex, (_currentRadioIndex - pGroupObject->__topIndex)); - UpdateCheckedList(_currentRadioGroupIndex, _currentRadioIndex, false); - - DrawItem(_currentRadioGroupIndex, _currentRadioIndex); + if (pOldCheckElement) + { + pOldCheckElement->SetCheckBoxStatus(CHECK_BOX_UNCHECKED); + DrawItem(_currentRadioGroupIndex, (_currentRadioIndex - pGroupObject->__topIndex)); + } } _currentRadioGroupIndex = groupIndex; _currentRadioIndex = index; - - UpdateCheckedList(groupIndex, index, true); } else { - UpdateCheckedList(groupIndex, index, false); - _currentRadioGroupIndex = -1; _currentRadioIndex = -1; } - - DrawItem(groupIndex, index); + pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)check); + DrawItem(groupIndex, index - pGroupObject->__topIndex); return E_SUCCESS; } @@ -1823,14 +1819,19 @@ _SlidableGroupedListImpl::SetItemCheckedRadio(int groupIndex, int index, bool ch result _SlidableGroupedListImpl::SetItemCheckedMarkOnOff(int groupIndex, int index, bool check) { - _CheckElementModel* pCheckElement = GetCheckElementAt(groupIndex, index); + + _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast(__groupsList.GetAt(groupIndex))); + SysTryReturn(NID_UI_CTRL, pGroupObject, INVALID_INDEX, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at groupIndex (%d).", groupIndex); + + _CheckElementModel* pCheckElement = GetCheckElementAt(groupIndex, (index - pGroupObject->__topIndex)); SysTryReturnResult(NID_UI_CTRL, (pCheckElement != null), E_SYSTEM, "A system error has occurred."); pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)check); UpdateCheckedList(groupIndex, index, check); - DrawItem(groupIndex, index); + DrawItem(groupIndex, index - pGroupObject->__topIndex); return E_SUCCESS; } @@ -1884,18 +1885,6 @@ _SlidableGroupedListImpl::SetLoadedItemEnabled(int groupIndex, int index, bool e return GetCore().SetItemEnabled(groupIndex, index, enable); } -void -_SlidableGroupedListImpl::SetTextColorOfEmptyList(const Color& color) -{ - GetCore().SetTextColorOfEmptyTableView(color); -} - -void -_SlidableGroupedListImpl::SetTextOfEmptyList(const String& text) -{ - GetCore().SetTextOfEmptyTableView(text); -} - result _SlidableGroupedListImpl::SetGroupAt(int groupIndex, const String& text, const Bitmap* pBackgroundBitmap, int groupId) { @@ -1966,57 +1955,57 @@ _SlidableGroupedListImpl::OnGroupedTableViewItemStateChanged(_TableView& tableVi CustomListItemStatus customListItemStatus = CUSTOM_LIST_ITEM_STATUS_NORMAL; ItemStatus itemStatus = ITEM_HIGHLIGHTED; - switch (status) - { - case TABLE_VIEW_ITEM_STATUS_SELECTED: - itemStatus = ITEM_SELECTED; - customListItemStatus = CUSTOM_LIST_ITEM_STATUS_SELECTED; - break; - case TABLE_VIEW_ITEM_STATUS_HIGHLIGHTED: - itemStatus = ITEM_HIGHLIGHTED; - customListItemStatus = CUSTOM_LIST_ITEM_STATUS_FOCUSED; - break; - case TABLE_VIEW_ITEM_STATUS_CHECKED: - itemStatus = ITEM_CHECKED; - break; - case TABLE_VIEW_ITEM_STATUS_UNCHECKED: - itemStatus = ITEM_UNCHECKED; - break; - default: - SetLastResult(E_INVALID_ARG); - SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. ListItemStatus is invalid"); - return; - } - - LinkedList* pElements = &pCustomListItem->__pCustomListItemImpl->elements; - _ElementBaseModel* pElementBase = null; - - for (int i = 0; i < pElements->GetCount(); i++) - { - pElementBase = dynamic_cast<_ElementBaseModel*>(pElements->GetAt(i)); - SysTryReturnVoidResult(NID_UI_CTRL, (pElementBase != null), E_SYSTEM, "Invalid element."); - - if ((_isDividerEnabled && pElementBase->_elementType != LIST_ITEM_ELEMENT_TYPE_CHECKBOX) || (!_isDividerEnabled)) - { - pElementBase->HandleElementEvent(customListItemStatus); - } - } - - if ((!_isDividerEnabled) && (_annexStyle != TABLE_VIEW_ANNEX_STYLE_NORMAL)) - { - bool isChecked = IsItemChecked(groupIndex, itemIndex); - - if (isChecked) - { - itemStatus = ITEM_UNCHECKED; - } - else - { - itemStatus = ITEM_CHECKED; - } - - SetItemChecked(groupIndex, itemIndex, !isChecked); - } + switch (status) + { + case TABLE_VIEW_ITEM_STATUS_SELECTED: + itemStatus = ITEM_SELECTED; + customListItemStatus = CUSTOM_LIST_ITEM_STATUS_SELECTED; + break; + case TABLE_VIEW_ITEM_STATUS_HIGHLIGHTED: + itemStatus = ITEM_HIGHLIGHTED; + customListItemStatus = CUSTOM_LIST_ITEM_STATUS_FOCUSED; + break; + case TABLE_VIEW_ITEM_STATUS_CHECKED: + itemStatus = ITEM_CHECKED; + break; + case TABLE_VIEW_ITEM_STATUS_UNCHECKED: + itemStatus = ITEM_UNCHECKED; + break; + default: + SetLastResult(E_INVALID_ARG); + SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. ListItemStatus is invalid"); + return; + } + + LinkedList* pElements = &pCustomListItem->__pCustomListItemImpl->elements; + _ElementBaseModel* pElementBase = null; + + for (int i = 0; i < pElements->GetCount(); i++) + { + pElementBase = dynamic_cast<_ElementBaseModel*>(pElements->GetAt(i)); + SysTryReturnVoidResult(NID_UI_CTRL, (pElementBase != null), E_SYSTEM, "Invalid element."); + + if ((_isDividerEnabled && pElementBase->_elementType != LIST_ITEM_ELEMENT_TYPE_CHECKBOX) || (!_isDividerEnabled)) + { + pElementBase->HandleElementEvent(customListItemStatus); + } + } + + if ((!_isDividerEnabled) && (_annexStyle != TABLE_VIEW_ANNEX_STYLE_NORMAL)) + { + bool isChecked = IsItemChecked(groupIndex, itemIndex); + + if (isChecked) + { + itemStatus = ITEM_UNCHECKED; + } + else + { + itemStatus = ITEM_CHECKED; + } + + SetItemChecked(groupIndex, itemIndex, !isChecked); + } ProcessItemStateChange(groupIndex, itemIndex, itemStatus); @@ -2107,10 +2096,13 @@ _SlidableGroupedListImpl::Initialize(void) __pItemFormat->Construct(); int leftMargin = 0; + Color groupTextColor = Color(0); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_LEFT_MARGIN, GetCore().GetOrientation(), leftMargin); + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, groupTextColor); __pItemFormat->AddElement(ID_FORMAT_MARGIN, Rectangle(0, 0, leftMargin, __groupItemHeight), __groupItemTextFont); - __pItemFormat->AddElement(ID_FORMAT_STRING, Rectangle(leftMargin, 0, GetCore().GetBounds().width, __groupItemHeight), __groupItemTextFont); + __pItemFormat->AddElement(ID_FORMAT_STRING, Rectangle(leftMargin, 0, GetCore().GetBounds().width, __groupItemHeight), + __groupItemTextFont, groupTextColor, groupTextColor); __pItemFormat->SetElementEventEnabled(ID_FORMAT_MARGIN, true); __pItemFormat->SetElementEventEnabled(ID_FORMAT_STRING, true); @@ -2137,7 +2129,16 @@ _SlidableGroupedListImpl::OnUiFastScrollIndexSelected(_Control& source, _FastScr Character mainIndex(mch); __pFastScrollListener->OnMainIndexChanged(control, mainIndex); } - else + } + else + { + // __subScrollIndex + int itemIndex = 0; + result r = __subScrollIndex.IndexOf(*pIndexText, 0, itemIndex); + const Control& control = GetPublic(); + _FastScrollIndex* pMainIndex = index.GetParentIndex(); + + if (!IsFailed(r)) { Character subIndex(mch); pIndexText = pMainIndex->GetIndexText(); diff --git a/src/ui/controls/FUiCtrl_SlidableListImpl.cpp b/src/ui/controls/FUiCtrl_SlidableListImpl.cpp index 169e3d5..06718cd 100644 --- a/src/ui/controls/FUiCtrl_SlidableListImpl.cpp +++ b/src/ui/controls/FUiCtrl_SlidableListImpl.cpp @@ -126,21 +126,30 @@ _SlidableListItemProvider::CallLoadToTopCb(int index) } result -_SlidableListItemProvider::UpdateCheckStatus(_TableViewItemData* pTableViewItemData, int index) +_SlidableListItemProvider::UpdateCheckStatus(int index) { - if (pTableViewItemData && __pListImpl->__pCheckedList) + if (__pListImpl->_annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) { - Boolean* pChecked = dynamic_cast(__pListImpl->__pCheckedList->GetAt(index)); - SysTryReturn(NID_UI_CTRL, pChecked, E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get Check status"); + if (__pListImpl->_currentRadioIndex == index) + { + _CheckElementModel* pOldCheckElement = __pListImpl->GetCheckElementAt(-1, __pListImpl->_currentRadioIndex - __pListImpl->__topIndex); + if (pOldCheckElement) + { + pOldCheckElement->SetCheckBoxStatus(CHECK_BOX_CHECKED); + } + } + } + else if (__pListImpl->__pCheckedList) + { + Boolean* pChecked = dynamic_cast(__pListImpl->__pCheckedList->GetAt(index)); _CheckElementModel* pCheckElement = __pListImpl->GetCheckElementAt(-1, index - __pListImpl->__topIndex); - SysTryReturn(NID_UI_CTRL, pCheckElement, E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to get CheckElement. "); - pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)pChecked->ToBool()); + if (pCheckElement && pChecked) + { + pCheckElement->SetCheckBoxStatus((_CheckBoxBitmapType)pChecked->ToBool()); + } } - return E_SUCCESS; } @@ -159,7 +168,7 @@ _SlidableListItemProvider::LoadAtTop(int index) r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - r = UpdateCheckStatus(pTableViewItemData, index); + r = UpdateCheckStatus(index); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); return pTableViewItemData; @@ -196,22 +205,17 @@ _SlidableListItemProvider::LoadAtBottom(int index) r = CallLoadToBottomCb(index); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - if (__pListImpl->_itemsList.GetCount() > __pListImpl->__itemCacheSize) - { - __pListImpl->__topIndex++; - } - else if (__pListImpl->_itemsList.GetCount() == 1) - { - __pListImpl->__topIndex = index; - } - pTableViewItemData = __pListImpl->GetTableViewItemAt(-1, __pListImpl->_itemsList.GetCount() - 1); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - r = UpdateCheckStatus(pTableViewItemData, index); + r = UpdateCheckStatus(index); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + if (__pListImpl->_itemsList.GetCount() == 1) + { + __pListImpl->__topIndex = index; + } return pTableViewItemData; } @@ -251,9 +255,11 @@ _SlidableListItemProvider::DeleteItem(int index, TableViewItem* pItem) { SysTryReturn(NID_UI_CTRL, __pListImpl, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Item provider not constructed properly."); + __pListImpl->CallUnloadItemCb(index); + result r = E_SUCCESS; - if (__pListImpl->__isDirectDelete == true) + if (__pListImpl->__isForcedScroll == true) { r = __pListImpl->_itemsList.RemoveAt(0, true); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item."); @@ -264,6 +270,8 @@ _SlidableListItemProvider::DeleteItem(int index, TableViewItem* pItem) { r = __pListImpl->_itemsList.RemoveAt(0, true); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item."); + + __pListImpl->__topIndex++; } else { @@ -271,8 +279,11 @@ _SlidableListItemProvider::DeleteItem(int index, TableViewItem* pItem) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item."); } } - - __pListImpl->CallUnloadItemCb(index); + else if (__pListImpl->__isFullUpdate == true) + { + r = __pListImpl->_itemsList.RemoveAt(__pListImpl->_itemsList.GetCount() - 1, true); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item."); + } _TableViewItemData* pTableViewItemData = dynamic_cast<_TableViewItemData*>(pItem); delete pTableViewItemData; @@ -324,9 +335,10 @@ _SlidableListImpl::_SlidableListImpl(Control* pList, _TableView* pCore) , __totalItemCount(-1) , __topIndex(-1) , __pItemProvider(null) - , __isDirectDelete(false) + , __isFullUpdate(false) , __isCreating(false) , __itemCacheSize(0) + , __isForcedScroll(false) { } @@ -398,7 +410,7 @@ _SlidableListImpl::CreateSlidableListImplN(SlidableList* pControl, const Rectang return null; } - _TableView* pList = _TableView::CreateTableViewN(TABLE_VIEW_STYLE_SIMPLE, itemDivider, TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL); + _TableView* pList = _TableView::CreateTableViewN(TABLE_VIEW_STYLE_SIMPLE, itemDivider, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, pList, null, r, "[%s] Failed to create ListView instance", GetErrorMessage(r)); @@ -654,11 +666,6 @@ _SlidableListImpl::GetNextCheckedItemIndexAfter(int index) const return INVALID_INDEX; } -Tizen::Graphics::Color -_SlidableListImpl::GetTextColorOfEmptyList(void) const -{ - return GetCore().GetTextColorOfEmptyTableView(); -} int _SlidableListImpl::GetTopDrawnItemIndex(void) const @@ -835,7 +842,6 @@ _SlidableListImpl::LoadItemToBottom(const CustomListItem& item, int itemId) item.__pCustomListItemImpl->itemId = itemId; r = _itemsList.Add(item); -// r = InsertIntoItemsList(item, -1, _itemsList.GetCount()); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has occurred. Failed to insert an item at index 0.", GetErrorMessage(r)); @@ -861,7 +867,6 @@ _SlidableListImpl::LoadItemToTop(const CustomListItem& item, int itemId) "[%s] A system error has occurred. Failed to create an item at index %d.", GetErrorMessage(r), (__topIndex - 1)); item.__pCustomListItemImpl->itemId = itemId; -// r = InsertIntoItemsList(item, -1, 0); r = _itemsList.InsertAt(item, 0); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has occurred. Failed to insert an item at index 0.", GetErrorMessage(r)); @@ -874,29 +879,20 @@ _SlidableListImpl::SetItemCountAndHeight(int count, int listHeight) { SysTryReturnVoidResult(NID_UI_CTRL, (count > 0 && listHeight > 0), E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. Count (%d) and listHeight (%d) must be greater than 0.", count, listHeight); - + result r = E_SUCCESS; + int prevCount = __totalItemCount; __totalItemCount = count; - if (__pCheckedList) - { - __pCheckedList->RemoveAll(true); - delete __pCheckedList; - __pCheckedList = null; - } if (_annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || _annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)//(IsCheckedStyle() == true) { - __pCheckedList = new (std::nothrow) ArrayList(); - SysTryReturnVoidResult(NID_UI_CTRL, __pCheckedList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pCheckedList->Construct(count); - Boolean* pChecked = null; + __pCheckedList->SetCapacity(count); - for (int itemIndex = 0; itemIndex < count; itemIndex++) + for (int itemIndex = prevCount; itemIndex < count; itemIndex++) { pChecked = new (std::nothrow) Boolean(false); - SysTryCatch(NID_UI_CTRL, pChecked, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + SysTryReturnVoidResult(NID_UI_CTRL, pChecked, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); __pCheckedList->Add(*pChecked); } @@ -904,22 +900,22 @@ _SlidableListImpl::SetItemCountAndHeight(int count, int listHeight) if (!(__pItemProvider && __pItemProvider->firstTime == true)) { - _itemsList.RemoveAll(true); + for (int itemIndex = prevCount - 1; itemIndex >= count; itemIndex--) + { + _itemsList.RemoveAt(itemIndex); + r = GetCore().RefreshTableView(0, itemIndex , TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); - result r = GetCore().UpdateTableView(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + } + for (int itemIndex = prevCount; itemIndex < count; itemIndex++) + { + r = GetCore().RefreshTableView(0, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); + } } - return; -CATCH: - if (__pCheckedList) - { - __pCheckedList->RemoveAll(true); - delete __pCheckedList; - __pCheckedList = null; - } - _itemsList.RemoveAll(true); + return; } int @@ -993,7 +989,10 @@ _SlidableListImpl::UnloadAllItems(void) "[%s] A system error has occurred. Failed to remove Check item at index %d", GetErrorMessage(r), (itemIndex + __topIndex)); } - CallUnloadItemCb(itemIndex + __topIndex); + if (GetCore().GetFirstDrawnFlag() == true) + { + CallUnloadItemCb(itemIndex + __topIndex); + } } return E_SUCCESS; @@ -1085,21 +1084,25 @@ _SlidableListImpl::RemoveAllCheckedItems(int itemHeight) for (itemIndex = 0; itemIndex < _itemsList.GetCount(); itemIndex++) { - if (IsItemChecked(itemIndex) == true) + if (IsItemChecked(itemIndex + __topIndex) == true) { r = RemoveFromItemsList(-1, itemIndex); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to remove an item."); - __pCheckedList->RemoveAt(itemIndex, true); + __pCheckedList->RemoveAt(itemIndex + __topIndex, true); - r = GetCore().RefreshTableView(0, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); + r = GetCore().RefreshTableView(0, itemIndex + __topIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); if (r != E_SUCCESS) { - SysLog(NID_UI_CTRL, "[%s] Failed to remove item at index %d.", GetErrorMessage(r), itemIndex); + SysLog(NID_UI_CTRL, "[%s] Failed to remove item at index %d.", GetErrorMessage(r), itemIndex + __topIndex); + } + + if (GetCore().GetFirstDrawnFlag() == true) + { + CallUnloadItemCb(itemIndex + __topIndex); } - CallUnloadItemCb(itemIndex); itemIndex--; __totalItemCount--; } @@ -1112,9 +1115,10 @@ result _SlidableListImpl::RemoveAllItems(void) { __totalItemCount = 0; - _itemsList.RemoveAll(true); + __isFullUpdate = true; GetCore().UpdateTableView(); + __isFullUpdate = false; if(__pCheckedList) { @@ -1157,23 +1161,25 @@ _SlidableListImpl::RemoveItemAt(int index, int itemHeight) return E_SYSTEM; } } + r = RemoveFromItemsList(-1, (index - __topIndex)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, + "[E_SYSTEM] A system error has occurred. Failed to remove an item."); r = GetCore().RefreshTableView(0, index, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred. Failed to remove item at %d", GetErrorMessage(r), index); - r = RemoveFromItemsList(-1, (index - __topIndex)); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_SYSTEM, - "[E_SYSTEM] A system error has occurred. Failed to remove an item."); - if (__pCheckedList) { __pCheckedList->RemoveAt(index, true); } - __totalItemCount--; - CallUnloadItemCb(index); + + if (GetCore().GetFirstDrawnFlag() == true) + { + CallUnloadItemCb(index); + } return E_SUCCESS; } @@ -1181,7 +1187,7 @@ _SlidableListImpl::RemoveItemAt(int index, int itemHeight) void _SlidableListImpl::ScrollToBottom(void) { - __isDirectDelete = true; + __isForcedScroll = true; result r = E_SUCCESS; @@ -1190,7 +1196,7 @@ _SlidableListImpl::ScrollToBottom(void) GetCore().Draw(); - __isDirectDelete = false; + __isForcedScroll = false; } result @@ -1201,14 +1207,14 @@ _SlidableListImpl::ScrollToTop(int index) result r = E_SUCCESS; - __isDirectDelete = true; + __isForcedScroll = true; r = GetCore().SetTopDrawnItemIndex(0, index); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); GetCore().Draw(); - __isDirectDelete = false; + __isForcedScroll = false; return E_SUCCESS; } @@ -1218,14 +1224,14 @@ _SlidableListImpl::ScrollToTop(void) { result r = E_SUCCESS; - __isDirectDelete = true; + __isForcedScroll = true; r = GetCore().SetTopDrawnItemIndex(0, 0); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); GetCore().Draw(); - __isDirectDelete = false; + __isForcedScroll = false; } result @@ -1358,11 +1364,12 @@ _SlidableListImpl::SetItemChecked(int index, bool check) if (_currentRadioIndex != -1) { _CheckElementModel* pOldCheckElement = GetCheckElementAt(-1, _currentRadioIndex - __topIndex); - SysTryReturnResult(NID_UI_CTRL, pOldCheckElement, E_SYSTEM, "[E_SYSTEM] A system error has occurred. CheckElement instance must not be null."); - - pOldCheckElement->SetCheckBoxStatus(CHECK_BOX_UNCHECKED); - DrawItem(-1, _currentRadioIndex); + if (pOldCheckElement) + { + pOldCheckElement->SetCheckBoxStatus(CHECK_BOX_UNCHECKED); + DrawItem(-1, _currentRadioIndex - __topIndex); + } _currentRadioIndex = index; } else @@ -1391,7 +1398,7 @@ _SlidableListImpl::SetItemChecked(int index, bool check) pCheckElementModel->SetCheckBoxStatus((_CheckBoxBitmapType)check); } - DrawItem(-1, index); + DrawItem(-1, index - __topIndex); return E_SUCCESS; } @@ -1446,20 +1453,6 @@ _SlidableListImpl::SetLoadedItemEnabled(int index, bool enable) return r; } -void -_SlidableListImpl::SetTextColorOfEmptyList(const Color& color) -{ - result r = GetCore().SetTextColorOfEmptyTableView(color); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); -} - -void -_SlidableListImpl::SetTextOfEmptyList(const String& text) -{ - result r = GetCore().SetTextOfEmptyTableView(text); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); -} - result _SlidableListImpl::Initalize(void) { @@ -1473,6 +1466,14 @@ _SlidableListImpl::Initalize(void) __itemCacheSize = GetCore().GetMaxItemCachingSize(); + if (_annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || _annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING) + { + __pCheckedList = new (std::nothrow) ArrayList(); + SysTryReturnResult(NID_UI_CTRL, __pCheckedList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pCheckedList->Construct(); + } + return E_SUCCESS; } @@ -1559,7 +1560,7 @@ _SlidableListImpl::OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& if ((!_isDividerEnabled) && (_annexStyle != TABLE_VIEW_ANNEX_STYLE_NORMAL)) { - bool isChecked = IsItemChecked(itemIndex + __topIndex); + bool isChecked = IsItemChecked(itemIndex); if (isChecked) { diff --git a/src/ui/controls/FUiCtrl_Slider.cpp b/src/ui/controls/FUiCtrl_Slider.cpp index d2bb97c..93d90fc 100644 --- a/src/ui/controls/FUiCtrl_Slider.cpp +++ b/src/ui/controls/FUiCtrl_Slider.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Slider.cpp * @brief This is the implementation file for the _Slider class. @@ -49,6 +50,7 @@ _Slider::_Slider(void) , __pRightBitmap(null) , __bgColor() , __barColor() + , __barBgColor() , __titleTextColor() , __sliderStyle(_SLIDER_STYLE_OVERLAY) , __pBase(null) @@ -143,7 +145,7 @@ _Slider::Initialize(void) { result r = E_SUCCESS; - Rectangle handleRect(0, 0, 0, 0); + FloatRectangle handleRect(0.0f, 0.0f, 0.0f, 0.0f); _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); r = GET_COLOR_CONFIG(SLIDER::BG_DEFAULT_NORMAL, __bgColor); @@ -152,6 +154,9 @@ _Slider::Initialize(void) r = GET_COLOR_CONFIG(SLIDER::BAR_NORMAL, __barColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, __barBgColor); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_COLOR_CONFIG(SLIDER::TITLE_TEXT_NORMAL, __titleTextColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -190,7 +195,9 @@ _Slider::Initialize(void) __pSliderEvent = _SliderEvent::CreateInstanceN(*this); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, __pSliderEvent, r, r, "[%s] Propagating.", GetErrorMessage(r)); - + + InitializeAccessibilityElement(); + return r; } @@ -217,7 +224,8 @@ _Slider::InitializeAccessibilityElement(void) "[E_OUT_OF_MEMORY] Memory allocation failed."); __pAccessibilityElement->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); __pAccessibilityElement->SetLabel(__titleText); - __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_SLIDER); + __pAccessibilityElement->SetName(L"SliderControl"); + __pAccessibilityElement->SetTrait(L"Slider"); __pAccessibilityElement->SetHint(L"double tap and drag to adjust"); SetAccessibilityElementValue(); r = pContainer->AddElement(*__pAccessibilityElement); @@ -238,7 +246,10 @@ _Slider::OnDraw(void) result _Slider::OnAttachedToMainTree(void) { - InitializeAccessibilityElement(); + if(__pAccessibilityElement) + { + __pAccessibilityElement->SetBounds(Rectangle(0, 0, GetBounds().width, GetBounds().height)); + } return E_SUCCESS; } @@ -275,9 +286,9 @@ _Slider::SetGroupStyle(GroupStyle groupStyle) } result -_Slider::UpdateHandle(const Rectangle& handleRect) +_Slider::UpdateHandle(const FloatRectangle& handleRect) { - __pHandle->SetBounds(FloatRectangle(handleRect.x, handleRect.y, handleRect.width, handleRect.height)); + __pHandle->SetBounds(handleRect); return __pHandle->SetFlushNeeded(); } @@ -479,8 +490,8 @@ _Slider::SetIcon(IconPosition position, const Bitmap& icon) { result r = E_SUCCESS; - int iconWidth = 0; - int iconHeight = 0; + float iconWidth = 0.0f; + float iconHeight = 0.0f; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); Bitmap* pNewBitmap = null; @@ -682,6 +693,7 @@ _Slider::SetPropertyBarColor(const Variant& barColor) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __barColor = tempBarColor; + __barColor.SetAlpha(0xFF); __pSliderPresenter->SetNeedUpdate(); @@ -707,6 +719,47 @@ _Slider::GetPropertyBarColor(void) const } result +_Slider::SetBarBackgroundColor(const Color& color) +{ + return SetProperty("barBackgroundColor", Variant(color)); +} + +result +_Slider::SetPropertyBarBackgroundColor(const Variant& barBackgroundColor) +{ + result r = E_SUCCESS; + + Color tempBarBackgroundColor = barBackgroundColor.ToColor(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __barBgColor = tempBarBackgroundColor; + __barBgColor.SetAlpha(0xFF); + + __pSliderPresenter->SetNeedUpdate(); + + return r; +} + +Color +_Slider::GetBarBackgroundColor(void) const +{ + result r = E_SUCCESS; + + Variant barBgColor = GetProperty("barBackgroundColor"); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Color(), r, "[%s] Propagating.", GetErrorMessage(r)); + + return barBgColor.ToColor(); +} + +Variant +_Slider::GetPropertyBarBackgroundColor(void) const +{ + return Variant(__barBgColor); +} + +result _Slider::SetColor(const Color& color) { return SetProperty("color", Variant(color)); diff --git a/src/ui/controls/FUiCtrl_SliderEvent.cpp b/src/ui/controls/FUiCtrl_SliderEvent.cpp index f3a3a78..e40f17b 100644 --- a/src/ui/controls/FUiCtrl_SliderEvent.cpp +++ b/src/ui/controls/FUiCtrl_SliderEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderEvent.cpp * @brief This is the implementation for the _SliderEvent class. diff --git a/src/ui/controls/FUiCtrl_SliderImpl.cpp b/src/ui/controls/FUiCtrl_SliderImpl.cpp index a408e81..b268ffd 100644 --- a/src/ui/controls/FUiCtrl_SliderImpl.cpp +++ b/src/ui/controls/FUiCtrl_SliderImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderImpl.cpp * @brief This is the implementation file for the _SliderImpl class. @@ -21,6 +22,8 @@ #include #include +#include +#include #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_UiBuilder.h" @@ -111,6 +114,48 @@ CATCH: return null; } +_SliderImpl* +_SliderImpl::CreateSliderImplFN(Slider* pControl, const FloatRectangle& rect, int sliderStyle) +{ + ClearLastResult(); + + result r = E_SUCCESS; + + r = FUNC_SIZE_INFO(Slider)(sliderStyle).CheckInitialSizeValidF(FloatDimension(rect.width, rect.height), _CONTROL_ORIENTATION_PORTRAIT); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _Slider* pCore = _Slider::CreateSliderN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, pCore != null, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + _SliderImpl* pImpl = new (std::nothrow) _SliderImpl(pControl, pCore); + r = CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pImpl->InitializeBoundsPropertiesF(FUNC_SIZE_INFO(Slider)(sliderStyle), rect, pCore->GetOrientation()); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + pImpl->__pPublicAdjustmentEvent = _PublicAdjustmentEvent::CreateInstanceN(*pControl); + SysTryCatch(NID_UI_CTRL, pImpl->__pPublicAdjustmentEvent != null, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct an AdjustmentEvent instance"); + + pImpl->__pPublicSliderEvent = _PublicSliderEvent::CreateInstanceN(*pControl); + SysTryCatch(NID_UI_CTRL, pImpl->__pPublicSliderEvent != null, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct a SliderEvent instance"); + + r = pCore->AddAdjustmentEventListener(*pImpl); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = pCore->AddSliderEventListener(*pImpl); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; + +CATCH: + delete pImpl; + pImpl = null; + + return null; +} + result _SliderImpl::Initialize(int minValue, int maxValue, BackgroundStyle bgStyle, int sliderStyle, GroupStyle groupStyle) { @@ -287,6 +332,24 @@ _SliderImpl::GetBarColor(void) const } result +_SliderImpl::SetBarBackgroundColor(const Color& color) +{ + ClearLastResult(); + + Variant varBarBackgroundColor(color); + + return GetCore().SetPropertyBarBackgroundColor(varBarBackgroundColor); +} + +Color +_SliderImpl::GetBarBackgroundColor(void) const +{ + ClearLastResult(); + + return GetCore().GetPropertyBarBackgroundColor().ToColor(); +} + +result _SliderImpl::SetColor(const Color& color) { ClearLastResult(); @@ -402,7 +465,7 @@ protected: Slider* pSlider = null; Tizen::Base::String elementString; Tizen::Base::String elementString1; - Rectangle rect; + FloatRectangle rect; int tempMin = 0; int tempMax = 0; int temp = 0; @@ -427,7 +490,7 @@ protected: { return null; } - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); if (pControl->GetElement(L"backgroundStyle", elementString) || pControl->GetElement(L"BackgroundStyle", elementString)) { @@ -667,6 +730,13 @@ protected: ConvertStringToColor(elementString, color); pSlider->SetBarColor(color); } + + if (pControl->GetElement(L"barBackgroundColor", elementString)) + { + ConvertStringToColor(elementString, color); + pSlider->SetBarBackgroundColor(color); + } + if (pControl->GetElement(L"colorOpacity", elementString)) { Base::Integer::Parse(elementString, opacity); @@ -676,7 +746,20 @@ protected: ConvertStringToColor32(elementString, opacity, color); pSlider->SetColor(color); } - + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pSlider->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"SliderControl"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pSlider; } diff --git a/src/ui/controls/FUiCtrl_SliderModel.cpp b/src/ui/controls/FUiCtrl_SliderModel.cpp index 18850d0..b84611f 100644 --- a/src/ui/controls/FUiCtrl_SliderModel.cpp +++ b/src/ui/controls/FUiCtrl_SliderModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderModel.cpp * @brief This is the implementation file for the _SliderModel class. diff --git a/src/ui/controls/FUiCtrl_SliderOverlay.cpp b/src/ui/controls/FUiCtrl_SliderOverlay.cpp index 63ee173..5a4ab2e 100644 --- a/src/ui/controls/FUiCtrl_SliderOverlay.cpp +++ b/src/ui/controls/FUiCtrl_SliderOverlay.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderOverlay.cpp * @brief This is the implementation file for the _SliderOverlay class. @@ -71,12 +72,10 @@ _SliderOverlay::Construct(void) result r = E_SUCCESS; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); -#if defined(MULTI_WINDOW) r = CreateRootVisualElement(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); SetActivationEnabled(false); -#endif AcquireHandle(); @@ -86,7 +85,7 @@ _SliderOverlay::Construct(void) r = GET_COLOR_CONFIG(SLIDER::OVERLAY_TEXT_NORMAL, __overlayTextColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Dimension dim(0, 0); + FloatDimension dim(0.0f, 0.0f); r = GET_SHAPE_CONFIG(SLIDER::OVERLAY_WIDTH, orientation, dim.width); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -100,7 +99,7 @@ _SliderOverlay::Construct(void) } result -_SliderOverlay::SetSliderRect(Rectangle& sliderRect, Rectangle& sliderTouchRect) +_SliderOverlay::SetSliderRect(FloatRectangle& sliderRect, FloatRectangle& sliderTouchRect) { __sliderRect = sliderRect; __sliderTouchRect = sliderTouchRect; @@ -116,7 +115,7 @@ _SliderOverlay::SetFont(Tizen::Graphics::Font* pFont) } result -_SliderOverlay::LoadBitmaps(Dimension& dim) +_SliderOverlay::LoadBitmaps(FloatDimension& dim) { result r = E_SUCCESS; @@ -176,17 +175,19 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) { result r = E_SUCCESS; - int overlayWidth = 0; - int overlayHeight = 0; - int overlayBottomMargin = 0; + float overlayWidth = 0.0f; + float overlayHeight = 0.0f; + float overlayBottomMargin = 0.0f; int overlayTextSize = 0; - int overlayBodyHeight = 0; - int overlayY = 0; - int overlayOffset = 0; + float overlayBodyHeight = 0.0f; + float overlayY = 0.0f; + float overlayOffset = 0.0f; Point textPoint(0, 0); + bool isCustomBitmap = false; Bitmap* pBgBitmap = __pOverlayBgBitmap; Bitmap* pEffectBgBitmap = __pOverlayBgEffectBitmap; + isCustomBitmap = IS_CUSTOM_BITMAP(SLIDER::UPWARD_OVERLAY_BG_NORMAL); Tizen::Base::String text; text.Append(value); @@ -225,7 +226,7 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) overlayY = __sliderTouchRect.y; } - __sliderOverlayRect = Rectangle(__sliderRect.x + positionX + (handleWidth - overlayWidth) / 2, + __sliderOverlayRect = FloatRectangle(__sliderRect.x + positionX + (handleWidth - overlayWidth) / 2.0f, __sliderRect.y + overlayY - (overlayHeight + overlayBottomMargin), overlayWidth, overlayHeight); @@ -243,6 +244,7 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) pBgBitmap = __pOverlayBottomBgBitmap; pEffectBgBitmap = __pOverlayBottomBgEffectBitmap; textPoint.y = overlayHeight - overlayBodyHeight; + isCustomBitmap = IS_CUSTOM_BITMAP(SLIDER::DOWNWARD_OVERLAY_BG_NORMAL); } // Check SliderOverlay Position @@ -268,8 +270,8 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) pCanvas->SetFont(*__pFont); // Draw BG - Rectangle overlayRect = Rectangle(0, 0, __sliderOverlayRect.width, __sliderOverlayRect.height); - Dimension textDim(0, 0); + FloatRectangle overlayRect = FloatRectangle(0.0f, 0.0f, __sliderOverlayRect.width, __sliderOverlayRect.height); + FloatDimension textDim(0.0f, 0.0f); __pFont->GetTextExtent(text, text.GetLength(), textDim); @@ -283,16 +285,18 @@ _SliderOverlay::DrawSliderOverlay(int positionX, int handleWidth, int value) r = pCanvas->DrawBitmap(overlayRect, *pBgBitmap); } SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - - if (pEffectBgBitmap->IsNinePatchedBitmap()) - { - r = pCanvas->DrawNinePatchedBitmap(overlayRect, *pEffectBgBitmap); - } - else + if (isCustomBitmap == false) { - r = pCanvas->DrawBitmap(overlayRect, *pEffectBgBitmap); + if (pEffectBgBitmap->IsNinePatchedBitmap()) + { + r = pCanvas->DrawNinePatchedBitmap(overlayRect, *pEffectBgBitmap); + } + else + { + r = pCanvas->DrawBitmap(overlayRect, *pEffectBgBitmap); + } + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); } - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); // Draw Value Text __pFont->GetTextExtent(text, text.GetLength(), textDim); diff --git a/src/ui/controls/FUiCtrl_SliderPresenter.cpp b/src/ui/controls/FUiCtrl_SliderPresenter.cpp index a380570..3b409ce 100644 --- a/src/ui/controls/FUiCtrl_SliderPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SliderPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderPresenter.cpp * @brief This is the implementation file for the _SliderPresenter class. @@ -31,7 +32,7 @@ #include "FUiCtrl_Slider.h" #include "FUiCtrl_SliderModel.h" #include "FUiCtrl_SliderOverlay.h" - +#include "FUi_CoordinateSystemUtils.h" #include "FUiCtrl_SliderPresenter.h" using namespace Tizen::Graphics; @@ -73,6 +74,7 @@ _SliderPresenter::_SliderPresenter(void) , __pHandleDisabledEffectBitmap(null) , __pHandleHighlightedEffectBitmap(null) , __currentBarColor(0) + , __currentBarBgColor(0) , __currentBgColor(0) , __pFont(null) , __pTitleTextObject(null) @@ -86,6 +88,7 @@ _SliderPresenter::_SliderPresenter(void) , __isCustomPressedTextColor(false) , __groupStyle(GROUP_STYLE_NONE) , __fontSize(0) + , __barOffset(0.0f) { } @@ -139,6 +142,9 @@ _SliderPresenter::~_SliderPresenter(void) delete __pResourceBarBitmap; __pResourceBarBitmap = null; + delete __pResourceBarBgBitmap; + __pResourceBarBgBitmap = null; + delete __pBarResourceEffectBitmap; __pBarResourceEffectBitmap = null; @@ -221,18 +227,18 @@ _SliderPresenter::Resize(void) { result r = E_SUCCESS; - int barHeight = 0; - int barLeftMargin = 0; - int barRightMargin = 0; - int sliderY = 0; - int iconWidth = 0; - int iconSideMargin = 0; - int offset = 0; - int minimumHeight = 0; - int minimumWidth = 0; - int topMargin = 0; - int iconRightMargin = 0; - Rectangle titleTextBounds; + float barHeight = 0.0f; + float barLeftMargin = 0.0f; + float barRightMargin = 0.0f; + float sliderY = 0.0f; + float iconWidth = 0.0f; + float iconSideMargin = 0.0f; + float offset = 0.0f; + float minimumHeight = 0.0f; + float minimumWidth = 0.0f; + float topMargin = 0.0f; + float iconRightMargin = 0.0f; + FloatRectangle titleTextBounds; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); @@ -272,6 +278,8 @@ _SliderPresenter::Resize(void) r = GET_SHAPE_CONFIG(SLIDER::ICON_WIDTH, orientation, iconWidth); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_SHAPE_CONFIG(SLIDER::BAR_OFFSET, orientation, __barOffset); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); if (!__isCustomHandle) { @@ -284,7 +292,7 @@ _SliderPresenter::Resize(void) r = GET_SHAPE_CONFIG(SLIDER::HANDLE_HEIGHT, orientation, __handleRect.height); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); } - __rect = Rectangle(0, 0, __pSlider->GetBounds().width, __pSlider->GetBounds().height); + __rect = FloatRectangle(0.0f, 0.0f, __pSlider->GetBoundsF().width, __pSlider->GetBoundsF().height); r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -314,13 +322,13 @@ _SliderPresenter::Resize(void) if (__pSlider->GetStyle() & _SLIDER_STYLE_TITLE_TEXT) { r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_SIZE, orientation, minimumHeight); - minimumHeight = minimumHeight + (2 * topMargin) + barHeight; + minimumHeight = minimumHeight + (2.0f * topMargin) + barHeight; if (__rect.height < minimumHeight ) __rect.height = minimumHeight; } else { - minimumHeight = (2 * topMargin) + barHeight; + minimumHeight = (2.0f * topMargin) + barHeight; if (__rect.height < minimumHeight) __rect.height = minimumHeight; } @@ -329,13 +337,13 @@ _SliderPresenter::Resize(void) { titleTextBounds = GetTitleTextBounds(); sliderY = titleTextBounds.y + titleTextBounds.height; - __touchRect = Rectangle(barLeftMargin - offset, sliderY + (__rect.height - (sliderY + __handleRect.height)) / 2, - __rect.width - (barLeftMargin + barRightMargin) + (2 * offset), __handleRect.height); + __touchRect = FloatRectangle(barLeftMargin - offset, sliderY + (__rect.height - (sliderY + __handleRect.height)) / 2.0f, + __rect.width - (barLeftMargin + barRightMargin) + (2.0f * offset), __handleRect.height); } else { - __touchRect = Rectangle(barLeftMargin - offset, (__rect.height - __handleRect.height) / 2, - (__rect.width - (barLeftMargin + barRightMargin)) + (2 * offset), __handleRect.height); + __touchRect = FloatRectangle(barLeftMargin - offset, (__rect.height - __handleRect.height) / 2.0f, + (__rect.width - (barLeftMargin + barRightMargin)) + (2.0f * offset), __handleRect.height); } if (__pSlider->GetIcon(ICON_POSITION_LEFT) != null) @@ -349,11 +357,12 @@ _SliderPresenter::Resize(void) __touchRect.width = __touchRect.width - (iconWidth + iconSideMargin + iconRightMargin); } - __barBgRect = Rectangle(__touchRect.x + offset, __touchRect.y + - ((__handleRect.height - barHeight) / 2), __touchRect.width - (2 * offset), barHeight); + __barBgRect = FloatRectangle(__touchRect.x + offset, __touchRect.y + + ((__handleRect.height - barHeight) / 2.0f), __touchRect.width - (2.0f * offset), barHeight); Rectangle absBounds = __pSlider->GetAbsoluteBounds(); - __pSliderOverlay->SetSliderRect(absBounds, __touchRect); + FloatRectangle absBoundsFloat(absBounds.x, absBounds.y, absBounds.width, absBounds.height); + __pSliderOverlay->SetSliderRect(absBoundsFloat, __touchRect); return r; } @@ -370,7 +379,6 @@ _SliderPresenter::LoadBitmap(void) Bitmap* pDisabledBitmap = null; Bitmap* pHighlightedBitmap = null; Bitmap* pReplacementBitmap = null; - Color barBgColor; Color handleNormalColor; Color handlePressedColor; Color handleDisabledColor; @@ -385,7 +393,7 @@ _SliderPresenter::LoadBitmap(void) r = GET_COLOR_CONFIG(SLIDER::BAR_NORMAL, __currentBarColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, barBgColor); + r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, __currentBarBgColor); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_COLOR_CONFIG(SLIDER::HANDLE_BG_NORMAL, handleNormalColor); @@ -401,42 +409,42 @@ _SliderPresenter::LoadBitmap(void) SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); // for GROUP_STYLE_TOP - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_TOP_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgTopBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgTopBitmap); SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating."); __pBgTopBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgTopBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_TOP_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgTopEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgTopEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // for GROUP_STYLE_MIDDLE - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_MIDDLE_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgMiddleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgMiddleBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); __pBgMiddleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgMiddleBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_MIDDLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgMiddleEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgMiddleEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // for GROUP_STYLE_BOTTOM - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_BOTTOM_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgBottomBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgBottomBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); __pBgBottomBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgBottomBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_BOTTOM_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgBottomEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgBottomEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // for GROUP_STYLE_SINGLE and GROUP_STYLE_NONE - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_SINGLE_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgSingleBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgSingleBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); __pBgSingleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor); @@ -448,7 +456,7 @@ _SliderPresenter::LoadBitmap(void) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = GET_BITMAP_CONFIG_N(SLIDER::GROUP_SINGLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgSingleEffectBitmap); + r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgSingleEffectBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); opacity = __currentBgColor.GetAlpha(); @@ -467,16 +475,13 @@ _SliderPresenter::LoadBitmap(void) // Bar Resources - r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBitmap); + r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBgBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - __pBarBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBitmap,Color::GetColor(COLOR_ID_MAGENTA), barBgColor); + __pBarBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBarBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - delete __pResourceBarBitmap; - __pResourceBarBitmap = null; - r = GET_BITMAP_CONFIG_N(SLIDER::BAR_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -632,6 +637,9 @@ CATCH: delete __pResourceBarBitmap; __pResourceBarBitmap = null; + delete __pResourceBarBgBitmap; + __pResourceBarBgBitmap = null; + delete __pBarResourceEffectBitmap; __pBarResourceEffectBitmap = null; @@ -686,7 +694,7 @@ _SliderPresenter::CalculateSliderValue(int positionX, int offsetX) if (positionX >= (__touchRect.x + __touchRect.width) - offsetX) { - __sliderX = __barBgRect.width - __handleRect.width; + __sliderX = __barBgRect.width - __handleRect.width - (2.0f * __barOffset); __handleX = __touchRect.width - __handleRect.width; return maxValue; } @@ -696,7 +704,7 @@ _SliderPresenter::CalculateSliderValue(int positionX, int offsetX) return minValue; } - __sliderX = positionX - (__barBgRect.x + offsetX); + __sliderX = positionX - (__barBgRect.x + offsetX) - (2.0f * __barOffset); __handleX = positionX - (__touchRect.x + offsetX); __handleRect.x = __touchRect.x + __handleX; @@ -730,8 +738,8 @@ result _SliderPresenter::DrawSlider(void) { result r = E_SUCCESS; - int sliderY = 0; - Rectangle titleTextBounds; + float sliderY = 0.0f; + FloatRectangle titleTextBounds; int style = __pSlider->GetStyle(); @@ -975,15 +983,17 @@ result _SliderPresenter::DrawSliderBar(Canvas& canvas) { result r = E_SUCCESS; - int bitmapHeight = 0; - int bitmapWidth = 0; - int bitmapPositionX = 0; - int bitmapPositionY = 0; + float bitmapHeight = 0.0f; + float bitmapWidth = 0.0f; + float bitmapPositionX = 0.0f; + float bitmapPositionY = 0.0f; int opacity = 0; - int offset = 0; + float offset = 0.0f; Bitmap* pReplacementBitmap = null; Bitmap* pHandleBitmap = null; Bitmap* pHandleEffectBitmap = null; + bool isCustomHandleBitmap = false; + bool isCustomBarBitmap = false; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); @@ -994,6 +1004,7 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas) { pHandleBitmap = __pHandleDisabledBitmap; pHandleEffectBitmap = __pHandleDisabledEffectBitmap; + isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_DISABLED); if(__isSliderPressed == true) { __isSliderPressed = false; @@ -1007,29 +1018,45 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas) { pHandleBitmap = __pHandlePressedBitmap; pHandleEffectBitmap = __pHandlePressedEffectBitmap; + isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_PRESSED); } else if (__pSlider->IsFocused() == true) { pHandleBitmap = __pHandleHighlightedBitmap; pHandleEffectBitmap = __pHandleHighlightedEffectBitmap; + isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_HIGHLIGHTED); } else //(__isSliderPressed == false) // normal state { pHandleBitmap = __pHandleNormalBitmap; pHandleEffectBitmap = __pHandleNormalEffectBitmap; + isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_NORMAL); } int minValue = __pSliderModel->GetMinValue(); int maxValue = __pSliderModel->GetMaxValue(); - __barRect = Rectangle(__barBgRect.x, __barBgRect.y, __sliderX, __barBgRect.height); + __barRect = FloatRectangle(__barBgRect.x + __barOffset, __barBgRect.y, __sliderX, __barBgRect.height); if (__isSliderPressed == false && (maxValue - minValue) != 0) { - __barRect.width = ((__barBgRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue); + __barRect.width = ((__barBgRect.width - ( __handleRect.width + (2.0f * __barOffset))) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue); __handleX = ((__touchRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue); } + if (__pSlider->GetBarBackgroundColor() != __currentBarBgColor) + { + pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetBarBackgroundColor()); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, (pReplacementBitmap != null), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + delete __pBarBgColorReplacementBitmap; + __pBarBgColorReplacementBitmap = null; + + __pBarBgColorReplacementBitmap = pReplacementBitmap; + __currentBarBgColor = __pSlider->GetBarBackgroundColor(); + } + if (__pSlider->GetBarColor() != __currentBarColor) { pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetBarColor()); @@ -1046,30 +1073,32 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas) // Redrawing twice is required because, when slider is disabled we are applying alpha channel to the bar // which will show the previously drawn portion. - __pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF); - __pBarColorReplacementBitmap->SetAlphaConstant(0xFF); - - DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap); - DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap); - - if (__pSlider->IsEnabled() == false) // disabled { - __pBarBgColorReplacementBitmap->SetAlphaConstant(0x4C); + __pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF); + DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap); + __pBarColorReplacementBitmap->SetAlphaConstant(0x4C); } else { opacity = __pSlider->GetBarColor().GetAlpha(); - __pBarBgColorReplacementBitmap->SetAlphaConstant(opacity); __pBarColorReplacementBitmap->SetAlphaConstant(opacity); } + isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_BG_NORMAL); DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap); - DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap); + if (isCustomBarBitmap == false) + { + DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap); + } - DrawBitmap(canvas, Rectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarColorReplacementBitmap); - DrawBitmap(canvas, Rectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap); + isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_NORMAL); + DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarColorReplacementBitmap); + if (isCustomBarBitmap == false) + { + DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap); + } __handleRect.x = __touchRect.x + __handleX; __handleRect.y = __touchRect.y; @@ -1093,11 +1122,13 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas) if (pHandleEffectBitmap != null) // drawing the default bitmap { - r = DrawBitmap(*pHandleCanvas, Rectangle(0, 0, __handleRect.width, __handleRect.height), pHandleBitmap); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - r = DrawBitmap(*pHandleCanvas, Rectangle(0, 0, __handleRect.width, __handleRect.height), pHandleEffectBitmap); + r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + if (isCustomHandleBitmap == false) + { + r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } } else { @@ -1109,21 +1140,21 @@ _SliderPresenter::DrawSliderBar(Canvas& canvas) // to clip the center portion of the larger bitmap. if( bitmapWidth > __handleRect.width ) { - bitmapPositionX = (bitmapWidth / 2) - (__handleRect.width / 2); + bitmapPositionX = (bitmapWidth / 2.0f) - (__handleRect.width / 2.0f); bitmapWidth = __handleRect.width; } if( bitmapHeight > __handleRect.height ) { - bitmapPositionY = (bitmapHeight / 2) - (__handleRect.height / 2); + bitmapPositionY = (bitmapHeight / 2.0f) - (__handleRect.height / 2.0f); bitmapHeight = __handleRect.height; } - r = pHandleCanvas->DrawBitmap(Rectangle(0, 0, __handleRect.width, __handleRect.height), *pHandleBitmap, Rectangle(bitmapPositionX, bitmapPositionY, bitmapWidth, bitmapHeight)); + r = pHandleCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *pHandleBitmap, FloatRectangle(bitmapPositionX, bitmapPositionY, bitmapWidth, bitmapHeight)); } else { - r = pHandleCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, __handleRect.width, __handleRect.height), *pHandleBitmap); + r = pHandleCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *pHandleBitmap); } SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -1178,7 +1209,7 @@ _SliderPresenter::DrawSliderBarNumber(int value) textColor = __handleTextColor; } - Dimension textDim(0, 0); + FloatDimension textDim(0.0f, 0.0f); text.Append(value); valueLength = text.GetLength(); @@ -1207,9 +1238,9 @@ _SliderPresenter::DrawSliderBarNumber(int value) pHandleCanvas->SetFont(*__pFont); __pFont->GetTextExtent(text, valueLength, textDim); - Point textPoint; - textPoint.x = (__handleRect.width - textDim.width) / 2; - textPoint.y = (__handleRect.height - textDim.height) / 2; + FloatPoint textPoint; + textPoint.x = (__handleRect.width - textDim.width) / 2.0f; + textPoint.y = (__handleRect.height - textDim.height) / 2.0f; pHandleCanvas->SetForegroundColor(textColor); pHandleCanvas->DrawText(textPoint, text); @@ -1228,7 +1259,7 @@ _SliderPresenter::DrawTitleText(Canvas& canvas) TextSimple* pSimpleTitleText = null; int titleTextSize = 0; int titleLength = 0; - Rectangle titleTextBounds; + FloatRectangle titleTextBounds; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); titleLength = __pSlider->GetTitleText().GetLength(); @@ -1294,7 +1325,8 @@ _SliderPresenter::DrawSliderOverlay(int value) result r = E_SUCCESS; Rectangle absBounds = __pSlider->GetAbsoluteBounds(); - r = __pSliderOverlay->SetSliderRect(absBounds, __touchRect); + FloatRectangle absBoundsFloat(absBounds.x, absBounds.y, absBounds.width, absBounds.height); + r = __pSliderOverlay->SetSliderRect(absBoundsFloat, __touchRect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); r = __pSliderOverlay->DrawSliderOverlay(__touchRect.x + __handleX, __handleRect.width, value); @@ -1304,7 +1336,7 @@ _SliderPresenter::DrawSliderOverlay(int value) } result -_SliderPresenter::DrawBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pBitmap) +_SliderPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap) { result r = E_SUCCESS; @@ -1321,63 +1353,62 @@ _SliderPresenter::DrawBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pB return r; } - -Rectangle +FloatRectangle _SliderPresenter::GetTitleTextBounds(void) const { - Rectangle titleTextBounds; - int topMargin = 0; + FloatRectangle titleTextBounds; + float topMargin = 0.0f; result r = E_SUCCESS; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_X, orientation, titleTextBounds.x); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_Y, orientation, titleTextBounds.y); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); titleTextBounds.y = titleTextBounds.y + topMargin; r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_HEIGHT, orientation, titleTextBounds.height); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); - titleTextBounds.width = __pSlider->GetBounds().width - titleTextBounds.x; + titleTextBounds.width = __pSlider->GetBoundsF().width - titleTextBounds.x; return titleTextBounds; } -Rectangle +FloatRectangle _SliderPresenter::GetTouchBounds(void) const { return __touchRect; } -Rectangle +FloatRectangle _SliderPresenter::GetIconBounds(IconPosition iconPosition) const { result r = E_SUCCESS; - Rectangle iconBounds; - int iconSideMargin = 0; - int barHeight = 0; + FloatRectangle iconBounds; + float iconSideMargin = 0.0f; + float barHeight = 0.0f; _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); r = GET_SHAPE_CONFIG(SLIDER::ICON_WIDTH, orientation, iconBounds.width); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_SHAPE_CONFIG(SLIDER::ICON_HEIGHT, orientation, iconBounds.height); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_SHAPE_CONFIG(SLIDER::ICON_LEFT_MARGIN, orientation, iconSideMargin); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); r = GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, orientation, barHeight);; - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, Rectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r)); iconBounds.y = __barBgRect.y + ((barHeight - iconBounds.height) / 2); @@ -1401,11 +1432,11 @@ _SliderPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touch return false; } - Point point = touchinfo.GetCurrentPosition(); + Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); __isBubblingBlocked = false; - if (__pSlider->IsEnabled() == true && __handleRect.Contains(point) == true) + if (__pSlider->IsEnabled() == true && __handleRect.Contains(FloatPoint(point.x, point.y)) == true) { int candidateValue = CalculateSliderValue(point.x, point.x - __handleRect.x); @@ -1434,11 +1465,12 @@ _SliderPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc return false; } - Point point = touchinfo.GetCurrentPosition(); + Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); bool isBubblingBlocked = __isBubblingBlocked; if (__isSliderPressed == true) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); __isSliderPressed = false; int candidateValue = CalculateSliderValue(point.x, point.x - __handleRect.x); @@ -1475,7 +1507,7 @@ _SliderPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin return false; } - Point point = touchinfo.GetCurrentPosition(); + Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); bool isBubblingBlocked = __isBubblingBlocked; if (__isSliderPressed == false) @@ -1489,14 +1521,15 @@ _SliderPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin return false; } - int handleHalfWidth = __handleRect.width / 2; + float handleHalfWidth = __handleRect.width / 2.0f; int oldValue = __pSliderModel->GetValue(); int candidateValue = CalculateSliderValue(point.x, handleHalfWidth); __pSliderModel->SetValue(candidateValue); __pSlider->SetAccessibilityElementValue(); - __pSlider->Invalidate(); + __pSlider->Draw(); + __pSlider->Show(); if (oldValue != candidateValue) { diff --git a/src/ui/controls/FUiCtrl_SplitPanel.cpp b/src/ui/controls/FUiCtrl_SplitPanel.cpp index d121bde..4de73f1 100644 --- a/src/ui/controls/FUiCtrl_SplitPanel.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanel.cpp * @brief This is the implementation file for the _SplitPanel class. @@ -30,6 +31,7 @@ #include "FUi_AccessibilityElement.h" #include "FUiCtrl_SplitPanel.h" #include "FUiCtrl_SplitPanelPresenter.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Ui; using namespace Tizen::Graphics; @@ -50,25 +52,24 @@ _SplitPanel::_SplitPanel() , __dividerTapCount(0) , __pAccessibilityElement(null) , __pDividerVisualElement(null) - , __isDividerPositionInitialized(false) - , __isDividerMaximumPositionInitialized(false) - , __isDividerMinimumPositionInitialized(false) - , __isFirstTimeOrientationChanged(true) { for (int i=0; i < _SPLIT_PANEL_DIVIDER_STATE; i++) { - __dividerPosition[i] = 0; - __minimumDividerPosition[i] = 0; - __maximumDividerPosition[i] = 0; + __dividerPosition[i] = 0.0f; + __minimumDividerPosition[i] = 0.0f; + __maximumDividerPosition[i] = 0.0f; } } _SplitPanel* -_SplitPanel::CreateSplitPanelN(const Rectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection) +_SplitPanel::CreateSplitPanelN(const FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection) { result r = E_SUCCESS; + float dividerThickness = 0.0f; + _SplitPanel* pSplitPanel = null; + _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; - _SplitPanel* pSplitPanel = new (std::nothrow) _SplitPanel; + pSplitPanel = new (std::nothrow) _SplitPanel; SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); r = pSplitPanel->Construct(splitPanelDividerStyle, splitPanelDividerDirection); @@ -81,20 +82,26 @@ _SplitPanel::CreateSplitPanelN(const Rectangle& rect, SplitPanelDividerStyle spl pSplitPanel->AcquireHandle(); pSplitPanel->SetDividerDirection(splitPanelDividerDirection); - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + orientation = _ControlManager::GetInstance()->GetOrientation(); - int dividerThickness = 0; - GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness); + if (splitPanelDividerStyle == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) + { + GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness); + } + else + { + GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, dividerThickness); + } pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.width - dividerThickness; pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width - dividerThickness; pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.height - dividerThickness; pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width - dividerThickness; - pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.width / 2; - pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width / 2; - pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.height / 2; - pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.height / 2; + pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.width / 2.0f; + pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width / 2.0f; + pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.height / 2.0f; + pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.height / 2.0f; pSplitPanel->__pTapGesture = new (std::nothrow) _TouchTapGestureDetector; SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -248,44 +255,6 @@ _SplitPanel::OnDraw(void) void _SplitPanel::OnChangeLayout(_ControlOrientation orientation) { - if (__isFirstTimeOrientationChanged) - { - Rectangle bounds = GetBounds(); - - int dividerThickness = 0; - GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness); - - if (!__isDividerMaximumPositionInitialized) - { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = bounds.width - dividerThickness; - __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = bounds.width - dividerThickness; - } - else - { - __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = bounds.width - dividerThickness; - __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = bounds.width - dividerThickness; - } - } - - if (!__isDividerPositionInitialized) - { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = bounds.width / 2; - __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = bounds.height / 2; - } - else - { - __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = bounds.width / 2; - __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = bounds.height / 2; - } - } - - __isFirstTimeOrientationChanged = false; - } - __pSplitPanelPresenter->OnChangeLayout(orientation); return; @@ -294,11 +263,11 @@ _SplitPanel::OnChangeLayout(_ControlOrientation orientation) void _SplitPanel::OnBoundsChanged(void) { - Rectangle bounds = GetBounds(); - - int dividerThickness = 0; + FloatRectangle bounds = GetBoundsF(); + float dividerThickness = 0.0f; + _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + orientation = _ControlManager::GetInstance()->GetOrientation(); GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness); @@ -370,21 +339,21 @@ _SplitPanel::SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder) { result r = E_SUCCESS; - SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM, - "[E_SYSTEM] A system error occurred."); - if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST) { + r = AttachChild(*pControl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + __pFirstPane = pControl; } else { + r = AttachChild(*pControl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + __pSecondPane = pControl; } - r = AttachChild(*pControl); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - return E_SUCCESS; } @@ -422,11 +391,11 @@ _SplitPanel::GetDividerStyle(void) const } result -_SplitPanel::SetDividerPosition(int position) +_SplitPanel::SetDividerPosition(float position) { - const int width = GetBounds().width; + const float width = GetBoundsF().width; - if ((0 > position) || (width < position)) + if ((0.0f > position) || (width < position)) { return E_OUT_OF_RANGE; } @@ -439,46 +408,28 @@ _SplitPanel::SetDividerPosition(int position) } } - if (!__isDividerPositionInitialized) + _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + + if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } else { - __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } - - __isDividerPositionInitialized = true; } else { - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); - - if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } - else - { - __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } + __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } else { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } - else - { - __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } + __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } } @@ -487,7 +438,7 @@ _SplitPanel::SetDividerPosition(int position) return E_SUCCESS; } -int +float _SplitPanel::GetDividerPosition(void) const { _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); @@ -517,7 +468,7 @@ _SplitPanel::GetDividerPosition(void) const } result -_SplitPanel::SetMaximumDividerPosition(int position) +_SplitPanel::SetMaximumDividerPosition(float position) { if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED) { @@ -527,53 +478,42 @@ _SplitPanel::SetMaximumDividerPosition(int position) _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); - const int width = GetBounds().width; - int margin = 0; - GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER, orientation, margin); + const float width = GetBoundsF().width; + float margin = 0.0f; + if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) + { + GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, margin); + } + else + { + GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, margin); + } - if ((0 > position) || ((width - margin) < position) || (position < GetMinimumDividerPosition())) + if ((0.0f > position) || ((width - margin) < position) || (position < GetMinimumDividerPosition())) { return E_OUT_OF_RANGE; } - if (!__isDividerMaximumPositionInitialized) + if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } else { - __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } - - __isDividerMaximumPositionInitialized = true; } else { - if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } - else - { - __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } + __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } else { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } - else - { - __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } + __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } } @@ -585,7 +525,7 @@ _SplitPanel::SetMaximumDividerPosition(int position) return E_SUCCESS; } -int +float _SplitPanel::GetMaximumDividerPosition(void) const { if (GetDividerStyle() != SPLIT_PANEL_DIVIDER_STYLE_FIXED) @@ -621,7 +561,7 @@ _SplitPanel::GetMaximumDividerPosition(void) const } result -_SplitPanel::SetMinimumDividerPosition(int position) +_SplitPanel::SetMinimumDividerPosition(float position) { if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED) { @@ -629,53 +569,35 @@ _SplitPanel::SetMinimumDividerPosition(int position) return E_SUCCESS; } - const int width = GetBounds().width; + const float width = GetBoundsF().width; - if ((0 > position) || (width < position) || (position > GetMaximumDividerPosition())) + if ((0.0f > position) || (width < position) || (position > GetMaximumDividerPosition())) { return E_OUT_OF_RANGE; } - if (!__isDividerMinimumPositionInitialized) + _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + + if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } else { - __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; } - - __isDividerMinimumPositionInitialized = true; } else { - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); - - if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) + if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } - else - { - __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position; - } + __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } else { - if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) - { - __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } - else - { - __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; - } + __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position; } } @@ -687,7 +609,7 @@ _SplitPanel::SetMinimumDividerPosition(int position) return E_SUCCESS; } -int +float _SplitPanel::GetMinimumDividerPosition(void) const { if (GetDividerStyle() != SPLIT_PANEL_DIVIDER_STYLE_FIXED) @@ -814,7 +736,7 @@ _SplitPanel::OnAttachedToMainTree(void) { if (__pDividerVisualElement) { - Rectangle dividerRect = __pSplitPanelPresenter->GetDividerRectangle(); + FloatRectangle dividerRect = __pSplitPanelPresenter->GetDividerRectangle(); String hintText = L""; if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED) @@ -829,7 +751,7 @@ _SplitPanel::OnAttachedToMainTree(void) __pAccessibilityElement = new _AccessibilityElement(true); SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - __pAccessibilityElement->SetBounds(dividerRect); + __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(dividerRect)); __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); __pAccessibilityElement->SetHint(hintText); __pAccessibilityElement->SetLabel(L""); @@ -850,15 +772,15 @@ _SplitPanel::GetDividerVisualElement(void) } void -_SplitPanel::SetDividerVisualElementBounds(Rectangle& bounds) +_SplitPanel::SetDividerVisualElementBounds(FloatRectangle& bounds) { if (__pDividerVisualElement) { - __pDividerVisualElement->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); + __pDividerVisualElement->SetBounds(bounds); if (likely(_AccessibilityManager::IsActivated()) && __pAccessibilityElement) { - __pAccessibilityElement->SetBounds(bounds); + __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(bounds)); } } diff --git a/src/ui/controls/FUiCtrl_SplitPanelImpl.cpp b/src/ui/controls/FUiCtrl_SplitPanelImpl.cpp index 5d58d08..bed2c52 100644 --- a/src/ui/controls/FUiCtrl_SplitPanelImpl.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanelImpl.cpp @@ -29,6 +29,7 @@ #include "FUiCtrl_SplitPanelImpl.h" #include "FUiCtrl_SplitPanel.h" #include "FUi_UiBuilder.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Ui; @@ -78,6 +79,24 @@ _SplitPanelImpl::CreateSplitPanelImplN(SplitPanel* pControl, const Rectangle& re ClearLastResult(); result r = E_SUCCESS; + FloatRectangle rectF = _CoordinateSystemUtils::ConvertToFloat(rect); + + _SplitPanel* pCore = _SplitPanel::CreateSplitPanelN(rectF, splitPanelDividerStyle, splitPanelDividerDirection); + SysTryReturn(NID_UI_CTRL, pCore != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + _SplitPanelImpl* pImpl = new (std::nothrow) _SplitPanelImpl(pControl, pCore); + r = _ControlImpl::CheckConstruction(pCore, pImpl); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + + return pImpl; +} + +_SplitPanelImpl* +_SplitPanelImpl::CreateSplitPanelImplFN(SplitPanel* pControl, const FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection) +{ + ClearLastResult(); + result r = E_SUCCESS; + _SplitPanel* pCore = _SplitPanel::CreateSplitPanelN(rect, splitPanelDividerStyle, splitPanelDividerDirection); SysTryReturn(NID_UI_CTRL, pCore != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -94,6 +113,26 @@ _SplitPanelImpl::Initialize(const Rectangle& rect) ClearLastResult(); result r = E_SUCCESS; + FloatRectangle rectF = _CoordinateSystemUtils::ConvertToFloat(rect); + + r = SetBounds(rectF); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + __pPublicSplitPanelEvent = _PublicSplitPanelEvent::CreateInstanceN(GetPublic()); + SysTryReturn(NID_UI_CTRL, __pPublicSplitPanelEvent, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + r = GetCore().AddSplitPanelEventListener(*this); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; +} + +result +_SplitPanelImpl::InitializeF(const FloatRectangle& rect) +{ + ClearLastResult(); + result r = E_SUCCESS; + r = SetBounds(rect); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -169,12 +208,24 @@ _SplitPanelImpl::AddSplitPanelEventListener(ISplitPanelEventListener& listener) } result +_SplitPanelImpl::AddSplitPanelEventListener(ISplitPanelEventListenerF& listener) +{ + return __pPublicSplitPanelEvent->AddListener(listener); +} + +result _SplitPanelImpl::RemoveSplitPanelEventListener(ISplitPanelEventListener& listener) { return __pPublicSplitPanelEvent->RemoveListener(listener); } result +_SplitPanelImpl::RemoveSplitPanelEventListener(ISplitPanelEventListenerF& listener) +{ + return __pPublicSplitPanelEvent->RemoveListener(listener); +} + +result _SplitPanelImpl::SetPane(_ControlImpl* pControl, SplitPanelPaneOrder paneOrder) { result r = E_SUCCESS; @@ -210,10 +261,26 @@ _SplitPanelImpl::SetDividerPosition(int position) SetLastResultReturn(r); } +result +_SplitPanelImpl::SetDividerPosition(float position) +{ + int intPosition = _CoordinateSystemUtils::ConvertToInteger(position); + result r = GetCore().SetDividerPosition(intPosition); + SetLastResultReturn(r); +} + int _SplitPanelImpl::GetDividerPosition(void) const { ClearLastResult(); + int position = _CoordinateSystemUtils::ConvertToInteger(GetCore().GetDividerPosition()); + return position; +} + +float +_SplitPanelImpl::GetDividerPositionF(void) const +{ + ClearLastResult(); return GetCore().GetDividerPosition(); } @@ -224,10 +291,26 @@ _SplitPanelImpl::SetMaximumDividerPosition(int position) SetLastResultReturn(r); } +result +_SplitPanelImpl::SetMaximumDividerPosition(float position) +{ + int intPosition = _CoordinateSystemUtils::ConvertToInteger(position); + result r = GetCore().SetMaximumDividerPosition(intPosition); + SetLastResultReturn(r); +} + int _SplitPanelImpl::GetMaximumDividerPosition(void) const { ClearLastResult(); + int maxPosition = _CoordinateSystemUtils::ConvertToInteger(GetCore().GetMaximumDividerPosition()); + return maxPosition; +} + +float +_SplitPanelImpl::GetMaximumDividerPositionF(void) const +{ + ClearLastResult(); return GetCore().GetMaximumDividerPosition(); } @@ -238,10 +321,26 @@ _SplitPanelImpl::SetMinimumDividerPosition(int position) SetLastResultReturn(r); } +result +_SplitPanelImpl::SetMinimumDividerPosition(float position) +{ + int intPosition = _CoordinateSystemUtils::ConvertToInteger(position); + result r = GetCore().SetMinimumDividerPosition(intPosition); + SetLastResultReturn(r); +} + int _SplitPanelImpl::GetMinimumDividerPosition(void) const { ClearLastResult(); + int minPosition = _CoordinateSystemUtils::ConvertToInteger(GetCore().GetMinimumDividerPosition()); + return minPosition; +} + +float +_SplitPanelImpl::GetMinimumDividerPositionF(void) const +{ + ClearLastResult(); return GetCore().GetMinimumDividerPosition(); } @@ -288,12 +387,12 @@ protected: result r = E_SYSTEM; _UiBuilderControlLayout* pControlProperty = null; SplitPanel* pSplitPanel = null; - Tizen::Graphics::Rectangle rect; + Tizen::Graphics::FloatRectangle rect; Tizen::Base::String elementString; Tizen::Base::String xmlLink; - int minDividerPosition = 0; - int maxDividerPosition = 0; - int dividerPosition = 0; + float minDividerPosition = 0.0f; + float maxDividerPosition = 0.0f; + float dividerPosition = 0.0f; SplitPanelDividerStyle splitPanelDividerStyle = SPLIT_PANEL_DIVIDER_STYLE_MOVABLE; SplitPanelDividerDirection splitPanelDividerDirection = SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL; @@ -308,7 +407,7 @@ protected: pSplitPanel = new (std::nothrow) SplitPanel(); SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - rect = pControlProperty->GetRect(); + rect = pControlProperty->GetRectF(); // Set Style if (pControl->GetElement("dividerStyle", elementString) || pControl->GetElement("DividerStyle", elementString)) @@ -349,19 +448,19 @@ protected: if (pControl->GetElement("minDividerPosition", elementString)) { - Base::Integer::Parse(elementString, minDividerPosition); + Base::Float::Parse(elementString, minDividerPosition); pSplitPanel->SetMinimumDividerPosition(minDividerPosition); } if (pControl->GetElement("maxDividerPosition", elementString)) { - Base::Integer::Parse(elementString, maxDividerPosition); + Base::Float::Parse(elementString, maxDividerPosition); pSplitPanel->SetMaximumDividerPosition(maxDividerPosition); } if (pControl->GetElement("dividerPosition", elementString)) { - Base::Integer::Parse(elementString, dividerPosition); + Base::Float::Parse(elementString, dividerPosition); pSplitPanel->SetDividerPosition(dividerPosition); } diff --git a/src/ui/controls/FUiCtrl_SplitPanelModel.cpp b/src/ui/controls/FUiCtrl_SplitPanelModel.cpp index dce362f..1c92703 100644 --- a/src/ui/controls/FUiCtrl_SplitPanelModel.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanelModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanelModel.cpp * @brief This is the implementation file for the _SplitPanelModel class. diff --git a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp index cc3a65b..7957001 100644 --- a/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_SplitPanelPresenter.cpp @@ -32,6 +32,7 @@ #include "FUiCtrl_SplitPanelPresenter.h" #include "FUiCtrl_SplitPanel.h" #include "FUiCtrl_SplitPanelImpl.h" +#include "FGrp_CoordinateSystemUtils.h" using namespace Tizen::Ui; using namespace Tizen::Graphics; @@ -43,12 +44,12 @@ namespace Tizen { namespace Ui { namespace Controls _SplitPanelPresenter::_SplitPanelPresenter(void) : __pSplitPanel(null) , __pSplitPanelModel(null) - , __dividerMaximumPosition(0) - , __dividerMinimumPosition(0) + , __dividerMaximumPosition(0.0f) + , __dividerMinimumPosition(0.0f) , __splitPanelDividerPressed(false) , __setFirstDividerPositionChangeEvent(true) - , __dividerRectangle(0,0,0,0) - , __dividerThumbRectangle(0,0,0,0) + , __dividerRectangle(0.0f, 0.0f ,0.0f, 0.0f) + , __dividerThumbRectangle(0.0f, 0.0f, 0.0f, 0.0f) , __pDividerPressedBackgroundBitmap(null) , __pDividerBackgroundBitmap(null) , __pDividerBackgroundEffectBitmap(null) @@ -84,8 +85,9 @@ result _SplitPanelPresenter::Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection) { result r = E_SUCCESS; + _SplitPanelModel* pModel = null; - _SplitPanelModel* pModel = new (std::nothrow) _SplitPanelModel; + pModel = new (std::nothrow) _SplitPanelModel; SysTryReturnResult(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, "Memory allocation failed."); r = SetModel(*pModel); @@ -117,24 +119,27 @@ CATCH: } bool -_SplitPanelPresenter::CheckDividerTouchRegion(int positionX, int positionY) +_SplitPanelPresenter::CheckDividerTouchRegion(float positionX, float positionY) { - int dividerPosition = __pSplitPanel->GetDividerPosition(); + float dividerPosition = 0.0f; + Bitmap* pThumbBitmap = null; + + dividerPosition = __pSplitPanel->GetDividerPosition(); if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - Bitmap* pThumbBitmap = __pDividerThumbBitmap; + pThumbBitmap = __pDividerThumbBitmap; if ((positionX >= dividerPosition) - && (positionX <= dividerPosition + pThumbBitmap->GetWidth())) + && (positionX <= dividerPosition + pThumbBitmap->GetWidthF())) { return true; } } else { - Bitmap* pThumbBitmap = __pDividerThumbBitmap; + pThumbBitmap = __pDividerThumbBitmap; if ((positionY >= dividerPosition) - && (positionY <= dividerPosition + pThumbBitmap->GetHeight())) + && (positionY <= dividerPosition + pThumbBitmap->GetHeightF())) { return true; } @@ -146,7 +151,9 @@ _SplitPanelPresenter::CheckDividerTouchRegion(int positionX, int positionY) bool _SplitPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - Point point = touchinfo.GetCurrentPosition(); + FloatPoint point(0.0f, 0.0f); + + point = touchinfo.GetCurrentPosition(); if (CheckDividerTouchRegion(point.x, point.y) == true) { @@ -163,6 +170,7 @@ _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& { if (__splitPanelDividerPressed == true) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); __splitPanelDividerPressed = false; Draw(); } @@ -173,6 +181,9 @@ _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& bool _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + FloatPoint point(0.0f, 0.0f); + Bitmap* pThumbBitmap = null; + if (__pSplitPanel != &source || __splitPanelDividerPressed == false ) { return false; @@ -183,7 +194,7 @@ _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou return false; } - Point point = touchinfo.GetCurrentPosition(); + point = touchinfo.GetCurrentPosition(); if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { @@ -194,9 +205,9 @@ _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou return false; } - Bitmap* pThumbBitmap = __pDividerThumbBitmap; + pThumbBitmap = __pDividerThumbBitmap; - if (point.x <= __pSplitPanel->GetBounds().width - pThumbBitmap->GetWidth()) + if (point.x <= __pSplitPanel->GetBoundsF().width - pThumbBitmap->GetWidthF()) { __pSplitPanel->SetDividerPosition(point.x); } @@ -210,9 +221,9 @@ _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& tou return false; } - Bitmap* pThumbBitmap = __pDividerThumbBitmap; + pThumbBitmap = __pDividerThumbBitmap; - if (point.y <= __pSplitPanel->GetBounds().height - pThumbBitmap->GetHeight()) + if (point.y <= __pSplitPanel->GetBoundsF().height - pThumbBitmap->GetHeightF()) { __pSplitPanel->SetDividerPosition(point.y); } @@ -270,7 +281,7 @@ _SplitPanelPresenter::GetDividerStyle(void) const return __pSplitPanelModel->GetDividerStyle(); } -Rectangle +FloatRectangle _SplitPanelPresenter::GetDividerRectangle(void) const { return __dividerRectangle; @@ -414,6 +425,9 @@ _SplitPanelPresenter::Draw(void) { if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED) { + FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f); + //adjust divider rectangle AdjustDividerRectangle(); @@ -425,9 +439,9 @@ _SplitPanelPresenter::Draw(void) //resize pane SetPaneBounds(); - Rectangle dividerBounds = __dividerRectangle; - dividerBounds.x = 0; - dividerBounds.y = 0; + dividerBounds = __dividerRectangle; + dividerBounds.x = 0.0f; + dividerBounds.y = 0.0f; if (__splitPanelDividerPressed == true) { @@ -444,14 +458,14 @@ _SplitPanelPresenter::Draw(void) //draw divider thumb if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) { - Rectangle dividerThumbBounds = __dividerThumbRectangle; + dividerThumbBounds = __dividerThumbRectangle; if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - dividerThumbBounds.x = 0; + dividerThumbBounds.x = 0.0f; } else { - dividerThumbBounds.y = 0; + dividerThumbBounds.y = 0.0f; } pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap); @@ -549,16 +563,20 @@ result _SplitPanelPresenter::SetPaneBounds(void) { result r = E_SUCCESS; - Rectangle firstPaneBounds(0, 0, 0, 0); - Rectangle secondPaneBounds(0, 0, 0, 0); + FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatPoint panePostion(0.0f, 0.0f); + _Control* pFirstPane = null; + _Control* pSecondPane = null; - Rectangle clientBounds = __pSplitPanel->GetBounds(); + clientBounds = __pSplitPanel->GetBoundsF(); - _Control* pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST); + pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST); - _Control* pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND); + pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND); - clientBounds.x = clientBounds.y = 0; + clientBounds.x = clientBounds.y = 0.0f; if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST)) { @@ -566,11 +584,11 @@ _SplitPanelPresenter::SetPaneBounds(void) if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - secondPaneBounds = Rectangle(clientBounds.width + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height); + secondPaneBounds = FloatRectangle(clientBounds.width + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height); } else { - secondPaneBounds = Rectangle(0, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); + secondPaneBounds = FloatRectangle(0.0f, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); } } else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND)) @@ -579,59 +597,56 @@ _SplitPanelPresenter::SetPaneBounds(void) if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - firstPaneBounds = Rectangle(clientBounds.x -__dividerRectangle.x - __dividerRectangle.width, 0, __dividerRectangle.x, clientBounds.height); + firstPaneBounds = FloatRectangle(clientBounds.x -__dividerRectangle.x - __dividerRectangle.width, 0.0f, __dividerRectangle.x, clientBounds.height); } else { - firstPaneBounds = Rectangle(0, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y); + firstPaneBounds = FloatRectangle(0.0f, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y); } } else { if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - firstPaneBounds = Rectangle(0, 0, __dividerRectangle.x, clientBounds.height); - secondPaneBounds = Rectangle(__dividerRectangle.x + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height); + firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height); + secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height); } else { - firstPaneBounds = Rectangle(0, 0, clientBounds.width, __dividerRectangle.y); - secondPaneBounds = Rectangle(0, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); + firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y); + secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); } } - bool movable = true; - bool resizable = true; - //set Pane bounds if (pFirstPane != null) { - movable = pFirstPane->IsMovable(); - resizable = pFirstPane->IsResizable(); - - pFirstPane->SetMovable(true); - pFirstPane->SetResizable(true); - r = pFirstPane->SetBounds(firstPaneBounds); - SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - pFirstPane->SetMovable(movable); - pFirstPane->SetResizable(resizable); + if (r != E_SUCCESS) + { + panePostion.x = firstPaneBounds.x; + panePostion.y = firstPaneBounds.y; + + r = pFirstPane->SetPosition(panePostion); + } + + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); } if (pSecondPane != null) { - movable = pSecondPane->IsMovable(); - resizable = pSecondPane->IsResizable(); + r = pSecondPane->SetBounds(secondPaneBounds); - pSecondPane->SetMovable(true); - pSecondPane->SetResizable(true); + if (r != E_SUCCESS) + { + panePostion.x = secondPaneBounds.x; + panePostion.y = secondPaneBounds.y; - r = pSecondPane->SetBounds(secondPaneBounds); + r = pSecondPane->SetPosition(panePostion); + } + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - - pSecondPane->SetMovable(movable); - pSecondPane->SetResizable(resizable); } if ((pFirstPane != null) && (pSecondPane != null)) @@ -649,18 +664,21 @@ _SplitPanelPresenter::SetPaneBounds(void) void _SplitPanelPresenter::AdjustDividerRectangle(void) { - int dividerPosition = __pSplitPanel->GetDividerPosition(); - // Check - Divider Postion. ( Screen Size Over / Maximum Divider Position ) + float dividerPosition = 0.0f; + float width = 0.0f; + float height = 0.0f; + FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f); + _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; + Bitmap* pThumbBitmap = null; - Rectangle clientBounds = __pSplitPanel->GetBounds(); - int width = 0; - int height = 0; + orientation = _ControlManager::GetInstance()->GetOrientation(); - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + dividerPosition = __pSplitPanel->GetDividerPosition(); + clientBounds = __pSplitPanel->GetBoundsF(); if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - Bitmap* pThumbBitmap = __pDividerThumbBitmap; + pThumbBitmap = __pDividerThumbBitmap; if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) { @@ -675,15 +693,13 @@ _SplitPanelPresenter::AdjustDividerRectangle(void) if (height > 0) { - __dividerRectangle = Rectangle(dividerPosition, 0, width, height); - __dividerThumbRectangle = Rectangle(dividerPosition, ((height - pThumbBitmap->GetHeight()) / 2), pThumbBitmap->GetWidth(), pThumbBitmap->GetHeight()); + __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height); + __dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF()); } } else { - Bitmap* pThumbBitmap = __pDividerThumbBitmap; - - width = clientBounds.width; + pThumbBitmap = __pDividerThumbBitmap; if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) { @@ -694,10 +710,12 @@ _SplitPanelPresenter::AdjustDividerRectangle(void) GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height); } - if (width > 0) + width = clientBounds.width; + + if (width > 0.0f) { - __dividerRectangle = Rectangle(0, dividerPosition, width, height); - __dividerThumbRectangle = Rectangle(((width - pThumbBitmap->GetWidth()) / 2), dividerPosition, pThumbBitmap->GetWidth(), pThumbBitmap->GetHeight()); + __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height); + __dividerThumbRectangle = FloatRectangle(((width - pThumbBitmap->GetWidth()) / 2.0f), dividerPosition, pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF()); } } @@ -708,10 +726,12 @@ void _SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder) { result r = E_SUCCESS; + _Control* pFirstPane = null; + _Control* pSecondPane = null; if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST) { - _Control* pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST); + pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST); SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); r = __pSplitPanel->DetachChild(*pFirstPane); @@ -722,7 +742,7 @@ _SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder) } else { - _Control* pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND); + pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND); SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r)); r = __pSplitPanel->DetachChild(*pSecondPane); @@ -739,15 +759,24 @@ result _SplitPanelPresenter::AnimateDivider(int destination) { result r = E_SUCCESS; + FloatRectangle dividerBoundsStart(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle dividerBoundsEnd(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle dividerBounds(0, 0, 0, 0); + FloatRectangle clientBounds(0, 0, 0, 0); + FloatRectangle firstPaneBounds(0, 0, 0, 0); + Control* pFirstPanelControl = null; + VisualElement* pVisualElementDivider = null; + VisualElementPropertyAnimation* pAnimationDivider = null; - FloatRectangle dividerBoundsStartF(0.0f, 0.0f, 0.0f, 0.0f); - FloatRectangle dividerBoundsEndF(0.0f, 0.0f, 0.0f, 0.0f); + const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator); + r = GetLastResult(); + SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating."); - Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST); + pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating."); - VisualElement* pVisualElementDivider = __pSplitPanel->GetDividerVisualElement(); + pVisualElementDivider = __pSplitPanel->GetDividerVisualElement(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating."); @@ -755,15 +784,7 @@ _SplitPanelPresenter::AnimateDivider(int destination) r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - FloatRectangle dividerBoundsF = pVisualElementDivider->GetBounds(); - Rectangle clientBounds = __pSplitPanel->GetBounds(); - Rectangle firstPaneBounds = pFirstPanelControl->GetBounds(); - - const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator); - r = GetLastResult(); - SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating."); - - VisualElementPropertyAnimation* pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation(); + pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation(); SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.") r = pAnimationDivider->SetPropertyName(L"bounds"); @@ -776,87 +797,86 @@ _SplitPanelPresenter::AnimateDivider(int destination) r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating."); - dividerBoundsF = pVisualElementDivider->GetBounds(); - dividerBoundsStartF = dividerBoundsF; + dividerBounds = pVisualElementDivider->GetBounds(); + clientBounds = __pSplitPanel->GetBoundsF(); + firstPaneBounds = pFirstPanelControl->GetBoundsF(); + dividerBoundsStart = dividerBounds; - clientBounds.x = clientBounds.y = 0; + clientBounds.x = clientBounds.y = 0.0f; switch (destination) { case _SPLIT_PANEL_ANIMATION_RIGHT: { - dividerBoundsStartF.x = firstPaneBounds.x + firstPaneBounds.width; + dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width; - dividerBoundsEndF = dividerBoundsF; - dividerBoundsEndF.x = (float)clientBounds.width; + dividerBoundsEnd = dividerBounds; + dividerBoundsEnd.x = clientBounds.width; } break; case _SPLIT_PANEL_ANIMATION_LEFT: { - dividerBoundsStartF.x = firstPaneBounds.x + firstPaneBounds.width; + dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width; - dividerBoundsEndF = dividerBoundsF; - dividerBoundsEndF.x = (float)clientBounds.x - dividerBoundsF.width; + dividerBoundsEnd = dividerBounds; + dividerBoundsEnd.x = clientBounds.x - dividerBounds.width; } break; case _SPLIT_PANEL_ANIMATION_TOP: { - dividerBoundsStartF.y = firstPaneBounds.y + firstPaneBounds.height; + dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height; - dividerBoundsEndF = dividerBoundsF; - dividerBoundsEndF.y = (float)clientBounds.y - dividerBoundsF.height; + dividerBoundsEnd = dividerBounds; + dividerBoundsEnd.y = clientBounds.y - dividerBounds.height; } break; case _SPLIT_PANEL_ANIMATION_BOTTOM: { - dividerBoundsStartF.y = firstPaneBounds.y + firstPaneBounds.height; + dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height; - dividerBoundsEndF = dividerBoundsF; - dividerBoundsEndF.y = (float)clientBounds.height; + dividerBoundsEnd = dividerBounds; + dividerBoundsEnd.y = clientBounds.height; } break; case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL: { - dividerBoundsF = FloatRectangle((float)__dividerRectangle.x, (float)__dividerRectangle.y, - (float)__dividerRectangle.width, (float)__dividerRectangle.height); + dividerBounds = __dividerRectangle; - dividerBoundsStartF = dividerBoundsF; - dividerBoundsEndF = dividerBoundsF; + dividerBoundsStart = dividerBounds; + dividerBoundsEnd = dividerBounds; if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST) { - dividerBoundsStartF.y = (float)clientBounds.height; + dividerBoundsStart.y = clientBounds.height; } else { - dividerBoundsStartF.y = (float)clientBounds.y - dividerBoundsF.height; + dividerBoundsStart.y = clientBounds.y - dividerBounds.height; } } break; case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL: { - dividerBoundsF = FloatRectangle((float)__dividerRectangle.x, (float)__dividerRectangle.y, - (float)__dividerRectangle.width, (float)__dividerRectangle.height); + dividerBounds = __dividerRectangle; - dividerBoundsStartF = dividerBoundsF; - dividerBoundsEndF = dividerBoundsF; + dividerBoundsStart = dividerBoundsEnd = dividerBounds; if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST) { - dividerBoundsStartF.x = (float)clientBounds.width; + dividerBoundsStart.x = clientBounds.width; } else { - dividerBoundsStartF.x = (float)clientBounds.x - dividerBoundsF.width; + dividerBoundsStart.x = clientBounds.x - dividerBounds.width; } } break; } - r = pAnimationDivider->SetStartValue(dividerBoundsStartF); + r = pAnimationDivider->SetStartValue(dividerBoundsStart); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating."); - r = pAnimationDivider->SetEndValue(dividerBoundsEndF); + r = pAnimationDivider->SetEndValue(dividerBoundsEnd); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating."); pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider); @@ -874,38 +894,48 @@ result _SplitPanelPresenter::AnimatePane(int destination) { result r = E_SUCCESS; + Rectangle clientBounds(0, 0, 0, 0); + Rectangle firstPaneBounds(0, 0, 0, 0); + Rectangle secondPaneBounds(0, 0, 0, 0); + Rectangle dividerRectangle(0, 0, 0, 0); + Control* pFirstPanelControl = null; + Control* pSecondPanelControl = null; + ControlAnimator* pControlAnimatorFirstPane = null; + ControlAnimator* pControlAnimatorSecondPane = null; - Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST); + FloatAnimation animationHidePane = FloatAnimation(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); + FloatAnimation animationShowPane = FloatAnimation(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); + + pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating."); - Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND); + pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating."); - ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator(); + pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating."); - ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator(); + pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator(); r = GetLastResult(); SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating."); - Rectangle clientBounds = __pSplitPanel->GetBounds(); - Rectangle firstPaneBounds = pFirstPanelControl->GetBounds(); - Rectangle secondPaneBounds = pSecondPanelControl->GetBounds(); - - FloatAnimation animationHidePane(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); - FloatAnimation animationShowPane(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); + clientBounds = __pSplitPanel->GetBounds(); + firstPaneBounds = pFirstPanelControl->GetBounds(); + secondPaneBounds = pSecondPanelControl->GetBounds(); clientBounds.x = clientBounds.y = 0; + dividerRectangle = _CoordinateSystemUtils::ConvertToInteger(__dividerRectangle); + switch (destination) { case _SPLIT_PANEL_ANIMATION_RIGHT: { Rectangle secondPaneEndBounds = secondPaneBounds; - secondPaneEndBounds.x = clientBounds.x + clientBounds.width + __dividerRectangle.width; + secondPaneEndBounds.x = clientBounds.x + clientBounds.width + dividerRectangle.width; RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -932,7 +962,7 @@ _SplitPanelPresenter::AnimatePane(int destination) case _SPLIT_PANEL_ANIMATION_LEFT: { Rectangle firstPaneEndBounds = firstPaneBounds; - firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - __dividerRectangle.width; + firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - dividerRectangle.width; RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -959,7 +989,7 @@ _SplitPanelPresenter::AnimatePane(int destination) case _SPLIT_PANEL_ANIMATION_TOP: { Rectangle firstPaneEndBounds = firstPaneBounds; - firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - __dividerRectangle.height; + firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - dividerRectangle.height; RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -986,7 +1016,7 @@ _SplitPanelPresenter::AnimatePane(int destination) case _SPLIT_PANEL_ANIMATION_BOTTOM: { Rectangle secondPaneEndBounds = secondPaneBounds; - secondPaneEndBounds.y = clientBounds.y + clientBounds.height + __dividerRectangle.height; + secondPaneEndBounds.y = clientBounds.y + clientBounds.height + dividerRectangle.height; RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -1012,8 +1042,8 @@ _SplitPanelPresenter::AnimatePane(int destination) break; case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL: { - Rectangle firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST); - Rectangle secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND); + Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST)); + Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND)); RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -1046,8 +1076,8 @@ _SplitPanelPresenter::AnimatePane(int destination) break; case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL: { - Rectangle firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST); - Rectangle secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND); + Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST)); + Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND)); RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator); @@ -1086,15 +1116,19 @@ _SplitPanelPresenter::AnimatePane(int destination) Control* _SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder) { - _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(__pSplitPanel->GetUserData()); + _ControlImpl* pControlImpl = null; + _SplitPanelImpl* pSplitPanelImpl = null; + Control* pControl = null; + + pControlImpl = static_cast<_ControlImpl*>(__pSplitPanel->GetUserData()); SysTryReturn(NID_UI_CTRL, pControlImpl != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. _ControlImpl is null."); - _SplitPanelImpl* pSplitPanelImpl = dynamic_cast<_SplitPanelImpl*>(pControlImpl); + pSplitPanelImpl = dynamic_cast<_SplitPanelImpl*>(pControlImpl); SysTryReturn(NID_UI_CTRL, pSplitPanelImpl != null, null, E_SYSTEM, "[E_SYSTEM]A system error has occurred. _SplitPanelImpl is null."); SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic(); - Control* pControl = splitPanelPublic.GetPane(paneOrder); + pControl = splitPanelPublic.GetPane(paneOrder); SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); return pControl; @@ -1129,18 +1163,18 @@ _SplitPanelPresenter::GetAnimationStatus(void) return ANIMATOR_STATUS_PLAYING; } -Rectangle +FloatRectangle _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder) { - int width = 0; - int height = 0; + float width = 0.0f; + float height = 0.0f; - Rectangle firstPaneBounds(0, 0, 0, 0); - Rectangle secondPaneBounds(0, 0, 0, 0); + FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f); - int dividerPosition = __pSplitPanel->GetDividerPosition(); + float dividerPosition = __pSplitPanel->GetDividerPosition(); - Rectangle clientBounds = __pSplitPanel->GetBounds(); + FloatRectangle clientBounds = __pSplitPanel->GetBoundsF(); _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); @@ -1157,15 +1191,13 @@ _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder) height = clientBounds.height; - if (height > 0) + if (height > 0.0f) { - __dividerRectangle = Rectangle(dividerPosition, 0, width, height); + __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height); } } else { - width = clientBounds.width; - if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE) { GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height); @@ -1175,21 +1207,23 @@ _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder) GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height); } - if (width > 0) + width = clientBounds.width; + + if (width > 0.0f) { - __dividerRectangle = Rectangle(0, dividerPosition, width, height); + __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height); } } if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) { - firstPaneBounds = Rectangle(0, 0, __dividerRectangle.x, clientBounds.height); - secondPaneBounds = Rectangle(__dividerRectangle.x + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height); + firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height); + secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height); } else { - firstPaneBounds = Rectangle(0, 0, clientBounds.width, __dividerRectangle.y); - secondPaneBounds = Rectangle(0, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); + firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y); + secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height); } if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST) diff --git a/src/ui/controls/FUiCtrl_Tab.cpp b/src/ui/controls/FUiCtrl_Tab.cpp index 44de206..d21fb9c 100644 --- a/src/ui/controls/FUiCtrl_Tab.cpp +++ b/src/ui/controls/FUiCtrl_Tab.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Tab.cpp * @brief This is the implementation file for the _Tab class. @@ -28,6 +29,7 @@ #include "FUi_AccessibilityElement.h" #include "FUi_TouchLongPressGestureDetector.h" #include "FUiCtrl_Tab.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -43,7 +45,9 @@ _Tab::_Tab(void) , __pGestureLongPress(null) , __pFlickGesture(null) , __pBackgroundBitmap(null) + , __pDisabledBackgroundBitmap(null) , __pPressedItemBackgroundBitmap(null) + , __pPressedItemBackgroundEffectBitmap(null) , __pSelectedItemBackgroundBitmap(null) , __pHighlightedItemBackgroundBitmap(null) { @@ -118,12 +122,24 @@ _Tab::~_Tab(void) __pBackgroundBitmap = null; } + if (__pDisabledBackgroundBitmap) + { + delete __pDisabledBackgroundBitmap; + __pDisabledBackgroundBitmap = null; + } + if (__pPressedItemBackgroundBitmap) { delete __pPressedItemBackgroundBitmap; __pPressedItemBackgroundBitmap = null; } + if (__pPressedItemBackgroundEffectBitmap) + { + delete __pPressedItemBackgroundEffectBitmap; + __pPressedItemBackgroundEffectBitmap = null; + } + if (__pSelectedItemBackgroundBitmap) { delete __pSelectedItemBackgroundBitmap; @@ -244,7 +260,7 @@ _Tab::AddItem(const Bitmap& icon, const String& text, int actionId) pItem->SetStatus(_TABITEM_STATUS_SELECTED); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); return __tabItems.Add(*pItem); } @@ -286,7 +302,7 @@ _Tab::AddItem(const Bitmap& icon, int actionId) pItem->SetStatus(_TABITEM_STATUS_SELECTED); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); return __tabItems.Add(*pItem); } @@ -328,7 +344,7 @@ _Tab::AddItem(const String& text, int actionId) pItem->SetStatus(_TABITEM_STATUS_SELECTED); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); return __tabItems.Add(*pItem); @@ -338,7 +354,7 @@ result _Tab::InsertItemAt(int index, const Bitmap& icon, const String& text, int actionId) { result r = E_SUCCESS; - bool selected = false; + bool isSelected = false; if (actionId < _TAB_ACTION_ID_MIN || actionId > _TAB_ACTION_ID_MAX) { @@ -368,15 +384,15 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, const String& text, int action pItem->SetActionId(actionId); pItem->SetUpdateState(true); - int i = GetSelectedItemIndex(); + int selectedIndex = GetSelectedItemIndex(); - if (i >= index) + if (selectedIndex >= index) { _TabItem *pSelectedItem = null; - pSelectedItem = GetItemAt(i); + pSelectedItem = GetItemAt(selectedIndex); if (pSelectedItem != null) { - selected = true; + isSelected = true; pSelectedItem->SetStatus(_TABITEM_STATUS_NORMAL); } } @@ -385,13 +401,13 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, const String& text, int action pItem->SetStatus(_TABITEM_STATUS_NORMAL); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); r = __tabItems.InsertAt(*pItem, index); - if (selected) + if (isSelected) { - SetSelectedItemIndex(i); + SetSelectedItemIndex(selectedIndex); } return r; @@ -401,7 +417,7 @@ result _Tab::InsertItemAt(int index, const Bitmap& icon, int actionId) { result r = E_SUCCESS; - bool selected = false; + bool isSelected = false; if (actionId < _TAB_ACTION_ID_MIN || actionId > _TAB_ACTION_ID_MAX) { @@ -427,15 +443,15 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, int actionId) pItem->SetIcon(icon); pItem->SetActionId(actionId); pItem->SetUpdateState(true); - int i = GetSelectedItemIndex(); + int selectedIndex = GetSelectedItemIndex(); - if (i >= index) + if (selectedIndex >= index) { _TabItem *pSelectedItem = null; - pSelectedItem = GetItemAt(i); + pSelectedItem = GetItemAt(selectedIndex); if (pSelectedItem != null) { - selected = true; + isSelected = true; pSelectedItem->SetStatus(_TABITEM_STATUS_NORMAL); } } @@ -444,13 +460,13 @@ _Tab::InsertItemAt(int index, const Bitmap& icon, int actionId) pItem->SetStatus(_TABITEM_STATUS_NORMAL); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); r = __tabItems.InsertAt(*pItem, index); - if (selected) + if (isSelected) { - SetSelectedItemIndex(i); + SetSelectedItemIndex(selectedIndex); } return r; @@ -460,7 +476,7 @@ result _Tab::InsertItemAt(int index, const String& text, int actionId) { result r = E_SUCCESS; - bool selected = false; + bool isSelected = false; if (actionId < _TAB_ACTION_ID_MIN || actionId > _TAB_ACTION_ID_MAX) { @@ -486,15 +502,15 @@ _Tab::InsertItemAt(int index, const String& text, int actionId) pItem->SetText(text); pItem->SetActionId(actionId); pItem->SetUpdateState(true); - int i = GetSelectedItemIndex(); + int selectedIndex = GetSelectedItemIndex(); - if (i >= index) + if (selectedIndex >= index) { _TabItem *pSelectedItem = null; - pSelectedItem = GetItemAt(i); + pSelectedItem = GetItemAt(selectedIndex); if (pSelectedItem != null) { - selected = true; + isSelected = true; pSelectedItem->SetStatus(_TABITEM_STATUS_NORMAL); } } @@ -503,13 +519,13 @@ _Tab::InsertItemAt(int index, const String& text, int actionId) pItem->SetStatus(_TABITEM_STATUS_NORMAL); } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); r = __tabItems.InsertAt(*pItem, index); - if (selected) + if (isSelected) { - SetSelectedItemIndex(i); + SetSelectedItemIndex(selectedIndex); } return r; @@ -639,18 +655,18 @@ result _Tab::RemoveItemAt(int index) { result r = E_SUCCESS; - int i = GetSelectedItemIndex(); + int selectedIndex = GetSelectedItemIndex(); - if (i >= index) + if (selectedIndex >= index) { _TabItem *pSelectedItem = null; - pSelectedItem = GetItemAt(i); + pSelectedItem = GetItemAt(selectedIndex); if (pSelectedItem != null) { pSelectedItem->SetStatus(_TABITEM_STATUS_NORMAL); } } - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); r = __tabItems.RemoveAt(index, true); @@ -662,7 +678,7 @@ _Tab::RemoveItemAt(int index) result _Tab::RemoveAllItems(void) { - __pTabPresenter->SetReCalculateItemBounds(true); + __pTabPresenter->SetRecalculateItemBounds(true); SetSelectedItemIndex(0); SetFirstDrawnItemIndex(-1); @@ -728,23 +744,79 @@ result _Tab::LoadBitmap(void) { result r = E_SUCCESS; + Bitmap* pPressedItemBackgroundBitmap = null; + Bitmap* pItemBackgroundBitmap = null; + Bitmap* pDisabledBackgroundBitmap = null; + Bitmap* pSelectedItemBackgroundBitmap = null; + Bitmap* pPressedItemBackgroundEffectBitmap = null; + Bitmap* pHighlightedItemBackgroundBitmap = null; + Color pressedEffectColor; + GET_COLOR_CONFIG(TAB::ITEM_BG_EFFECT_PRESSED, pressedEffectColor); + + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledBackgroundBitmap); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate disabled item background bitmap."); + + if (pDisabledBackgroundBitmap) + { + __pDisabledBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDisabledBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetDisabledItemBackgroundColor()); + SysTryLog(NID_UI_CTRL, (__pDisabledBackgroundBitmap != null), "Failed to locate disabled item background bitmap."); - r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pPressedItemBackgroundBitmap); + delete pDisabledBackgroundBitmap; + } + + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pItemBackgroundBitmap); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate item background bitmap."); + + if (pItemBackgroundBitmap) + { + __pBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetItemBackgroundColor()); + SysTryLog(NID_UI_CTRL, (__pBackgroundBitmap != null), "Failed to locate item background bitmap."); + + delete pItemBackgroundBitmap; + } + + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedItemBackgroundBitmap); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate pressed item background bitmap."); - if (__pPressedItemBackgroundBitmap) + if (pPressedItemBackgroundBitmap) { - __pPressedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(__pPressedItemBackgroundBitmap), Color::GetColor(COLOR_ID_MAGENTA), GetPressedItemBackgroundColor()); - SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate pressed item background bitmap."); + __pPressedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetPressedItemBackgroundColor()); + SysTryLog(NID_UI_CTRL, (__pPressedItemBackgroundBitmap != null), "Failed to locate pressed item background bitmap."); + + delete pPressedItemBackgroundBitmap; } - r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHighlightedItemBackgroundBitmap); + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedItemBackgroundBitmap); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate selected item background bitmap."); + + if (pSelectedItemBackgroundBitmap) + { + __pSelectedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetSelectedItemBackgroundColor()); + SysTryLog(NID_UI_CTRL, (__pSelectedItemBackgroundBitmap != null), "Failed to locate selected item background bitmap."); + + delete pSelectedItemBackgroundBitmap; + } + + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedItemBackgroundEffectBitmap); + SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate selected item background bitmap."); + + if (pPressedItemBackgroundEffectBitmap) + { + __pPressedItemBackgroundEffectBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedItemBackgroundEffectBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedEffectColor); + SysTryLog(NID_UI_CTRL, (__pPressedItemBackgroundEffectBitmap != null), "Failed to locate selected item background bitmap."); + + delete pPressedItemBackgroundEffectBitmap; + } + + r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pHighlightedItemBackgroundBitmap); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate highlighted item background bitmap."); - if (__pHighlightedItemBackgroundBitmap) + if (pHighlightedItemBackgroundBitmap) { - __pHighlightedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(__pHighlightedItemBackgroundBitmap), Color::GetColor(COLOR_ID_MAGENTA), GetHighlightedItemBackgroundColor()); - SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate highlighted item background bitmap."); + __pHighlightedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetHighlightedItemBackgroundColor()); + SysTryLog(NID_UI_CTRL, (__pHighlightedItemBackgroundBitmap != null), "Failed to locate highlighted item background bitmap."); + + delete pHighlightedItemBackgroundBitmap; } return r; } @@ -872,9 +944,9 @@ _Tab::GetFirstDrawnItemIndex(void) const } void -_Tab::SetEditModeEnabled(bool enable) +_Tab::SetEditModeEnabled(bool isEnabled) { - return __pTabPresenter->SetEditModeEnabled(enable); + return __pTabPresenter->SetEditModeEnabled(isEnabled); } bool @@ -900,6 +972,12 @@ _Tab::SetBackgroundBitmap(const Bitmap& bitmap) __pBackgroundBitmap = pBitmap; + if (__pDisabledBackgroundBitmap) + { + delete __pDisabledBackgroundBitmap; + __pDisabledBackgroundBitmap = null; + } + return E_SUCCESS; } @@ -909,24 +987,10 @@ _Tab::GetBackgroundBitmap(void) const return __pBackgroundBitmap; } - -result -_Tab::SetPressedItemBackgroundBitmap(const Bitmap& bitmap) +Bitmap* +_Tab::GetDisabledBackgroundBitmap(void) const { - ClearLastResult(); - - Tizen::Graphics::Bitmap* pBitmap = _BitmapImpl::CloneN(bitmap); - - SysTryReturn(NID_UI_CTRL, (pBitmap), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - if (__pPressedItemBackgroundBitmap) - { - delete __pPressedItemBackgroundBitmap; - __pPressedItemBackgroundBitmap = null; - } - - __pPressedItemBackgroundBitmap = pBitmap; - return E_SUCCESS; + return __pDisabledBackgroundBitmap; } Bitmap* @@ -935,6 +999,12 @@ _Tab::GetPressedItemBackgroundBitmap(void) const return __pPressedItemBackgroundBitmap; } +Bitmap* +_Tab::GetPressedItemBackgroundEffectBitmap(void) const +{ + return __pPressedItemBackgroundEffectBitmap; +} + result _Tab::SetSelectedItemBackgroundBitmap(const Bitmap& bitmap) { @@ -1001,13 +1071,6 @@ _Tab::GetItemBackgroundColor(void) const return __itemBgColor[_TAB_STATUS_NORMAL]; } -void -_Tab::SetPressedItemBackgroundColor(Color color) -{ - __itemBgColor[_TAB_STATUS_PRESSED] = color; - return; -} - Color _Tab::GetPressedItemBackgroundColor(void) const { @@ -1040,6 +1103,12 @@ _Tab::GetHighlightedItemBackgroundColor(void) const return __itemBgColor[_TAB_STATUS_HIGHLIGHTED]; } +Color +_Tab::GetDisabledItemBackgroundColor(void) const +{ + return __itemBgColor[_TAB_STATUS_DISABLED]; +} + void _Tab::SetTextColor(const Color& textColor) { @@ -1053,6 +1122,12 @@ _Tab::GetTextColor(void) const return __itemTextColor[_TAB_STATUS_NORMAL]; } +Color +_Tab::GetDisabledTextColor(void) const +{ + return __itemTextColor[_TAB_STATUS_DISABLED]; +} + void _Tab::SetPressedTextColor(const Color& textColor) { @@ -1155,7 +1230,7 @@ _Tab::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) __pTabPresenter->OnTouchReleased(source, touchinfo); - int index = __pTabPresenter->GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + int index = __pTabPresenter->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition())); _TabItem* pItem = __pTabPresenter->GetItemAt(index); @@ -1274,7 +1349,7 @@ _Tab::AddAccessibilityElement(const Rectangle& itemBounds, const String& itemTex _AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_TAB); + pAccessibilityElement->SetTrait(L"Tab"); pAccessibilityElement->SetHint(L"Double tap to move to contents"); pAccessibilityElement->SetBounds(itemBounds); @@ -1286,10 +1361,12 @@ _Tab::AddAccessibilityElement(const Rectangle& itemBounds, const String& itemTex if (status == _TABITEM_STATUS_SELECTED) { pAccessibilityElement->SetStatus("Selected"); + pAccessibilityElement->SetHintDisabled(true); } else { pAccessibilityElement->SetStatus(""); + pAccessibilityElement->SetHintDisabled(false); } pContainer->AddElement(*pAccessibilityElement); @@ -1332,6 +1409,14 @@ _Tab::RemoveAllAccessibilityElement(void) return; } +void +_Tab::OnChangeLayout(_ControlOrientation orientation) +{ + __pTabPresenter->OnChangeLayout(orientation); + + return; +} + bool _Tab::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) { @@ -1349,7 +1434,12 @@ _Tab::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, } bool -_Tab::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_Tab::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} +bool +_Tab::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } diff --git a/src/ui/controls/FUiCtrl_TabBar.cpp b/src/ui/controls/FUiCtrl_TabBar.cpp index f4e1868..a7c4a8b 100644 --- a/src/ui/controls/FUiCtrl_TabBar.cpp +++ b/src/ui/controls/FUiCtrl_TabBar.cpp @@ -22,10 +22,12 @@ #include #include -#include "FUi_UiTouchEvent.h" -#include "FUi_ResourceManager.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_ResourceManager.h" +#include "FUi_UiTouchEvent.h" + #include "FUiCtrl_TabBar.h" using namespace Tizen::Base; @@ -44,12 +46,12 @@ _TabBar::_TabBar() GET_COLOR_CONFIG(TABBAR::BG_NORMAL, __color); GET_COLOR_CONFIG(TABBAR::ITEM_BG_NORMAL, __itemColor[ITEM_STATUS_NORMAL]); - GET_COLOR_CONFIG(TABBAR::ITEM_BG_PRESSED, __itemColor[ITEM_STATUS_SELECTED]); - GET_COLOR_CONFIG(TABBAR::ITEM_BG_HIGHLIGHTED, __itemColor[ITEM_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(TABBAR::ITEM_BG_SELECTED, __itemColor[ITEM_STATUS_SELECTED]); + GET_COLOR_CONFIG(TABBAR::ITEM_BG_PRESSED, __itemColor[ITEM_STATUS_HIGHLIGHTED]); GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_NORMAL, __itemTextColor[ITEM_STATUS_NORMAL]); - GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_PRESSED, __itemTextColor[ITEM_STATUS_SELECTED]); - GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_HIGHLIGHTED, __itemTextColor[ITEM_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_SELECTED, __itemTextColor[ITEM_STATUS_SELECTED]); + GET_COLOR_CONFIG(TABBAR::ITEM_TEXT_PRESSED, __itemTextColor[ITEM_STATUS_HIGHLIGHTED]); } _TabBar::~_TabBar(void) @@ -76,11 +78,12 @@ _TabBar::CreateTabBarN(void) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Initialize.", GetErrorMessage(r)); pTabBar->AcquireHandle(); - pTabBar->SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_NORMAL); + pTabBar->SetTouchPressThreshold(0.08f); if (pTabBar->GetAccessibilityContainer() != null) { pTabBar->GetAccessibilityContainer()->Activate(true); + pTabBar->GetAccessibilityContainer()->AddListener(*pTabBar); } return pTabBar; @@ -94,12 +97,10 @@ CATCH: result _TabBar::Initialize(void) { - result r; - _TabBarPresenter* pTabBarPresenter = new (std::nothrow) _TabBarPresenter(*this); SysTryReturn(NID_UI_CTRL, pTabBarPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - r = pTabBarPresenter->Construct(); + result r = pTabBarPresenter->Construct(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = SetPresenter(*pTabBarPresenter); @@ -408,7 +409,7 @@ _TabBar::GetItemCount(void) const } _TabBarItem* -_TabBar::GetItemFromPosition(const Tizen::Graphics::Point& position) const +_TabBar::GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const { return __pTabBarPresenter->GetItemFromPosition(position); } @@ -420,13 +421,12 @@ _TabBar::SetTopDrawnItemIndex(int index) } result -_TabBar::SetWidth(int width) +_TabBar::SetWidth(float width) { - result r; - int height = 0; - + float height = 0.0f; GET_SHAPE_CONFIG(TABBAR::HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); - r = SetSize(Dimension(width, height)); + + result r = SetSize(FloatDimension(width, height)); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __pTabBarPresenter->InitItemPositionX(); @@ -473,9 +473,11 @@ bool _TabBar::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { bool eventFire = __pTabBarPresenter->OnTouchReleased(source, touchinfo); + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + if (eventFire == true) { - int index = __pTabBarPresenter->GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + int index = __pTabBarPresenter->GetItemIndexFromPosition(touchPosition); _TabBarItem* pItem = __pTabBarPresenter->GetItemAt(index); if (pItem != null) { @@ -484,6 +486,7 @@ _TabBar::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(pItem->GetActionId()); SysTryReturn(NID_UI_CTRL, pEventArg != null, E_INVALID_STATE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); __pActionEvent->Fire(*pEventArg); } } @@ -505,7 +508,7 @@ _TabBar::OnFontChanged(Font * pFont) } void -_TabBar::OnFontInfoRequested(unsigned long& style, int& size) +_TabBar::OnFontInfoRequested(unsigned long& style, float& size) { __pTabBarPresenter->OnFontInfoRequested(style, size); } @@ -548,7 +551,6 @@ _TabBar::AddAccessibilityElement(const _AccessibilityElement& element) void _TabBar::SetAllAccessibilityElement(void) { - RemoveAllAccessibilityElement(); __pTabBarPresenter->SetAllAccessibilityElement(); } @@ -566,4 +568,64 @@ _TabBar::RemoveAllAccessibilityElement(void) } } +bool +_TabBar::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityFocusMovedNext(control, element); +} + +bool +_TabBar::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityFocusMovedPrevious(control, element); +} + +bool +_TabBar::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityReadedElement(control, element); +} + +bool +_TabBar::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityReadingElement(control, element); +} + +bool +_TabBar::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityFocusIn(control, element); +} + +bool +_TabBar::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityFocusOut(control, element); +} + +bool +_TabBar::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityActionPerformed(control, element); +} + +bool +_TabBar::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityValueIncreased(control, element); +} + +bool +_TabBar::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pTabBarPresenter->OnAccessibilityValueDecreased(control, element); +} + +bool +_TabBar::OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction) +{ + return __pTabBarPresenter->OnAccessibilityItemRefreshed(control, element, direction); +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TabBarImpl.cpp b/src/ui/controls/FUiCtrl_TabBarImpl.cpp index a6927c2..3682f8d 100644 --- a/src/ui/controls/FUiCtrl_TabBarImpl.cpp +++ b/src/ui/controls/FUiCtrl_TabBarImpl.cpp @@ -15,8 +15,12 @@ // limitations under the License. // +#include +#include +#include #include "FUiCtrl_TabBarImpl.h" #include "FUiCtrl_TabBarItem.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" @@ -31,19 +35,6 @@ using namespace Tizen::Base::Runtime; namespace Tizen { namespace Ui { namespace Controls { -Tizen::Graphics::Dimension -_TabBarImpl::TabBarSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const -{ - result r = E_SUCCESS; - - Tizen::Graphics::Dimension dimension(0, 0); - - GET_SHAPE_CONFIG(TABBAR::MIN_WIDTH, orientation, dimension.width); - - SysTryReturn(NID_UI, r == E_SUCCESS, dimension, r, "[%s] System Error.", GetErrorMessage(r)); - return dimension; -} - _TabBarImpl* _TabBarImpl::GetInstance(TabBar& tabBar) { @@ -72,21 +63,15 @@ _TabBarImpl::~_TabBarImpl(void) } _TabBarImpl* -_TabBarImpl::CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::Rectangle& bounds) +_TabBarImpl::CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::FloatRectangle& bounds) { ClearLastResult(); - SysTryReturn(NID_UI_CTRL, bounds.width >= 0 && bounds.height >= 0, null, E_INVALID_ARG, "[E_INVALID_ARG] The specified width is smaller than minimum size."); + SysTryReturn(NID_UI_CTRL, bounds.width >= 0.0f && bounds.height >= 0.0f, null, E_INVALID_ARG, "[E_INVALID_ARG] The specified width is smaller than minimum size."); - int minWidth = 0; - int maxWidth = 0; - int height = 0; - GET_SHAPE_CONFIG(TABBAR::MIN_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, minWidth); - GET_SHAPE_CONFIG(TABBAR::MAX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, maxWidth); + float height = 0.0f; GET_SHAPE_CONFIG(TABBAR::HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); result r = E_SUCCESS; - //r = GET_SIZE_INFO(TabBar).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); - //SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The specified width is smaller than minimum size."); _TabBar* pCore = _TabBar::CreateTabBarN(); SysTryReturn(NID_UI_CTRL, pCore != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] _TabBar is not constructed."); @@ -95,13 +80,13 @@ _TabBarImpl::CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::Rectangle r = CheckConstruction(pCore, pImpl); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pImpl->SetBounds(Rectangle(bounds.x, bounds.y, bounds.width, height)); + r = pImpl->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, height)); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetBounds is failed.", GetErrorMessage(r)); - r = pImpl->SetMinimumSize(Dimension(minWidth, height)); + r = pImpl->SetMinimumSize(FloatDimension(pImpl->GetMinimumSizeF().width, height)); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetMinimumSize is failed.", GetErrorMessage(r)); - r = pImpl->SetMaximumSize(Dimension(maxWidth, height)); + r = pImpl->SetMaximumSize(FloatDimension(pImpl->GetMaximumSizeLimitF().width, height)); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] SetMaximumSize is failed.", GetErrorMessage(r)); return pImpl; @@ -230,7 +215,7 @@ _TabBarImpl::SetSelectedItemColor(const Tizen::Graphics::Color& color) } result -_TabBarImpl::SetWidth(int width) +_TabBarImpl::SetWidth(float width) { return GetCore().SetWidth(width); } @@ -413,6 +398,19 @@ protected: tabBarItem.Construct(elementString, actionId); } pTabBar->AddItem(tabBarItem); + + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pTabBar->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"Category" + Base::Integer::ToString(i+1)); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } } rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRect(); diff --git a/src/ui/controls/FUiCtrl_TabBarItem.cpp b/src/ui/controls/FUiCtrl_TabBarItem.cpp index 5deee4b..f54020b 100644 --- a/src/ui/controls/FUiCtrl_TabBarItem.cpp +++ b/src/ui/controls/FUiCtrl_TabBarItem.cpp @@ -24,8 +24,10 @@ #include #include "FUiCtrl_TabBarItem.h" #include "FUi_ResourceManager.h" +#include "FUi_AccessibilityElement.h" using namespace Tizen::Graphics; +using namespace Tizen::Ui; namespace Tizen { namespace Ui { namespace Controls { @@ -34,11 +36,12 @@ _TabBarItem::_TabBarItem(_ControlOrientation orientation) : __actionId(-1) , __text(L"") , __status(ITEM_STATUS_MAX) + , __pElement(null) { - __bounds.x = 0; + __bounds.x = 0.0f; + GET_SHAPE_CONFIG(TABBAR::TOP_MARGIN, orientation, __bounds.y); GET_SHAPE_CONFIG(TABBAR::ITEM_MIN_WIDTH, orientation, __bounds.width); - GET_SHAPE_CONFIG(TABBAR::ITEM_HEIGHT, orientation, __bounds.height); - GET_SHAPE_CONFIG(TABBAR::TOP_MARGIN, orientation, __bounds.y); + GET_SHAPE_CONFIG(TABBAR::ITEM_HEIGHT, orientation, __bounds.height); } @@ -62,22 +65,22 @@ _TabBarItem::GetActionId(void) const void _TabBarItem::SetText(const Tizen::Base::String& text, _ControlOrientation orientation) { - int fontSize = 0; + float fontSize = 0.0f; GET_SHAPE_CONFIG(TABBAR::FONT_SIZE, orientation, fontSize); - Dimension bounds(0, 0); + FloatDimension bounds(0.0f, 0.0f); - int minWidth = 0; - int maxWidth = 0; - int fontMargin = 0; + float minWidth = 0.0f; + float maxWidth = 0.0f; + float fontMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ITEM_MIN_WIDTH, orientation, minWidth); GET_SHAPE_CONFIG(TABBAR::ITEM_MAX_WIDTH, orientation, maxWidth); - GET_SHAPE_CONFIG(TABBAR::FONT_MARGIN, orientation, fontMargin); + GET_SHAPE_CONFIG(TABBAR::FONT_MARGIN, orientation, fontMargin); Font font; font.Construct(FONT_STYLE_BOLD, fontSize); font.GetTextExtent(text, text.GetLength(), bounds); - bounds.width += 2 * fontMargin; + bounds.width += 2.0f * fontMargin; __bounds.width = bounds.width; if (bounds.width < minWidth) @@ -112,15 +115,27 @@ _TabBarItem::GetStatus(void) const } void -_TabBarItem::SetBounds(const Tizen::Graphics::Rectangle& bounds) +_TabBarItem::SetBounds(const Tizen::Graphics::FloatRectangle& bounds) { __bounds = bounds; } -Tizen::Graphics::Rectangle +Tizen::Graphics::FloatRectangle _TabBarItem::GetBounds(void) const { return __bounds; } +void +_TabBarItem::SetAccessibilityElement(_AccessibilityElement* pElement) +{ + __pElement = pElement; +} + +_AccessibilityElement* +_TabBarItem::GetAccessibilityElement(void) +{ + return __pElement; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TabBarModel.cpp b/src/ui/controls/FUiCtrl_TabBarModel.cpp index cc9570b..4c2986c 100644 --- a/src/ui/controls/FUiCtrl_TabBarModel.cpp +++ b/src/ui/controls/FUiCtrl_TabBarModel.cpp @@ -32,7 +32,8 @@ namespace Tizen { namespace Ui { namespace Controls _TabBarModel::_TabBarModel(void) : __selectedItemIndex(0) , __firstDrawnItemIndex(0) - , __widthOfAllItems(0) + , __lastDrawnItemIndex(0) + , __widthOfAllItems(0.0f) { __tabBarItems.Construct(); } @@ -66,13 +67,25 @@ _TabBarModel::GetFirstDrawnItemIndex(void) const return __firstDrawnItemIndex; } +void +_TabBarModel::SetLastDrawnItemIndex(int index) +{ + __lastDrawnItemIndex = index; +} + +int +_TabBarModel::GetLastDrawnItemIndex(void) const +{ + return __lastDrawnItemIndex; +} + int _TabBarModel::GetItemCount(void) const { return __tabBarItems.GetCount(); } -int +float _TabBarModel::GetWidthOfAllItems(void) const { return __widthOfAllItems; @@ -98,18 +111,18 @@ _TabBarModel::AddItem(const Tizen::Base::String& text, int actionId, _ControlOri } _TabBarItem* pPreviousItem = GetItemAt(itemCount - 1); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); if (pPreviousItem != null) { - Rectangle previousItemBounds = pPreviousItem->GetBounds(); - int itemMargin = 0; + FloatRectangle previousItemBounds = pPreviousItem->GetBounds(); + float itemMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin); itemBounds.x = previousItemBounds.x + previousItemBounds.width + itemMargin; __widthOfAllItems += itemMargin; } else { - int arrowMargin = 0; + float arrowMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ARROW_MARGIN, orientation, arrowMargin); itemBounds.x += arrowMargin; } @@ -135,11 +148,11 @@ _TabBarModel::InsertItemAt(int index, const Tizen::Base::String& text, int actio pItem->SetActionId(actionId); _TabBarItem* pPreviousItem = GetItemAt(index - 1); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); if (pPreviousItem != null) { - Rectangle previousItemBounds = pPreviousItem->GetBounds(); - int itemMargin = 0; + FloatRectangle previousItemBounds = pPreviousItem->GetBounds(); + float itemMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin); itemBounds.x = previousItemBounds.x + previousItemBounds.width + itemMargin; pItem->SetBounds(itemBounds); @@ -175,7 +188,7 @@ _TabBarModel::RemoveItemAt(int index, _ControlOrientation orientation) _TabBarItem* pItem = static_cast <_TabBarItem*>(__tabBarItems.GetAt(index)); SysTryReturn(NID_UI_CTRL, pItem != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The %d index item is not exist.", index); - int itemMargin = 0; + float itemMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin); result r = __tabBarItems.RemoveAt(index, true); @@ -190,7 +203,7 @@ _TabBarModel::RemoveItemAt(int index, _ControlOrientation orientation) void _TabBarModel::RemoveAllItems(void) { - __widthOfAllItems = 0; + __widthOfAllItems = 0.0f; __tabBarItems.RemoveAll(true); } @@ -208,13 +221,13 @@ _TabBarModel::ReCalculateItemPosition(int itemIndex, _ControlOrientation orienta { SysTryReturn(NID_UI_CTRL, itemIndex >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The itemIndex(%d) is negative."); int itemCount = __tabBarItems.GetCount(); - int itemMargin = 0; + float itemMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::ITEM_MARGIN, orientation, itemMargin); _TabBarItem* pPreviousItem = null; _TabBarItem* pCurrentItem = null; - Rectangle previousItemBounds; - Rectangle currentItemBounds; + FloatRectangle previousItemBounds; + FloatRectangle currentItemBounds; for (int i = itemIndex; i < itemCount; i++) { pPreviousItem = GetItemAt(i - 1); @@ -225,7 +238,7 @@ _TabBarModel::ReCalculateItemPosition(int itemIndex, _ControlOrientation orienta } if (pPreviousItem == null) { - previousItemBounds.SetBounds(0, 0, 0, 0); + previousItemBounds.SetBounds(0.0f, 0.0f, 0.0f, 0.0f); } else { diff --git a/src/ui/controls/FUiCtrl_TabBarPresenter.cpp b/src/ui/controls/FUiCtrl_TabBarPresenter.cpp index 3e2cab9..1965ee5 100644 --- a/src/ui/controls/FUiCtrl_TabBarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TabBarPresenter.cpp @@ -22,13 +22,16 @@ #include #include -#include #include +#include #include -#include "FUi_UiTouchEvent.h" -#include "FUi_ResourceManager.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" +#include "FUi_ResourceManager.h" +#include "FUi_UiTouchEvent.h" + #include "FUiCtrl_TabBarPresenter.h" @@ -45,16 +48,15 @@ _TabBarPresenter::_TabBarPresenter(_TabBar& tabBar) , __pTabBarModel(null) , __pFont(null) , __pTextObject(null) + , __startPosition(FloatPoint(0.0f, 0.0f)) , __highlightedItemIndex(-1) , __touchMoved(false) , __touchBubblingBlocked(true) , __pBgBitmapCached(null) - , __pLeftArrowBgBitmapCached(null) - , __pRightArrowBgBitmapCached(null) + , __pBgEffectBitmapCached(null) , __pLeftArrowBitmapCached(null) , __pRightArrowBitmapCached(null) { - __startPosition = Point(0, 0); for (int i = 0; i < ITEM_STATUS_MAX; i++) { __pItemBgBitmapCached[i] = null; @@ -76,18 +78,15 @@ _TabBarPresenter::~_TabBarPresenter(void) delete __pBgBitmapCached; __pBgBitmapCached = null; + delete __pBgEffectBitmapCached; + __pBgEffectBitmapCached = null; + for (int i = 0; i < ITEM_STATUS_MAX; i++) { delete __pItemBgBitmapCached[i]; __pItemBgBitmapCached[i] = null; } - delete __pLeftArrowBgBitmapCached; - __pLeftArrowBgBitmapCached = null; - - delete __pRightArrowBgBitmapCached; - __pRightArrowBgBitmapCached = null; - delete __pLeftArrowBitmapCached; __pLeftArrowBitmapCached = null; @@ -96,7 +95,7 @@ _TabBarPresenter::~_TabBarPresenter(void) } result -_TabBarPresenter::Construct() +_TabBarPresenter::Construct(void) { __pTabBarModel = new (std::nothrow) _TabBarModel; SysTryReturn(NID_UI_CTRL, __pTabBarModel != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -124,6 +123,7 @@ _TabBarPresenter::InitializeFont(void) __pTextObject = new (std::nothrow) TextObject(); SysTryCatch(NID_UI_CTRL, __pTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + __pTextObject->Construct(); __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); @@ -144,9 +144,9 @@ _TabBarPresenter::OnFontChanged(Font* pFont) } void -_TabBarPresenter::OnFontInfoRequested(unsigned long& style, int& size) +_TabBarPresenter::OnFontInfoRequested(unsigned long& style, float& size) { - int fontSize = 0; + float fontSize = 0.0f; GET_SHAPE_CONFIG(TABBAR::FONT_SIZE, __tabBar.GetOrientation(), fontSize); style = FONT_STYLE_PLAIN; @@ -159,7 +159,7 @@ _TabBarPresenter::LoadBitmap(void) Bitmap* pBitmap = null; Color arrowColor; - GET_COLOR_CONFIG(TABBAR::ARROW_NORMAL, arrowColor); + GET_COLOR_CONFIG(TABBAR::ARROW_BG_NORMAL, arrowColor); if (__pBgBitmapCached != null) { @@ -167,10 +167,10 @@ _TabBarPresenter::LoadBitmap(void) __pBgBitmapCached = null; } - if (__pLeftArrowBgBitmapCached != null) + if (__pBgEffectBitmapCached != null) { - delete __pLeftArrowBgBitmapCached; - __pLeftArrowBgBitmapCached = null; + delete __pBgEffectBitmapCached; + __pBgEffectBitmapCached = null; } if (__pLeftArrowBitmapCached != null) @@ -179,12 +179,6 @@ _TabBarPresenter::LoadBitmap(void) __pLeftArrowBitmapCached = null; } - if (__pRightArrowBgBitmapCached == null) - { - delete __pRightArrowBgBitmapCached; - __pRightArrowBgBitmapCached = null; - } - if (__pRightArrowBitmapCached == null) { delete __pRightArrowBitmapCached; @@ -201,37 +195,34 @@ _TabBarPresenter::LoadBitmap(void) } result r; - r = GET_BITMAP_CONFIG_N(TABBAR::ARROW_BG_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, __pLeftArrowBgBitmapCached); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap."); - - r = GET_BITMAP_CONFIG_N(TABBAR::ARROW_BG_RIGHT, BITMAP_PIXEL_FORMAT_ARGB8888, __pRightArrowBgBitmapCached); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap."); - r = GET_BITMAP_CONFIG_N(TABBAR::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap."); __pBgBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetColor()); delete pBitmap; pBitmap = null; - r = GET_BITMAP_CONFIG_N(TABBAR::ARROW_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::BG_OUTLINE_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgEffectBitmapCached); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap."); + + r = GET_BITMAP_CONFIG_N(TABBAR::LEFT_ARROW_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); __pLeftArrowBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), arrowColor); SysTryCatch(NID_UI_CTRL, __pLeftArrowBitmapCached != null, , E_OUT_OF_MEMORY, "Failed to load bitmap."); delete pBitmap; pBitmap = null; - r = GET_BITMAP_CONFIG_N(TABBAR::ARROW_RIGHT, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::RIGHT_ARROW_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); __pRightArrowBitmapCached = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), arrowColor); SysTryCatch(NID_UI_CTRL, __pRightArrowBitmapCached != null, , E_OUT_OF_MEMORY, "Failed to load bitmap."); delete pBitmap; pBitmap = null; - r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); __pItemBgBitmapCached[ITEM_STATUS_SELECTED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_SELECTED)); SysTryCatch(NID_UI_CTRL, __pItemBgBitmapCached[ITEM_STATUS_SELECTED] != null, , E_OUT_OF_MEMORY, "Failed to load bitmap."); delete pBitmap; pBitmap = null; - r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); __pItemBgBitmapCached[ITEM_STATUS_HIGHLIGHTED] = _BitmapImpl::GetColorReplacedBitmapN(*pBitmap, Color::GetColor(COLOR_ID_MAGENTA), __tabBar.GetItemColor(ITEM_STATUS_HIGHLIGHTED)); SysTryCatch(NID_UI_CTRL, __pItemBgBitmapCached[ITEM_STATUS_HIGHLIGHTED] != null, , E_OUT_OF_MEMORY, "Failed to load bitmap."); delete pBitmap; @@ -245,15 +236,9 @@ CATCH: delete __pBgBitmapCached; __pBgBitmapCached = null; - delete __pLeftArrowBgBitmapCached; - __pLeftArrowBgBitmapCached = null; - delete __pLeftArrowBitmapCached; __pLeftArrowBitmapCached = null; - delete __pRightArrowBgBitmapCached; - __pRightArrowBgBitmapCached = null; - delete __pRightArrowBitmapCached; __pRightArrowBitmapCached = null; @@ -351,13 +336,33 @@ _TabBarPresenter::SetItemSelected(int index) result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); pItem->SetStatus(ITEM_STATUS_NORMAL); + if(unlikely(_AccessibilityManager::IsActivated())) + { + _AccessibilityElement* pElement = pItem->GetAccessibilityElement(); + if(pElement != null) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } + } pItem = GetItemAt(index); r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); pItem->SetStatus(ITEM_STATUS_SELECTED); + if(unlikely(_AccessibilityManager::IsActivated())) + { + _AccessibilityElement* pElement = pItem->GetAccessibilityElement(); + if(pElement != null) + { + pElement->SetStatus(L"Selected"); + pElement->SetHintDisabled(true); + } + } + __pTabBarModel->SetSelectedItemIndex(index); + return E_SUCCESS; } @@ -374,12 +379,12 @@ _TabBarPresenter::GetItemCount(void) const } int -_TabBarPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const +_TabBarPresenter::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const { - Rectangle clientBounds = __tabBar.GetBounds(); - int topMargin = 0; - int sideMargin = 0; - GET_SHAPE_CONFIG(TABBAR::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); + FloatRectangle clientBounds = __tabBar.GetBoundsF(); + float topMargin = 0.0f; + float sideMargin = 0.0f; + GET_SHAPE_CONFIG(TABBAR::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); if (point.x < sideMargin @@ -395,7 +400,36 @@ _TabBarPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point& point) while (pItem != null) { - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBounds(); + + if (point.x - sideMargin > itemBounds.x + && point.x - sideMargin < itemBounds.x + itemBounds.width + && point.y - topMargin > itemBounds.y + && point.y - topMargin < itemBounds.y + itemBounds.height) + { + return itemIndex; + } + itemIndex++; + pItem = __pTabBarModel->GetItemAt(itemIndex); + } + return -1; +} + +int +_TabBarPresenter::GetItemIndexFromAbsPosition(const Tizen::Graphics::FloatPoint& point) const +{ + FloatRectangle clientBounds = __tabBar.GetBoundsF(); + float topMargin = 0.0f; + float sideMargin = 0.0f; + GET_SHAPE_CONFIG(TABBAR::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); + GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); + + int itemIndex = 0; + _TabBarItem* pItem = __pTabBarModel->GetItemAt(itemIndex); + + while (pItem != null) + { + FloatRectangle itemBounds = pItem->GetBounds(); if (point.x - sideMargin > itemBounds.x && point.x - sideMargin < itemBounds.x + itemBounds.width @@ -407,11 +441,12 @@ _TabBarPresenter::GetItemIndexFromPosition(const Tizen::Graphics::Point& point) itemIndex++; pItem = __pTabBarModel->GetItemAt(itemIndex); } + return -1; } _TabBarItem* -_TabBarPresenter::GetItemFromPosition(const Tizen::Graphics::Point& position) const +_TabBarPresenter::GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const { SetLastResult(E_SUCCESS); int index = GetItemIndexFromPosition(position); @@ -430,18 +465,18 @@ _TabBarPresenter::SetTopDrawnItemIndex(int index) result r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - int distance = pTopItem->GetBounds().x; + float distance = pTopItem->GetBounds().x; _TabBarItem* pBottomItem = GetItemAt(GetItemCount() - 1); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle clientBounds = __tabBar.GetBounds(); - int sideMargin = 0; + FloatRectangle clientBounds = __tabBar.GetBoundsF(); + float sideMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); - if ((pBottomItem->GetBounds().x + pBottomItem->GetBounds().width - distance) < clientBounds.width - sideMargin * 2) + if ((pBottomItem->GetBounds().x + pBottomItem->GetBounds().width - distance) < clientBounds.width - sideMargin * 2.0f) { - distance = (pBottomItem->GetBounds().x + pBottomItem->GetBounds().width) - (clientBounds.width - sideMargin * 2); + distance = (pBottomItem->GetBounds().x + pBottomItem->GetBounds().width) - (clientBounds.width - sideMargin * 2.0f); } r = AdjustItemPositionX(-distance); @@ -473,7 +508,7 @@ _TabBarPresenter::GetItemStatus(int index) const } result -_TabBarPresenter::AdjustItemPositionX(int distance) +_TabBarPresenter::AdjustItemPositionX(float distance) { int index = 0; @@ -481,12 +516,14 @@ _TabBarPresenter::AdjustItemPositionX(int distance) { _TabBarItem* pItem = __pTabBarModel->GetItemAt(index); SysTryReturn(NID_UI_CTRL, pItem, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Item(%d) not exists.", index); - Rectangle bounds = pItem->GetBounds(); + FloatRectangle bounds = pItem->GetBounds(); bounds.x += distance; pItem->SetBounds(bounds); index++; } + SetAllAccessibilityElement(); + return E_SUCCESS; } @@ -521,12 +558,12 @@ _TabBarPresenter::SetItemReplacementColor(_TabBarItemStatus itemStatus, const Ti result r; if (itemStatus == ITEM_STATUS_SELECTED) { - r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); SysTryReturn(NID_UI_CTRL, pBitmap != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail."); } else if (itemStatus == ITEM_STATUS_HIGHLIGHTED) { - r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); + r = GET_BITMAP_CONFIG_N(TABBAR::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap); SysTryReturn(NID_UI_CTRL, pBitmap != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Image loading fail."); } else @@ -552,17 +589,17 @@ _TabBarPresenter::Draw(void) Canvas* pCanvas = __tabBar.GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, E_SYSTEM, "[E_SYSTEM] It can not get canvas."); - int sideMargin = 0; + float sideMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); - Rectangle clientBounds = __tabBar.GetBounds(); + FloatRectangle clientBounds = __tabBar.GetBoundsF(); pCanvas->Clear(); DrawBackground(pCanvas); DrawArrow(pCanvas); delete pCanvas; - Rectangle rect(sideMargin, 0, clientBounds.width - sideMargin * 2, clientBounds.height); + FloatRectangle rect(sideMargin, 0.0f, clientBounds.width - sideMargin * 2.0f, clientBounds.height); Canvas* pSubCanvas = __tabBar.GetCanvasN(rect); if (pSubCanvas != null) @@ -581,23 +618,21 @@ _TabBarPresenter::InitItemPositionX(void) return; } - int sideMargin = 0; + float sideMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); _TabBarItem* pFirstItem = __pTabBarModel->GetItemAt(0); _TabBarItem* pLastItem = __pTabBarModel->GetItemAt(itemCount - 1); SysTryReturnVoidResult(NID_UI_CTRL, pFirstItem != null && pLastItem != null, E_SYSTEM, "[E_SYSTEM] Item not found."); - Rectangle clientBounds = __tabBar.GetBounds(); - Rectangle firstItemBounds = pFirstItem->GetBounds(); - Rectangle lastItemBounds = pLastItem->GetBounds(); + FloatRectangle clientBounds = __tabBar.GetBoundsF(); + FloatRectangle firstItemBounds = pFirstItem->GetBounds(); + FloatRectangle lastItemBounds = pLastItem->GetBounds(); - if (firstItemBounds.x != 0 && lastItemBounds.x + lastItemBounds.width - firstItemBounds.x < clientBounds.width - sideMargin * 2) + if (!_FloatCompare(firstItemBounds.x, 0.0f) && lastItemBounds.x + lastItemBounds.width - firstItemBounds.x < clientBounds.width - sideMargin * 2.0f) { AdjustItemPositionX(-firstItemBounds.x); } - - return; } void @@ -611,17 +646,19 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) { SysTryReturnVoidResult(NID_UI_CTRL, __pTextObject != null, E_INVALID_STATE, "[E_INVALID_STATE] TextObject is not constructed."); - Rectangle clientBounds = pCanvas->GetBounds(); + FloatRectangle clientBounds = pCanvas->GetBoundsF(); _TabBarItem* pDrawItem = null; - Rectangle itemBounds(0, 0, 0, 0); + FloatRectangle itemBounds(0.0f, 0.0f, 0.0f, 0.0f); String drawText(L""); - Rectangle textRect(0, 0, 0, 0); + FloatRectangle textRect(0.0f, 0.0f, 0.0f, 0.0f); TextSimple* pSimpleText = null; _TabBarItemStatus itemStatus = ITEM_STATUS_NORMAL; + __pTabBarModel->SetFirstDrawnItemIndex(-1); + __pTabBarModel->SetLastDrawnItemIndex(-1); int itemCount = GetItemCount(); for (int i = 0; i < itemCount; i++) { @@ -633,7 +670,7 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) itemBounds = pDrawItem->GetBounds(); - if (itemBounds.x + itemBounds.width < 0) + if (itemBounds.x + itemBounds.width < 0.0f) { continue; } @@ -643,6 +680,13 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) break; } + if (__pTabBarModel->GetFirstDrawnItemIndex() == -1) + { + __pTabBarModel->SetFirstDrawnItemIndex(i); + } + + __pTabBarModel->SetLastDrawnItemIndex(i); + itemStatus = pDrawItem->GetStatus(); // draw item BG @@ -652,11 +696,11 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) } // draw item text - textRect = Rectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height); - if (textRect.x < 0) + textRect = FloatRectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height); + if (textRect.x < 0.0f) { textRect.width += textRect.x; - textRect.x = 0; + textRect.x = 0.0f; } if (textRect.x + textRect.width > clientBounds.width) @@ -685,18 +729,27 @@ _TabBarPresenter::DrawItem(Tizen::Graphics::Canvas* pCanvas) void _TabBarPresenter::DrawBackground(Tizen::Graphics::Canvas* pCanvas) { - Rectangle clientBounds = __tabBar.GetBounds(); + result r = E_SUCCESS; + FloatRectangle clientBounds = __tabBar.GetBoundsF(); if (__pBgBitmapCached != null) { - pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, clientBounds.width, clientBounds.height), *__pBgBitmapCached); + r = DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, clientBounds.width, clientBounds.height), *__pBgBitmapCached); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + bool isCustomBitmap = IS_CUSTOM_BITMAP(TABBAR::BG_NORMAL); + if (__pBgEffectBitmapCached != null && !isCustomBitmap) + { + r = DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, clientBounds.width, clientBounds.height), *__pBgEffectBitmapCached); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } } void _TabBarPresenter::DrawArrow(Tizen::Graphics::Canvas* pCanvas) { - Rectangle clientBounds = __tabBar.GetBounds(); + FloatRectangle clientBounds = __tabBar.GetBoundsF(); _TabBarItem* pFirstItem = __pTabBarModel->GetItemAt(0); if (pFirstItem == null) @@ -704,23 +757,23 @@ _TabBarPresenter::DrawArrow(Tizen::Graphics::Canvas* pCanvas) return; } - Rectangle firstItemBounds = pFirstItem->GetBounds(); - int sideMargin = 0; - int arrowMargin = 0; + FloatRectangle firstItemBounds = pFirstItem->GetBounds(); + float sideMargin = 0.0f; + float arrowMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); GET_SHAPE_CONFIG(TABBAR::ARROW_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, arrowMargin); - Rectangle drawRect(0, 0, 0, 0); + FloatRectangle drawRect(0.0f, 0.0f, 0.0f, 0.0f); drawRect.width = sideMargin; drawRect.height = clientBounds.height; // draw left arrow - if (firstItemBounds.x < 0) + if (firstItemBounds.x < 0.0f) { drawRect.width = __pLeftArrowBitmapCached->GetWidth(); drawRect.height = __pLeftArrowBitmapCached->GetHeight(); - drawRect.x = (sideMargin - __pLeftArrowBitmapCached->GetWidth()) / 2; - drawRect.y = (clientBounds.height - __pLeftArrowBitmapCached->GetHeight()) / 2; + drawRect.x = (sideMargin - __pLeftArrowBitmapCached->GetWidth()) / 2.0f; + drawRect.y = (clientBounds.height - __pLeftArrowBitmapCached->GetHeight()) / 2.0f; DrawBitmap(*pCanvas, drawRect, *__pLeftArrowBitmapCached); } @@ -731,18 +784,18 @@ _TabBarPresenter::DrawArrow(Tizen::Graphics::Canvas* pCanvas) return; } - Rectangle lastItemBounds = pLastItem->GetBounds(); + FloatRectangle lastItemBounds = pLastItem->GetBounds(); - drawRect.SetBounds(0, 0, 0, 0); + drawRect.SetBounds(0.0f, 0.0f, 0.0f, 0.0f); drawRect.x = clientBounds.width - sideMargin; drawRect.width = sideMargin; drawRect.height = clientBounds.height; // draw right arrow - if (lastItemBounds.x + lastItemBounds.width > clientBounds.width - sideMargin * 2) + if (lastItemBounds.x + lastItemBounds.width > clientBounds.width - sideMargin * 2.0f) { - drawRect.x += (sideMargin - __pRightArrowBitmapCached->GetWidth()) / 2; - drawRect.y = (clientBounds.height - __pRightArrowBitmapCached->GetHeight()) / 2; + drawRect.x += (sideMargin - __pRightArrowBitmapCached->GetWidth()) / 2.0f; + drawRect.y = (clientBounds.height - __pRightArrowBitmapCached->GetHeight()) / 2.0f; drawRect.width = __pRightArrowBitmapCached->GetWidth(); drawRect.height = __pRightArrowBitmapCached->GetHeight(); DrawBitmap(*pCanvas, drawRect, *__pRightArrowBitmapCached); @@ -752,10 +805,11 @@ _TabBarPresenter::DrawArrow(Tizen::Graphics::Canvas* pCanvas) bool _TabBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - __startPosition = touchinfo.GetCurrentPosition(); + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + __startPosition = touchPosition; __touchBubblingBlocked = true; - int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + int index = GetItemIndexFromPosition(touchPosition); if (index == -1) { return true; @@ -778,12 +832,12 @@ _TabBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touch bool _TabBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + int index = GetItemIndexFromPosition(touchPosition); int selectedItemIndex = GetSelectedItemIndex(); bool eventFire = false; result r = E_SUCCESS; - if (index != -1 && GetItemStatus(index) != ITEM_STATUS_NORMAL && __touchMoved == false) { if (GetItemStatus(index) == ITEM_STATUS_HIGHLIGHTED) @@ -806,6 +860,7 @@ _TabBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc } } } + __highlightedItemIndex = -1; __touchMoved = false; @@ -817,26 +872,29 @@ _TabBarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touc bool _TabBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + if (&source != &__tabBar) { return false; } - int sideMargin = 0; - GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); - int arrowMargin = 0; + float sideMargin = 0.0f; + float arrowMargin = 0.0f; + GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); GET_SHAPE_CONFIG(TABBAR::ARROW_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, arrowMargin); - Rectangle clientBounds = __tabBar.GetBounds(); - if (__pTabBarModel->GetWidthOfAllItems() + (sideMargin * 2) <= clientBounds.width + arrowMargin * 2) + FloatRectangle clientBounds = __tabBar.GetBoundsF(); + if (__pTabBarModel->GetWidthOfAllItems() + (sideMargin * 2.0f) <= clientBounds.width + arrowMargin * 2.0f) { return true; } + FloatPoint touchPosition = touchinfo.GetCurrentPosition(); + if (__touchMoved == false) { - int distanceX = abs((touchinfo.GetCurrentPosition()).x - __startPosition.x); - int distanceY = abs((touchinfo.GetCurrentPosition()).y - __startPosition.y); + float distanceX = _Abs((touchPosition).x - __startPosition.x); + float distanceY = _Abs((touchPosition).y - __startPosition.y); if (distanceY > distanceX) { @@ -846,11 +904,11 @@ _TabBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin __touchMoved = true; - int distance = (touchinfo.GetCurrentPosition()).x - __startPosition.x; + float distance = touchPosition.x - __startPosition.x; - __startPosition = touchinfo.GetCurrentPosition(); + __startPosition = touchPosition; _TabBarItem* pItem = null; - Rectangle itemBounds; + FloatRectangle itemBounds; int itemCount = GetItemCount(); if (distance > 0) // right move @@ -882,14 +940,14 @@ _TabBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin } itemBounds = pItem->GetBounds(); - if (itemBounds.x + itemBounds.width + (arrowMargin * 2) == clientBounds.width - (sideMargin * 2)) + if (_FloatCompare(itemBounds.x + itemBounds.width + (arrowMargin * 2.0f), clientBounds.width - (sideMargin * 2.0f))) { return true; } - if (itemBounds.x + itemBounds.width + distance + (arrowMargin * 2) <= clientBounds.width - (sideMargin * 2)) + if (itemBounds.x + itemBounds.width + distance + (arrowMargin * 2.0f) <= clientBounds.width - (sideMargin * 2.0f)) { - distance = (clientBounds.width - (sideMargin * 2)) - (itemBounds.x + itemBounds.width + (arrowMargin * 2)); + distance = (clientBounds.width - (sideMargin * 2.0f)) - (itemBounds.x + itemBounds.width + (arrowMargin * 2.0f)); } } @@ -901,7 +959,7 @@ _TabBarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin } result -_TabBarPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) +_TabBarPresenter::DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) @@ -922,7 +980,7 @@ void _TabBarPresenter::SetAllAccessibilityElement(void) { _AccessibilityContainer* pContainer = __tabBar.GetAccessibilityContainer(); - int sideMargin = 0; + float sideMargin = 0.0f; GET_SHAPE_CONFIG(TABBAR::SIDE_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sideMargin); if (pContainer != null) @@ -931,34 +989,106 @@ _TabBarPresenter::SetAllAccessibilityElement(void) for (int i = 0; i < itemCount; i++) { _TabBarItem* pItem = __pTabBarModel->GetItemAt(i); - _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true); - if (pItem != null && pElement != null) + _AccessibilityElement* pElement = pItem->GetAccessibilityElement(); + if (pElement == null) { + pElement = new (std::nothrow) _AccessibilityElement(true); + pElement->Construct(L"", FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)); + pElement->SetName(L"Category" + Integer::ToString(i + 1)); pElement->SetLabel(pItem->GetText()); -// pElement->SetTrait(ACCESSIBILITY_TRAITS_TABBAR); - pElement->SetTrait(ACCESSIBILITY_TRAITS_TAB); // not yet - Rectangle itemBounds = pItem->GetBounds(); + pElement->SetTrait(L"Category"); + FloatRectangle itemBounds = pItem->GetBounds(); itemBounds.x += sideMargin; pElement->SetBounds(itemBounds); - - if (i == 0) - { - pElement->SetHint(L"The first of TabBar"); - } - else if(i == itemCount - 1) - { - pElement->SetHint(L"The last of TabBar"); - } + pItem->SetAccessibilityElement(pElement); pContainer->AddElement(*pElement); - __tabBar.AddAccessibilityElement(*pElement); } else { - delete pElement; + pElement->SetName(L"Category" + Integer::ToString(i + 1)); + pElement->SetLabel(pItem->GetText()); + pElement->SetTrait(L"Category"); + FloatRectangle itemBounds = pItem->GetBounds(); + itemBounds.x += sideMargin; + pElement->SetBounds(itemBounds); + } + + if (pItem->GetStatus() != ITEM_STATUS_SELECTED) + { + pElement->SetHint(L"Double tap to move to contents"); } } } +} + +bool +_TabBarPresenter::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + + return false; +} + +bool +_TabBarPresenter::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TabBarPresenter::OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction) +{ + FloatRectangle r = element.GetBounds(); + int itemIndex = GetItemIndexFromAbsPosition(FloatPoint(r.x + r.width / 2.0f, r.y + r.height / 2.0f)); + + if (itemIndex < __pTabBarModel->GetFirstDrawnItemIndex() || __pTabBarModel->GetLastDrawnItemIndex() < itemIndex) + { + SetTopDrawnItemIndex(itemIndex); + __tabBar.Draw(); + } + return false; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TabImpl.cpp b/src/ui/controls/FUiCtrl_TabImpl.cpp index 6d666c5..e713606 100644 --- a/src/ui/controls/FUiCtrl_TabImpl.cpp +++ b/src/ui/controls/FUiCtrl_TabImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabImpl.cpp * @brief This is the implementation file for the _TabImpl class. diff --git a/src/ui/controls/FUiCtrl_TabItem.cpp b/src/ui/controls/FUiCtrl_TabItem.cpp index f86a976..a3c8649 100644 --- a/src/ui/controls/FUiCtrl_TabItem.cpp +++ b/src/ui/controls/FUiCtrl_TabItem.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabItem.cpp * @brief This is the header file for the _TabItem class. diff --git a/src/ui/controls/FUiCtrl_TabModel.cpp b/src/ui/controls/FUiCtrl_TabModel.cpp index 199a3b2..f15926f 100644 --- a/src/ui/controls/FUiCtrl_TabModel.cpp +++ b/src/ui/controls/FUiCtrl_TabModel.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabModel.cpp * @brief This is the implementation file for the _TabModel class. diff --git a/src/ui/controls/FUiCtrl_TabPresenter.cpp b/src/ui/controls/FUiCtrl_TabPresenter.cpp index e66d027..94d0229 100644 --- a/src/ui/controls/FUiCtrl_TabPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TabPresenter.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabPresenter.cpp * @brief This is the implementation file for the _TabPresenter class. @@ -37,6 +38,7 @@ #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_TabPresenter.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -66,8 +68,8 @@ _TabPresenter::_TabPresenter(void) , __pTabModel(null) , __pFont(null) , __pTextObject(null) - , __recalc(false) - , __editMode(false) + , __isRecalculateNeeded(false) + , __isEditMode(false) , __editItemIndex(-1) , __pVerticalLineBitmap(null) , __pHorizontalLineBitmap(null) @@ -87,8 +89,8 @@ _TabPresenter::_TabPresenter(void) , __itemWidth(0) , __itemHeight(0) , __rearIndex(0) - , __isRightScrolable(false) - , __isLeftScrolable(false) + , __isRightScrollable(false) + , __isLeftScrollable(false) , __isDirectionRight(true) , __isTimerCanceled(false) , __flickMove(0.0) @@ -105,6 +107,7 @@ _TabPresenter::_TabPresenter(void) , __isTouchMove(false) , __scrollFlag(0) , __tabMinimumSize(0) + , __fontChangeItemCount(0) { __currentTouchPosition = Point(0, 0); @@ -242,7 +245,7 @@ _TabPresenter::Construct(const _Tab& tab) GET_SHAPE_CONFIG(TAB::SCREEN_WIDTH, __pTab->GetOrientation(), __width); GET_SHAPE_CONFIG(TAB::SCREEN_HEIGHT, __pTab->GetOrientation(), __height); - GET_SHAPE_CONFIG(TAB::DIVIDER_WIDTH, __pTab->GetOrientation(), __dividerLine.width); + GET_FIXED_VALUE_CONFIG(TAB::DIVIDER_WIDTH, __pTab->GetOrientation(), __dividerLine.width); GET_SHAPE_CONFIG(TAB::DIVIDER_HEIGHT, __pTab->GetOrientation(), __dividerLine.height); GET_SHAPE_CONFIG(TAB::TAB_MINIMUM_SIZE, __pTab->GetOrientation(), __tabMinimumSize); @@ -250,6 +253,7 @@ _TabPresenter::Construct(const _Tab& tab) GET_SHAPE_CONFIG(TAB::SELECTED_LINE_LEFT_MARGIN, __pTab->GetOrientation(), __selectedLineLeftMargin); GET_SHAPE_CONFIG(TAB::SELECTED_LINE_RIGHT_MARGIN, __pTab->GetOrientation(), __selectedLineRightMargin); GET_SHAPE_CONFIG(TAB::SELECTED_LINE_HEIGHT, __pTab->GetOrientation(), __selectedLine.height); + GET_FIXED_VALUE_CONFIG(TAB::FONT_CHANGE_ITEM_COUNT, __pTab->GetOrientation(), __fontChangeItemCount); __flickAnimation.SetSizeInformation(__width, __height, DEVICE_SIZE_HORIZONTAL, DEVICE_SIZE_VERTICAL); __flickAnimation.SetSensitivity(FLICK_ANIMATION_FPS_TAB, FLICK_ANIMATION_SENSITIVITY_TAB); @@ -281,6 +285,7 @@ _TabPresenter::LoadBitmap(void) { result r = E_SUCCESS; Tizen::Graphics::Bitmap* pBitmap = null; + r = GET_BITMAP_CONFIG_N(TAB::VERTICAL_DIVIDER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pVerticalLineBitmap); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate divider line bitmap."); @@ -289,9 +294,10 @@ _TabPresenter::LoadBitmap(void) if (pBitmap) { - __pHorizontalLineBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(pBitmap), Color::GetColor(COLOR_ID_MAGENTA), __pTab->GetPressedTextColor()); - SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate focus item line bitmap."); + __pHorizontalLineBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(pBitmap), Color::GetColor(COLOR_ID_MAGENTA), __pTab->GetSelectedTextColor()); + SysTryLog(NID_UI_CTRL, (__pHorizontalLineBitmap != null), "Failed to locate focus item line bitmap."); } + r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, __pFrontScrollingEffectBitmap); SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling left bitmap."); @@ -337,10 +343,12 @@ _TabPresenter::SetModel(const _TabModel& tabModel) void _TabPresenter::SetSelectedItemIndex(int index) { - int i = GetSelectedItemIndex(); - SetItemStatus(i, _TABITEM_STATUS_NORMAL); + int selectedIndex = GetSelectedItemIndex(); + + SetItemStatus(selectedIndex, _TABITEM_STATUS_NORMAL); __pTabModel->SetSelectedItemIndex(index); SetItemStatus(index, _TABITEM_STATUS_SELECTED); + return; } @@ -378,10 +386,10 @@ _TabPresenter::GetFirstDrawnItemIndex(void) const } void -_TabPresenter::SetEditModeEnabled(bool enable) +_TabPresenter::SetEditModeEnabled(bool isEnabled) { - return __pTabModel->SetEditModeEnabled(enable); + return __pTabModel->SetEditModeEnabled(isEnabled); } bool @@ -477,15 +485,17 @@ _TabPresenter::Draw(void) SysTryReturnVoidResult(NID_UI_CTRL, __pTab, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Tab instance is null."); GET_COLOR_CONFIG(TAB::ITEM_BG_NORMAL, backgroundColor); - if (__recalc) + + if (__isRecalculateNeeded) { - __recalc = false; + __isRecalculateNeeded = false; CalcItemBounds(); } else if (__isFlickEnabled ) { DrawHorizontal(); } + Canvas* pCanvas = __pTab->GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -512,9 +522,9 @@ _TabPresenter::Draw(void) } void -_TabPresenter::SetReCalculateItemBounds(bool reCalculationRequired) +_TabPresenter::SetRecalculateItemBounds(bool isRecalculationRequired) { - __recalc = reCalculationRequired; + __isRecalculateNeeded = isRecalculationRequired; return; } @@ -533,9 +543,7 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; - bool multiline = false; - int fontChangeItemCount = 0; - GET_FIXED_VALUE_CONFIG(TAB::FONT_CHANGE_ITEM_COUNT, __pTab->GetOrientation(), fontChangeItemCount); + bool isMultiline = false; int topMargin = 0; int bottomMargin = 0; @@ -546,23 +554,45 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) GET_SHAPE_CONFIG(TAB::ITEM_LEFT_MARGIN, __pTab->GetOrientation(), leftMargin); GET_SHAPE_CONFIG(TAB::ITEM_RIGHT_MARGIN, __pTab->GetOrientation(), rightMargin); - for (int i = 0; i < itemCount; i++) + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + + int startIndex = __firstLoadedItemIndex - 1; + int endIndex = __lastLoadedItemIndex + 1; + if (__firstLoadedItemIndex == 0) { + startIndex = __firstLoadedItemIndex; + } + + if (__lastLoadedItemIndex == (GetItemCount() - 1)) + { + endIndex = __lastLoadedItemIndex; + } + + for (int i = startIndex; i <= endIndex; i++) + { + if (i == __editItemIndex) + { + continue; + } pDrawItem = GetItemAt(i); SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetFirstDrawnItemIndex(0); - // Item Rect itemDrawRect = pDrawItem->GetItemBounds(); - __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width)/2); - __dividerLine.y = ((itemDrawRect.height - __dividerLine.height)/2); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); - // Item Status itemStatus = pDrawItem->GetStatus(); - // Status + if (!__pTab->IsEnabled()) + { + itemStatus = _TABITEM_STATUS_DISABLED; + } + + if (itemStatus == _TABITEM_STATUS_SELECTED) { DrawSelectedItemBackground(pCanvas, itemDrawRect); @@ -571,14 +601,17 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) } else if (itemStatus == _TABITEM_STATUS_PRESSED) { - DrawFocusItemBackground(pCanvas, itemDrawRect); + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); } else { DrawItemBackground(pCanvas, itemDrawRect); } - // Draw Text itemText = pDrawItem->GetText(); __pTextObject->RemoveAll(); @@ -589,7 +622,6 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - // Margin - Item Rect. itemDrawRect.x = itemDrawRect.x + leftMargin; itemDrawRect.y = itemDrawRect.y + topMargin; itemDrawRect.width = itemDrawRect.width - leftMargin - rightMargin; @@ -600,66 +632,59 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) const int textRowCount = __pTextObject->GetTotalLineCount(); - // Init. - multiline = false; + isMultiline = false; if (textRowCount >= 2) { - multiline = true; + isMultiline = true; } - // Font Size Change - if (__pFont != null ) - { - int fontSize = 0; + int fontSize = 0; - if (__showItemCount < fontChangeItemCount) + if (__showItemCount < __fontChangeItemCount) + { + if (isMultiline == false) { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::FONT_SIZE_01, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::FONT_SIZE_01, __pTab->GetOrientation(), fontSize); } - else if (__showItemCount == fontChangeItemCount) + else { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::FONT_SIZE_02, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); + } + } + else if (__showItemCount == __fontChangeItemCount) + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::FONT_SIZE_02, __pTab->GetOrientation(), fontSize); } else { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::FONT_SIZE_03, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); + } + } + else + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::FONT_SIZE_03, __pTab->GetOrientation(), fontSize); + } + else + { + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); } - - (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); } + (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); + __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); if (itemStatus == _TABITEM_STATUS_SELECTED) { __pTextObject->SetForegroundColor(__pTab->GetSelectedTextColor(), 0, __pTextObject->GetTextLength()); __selectedLine.y = itemDrawRect.y + itemDrawRect.height; - if (__pTab->GetSelectedItemBackgroundBitmap() == null) - { - DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); - } + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); } else if (itemStatus == _TABITEM_STATUS_PRESSED) @@ -670,6 +695,10 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) { __pTextObject->SetForegroundColor(__pTab->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength()); } + else if (itemStatus == _TABITEM_STATUS_DISABLED) + { + __pTextObject->SetForegroundColor(__pTab->GetDisabledTextColor(), 0, __pTextObject->GetTextLength()); + } else { __pTextObject->SetForegroundColor(__pTab->GetTextColor(), 0, __pTextObject->GetTextLength()); @@ -679,12 +708,171 @@ _TabPresenter::DrawTextItem(Canvas* pCanvas) __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); if (i < (itemCount - 1)) { - DrawItemDivisionVerticalLine(pCanvas, __dividerLine); + DrawItemDivider(*pCanvas, __dividerLine); } DrawBadgeIcon(pDrawItem, pCanvas); } + + if (__isEditMode) + { + DrawEditTextItem(pCanvas); + } + + return; +} + +void +_TabPresenter::DrawEditTextItem(Canvas* pCanvas) +{ + ClearLastResult(); + + TextSimple* pSimpleText = null; + Rectangle bounds = __pTab->GetBounds(); + + _TabItem* pDrawItem = null; + String itemText(L""); + Rectangle itemDrawRect(0, 0, 0, 0); + + _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; + + bool isMultiline = false; + + int topMargin = 0; + int bottomMargin = 0; + int leftMargin = 0; + int rightMargin = 0; + GET_SHAPE_CONFIG(TAB::TOP_MARGIN, __pTab->GetOrientation(), topMargin); + GET_SHAPE_CONFIG(TAB::BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMargin); + GET_SHAPE_CONFIG(TAB::ITEM_LEFT_MARGIN, __pTab->GetOrientation(), leftMargin); + GET_SHAPE_CONFIG(TAB::ITEM_RIGHT_MARGIN, __pTab->GetOrientation(), rightMargin); + + pDrawItem = GetItemAt(__editItemIndex); + SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + itemDrawRect = pDrawItem->GetItemBounds(); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); + + itemStatus = pDrawItem->GetStatus(); + + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + DrawSelectedItemBackground(pCanvas, itemDrawRect); + __selectedLine.width = __itemWidth - __selectedLineLeftMargin - __selectedLineRightMargin; + __selectedLine.x = itemDrawRect.x + __selectedLineLeftMargin; + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); + } + else + { + DrawItemBackground(pCanvas, itemDrawRect); + } + + itemText = pDrawItem->GetText(); + + __pTextObject->RemoveAll(); + pSimpleText = new (std::nothrow)TextSimple(const_cast (itemText.GetPointer()), itemText.GetLength()); + SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pTextObject->AppendElement(*pSimpleText); + __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); + __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + + itemDrawRect.x = itemDrawRect.x + leftMargin; + itemDrawRect.y = itemDrawRect.y + topMargin; + itemDrawRect.width = itemDrawRect.width - leftMargin - rightMargin; + itemDrawRect.height = itemDrawRect.height - topMargin - bottomMargin; + + __pTextObject->SetBounds(itemDrawRect); + __pTextObject->Compose(); + + const int textRowCount = __pTextObject->GetTotalLineCount(); + + isMultiline = false; + + if (textRowCount >= 2) + { + isMultiline = true; + } + + int fontSize = 0; + + if (__showItemCount < __fontChangeItemCount) + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::FONT_SIZE_01, __pTab->GetOrientation(), fontSize); + } + else + { + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); + } + } + else if (__showItemCount == __fontChangeItemCount) + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::FONT_SIZE_02, __pTab->GetOrientation(), fontSize); + } + else + { + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); + } + } + else + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::FONT_SIZE_03, __pTab->GetOrientation(), fontSize); + } + else + { + GET_SHAPE_CONFIG(TAB::MULTILINE_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); + } + } + + (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); + + __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); + + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + __pTextObject->SetForegroundColor(__pTab->GetSelectedTextColor(), 0, __pTextObject->GetTextLength()); + __selectedLine.y = itemDrawRect.y + itemDrawRect.height; + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); + + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + __pTextObject->SetForegroundColor(__pTab->GetPressedTextColor(), 0, __pTextObject->GetTextLength()); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + __pTextObject->SetForegroundColor(__pTab->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength()); + } + else if (itemStatus == _TABITEM_STATUS_DISABLED) + { + __pTextObject->SetForegroundColor(__pTab->GetDisabledTextColor(), 0, __pTextObject->GetTextLength()); + } + else + { + __pTextObject->SetForegroundColor(__pTab->GetTextColor(), 0, __pTextObject->GetTextLength()); + } + + __pTextObject->SetBounds(itemDrawRect); + __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + + DrawBadgeIcon(pDrawItem, pCanvas); + return; } @@ -692,6 +880,13 @@ void _TabPresenter::DrawItemBackground(Canvas* pCanvas, Rectangle& itemRect) { Bitmap* pBackgroundBitmap = __pTab->GetBackgroundBitmap(); + Bitmap* pDisabledBackgroundBitmap = __pTab->GetDisabledBackgroundBitmap(); + + if ((!__pTab->IsEnabled()) && (pDisabledBackgroundBitmap != null)) + { + DrawResourceBitmap(*pCanvas, itemRect, pDisabledBackgroundBitmap); + return; + } DrawResourceBitmap(*pCanvas, itemRect, pBackgroundBitmap); @@ -699,9 +894,22 @@ _TabPresenter::DrawItemBackground(Canvas* pCanvas, Rectangle& itemRect) } void -_TabPresenter::DrawFocusItemBackground(Canvas* pCanvas, Rectangle& itemRect) +_TabPresenter::DrawPressedItemBackground(Canvas* pCanvas, Rectangle& itemRect) { Bitmap* pBackgroundBitmap = __pTab->GetPressedItemBackgroundBitmap(); + Bitmap* pBackgroundEffectBitmap = __pTab->GetPressedItemBackgroundEffectBitmap(); + + DrawResourceBitmap(*pCanvas, itemRect, pBackgroundBitmap); + + DrawResourceBitmap(*pCanvas, itemRect, pBackgroundEffectBitmap); + + return; +} + +void +_TabPresenter::DrawHighlightedItemBackground(Canvas* pCanvas, Rectangle& itemRect) +{ + Bitmap* pBackgroundBitmap = __pTab->GetHighlightedItemBackgroundBitmap(); DrawResourceBitmap(*pCanvas, itemRect, pBackgroundBitmap); @@ -729,6 +937,9 @@ _TabPresenter::DrawIconItem(Canvas* pCanvas) Rectangle itemDrawRect(0, 0, 0, 0); const int itemCount = GetItemCount(); + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; int iconWidth = 0; @@ -739,45 +950,64 @@ _TabPresenter::DrawIconItem(Canvas* pCanvas) GET_SHAPE_CONFIG(TAB::ICON_HEIGHT, __pTab->GetOrientation(), iconHeight); GET_SHAPE_CONFIG(TAB::BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMargin); - for (int i = 0; i < itemCount; i++) + int startIndex = __firstLoadedItemIndex - 1; + int endIndex = __lastLoadedItemIndex + 1; + if (__firstLoadedItemIndex == 0) { + startIndex = __firstLoadedItemIndex; + } + + if (__lastLoadedItemIndex == (GetItemCount() - 1)) + { + endIndex = __lastLoadedItemIndex; + } + + for (int i = startIndex; i <= endIndex; i++) + { + if (i == __editItemIndex) + { + continue; + } + pDrawItem = GetItemAt(i); SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetFirstDrawnItemIndex(0); - // Item Rect itemDrawRect = pDrawItem->GetItemBounds(); - __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width)/2); - __dividerLine.y = ((itemDrawRect.height - __dividerLine.height)/2); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); - // Item Status itemStatus = pDrawItem->GetStatus(); - // Status + if (!__pTab->IsEnabled()) + { + itemStatus = _TABITEM_STATUS_DISABLED; + } + if (itemStatus == _TABITEM_STATUS_SELECTED) { DrawSelectedItemBackground(pCanvas, itemDrawRect); __selectedLine.width = __itemWidth - __selectedLineLeftMargin - __selectedLineRightMargin; __selectedLine.x = itemDrawRect.x + __selectedLineLeftMargin; - __selectedLine.y = itemDrawRect.height - (bottomMargin/2); + __selectedLine.y = itemDrawRect.height - (bottomMargin / 2); + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); - if (__pTab->GetSelectedItemBackgroundBitmap() == null) - { - DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); - } } else if (itemStatus == _TABITEM_STATUS_PRESSED) { - DrawFocusItemBackground(pCanvas, itemDrawRect); + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); } else { DrawItemBackground(pCanvas, itemDrawRect); } - // Disable / Normal - // Margin - Item Rect. itemDrawRect.x = itemDrawRect.x + ((itemDrawRect.width - iconWidth) / 2); itemDrawRect.y = itemDrawRect.y + ((itemDrawRect.height - iconHeight) / 2); itemDrawRect.width = iconWidth; @@ -789,10 +1019,83 @@ _TabPresenter::DrawIconItem(Canvas* pCanvas) if (i < itemCount - 1) { - DrawItemDivisionVerticalLine(pCanvas, __dividerLine); + DrawItemDivider(*pCanvas, __dividerLine); } + DrawBadgeIcon(pDrawItem, pCanvas); } + + if (__isEditMode) + { + DrawEditIconItem(pCanvas); + } + + return; +} + +void +_TabPresenter::DrawEditIconItem(Canvas* pCanvas) +{ + ClearLastResult(); + + Rectangle bounds = __pTab->GetBounds(); + + _TabItem* pDrawItem = null; + String itemText(L""); + Rectangle itemDrawRect(0, 0, 0, 0); + + _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; + + int iconWidth = 0; + int iconHeight = 0; + int bottomMargin = 0; + + GET_SHAPE_CONFIG(TAB::ICON_WIDTH, __pTab->GetOrientation(), iconWidth); + GET_SHAPE_CONFIG(TAB::ICON_HEIGHT, __pTab->GetOrientation(), iconHeight); + GET_SHAPE_CONFIG(TAB::BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMargin); + + pDrawItem = GetItemAt(__editItemIndex); + SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + itemDrawRect = pDrawItem->GetItemBounds(); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); + + itemStatus = pDrawItem->GetStatus(); + + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + DrawSelectedItemBackground(pCanvas, itemDrawRect); + __selectedLine.width = __itemWidth - __selectedLineLeftMargin - __selectedLineRightMargin; + __selectedLine.x = itemDrawRect.x + __selectedLineLeftMargin; + __selectedLine.y = itemDrawRect.height - (bottomMargin / 2); + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); + } + else + { + DrawItemBackground(pCanvas, itemDrawRect); + } + + itemDrawRect.x = itemDrawRect.x + ((itemDrawRect.width - iconWidth) / 2); + itemDrawRect.y = itemDrawRect.y + ((itemDrawRect.height - iconHeight) / 2); + itemDrawRect.width = iconWidth; + itemDrawRect.height = iconHeight; + + Bitmap* pIconBitmap = pDrawItem->GetIcon(); + + DrawResourceBitmap(*pCanvas, itemDrawRect, pIconBitmap); + + DrawBadgeIcon(pDrawItem, pCanvas); + return; } @@ -811,16 +1114,14 @@ _TabPresenter::DrawItem(Canvas* pCanvas) Rectangle itemDrawRect(0, 0, 0, 0); Rectangle itemDrawIconRect(0, 0, 0, 0); Rectangle itemDrawTextRect(0, 0, 0, 0); - int iconTextGap = 0; const int itemCount = GetItemCount(); - _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); - bool multiline = false; - int fontChangeItemCount = 0; - GET_FIXED_VALUE_CONFIG(TAB::FONT_CHANGE_ITEM_COUNT, __pTab->GetOrientation(), fontChangeItemCount); - GET_FIXED_VALUE_CONFIG(TAB::ICON_TEXT_GAP, __pTab->GetOrientation(), iconTextGap); + _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; + bool isMultiline = false; int topMargin = 0; int bottomMargin = 0; int leftMargin = 0; @@ -828,33 +1129,55 @@ _TabPresenter::DrawItem(Canvas* pCanvas) int topMarginTextOnly = 0; int textLength = 0; int bottomMarginTextOnly = 0; + int iconWidth = 0; + int iconHeight = 0; + int iconGap = 0; + GET_SHAPE_CONFIG(TAB::TOP_MARGIN, __pTab->GetOrientation(), topMarginTextOnly); GET_SHAPE_CONFIG(TAB::BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMarginTextOnly); - GET_SHAPE_CONFIG(TAB::ICON_TEXT_TOP_MARGIN, __pTab->GetOrientation(), topMargin); GET_SHAPE_CONFIG(TAB::ICON_TEXT_BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMargin); GET_SHAPE_CONFIG(TAB::ITEM_LEFT_MARGIN, __pTab->GetOrientation(), leftMargin); GET_SHAPE_CONFIG(TAB::ITEM_RIGHT_MARGIN, __pTab->GetOrientation(), rightMargin); - int iconWidth = 0; - int iconHeight = 0; GET_SHAPE_CONFIG(TAB::ICON_TEXT_ICON_WIDTH, __pTab->GetOrientation(), iconWidth); GET_SHAPE_CONFIG(TAB::ICON_TEXT_ICON_HEIGHT, __pTab->GetOrientation(), iconHeight); - int iconGap = 0; GET_FIXED_VALUE_CONFIG(TAB::ICON_TEXT_GAP, __pTab->GetOrientation(), iconGap); - for (int i = 0; i < itemCount; i++) + int startIndex = __firstLoadedItemIndex - 1; + int endIndex = __lastLoadedItemIndex + 1; + if (__firstLoadedItemIndex == 0) { + startIndex = __firstLoadedItemIndex; + } + + if (__lastLoadedItemIndex == (GetItemCount() - 1)) + { + endIndex = __lastLoadedItemIndex; + } + + for (int i = startIndex; i <= endIndex; i++) + { + if (i == __editItemIndex) + { + continue; + } + pDrawItem = GetItemAt(i); SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); SetFirstDrawnItemIndex(0); itemDrawRect = pDrawItem->GetItemBounds(); - __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width)/2); - __dividerLine.y = ((itemDrawRect.height - __dividerLine.height)/2); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); itemStatus = pDrawItem->GetStatus(); + if (!__pTab->IsEnabled()) + { + itemStatus = _TABITEM_STATUS_DISABLED; + } + if (itemStatus == _TABITEM_STATUS_SELECTED) { DrawSelectedItemBackground(pCanvas, itemDrawRect); @@ -863,7 +1186,11 @@ _TabPresenter::DrawItem(Canvas* pCanvas) } else if (itemStatus == _TABITEM_STATUS_PRESSED) { - DrawFocusItemBackground(pCanvas, itemDrawRect); + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); } else { @@ -891,134 +1218,350 @@ _TabPresenter::DrawItem(Canvas* pCanvas) } Dimension textDim(0,0); - // Font Size Change - if (__pFont != null ) - { - int fontSize = 0; + int fontSize = 0; - if (__showItemCount < fontChangeItemCount) + if (__showItemCount < __fontChangeItemCount) + { + if (isMultiline == false) { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); } - else if (__showItemCount == fontChangeItemCount) + else { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); + } + } + else if (__showItemCount == __fontChangeItemCount) + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); } else { - if (multiline == false) - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); - } - else - { - GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); - } + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); + } + } + else + { + if (isMultiline == false) + { + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); + } + else + { + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); } + } + + (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); + + __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); + + __pFont->GetTextExtent(itemText, itemText.GetLength(), textDim); + + itemDrawTextRect = itemDrawRect; + itemDrawTextRect.x = itemDrawRect.x + leftMargin; + isMultiline = false; + if (textDim.width > (__itemWidth / 2)) + { + isMultiline = true; + textDim.width = (__itemWidth / 2); + textDim.height = textDim.height * 2; + } + itemDrawTextRect.width = textDim.width; + itemDrawTextRect.x = itemDrawRect.x + leftMargin; + itemDrawTextRect.x = itemDrawTextRect.x + ((itemDrawRect.width - leftMargin - rightMargin) - (iconWidth + iconGap + itemDrawTextRect.width)) / 2; + itemDrawTextRect.height = textDim.height; + itemDrawIconRect = itemDrawTextRect; + itemDrawTextRect.x = itemDrawIconRect.x + iconWidth + iconGap; + + if ((pDrawItem->GetIcon()) != null) + { + itemDrawIconRect.height = itemDrawRect.height - topMargin - bottomMargin; + itemDrawIconRect.y = itemDrawIconRect.y + topMargin + (itemDrawIconRect.height - iconHeight) / 2; + + itemDrawIconRect.width = iconWidth; + itemDrawIconRect.height = iconHeight; + Bitmap* pIconBitmap = pDrawItem->GetIcon(); + + DrawResourceBitmap(*pCanvas, itemDrawIconRect, pIconBitmap); + + } + else + { + itemDrawTextRect.x = itemDrawRect.x + leftMargin + (itemDrawRect.width - leftMargin - rightMargin - itemDrawTextRect.width) / 2; + } + + + if (isMultiline == false) + { + itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height) / 2; + } + else + { + itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height) / 2; + } + __pTextObject->SetBounds(itemDrawTextRect); + __pTextObject->Compose(); + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + __pTextObject->SetForegroundColor(__pTab->GetSelectedTextColor(), 0, __pTextObject->GetTextLength()); + __selectedLine.y = itemDrawRect.height - bottomMargin; + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); + + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + __pTextObject->SetForegroundColor(__pTab->GetPressedTextColor(), 0, __pTextObject->GetTextLength()); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + __pTextObject->SetForegroundColor(__pTab->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength()); + } + else if (itemStatus == _TABITEM_STATUS_DISABLED) + { + __pTextObject->SetForegroundColor(__pTab->GetDisabledTextColor(), 0, __pTextObject->GetTextLength()); + } + else + { + __pTextObject->SetForegroundColor(__pTab->GetTextColor(), 0, __pTextObject->GetTextLength()); + } + + __pTextObject->SetBounds(itemDrawTextRect); + + __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + + if (i < itemCount - 1) + { + DrawItemDivider(*pCanvas, __dividerLine); + } + DrawBadgeIcon(pDrawItem, pCanvas); + } + + if (__isEditMode) + { + DrawEditIconTextItem(pCanvas); + } + return; +} + +void +_TabPresenter::DrawEditIconTextItem(Canvas* pCanvas) +{ + ClearLastResult(); + + Rectangle bounds = __pTab->GetBounds(); + + TextSimple* pSimpleText = null; + _TabItem* pDrawItem = null; + Rectangle buttonBounds(0, 0, 0, 0); + String itemText(L""); + Rectangle itemDrawRect(0, 0, 0, 0); + Rectangle itemDrawIconRect(0, 0, 0, 0); + Rectangle itemDrawTextRect(0, 0, 0, 0); + + _TabItemStatus itemStatus = _TABITEM_STATUS_NORMAL; + + bool isMultiline = false; + + int topMargin = 0; + int bottomMargin = 0; + int leftMargin = 0; + int rightMargin = 0; + int topMarginTextOnly = 0; + int textLength = 0; + int bottomMarginTextOnly = 0; + GET_SHAPE_CONFIG(TAB::TOP_MARGIN, __pTab->GetOrientation(), topMarginTextOnly); + GET_SHAPE_CONFIG(TAB::BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMarginTextOnly); - (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_TOP_MARGIN, __pTab->GetOrientation(), topMargin); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_BOTTOM_MARGIN, __pTab->GetOrientation(), bottomMargin); + GET_SHAPE_CONFIG(TAB::ITEM_LEFT_MARGIN, __pTab->GetOrientation(), leftMargin); + GET_SHAPE_CONFIG(TAB::ITEM_RIGHT_MARGIN, __pTab->GetOrientation(), rightMargin); + int iconWidth = 0; + int iconHeight = 0; + GET_SHAPE_CONFIG(TAB::ICON_TEXT_ICON_WIDTH, __pTab->GetOrientation(), iconWidth); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_ICON_HEIGHT, __pTab->GetOrientation(), iconHeight); + int iconGap = 0; + GET_FIXED_VALUE_CONFIG(TAB::ICON_TEXT_GAP, __pTab->GetOrientation(), iconGap); - __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); + pDrawItem = GetItemAt(__editItemIndex); + SysTryReturnVoidResult(NID_UI_CTRL, pDrawItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - __pFont->GetTextExtent(itemText, itemText.GetLength(), textDim); - } + SetFirstDrawnItemIndex(0); - itemDrawTextRect = itemDrawRect; - itemDrawTextRect.x = itemDrawRect.x + leftMargin; - multiline = false; - if (textDim.width > (__itemWidth/2)) - { - multiline = true; - textDim.width = (__itemWidth/2); - textDim.height = textDim.height * 2; - } - itemDrawTextRect.width = textDim.width; - itemDrawTextRect.x = itemDrawRect.x + leftMargin; - itemDrawTextRect.x = itemDrawTextRect.x + ((itemDrawRect.width - leftMargin - rightMargin) - (iconWidth + iconGap + itemDrawTextRect.width))/2; - itemDrawTextRect.height = textDim.height; - itemDrawIconRect = itemDrawTextRect; - itemDrawTextRect.x = itemDrawIconRect.x + iconWidth + iconGap; + itemDrawRect = pDrawItem->GetItemBounds(); + __dividerLine.x = itemDrawRect.x + (itemDrawRect.width - (__dividerLine.width) / 2); + __dividerLine.y = ((itemDrawRect.height - __dividerLine.height) / 2); - if ((pDrawItem->GetIcon()) != null) - { - itemDrawIconRect.height = itemDrawRect.height - topMargin - bottomMargin; - itemDrawIconRect.y = itemDrawIconRect.y +topMargin+ (itemDrawIconRect.height - iconHeight)/2; + itemStatus = pDrawItem->GetStatus(); - itemDrawIconRect.width = iconWidth; - itemDrawIconRect.height = iconHeight; - Bitmap* pIconBitmap = pDrawItem->GetIcon(); + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + DrawSelectedItemBackground(pCanvas, itemDrawRect); + __selectedLine.width = __itemWidth - __selectedLineLeftMargin - __selectedLineRightMargin; + __selectedLine.x = itemDrawRect.x + __selectedLineLeftMargin; + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + DrawPressedItemBackground(pCanvas, itemDrawRect); + } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + DrawHighlightedItemBackground(pCanvas, itemDrawRect); + } + else + { + DrawItemBackground(pCanvas, itemDrawRect); + } - DrawResourceBitmap(*pCanvas, itemDrawIconRect, pIconBitmap); + itemText = pDrawItem->GetText(); + + __pTextObject->RemoveAll(); + pSimpleText = new (std::nothrow)TextSimple(const_cast (itemText.GetPointer()), itemText.GetLength()); + SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pTextObject->AppendElement(*pSimpleText); + + __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); + __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); + textLength = __pTextObject->GetTextLength(); + + if ((pDrawItem->GetIcon()) == null) + { + topMargin = topMarginTextOnly; + bottomMargin = bottomMarginTextOnly; + } + + Dimension textDim(0,0); - } - else - { - itemDrawTextRect.x = itemDrawRect.x + leftMargin + (itemDrawRect.width - leftMargin - rightMargin - itemDrawTextRect.width)/2; - } + int fontSize = 0; - if (multiline == false) + if (__showItemCount < __fontChangeItemCount) + { + if (isMultiline == false) { - itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height)/2; + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_01, __pTab->GetOrientation(), fontSize); } else { - itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height)/2; + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); } - __pTextObject->SetBounds(itemDrawTextRect); - __pTextObject->Compose(); - if (itemStatus == _TABITEM_STATUS_SELECTED) + } + else if (__showItemCount == __fontChangeItemCount) + { + if (isMultiline == false) { - __pTextObject->SetForegroundColor(__pTab->GetSelectedTextColor(), 0, __pTextObject->GetTextLength()); - __selectedLine.y = itemDrawRect.height - bottomMargin; - if (__pTab->GetSelectedItemBackgroundBitmap() == null) - { - DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); - } + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); } - else if (itemStatus == _TABITEM_STATUS_PRESSED) + else { - __pTextObject->SetForegroundColor(__pTab->GetPressedTextColor(), 0, __pTextObject->GetTextLength()); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_02, __pTab->GetOrientation(), fontSize); } - else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + } + else + { + if (isMultiline == false) { - __pTextObject->SetForegroundColor(__pTab->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength()); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); } else { - __pTextObject->SetForegroundColor(__pTab->GetTextColor(), 0, __pTextObject->GetTextLength()); + GET_SHAPE_CONFIG(TAB::ICON_TEXT_FONT_SIZE_03, __pTab->GetOrientation(), fontSize); } + } - __pTextObject->SetBounds(itemDrawTextRect); + (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize); - __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength()); - if (i < itemCount - 1) - { - DrawItemDivisionVerticalLine(pCanvas, __dividerLine); - } - DrawBadgeIcon(pDrawItem, pCanvas); + __pFont->GetTextExtent(itemText, itemText.GetLength(), textDim); + + itemDrawTextRect = itemDrawRect; + itemDrawTextRect.x = itemDrawRect.x + leftMargin; + isMultiline = false; + + if (textDim.width > (__itemWidth / 2)) + { + isMultiline = true; + textDim.width = (__itemWidth / 2); + textDim.height = textDim.height * 2; + } + + itemDrawTextRect.width = textDim.width; + itemDrawTextRect.x = itemDrawRect.x + leftMargin; + itemDrawTextRect.x = itemDrawTextRect.x + ((itemDrawRect.width - leftMargin - rightMargin) - (iconWidth + iconGap + itemDrawTextRect.width)) / 2; + itemDrawTextRect.height = textDim.height; + itemDrawIconRect = itemDrawTextRect; + itemDrawTextRect.x = itemDrawIconRect.x + iconWidth + iconGap; + + if ((pDrawItem->GetIcon()) != null) + { + itemDrawIconRect.height = itemDrawRect.height - topMargin - bottomMargin; + itemDrawIconRect.y = itemDrawIconRect.y + topMargin + (itemDrawIconRect.height - iconHeight) / 2; + + itemDrawIconRect.width = iconWidth; + itemDrawIconRect.height = iconHeight; + Bitmap* pIconBitmap = pDrawItem->GetIcon(); + + DrawResourceBitmap(*pCanvas, itemDrawIconRect, pIconBitmap); + } + else + { + itemDrawTextRect.x = itemDrawRect.x + leftMargin + (itemDrawRect.width - leftMargin - rightMargin - itemDrawTextRect.width) / 2; + } + + + if (isMultiline == false) + { + itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height) / 2; + } + else + { + itemDrawTextRect.y = itemDrawRect.y + topMargin + (itemDrawRect.height - topMargin - bottomMargin - itemDrawTextRect.height) / 2; + } + __pTextObject->SetBounds(itemDrawTextRect); + __pTextObject->Compose(); + if (itemStatus == _TABITEM_STATUS_SELECTED) + { + __pTextObject->SetForegroundColor(__pTab->GetSelectedTextColor(), 0, __pTextObject->GetTextLength()); + __selectedLine.y = itemDrawRect.height - bottomMargin; + + DrawResourceBitmap(*pCanvas, __selectedLine, __pHorizontalLineBitmap); + } + else if (itemStatus == _TABITEM_STATUS_PRESSED) + { + __pTextObject->SetForegroundColor(__pTab->GetPressedTextColor(), 0, __pTextObject->GetTextLength()); } + else if (itemStatus == _TABITEM_STATUS_HIGHLIGHTED) + { + __pTextObject->SetForegroundColor(__pTab->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength()); + } + else if (itemStatus == _TABITEM_STATUS_DISABLED) + { + __pTextObject->SetForegroundColor(__pTab->GetDisabledTextColor(), 0, __pTextObject->GetTextLength()); + } + else + { + __pTextObject->SetForegroundColor(__pTab->GetTextColor(), 0, __pTextObject->GetTextLength()); + } + + __pTextObject->SetBounds(itemDrawTextRect); + + __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + + DrawBadgeIcon(pDrawItem, pCanvas); + return; } void -_TabPresenter::DrawEditItem(const Point& point) +_TabPresenter::SetEditItemBounds(const Point& point) { _TabItem *pTabItem = null; @@ -1036,9 +1579,30 @@ _TabPresenter::DrawEditItem(const Point& point) } void -_TabPresenter::DrawItemDivisionVerticalLine(Canvas* pCanvas, Rectangle& lineRect) +_TabPresenter::DrawItemDivider(Canvas& canvas, Rectangle& lineRect) { - DrawResourceBitmap(*pCanvas, lineRect, __pVerticalLineBitmap); + Color dividerLeftHalfColor; + Color dividerRightHalfColor; + + int halfLineWidth = 0; + + GET_COLOR_CONFIG(EDITDATE::DIVIDER_LEFT_HALF, dividerLeftHalfColor); + GET_COLOR_CONFIG(EDITDATE::DIVIDER_RIGHT_HALF, dividerRightHalfColor); + + result r = E_SUCCESS; + halfLineWidth = lineRect.width / 2; + + canvas.SetForegroundColor(dividerLeftHalfColor); + canvas.SetLineWidth(halfLineWidth); + + r = canvas.DrawLine(Point(lineRect.x, lineRect.y), Point(lineRect.x, lineRect.y + lineRect.height)); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + canvas.SetForegroundColor(dividerRightHalfColor); + canvas.SetLineWidth(halfLineWidth); + + r = canvas.DrawLine(Point(lineRect.x + halfLineWidth, lineRect.y), Point(lineRect.x + halfLineWidth, lineRect.y + lineRect.height)); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); return; } @@ -1059,6 +1623,7 @@ _TabPresenter::DrawHorizontal() SysLog(NID_UI_CTRL, "itemCount is 0."); return; } + //Bound beyond which the item shouldnt move when flicked boundItemIndex = itemCount - __itemMaxCount; @@ -1105,7 +1670,7 @@ _TabPresenter::DrawBadgeIcon(_TabItem* pDrawItem, Canvas* pCanvas) Bitmap* pBadgeIcon = null; int badgeMargin = 0; GET_SHAPE_CONFIG(TAB::BADGE_ICON_MARGIN, __pTab->GetOrientation(), badgeMargin); - // Badge. + pBadgeIcon = pDrawItem->GetBadgeIcon(); if (pBadgeIcon != null) @@ -1129,6 +1694,9 @@ _TabPresenter::CalcItemBounds(void) { ClearLastResult(); + GET_SHAPE_CONFIG(TAB::SCREEN_WIDTH, __pTab->GetOrientation(), __width); + GET_SHAPE_CONFIG(TAB::SCREEN_HEIGHT, __pTab->GetOrientation(), __height); + const int itemCount = GetItemCount(); if (itemCount == 0) @@ -1172,12 +1740,12 @@ _TabPresenter::CalcItemBounds(void) } void -_TabPresenter::CalcTabBounds(bool bReset) +_TabPresenter::CalcTabBounds(bool isReset) { Rectangle bounds = __pTab->GetBounds(); - bool movable = __pTab->IsMovable(); - bool resizable = __pTab->IsResizable(); + bool isMovable = __pTab->IsMovable(); + bool isResizable = __pTab->IsResizable(); int lineHeight = 0; int tabLeftMargin = 0; @@ -1194,7 +1762,7 @@ _TabPresenter::CalcTabBounds(bool bReset) GET_SHAPE_CONFIG(TAB::HEIGHT, __pTab->GetOrientation(), lineHeight); } __lastItemIndex = (__pTab->GetItemCount() - 1); - // Only 1 line + bounds.height = lineHeight; for (int i = 0; i < (__pTab->GetItemCount()); i++) @@ -1215,8 +1783,8 @@ _TabPresenter::CalcTabBounds(bool bReset) __pTab->SetBounds(bounds); - __pTab->SetMovable(movable); - __pTab->SetResizable(resizable); + __pTab->SetMovable(isMovable); + __pTab->SetResizable(isResizable); return; @@ -1229,21 +1797,21 @@ _TabPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinf { return true; } - __currentTouchPosition = touchinfo.GetCurrentPosition(); + __currentTouchPosition = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); SetFirstLoadedItemIndex(); SetLastLoadedItemIndex(); - SetItemFitToLeft(); ResetScrollAnimationTimer(); - SetReCalculateItemBounds(false); + SetRecalculateItemBounds(false); ResetFlickAnimationTimer(); - Point point = touchinfo.GetCurrentPosition(); + Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); - const int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + const int index = GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition())); if (index == -1) { return false; } + if (GetItemStatus(index) != _TABITEM_STATUS_SELECTED) { SetItemStatus(index, _TABITEM_STATUS_PRESSED); @@ -1262,13 +1830,16 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin { return true; } - Point point = touchinfo.GetCurrentPosition(); + + Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); __scrollFlag = 0; - CancelReorderTimer(); - ResetScrollAnimationTimer(); Rectangle itemBounds(0, 0, 0, 0); _TabItem* pItem = null; - int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition()); + + ResetReorderTimer(); + ResetScrollAnimationTimer(); + int index = GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition())); + if (__pScrollingEffectVe) { __pScrollingEffectVe->RemoveAllAnimations(); @@ -1278,8 +1849,10 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin __isScrollEffectEnded = false; __isScrollEffectStarted = false; } + int pressedIndex = GetPressedItemIndex(); - __isRightScrolable = false; + __isRightScrollable = false; + if (index == -1 && !__isFlickEnabled) { SetFirstLoadedItemIndex(); @@ -1288,16 +1861,18 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin SetItemStatus(pressedIndex, _TABITEM_STATUS_NORMAL); } CalcItemBounds(); + __moveDistance = -(GetItemAt(__firstLoadedItemIndex)->GetItemBounds().x); DrawHorizontal(); __pTab->Invalidate(); + __rearIndex = 0; - __editMode = false; + __isEditMode = false; return false; } - if (__editMode && __editItemIndex == __rearIndex) + if (__isEditMode && __editItemIndex == __rearIndex) { - Rectangle bounds(0,0,0,0); + Rectangle bounds(0, 0, 0, 0); if(__editItemIndex > 0) { pItem = GetItemAt((__editItemIndex - 1)); @@ -1311,14 +1886,14 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin { CalcItemBounds(); } - } + // Edit Mode - Item Insert - if (__editMode && (__editItemIndex != __rearIndex)) + if (__isEditMode && (__editItemIndex != __rearIndex)) { index = __rearIndex; - int i = GetSelectedItemIndex(); - SetItemStatus(i, _TABITEM_STATUS_NORMAL); + int selectedIndex = GetSelectedItemIndex(); + SetItemStatus(selectedIndex, _TABITEM_STATUS_NORMAL); if (__isDirectionRight) { @@ -1350,26 +1925,28 @@ _TabPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchin // Pressed -> Selected or Normal if (GetItemStatus(index) == _TABITEM_STATUS_PRESSED && !__isFlickEnabled && !__isTouchMove) { - int i = GetSelectedItemIndex(); - SetItemStatus(i, _TABITEM_STATUS_NORMAL); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + int selectedIndex = GetSelectedItemIndex(); + SetItemStatus(selectedIndex, _TABITEM_STATUS_NORMAL); SetItemStatus(index, _TABITEM_STATUS_SELECTED); SetSelectedItemIndex(index); } else { - int i = GetPressedItemIndex(); - if (GetItemStatus(i) == _TABITEM_STATUS_PRESSED) + int pressedIndex = GetPressedItemIndex(); + if (GetItemStatus(pressedIndex) == _TABITEM_STATUS_PRESSED) { - SetItemStatus(i, _TABITEM_STATUS_NORMAL); + SetItemStatus(pressedIndex, _TABITEM_STATUS_NORMAL); } } + SetItemFitToLeft(); } __pTab->Invalidate(); __isTouchMove = false; - __editMode = false; + __isEditMode = false; __editItemIndex = -1; __rearIndex = -1; @@ -1393,17 +1970,19 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { return true; } + _TabItem *pTabItem = null; _TabItem *pNextItem = null; _TabItem *pPrevItem = null; - Point movedPosition = touchinfo.GetCurrentPosition(); + Point movedPosition = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()); int index = GetNextItemIndexFromPosition(movedPosition, __editItemIndex); SetFirstLoadedItemIndex(); SetLastLoadedItemIndex(); + //Remove the Pressed Bitmap during Touch Move int i = GetPressedItemIndex(); - if (!__editMode) + if (!__isEditMode) { if (GetItemStatus(i) == _TABITEM_STATUS_PRESSED) { @@ -1415,7 +1994,8 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) int distance; distance = movedPosition.x - __currentTouchPosition.x; __currentTouchPosition.x = movedPosition.x; - if (!__editMode && distance > 0) //Move right i.e Bounce at leftEnd + + if (!__isEditMode && distance > 0) //Move right i.e Bounce at leftEnd { __isTouchMove = true; if (!__isDirectionRight) @@ -1427,9 +2007,11 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) __pScrollingEffectVe->Destroy(); __pScrollingEffectVe = null; } + __isScrollEffectEnded = false; __isScrollEffectStarted = false; } + __isDirectionRight = true; SetFirstLoadedItemIndex(); if ( GetItemAt(0)->GetItemBounds().x >= 0) @@ -1440,17 +2022,19 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) SetOpacityVisualElement(0); StartScrollingEffect(); } + __isScrollEffectStarted = true; } + __moveDistance = distance; DrawHorizontal(); Draw(); __moveDistance = 0; - return true; } - if (!__editMode && distance < 0)//Move left i.e Bounce at RightEnd + + if (!__isEditMode && distance < 0)//Move left i.e Bounce at RightEnd { __isTouchMove = true; if (__isDirectionRight) @@ -1462,9 +2046,11 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) __pScrollingEffectVe->Destroy(); __pScrollingEffectVe = null; } + __isScrollEffectEnded = false; __isScrollEffectStarted = false; } + __isDirectionRight = false; SetLastLoadedItemIndex(); @@ -1473,14 +2059,15 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) if (!__isScrollEffectStarted) { int index = (GetItemCount() - 1); - int xPosition = (GetItemAt(index)->GetItemBounds().x + (__itemWidth/2)); + int xPosition = (GetItemAt(index)->GetItemBounds().x + (__itemWidth / 2)); __pScrollingEffectBitmap = __pRearScrollingEffectBitmap; SetOpacityVisualElement(xPosition); StartScrollingEffect(); - } + __isScrollEffectStarted = true; } + __moveDistance = distance; DrawHorizontal(); Draw(); @@ -1488,7 +2075,8 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) return true; } - if (!__editMode) + + if (!__isEditMode) { return false; } @@ -1498,10 +2086,11 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) if (!__isDirectionRight) { __isTimerCanceled = true; - __isRightScrolable = false; - __isLeftScrolable = false; - CancelReorderTimer(); + __isRightScrollable = false; + __isLeftScrollable = false; + ResetReorderTimer(); } + __isDirectionRight = true; } else @@ -1509,12 +2098,14 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) if (__isDirectionRight) { __isTimerCanceled = true; - __isLeftScrolable = false; - __isRightScrolable = false; - CancelReorderTimer(); + __isLeftScrollable = false; + __isRightScrollable = false; + ResetReorderTimer(); } + __isDirectionRight = false; } + pTabItem = GetItemAt(__editItemIndex); SysTryReturn(NID_UI_CTRL, pTabItem, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -1536,9 +2127,9 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { __timerCount = 0; } + __isTimerCanceled = false; __rearIndex = index; - } } else @@ -1547,7 +2138,7 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) SysTryReturn(NID_UI_CTRL, pPrevItem, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); Rectangle boundsPrev = pPrevItem->GetItemBounds(); - if ((bounds.x + 100) > (boundsPrev.x + 100) && ((bounds.x + 100) < (boundsPrev.x + boundsPrev.width))) + if ((bounds.x + (__itemWidth / 2)) > (boundsPrev.x + (__itemWidth / 2)) && ((bounds.x + (__itemWidth / 2)) < (boundsPrev.x + boundsPrev.width))) { __pTimerInfo[__timerCount]->index = index; StartReorderTimer(__timerCount); @@ -1556,6 +2147,7 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { __timerCount = 0; } + __isTimerCanceled = false; __rearIndex = index; @@ -1573,7 +2165,7 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) if ((pLastItem->GetItemBounds().x + pLastItem->GetItemBounds().width) > __width) { - __isRightScrolable = true; + __isRightScrollable = true; StartScrollAnimationTimer(); } } @@ -1585,14 +2177,14 @@ _TabPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { if (GetItemAt(__firstItemIndex)->GetItemBounds().x < __itemWidth) { - __isLeftScrolable = true; + __isLeftScrollable = true; StartScrollAnimationTimer(); } } } } - DrawEditItem(movedPosition); + SetEditItemBounds(movedPosition); __pTab->Invalidate(); return true; @@ -1606,6 +2198,7 @@ _TabPresenter::ShiftItems(void) int fitDistance = 0; _TabItem* pTabItem = null; Rectangle bounds(0,0,0,0); + pTabItem = GetItemAt(0); SysTryReturnVoidResult(NID_UI_CTRL, pTabItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -1617,9 +2210,9 @@ _TabPresenter::ShiftItems(void) { continue; } - if (__isRightScrolable) - { + if (__isRightScrollable) + { if (i == __rearIndex + 1) { fitDistance = -(2 * __itemWidth); @@ -1652,19 +2245,21 @@ _TabPresenter::ShiftItems(void) { return; } + pTabItem->SetItemBounds(bounds); } - if (__isRightScrolable) + if (__isRightScrollable) { __rearIndex++; } - if (__isLeftScrolable) + if (__isLeftScrollable) { __rearIndex--; } + Draw(); return; } @@ -1676,6 +2271,7 @@ _TabPresenter::OnLongPressGestureDetected(void) { return true; } + const int index = GetItemIndexFromPosition(__currentTouchPosition); if (index == -1) @@ -1687,9 +2283,10 @@ _TabPresenter::OnLongPressGestureDetected(void) { SetItemStatus(index, _TABITEM_STATUS_NORMAL); } - __editMode = true; + __isEditMode = true; __editItemIndex = index; + if (__editItemIndex == __firstItemIndex) { __firstItemIndex = __firstItemIndex + 1; @@ -1714,22 +2311,26 @@ _TabPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) return true; } - if (__editMode) + if (__isEditMode) { return true; } + if (gesture.GetDirection() != _FLICK_DIRECTION_RIGHT && gesture.GetDirection() != _FLICK_DIRECTION_LEFT) { return false; } + int distanceX = 0; int distanceY = 0; + int xPosition = 0; + int itemsBeyondScreen = 0; + gesture.GetDistance(distanceX, distanceY); SetFirstLoadedItemIndex(); SetLastLoadedItemIndex(); - int xPosition = 0; - int itemsBeyondScreen = 0; int itemCount = GetItemCount(); + if (distanceX < 0) //left { itemsBeyondScreen = (itemCount - 1) - __lastLoadedItemIndex; @@ -1749,6 +2350,7 @@ _TabPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) } } + if (itemsBeyondScreen >= (__itemMaxCount - 1)) { __flickDistance = (3 * __itemWidth); @@ -1757,6 +2359,7 @@ _TabPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) { __flickDistance = (itemsBeyondScreen * __itemWidth); } + if (distanceX < 0) //Left flick { __flickMove = 0.006; @@ -1775,6 +2378,7 @@ _TabPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) __flickFlag = 0; __moveDistance =0; } + __isFlickEnabled = true; StartFlickAnimationTimer(); @@ -1788,17 +2392,18 @@ _TabPresenter::StartFlickAnimation(void) float distance = CalculateProgress(__flickMove); __moveDistance = -(__flickDistance * distance); - __flickDistance = (__flickDistance + __moveDistance); __flickMove = __flickMove + 0.006; __flickFlag++; - if (__flickFlag <= 400) + + if (__flickFlag <= FLICK_ANIMATION_COUNT) { StartFlickAnimationTimer(); } else { ResetFlickAnimationTimer(); + SetItemFitToLeft(); } Draw(); @@ -1882,23 +2487,25 @@ _TabPresenter::ResetFlickAnimationTimer(void) } __isFlickEnabled = false; - __moveDistance =0; + __moveDistance = 0; return E_SUCCESS; } void _TabPresenter::SetItemFit(int index) { - Point pt = Point(0,0); + Point pt = Point(0, 0); int itemCount = GetItemCount(); int fitDistance = 0; _TabItem* pTabItem = null; - Rectangle bounds(0,0,0,0); + Rectangle bounds(0, 0, 0, 0); + pTabItem = GetItemAt(index); SysTryReturnVoidResult(NID_UI_CTRL, pTabItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); bounds = pTabItem->GetItemBounds(); fitDistance = -bounds.x; + for (int i = 0; i < itemCount; i++) { pTabItem = GetItemAt(i); @@ -1908,6 +2515,7 @@ _TabPresenter::SetItemFit(int index) bounds.x = bounds.x + fitDistance; pTabItem->SetItemBounds(bounds); } + return; } @@ -1928,13 +2536,13 @@ _TabPresenter::SetItemFitToRight(void) void _TabPresenter::OnTimerExpired(Timer& timer) { - if (&timer == __pFlickAnimationTimer) + if (&timer == __pFlickAnimationTimer) { StartFlickAnimation(); } + for (int i = 0; i < _TIMER_COUNT; i++) { - if (!__isTimerCanceled) { if (&timer == __pTimerInfo[i]->pReorderTimer) @@ -1943,6 +2551,7 @@ _TabPresenter::OnTimerExpired(Timer& timer) } } } + if (&timer == __pScrollAnimationTimer) { _TabItem* pLastItem = GetItemAt(__lastItemIndex); @@ -1950,33 +2559,36 @@ _TabPresenter::OnTimerExpired(Timer& timer) if ((GetItemAt(__firstItemIndex)->GetItemBounds().x >= __itemWidth)) { - __isRightScrolable = false; - __isLeftScrolable = false; + __isRightScrollable = false; + __isLeftScrollable = false; } + if ((pLastItem->GetItemBounds().x + pLastItem->GetItemBounds().width) <= __width && __isDirectionRight) { - __isRightScrolable = false; - __isLeftScrolable = false; + __isRightScrollable = false; + __isLeftScrollable = false; } - if (__isRightScrolable || __isLeftScrolable) + + if (__isRightScrollable || __isLeftScrollable) { if ((__rearIndex - 1) == __editItemIndex && !__isDirectionRight) { - if (__isLeftScrolable) + if (__isLeftScrollable) { __rearIndex--; } } + if ((__rearIndex + 1) == __editItemIndex && __isDirectionRight) { - if (__isRightScrolable) + if (__isRightScrollable) { __rearIndex++; } } + ShiftItems(); StartScrollAnimationTimer(); - } else { @@ -2048,7 +2660,7 @@ _TabPresenter::FreeHorizontalLineBitmap() result -_TabPresenter::CancelReorderTimer() +_TabPresenter::ResetReorderTimer() { for (int index = 0; index < (__pTab->GetItemCount()); index++) @@ -2061,15 +2673,18 @@ _TabPresenter::CancelReorderTimer() } } - __pAnimInfo[index]->totalDistance = __itemWidth; - __pAnimInfo[index]->move = 0.5; - __pAnimInfo[index]->reorderValue =0; + if (__pAnimInfo[index]) + { + __pAnimInfo[index]->totalDistance = __itemWidth; + __pAnimInfo[index]->move = 0.5; + __pAnimInfo[index]->reorderValue = 0; + } } return E_SUCCESS; } result -_TabPresenter::ResetReorderTimer(int index) +_TabPresenter::CancelReorderTimer(int index) { __pAnimInfo[index]->totalDistance = __itemWidth; __pAnimInfo[index]->move = 0.5; @@ -2088,21 +2703,6 @@ _TabPresenter::ResetReorderTimer(int index) return E_SUCCESS; } -result -_TabPresenter::StopReorderTimer() -{ - for (int i = 0 ; i < _TIMER_COUNT; i++) - { - if (__pTimerInfo[i]) - { - delete __pTimerInfo[i]->pReorderTimer; - __pTimerInfo[i]->pReorderTimer = null; - } - } - - return E_SUCCESS; -} - void _TabPresenter::StartReorderAnimation(int index, int timerIndex) { @@ -2117,9 +2717,10 @@ _TabPresenter::StartReorderAnimation(int index, int timerIndex) { __reorderDist = -__reorderDist; } + __pAnimInfo[index]->reorderValue++; - if (__pAnimInfo[index]->reorderValue <= 50) + if (__pAnimInfo[index]->reorderValue <= REORDER_ANIMATION_COUNT) { SwapItems(index, __reorderDist); StartReorderTimer(timerIndex); @@ -2127,7 +2728,7 @@ _TabPresenter::StartReorderAnimation(int index, int timerIndex) } else { - ResetReorderTimer(index); + CancelReorderTimer(index); } @@ -2140,7 +2741,7 @@ void _TabPresenter::SwapItems(int indexDest, int distance) { _TabItem *pItem; - Rectangle itemBounds(0,0,0,0); + Rectangle itemBounds(0, 0, 0, 0); pItem = GetItemAt(indexDest); SysTryReturnVoidResult(NID_UI_CTRL, pItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -2151,9 +2752,11 @@ _TabPresenter::SwapItems(int indexDest, int distance) int animIndex; int index; index = GetNextItemIndexFromPosition(Point(itemBounds.x,itemBounds.y), __editItemIndex); + if (distance < 0) //Moving Left { animIndex = indexDest - __lastLoadedItemIndex; + if (__pTab->GetItemCount() >= __itemMaxCount) { animIndex = animIndex + (__itemMaxCount - 1); @@ -2162,10 +2765,12 @@ _TabPresenter::SwapItems(int indexDest, int distance) { animIndex = animIndex + (__pTab->GetItemCount() - 1); } + if ((__lastLoadedItemIndex > __editItemIndex) && (indexDest < __editItemIndex)) { animIndex++; } + if ((itemBounds.x <= __pAnimInfo[animIndex]->xPosition) && (itemBounds.x >= __pAnimInfo[animIndex-1]->xPosition)) { if (index == -1 || index == indexDest) //to avoid overlaping of items on each other @@ -2174,13 +2779,16 @@ _TabPresenter::SwapItems(int indexDest, int distance) } } } + if (distance > 0) { animIndex = indexDest - __firstLoadedItemIndex; + if ((__firstLoadedItemIndex < __editItemIndex) && (indexDest > __editItemIndex)) { animIndex--; } + if ((itemBounds.x >= __pAnimInfo[animIndex]->xPosition) && (itemBounds.x <= __pAnimInfo[animIndex+1]->xPosition)) { if (index == -1 || index == indexDest) @@ -2189,6 +2797,7 @@ _TabPresenter::SwapItems(int indexDest, int distance) } } } + Draw(); return; @@ -2208,6 +2817,7 @@ _TabPresenter::GetNextItemIndexFromPosition(const Point& point, int curIndex) co } _TabItem* pItem = __pTab->GetItemAt(itemIndex); + if (pItem == null) { return -1; @@ -2220,11 +2830,14 @@ _TabPresenter::GetNextItemIndexFromPosition(const Point& point, int curIndex) co if ((point.x > itemBounds.x) && (point.x < itemBounds.x + itemBounds.width)) { if (curIndex != itemIndex) - return itemIndex; + { + return itemIndex; + } } itemIndex++; pItem = __pTab->GetItemAt(itemIndex); + if (pItem == null) { break; @@ -2243,7 +2856,8 @@ _TabPresenter::SetFirstLoadedItemIndex() { continue; } - if ((GetItemAt(i)->GetItemBounds().x + 50) <= __itemWidth) + + if ((GetItemAt(i)->GetItemBounds().x + (__itemWidth / 2)) <= __itemWidth) { __firstLoadedItemIndex = i; } @@ -2257,11 +2871,13 @@ _TabPresenter::SetLastLoadedItemIndex() for (int i = 0; i < __pTab->GetItemCount(); i++) { int X = GetItemAt(i)->GetItemBounds().x; + if (__editItemIndex == i) { continue; } - if ((X + 50) < __width) + + if ((X + (__itemWidth / 2)) < __width) { __lastLoadedItemIndex = i; } @@ -2312,12 +2928,15 @@ void _TabPresenter::OnBoundsChanged() { Rectangle bounds = __pTab->GetBounds(); + if (bounds.width <= __tabMinimumSize) { bounds.width = __tabMinimumSize; } + __pTab->SetBounds(bounds); - SetReCalculateItemBounds(true); + SetRecalculateItemBounds(true); + return; } @@ -2327,7 +2946,7 @@ _TabPresenter::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& cont { if (element.GetBounds().x < 0) { - SetReCalculateItemBounds(true); + SetRecalculateItemBounds(true); Draw(); } @@ -2367,6 +2986,7 @@ _TabPresenter::SetOpacityVisualElement(int xPosition) { Canvas * pCanvas = null; int bounceWidth = (__itemWidth / 2); + if (__pScrollingEffectVe == null) { __pScrollingEffectVe = new (std::nothrow) _VisualElement(); @@ -2375,11 +2995,13 @@ _TabPresenter::SetOpacityVisualElement(int xPosition) __pScrollingEffectVe->Construct(); __pScrollingEffectVe->SetName(L"Opacity"); } + __pScrollingEffectVe->SetBounds(FloatRectangle(xPosition, 0, bounceWidth, __itemHeight)); __pScrollingEffectVe->SetShowState(true); __pScrollingEffectVe->SetImplicitAnimationEnabled(true); __pTab->GetVisualElement()->AttachChild(*__pScrollingEffectVe); pCanvas = __pScrollingEffectVe->GetCanvasN(); + if (!pCanvas) { __pScrollingEffectVe->Destroy(); @@ -2388,6 +3010,7 @@ _TabPresenter::SetOpacityVisualElement(int xPosition) SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(GetLastResult())); return; } + Color backgroundColor(0,0,0,0); pCanvas->SetBackgroundColor(backgroundColor); pCanvas->Clear(); @@ -2404,13 +3027,14 @@ _TabPresenter::StartScrollingEffect(void) { float __startOpacity = 0.0f; float __endOpacity = 1.0f; + VisualElementPropertyAnimation* pAnimation = new (std::nothrow) VisualElementPropertyAnimation(); SysTryReturnVoidResult(NID_UI_CTRL, pAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); pAnimation->SetPropertyName(L"opacity"); pAnimation->SetStartValue(Variant(__startOpacity)); pAnimation->SetEndValue(Variant(__endOpacity)); - pAnimation->SetDuration(500); + pAnimation->SetDuration(OVERSCROLL_ANIMATION_DURATION); pAnimation->SetVisualElementAnimationStatusEventListener(this); String animationName3(L"opacity"); @@ -2423,6 +3047,32 @@ _TabPresenter::StartScrollingEffect(void) } void +_TabPresenter::OnChangeLayout(_ControlOrientation orientation) +{ + __isEditMode = false; + __isTimerCanceled = true; + __isRightScrollable = false; + __isLeftScrollable = false; + + if (__pScrollingEffectVe) + { + __pScrollingEffectVe->RemoveAllAnimations(); + __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe); + __pScrollingEffectVe->Destroy(); + __pScrollingEffectVe = null; + __isScrollEffectEnded = false; + __isScrollEffectStarted = false; + } + + ResetScrollAnimationTimer(); + ResetReorderTimer(); + ResetFlickAnimationTimer(); + SetRecalculateItemBounds(true); + + return; +} + +void _TabPresenter::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) { return; @@ -2435,7 +3085,7 @@ _TabPresenter::OnVisualElementAnimationRepeated(const VisualElementAnimation& an } void -_TabPresenter::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +_TabPresenter::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool isCompletedNormally) { return; diff --git a/src/ui/controls/FUiCtrl_TableView.cpp b/src/ui/controls/FUiCtrl_TableView.cpp index c189ceb..f4879e5 100644 --- a/src/ui/controls/FUiCtrl_TableView.cpp +++ b/src/ui/controls/FUiCtrl_TableView.cpp @@ -18,7 +18,6 @@ /** * @file FUiCtrl_TableView.cpp * @brief This file implements the _TableView class. - * @version 3.0 */ #include @@ -34,6 +33,7 @@ #include "FUiCtrl_TableViewItemProvider.h" #include "FUiCtrl_TableViewItemProviderAdaptor.h" #include "FUiCtrl_UiTableViewItemEvent.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; @@ -60,6 +60,10 @@ _TableView::_TableView(void) , __pBitmapOfEmptyTableView(null) , __pBackgroundBitmap(null) , __textOfEmptyTableView(L"Empty TableView") + , __pExpandGroupAnimation(null) + , __pCollapseGroupAnimation(null) + , __pSweptAnimation(null) + , __pRemoveItemtAnimation(null) { Color bgColor; @@ -72,8 +76,26 @@ _TableView::_TableView(void) _TableView::~_TableView(void) { - GetVisualElement()->RemoveAllAnimations(); + __pTableViewPresenter->BlockAnimationCallback(true); + if (GetVisualElement() != null) + { + __pExpandGroupAnimation->SetVisualElementAnimationTickEventListener(null); + __pExpandGroupAnimation->SetVisualElementAnimationStatusEventListener(null); + + __pCollapseGroupAnimation->SetVisualElementAnimationTickEventListener(null); + __pCollapseGroupAnimation->SetVisualElementAnimationStatusEventListener(null); + + __pSweptAnimation->SetVisualElementAnimationTickEventListener(null); + __pSweptAnimation->SetVisualElementAnimationStatusEventListener(null); + + __pRemoveItemtAnimation->SetVisualElementAnimationTickEventListener(null); + __pRemoveItemtAnimation->SetVisualElementAnimationStatusEventListener(null); + + GetVisualElement()->RemoveAllAnimations(); + } + + //SuperClass will delete. __pTableViewPresenter = null; if (__pFastScroll != null) @@ -86,6 +108,18 @@ _TableView::~_TableView(void) delete __pTableViewItemEvent; __pTableViewItemEvent = null; + + delete __pExpandGroupAnimation; + __pExpandGroupAnimation = null; + + delete __pCollapseGroupAnimation; + __pCollapseGroupAnimation = null; + + delete __pSweptAnimation; + __pSweptAnimation = null; + + delete __pRemoveItemtAnimation; + __pRemoveItemtAnimation = null; } _TableView* @@ -132,13 +166,88 @@ _TableView::Initialize(TableViewStyle style, bool itemDivider, TableViewScrollBa SetTableViewPresenter(pPresenter); SetScrollAreaAutoResizingEnabled(false); - Rectangle rect = GetBounds(); + FloatRectangle rect = GetBoundsF(); SetScrollAreaBounds(rect); SetTableViewStyle(style); SetScrollStyle(scrollStyle); SetItemDividerEnabled(itemDivider); + __pExpandGroupAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryReturn(NID_UI_CTRL, __pExpandGroupAnimation != null, false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pExpandGroupAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseInOut")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pExpandGroupAnimation->SetVisualElementAnimationTickEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pExpandGroupAnimation->SetVisualElementAnimationStatusEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pCollapseGroupAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryReturn(NID_UI_CTRL, __pCollapseGroupAnimation != null, false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pCollapseGroupAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseInOut")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pCollapseGroupAnimation->SetVisualElementAnimationTickEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pCollapseGroupAnimation->SetVisualElementAnimationStatusEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pSweptAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryReturn(NID_UI_CTRL, __pSweptAnimation != null, false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pSweptAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseInOut")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pSweptAnimation->SetVisualElementAnimationTickEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pSweptAnimation->SetVisualElementAnimationStatusEventListener(__pTableViewPresenter); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pRemoveItemtAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryReturn(NID_UI_CTRL, __pRemoveItemtAnimation != null, false, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pRemoveItemtAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseIn")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pRemoveItemtAnimation->SetVisualElementAnimationTickEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pRemoveItemtAnimation->SetVisualElementAnimationStatusEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + delete __pExpandGroupAnimation; + __pExpandGroupAnimation = null; + + delete __pCollapseGroupAnimation; + __pCollapseGroupAnimation = null; + + delete __pSweptAnimation; + __pSweptAnimation = null; + + delete __pRemoveItemtAnimation; + __pRemoveItemtAnimation = null; + return r; } @@ -151,8 +260,6 @@ _TableView::GetTableViewPresenter(void) const void _TableView::SetTableViewPresenter(const _TableViewPresenter* pPresenter) { - _ScrollPanel::SetScrollPanelPresenter(pPresenter); - __pTableViewPresenter = const_cast<_TableViewPresenter*>(pPresenter); } @@ -290,32 +397,38 @@ _TableView::ResetSweepItem(void) __pTableViewPresenter->ResetSweepItem(); } +void +_TableView::GetSweepItemIndex(int& groupIndex, int& itemIndex) const +{ + __pTableViewPresenter->GetSweepItemIndex(groupIndex, itemIndex); +} + int _TableView::GetPressedItemCount(void) { return __pTableViewPresenter->GetPressedItemCount(); } -int +float _TableView::GetTopMargin(void) const { return __pTableViewPresenter->GetTopMargin(); } result -_TableView::SetTopMargin(int topMargin) +_TableView::SetTopMargin(float topMargin) { return __pTableViewPresenter->SetTopMargin(topMargin); } -int +float _TableView::GetBottomMargin(void) const { return __pTableViewPresenter->GetBottomMargin(); } result -_TableView::SetBottomMargin(int bottomMargin) +_TableView::SetBottomMargin(float bottomMargin) { return __pTableViewPresenter->SetBottomMargin(bottomMargin); } @@ -365,7 +478,7 @@ _TableView::SetBottomDrawnItemIndex(int groupIndex, int itemIndex) } result -_TableView::ScrollByPixel(int scrollDistance) +_TableView::ScrollByPixel(float scrollDistance) { return __pTableViewPresenter->ScrollByPixel(scrollDistance); } @@ -615,10 +728,23 @@ _TableView::RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType { return E_INVALID_OPERATION; } + return __pTableViewPresenter->RefreshTableView(groupIndex, itemIndex, type, animation); } result +_TableView::RefreshAllItems(void) +{ + if (IsOnProcessing()) + { + return E_INVALID_OPERATION; + } + + return __pTableViewPresenter->RefreshAllItems(); +} + + +result _TableView::UpdateTableView(void) { if (IsOnProcessing()) @@ -631,9 +757,16 @@ _TableView::UpdateTableView(void) result _TableView::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const { + return __pTableViewPresenter->GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex); +} + +result +_TableView::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const +{ return __pTableViewPresenter->GetItemIndexFromPosition(position, groupIndex, itemIndex); } + result _TableView::SetPropertySectionColor(const Variant& sectionColor) { @@ -1006,7 +1139,7 @@ _TableView::OnBoundsChanged(void) _Scroll* pScroll = _ScrollPanel::GetScrollBar(); if (pScroll == null) { - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); pScroll = _Scroll::CreateScrollN(*this, SCROLL_DIRECTION_VERTICAL, @@ -1027,12 +1160,19 @@ _TableView::OnBoundsChanged(void) AttachSystemChild(*pScroll); } - if (__pFastScroll == null && __scrollStyle == TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL) + if (__scrollStyle == TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL) { - __pFastScroll = _FastScroll::CreateFastScrollN(*this); - if (__pFastScroll != null) + if (__pFastScroll == null) + { + __pFastScroll = _FastScroll::CreateFastScrollN(*this); + if (__pFastScroll != null) + { + AttachSystemChild(*__pFastScroll); + } + } + else { - AttachSystemChild(*__pFastScroll); + __pFastScroll->OnParentBoundsChanged(); } } } @@ -1042,7 +1182,7 @@ _TableView::OnBoundsChanged(void) if (pScroll == null) { - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); pScroll = _Scroll::CreateScrollN(*this, SCROLL_DIRECTION_VERTICAL, @@ -1147,4 +1287,31 @@ _TableView::IsOnProcessing(void) return false; } +VisualElementValueAnimation* +_TableView::GetVisualElementValueAnimation(const Tizen::Base::String& keyName) const +{ + ClearLastResult(); + + VisualElementValueAnimation* pAnimation = null; + + if (keyName == L"EXPAND_GROUP_ANIMATION") + { + pAnimation = __pExpandGroupAnimation; + } + else if (keyName == L"COLLAPSE_GROUP_ANIMATION") + { + pAnimation = __pCollapseGroupAnimation; + } + else if (keyName == L"SWEEP_ITEM_ANIMATION") + { + pAnimation = __pSweptAnimation; + } + else if (keyName == L"REMOVE_ITEM_ANIMATION") + { + pAnimation = __pRemoveItemtAnimation; + } + + return pAnimation; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TableViewImpl.cpp b/src/ui/controls/FUiCtrl_TableViewImpl.cpp index c436fd8..af1cb84 100644 --- a/src/ui/controls/FUiCtrl_TableViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_TableViewImpl.cpp @@ -25,18 +25,22 @@ #include #include #include +#include #include +#include #include +#include +#include +#include +#include #include "FUiCtrl_TableViewImpl.h" #include "FUiCtrl_TableViewItemEventArg.h" #include "FUiCtrl_TableViewItemProvider.h" -#include "FUiCtrlTableViewItem.h" -#include "FUiCtrlTableViewGroupItem.h" -#include "FUiCtrlTableViewContextItem.h" #include "FUiCtrl_FastScrollEvent.h" #include "FUiCtrl_FastScrollEventArg.h" #include "FUiCtrl_ScrollEvent.h" #include "FUiCtrl_ScrollEventArg.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" @@ -145,13 +149,13 @@ _TableViewImpl::GetCore(void) return static_cast <_TableView&>(_ControlImpl::GetCore()); } -_TableViewImpl* -_TableViewImpl::CreateTableViewImplN(Container* pPublic, Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle) + _TableViewImpl* +_TableViewImpl::CreateTableViewImplN(Container* pPublic, FloatRectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle) { result r = E_SUCCESS; ClearLastResult(); - r = GET_SIZE_INFO(TableView).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); + r = GET_SIZE_INFO(TableView).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); _TableView* pCore = _TableView::CreateTableViewN(style, itemDivider, scrollStyle); @@ -172,23 +176,6 @@ CATCH: return null; } -_TableViewImpl* -_TableViewImpl::CreateTableViewImplN(TableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle) -{ - return _TableViewImpl::CreateTableViewImplN(static_cast(pPublic), bounds, style, itemDivider, scrollStyle); -} -_TableViewImpl* -_TableViewImpl::CreateGroupedTableViewImplN(GroupedTableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle) -{ - return _TableViewImpl::CreateTableViewImplN(static_cast(pPublic), bounds, style, itemDivider, scrollStyle); -} -_TableViewImpl* -_TableViewImpl::CreateSectionTableViewImplN(SectionTableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle) -{ - return _TableViewImpl::CreateTableViewImplN(static_cast(pPublic), bounds, style, itemDivider, scrollStyle); -} - - void _TableViewImpl::SetPublic(TableViewStyle style, Container *pPublic) { @@ -215,14 +202,19 @@ _TableViewImpl::SetSimpleStyleItemProvider(ITableViewItemProvider* pProvider) TableViewStyle style = GetCore().GetTableViewStyle(); SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_SIMPLE, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SIMPLE"); - _TableViewItemProvider* pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); - SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + _TableViewItemProvider* pItemProvider = null; - result r = pItemProvider->SetSimpleStyleItemProvider(pProvider); - if (r != E_SUCCESS) + if (pProvider != null) { - delete pItemProvider; - SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetSimpleStyleItemProvider(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } } return GetCore().SetItemProvider(pItemProvider); @@ -234,33 +226,116 @@ _TableViewImpl::SetGroupedStyleItemProvider(IGroupedTableViewItemProvider* pProv TableViewStyle style = GetCore().GetTableViewStyle(); SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_GROUPED, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_GROUPED"); - _TableViewItemProvider* pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); - SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + _TableViewItemProvider* pItemProvider = null; - result r = pItemProvider->SetGroupedStyleItemProvider(pProvider); - if (r != E_SUCCESS) + if (pProvider != null) { - delete pItemProvider; - SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetGroupedStyleItemProvider(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } } return GetCore().SetItemProvider(pItemProvider); } -// + result _TableViewImpl::SetSectionStyleItemProvider(ISectionTableViewItemProvider* pProvider) { TableViewStyle style = GetCore().GetTableViewStyle(); SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_SECTION, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); - _TableViewItemProvider* pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); - SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + _TableViewItemProvider* pItemProvider = null; + + if (pProvider != null) + { + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetSectionStyleItemProvider(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } + + return GetCore().SetItemProvider(pItemProvider); +} + +result +_TableViewImpl::SetSimpleStyleItemProviderF(ITableViewItemProviderF* pProvider) +{ + TableViewStyle style = GetCore().GetTableViewStyle(); + SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_SIMPLE, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SIMPLE"); + + _TableViewItemProvider* pItemProvider = null; + + if (pProvider != null) + { + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style, true); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetSimpleStyleItemProviderF(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } + + return GetCore().SetItemProvider(pItemProvider); +} + +result +_TableViewImpl::SetGroupedStyleItemProviderF(IGroupedTableViewItemProviderF* pProvider) +{ + TableViewStyle style = GetCore().GetTableViewStyle(); + SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_GROUPED, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_GROUPED"); + + _TableViewItemProvider* pItemProvider = null; + + if (pProvider != null) + { + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style, true); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetGroupedStyleItemProviderF(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } + + return GetCore().SetItemProvider(pItemProvider); + +} + +result +_TableViewImpl::SetSectionStyleItemProviderF(ISectionTableViewItemProviderF* pProvider) +{ + TableViewStyle style = GetCore().GetTableViewStyle(); + SysTryReturn(NID_UI_CTRL, style == TABLE_VIEW_STYLE_SECTION, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + + _TableViewItemProvider* pItemProvider = null; - result r = pItemProvider->SetSectionStyleItemProvider(pProvider); - if (r != E_SUCCESS) + if (pProvider != null) { - delete pItemProvider; - SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + pItemProvider = _TableViewItemProvider::CreateTableViewItemProviderN(style, true); + SysTryReturn(NID_UI_CTRL, pItemProvider != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + result r = pItemProvider->SetSectionStyleItemProviderF(pProvider); + if (r != E_SUCCESS) + { + delete pItemProvider; + SysTryReturn(NID_UI_CTRL, false, r, r, "[%s] Propagating.", GetErrorMessage(r)); + } } return GetCore().SetItemProvider(pItemProvider); @@ -431,6 +506,18 @@ _TableViewImpl::RemoveScrollEventListener(IScrollEventListener& listener) } result +_TableViewImpl::AddScrollEventListener(IScrollEventListenerF& listener) +{ + return E_SUCCESS; +} + +result +_TableViewImpl::RemoveScrollEventListener(IScrollEventListenerF& listener) +{ + return E_SUCCESS; +} + +result _TableViewImpl::SetSweepEnabled(bool enable) { GetCore().SetSweepEnabled(enable); @@ -474,12 +561,12 @@ _TableViewImpl::ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemA } result -_TableViewImpl::ScrollByPixel(int scrollDistance) +_TableViewImpl::ScrollByPixel(float scrollDistance) { return GetCore().ScrollByPixel(scrollDistance); } -int +float _TableViewImpl::GetCurrentScrollPosition(void) const { return GetCore().GetScrollPosition(); @@ -540,6 +627,12 @@ _TableViewImpl::RefreshTableView(int groupIndex, int itemIndex, TableViewRefresh } result +_TableViewImpl::RefreshAllItems(void) +{ + return GetCore().RefreshAllItems(); +} + +result _TableViewImpl::UpdateTableView(void) { return GetCore().UpdateTableView(); @@ -548,6 +641,12 @@ _TableViewImpl::UpdateTableView(void) result _TableViewImpl::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const { + return GetItemIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(position), groupIndex, itemIndex); +} + +result +_TableViewImpl::GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const +{ return GetCore().GetItemIndexFromPosition(position, groupIndex, itemIndex); } @@ -798,7 +897,7 @@ _TableViewImpl::OnScrollEndReached(_Control& source, ScrollEndEvent type) } void -_TableViewImpl::OnScrollPositionChanged(_Control& source, int scrollPosition) +_TableViewImpl::OnScrollPositionChanged(_Control& source, float scrollPosition) { if (__pScrollEvent != null) { diff --git a/src/ui/controls/FUiCtrl_TableViewItem.cpp b/src/ui/controls/FUiCtrl_TableViewItem.cpp index ed9be1a..5e64dc9 100644 --- a/src/ui/controls/FUiCtrl_TableViewItem.cpp +++ b/src/ui/controls/FUiCtrl_TableViewItem.cpp @@ -30,6 +30,8 @@ #include "FUiAnim_ControlVisualElement.h" #include "FUiCtrl_TableViewItem.h" #include "FUiCtrl_TableView.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" using namespace Tizen::Base; using namespace Tizen::Base::Runtime; @@ -40,7 +42,135 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { -_TableViewItem::_TableViewItem(int itemHeight) +_TableViewItemControl::_TableViewItemControl(void) + :__pBackgroundBitmap(null) +{ +} + +_TableViewItemControl::~_TableViewItemControl(void) +{ + delete __pBackgroundBitmap; + __pBackgroundBitmap = null; + + ClearLastResult(); +} + +void +_TableViewItemControl::OnDraw(void) +{ + Bitmap* pBitmap = GetBackgroundBitmap(); + + FloatRectangle bounds(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height); // +++ check floating + + Color bgColor = GetBackgroundColor(); + + Canvas* pCanvas = null; + + if (pBitmap != null) + { + pCanvas = GetCanvasN(); + if (pCanvas == null) + { + SysLog(NID_UI_CTRL, "Cannot get a canvas."); + + return; + } + + pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->Clear(); + + if (pBitmap->IsNinePatchedBitmap()) + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), *pBitmap); // +++ check floating + } + else + { + FloatRectangle drawingRect(0.0f, 0.0f, bounds.width, bounds.height); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(drawingRect), *pBitmap); // +++ check floating + } + + } + else + { + if (IsCalledGetCanvasN() == false) + { + GetVisualElement()->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255)); + } + else + { + pCanvas = GetCanvasN(); + if (pCanvas == null) + { + SysLog(NID_UI_CTRL, "Cannot get a canvas."); + + return; + } + + pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->Clear(); + pCanvas->FillRectangle(GetBackgroundColor(), _CoordinateSystemUtils::ConvertToInteger(bounds)); // +++ check floating + } + } + + if (pCanvas) + { + delete pCanvas; + } + + return; +} + +HitTestResult +_TableViewItemControl::HitTest(const Graphics :: FloatPoint & point) +{ + return HIT_TEST_NOWHERE; +} + +_TableViewItemControl* +_TableViewItemControl::CreateTableViewItemControlN(void) +{ + _TableViewItemControl* pItemControl = new (std::nothrow) _TableViewItemControl(); + SysTryReturn(NID_UI_CTRL, pItemControl, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); + SysTryCatch(NID_UI_CTRL, GetLastResult() == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + pItemControl->AcquireHandle(); + + return pItemControl; + +CATCH: + delete pItemControl; + return null; +} + +result +_TableViewItemControl::SetBackgroundBitmap(const Bitmap& bitmap) +{ + result r = E_SYSTEM; + + Bitmap* pClonedBitmap = _BitmapImpl::CloneN(bitmap); + + if (pClonedBitmap) + { + if (__pBackgroundBitmap != null) + { + delete __pBackgroundBitmap; + } + + __pBackgroundBitmap = pClonedBitmap; + + r = E_SUCCESS; + } + + return r; +} + +Bitmap* +_TableViewItemControl::GetBackgroundBitmap(void) const +{ + return __pBackgroundBitmap; +} + +_TableViewItem::_TableViewItem(float itemHeight) : _Control() , __pAppInfo(null) , __refCount(1) @@ -64,25 +194,42 @@ _TableViewItem::_TableViewItem(int itemHeight) , __pItemDivider(null) , __pItemTopDivider(null) , __pItemAnnex(null) - , __itemWidth(0) + , __pItemCover(null) + , __pItemAnnexLeftDivider(null) + , __pItemAnnexRightDivider(null) + , __itemWidth(0.0f) , __pDrawingProperty(null) , __itemDividerEnabled(true) , __pSimpleItemText(null) , __pSimpleItemBitmap(null) , __simpleItemTextSize(0) , __pDimLayer(null) - , __touchStartPosition(0, 0) - , __isTouchMoved(false) + , __touchStartPosition(0.0f, 0.0f) + , __annexOnOffTouchPosition(0) + , __annexOnOffHandlerMoved(false) + , __annexOnOffHandlerLastPosition(0.0f) , __childControlCenterAlign(false) - , __customHeight(0) + , __customHeight(0.0f) , __animationCount(0) , __pAccessibilityElement(null) + , __pPressedTimer(null) + , __isPressedTimerEnabled(false) + , __pressedControl(TABLE_VIEW_ITEM_PRESSED_NONE) , __pCheckedTimer(null) , __isCheckedTimerEnabled(false) , __isCheckedAnimationEnabled(false) , __checkedCount(0) - , __checkedBounds(Rectangle(0, 0, 0, 0)) + , __checkedBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __isItemLayoutEnabled(false) + , __isMoveItemAnimationEnabled(false) + , __isZoomInOutItemAnimationEnabled(false) + , __isFadeInOutItemAnimationEnabled(false) + , __isAnimationCallbackBlocked(false) , __pHighlightVisualElement(null) + , __pBitmapVisualElement(null) + , __pMoveItemAnimation(null) + , __pZoomInOutItemAnimation(null) + , __pFadeInOutItemtAnimation(null) { for (int i = 0; i < 3; i++) { @@ -111,9 +258,20 @@ _TableViewItem::_TableViewItem(int itemHeight) _TableViewItem::~_TableViewItem() { + __isAnimationCallbackBlocked = true; + _VisualElement* pVisualElement = GetVisualElement(); if (pVisualElement != null) { + __pMoveItemAnimation->SetVisualElementAnimationTickEventListener(null); + __pMoveItemAnimation->SetVisualElementAnimationStatusEventListener(null); + + __pZoomInOutItemAnimation->SetVisualElementAnimationTickEventListener(null); + __pZoomInOutItemAnimation->SetVisualElementAnimationStatusEventListener(null); + + __pFadeInOutItemtAnimation->SetVisualElementAnimationTickEventListener(null); + __pFadeInOutItemtAnimation->SetVisualElementAnimationStatusEventListener(null); + pVisualElement->RemoveAllAnimations(); } @@ -131,6 +289,14 @@ _TableViewItem::~_TableViewItem() __pHighlightVisualElement = null; } + if (__pBitmapVisualElement != null) + { + __pBitmapVisualElement->RemoveAllAnimations(); + __pBitmapVisualElement->SetAnimationProvider(null); + __pBitmapVisualElement->Destroy(); + __pBitmapVisualElement = null; + } + DetachAllChildren(); if (GetParent() != null && __isContextItem == true) @@ -144,12 +310,38 @@ _TableViewItem::~_TableViewItem() delete __pItemTopDivider; __pItemTopDivider = null; + delete __pItemAnnexLeftDivider; + __pItemAnnexLeftDivider = null; + + delete __pItemAnnexRightDivider; + __pItemAnnexRightDivider = null; + delete __pItemAnnex; __pItemAnnex = null; delete __pDimLayer; __pDimLayer = null; + delete __pItemCover; + __pItemCover = null; + + delete __pMoveItemAnimation; + __pMoveItemAnimation = null; + + delete __pZoomInOutItemAnimation; + __pZoomInOutItemAnimation = null; + + delete __pFadeInOutItemtAnimation; + __pFadeInOutItemtAnimation = null; + + if (__isPressedTimerEnabled) + { + __pPressedTimer->Cancel(); + } + + delete __pPressedTimer; + __pPressedTimer = null; + if (__isCheckedTimerEnabled) { __pCheckedTimer->Cancel(); @@ -165,12 +357,13 @@ _TableViewItem::~_TableViewItem() { pContainer->RemoveAllElement(); } + __pAccessibilityElement->Activate(false); __pAccessibilityElement = null; } } _TableViewItem* -_TableViewItem::CreateTableViewItemN(int itemHeight) +_TableViewItem::CreateTableViewItemN(float itemHeight) { result r = E_SUCCESS; @@ -198,6 +391,9 @@ _TableViewItem::Initialize(void) result r = E_SUCCESS; + CreateItemDivider(); + CreateItemAnnexDivider(); + __pHighlightVisualElement = new (std::nothrow) _VisualElement(); SysTryCatch(NID_UI_CTRL, __pHighlightVisualElement != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -219,9 +415,54 @@ _TableViewItem::Initialize(void) __pHighlightVisualElement->SetShowState(true); r = __individualSelectionControls.Construct(DEFAULT_CAPTURED_CONTROL_COUNT); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to construct ArrayList", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct ArrayList", GetErrorMessage(r)); + + SetTouchPressThreshold(INSENSITIVE); + + __pMoveItemAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryCatch(NID_UI_CTRL, __pMoveItemAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pMoveItemAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseInOut")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pMoveItemAnimation->SetVisualElementAnimationTickEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pMoveItemAnimation->SetVisualElementAnimationStatusEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pZoomInOutItemAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryCatch(NID_UI_CTRL, __pZoomInOutItemAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pZoomInOutItemAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseIn")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE); + __pZoomInOutItemAnimation->SetVisualElementAnimationTickEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pZoomInOutItemAnimation->SetVisualElementAnimationStatusEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pFadeInOutItemtAnimation = new (std::nothrow) VisualElementValueAnimation; + SysTryCatch(NID_UI_CTRL, __pFadeInOutItemtAnimation != null, , E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + __pFadeInOutItemtAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName("EaseIn")); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pFadeInOutItemtAnimation->SetVisualElementAnimationTickEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pFadeInOutItemtAnimation->SetVisualElementAnimationStatusEventListener(this); + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); return r; @@ -234,6 +475,15 @@ CATCH: __pHighlightVisualElement = null; } + delete __pMoveItemAnimation; + __pMoveItemAnimation = null; + + delete __pZoomInOutItemAnimation; + __pZoomInOutItemAnimation = null; + + delete __pFadeInOutItemtAnimation; + __pFadeInOutItemtAnimation = null; + return r; } @@ -293,8 +543,75 @@ _TableViewItem::CreateItemDimLayer(void) return r; } +result +_TableViewItem::CreateItemDivider(void) +{ + result r = E_SUCCESS; + + if (__pItemDivider == null) + { + __pItemDivider = _TableViewItemControl::CreateTableViewItemControlN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, __pItemDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + AttachSystemChild(*__pItemDivider); + } + + if (__pItemTopDivider == null) + { + __pItemTopDivider = _TableViewItemControl::CreateTableViewItemControlN(); + SysTryReturn(NID_UI_CTRL, __pItemTopDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + AttachSystemChild(*__pItemTopDivider); + } + + return r; +} + +result +_TableViewItem::CreateItemAnnexDivider(void) +{ + result r = E_SUCCESS; + + if (__pItemAnnexLeftDivider == null) + { + __pItemAnnexLeftDivider = _TableViewItemControl::CreateTableViewItemControlN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, __pItemAnnexLeftDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + AttachSystemChild(*__pItemAnnexLeftDivider); + } + + if (__pItemAnnexRightDivider == null) + { + __pItemAnnexRightDivider = _TableViewItemControl::CreateTableViewItemControlN(); + SysTryReturn(NID_UI_CTRL, __pItemAnnexRightDivider != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + AttachSystemChild(*__pItemAnnexRightDivider); + } + + return r; +} + +result +_TableViewItem::CreateItemCover(void) +{ + result r = E_SUCCESS; + + if (__pItemCover == null) + { + __pItemCover = _TableViewItemControl::CreateTableViewItemControlN(); + r = GetLastResult(); + SysTryReturn(NID_UI_CTRL, __pItemCover != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + AttachSystemChild(*__pItemCover); + } + + return r; +} + void -_TableViewItem::ExposeContextItem(Rectangle itemBounds, int targetWidth) +_TableViewItem::ExposeContextItem(FloatRectangle itemBounds, float targetWidth) { DrawItemDivider(); if (__pDimLayer == null) @@ -309,22 +626,23 @@ _TableViewItem::ExposeContextItem(Rectangle itemBounds, int targetWidth) bool visible = true; - if ((itemBounds.width <= 0) || (itemBounds.width >= targetWidth)) + if ((itemBounds.width <= 0) || (itemBounds.width >= targetWidth)) // +++ check floating { visible = false; } if (visible) { - int rightMargin = 0; + float rightMargin = 0.0f; float dimLayerOpacity = 0.0f; - GET_SHAPE_CONFIG(TABLEVIEW::CONTEXTITEM_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, rightMargin); + GET_SHAPE_CONFIG(TABLEVIEW::CONTEXTITEM_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, rightMargin); + dimLayerOpacity = BACKGROUND_DIMMED_OPACITY - ((itemBounds.width * BACKGROUND_DIMMED_OPACITY) / (targetWidth - rightMargin)); - dimLayerOpacity = ((dimLayerOpacity < 0) ? 0 : dimLayerOpacity); + dimLayerOpacity = ((dimLayerOpacity < 0) ? 0 : dimLayerOpacity); // +++ check floating - __pDimLayer->SetBounds(Rectangle(0, 0, itemBounds.width, itemBounds.height)); - __pDimLayer->SetBackgroundColor(Color(0, 0, 0, dimLayerOpacity * 0xff)); + __pDimLayer->SetBounds(FloatRectangle(0.0f, 0.0f, itemBounds.width, itemBounds.height)); + __pDimLayer->SetBackgroundColor(Color(0.0f, 0.0f, 0.0f, dimLayerOpacity * 0xff)); } __pDimLayer->SetVisibleState(visible); @@ -344,8 +662,8 @@ _TableViewItem::DrawItemDimLayer(bool visible) if (visible) { - Dimension itemSize = GetSize(); - __pDimLayer->SetBounds(Rectangle(0, 0, itemSize.width, itemSize.height)); + FloatDimension itemSize = GetSizeF(); + __pDimLayer->SetBounds(FloatRectangle(0.0f, 0.0f, itemSize.width, itemSize.height)); __pDimLayer->SetBackgroundColor(Color(0, 0, 0, BACKGROUND_DISABLED_OPACITY * 0xff)); } @@ -353,7 +671,7 @@ _TableViewItem::DrawItemDimLayer(bool visible) } void -_TableViewItem::SetItemWidth(int width) +_TableViewItem::SetItemWidth(float width) { __itemWidth = width; } @@ -369,9 +687,52 @@ _TableViewItem::SetItemBackgroundBitmap(ListItemState itemState, const Bitmap* p delete __pItemBgBitmap[itemState]; __pItemBgBitmap[itemState] = pCopyBitmap; - SetItemChanged(true); + if(__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] == null && + __pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED] == null && + __pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED] == null) + { + if(__pBitmapVisualElement != null) + { + __pBitmapVisualElement->Destroy(); + __pBitmapVisualElement = null; + } + } + else + { + if(__pBitmapVisualElement == null) + { + FloatRectangle bounds = GetBoundsF(); + result r = E_SUCCESS; + + __pBitmapVisualElement = new (std::nothrow) _VisualElement(); + SysTryCatch(NID_UI_CTRL, __pBitmapVisualElement != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + r = __pBitmapVisualElement->Construct(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pBitmapVisualElement->SetSurfaceOpaque(false); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set surface opaque.", GetErrorMessage(r)); + + __pBitmapVisualElement->SetImplicitAnimationEnabled(false); + __pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); + __pBitmapVisualElement->SetShowState(true); + + GetVisualElement()->AttachChild(*__pBitmapVisualElement); + } + } + + SetItemChanged(true); return true; +CATCH: + if (__pBitmapVisualElement != null) + { + __pBitmapVisualElement->RemoveAllAnimations(); + __pBitmapVisualElement->SetAnimationProvider(null); + __pBitmapVisualElement->Destroy(); + __pBitmapVisualElement = null; + } + return false; } Tizen::Graphics::Bitmap* @@ -425,10 +786,22 @@ _TableViewItem::GetItemHeight(void) const return GetSize().height; } +float +_TableViewItem::GetItemHeightF(void) const +{ + return GetSizeF().height; +} + void _TableViewItem::SetItemHeight(int itemHeight) { - SetSize(Dimension(GetSize().width, itemHeight)); + SetItemHeight(_CoordinateSystemUtils::ConvertToFloat(itemHeight)); +} + +void +_TableViewItem::SetItemHeight(float itemHeight) +{ + SetSize(FloatDimension(GetSizeF().width, itemHeight)); } void @@ -495,6 +868,14 @@ _TableViewItem::SetItemType(const TableViewItemType itemType) { __pContextItem->SetItemType(__itemType); } + + if(__pDrawingProperty != null) + { + if (__pDrawingProperty->sectionStyleEnabled == true) + { + CreateItemCover(); + } + } } void @@ -528,19 +909,6 @@ void _TableViewItem::SetReorderMode(bool enabled) { __reorderMode = enabled; - - if (GetItemStyle() != TABLE_VIEW_ANNEX_STYLE_NORMAL) - { - if (__pItemAnnex != null) - { - __pItemAnnex->SetVisibleState(!enabled); - } - else - { - SetItemChanged(true); - Invalidate(); - } - } } void @@ -567,6 +935,12 @@ _TableViewItem::IsItemChanged(void) const return __itemChanged; } +bool +_TableViewItem::IsAnnexOnOffSliding(void) +{ + return __annexOnOffHandlerMoved; +} + TableViewAnnexStyle _TableViewItem::GetItemStyle(void) const { @@ -574,13 +948,13 @@ _TableViewItem::GetItemStyle(void) const } bool -_TableViewItem::DrawItem(Rectangle& rcItem, ListItemState itemState, bool itemDivider) +_TableViewItem::DrawItem(FloatRectangle& rcItem, ListItemState itemState, bool itemDivider) { return true; } void -_TableViewItem::FireItemEvent(bool selectedBody) +_TableViewItem::FireItemEvent(bool selectedItem) { if (HasParent() == false) { @@ -602,7 +976,8 @@ _TableViewItem::FireItemEvent(bool selectedBody) if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) - || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)) + || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING) + || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)) { if (IsChecked()) { @@ -615,12 +990,14 @@ _TableViewItem::FireItemEvent(bool selectedBody) } else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) { - if (!selectedBody) + if (!selectedItem) { eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_MORE; } } + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP); + __checkItemHeightNeeded = true; int groupIndex = -1; @@ -654,24 +1031,20 @@ _TableViewItem::FireItemSweepEvent(TableViewSweepDirection direction) bool _TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - if (&source != this || IsAnimationPlaying()) - { - return false; - } - - if (IsContextItem() || __isContextItemActivated) + if (IsContextItem() || + __isContextItemActivated || + IsAnimationPlaying()) { return true; } - __isTouchMoved = false; - __touchStartPosition = touchinfo.GetCurrentPosition(); + __annexOnOffHandlerMoved = false; + __touchStartPosition = touchinfo.GetCurrentPosition(); // +++ check floating + __itemSelected = true; - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED; - SetItemChanged(true); - Invalidate(); + StartTouchPressedTimer(source, touchinfo); return true; } @@ -679,235 +1052,192 @@ _TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchin bool _TableViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { - if (&source != this) + if(IsReorderMode()) { - return false; + return true; } - bool fireEvent = false; - - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; - - if (__itemSelected == true) + if (__isPressedTimerEnabled) { - if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) - || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) - || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)) - { - bool checked = IsChecked(); - SetChecked(!checked); - SetCheckedAnimationEnabled(!checked); - } - - fireEvent = true; + StopTouchPressedTimer(); } - SetItemChanged(true); - Invalidate(); - - __itemSelected = false; - - if (fireEvent) - { - FireItemEvent(true); - } + bool fireItemEvent = false; + bool selectedItem = true; - return true; -} + __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; -bool -_TableViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) -{ if (__itemSelected == true) { - Point touchPosition = touchinfo.GetCurrentPosition(); - - __isTouchMoved = true; - - __itemSelected = false; - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; - - SetItemChanged(true); - Invalidate(); - } - - return false; -} - -bool -_TableViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) -{ - if (&source != this) - { - return false; - } - - __isTouchMoved = false; + bool checked = IsChecked(); - __itemSelected = false; - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; - - if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) - { - SetChecked(false); - } - - SetItemChanged(true); - Invalidate(); - - return true; -} - -_UiTouchEventDelivery -_TableViewItem::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo) -{ - if (__isContextItemActivated || IsAnimationPlaying() || !IsValidSelectionState()) - { - return _UI_TOUCH_EVENT_DELIVERY_YES; - } - - __itemSelected = true; - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED; - - __isTouchMoved = false; - __touchStartPosition = touchinfo.GetCurrentPosition(); - - if (__selectionStyle == TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE && !IsIndividualSelectionEnabled(source)) - { - if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) && (&source == __pItemAnnex)) - { - SetChecked(true); - DrawAnnexStyle(); - } - else - { - SetItemChanged(true); - Invalidate(); - } - } - else - { - if (&source == __pItemAnnex) - { - if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) - { - SetChecked(true); - DrawAnnexStyle(); - } - else - { - SetItemChanged(true); - Invalidate(); - } - } - } - - return _UI_TOUCH_EVENT_DELIVERY_YES; -} - -_UiTouchEventDelivery -_TableViewItem::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo) -{ - if (__isContextItemActivated) - { - return _UI_TOUCH_EVENT_DELIVERY_YES; - } - - int selectedBody = true; - bool fireItemEvent = false; - - __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; - - if (__itemSelected == true) - { - if (__selectionStyle == TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE && !IsIndividualSelectionEnabled(source)) + if (&source == this) { if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)) { - bool checked = IsChecked(); SetChecked(!checked); SetCheckedAnimationEnabled(!checked); } - else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) + } + else if(&source == __pItemAnnex) + { + if (__selectionStyle == TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE) { - if (&source == __pItemAnnex) + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) { - SetChecked(!IsChecked()); - - selectedBody = false; + SetChecked(false); + DrawAnnexStyle(); + selectedItem = false; + } + else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || + __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + AdjustAnnexOnOffHandlerPosition(); + } + else + { + SetChecked(!checked); + SetCheckedAnimationEnabled(!checked); } } - - SetItemChanged(true); - Invalidate(); - - fireItemEvent = true; - } - else - { - if (&source == __pItemAnnex) + else { - bool checked = IsChecked(); SetChecked(!checked); SetCheckedAnimationEnabled(!checked); if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) { + SetChecked(false); DrawAnnexStyle(); - selectedBody = false; + selectedItem = false; } - else + else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || + __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) { - Invalidate(); + AdjustAnnexOnOffHandlerPosition(); + } + } + } + else + { + if(!IsIndividualSelectionEnabled(source)) + { + if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) + || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) + || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING)) + { + SetChecked(!checked); + SetCheckedAnimationEnabled(!checked); } + } + } + + SetItemChanged(true); + Invalidate(); + fireItemEvent = true; + } + else + { + if (&source == __pItemAnnex) + { + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || + __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + AdjustAnnexOnOffHandlerPosition(); fireItemEvent = true; } } } __itemSelected = false; + __annexOnOffHandlerMoved = false; if (fireItemEvent) { - FireItemEvent(selectedBody); + FireItemEvent(selectedItem); } - return _UI_TOUCH_EVENT_DELIVERY_YES; + return true; } -_UiTouchEventDelivery -_TableViewItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) +bool +_TableViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { - if (__itemSelected == true) + if(IsReorderMode()) { - Point touchPosition = touchinfo.GetCurrentPosition(); + return false; + } - __isTouchMoved = true; + if (__isPressedTimerEnabled) + { + StopTouchPressedTimer(); + } + bool retVal = false; + + if (&source == this) + { __itemSelected = false; __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; SetItemChanged(true); Invalidate(); } - else + else if (&source == __pItemAnnex) { - if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED && IsChecked()) + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) { SetChecked(false); DrawAnnexStyle(); } + else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || + __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + __annexOnOffHandlerMoved = true; + DrawAnnexOnOffHandler(touchinfo.GetCurrentPosition().x); // +++ check floating + retVal = true; + } + else + { + __itemSelected = false; + __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; + + SetItemChanged(true); + Invalidate(); + } + } + else + { + if(!IsIndividualSelectionEnabled(source)) + { + __itemSelected = false; + __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; + + SetItemChanged(true); + Invalidate(); + } } - return _UI_TOUCH_EVENT_DELIVERY_YES; + + return retVal; } -_UiTouchEventDelivery -_TableViewItem::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) +bool +_TableViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) { - __isTouchMoved = false; + if (&source != this) + { + return false; + } + + if (__isPressedTimerEnabled) + { + StopTouchPressedTimer(); + } + + __annexOnOffHandlerMoved = false; __itemSelected = false; __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL; @@ -920,7 +1250,32 @@ _TableViewItem::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& SetItemChanged(true); Invalidate(); - return _UI_TOUCH_EVENT_DELIVERY_YES; + return true; +} + +_UiTouchEventDelivery +_TableViewItem::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo) +{ + + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; +} + +_UiTouchEventDelivery +_TableViewItem::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; +} + +_UiTouchEventDelivery +_TableViewItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; +} + +_UiTouchEventDelivery +_TableViewItem::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) +{ + return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES; } void @@ -932,8 +1287,8 @@ _TableViewItem::OnDraw(void) DrawAnnexStyle(); DrawItemDivider(); DrawSimpleItem(); + DrawSectionStyleBackgroundCover(); - SetAccessibilityElement(); SetItemChanged(false); } } @@ -945,7 +1300,7 @@ _TableViewItem::OnChildAttached(const _Control& child) pContainer->Activate(false); _Control* pControl = const_cast<_Control*>(&child); - pControl->SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_INSENSITIVE); + pControl->SetTouchPressThreshold(INSENSITIVE); if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)) { @@ -954,9 +1309,9 @@ _TableViewItem::OnChildAttached(const _Control& child) return; } - Rectangle bounds = child.GetBounds(); - int leftMargin = 0; - int annexWidth = 0; + FloatRectangle bounds = child.GetBoundsF(); + float leftMargin = 0.0f; + float annexWidth = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); @@ -964,6 +1319,10 @@ _TableViewItem::OnChildAttached(const _Control& child) bounds.x += (leftMargin * 2) + annexWidth; pControl->SetBounds(bounds); } + else if((__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)) + { + pControl->SetTouchPressThreshold(SENSITIVE); + } } void @@ -978,6 +1337,7 @@ _TableViewItem::OnChildDetached(const _Control& child) { __pSimpleItemText = null; } + if (&child == __pSimpleItemBitmap) { __pSimpleItemBitmap = null; @@ -1011,6 +1371,133 @@ _TableViewItem::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) __isCheckedTimerEnabled = false; } } + else if (&timer == __pPressedTimer) + { + __isPressedTimerEnabled = false; + + __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED; + + if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM) + { + SetItemChanged(true); + Invalidate(); + } + else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX) + { + if (__selectionStyle == TABLE_VIEW_ITEM_SELECTION_STYLE_WHOLE) + { + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) + { + SetChecked(true); + DrawAnnexStyle(); + } + else if (__annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING && + __annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + SetItemChanged(true); + Invalidate(); + } + } + else + { + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) + { + SetChecked(true); + DrawAnnexStyle(); + } + else + { + SetItemChanged(true); + Invalidate(); + } + } + } + else + { + if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL) + { + SetItemChanged(true); + Invalidate(); + } + } + } +} + +result +_TableViewItem::StartTouchPressedTimer(const _Control& source, const _TouchInfo& touchinfo) +{ + result r = E_SUCCESS; + + if (__pPressedTimer == null) + { + __pPressedTimer = new (std::nothrow) Timer(); + SysTryCatch(NID_UI_CTRL, __pPressedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + r = __pPressedTimer->Construct(*this); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage); + } + + if (__isPressedTimerEnabled == false) + { + r = __pPressedTimer->Start(TOUCH_PRESSED_DURATION); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage); + + __isPressedTimerEnabled = true; + + if (&source == this) + { + __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM; + } + else if (&source == __pItemAnnex) + { + __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX; + + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || + __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER) + { + __annexOnOffTouchPosition = touchinfo.GetCurrentPosition().x; // +++ check floating + } + } + else if (IsIndividualSelectionEnabled(source)) + { + __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL; + } + else + { + __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE; + } + } + + return r; + +CATCH: + if (__isPressedTimerEnabled) + { + __pPressedTimer->Cancel(); + } + + delete __pPressedTimer; + __pPressedTimer = null; + + return r; +} + +void +_TableViewItem::StopTouchPressedTimer(void) +{ + result r = E_SUCCESS; + + SysTryReturnVoidResult(NID_UI_CTRL, __pPressedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid."); + + if (__isPressedTimerEnabled) + { + r = __pPressedTimer->Cancel(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + __isPressedTimerEnabled = false; + + return; } result @@ -1078,8 +1565,12 @@ _TableViewItem::PlayCheckBoxAnimation(void) Canvas* pCanvas = null; result r = E_SUCCESS; - Rectangle bounds; - int annexWidth = 0, annexHeight = 0; + FloatRectangle bounds; + + float annexWidth = 0.0f; + float annexHeight = 0.0f; + + Color canvasBackgroundColor; if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -1096,16 +1587,17 @@ _TableViewItem::PlayCheckBoxAnimation(void) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); + bounds.SetBounds(0, 0, annexWidth, annexHeight); pCanvas = new (std::nothrow) Canvas(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); if (pCanvas != null) { r = pCanvas->Construct(bounds); - - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(canvasBackgroundColor); pCanvas->Clear(); DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBoxBg), *pCheckBoxBg); @@ -1115,13 +1607,14 @@ _TableViewItem::PlayCheckBoxAnimation(void) { if (pCheckBox->IsNinePatchedBitmap()) { - r = pCanvas->DrawNinePatchedBitmap(Rectangle(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width, __checkedBounds.height), *pCheckBox); + FloatRectangle drawingRect(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width, __checkedBounds.height); + r = pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(drawingRect), *pCheckBox); // +++ check floating } else { - Rectangle bitmapSourceRect(0, 0, pCheckBox->GetWidth()*__checkedCount * 0.1, pCheckBox->GetHeight()); - Rectangle drawingRect(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width * __checkedCount * 0.1, __checkedBounds.height); - r = pCanvas->DrawBitmap(drawingRect, *pCheckBox, bitmapSourceRect); + FloatRectangle bitmapSourceRect(0.0f, 0.0f, pCheckBox->GetWidthF()*__checkedCount * 0.1, pCheckBox->GetHeightF()); + FloatRectangle drawingRect(__checkedBounds.x, __checkedBounds.y, __checkedBounds.width * __checkedCount * 0.1, __checkedBounds.height); + r = pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(drawingRect), *pCheckBox, _CoordinateSystemUtils::ConvertToInteger(bitmapSourceRect)); // +++ check floating } } } @@ -1141,11 +1634,12 @@ _TableViewItem::PlayCheckBoxAnimation(void) r = GetLastResult(); SysTryCatch(NID_UI_CTRL, __pItemAnnex != null, , r, "[%s] Propagating.", GetErrorMessage(r)); - int leftMargin = 0; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - int itemHeight = ((__customHeight > 0) ? __customHeight : GetBounds().height); - __pItemAnnex->SetBounds(Rectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + + __pItemAnnex->SetBounds(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); AttachSystemChild(*__pItemAnnex); @@ -1164,6 +1658,18 @@ CATCH: } void +_TableViewItem::SetItemLayoutEnabled(bool enabled) +{ + __isItemLayoutEnabled = enabled; +} + +bool +_TableViewItem::GetItemLayoutEnabled(void) +{ + return __isItemLayoutEnabled; +} + +void _TableViewItem::OnBoundsChanged(void) { if (__checkItemHeightNeeded && HasParent()) @@ -1184,6 +1690,12 @@ _TableViewItem::OnBoundsChanged(void) AdjustAnnexBounds(); SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds()); + + if(__pBitmapVisualElement != null) + { + FloatRectangle bounds = GetBoundsF(); + __pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); + } } void @@ -1204,127 +1716,116 @@ _TableViewItem::DrawItemBackground(void) Canvas* pCanvas = null; Bitmap* pDrawBitmap = __pItemBgBitmap[__drawingStatus]; Color bgColor = __colorItemBg[__drawingStatus]; - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds()); - if (pDrawBitmap != null) + if(__pBitmapVisualElement != null) { - const _BitmapImpl* pBitmapImpl = _BitmapImpl::GetInstance(*pDrawBitmap); - SysTryReturnVoidResult(NID_UI_CTRL, pBitmapImpl != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - pCanvas = GetVisualElement()->GetCanvasN(); - SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + pCanvas = __pBitmapVisualElement->GetCanvasN(); + SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - if (__enabledState) - { - pCanvas->SetBackgroundColor(bgColor); - } - else - { - GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); - pCanvas->SetBackgroundColor(bgColor); - } + pCanvas->SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); pCanvas->Clear(); - DrawBitmap(*pCanvas, Rectangle(0, 0, bounds.width, bounds.height), *pDrawBitmap); - - delete pCanvas; - pCanvas = null; } - else if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE) + + if(__enabledState) { - if (__enabledState) - { - SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); - __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f)); - } - else + if(pDrawBitmap != null) { - GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); - SetBackgroundColor(bgColor); + if(pCanvas != null) + { + __pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f)); + SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); + + DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pDrawBitmap); + } } - } - else if (__itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER) - { - if (__enabledState) + else if (__itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER) { SetBackgroundColor(Color(0, 0, 0, 0)); __pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f)); } - else + else if (__pDrawingProperty->sectionStyleEnabled == true) { - GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); - SetBackgroundColor(bgColor); + DrawSectionStyleBackground(); } - } - else if (IsContextItem()) - { - if (__enabledState) + else { SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f)); - } - else - { - GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); - SetBackgroundColor(bgColor); + + if (__pDrawingProperty->groupedLookEnabled == true) + { + DrawGroupedLook(); + } } } - else if (__pDrawingProperty->sectionStyleEnabled == true) - { - DrawSectionStyleBackground(); - } else { - if (__enabledState) + if (__pDrawingProperty->sectionStyleEnabled == true) { - SetBackgroundColor(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL]); - __pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f)); + DrawSectionStyleBackground(); } else { GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); SetBackgroundColor(bgColor); - } - if (__pDrawingProperty->groupedLookEnabled == true) - { - DrawGroupedLook(); + if (__pDrawingProperty->groupedLookEnabled == true) + { + DrawGroupedLook(); + } } } + + delete pCanvas; + return; + +CATCH: + delete pCanvas; + + if (__pBitmapVisualElement != null) + { + __pBitmapVisualElement->RemoveAllAnimations(); + __pBitmapVisualElement->SetAnimationProvider(null); + __pBitmapVisualElement->Destroy(); + __pBitmapVisualElement = null; + } } void _TableViewItem::DrawGroupedLook(void) { - if (IsTitleStyleItem()) + if (IsTitleStyleItem() || IsContextItem()) { return; } Color barColor; Color outlineColor = __pDrawingProperty->dividerColor; - int barWidth = 0; + + float barWidth = 0.0f; Canvas* pCanvas = GetVisualElement()->GetCanvasN(); SysTryReturnVoidResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); pCanvas->SetBackgroundColor(GetBackgroundColor()); pCanvas->Clear(); GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BAR_NORMAL, barColor); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, barWidth); - pCanvas->FillRectangle(barColor, Rectangle(0, 0, barWidth, bounds.height)); + pCanvas->FillRectangle(barColor, FloatRectangle(0.0f, 0.0f, barWidth, bounds.height)); if (__pDrawingProperty->sectionStyleEnabled == true) { - pCanvas->FillRectangle(outlineColor, Rectangle(bounds.width - 1, 0, 1, bounds.height)); + pCanvas->FillRectangle(outlineColor, FloatRectangle(bounds.width - 1.0f, 0.0f, 1.0f, bounds.height)); if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP || __itemType == TABLE_VIEW_ITEM_TYPE_ONE) { - pCanvas->FillRectangle(outlineColor, Rectangle(0, 0, bounds.width, 1)); + pCanvas->FillRectangle(outlineColor, FloatRectangle(0.0f, 0.0f, bounds.width, 1.0f)); } } @@ -1338,7 +1839,7 @@ _TableViewItem::DrawSectionStyleBackground(void) Bitmap* pSectionBg = null; Bitmap* pSectionPressedBg = null; Bitmap* pReplacementSectionBg = null; - Rectangle bounds = GetBounds(); + FloatRectangle bounds = GetBoundsF(); result r = E_SUCCESS; pCanvas = GetVisualElement()->GetCanvasN(); @@ -1379,7 +1880,8 @@ _TableViewItem::DrawSectionStyleBackground(void) GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor); } - DrawBitmap(*pCanvas, Rectangle(0, 0, bounds.width, bounds.height), *pReplacementSectionBg); + + DrawBitmap(*pCanvas, FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pReplacementSectionBg); if (__drawingStatus != TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -1405,24 +1907,29 @@ _TableViewItem::DrawSectionStyleBackground(void) if (__drawingStatus != TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { Color pressColor; - int dividerHeight; + int dividerHeightInt = 0; + float dividerHeight = 0.0f; GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_PRESSED, pressColor); pSectionPressedBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), pressColor); - GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight); - DrawBitmap(*pCanvas, Rectangle(0, dividerHeight, bounds.width, bounds.height-dividerHeight*2), *pSectionPressedBg); + GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeightInt); + dividerHeight = _CoordinateSystemUtils::ConvertToFloat(dividerHeightInt); + + DrawBitmap(*pCanvas, FloatRectangle(0.0f, dividerHeight, bounds.width, bounds.height-dividerHeight * 2), *pSectionPressedBg); } if (__pDrawingProperty->groupedLookEnabled == true) { Color barColor; - int barWidth = 0, barMargin = 0; + + float barWidth = 0.0f; + float barMargin = 0.0f; GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BAR_NORMAL, barColor); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, barWidth); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, barMargin); - pCanvas->FillRectangle(barColor, Rectangle(0, barMargin, barWidth, bounds.height-barMargin)); + pCanvas->FillRectangle(barColor, FloatRectangle(0.0f, barMargin, barWidth, bounds.height-barMargin)); } CATCH: @@ -1433,13 +1940,74 @@ CATCH: } void -_TableViewItem::DrawAnnexStyle(void) +_TableViewItem::DrawSectionStyleBackgroundCover(void) { - if (__reorderMode) + Bitmap* pSectionBgCover = null; + Bitmap* pReplacementSectionBg = null; + + if (__pDrawingProperty->sectionStyleEnabled == true) { - return; + if (__pItemCover != null) + { + result r = E_SUCCESS; + FloatRectangle bounds = GetBoundsF(); + if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_COVER, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCover); + } + else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_COVER, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCover); + } + else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_COVER, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCover); + } + else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_COVER, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionBgCover); + } + else + { + r = E_SYSTEM; + } + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed"); + + __pItemCover->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); + + if (__enabledState) + { + _TableView* pParent = dynamic_cast<_TableView*>(GetParent()); + if (pParent == null) + { + return; + } + pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBgCover, Color::GetColor(COLOR_ID_MAGENTA), pParent->GetBackgroundColor()); + __pItemCover->SetBackgroundBitmap(*pReplacementSectionBg); + } + else + { + Color bgColor; + GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor); + pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBgCover, Color::GetColor(COLOR_ID_MAGENTA), bgColor); + __pItemCover->SetBackgroundBitmap(*pReplacementSectionBg); + } + + if (__pDrawingProperty->groupedLookEnabled == true) + { + __pItemCover->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height)); + } + } } +CATCH: + delete pSectionBgCover; + delete pReplacementSectionBg; +} + +void +_TableViewItem::DrawAnnexStyle(void) +{ switch (__annexStyle) { case TABLE_VIEW_ANNEX_STYLE_MARK: @@ -1451,6 +2019,10 @@ _TableViewItem::DrawAnnexStyle(void) case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING: DrawOnOffButton(); break; + case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER: + DrawItemAnnexDivider(); + DrawOnOffButton(); + break; case TABLE_VIEW_ANNEX_STYLE_DETAILED: DrawDetailButton(); break; @@ -1468,8 +2040,10 @@ _TableViewItem::DrawCheckBox(void) Canvas* pCanvas = null; result r = E_SUCCESS; - Rectangle bounds; - int annexWidth = 0, annexHeight = 0; + FloatRectangle bounds; + float annexWidth = 0.0f; + float annexHeight = 0.0f; + Color canvasBackgroundColor; if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -1486,16 +2060,17 @@ _TableViewItem::DrawCheckBox(void) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); - bounds.SetBounds(0, 0, annexWidth, annexHeight); + + bounds.SetBounds(0.0f, 0.0f, annexWidth, annexHeight); pCanvas = new (std::nothrow) Canvas(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); if (pCanvas != null) { pCanvas->Construct(bounds); - - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(canvasBackgroundColor); pCanvas->Clear(); DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pCheckBoxBg), *pCheckBoxBg); @@ -1531,11 +2106,11 @@ _TableViewItem::DrawCheckBox(void) r = GetLastResult(); SysTryCatch(NID_UI_CTRL, __pItemAnnex != null, , r, "[%s] Propagating.", GetErrorMessage(r)); - int leftMargin = 0; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - int itemHeight = ((__customHeight > 0) ? __customHeight : GetBounds().height); - __pItemAnnex->SetBounds(Rectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + __pItemAnnex->SetBounds(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); AttachSystemChild(*__pItemAnnex); @@ -1562,8 +2137,10 @@ _TableViewItem::DrawRadioBox(void) Canvas* pCanvas = null; result r = E_SUCCESS; - Rectangle bounds; - int annexWidth = 0, annexHeight = 0; + FloatRectangle bounds; + float annexWidth = 0.0f; + float annexHeight = 0.0f; + Color canvasBackgroundColor; if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -1580,16 +2157,16 @@ _TableViewItem::DrawRadioBox(void) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); - bounds.SetBounds(0, 0, annexWidth, annexHeight); + bounds.SetBounds(0.0f, 0.0f, annexWidth, annexHeight); pCanvas = new (std::nothrow) Canvas(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); if (pCanvas != null) { pCanvas->Construct(bounds); - - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(canvasBackgroundColor); pCanvas->Clear(); DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pRadioButtonBg), *pRadioButtonBg); @@ -1603,21 +2180,115 @@ _TableViewItem::DrawRadioBox(void) pMergeBitmap = new (std::nothrow) Bitmap(); SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - if (pMergeBitmap != null) - { - pMergeBitmap->Construct(*pCanvas, bounds); - } + if (pMergeBitmap != null) + { + pMergeBitmap->Construct(*pCanvas, bounds); + } + + if (__pItemAnnex == null) + { + __pItemAnnex = _Label::CreateLabelN(); + SysTryReturnVoidResult(NID_UI_CTRL, __pItemAnnex, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + float leftMargin = 0.0f; + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); + + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + __pItemAnnex->SetBounds(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); + + AttachSystemChild(*__pItemAnnex); + } + + __pItemAnnex->SetBackgroundBitmap(*pMergeBitmap); + __pItemAnnex->Invalidate(); + +CATCH: + delete pRadioButton; + delete pRadioButtonBg; + delete pMergeBitmap; + delete pCanvas; + + return; +} + +void +_TableViewItem::DrawOnOffButton(void) +{ + Bitmap* pOnOffButton = null; + Bitmap* pOnOffButtonHandler = null; + Bitmap* pMergeBitmap = null; + Canvas* pCanvas = null; + result r = E_SUCCESS; + + FloatRectangle bounds; + FloatRectangle backgroundBounds; + FloatRectangle handlerBounds; + float annexWidth = 0.0f; + float annexHeight = 0.0f; + float annexMargin = 0.0f; + Color canvasBackgroundColor; + + r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffHandlerButton button image load failed"); + + if (IsChecked() == true) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton); + } + else + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton); + } + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButton != null), , E_SYSTEM, "[E_SYSTEM] OnOffButton image load failed"); + + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); + bounds.SetBounds(0, 0, annexWidth, annexHeight); + + pCanvas = new (std::nothrow) Canvas(); + SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); + pCanvas->Construct(bounds); + pCanvas->SetBackgroundColor(canvasBackgroundColor); + pCanvas->Clear(); + + backgroundBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButton); + DrawBitmap(*pCanvas, backgroundBounds, *pOnOffButton); + + handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin); + if (IsChecked() == true) + { + handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin; + handlerBounds.y = backgroundBounds.y - annexMargin; + } + else + { + handlerBounds.x = backgroundBounds.x + annexMargin; + handlerBounds.y = backgroundBounds.y - annexMargin; + } + + DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler); + + pMergeBitmap = new (std::nothrow) Bitmap(); + SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + + pMergeBitmap->Construct(*pCanvas, bounds); if (__pItemAnnex == null) { __pItemAnnex = _Label::CreateLabelN(); SysTryReturnVoidResult(NID_UI_CTRL, __pItemAnnex, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - int leftMargin = 0; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - int itemHeight = ((__customHeight > 0) ? __customHeight : GetBounds().height); - __pItemAnnex->SetBounds(Rectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + leftMargin += __pDrawingProperty->scrollMargin; + + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + __pItemAnnex->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); AttachSystemChild(*__pItemAnnex); @@ -1627,8 +2298,8 @@ _TableViewItem::DrawRadioBox(void) __pItemAnnex->Invalidate(); CATCH: - delete pRadioButton; - delete pRadioButtonBg; + delete pOnOffButton; + delete pOnOffButtonHandler; delete pMergeBitmap; delete pCanvas; @@ -1636,17 +2307,103 @@ CATCH: } void -_TableViewItem::DrawOnOffButton(void) +_TableViewItem::AdjustAnnexOnOffHandlerPosition() +{ + float annexWidth = 0.0f; + float annexHeight = 0.0f; + float annexMargin = 0.0f; + + float annexStartPosition = 0.0f; + float annexEndPosition = 0.0f; + float finalEndPosition = 0.0f; + FloatRectangle handlerBounds; + result r = E_SUCCESS; + + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin); + + annexStartPosition = __pItemAnnex->GetBoundsF().x; + annexEndPosition = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin; + + Bitmap* pOnOffButtonHandler = null; + r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffHandlerButton button image load failed"); + + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); + + handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler); + + if(__annexOnOffHandlerMoved) + { + if(annexStartPosition < __annexOnOffHandlerLastPosition + && annexEndPosition > __annexOnOffHandlerLastPosition) + { + if(((annexEndPosition - annexStartPosition) / 2) < __annexOnOffHandlerLastPosition - annexStartPosition + (handlerBounds.width / 2)) // +++ check floating + { + finalEndPosition = annexEndPosition; + SetChecked(true); + } + else + { + finalEndPosition = annexStartPosition; + SetChecked(false); + } + } + else + { + if(annexEndPosition < __annexOnOffHandlerLastPosition) + { + finalEndPosition = annexEndPosition; + SetChecked(true); + } + else + { + finalEndPosition = annexStartPosition; + SetChecked(false); + } + } + } + else + { + SetChecked(!IsChecked()); + if(IsChecked()) + { + finalEndPosition = annexEndPosition; + } + else + { + finalEndPosition = annexStartPosition; + } + } + + DrawAnnexOnOffHandler(finalEndPosition); + +CATCH: + delete pOnOffButtonHandler; + + return; +} + +void +_TableViewItem::DrawAnnexOnOffHandler(float position) { + Bitmap* pOnOffButton = null; Bitmap* pOnOffButtonHandler = null; Bitmap* pMergeBitmap = null; Canvas* pCanvas = null; result r = E_SUCCESS; - Rectangle bounds; - Rectangle backgroundBounds; - int annexWidth = 0, annexHeight = 0; + FloatRectangle bounds; + FloatRectangle backgroundBounds; + FloatRectangle handlerBounds; + float annexWidth = 0.0f; + float annexHeight = 0.0f; + float annexMargin = 0.0f; + float annexAbsoluteBoundsStart = 0.0f; + float annexAbsoluteBoundsEnd = 0.0f; + Color canvasBackgroundColor; + float nextHandlerBounds = 0; r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffHandlerButton button image load failed"); @@ -1659,37 +2416,58 @@ _TableViewItem::DrawOnOffButton(void) { r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton); } - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButton != null), , E_SYSTEM, "[E_SYSTEM] OnOffButton image load failed"); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButton != null), , E_SYSTEM, "[E_SYSTEM] OnOffButton_On image load failed"); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin); + bounds.SetBounds(0, 0, annexWidth, annexHeight); pCanvas = new (std::nothrow) Canvas(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); pCanvas->Construct(bounds); - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(canvasBackgroundColor); pCanvas->Clear(); backgroundBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButton); DrawBitmap(*pCanvas, backgroundBounds, *pOnOffButton); - if (IsChecked() == true) + handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler); + handlerBounds.y = backgroundBounds.y - annexMargin; + + if(IsChecked()) { - Rectangle handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler); - handlerBounds.x = backgroundBounds.width - handlerBounds.width; - handlerBounds.y = backgroundBounds.y; - DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler); + handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin; } else { - Rectangle handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler); - handlerBounds.x = backgroundBounds.x; - handlerBounds.y = backgroundBounds.y; - DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler); + handlerBounds.x = backgroundBounds.x + annexMargin; + } + + nextHandlerBounds = handlerBounds.x + (position - __annexOnOffTouchPosition); + annexAbsoluteBoundsStart = __pItemAnnex->GetBounds().x; + annexAbsoluteBoundsEnd = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin; + + if((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width) < annexAbsoluteBoundsEnd && + (annexAbsoluteBoundsStart + nextHandlerBounds) > annexAbsoluteBoundsStart) + { + handlerBounds.x = nextHandlerBounds; + __annexOnOffHandlerLastPosition = annexAbsoluteBoundsStart + nextHandlerBounds; + } + else if(_FloatCompareGE((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width), annexAbsoluteBoundsEnd)) + { + handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin; + } + else if(_FloatCompareLE((annexAbsoluteBoundsStart + nextHandlerBounds), annexAbsoluteBoundsStart)) + { + handlerBounds.x = backgroundBounds.x + annexMargin; } + DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler); + pMergeBitmap = new (std::nothrow) Bitmap(); SysTryCatch(NID_UI_CTRL, pMergeBitmap != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); @@ -1700,16 +2478,13 @@ _TableViewItem::DrawOnOffButton(void) __pItemAnnex = _Label::CreateLabelN(); SysTryReturnVoidResult(NID_UI_CTRL, __pItemAnnex, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - int leftMargin = 0; - int annexWidth = 0, annexHeight = 0; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); leftMargin += __pDrawingProperty->scrollMargin; - int itemHeight = ((__customHeight > 0) ? __customHeight : GetBounds().height); - __pItemAnnex->SetBounds(Rectangle((GetBounds().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); // +++ check floating + __pItemAnnex->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); AttachSystemChild(*__pItemAnnex); @@ -1741,25 +2516,33 @@ _TableViewItem::DrawDetailButton(void) Color replacementNewBgColor; result r = E_SUCCESS; - Rectangle bounds; - int annexWidth = 0, annexHeight = 0; + FloatRectangle bounds; + float annexWidth = 0.0f; + float annexHeight = 0.0f; + Color canvasBackgroundColor; + bool themeBackgroundBitmap = false; r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBg); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBg != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed"); + themeBackgroundBitmap = IS_CUSTOM_BITMAP(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL); if (IsChecked() != true) { - r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed"); - + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed"); + } GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_NORMAL, replacementNewColor); GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_BG_NORMAL, replacementNewBgColor); } else { - r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect); - SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed"); - + if (!themeBackgroundBitmap) + { + r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBgEffect); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBgEffect != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed"); + } GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_PRESSED, replacementNewColor); GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_DETAIL_BG_PRESSED, replacementNewBgColor); } @@ -1775,17 +2558,22 @@ _TableViewItem::DrawDetailButton(void) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight); + bounds.SetBounds(0, 0, annexWidth, annexHeight); pCanvas = new (std::nothrow) Canvas(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor); pCanvas->Construct(bounds); - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(canvasBackgroundColor); pCanvas->Clear(); DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pReplacementDetailBg), *pReplacementDetailBg); - DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailBgEffect), *pDetailBgEffect); + if (!themeBackgroundBitmap) + { + DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailBgEffect), *pDetailBgEffect); + } DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pReplacementDetail), *pReplacementDetail); pMergeBitmap = new (std::nothrow) Bitmap(); @@ -1798,12 +2586,12 @@ _TableViewItem::DrawDetailButton(void) __pItemAnnex = _Label::CreateLabelN(); SysTryReturnVoidResult(NID_UI_CTRL, __pItemAnnex, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - int leftMargin = 0; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); leftMargin += __pDrawingProperty->scrollMargin; - int itemHeight = ((__customHeight > 0) ? __customHeight : GetBounds().height); - __pItemAnnex->SetBounds(Rectangle((GetBounds().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); + float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + __pItemAnnex->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight)); __pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0)); AttachSystemChild(*__pItemAnnex); @@ -1841,17 +2629,12 @@ _TableViewItem::DrawItemDivider(void) } else if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE) { - if (__pItemDivider == null) - { - __pItemDivider = _Label::CreateLabelN(); - SysTryReturnVoidResult(NID_UI_CTRL, __pItemDivider, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - AttachSystemChild(*__pItemDivider); - } - Color underLineColor; - Rectangle bounds = GetBounds(); - int lineHeight = 0, lineLeftMargin = 0, lineBottomMargin = 0; + FloatRectangle bounds = GetBoundsF(); + + float lineHeight = 0.0f; + float lineLeftMargin = 0.0f; + float lineBottomMargin = 0.0f; if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) { @@ -1865,44 +2648,35 @@ _TableViewItem::DrawItemDivider(void) GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineBottomMargin); - __pItemDivider->SetBounds(Rectangle(lineLeftMargin, bounds.height - lineBottomMargin, bounds.width - lineLeftMargin * 2, lineHeight)); - __pItemDivider->SetBackgroundColor(underLineColor); - __pItemDivider->Invalidate(); + if(__pItemDivider != null) + { + __pItemDivider->SetBounds(FloatRectangle(lineLeftMargin, bounds.height - lineBottomMargin, bounds.width - lineLeftMargin * 2, lineHeight)); + __pItemDivider->SetBackgroundColor(underLineColor); + __pItemDivider->Invalidate(); + } } else { - if (__pItemDivider == null) - { - __pItemDivider = _Label::CreateLabelN(); - SysTryReturnVoidResult(NID_UI_CTRL, __pItemDivider, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - AttachSystemChild(*__pItemDivider); - } - Color dividerColor; - Rectangle bounds = GetBounds(); - int lineLeftMargin = 0, lineHeight = 0; - int groupIndex = -1, itemIndex = -1; + FloatRectangle bounds = GetBoundsF(); + + float lineLeftMargin = 0.0f; + float lineHeight = 0.0f; + int groupIndex = -1; + int itemIndex = -1; GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL, dividerColor); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_INDEX_BAR_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, lineLeftMargin); GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, lineHeight); - __pItemDivider->SetBounds(Rectangle(lineLeftMargin, (bounds.height - lineHeight), bounds.width - lineLeftMargin * 2, lineHeight)); + __pItemDivider->SetBounds(FloatRectangle(lineLeftMargin, (bounds.height - lineHeight), bounds.width - lineLeftMargin * 2, lineHeight)); __pItemDivider->SetBackgroundColor(__pDrawingProperty->dividerColor); __pItemDivider->Invalidate(); GetItemIndex(groupIndex, itemIndex); if (itemIndex != 0) { - if (__pItemTopDivider == null) - { - __pItemTopDivider = _Label::CreateLabelN(); - SysTryReturnVoidResult(NID_UI_CTRL, __pItemTopDivider, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - AttachSystemChild(*__pItemTopDivider); - } - __pItemTopDivider->SetBounds(Rectangle(lineLeftMargin, 0, bounds.width - lineLeftMargin * 2, lineHeight)); + __pItemTopDivider->SetBounds(FloatRectangle(lineLeftMargin, 0.0f, bounds.width - lineLeftMargin * 2, lineHeight)); __pItemTopDivider->SetBackgroundColor(dividerColor); __pItemTopDivider->Invalidate(); } @@ -1921,18 +2695,79 @@ _TableViewItem::DrawItemDivider(void) } } +void +_TableViewItem::DrawItemAnnexDivider(void) +{ + if (__pDrawingProperty->itemDividerEnabled == false || __itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER || __itemDividerEnabled == false) + { + if (__pItemAnnexLeftDivider != null) + { + __pItemAnnexLeftDivider->SetVisibleState(false); + } + + if (__pItemAnnexRightDivider != null) + { + __pItemAnnexRightDivider->SetVisibleState(false); + } + } + else + { + Color dividerColor; + FloatRectangle bounds = GetBoundsF(); + float dividerHeight = 0; + float itemHeight = 0; + float dividerWidth = 0.0f; + float dividerTopMargin = 0.0f; + float annexWidth = 0.0f; + float annexLeftMargin = 0.0f; + float itemLeftMargin = 0.0f; + + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemLeftMargin); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexLeftMargin); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_COLOR_CONFIG(TABLEVIEW::ITEM_DIVIDER_TOP_BG_NORMAL, dividerColor); + GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth); + GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_ANNEX_DIVIDER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin); + + itemLeftMargin += __pDrawingProperty->scrollMargin; + itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height); + dividerHeight = itemHeight - (dividerTopMargin*2); + __pItemAnnexLeftDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - (dividerWidth*2)), dividerTopMargin, dividerWidth, dividerHeight)); + __pItemAnnexLeftDivider->SetBackgroundColor(__pDrawingProperty->dividerColor); + __pItemAnnexLeftDivider->Invalidate(); + + __pItemAnnexRightDivider->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - (itemLeftMargin + annexLeftMargin) - dividerWidth), dividerTopMargin, dividerWidth, dividerHeight)); + __pItemAnnexRightDivider->SetBackgroundColor(dividerColor); + __pItemAnnexRightDivider->Invalidate(); + + } + + if (__pItemDivider != null) + { + _AccessibilityContainer* pContainer = __pItemDivider->GetAccessibilityContainer(); + pContainer->Activate(false); + } + + if (__pItemTopDivider != null) + { + _AccessibilityContainer* pContainer = __pItemTopDivider->GetAccessibilityContainer(); + pContainer->Activate(false); + } +} + + result -_TableViewItem::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitmap& bitmap) +_TableViewItem::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, const Bitmap& bitmap) { result r = E_SUCCESS; if (bitmap.IsNinePatchedBitmap()) { - r = canvas.DrawNinePatchedBitmap(bounds, bitmap); + r = canvas.DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), bitmap); // +++ check floating SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Fail to draw ninepatched bitmap.", GetErrorMessage(r)) } else { - r = canvas.DrawBitmap(bounds, bitmap); + r = canvas.DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(bounds), bitmap); // +++ check floating SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Fail to draw bitmap.", GetErrorMessage(r)) } @@ -1940,34 +2775,38 @@ _TableViewItem::DrawBitmap(Canvas& canvas, const Rectangle& bounds, const Bitmap } result -_TableViewItem::SetItemHighlightBounds(_VisualElement& highlightVisualElement, const Rectangle& bounds) +_TableViewItem::SetItemHighlightBounds(_VisualElement& highlightVisualElement, const FloatRectangle& bounds) { - FloatRectangle veBounds(bounds.x, bounds.y, bounds.width, bounds.height); - return highlightVisualElement.SetBounds(veBounds); +// FloatRectangle veBounds(bounds.x, bounds.y, bounds.width, bounds.height); + return highlightVisualElement.SetBounds(bounds); } -Rectangle +FloatRectangle _TableViewItem::CalculateItemHighlightBounds(void) { - int itemHighlightMargin = 0; - Rectangle itemBounds = GetBounds(); - Rectangle bounds; + int itemHighlightMarginInt = 0; + float itemHighlightMargin = 0.0f; + FloatRectangle itemBounds = GetBoundsF(); + FloatRectangle bounds; if (IsTitleStyleItem() == false) { - GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHighlightMargin); + GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHighlightMarginInt); + itemHighlightMargin = _CoordinateSystemUtils::ConvertToFloat(itemHighlightMarginInt); // +++ check floating } - bounds.SetBounds(0, itemHighlightMargin, itemBounds.width, itemBounds.height - itemHighlightMargin *2); + bounds.SetBounds(0.0f, itemHighlightMargin, itemBounds.width, itemBounds.height - itemHighlightMargin *2); return bounds; } -Rectangle -_TableViewItem::CalculateAnnexBitmapBounds(int annexWidth, int annexHeight, const Bitmap& bitmap) +FloatRectangle +_TableViewItem::CalculateAnnexBitmapBounds(float annexWidth, float annexHeight, const Bitmap& bitmap) { - Rectangle bounds; - int width = 0, height = 0; - int leftMargin = 0, topMargin = 0; + FloatRectangle bounds; + float width = 0; + float height = 0; + float leftMargin = 0; + float topMargin = 0; if (annexWidth > bitmap.GetWidth()) { @@ -1981,8 +2820,8 @@ _TableViewItem::CalculateAnnexBitmapBounds(int annexWidth, int annexHeight, cons if(annexHeight > bitmap.GetHeight()) { - topMargin = (annexHeight - bitmap.GetHeight()) / 2; - height = bitmap.GetHeight(); + topMargin = (annexHeight - bitmap.GetHeightF()) / 2; + height = bitmap.GetHeightF(); } else { @@ -2063,13 +2902,14 @@ _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tiz r = CreateSimpleItemContents(textOnly); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - Rectangle bitmapRect = Rectangle(0, 0, 0, 0); - Rectangle textRect = Rectangle(0, 0, 0, 0); - int elementWidth = 0; - int elementHeight = 0; - int leftMargin = 0; - int itemHeight = __itemHeight; - int annexWidth = GetAnnexWidth(__annexStyle); + FloatRectangle bitmapRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle textRect = FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f); + float leftMargin = 0.0f; + float annexMargin = 0.0f; + float elementWidth = 0; + float elementHeight = 0; + float itemHeight = __itemHeight; + float annexWidth = GetAnnexWidth(__annexStyle); if (groupType) { @@ -2099,14 +2939,15 @@ _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tiz bitmapRect.height = elementHeight; } -// if (annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) -// { -// bitmapRect.x += annexWidth + leftMargin; -// } - textRect.x = bitmapRect.x + elementWidth + leftMargin; - if (annexWidth > 0) + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK || __annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO) + { + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, annexMargin); + textRect.x = bitmapRect.x + elementWidth + annexMargin; + } + + if (annexWidth > 0) // +++ check floating { elementWidth = __itemWidth - textRect.x - annexWidth - leftMargin; } @@ -2115,7 +2956,7 @@ _TableViewItem::SetSimpleItemContents(const Tizen::Base::String& text, const Tiz elementWidth = __itemWidth - textRect.x; } - textRect.y = 0; + textRect.y = 0.0f; textRect.width = elementWidth; textRect.height = itemHeight; @@ -2228,15 +3069,15 @@ _TableViewItem::GetSimpleItemTextSize(void) const return __simpleItemTextSize; } -int +float _TableViewItem::GetAnnexWidth(TableViewAnnexStyle style) { - int annexWidth = 0; + float annexWidth = 0.0f; switch (style) { case TABLE_VIEW_ANNEX_STYLE_NORMAL: - annexWidth = 0; + annexWidth = 0.0f; break; case TABLE_VIEW_ANNEX_STYLE_MARK: @@ -2247,6 +3088,10 @@ _TableViewItem::GetAnnexWidth(TableViewAnnexStyle style) GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); break; + case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER: + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + break; + case TABLE_VIEW_ANNEX_STYLE_DETAILED: GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); break; @@ -2289,11 +3134,11 @@ _TableViewItem::AdjustChildControlMargin(void) __childMarginState = true; - int margin = 0; + float margin = 0; if (__pDrawingProperty->groupedLookEnabled) { - int groupedBarMargin = 0; + float groupedBarMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_BAR_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, groupedBarMargin); margin = margin + groupedBarMargin; @@ -2323,10 +3168,10 @@ _TableViewItem::AdjustContextItemBounds(void) return; } - Dimension contextItemSize = pContextItem->GetSize(); - Dimension itemSize = GetSize(); + FloatDimension contextItemSize = pContextItem->GetSizeF(); + FloatDimension itemSize = GetSizeF(); - if (contextItemSize.height != itemSize.height) + if (!_FloatCompare(contextItemSize.height, itemSize.height)) { contextItemSize.height = itemSize.height; @@ -2339,35 +3184,35 @@ _TableViewItem::AdjustContextItemBounds(void) void _TableViewItem::AdjustAnnexBounds(void) { - if (__pItemAnnex == null) + if (__pItemAnnex == null || __isMoveItemAnimationEnabled || __isZoomInOutItemAnimationEnabled ||__isFadeInOutItemAnimationEnabled) { return; } // h align - if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || __annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) + if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER || __annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED) { if (__pItemAnnex->HasParent()) { - Rectangle annexBounds = __pItemAnnex->GetBounds(); - int annexPositionX = annexBounds.x; - int leftMargin = 0; + FloatRectangle annexBounds = __pItemAnnex->GetBoundsF(); + float annexPositionX = annexBounds.x; + float leftMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); leftMargin += __pDrawingProperty->scrollMargin; - annexPositionX = GetBounds().width - annexBounds.width - leftMargin; + annexPositionX = GetBoundsF().width - annexBounds.width - leftMargin; - if (annexPositionX != annexBounds.x) + if (!_FloatCompare(annexPositionX, annexBounds.x)) { - __pItemAnnex->SetPosition(Point(annexPositionX, annexBounds.y)); + __pItemAnnex->SetPosition(FloatPoint(annexPositionX, annexBounds.y)); } } } // v align - Rectangle itemBounds = GetBounds(); - Rectangle annexBounds = __pItemAnnex->GetBounds(); + FloatRectangle itemBounds = GetBoundsF(); + FloatRectangle annexBounds = __pItemAnnex->GetBoundsF(); if (__customHeight > 0) { @@ -2375,11 +3220,11 @@ _TableViewItem::AdjustAnnexBounds(void) } annexBounds.y = (itemBounds.height - annexBounds.height) / 2; - __pItemAnnex->SetPosition(Point(annexBounds.x, annexBounds.y)); + __pItemAnnex->SetPosition(FloatPoint(annexBounds.x, annexBounds.y)); } void -_TableViewItem::SetItemCustomHeight(int height) +_TableViewItem::SetItemCustomHeight(float height) { __customHeight = height; } @@ -2389,7 +3234,7 @@ _TableViewItem::AdjustChildControlCenterAlign(void) { if (__childControlCenterAlign) { - Dimension itemSize = GetSize(); + FloatDimension itemSize = GetSizeF(); int childControlCount = GetChildCount(); @@ -2404,23 +3249,23 @@ _TableViewItem::AdjustChildControlCenterAlign(void) if (__pItemDivider == pChildControl) { - int positionX = pChildControl->GetPosition().x; - pChildControl->SetPosition(Point(positionX, itemSize.height - 1)); + float positionX = pChildControl->GetPositionF().x; + pChildControl->SetPosition(FloatPoint(positionX, itemSize.height - 1)); continue; } if (__pItemTopDivider == pChildControl) { - int positionX = pChildControl->GetPosition().x; - pChildControl->SetPosition(Point(positionX, 0)); + float positionX = pChildControl->GetPositionF().x; + pChildControl->SetPosition(FloatPoint(positionX, 0)); continue; } - Rectangle itemBounds = pChildControl->GetBounds(); + FloatRectangle itemBounds = pChildControl->GetBoundsF(); itemBounds.y = (itemSize.height - itemBounds.height) / 2; - pChildControl->SetPosition(Point(itemBounds.x, itemBounds.y)); + pChildControl->SetPosition(FloatPoint(itemBounds.x, itemBounds.y)); } } } @@ -2434,17 +3279,31 @@ _TableViewItem::SetChildControlCenterAlign(bool centerAlign) Point _TableViewItem::GetLastTouchPressedPosition(void) { + return _CoordinateSystemUtils::ConvertToInteger(__touchStartPosition); +} + +FloatPoint +_TableViewItem::GetLastTouchPressedPositionF(void) +{ return __touchStartPosition; } void -_TableViewItem::SetLastTouchPressedPosition(Point position) +_TableViewItem::SetLastTouchPressedPosition(FloatPoint position) { // This function was made to modify of ListView::RefreshList(). // This function could adversely affect touch event handling. So, you should be used with caution. __touchStartPosition = position; } +void +_TableViewItem::SetLastTouchPressedPosition(Point position) +{ + // This function was made to modify of ListView::RefreshList(). + // This function could adversely affect touch event handling. So, you should be used with caution. + __touchStartPosition = _CoordinateSystemUtils::ConvertToFloat(position); +} + bool _TableViewItem::GetSelectionState(void) { @@ -2460,29 +3319,18 @@ _TableViewItem::SetSelectionState(bool selected) } bool -_TableViewItem::MoveItem(Point position, int duration, int delay, Tizen::Base::String* pName) +_TableViewItem::MoveItem(FloatPoint position, int duration, int delay, Tizen::Base::String* pName) { _VisualElement* pVisualElement = GetVisualElement(); - String animationName = L"MoveTableViewItem"; - - VisualElementValueAnimation* pAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); - - if (pAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } + String animationName = L"MOVE_ITEM"; - pAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturn(NID_UI_CTRL, pAnimation, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + VisualElementValueAnimation* pAnimation = __pMoveItemAnimation; pAnimation->SetDuration(duration); pAnimation->SetDelay(delay); - pAnimation->SetStartValue(Variant(GetPosition())); + pAnimation->SetStartValue(Variant(GetPositionF())); pAnimation->SetEndValue(Variant(position)); - pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseInOut")); - pAnimation->SetVisualElementAnimationStatusEventListener(this); - pAnimation->SetVisualElementAnimationTickEventListener(this); if (pName != null) { String* pUserData = new (std::nothrow) String(*pName); @@ -2499,14 +3347,11 @@ _TableViewItem::MoveItem(Point position, int duration, int delay, Tizen::Base::S return false; } - delete pAnimation; - __animationCount++; return true; CATCH: - delete pAnimation; return false; } @@ -2516,31 +3361,23 @@ _TableViewItem::ZoomInOutItem(bool zoomOut, int duration, int delay, Tizen::Base { _VisualElement* pVisualElement = GetVisualElement(); - String animationName = L"ZoomInOutTableViewItem"; - - VisualElementValueAnimation* pAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); + String animationName = L"ZOOM_IN_OUT_ITEM"; - if (pAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } + VisualElementValueAnimation* pAnimation = __pZoomInOutItemAnimation; - pAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturn(NID_UI_CTRL, pAnimation, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - - Dimension itemSize = GetSize(); - Dimension startValue; - Dimension endValue; + FloatDimension itemSize = GetSizeF(); + FloatDimension startValue; + FloatDimension endValue; if (zoomOut) { startValue = itemSize; - endValue = Dimension(itemSize.width, itemSize.height / 2); + endValue = FloatDimension(itemSize.width, itemSize.height / 2); pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseOut")); } else { - startValue = Dimension(itemSize.width, itemSize.height / 2); + startValue = FloatDimension(itemSize.width, itemSize.height / 2); endValue = itemSize; pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseIn")); } @@ -2549,8 +3386,6 @@ _TableViewItem::ZoomInOutItem(bool zoomOut, int duration, int delay, Tizen::Base pAnimation->SetDelay(delay); pAnimation->SetStartValue(Variant(startValue)); pAnimation->SetEndValue(Variant(endValue)); - pAnimation->SetVisualElementAnimationStatusEventListener(this); - pAnimation->SetVisualElementAnimationTickEventListener(this); if (pName != null) { @@ -2568,14 +3403,11 @@ _TableViewItem::ZoomInOutItem(bool zoomOut, int duration, int delay, Tizen::Base return false; } - delete pAnimation; - __animationCount++; return true; CATCH: - delete pAnimation; return false; } @@ -2585,17 +3417,9 @@ _TableViewItem::FadeInOutItem(bool fadeOut, int duration, int delay, Tizen::Base { _VisualElement* pVisualElement = GetVisualElement(); - String animationName = L"FadeInOutTableViewItem";; - - VisualElementValueAnimation* pAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); - - if (pAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } + String animationName = L"FADE_IN_OUT_ITEM";; - pAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturn(NID_UI_CTRL, pAnimation, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + VisualElementValueAnimation* pAnimation = __pFadeInOutItemtAnimation; float startValue = 0.0f; float endValue = 1.0f; @@ -2615,8 +3439,7 @@ _TableViewItem::FadeInOutItem(bool fadeOut, int duration, int delay, Tizen::Base pAnimation->SetDelay(delay); pAnimation->SetStartValue(Variant(startValue)); pAnimation->SetEndValue(Variant(endValue)); - pAnimation->SetVisualElementAnimationStatusEventListener(this); - pAnimation->SetVisualElementAnimationTickEventListener(this); + if (pName != null) { String* pUserData = new (std::nothrow) String(*pName); @@ -2633,14 +3456,13 @@ _TableViewItem::FadeInOutItem(bool fadeOut, int duration, int delay, Tizen::Base return false; } - delete pAnimation; + pVisualElement->SetOpacity(startValue); __animationCount++; return true; CATCH: - delete pAnimation; return false; } @@ -2722,12 +3544,12 @@ _TableViewItem::SetItemDividerEnabled(bool enable) void _TableViewItem::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, const Tizen::Ui::Variant& currentValue) { - if (keyName == L"MoveTableViewItem") + if (keyName == L"MOVE_ITEM") { - Point position = currentValue.ToPoint(); + FloatPoint position = currentValue.ToFloatPoint(); SetPosition(position); } - else if (keyName == L"FadeInOutTableViewItem") + else if (keyName == L"FADE_IN_OUT_ITEM") { float opacity = currentValue.ToFloat(); @@ -2738,10 +3560,9 @@ _TableViewItem::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimati pVisualElement->SetOpacity(opacity); } } - else if (keyName == L"ZoomInOutTableViewItem") + else if (keyName == L"ZOOM_IN_OUT_ITEM") { - Dimension size = currentValue.ToDimension(); - + FloatDimension size = currentValue.ToFloatDimension(); SetSize(size); } } @@ -2749,6 +3570,18 @@ _TableViewItem::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimati void _TableViewItem::OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target) { + if (keyName == L"MOVE_ITEM") + { + __isMoveItemAnimationEnabled = true; + } + else if (keyName == L"FADE_IN_OUT_ITEM") + { + __isFadeInOutItemAnimationEnabled = true; + } + else if (keyName == L"ZOOM_IN_OUT_ITEM") + { + __isZoomInOutItemAnimationEnabled = true; + } } void @@ -2759,25 +3592,25 @@ _TableViewItem::OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::Vi void _TableViewItem::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally) { - if (!completedNormally) + if (__isAnimationCallbackBlocked) { - __animationCount--; return; } bool tableViewItemAnimation = true; const VisualElementValueAnimation *pAnimation = dynamic_cast(&(animation)); - if (keyName == L"MoveTableViewItem") + if (keyName == L"MOVE_ITEM") { if (pAnimation != null) { - Point position = pAnimation->GetEndValue().ToPoint(); + FloatPoint position = pAnimation->GetEndValue().ToFloatPoint(); SetPosition(position); } + __isMoveItemAnimationEnabled = false; } - else if (keyName == L"FadeInOutTableViewItem") + else if (keyName == L"FADE_IN_OUT_ITEM") { if (pAnimation != null) { @@ -2791,15 +3624,17 @@ _TableViewItem::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::Vi Invalidate(); } } + __isFadeInOutItemAnimationEnabled = false; } - else if (keyName == L"ZoomInOutTableViewItem") + else if (keyName == L"ZOOM_IN_OUT_ITEM") { if (pAnimation != null) { - Dimension size = pAnimation->GetEndValue().ToDimension(); + FloatDimension size = pAnimation->GetEndValue().ToFloatDimension(); SetSize(size); } + __isZoomInOutItemAnimationEnabled = false; } else { @@ -2814,6 +3649,19 @@ _TableViewItem::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::Vi return; } +result +_TableViewItem::OnAttachedToMainTree(void) +{ + result r = E_SUCCESS; + + if (!_FloatCompare(GetBoundsF().height, 0.0f)) + { + SetAccessibilityElement(); + } + + return r; +} + void _TableViewItem::SetAccessibilityElement(void) { @@ -2823,13 +3671,13 @@ _TableViewItem::SetAccessibilityElement(void) } _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if(pContainer) { __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - __pAccessibilityElement->SetBounds(Rectangle(0,0, GetBounds().width, GetBounds().height)); + FloatRectangle accessibilityRect(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height); + __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(accessibilityRect)); // +++ check floating __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE); __pAccessibilityElement->SetName(L"TableViewItem"); @@ -2837,22 +3685,17 @@ _TableViewItem::SetAccessibilityElement(void) } } -bool -_TableViewItem::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) -{ - return false; -} - -bool -_TableViewItem::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) +_AccessibilityElement* +_TableViewItem::GetAccessibilityElement(void) { - return false; + return __pAccessibilityElement; } -bool -_TableViewItem::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +void +_TableViewItem::SetAccessibilityElementLabel(void) { - String accessibilityLable; + String accessibilityLabel; + String itemStyleLabel; int childControlCount = GetChildCount(); for (int i = 0; i < childControlCount; i++) @@ -2864,7 +3707,7 @@ _TableViewItem::OnAccessibilityReadElement(const _AccessibilityContainer& contro continue; } - if (__pItemDivider == pChildControl || __pItemTopDivider == pChildControl) + if (__pItemDivider == pChildControl || __pItemTopDivider == pChildControl || __pItemCover == pChildControl) { continue; } @@ -2883,13 +3726,67 @@ _TableViewItem::OnAccessibilityReadElement(const _AccessibilityContainer& contro { if (accessibilityElements.GetAt(i, pElement) == E_SUCCESS) { - accessibilityLable += pElement->GetLabel(); + accessibilityLabel += pElement->GetLabel(); } } } } - __pAccessibilityElement->SetLabel(accessibilityLable); + switch (__annexStyle) + { + case TABLE_VIEW_ANNEX_STYLE_NORMAL: + accessibilityLabel += L"Normal Style"; + break; + + case TABLE_VIEW_ANNEX_STYLE_MARK: + accessibilityLabel += L"Mark Style"; + break; + + case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING: + accessibilityLabel += L"On Off Sliding Style"; + break; + + case TABLE_VIEW_ANNEX_STYLE_DETAILED: + accessibilityLabel += L"Detail Style"; + break; + + case TABLE_VIEW_ANNEX_STYLE_RADIO: + accessibilityLabel += L"Radio Style"; + break; + + default: + break; + } + + if (!accessibilityLabel.IsEmpty()) + { + __pAccessibilityElement->SetLabel(accessibilityLabel); + } +} + + +bool +_TableViewItem::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TableViewItem::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TableViewItem::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_TableViewItem::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + SetAccessibilityElementLabel(); return false; } @@ -2911,15 +3808,18 @@ _TableViewItem::OnAccessibilityActionPerformed(const _AccessibilityContainer& co { return false; } + bool _TableViewItem::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } + bool _TableViewItem::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) { return false; } + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TableViewItemImpl.cpp b/src/ui/controls/FUiCtrl_TableViewItemImpl.cpp index db80d76..7328632 100644 --- a/src/ui/controls/FUiCtrl_TableViewItemImpl.cpp +++ b/src/ui/controls/FUiCtrl_TableViewItemImpl.cpp @@ -24,12 +24,14 @@ #include #include +#include #include "FUiCtrl_TableViewItemImpl.h" #include "FUiCtrl_TableViewItem.h" #include "FUi_LayoutImpl.h" #include "FUi_ResourceManager.h" #include "FUi_ResourceSizeInfo.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Graphics; @@ -40,7 +42,13 @@ namespace Tizen { namespace Ui { namespace Controls Tizen::Graphics::Dimension _TableViewItemImpl::TableViewItemSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const { - return Dimension(0, 0); + return Dimension(0.0f, 0.0f); +} + +Tizen::Graphics::FloatDimension +_TableViewItemImpl::TableViewItemSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const +{ + return FloatDimension(0.0f, 0.0f); } _TableViewItemImpl* @@ -58,6 +66,10 @@ _TableViewItemImpl::GetInstance(const TableViewItemBase& tableViewItem) _TableViewItemImpl::_TableViewItemImpl(TableViewItemBase* pPublic, _TableViewItem* pCore, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) : _ContainerImpl(pPublic, pCore, pPublicPortraitLayout, pPublicLandscapeLayout) { + if (pPublicPortraitLayout != null || pPublicLandscapeLayout != null) + { + GetCore().SetItemLayoutEnabled(true); + } } _TableViewItemImpl::~_TableViewItemImpl(void) @@ -96,11 +108,11 @@ _TableViewItemImpl::GetCore(void) } _TableViewItemImpl* -_TableViewItemImpl::CreateTableViewItemImplN(TableViewItemBase* pPublic, const Dimension& itemSize, const TableViewAnnexStyle style, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) +_TableViewItemImpl::CreateTableViewItemImplN(TableViewItemBase* pPublic, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style, Layout* pPublicPortraitLayout, Layout* pPublicLandscapeLayout) { result r = E_SUCCESS; - r = GET_SIZE_INFO(TableViewItem).CheckInitialSizeValid(Dimension(itemSize.width, itemSize.height), _CONTROL_ORIENTATION_PORTRAIT); + r = GET_SIZE_INFO(TableViewItem).CheckInitialSizeValidF(FloatDimension(itemSize.width, itemSize.height), _CONTROL_ORIENTATION_PORTRAIT); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); if (pPublicPortraitLayout != null) @@ -135,13 +147,12 @@ CATCH: return null; } - result -_TableViewItemImpl::Construct(const Dimension& itemSize, const TableViewAnnexStyle style) +_TableViewItemImpl::Construct(const FloatDimension& itemSize, const TableViewAnnexStyle style) { result r = E_SUCCESS; - SysTryReturn(NID_UI_CTRL, (itemSize.width >= 0 && itemSize.height >= 0), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] The item size should be greater than 0")); + SysTryReturn(NID_UI_CTRL, (itemSize.width >= 0 && itemSize.height >= 0), E_INVALID_ARG, E_INVALID_ARG, ("[E_INVALID_ARG] The item size should be greater than 0")); //CONVERTFLOAT_1 GetCore().SetItemStyle(style); GetCore().SetItemWidth(itemSize.width); @@ -293,31 +304,41 @@ _TableViewItemImpl::GetSimpleItemTextSize(void) const return GetCore().GetSimpleItemTextSize(); } -int +float _TableViewItemImpl::GetAnnexWidth(TableViewAnnexStyle style) { - int annexWidth = 0; + int annexWidthInt = 0; + float annexWidth = 0.0f; switch (style) { case TABLE_VIEW_ANNEX_STYLE_NORMAL: - annexWidth = 0; + annexWidth = 0.0f; break; case TABLE_VIEW_ANNEX_STYLE_MARK: - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidthInt); + annexWidth = _CoordinateSystemUtils::ConvertToFloat(annexWidthInt); // +++ check floating break; case TABLE_VIEW_ANNEX_STYLE_RADIO: - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidthInt); + annexWidth = _CoordinateSystemUtils::ConvertToFloat(annexWidthInt); // +++ check floating break; case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING: - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidthInt); + annexWidth = _CoordinateSystemUtils::ConvertToFloat(annexWidthInt); // +++ check floating + break; + + case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER: + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidthInt); + annexWidth = _CoordinateSystemUtils::ConvertToFloat(annexWidthInt); // +++ check floating break; case TABLE_VIEW_ANNEX_STYLE_DETAILED: - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth); + GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidthInt); + annexWidth = _CoordinateSystemUtils::ConvertToFloat(annexWidthInt); // +++ check floating break; default: diff --git a/src/ui/controls/FUiCtrl_TableViewItemProvider.cpp b/src/ui/controls/FUiCtrl_TableViewItemProvider.cpp index 61569bc..02ac799 100644 --- a/src/ui/controls/FUiCtrl_TableViewItemProvider.cpp +++ b/src/ui/controls/FUiCtrl_TableViewItemProvider.cpp @@ -18,17 +18,20 @@ /** * @file FUiCtrl_TableViewItemProvider.cpp * @brief This file implements the _TableViewItemProvider class. - * @version 3.0 */ #include #include #include #include +#include +#include +#include #include #include #include "FUiCtrl_TableViewItemProvider.h" #include "FUi_ResourceManager.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; using namespace Tizen::Ui; @@ -36,12 +39,16 @@ using namespace Tizen::Ui; namespace Tizen { namespace Ui { namespace Controls { -_TableViewItemProvider::_TableViewItemProvider(TableViewStyle style) +_TableViewItemProvider::_TableViewItemProvider(TableViewStyle style, bool useFloatingPoint) : __pSimpleProvider(null) , __pGroupedProvider(null) , __pSectionProvider(null) + , __pSimpleProviderF(null) + , __pGroupedProviderF(null) + , __pSectionProviderF(null) , __style(style) , __onProcessing(false) + , __useFloatingPoint(useFloatingPoint) { } @@ -54,11 +61,11 @@ _TableViewItemProvider::~_TableViewItemProvider(void) } _TableViewItemProvider* -_TableViewItemProvider::CreateTableViewItemProviderN(TableViewStyle style) +_TableViewItemProvider::CreateTableViewItemProviderN(TableViewStyle style, bool useFloatingPoint) { ClearLastResult(); - _TableViewItemProvider* pProvider = new (std::nothrow) _TableViewItemProvider(style); + _TableViewItemProvider* pProvider = new (std::nothrow) _TableViewItemProvider(style, useFloatingPoint); SysTryReturn(NID_UI_CTRL, pProvider != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); return pProvider; @@ -69,6 +76,11 @@ _TableViewItemProvider::SetSimpleStyleItemProvider(ITableViewItemProvider* pProv { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SIMPLE, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + if (__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + __pSimpleProvider = pProvider; return E_SUCCESS; @@ -79,6 +91,11 @@ _TableViewItemProvider::SetGroupedStyleItemProvider(IGroupedTableViewItemProvide { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_GROUPED, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + if (__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + __pGroupedProvider = pProvider; return E_SUCCESS; @@ -89,30 +106,101 @@ _TableViewItemProvider::SetSectionStyleItemProvider(ISectionTableViewItemProvide { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + if (__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + __pSectionProvider = pProvider; return E_SUCCESS; } +result +_TableViewItemProvider::SetSimpleStyleItemProviderF(ITableViewItemProviderF* pProvider) +{ + SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SIMPLE, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + + if (!__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + + __pSimpleProviderF = pProvider; + + return E_SUCCESS; +} + +result +_TableViewItemProvider::SetGroupedStyleItemProviderF(IGroupedTableViewItemProviderF* pProvider) +{ + SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_GROUPED, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + + if (!__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + + __pGroupedProviderF = pProvider; + + return E_SUCCESS; +} + +result +_TableViewItemProvider::SetSectionStyleItemProviderF(ISectionTableViewItemProviderF* pProvider) +{ + SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); + + if (!__useFloatingPoint) + { + return E_INVALID_OPERATION; + } + + __pSectionProviderF = pProvider; + + return E_SUCCESS; +} + + int _TableViewItemProvider::GetGroupCount(void) { int count = 0; __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - count = 1; - break; - - case TABLE_VIEW_STYLE_GROUPED: - count = __pGroupedProvider->GetGroupCount(); - break; - - case TABLE_VIEW_STYLE_SECTION: - count = __pSectionProvider->GetSectionCount(); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + count = 1; + break; + + case TABLE_VIEW_STYLE_GROUPED: + count = __pGroupedProviderF->GetGroupCount(); + break; + + case TABLE_VIEW_STYLE_SECTION: + count = __pSectionProviderF->GetSectionCount(); + break; + } + } + else + { + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + count = 1; + break; + + case TABLE_VIEW_STYLE_GROUPED: + count = __pGroupedProvider->GetGroupCount(); + break; + + case TABLE_VIEW_STYLE_SECTION: + count = __pSectionProvider->GetSectionCount(); + break; + } } __onProcessing = false; @@ -127,19 +215,39 @@ _TableViewItemProvider::GetItemCount(int groupIndex) __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - count = __pSimpleProvider->GetItemCount(); - break; - - case TABLE_VIEW_STYLE_GROUPED: - count = __pGroupedProvider->GetItemCount(groupIndex); - break; - - case TABLE_VIEW_STYLE_SECTION: - count = __pSectionProvider->GetItemCount(groupIndex); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + count = __pSimpleProviderF->GetItemCount(); + break; + + case TABLE_VIEW_STYLE_GROUPED: + count = __pGroupedProviderF->GetItemCount(groupIndex); + break; + + case TABLE_VIEW_STYLE_SECTION: + count = __pSectionProviderF->GetItemCount(groupIndex); + break; + } + } + else + { + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + count = __pSimpleProvider->GetItemCount(); + break; + + case TABLE_VIEW_STYLE_GROUPED: + count = __pGroupedProvider->GetItemCount(groupIndex); + break; + + case TABLE_VIEW_STYLE_SECTION: + count = __pSectionProvider->GetItemCount(groupIndex); + break; + } } __onProcessing = false; @@ -147,63 +255,99 @@ _TableViewItemProvider::GetItemCount(int groupIndex) return count; } -int +float _TableViewItemProvider::GetGroupItemHeight(int groupIndex) { return GetDefaultGroupItemHeight(); } -int +float _TableViewItemProvider::GetItemHeight(const TableViewItemTag& itemTag) { return GetDefaultItemHeight(); } -int +float _TableViewItemProvider::GetDefaultItemHeight(void) { - int height = 0; + float height = 0.0f; __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - height = __pSimpleProvider->GetDefaultItemHeight(); - break; - - case TABLE_VIEW_STYLE_GROUPED: - height = __pGroupedProvider->GetDefaultItemHeight(); - break; - - case TABLE_VIEW_STYLE_SECTION: - height = __pSectionProvider->GetDefaultItemHeight(); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + height = __pSimpleProviderF->GetDefaultItemHeight(); + break; + + case TABLE_VIEW_STYLE_GROUPED: + height = __pGroupedProviderF->GetDefaultItemHeight(); + break; + + case TABLE_VIEW_STYLE_SECTION: + height = __pSectionProviderF->GetDefaultItemHeight(); + break; + } + } + else + { + int heightInt = 0; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + heightInt = __pSimpleProvider->GetDefaultItemHeight(); + break; + + case TABLE_VIEW_STYLE_GROUPED: + heightInt = __pGroupedProvider->GetDefaultItemHeight(); + break; + + case TABLE_VIEW_STYLE_SECTION: + heightInt = __pSectionProvider->GetDefaultItemHeight(); + break; + } + + height = _CoordinateSystemUtils::ConvertToFloat(heightInt); } __onProcessing = false; return height; } -int + +float _TableViewItemProvider::GetDefaultGroupItemHeight(void) { - int height = 0; + float height = 0.0f; + int heightInt = 0; __onProcessing = true; switch (__style) { case TABLE_VIEW_STYLE_SIMPLE: - height = 0; + height = 0.0f; break; case TABLE_VIEW_STYLE_GROUPED: - height = __pGroupedProvider->GetDefaultGroupItemHeight(); + if (__useFloatingPoint) + { + height = __pGroupedProviderF->GetDefaultGroupItemHeight(); + } + else + { + heightInt = __pGroupedProvider->GetDefaultGroupItemHeight(); + + height = _CoordinateSystemUtils::ConvertToFloat(heightInt); + } break; case TABLE_VIEW_STYLE_SECTION: - GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); + { + GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); + } break; } @@ -214,7 +358,7 @@ _TableViewItemProvider::GetDefaultGroupItemHeight(void) TableViewGroupItem* -_TableViewItemProvider::CreateGroupItem(int groupIndex, int itemWidth) +_TableViewItemProvider::CreateGroupItem(int groupIndex, float itemWidth) { TableViewGroupItem* pItem = null; @@ -227,7 +371,15 @@ _TableViewItemProvider::CreateGroupItem(int groupIndex, int itemWidth) break; case TABLE_VIEW_STYLE_GROUPED: - pItem = __pGroupedProvider->CreateGroupItem(groupIndex, itemWidth); + if (__useFloatingPoint) + { + pItem = __pGroupedProviderF->CreateGroupItem(groupIndex, itemWidth); + } + else + { + int itemWidthInt = _CoordinateSystemUtils::ConvertToInteger(itemWidth); + pItem = __pGroupedProvider->CreateGroupItem(groupIndex, itemWidthInt); + } break; case TABLE_VIEW_STYLE_SECTION: @@ -255,9 +407,15 @@ _TableViewItemProvider::DeleteGroupItem(int groupIndex, TableViewGroupItem* pIte break; case TABLE_VIEW_STYLE_GROUPED: - value = __pGroupedProvider->DeleteGroupItem(groupIndex, pItem); + if (__useFloatingPoint) + { + value = __pGroupedProviderF->DeleteGroupItem(groupIndex, pItem); + } + else + { + value = __pGroupedProvider->DeleteGroupItem(groupIndex, pItem); + } break; - case TABLE_VIEW_STYLE_SECTION: delete pItem; value = true; @@ -269,25 +427,47 @@ _TableViewItemProvider::DeleteGroupItem(int groupIndex, TableViewGroupItem* pIte } TableViewItem* -_TableViewItemProvider::CreateItem(const TableViewItemTag& itemTag, int itemWidth) +_TableViewItemProvider::CreateItem(const TableViewItemTag& itemTag, float itemWidth) { TableViewItem* pItem = null; __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - pItem = __pSimpleProvider->CreateItem(itemTag.itemIndex, itemWidth); - break; - - case TABLE_VIEW_STYLE_GROUPED: - pItem = __pGroupedProvider->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidth); - break; - - case TABLE_VIEW_STYLE_SECTION: - pItem = __pSectionProvider->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidth); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + pItem = __pSimpleProviderF->CreateItem(itemTag.itemIndex, itemWidth); + break; + + case TABLE_VIEW_STYLE_GROUPED: + pItem = __pGroupedProviderF->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidth); + break; + + case TABLE_VIEW_STYLE_SECTION: + pItem = __pSectionProviderF->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidth); + break; + } + } + else + { + int itemWidthInt = _CoordinateSystemUtils::ConvertToInteger(itemWidth); + + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + pItem = __pSimpleProvider->CreateItem(itemTag.itemIndex, itemWidthInt); + break; + + case TABLE_VIEW_STYLE_GROUPED: + pItem = __pGroupedProvider->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidthInt); + break; + + case TABLE_VIEW_STYLE_SECTION: + pItem = __pSectionProvider->CreateItem(itemTag.groupIndex, itemTag.itemIndex, itemWidthInt); + break; + } } __onProcessing = false; @@ -302,19 +482,39 @@ _TableViewItemProvider::DeleteItem(const TableViewItemTag& itemTag, TableViewIte __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - value = __pSimpleProvider->DeleteItem(itemTag.itemIndex, pItem); - break; - - case TABLE_VIEW_STYLE_GROUPED: - value = __pGroupedProvider->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); - break; - - case TABLE_VIEW_STYLE_SECTION: - value = __pSectionProvider->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + value = __pSimpleProviderF->DeleteItem(itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_GROUPED: + value = __pGroupedProviderF->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_SECTION: + value = __pSectionProviderF->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + } + } + else + { + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + value = __pSimpleProvider->DeleteItem(itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_GROUPED: + value = __pGroupedProvider->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_SECTION: + value = __pSectionProvider->DeleteItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + } } __onProcessing = false; @@ -327,19 +527,39 @@ _TableViewItemProvider::UpdateItem(const TableViewItemTag& itemTag, TableViewIte { __onProcessing = true; - switch (__style) + if (__useFloatingPoint) { - case TABLE_VIEW_STYLE_SIMPLE: - __pSimpleProvider->UpdateItem(itemTag.itemIndex, pItem); - break; - - case TABLE_VIEW_STYLE_GROUPED: - __pGroupedProvider->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); - break; - - case TABLE_VIEW_STYLE_SECTION: - __pSectionProvider->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); - break; + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + __pSimpleProviderF->UpdateItem(itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_GROUPED: + __pGroupedProviderF->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_SECTION: + __pSectionProviderF->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + } + } + else + { + switch (__style) + { + case TABLE_VIEW_STYLE_SIMPLE: + __pSimpleProvider->UpdateItem(itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_GROUPED: + __pGroupedProvider->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + + case TABLE_VIEW_STYLE_SECTION: + __pSectionProvider->UpdateItem(itemTag.groupIndex, itemTag.itemIndex, pItem); + break; + } } __onProcessing = false; @@ -360,7 +580,14 @@ _TableViewItemProvider::UpdateGroupItem(int groupIndex, TableViewGroupItem *pIte break; case TABLE_VIEW_STYLE_GROUPED: - __pGroupedProvider->UpdateGroupItem(groupIndex, pItem); + if (__useFloatingPoint) + { + __pGroupedProviderF->UpdateGroupItem(groupIndex, pItem); + } + else + { + __pGroupedProvider->UpdateGroupItem(groupIndex, pItem); + } value = true; break; @@ -386,7 +613,14 @@ _TableViewItemProvider::IsReorderable(int groupIndexFrom, int groupIndexTo) break; case TABLE_VIEW_STYLE_GROUPED: - //value = __pGroupedProvider->IsReorderable(groupIndexFrom, groupIndexTo); + if (__useFloatingPoint) + { + //value = __pGroupedProviderF->IsReorderable(groupIndexFrom, groupIndexTo); + } + else + { + //value = __pGroupedProvider->IsReorderable(groupIndexFrom, groupIndexTo); + } value = false; break; @@ -409,7 +643,18 @@ _TableViewItemProvider::GetSectionHeader(int groupIndex) { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, String(""), E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); - return __pSectionProvider->GetSectionHeader(groupIndex); + String sectionHeader; + + if (__useFloatingPoint) + { + sectionHeader = __pSectionProviderF->GetSectionHeader(groupIndex); + } + else + { + sectionHeader = __pSectionProvider->GetSectionHeader(groupIndex); + } + + return sectionHeader; } bool @@ -417,7 +662,18 @@ _TableViewItemProvider::HasSectionHeader(int groupIndex) { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); - return __pSectionProvider->HasSectionHeader(groupIndex); + bool hasSectionHeader; + + if (__useFloatingPoint) + { + hasSectionHeader = __pSectionProviderF->HasSectionHeader(groupIndex); + } + else + { + hasSectionHeader = __pSectionProvider->HasSectionHeader(groupIndex); + } + + return hasSectionHeader; } Tizen::Base::String @@ -425,7 +681,18 @@ _TableViewItemProvider::GetSectionFooter(int groupIndex) { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, String(""), E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); - return __pSectionProvider->GetSectionFooter(groupIndex); + String sectionFooter; + + if (__useFloatingPoint) + { + sectionFooter = __pSectionProviderF->GetSectionFooter(groupIndex); + } + else + { + sectionFooter = __pSectionProvider->GetSectionFooter(groupIndex); + } + + return sectionFooter; } bool @@ -433,7 +700,18 @@ _TableViewItemProvider::HasSectionFooter(int groupIndex) { SysTryReturn(NID_UI_CTRL, __style == TABLE_VIEW_STYLE_SECTION, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The style of TableView is not TABLE_VIEW_STYLE_SECTION"); - return __pSectionProvider->HasSectionFooter(groupIndex); + bool hasSectionFooter; + + if (__useFloatingPoint) + { + hasSectionFooter = __pSectionProviderF->HasSectionFooter(groupIndex); + } + else + { + hasSectionFooter = __pSectionProvider->HasSectionFooter(groupIndex); + } + + return hasSectionFooter; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TableViewItemProviderAdaptor.cpp b/src/ui/controls/FUiCtrl_TableViewItemProviderAdaptor.cpp index b0fcc28..d3c4c29 100644 --- a/src/ui/controls/FUiCtrl_TableViewItemProviderAdaptor.cpp +++ b/src/ui/controls/FUiCtrl_TableViewItemProviderAdaptor.cpp @@ -29,14 +29,10 @@ #include "FUiCtrl_TableViewItem.h" #include "FUiCtrl_TableViewItemImpl.h" #include "FUiCtrl_TableViewItemProviderAdaptor.h" -//#include "FUiCtrl_TableViewItemFormat.h" - #include "FUiCtrl_ListViewModel.h" #include "FUiCtrl_IListItemCommon.h" -//#include "FUiCtrl_ListItemBaseImpl.h" -//#include "FUiCtrl_ListItemFormat.h" - #include "FUiCtrl_LabelImpl.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Graphics; @@ -46,7 +42,7 @@ namespace Tizen { namespace Ui { namespace Controls _TableViewItemProviderAdaptor::_TableViewItemProviderAdaptor() : __pTableViewProvider(null) , __pDefaultItem(null) - , __listWidth(0) + , __listWidth(0.0f) , __style(0) { } @@ -63,6 +59,11 @@ _TableViewItemProviderAdaptor::~_TableViewItemProviderAdaptor() void _TableViewItemProviderAdaptor::SetItemProvider(_TableViewItemProvider* pProvider) { + if (__pTableViewProvider != pProvider) + { + delete __pTableViewProvider; + } + __pTableViewProvider = pProvider; } @@ -82,6 +83,8 @@ _TableViewItemProviderAdaptor::IsItemProvider() const int _TableViewItemProviderAdaptor::GetItemCount(int groupIndex) const { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, 0, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + if (__style == TABLE_VIEW_STYLE_SECTION) { if (__pTableViewProvider->HasSectionFooter(groupIndex) == true) @@ -96,6 +99,8 @@ _TableViewItemProviderAdaptor::GetItemCount(int groupIndex) const int _TableViewItemProviderAdaptor::GetGroupCount(void) const { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, 0, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + if (__style == TABLE_VIEW_STYLE_SIMPLE) { return 1; @@ -107,7 +112,7 @@ _TableViewItemProviderAdaptor::GetGroupCount(void) const _IListItemCommon* _TableViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) { - SysTryReturn(NID_UI_CTRL, __pTableViewProvider, null, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed."); + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, null, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed."); TableViewItem* pItem = null; TableViewGroupItem* pGroupItem = null; @@ -153,17 +158,19 @@ _TableViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) return __pDefaultItem; } - int itemHeight = 0, titleHeight = 0; + float itemHeight = 0.0f; + float titleHeight = 0.0f; Color textColor; + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, textColor); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHeight); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, titleHeight); - pGroupItem->Construct(Dimension(__listWidth, itemHeight)); + pGroupItem->Construct(FloatDimension(__listWidth, itemHeight)); //pGroupItem->SetBackgroundColor(Color(0, 0, 255)); pLabel = new (std::nothrow) Label(); - pLabel->Construct(Rectangle(0, itemHeight - titleHeight, __listWidth, titleHeight), __pTableViewProvider->GetSectionHeader(groupIndex)); + pLabel->Construct(FloatRectangle(0.0f, itemHeight - titleHeight, __listWidth, titleHeight), __pTableViewProvider->GetSectionHeader(groupIndex)); pLabel->SetBackgroundColor(Color(0, 0, 0, 0)); pLabel->SetTextColor(textColor); pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); @@ -180,17 +187,19 @@ _TableViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) return __pDefaultItem; } - int itemHeight = 0, titleHeight = 0; + float itemHeight = 0.0f; + float titleHeight = 0.0f; Color textColor; + GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, textColor); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHeight); GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, titleHeight); - pItem->Construct(Dimension(__listWidth, itemHeight)); + pItem->Construct(FloatDimension(__listWidth, itemHeight)); //pItem->SetBackgroundColor(Color(0, 0, 255), TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL); pLabel = new (std::nothrow) Label(); - pLabel->Construct(Rectangle(0, 0, __listWidth, titleHeight), __pTableViewProvider->GetSectionFooter(groupIndex)); + pLabel->Construct(FloatRectangle(0.0f, 0.0f, __listWidth, titleHeight), __pTableViewProvider->GetSectionFooter(groupIndex)); pLabel->SetBackgroundColor(Color(0, 0, 0, 0)); pLabel->SetTextColor(textColor); pLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT); @@ -285,7 +294,7 @@ _TableViewItemProviderAdaptor::LoadItem(int groupIndex, int itemIndex) result _TableViewItemProviderAdaptor::UnloadItem(_IListItemCommon* pItemCore, int groupIndex, int itemIndex) { - SysTryReturn(NID_UI_CTRL, __pTableViewProvider, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); SysTryReturn(NID_UI_CTRL, pItemCore != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pItemCore is invalid argument."); TableViewItem* pItem = static_cast (pItemCore->GetAppInfo()); @@ -334,7 +343,7 @@ _TableViewItemProviderAdaptor::UnloadItem(_IListItemCommon* pItemCore, int group result _TableViewItemProviderAdaptor::DeleteItem(_IListItemCommon* pItemCore, int groupIndex, int itemIndex) { - SysTryReturn(NID_UI_CTRL, __pTableViewProvider, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); SysTryReturn(NID_UI_CTRL, pItemCore != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] pItemCore is invalid argument."); TableViewItem* pItem = static_cast (pItemCore->GetAppInfo()); @@ -362,6 +371,8 @@ _TableViewItemProviderAdaptor::DeleteItem(_IListItemCommon* pItemCore, int group bool _TableViewItemProviderAdaptor::UpdateItem(_IListItemCommon* pItemCore, int groupIndex, int itemIndex) { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + TableViewItemTag itemTag = {groupIndex, itemIndex}; bool ret = false; @@ -388,14 +399,14 @@ _TableViewItemProviderAdaptor::UpdateItem(_IListItemCommon* pItemCore, int group } result -_TableViewItemProviderAdaptor::SetListWidth(int width) +_TableViewItemProviderAdaptor::SetListWidth(float width) { __listWidth = width; return E_SUCCESS; } -int +float _TableViewItemProviderAdaptor::GetListWidth(void) { return __listWidth; @@ -412,19 +423,25 @@ _TableViewItemProviderAdaptor::SetTableViewStyle(int style) bool _TableViewItemProviderAdaptor::HasSectionHeader(int groupIndex) const { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + return __pTableViewProvider->HasSectionHeader(groupIndex); } bool _TableViewItemProviderAdaptor::HasSectionFooter(int groupIndex) const { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + return __pTableViewProvider->HasSectionFooter(groupIndex); } -int +float _TableViewItemProviderAdaptor::GetItemHeight(int groupIndex, int itemIndex) { - int itemHeight = 0; + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, 0, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + + float itemHeight = 0.0f; if (itemIndex == -1) { @@ -439,20 +456,27 @@ _TableViewItemProviderAdaptor::GetItemHeight(int groupIndex, int itemIndex) return itemHeight; } -int +float _TableViewItemProviderAdaptor::GetDefaultItemHeight(void) { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, 0, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + return __pTableViewProvider->GetDefaultItemHeight(); } -int + +float _TableViewItemProviderAdaptor::GetDefaultGroupItemHeight(void) { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, 0, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + return __pTableViewProvider->GetDefaultGroupItemHeight(); } bool _TableViewItemProviderAdaptor::IsReorderable(int groupIndexFrom, int groupIndexTo) { + SysTryReturn(NID_UI_CTRL, __pTableViewProvider != null, false, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This instance has not provider."); + return __pTableViewProvider->IsReorderable(groupIndexFrom, groupIndexTo); } @@ -466,90 +490,12 @@ _TableViewItemProviderAdaptor::IsOnProcessing() return false; } -void -_TableViewItemProviderAdaptor::SetAnnexToItem(TableViewItem* pItem) -{ - int leftMargin = 0; - GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin); - Rectangle annexRect = Rectangle(0, 0, 0, 0); - - _TableViewItemImpl* pImpl = _TableViewItemImpl::GetInstance(*pItem); - - _TableViewItem* pTableViewItem = null; - pTableViewItem = &pImpl->GetCore(); - - int itemHeight = pTableViewItem->GetItemHeight(); - int annexWidth = TableViewItem::GetAnnexWidth(pTableViewItem->GetItemStyle()); - - switch (pTableViewItem->GetItemStyle()) - { - case TABLE_VIEW_ANNEX_STYLE_MARK: - annexRect.x = __listWidth - annexWidth - leftMargin; - annexRect.y = 0; - annexRect.width = annexWidth; - annexRect.height = itemHeight; - - if (annexRect.x < 0 || annexRect.y < 0) - { - return; - } - - //pTableViewItem->AddCheckBox(annexRect); - break; - - case TABLE_VIEW_ANNEX_STYLE_RADIO: - annexRect.x = __listWidth - annexWidth - leftMargin; - annexRect.y = 0; - annexRect.width = annexWidth; - annexRect.height = itemHeight; - - if (annexRect.x < 0 || annexRect.y < 0) - { - return; - } - - //pTableViewItem->AddCheckBox(annexRect, LIST_RADIO); - break; - - case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING: - annexRect.x = __listWidth - annexWidth - leftMargin; - annexRect.y = 0; - annexRect.width = annexWidth + leftMargin; - annexRect.height = itemHeight; - - if (annexRect.x < 0 || annexRect.y < 0) - { - return; - } - - //pTableViewItem->AddCheckBox(annexRect); - break; - - case TABLE_VIEW_ANNEX_STYLE_DETAILED: - annexRect.x = __listWidth - annexWidth - leftMargin; - annexRect.y = 0; - annexRect.width = annexWidth; - annexRect.height = itemHeight; - - if (annexRect.x < 0 || annexRect.y < 0) - { - return; - } - - //pTableViewItem->AddDetailButton(annexRect); - break; - - default: - break; - } -} - _TableViewItem* _TableViewItemProviderAdaptor::GetDefaultItem(void) { if (__pDefaultItem == null) { - __pDefaultItem = _TableViewItem::CreateTableViewItemN(0); + __pDefaultItem = _TableViewItem::CreateTableViewItemN(0.0f); } return __pDefaultItem; diff --git a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp index eace4df..b25f1b2 100644 --- a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp @@ -35,6 +35,8 @@ #include "FUiCtrl_TableViewItem.h" #include "FUiCtrl_TableViewPresenter.h" #include "FUiCtrl_TableViewItemProviderAdaptor.h" +#include "FUi_CoordinateSystemUtils.h" +#include "FUi_Math.h" using namespace Tizen::Ui::Animations; using namespace Tizen::Graphics; @@ -54,7 +56,6 @@ _TableViewPresenter::_TableViewPresenter() , __firstDrawnFlag(true) , __statusChangedFlag(true) , __scrolling(true) - , __movedPos(0) , __pItemDrawingProperty(null) , __pBaseVisualElement(null) , __sweepOccured(false) @@ -66,6 +67,9 @@ _TableViewPresenter::_TableViewPresenter() , __itemTotalHeight(0) , __pFastScrollTimer(null) , __isFastScrollTimerEnabled(false) + , __scrollHeightOnFlickStarted(0) + , __scrollPositionOnFlickStarted(0) + , __isAnimationCallbackBlocked(false) { __sweptItemTag.itemIndex = -1; __sweptItemTag.groupIndex = -1; @@ -115,7 +119,7 @@ _TableViewPresenter::Initialize(_TableView* pTableView) __pFastScrollTimer = new (std::nothrow) Timer(); SysTryCatch(NID_UI_CTRL, __pFastScrollTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - __pFastScrollTimer->Construct(*this); + r = __pFastScrollTimer->Construct(*this); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); return true; @@ -189,21 +193,30 @@ _TableViewPresenter::SetItemProvider(const _TableViewItemProvider* pProvider) { pProviderAdaptor = new (std::nothrow) _TableViewItemProviderAdaptor(); SysTryReturn(NID_UI_CTRL, pProviderAdaptor != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, ("[E_OUT_OF_MEMORY] The memory is insufficient.")); + + SetTableViewItemProviderAdaptor(pProviderAdaptor); } - r = __pListModel->RegisterItemProviderAdaptor(pProviderAdaptor); + _TableViewItemProvider* pNewProvider = null; - pProviderAdaptor->SetItemProvider(const_cast <_TableViewItemProvider*>(pProvider)); - pProviderAdaptor->SetListWidth(__pTableView->GetBounds().width - (GetLeftMargin() * 2)); - pProviderAdaptor->SetTableViewStyle(__pTableView->GetTableViewStyle()); + if (pProvider != null) + { + pNewProvider = const_cast <_TableViewItemProvider*>(pProvider); + } + else + { + __pListModel->RemoveAllItem(false); + } - SetTableViewItemProviderAdaptor(pProviderAdaptor); + pProviderAdaptor->SetItemProvider(pNewProvider); + pProviderAdaptor->SetListWidth(__pTableView->GetBoundsF().width - (GetLeftMargin() * 2)); + pProviderAdaptor->SetTableViewStyle(__pTableView->GetTableViewStyle()); return r; } result -_TableViewPresenter::GetItemFromPosition(const Tizen::Graphics::Point& position, TableViewItemTag& itemPos) const +_TableViewPresenter::GetItemFromPosition(const Tizen::Graphics::FloatPoint& position, TableViewItemTag& itemPos) const { _TableViewItem* pItem = null; TableViewItemTag lastItemPos = {-1, -1}; @@ -216,7 +229,7 @@ _TableViewPresenter::GetItemFromPosition(const Tizen::Graphics::Point& position, pItem = static_cast <_TableViewItem*>(__pListModel->LoadItem(itemPos.groupIndex, itemPos.itemIndex)); SysTryCatch(NID_UI_CTRL, pItem != null, , E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is out of range."); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); if (itemBounds.Contains(position)) { return E_SUCCESS; @@ -227,7 +240,7 @@ _TableViewPresenter::GetItemFromPosition(const Tizen::Graphics::Point& position, break; } - } while (GetNextItemPosition(itemPos, itemPos) == true); + } while (GetNextItemPosition(itemPos, itemPos)); CATCH: itemPos.itemIndex = -1; @@ -350,15 +363,9 @@ _TableViewPresenter::RefreshTableView(int groupIndex, int itemIndex, TableViewRe return E_OUT_OF_RANGE; } - if (IsEmpty() && type == TABLE_VIEW_REFRESH_TYPE_ITEM_ADD && __pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE) - { - UpdateTableView(); - } - - _IListItemCommon* pItem = null; TableViewItemTag topDrawnItemPos = {-1, -1}; TableViewItemTag refreshItemPos = {groupIndex, itemIndex}; - int itemHeight = 0; + float prevScrollAreaHeight = GetScrollAreaBounds().height; GetTopDrawnItem(topDrawnItemPos); @@ -392,34 +399,22 @@ _TableViewPresenter::RefreshTableView(int groupIndex, int itemIndex, TableViewRe } else { - pItem = pProviderAdaptor->LoadItem(groupIndex, itemIndex); - SysTryReturn(NID_UI_CTRL, pItem != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Unable to load item."); + bool emptyState = IsEmpty(); - if (__pListModel->InsertItemToGroup(pItem, groupIndex, itemIndex) != E_SUCCESS) + if (__pListModel->InsertItemToGroup(null, groupIndex, itemIndex) != E_SUCCESS) { - pProviderAdaptor->UnloadItem(pItem, groupIndex, itemIndex); SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to add item."); return E_SYSTEM; } - itemHeight = pItem->GetItemHeight(); - - if (!IsValidDrawnItem(groupIndex, itemIndex)) + if (emptyState) { - if (__pListModel->UnloadItem(groupIndex, itemIndex) != E_SUCCESS) - { - SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to unload item."); - } + GetFirstItem(topDrawnItemPos); } } RefreshItemHeightList(groupIndex, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_ADD); - if (itemIndex != -1) - { - SetItemHeight(refreshItemPos, itemHeight); - } - if (__pListModel->GetAllItemCount() == 1) { SetStatusChanged(true); @@ -524,26 +519,77 @@ _TableViewPresenter::RefreshTableView(int groupIndex, int itemIndex, TableViewRe AdjustClientAreaBounds(true); - RefreshItemLayout(topDrawnItemPos, refreshItemPos, type, animation); + if ((topDrawnItemPos.groupIndex > refreshItemPos.groupIndex) + ||((topDrawnItemPos.groupIndex == refreshItemPos.groupIndex)&&(topDrawnItemPos.itemIndex > refreshItemPos.itemIndex))) + { + RefreshItemLayout(topDrawnItemPos, refreshItemPos, type, false); + + float newScrollPosition = GetScrollPosition() - (prevScrollAreaHeight - GetScrollAreaBounds().height); + SetScrollPosition(newScrollPosition, false); + } + else + { + RefreshItemLayout(topDrawnItemPos, refreshItemPos, type, animation); + } return E_SUCCESS; } result +_TableViewPresenter::RefreshAllItems(void) +{ + result r = E_SUCCESS; + TableViewItemTag itemTag = {-1, -1}; + TableViewItemTag lastLoadedItemTag = {-1, -1}; + + __pListModel->GetLastLoadedItemIndex(lastLoadedItemTag.groupIndex, lastLoadedItemTag.itemIndex); + __pListModel->GetFirstLoadedItemIndex(itemTag.groupIndex, itemTag.itemIndex); + + do + { + _TableViewItem* pItem = FindItem(itemTag); + + if (pItem == null) + { + continue; + } + + r = RefreshTableView(itemTag.groupIndex, itemTag.itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY, false); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if ((itemTag.itemIndex == lastLoadedItemTag.itemIndex) && (itemTag.groupIndex == lastLoadedItemTag.groupIndex)) + { + break; + } + } while (GetNextItemPosition(itemTag, itemTag)); + + return r; +} + +result _TableViewPresenter::UpdateTableView(void) { + _VisualElement* pVisualElement = __pTableView->GetVisualElement(); + + if (pVisualElement != null) + { + __pTableView->GetVisualElement()->RemoveAllAnimations(); + } + + if (__modelInitialized == false) { SetItemDrawingProperty(); - PreloadItem(); - - __modelInitialized = true; + if(PreloadItem() == false) + { + return E_SUCCESS; + } } else { TableViewItemTag topDrawnTag = {-1, -1}; - int shiftingDistance = 0; + float shiftingDistance = 0; ResetSweepItem(); @@ -555,29 +601,23 @@ _TableViewPresenter::UpdateTableView(void) if (pItem != null) { - shiftingDistance = GetScrollPosition() - pItem->GetBounds().y; + shiftingDistance = GetScrollPosition() - pItem->GetBoundsF().y; } } __pListModel->RemoveAllItem(false, true); - SetScrollPosition(0, false); + PreloadItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex, shiftingDistance); __statusChangedFlag = true; - PreloadItem(); - - if (__pListModel->IsValidItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex)) - { - ScrollToItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP, shiftingDistance); - } } return E_SUCCESS; } void -_TableViewPresenter::AdjustLayoutItems(int scrollPosition) +_TableViewPresenter::AdjustLayoutItems(float scrollPosition) { TableViewItemTag lastLoadedItemPos = {-1, -1}; TableViewItemTag firstLoadedItemPos = {-1, -1}; @@ -591,11 +631,12 @@ _TableViewPresenter::AdjustLayoutItems(int scrollPosition) if (pItem != null) { - int positionY = pItem->GetPosition().y; + float positionY = pItem->GetPositionF().y; currentItemPos = firstLoadedItemPos; - while (positionY > scrollPosition && GetPreviousItemPosition(currentItemPos, currentItemPos)) + //while ((positionY > scrollPosition) && GetPreviousItemPosition(currentItemPos, currentItemPos)) + while (!_FloatCompareLE(positionY, scrollPosition) && GetPreviousItemPosition(currentItemPos, currentItemPos)) { pItem = LoadItem(currentItemPos.groupIndex, currentItemPos.itemIndex); @@ -604,7 +645,7 @@ _TableViewPresenter::AdjustLayoutItems(int scrollPosition) break; } - positionY = pItem->GetPosition().y; + positionY = pItem->GetPositionF().y; } } @@ -612,12 +653,12 @@ _TableViewPresenter::AdjustLayoutItems(int scrollPosition) if (pItem != null) { - int positionY = pItem->GetPosition().y; - int itemHeight = pItem->GetBounds().height; - int limitScreenArea = scrollPosition + __pTableView->GetBounds().height; + float positionY = pItem->GetPositionF().y; + float itemHeight = pItem->GetBoundsF().height; + float limitScreenArea = scrollPosition + __pTableView->GetBoundsF().height; currentItemPos = lastLoadedItemPos; - while (positionY + itemHeight < limitScreenArea && GetNextItemPosition(currentItemPos, currentItemPos)) + while ((positionY + itemHeight < limitScreenArea) && GetNextItemPosition(currentItemPos, currentItemPos)) { pItem = LoadItem(currentItemPos.groupIndex, currentItemPos.itemIndex); @@ -626,8 +667,8 @@ _TableViewPresenter::AdjustLayoutItems(int scrollPosition) break; } - positionY = pItem->GetPosition().y; - itemHeight = pItem->GetBounds().height; + positionY = pItem->GetPositionF().y; + itemHeight = pItem->GetBoundsF().height; } } } @@ -651,9 +692,9 @@ _TableViewPresenter::ResetItemLayout(TableViewItemTag& topDrawnItemTag) TableViewItemTag currentItem = topDrawnItemTag; TableViewItemTag itemPos = topDrawnItemTag; - int screenAreaHeight = __pTableView->GetBounds().height; - int loadedItemTotalHeight = 0; - Rectangle itemBounds = pItem->GetBounds(); + float screenAreaHeight = __pTableView->GetBoundsF().height; + float loadedItemTotalHeight = 0.0f; + FloatRectangle itemBounds = pItem->GetBoundsF(); itemBounds.y = CalculateItemPositionY(itemPos.groupIndex, itemPos.itemIndex); pItem->SetBounds(itemBounds); @@ -671,7 +712,7 @@ _TableViewPresenter::ResetItemLayout(TableViewItemTag& topDrawnItemTag) } currentItem = itemPos; - loadedItemTotalHeight += pItem->GetBounds().height; + loadedItemTotalHeight += pItem->GetBoundsF().height; } if (loadedItemTotalHeight < screenAreaHeight) @@ -689,7 +730,7 @@ _TableViewPresenter::ResetItemLayout(TableViewItemTag& topDrawnItemTag) } currentItem = itemPos; - loadedItemTotalHeight += pItem->GetBounds().height; + loadedItemTotalHeight += pItem->GetBoundsF().height; } } } @@ -736,13 +777,20 @@ _TableViewPresenter::RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableV int loadItemCount = 0; int maxLoadItemCount = GetMaxItemCachingSize(); - Rectangle itemBounds(0, 0, 0, 0); + FloatRectangle itemBounds(0.0f, 0.0f, 0.0f, 0.0f); + + StopAllItemAnimation(); __pListModel->GetFirstLoadedItemIndex(itemPos.groupIndex, itemPos.itemIndex); + if (itemPos.groupIndex == -1 && itemPos.itemIndex == -1) + { + itemPos = topDrawnItemTag; + } + currentItem = itemPos; - int itemPositionY = CalculateItemPositionY(itemPos.groupIndex, itemPos.itemIndex); + float itemPositionY = CalculateItemPositionY(itemPos.groupIndex, itemPos.itemIndex); do { @@ -759,11 +807,9 @@ _TableViewPresenter::RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableV SetItemType(pItem, itemPos); } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); itemBounds.y = itemPositionY; - pItem->StopAllAnimation(); - if (animation) { if (type == TABLE_VIEW_REFRESH_TYPE_ITEM_ADD) @@ -776,7 +822,7 @@ _TableViewPresenter::RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableV } else { - if (!pItem->MoveItem(Point(itemBounds.x, itemBounds.y), ADD_ITEM_ANIMATION_DURATION, 0)) + if (!pItem->MoveItem(FloatPoint(itemBounds.x, itemBounds.y), ADD_ITEM_ANIMATION_DURATION, 0)) { pItem->SetBounds(itemBounds); } @@ -784,7 +830,7 @@ _TableViewPresenter::RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableV } else { - if (!pItem->MoveItem(Point(itemBounds.x, itemBounds.y), REMOVE_ITEM_MOVE_ANIMATION_DURATION, REFRESH_ITEM_ANIMATION_DELAY)) + if (!pItem->MoveItem(FloatPoint(itemBounds.x, itemBounds.y), REMOVE_ITEM_MOVE_ANIMATION_DURATION, REFRESH_ITEM_ANIMATION_DELAY)) { pItem->SetBounds(itemBounds); } @@ -831,26 +877,26 @@ _TableViewPresenter::RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableV void _TableViewPresenter::RefreshItemBounds(_TableViewItem* pItem, TableViewItemTag& itemPos) { - Rectangle itemBounds; + FloatRectangle itemBounds; if (pItem == null) { return; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); itemBounds.y = CalculateItemPositionY(itemPos.groupIndex, itemPos.itemIndex); if (itemPos.itemIndex != -1) { - int itemMargin = GetLeftMargin(); + float itemMargin = GetLeftMargin(); itemBounds.x = itemMargin; itemBounds.width = __pItemDrawingProperty->width - itemBounds.x - itemMargin; } else { - itemBounds.x = 0; + itemBounds.x = 0.0f; itemBounds.width = __pItemDrawingProperty->width; } @@ -858,13 +904,13 @@ _TableViewPresenter::RefreshItemBounds(_TableViewItem* pItem, TableViewItemTag& } result -_TableViewPresenter::GetItemIndexFromPosition(const Point& position, int& groupIndex, int& itemIndex) const +_TableViewPresenter::GetItemIndexFromPosition(const FloatPoint& position, int& groupIndex, int& itemIndex) const { result r = E_SUCCESS; TableViewItemTag itemPos; - Point targetPosition = position; - int scrollPosition = GetScrollPosition(); + FloatPoint targetPosition = position; + float scrollPosition = GetScrollPosition(); targetPosition.y += scrollPosition; r = GetItemFromPosition(targetPosition, itemPos); @@ -883,14 +929,16 @@ _TableViewPresenter::GetItemIndexFromPosition(const Point& position, int& groupI } -void +bool _TableViewPresenter::PreloadItem(void) { if (GetModel() == null || __pProviderAdaptor == null) { - return; + return false; } + __modelInitialized = true; + if (__pListModel->GetAllGroupCount() == 0 && (__pProviderAdaptor != null)) { int itemCount = 0; @@ -906,7 +954,6 @@ _TableViewPresenter::PreloadItem(void) __pListModel->RestoreItemStatus(); CreateItemHeightList(); - AdjustClientAreaBounds(true); int cachingSize = 0; @@ -942,6 +989,9 @@ _TableViewPresenter::PreloadItem(void) } } + PresetItemHeightList(); + AdjustClientAreaBounds(true); + if (__pTableView->GetScrollStyle() == TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL) { _FastScroll* pFastScroll = __pTableView->GetFastScrollBar(); @@ -951,6 +1001,64 @@ _TableViewPresenter::PreloadItem(void) pFastScroll->SetScrollVisibility(IsScrollable()); } } + + return true; +} + +bool +_TableViewPresenter::PreloadItem(int topDrawnGroupIndex, int topDrawnItemIndex, int shiftingDistance) +{ + if (GetModel() == null || __pProviderAdaptor == null) + { + return false; + } + + __modelInitialized = true; + + if (__pListModel->GetAllGroupCount() == 0 && (__pProviderAdaptor != null)) + { + int itemCount = 0; + int groupCount = __pProviderAdaptor->GetGroupCount(); + + for (int i = 0; i < groupCount; i++) + { + itemCount = __pProviderAdaptor->GetItemCount(i); + __pListModel->AddGroup(itemCount, false); + } + } + + __pListModel->RestoreItemStatus(); + + CreateItemHeightList(); + + if (!__pListModel->IsValidItem(topDrawnGroupIndex, topDrawnItemIndex)) + { + TableViewItemTag firstItemTag = {-1, -1}; + + GetFirstItem(firstItemTag); + + topDrawnGroupIndex = firstItemTag.groupIndex; + topDrawnItemIndex = firstItemTag.itemIndex; + + shiftingDistance = 0; + } + + ScrollToItem(topDrawnGroupIndex, topDrawnItemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP, shiftingDistance); + + PresetItemHeightList(); + AdjustClientAreaBounds(true); + + if (__pTableView->GetScrollStyle() == TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL) + { + _FastScroll* pFastScroll = __pTableView->GetFastScrollBar(); + if (pFastScroll != null) + { + pFastScroll->UpdateIndex(); + pFastScroll->SetScrollVisibility(IsScrollable()); + } + } + + return true; } bool @@ -1055,42 +1163,42 @@ _TableViewPresenter::IsStatusChanged(void) const return __statusChangedFlag; } -int +float _TableViewPresenter::GetTopMargin(void) const { return __topMargin; } result -_TableViewPresenter::SetTopMargin(int topMargin) +_TableViewPresenter::SetTopMargin(float topMargin) { __topMargin = topMargin; return E_SUCCESS; } -int +float _TableViewPresenter::GetBottomMargin(void) const { return __bottomMargin; } result -_TableViewPresenter::SetBottomMargin(int bottomMargin) +_TableViewPresenter::SetBottomMargin(float bottomMargin) { __bottomMargin = bottomMargin; return E_SUCCESS; } -int +float _TableViewPresenter::GetLeftMargin(void) const { return __leftMargin; } result -_TableViewPresenter::SetLeftMargin(int leftMargin) +_TableViewPresenter::SetLeftMargin(float leftMargin) { __leftMargin = leftMargin; @@ -1156,14 +1264,14 @@ _TableViewPresenter::SetItemLayout(_TableViewItem* pItem, TableViewItemTag& item { _TableViewItem* pSeriesItem = null; TableViewItemTag seriesItemPos = {-1, -1}; - Rectangle seriesItemBounds; - Rectangle itemBounds; + FloatRectangle seriesItemBounds; + FloatRectangle itemBounds; bool validBounds = false; bool downScroll = true; if (itemPos.itemIndex != -1) { - int itemMargin = GetLeftMargin(); + float itemMargin = GetLeftMargin(); itemBounds.x = itemMargin; itemBounds.width = __pItemDrawingProperty->width - itemBounds.x - itemMargin; } @@ -1174,7 +1282,7 @@ _TableViewPresenter::SetItemLayout(_TableViewItem* pItem, TableViewItemTag& item } //itemBounds.height = pItem->GetItemHeight(); - itemBounds.height = pItem->GetSize().height; + itemBounds.height = pItem->GetSizeF().height; if (itemPos.groupIndex == 0 && itemPos.itemIndex == -1) { @@ -1196,7 +1304,7 @@ _TableViewPresenter::SetItemLayout(_TableViewItem* pItem, TableViewItemTag& item } else { - seriesItemBounds = pSeriesItem->GetBounds(); + seriesItemBounds = pSeriesItem->GetBoundsF(); } itemBounds.y = seriesItemBounds.y + seriesItemBounds.height; @@ -1219,7 +1327,7 @@ _TableViewPresenter::SetItemLayout(_TableViewItem* pItem, TableViewItemTag& item } else { - seriesItemBounds = pSeriesItem->GetBounds(); + seriesItemBounds = pSeriesItem->GetBoundsF(); } itemBounds.y = seriesItemBounds.y - itemBounds.height; @@ -1237,6 +1345,11 @@ _TableViewPresenter::SetItemLayout(_TableViewItem* pItem, TableViewItemTag& item CheckItemHeightAndRefreshLayout(itemPos, downScroll); } + + if (pItem->GetItemLayoutEnabled()) + { + pItem->PartialUpdateLayout(); + } } _TableViewItem* @@ -1246,6 +1359,8 @@ _TableViewPresenter::LoadItem(int groupIndex, int itemIndex) if ((pItem != null) && !pItem->HasParent()) { + __pTableView->AttachChild(*pItem); + pItem->SetDrawingProperty(__pItemDrawingProperty); TableViewItemTag itemPosition = {groupIndex, itemIndex}; @@ -1253,10 +1368,8 @@ _TableViewPresenter::LoadItem(int groupIndex, int itemIndex) SetItemLayout(pItem, itemPosition); pItem->SetReorderMode(__pTableView->IsReorderModeEnabled()); pItem->AdjustChildControlMargin(); - - __pTableView->AttachChild(*pItem); - } + return pItem; } @@ -1387,7 +1500,7 @@ _TableViewPresenter::SetItemDrawingProperty(void) __pItemDrawingProperty->propertyChanged = true; } - if (__pItemDrawingProperty->leftMargin != __leftMargin) + if (!_FloatCompare(__pItemDrawingProperty->leftMargin, __leftMargin)) { __pItemDrawingProperty->leftMargin = __leftMargin; __pItemDrawingProperty->propertyChanged = true; @@ -1402,9 +1515,9 @@ _TableViewPresenter::SetItemDrawingProperty(void) __pItemDrawingProperty->scrollMargin = 0; } - if (__pItemDrawingProperty->width != __pTableView->GetBounds().width) + if (!_FloatCompare(__pItemDrawingProperty->width, __pTableView->GetBoundsF().width)) { - __pItemDrawingProperty->width = __pTableView->GetBounds().width; + __pItemDrawingProperty->width = __pTableView->GetBoundsF().width; __pItemDrawingProperty->propertyChanged = true; } } @@ -1413,13 +1526,11 @@ _TableViewPresenter::SetItemDrawingProperty(void) void _TableViewPresenter::OnBoundsChanged(void) { - _ScrollPanelPresenter::OnBoundsChanged(); - if (__pProviderAdaptor != null && __modelInitialized) { - int listWidth = __pTableView->GetBounds().width - (GetLeftMargin() * 2); + float listWidth = __pTableView->GetBoundsF().width - (GetLeftMargin() * 2); - if (listWidth != __pProviderAdaptor->GetListWidth()) + if (!_FloatCompare(listWidth, __pProviderAdaptor->GetListWidth())) { __pProviderAdaptor->SetListWidth(listWidth); SetItemDrawingProperty(); @@ -1432,6 +1543,11 @@ _TableViewPresenter::OnBoundsChanged(void) AdjustLayoutItems(GetScrollPosition()); } + else + { + SetClientAreaHeight(__pTableView->GetBoundsF().height); + _ScrollPanelPresenter::OnBoundsChanged(); + } } result @@ -1444,9 +1560,10 @@ _TableViewPresenter::Draw(void) { SetItemDrawingProperty(); - PreloadItem(); - - __modelInitialized = true; + if(PreloadItem() == false) + { + return E_SUCCESS; + } if (__reservedScrollItemIndex.groupIndex != -1 && __reservedScrollItemIndex.itemIndex != -1) { @@ -1476,9 +1593,6 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI { _UiTouchEventDelivery response = _ScrollPanelPresenter::OnPreviewTouchPressed(source, touchInfo); - __firstTouchMoved = true; - __sweepOccured = false; - _TableViewItem* pItem = GetTableViewItemFromControl(source); if (pItem == null) { @@ -1496,6 +1610,8 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI if (__pTableView->IsReorderModeEnabled()) { + __firstTouchMoved = true; + if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex)) { __reorderInfo.touchPressedPositionY = touchInfo.GetCurrentPosition().y; @@ -1503,29 +1619,90 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI return _UI_TOUCH_EVENT_DELIVERY_NO; } } - else + + return response; +} + +_UiTouchEventDelivery +_TableViewPresenter::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchInfo) +{ + if (__pTableView->IsReorderModeEnabled()) { - if (!(pItem == null - || pItem->IsContextItem() - || pItem->IsItemEnabled() == false - || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_TITLE - || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_HEADER - || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_FOOTER) - && ((itemPos.groupIndex != __sweptItemTag.groupIndex) - || (itemPos.itemIndex != __sweptItemTag.itemIndex))) + if (__reorderInfo.itemIndex != -1) { - ResetSweptItem(); + if (!DragSelectedItem(touchInfo.GetCurrentPosition().y - __reorderInfo.touchPressedPositionY, true)) + { + ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex); + } + + __firstTouchMoved = false; + + return _UI_TOUCH_EVENT_DELIVERY_NO; } } + return _ScrollPanelPresenter::OnPreviewTouchMoved(source, touchInfo); +} + +_UiTouchEventDelivery +_TableViewPresenter::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) +{ + if (__pTableView->IsReorderModeEnabled() && __reorderInfo.itemIndex != -1) + { + ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex); + + if (__reorderInfo.blockedTouchReleaseState) + { + __reorderInfo.blockedTouchReleaseState = false; + + return _UI_TOUCH_EVENT_DELIVERY_NO; + } + } + + return _ScrollPanelPresenter::OnPreviewTouchReleased(source, touchInfo); +} + +_UiTouchEventDelivery +_TableViewPresenter::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) +{ + return _ScrollPanelPresenter::OnPreviewTouchCanceled(source, touchInfo); +} + +bool +_TableViewPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) +{ + __firstTouchMoved = true; + + _TableViewItem* pItem = GetTableViewItemFromControl(source); + + if (pItem == null) + { + return false; + } + + TableViewItemTag itemPos = {-1, -1}; + pItem->GetItemIndex(itemPos.groupIndex, itemPos.itemIndex); + + if (!(pItem->IsContextItem() + || pItem->IsItemEnabled() == false + || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_TITLE + || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_HEADER + || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_FOOTER) + && ((itemPos.groupIndex != __sweptItemTag.groupIndex) + || (itemPos.itemIndex != __sweptItemTag.itemIndex))) + { + ResetSweptItem(); + } + + __sweepOccured = false; + _VisualElement* pVisualElement = __pTableView->GetVisualElement(); String animationName(L"EXPAND_GROUP_ANIMATION"); VisualElementValueAnimation* pExpandGroupAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); if (pExpandGroupAnimation != null) { pVisualElement->RemoveAnimation(animationName); - - //return _UI_TOUCH_EVENT_DELIVERY_NO; + delete pExpandGroupAnimation; } animationName = L"COLLAPSE_GROUP_ANIMATION"; @@ -1533,87 +1710,73 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI if (pCollapseGroupAnimation != null) { pVisualElement->RemoveAnimation(animationName); - - //return _UI_TOUCH_EVENT_DELIVERY_NO; + delete pCollapseGroupAnimation; } - return response; + return _ScrollPanelPresenter::OnTouchPressed(source, touchInfo); } -_UiTouchEventDelivery -_TableViewPresenter::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchInfo) +bool +_TableViewPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { - if (__pTableView->IsReorderModeEnabled() && __reorderInfo.itemIndex != -1) + if (__pTableView->IsReorderModeEnabled()) { - if (!DragSelectedItem(touchInfo.GetCurrentPosition().y - __reorderInfo.touchPressedPositionY, true)) - { - ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex); - } - - return _UI_TOUCH_EVENT_DELIVERY_NO; + return _ScrollPanelPresenter::OnTouchMoved(source, touchInfo); } _TableViewItem* pItem = GetTableViewItemFromControl(source); - - _UiTouchEventDelivery response = _ScrollPanelPresenter::OnPreviewTouchMoved(source, touchInfo); if (pItem == null || pItem->IsItemEnabled() == false || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_TITLE || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_HEADER - || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_FOOTER) + || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_FOOTER + || pItem->IsAnnexOnOffSliding()) { - return response; + return _ScrollPanelPresenter::OnTouchMoved(source, touchInfo);; } if (__firstTouchMoved) { - Point prevTouchPosition = GetPreviousTouchPosition(); - Point currTouchPosition = GetCurrentTouchPosition(); - int moveDistanceX = currTouchPosition.x - prevTouchPosition.x; - int moveDistanceY = currTouchPosition.y - prevTouchPosition.y; + FloatPoint prevTouchPosition = GetPreviousTouchPosition(); + FloatPoint currTouchPosition = GetCurrentTouchPosition(); + float moveDistanceX = currTouchPosition.x - prevTouchPosition.x; + float moveDistanceY = currTouchPosition.y - prevTouchPosition.y; if ((pItem->GetContextItem() != null && abs(moveDistanceX) > abs(moveDistanceY * 2)) || pItem->IsContextItem()) { if (!pItem->IsContextItem()) { pItem->GetItemIndex(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex); - __sweptItemPosition = pItem->GetPosition(); + __sweptItemPosition = pItem->GetPositionF(); pItem->AdjustContextItemBounds(); } __sweepOccured = true; - - SweepItem(moveDistanceX); } else { ResetSweptItem(); + return _ScrollPanelPresenter::OnTouchMoved(source, touchInfo); } } __firstTouchMoved = false; - return response; -} - -_UiTouchEventDelivery -_TableViewPresenter::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo) -{ - if (__pTableView->IsReorderModeEnabled() && __reorderInfo.itemIndex != -1) + if (__sweepOccured) { - ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex); - - if (__reorderInfo.blockedTouchReleaseState) - { - __reorderInfo.blockedTouchReleaseState = false; + FloatPoint prevTouchPosition = GetPreviousTouchPosition(); + FloatPoint currTouchPosition = GetCurrentTouchPosition(); - return _UI_TOUCH_EVENT_DELIVERY_NO; - } + SweepItem(currTouchPosition.x - prevTouchPosition.x); } - _UiTouchEventDelivery response = _ScrollPanelPresenter::OnPreviewTouchReleased(source, touchInfo); + return true; +} +bool +_TableViewPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) +{ _TableViewItem* pItem = GetTableViewItemFromControl(source); if (pItem == null @@ -1621,22 +1784,21 @@ _TableViewPresenter::OnPreviewTouchReleased(const _Control& source, const _Touch || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_HEADER || pItem->GetItemType() == TABLE_VIEW_ITEM_TYPE_FOOTER) { - return response; + return _ScrollPanelPresenter::OnTouchReleased(source, touchInfo); } - if (pItem->IsContextItem()) + if(__sweepOccured) { - pItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex)); - } - - _TableViewItem* pContextItem = pItem->GetContextItem(); + if (pItem->IsContextItem()) + { + pItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex)); + } + _TableViewItem* pContextItem = pItem->GetContextItem(); - if (__sweepOccured) - { // Swept event fire if (pContextItem == null && __pTableView->IsSweepEnabled()) { - Point prevPos = _ScrollPanelPresenter::GetPreviousTouchPosition(); + FloatPoint prevPos = _ScrollPanelPresenter::GetPreviousTouchPosition(); if (prevPos.x > touchInfo.GetCurrentPosition().x) { @@ -1655,42 +1817,6 @@ _TableViewPresenter::OnPreviewTouchReleased(const _Control& source, const _Touch } } - return response; -} - -_UiTouchEventDelivery -_TableViewPresenter::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchInfo) -{ - return _ScrollPanelPresenter::OnPreviewTouchCanceled(source, touchInfo); -} - -bool -_TableViewPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) -{ - return _ScrollPanelPresenter::OnTouchPressed(source, touchInfo); -} - -bool -_TableViewPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) -{ - if (!__sweepOccured || __pTableView->IsReorderModeEnabled()) - { - return _ScrollPanelPresenter::OnTouchMoved(source, touchInfo); - } - - if (__sweepOccured) - { - Point prevTouchPosition = GetPreviousTouchPosition(); - Point currTouchPosition = GetCurrentTouchPosition(); - SweepItem(currTouchPosition.x - prevTouchPosition.x); - } - - return true; -} - -bool -_TableViewPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchInfo) -{ return _ScrollPanelPresenter::OnTouchReleased(source, touchInfo); } @@ -1799,7 +1925,7 @@ _TableViewPresenter::OnTimerExpired(Tizen::Base::Runtime::Timer& timer) if (&timer == __pReorderScrollTimer) { - int distance = 0; + float distance = 0.0f; if (__reorderInfo.isScrollDirectionUp) { @@ -1862,9 +1988,19 @@ _TableViewPresenter::StopFastScrollTimer(void) bool _TableViewPresenter::IsEmpty(void) const { - if (GetItemCount() <= 0) + if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE) { - return true; + if (GetItemCountAt(0) <= 0) + { + return true; + } + } + else + { + if (GetGroupCount() <= 0 ) + { + return true; + } } return false; @@ -1893,12 +2029,29 @@ _TableViewPresenter::GetFirstItem(TableViewItemTag& firstItem) const return true; } +bool +_TableViewPresenter::GetLastItem(TableViewItemTag& lastItem) const +{ + if (IsEmpty()) + { + lastItem.groupIndex = -1; + lastItem.itemIndex = -1; + } + else + { + lastItem.groupIndex = GetGroupCount() - 1; + lastItem.itemIndex = GetItemCountAt(lastItem.groupIndex) - 1; + } + + return true; +} + result _TableViewPresenter::GetTopDrawnItem(TableViewItemTag& itemPos) const { _TableViewItem* pItem = null; TableViewItemTag lastItemPos = {-1, -1}; - int scrollPosition = 0; + float scrollPosition = 0.0f; scrollPosition = GetScrollPosition(); @@ -1913,7 +2066,7 @@ _TableViewPresenter::GetTopDrawnItem(TableViewItemTag& itemPos) const break; } - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); if (scrollPosition < (itemBounds.y + itemBounds.height)) { @@ -1948,7 +2101,7 @@ _TableViewPresenter::GetBottomDrawnItem(TableViewItemTag& itemPos) const return E_INVALID_STATE; } - int scrollPosition = GetScrollPosition() + __pTableView->GetBounds().height; + float scrollPosition = GetScrollPosition() + __pTableView->GetBoundsF().height; __pListModel->GetFirstLoadedItemIndex(itemPos.groupIndex, itemPos.itemIndex); __pListModel->GetLastLoadedItemIndex(lastItemPos.groupIndex, lastItemPos.itemIndex); @@ -1963,7 +2116,7 @@ _TableViewPresenter::GetBottomDrawnItem(TableViewItemTag& itemPos) const break; } - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); if (itemBounds.y <= scrollPosition && scrollPosition <= (itemBounds.y + itemBounds.height)) { @@ -2089,11 +2242,11 @@ _TableViewPresenter::GetNextItemPosition(const TableViewItemTag& currentItem, Ta return true; } -int +float _TableViewPresenter::GetHeightOfAllItems(void) const { int groupCount = GetGroupCount(); - int totalHeight = 0; + float totalHeight = 0; for (int i = 0; i < groupCount; i++) { @@ -2157,17 +2310,17 @@ _TableViewPresenter::ExpandGroup(int groupIndex, bool withAnimation) TableViewItemTag bottomTag; GetBottomDrawnItem(bottomTag); - int screenPosition = GetScrollPosition(); + float screenPosition = GetScrollPosition(); __pListModel->SetGroupExpandState(groupIndex, true); - int groupTotalHeight = 0; + float groupTotalHeight = 0; int itemCount = GetItemCountAt(groupIndex); _IListItemCommon* pItem = null; for (int i = 0; i < itemCount; i++) { pItem = __pListModel->GetItemFromTemporaryBuffer(groupIndex, i); - groupTotalHeight += pItem->GetItemHeight(); + groupTotalHeight += pItem->GetItemHeight(); // +++ check floating } AdjustClientAreaBounds(false, groupTotalHeight); @@ -2182,9 +2335,9 @@ _TableViewPresenter::ExpandGroup(int groupIndex, bool withAnimation) _TableViewItem* pItem = FindItem(firstLoadedItemTag); if (pItem != null) { - int itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex); + float itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); itemBounds.y = itemPositionY; pItem->SetBounds(itemBounds); @@ -2204,46 +2357,31 @@ _TableViewPresenter::ExpandGroup(int groupIndex, bool withAnimation) if (withAnimation) { - _VisualElement* pVisualElement = __pTableView->GetVisualElement(); - String animationName(L"EXPAND_GROUP_ANIMATION"); - VisualElementValueAnimation* pExpandGroupAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); - - if (pExpandGroupAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } - - pExpandGroupAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturn(NID_UI_CTRL, pExpandGroupAnimation != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - _TableViewItem *pItem = FindItem(itemTag); if (pItem == null) { - delete pExpandGroupAnimation; - return E_SUCCESS; } - Rectangle itemBounds = pItem->GetBounds(); - int startPosition = itemBounds.y + itemBounds.height; - int endPosition = startPosition + groupTotalHeight; + FloatRectangle itemBounds = pItem->GetBoundsF(); + float startPosition = itemBounds.y + itemBounds.height; - if (endPosition > screenPosition + __pTableView->GetBounds().height) + float endPosition = startPosition + groupTotalHeight; + if (endPosition > screenPosition + __pTableView->GetBoundsF().height) { - endPosition = screenPosition + __pTableView->GetBounds().height; + endPosition = screenPosition + __pTableView->GetBoundsF().height; } - pExpandGroupAnimation->SetStartValue(Variant(startPosition)); - pExpandGroupAnimation->SetEndValue(Variant(endPosition)); - pExpandGroupAnimation->SetDuration(EXPAND_GROUP_ANIMATION_DURATION); - pExpandGroupAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseInOut")); - pExpandGroupAnimation->SetVisualElementAnimationStatusEventListener(this); - pExpandGroupAnimation->SetVisualElementAnimationTickEventListener(this); + _VisualElement* pVisualElement = __pTableView->GetVisualElement(); + String animationName(L"EXPAND_GROUP_ANIMATION"); + + VisualElementValueAnimation* pAnimation = __pTableView->GetVisualElementValueAnimation(animationName); + pAnimation->SetStartValue(Variant(startPosition)); + pAnimation->SetEndValue(Variant(endPosition)); + pAnimation->SetDuration(EXPAND_GROUP_ANIMATION_DURATION); __expandableItemTag.groupIndex = groupIndex; __expandableItemTag.itemIndex = -1; - pVisualElement->AddAnimation(animationName, *pExpandGroupAnimation); - - delete pExpandGroupAnimation; + pVisualElement->AddAnimation(animationName, *pAnimation); } else { @@ -2301,19 +2439,19 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation) TableViewItemTag bottomTag; GetBottomDrawnItem(bottomTag); - int screenPosition = GetScrollPosition(); + float screenPosition = GetScrollPosition(); __pListModel->SetGroupExpandState(groupIndex, false); ResetSweepItem(); - int groupTotalHeight = 0; + float groupTotalHeight = 0; int itemCount = GetItemCountAt(groupIndex); _IListItemCommon* pItem = null; for (int i = 0; i < itemCount; i++) { pItem = __pListModel->GetItemFromTemporaryBuffer(groupIndex, i); - groupTotalHeight += pItem->GetItemHeight(); + groupTotalHeight += pItem->GetItemHeight(); // +++ check floating } if (groupIndex < itemTag.groupIndex || groupIndex > bottomTag.groupIndex) @@ -2331,9 +2469,9 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation) _TableViewItem* pItem = FindItem(firstLoadedItemTag); if (pItem != null) { - int itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex); + float itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex); - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); itemBounds.y = itemPositionY; pItem->SetBounds(itemBounds); @@ -2372,20 +2510,8 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation) return E_SUCCESS; } - _VisualElement* pVisualElement = __pTableView->GetVisualElement(); - String animationName(L"COLLAPSE_GROUP_ANIMATION"); - VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); - - if (pCollapseGroupAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } - - pCollapseGroupAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturn(NID_UI_CTRL, pCollapseGroupAnimation != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); - - Rectangle itemBounds = pItem->GetBounds(); - int startPosition = 0; + FloatRectangle itemBounds = pItem->GetBoundsF(); + float startPosition = 0; if (itemTag.itemIndex == -1) { startPosition = itemBounds.y + itemBounds.height; @@ -2404,33 +2530,31 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation) pItem = FindItem(bottomTag); if (pItem == null) { - delete pCollapseGroupAnimation; - return E_SUCCESS; } - itemBounds = pItem->GetBounds(); - int endPosition = itemBounds.y; + itemBounds = pItem->GetBoundsF(); + float endPosition = itemBounds.y; if (bottomTag.groupIndex != groupIndex +1) { endPosition += itemBounds.height; } - if (endPosition > screenPosition + __pTableView->GetBounds().height) + + if (endPosition > screenPosition + __pTableView->GetBoundsF().height) { - endPosition = screenPosition + __pTableView->GetBounds().height; + endPosition = screenPosition + __pTableView->GetBoundsF().height; } - pCollapseGroupAnimation->SetStartValue(Variant(endPosition)); - pCollapseGroupAnimation->SetEndValue(Variant(startPosition)); - pCollapseGroupAnimation->SetDuration(COLLAPSE_GROUP_ANIMATION_DURATION); - pCollapseGroupAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseInOut")); - pCollapseGroupAnimation->SetVisualElementAnimationStatusEventListener(this); - pCollapseGroupAnimation->SetVisualElementAnimationTickEventListener(this); + _VisualElement* pVisualElement = __pTableView->GetVisualElement(); + String animationName(L"COLLAPSE_GROUP_ANIMATION"); + + VisualElementValueAnimation* pAnimation = __pTableView->GetVisualElementValueAnimation(animationName); + pAnimation->SetStartValue(Variant(endPosition)); + pAnimation->SetEndValue(Variant(startPosition)); + pAnimation->SetDuration(COLLAPSE_GROUP_ANIMATION_DURATION); __expandableItemTag.groupIndex = itemTag.groupIndex; __expandableItemTag.itemIndex = itemTag.itemIndex; - pVisualElement->AddAnimation(animationName, *pCollapseGroupAnimation); - - delete pCollapseGroupAnimation; + pVisualElement->AddAnimation(animationName, *pAnimation); } else { @@ -2438,10 +2562,10 @@ _TableViewPresenter::CollapseGroup(int groupIndex, bool withAnimation) if (itemTag.itemIndex != -1) { - int itemPositionY = CalculateItemPositionY(nextTag.groupIndex, nextTag.itemIndex); + float itemPositionY = CalculateItemPositionY(nextTag.groupIndex, nextTag.itemIndex); _TableViewItem* pNextItem = LoadItem(nextTag.groupIndex, nextTag.itemIndex); - Rectangle itemBounds = pNextItem->GetBounds(); + FloatRectangle itemBounds = pNextItem->GetBoundsF(); itemBounds.y = itemPositionY; pNextItem->SetBounds(itemBounds); @@ -2553,10 +2677,10 @@ _TableViewPresenter::LoadItemsToBeVisible(const TableViewItemTag& from) return from; } - Rectangle itemBounds = pItem->GetBounds(); - int viewHeight = __pTableView->GetBounds().height; - int scrollPosition = GetScrollPosition(); - int itemPosition = itemBounds.y + itemBounds.height - scrollPosition; + FloatRectangle itemBounds = pItem->GetBoundsF(); + float viewHeight = __pTableView->GetBoundsF().height; + float scrollPosition = GetScrollPosition(); + float itemPosition = itemBounds.y + itemBounds.height - scrollPosition; while (viewHeight >= itemPosition) { @@ -2570,7 +2694,7 @@ _TableViewPresenter::LoadItemsToBeVisible(const TableViewItemTag& from) pItem = LoadItem(next.groupIndex, next.itemIndex); bottomTag.groupIndex = next.groupIndex; bottomTag.itemIndex = next.itemIndex; - itemPosition += pItem->GetBounds().height; + itemPosition += pItem->GetBoundsF().height; } return bottomTag; @@ -2589,8 +2713,8 @@ _TableViewPresenter::AttachNextItemsToBottom(const TableViewItemTag& anchor) return; } - Rectangle itemBounds = pItem->GetBounds(); - int itemPosition = itemBounds.y + itemBounds.height; + FloatRectangle itemBounds = pItem->GetBoundsF(); + float itemPosition = itemBounds.y + itemBounds.height; current.groupIndex = itemTag.groupIndex; current.itemIndex = itemTag.itemIndex; @@ -2603,7 +2727,7 @@ _TableViewPresenter::AttachNextItemsToBottom(const TableViewItemTag& anchor) continue; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); itemBounds.y = itemPosition; pItem->SetBounds(itemBounds); itemPosition += itemBounds.height; @@ -2633,10 +2757,10 @@ _TableViewPresenter::ScrollToHideNonClientArea(TableViewItemTag& bottomTag) return ; } - Rectangle itemBounds = pItem->GetBounds(); - int viewHeight = __pTableView->GetBounds().height; - int scrollPosition = GetScrollPosition(); - int itemBottom = itemBounds.y + itemBounds.height - scrollPosition; + FloatRectangle itemBounds = pItem->GetBoundsF(); + float viewHeight = __pTableView->GetBoundsF().height; + float scrollPosition = GetScrollPosition(); + float itemBottom = itemBounds.y + itemBounds.height - scrollPosition; if (itemBottom < viewHeight) { @@ -2651,9 +2775,9 @@ _TableViewPresenter::ScrollToHideNonClientArea(TableViewItemTag& bottomTag) } void -_TableViewPresenter::AdjustClientAreaBounds(bool reset, int dist) +_TableViewPresenter::AdjustClientAreaBounds(bool reset, float dist) { - int clientHeight = 0; + float clientHeight = 0; if (reset) { @@ -2670,10 +2794,10 @@ _TableViewPresenter::AdjustClientAreaBounds(bool reset, int dist) } void -_TableViewPresenter::SetClientAreaHeight(int height) +_TableViewPresenter::SetClientAreaHeight(float height) { - Rectangle screenBounds = __pTableView->GetBounds(); - Rectangle clientBounds = screenBounds; + FloatRectangle screenBounds = __pTableView->GetBoundsF(); + FloatRectangle clientBounds = screenBounds; clientBounds.height = height; @@ -2687,25 +2811,25 @@ _TableViewPresenter::SetClientAreaHeight(int height) _Scroll* pScroll = __pTableView->GetScrollBar(); if (pScroll != null) { - pScroll->SetScrollRange(__pTableView->GetBounds().height, clientBounds.height); + pScroll->SetScrollRange(__pTableView->GetBoundsF().height, clientBounds.height); } } void _TableViewPresenter::UnloadInvisibleItems(void) { - int scrollPosition = GetScrollPosition(); + float scrollPosition = GetScrollPosition(); TableViewItemTag itemTag; __pListModel->GetFirstLoadedItemIndex(itemTag.groupIndex, itemTag.itemIndex); _TableViewItem* pItem = null; - Rectangle bounds; + FloatRectangle bounds; while ((pItem = FindItem(itemTag)) != null) { if (itemTag.itemIndex != -1) { - bounds = pItem->GetBounds(); + bounds = pItem->GetBoundsF(); if (bounds.y + bounds.height < scrollPosition) { UnloadItem(itemTag); @@ -2719,13 +2843,13 @@ _TableViewPresenter::UnloadInvisibleItems(void) } __pListModel->GetLastLoadedItemIndex(itemTag.groupIndex, itemTag.itemIndex); - scrollPosition += __pTableView->GetBounds().height; + scrollPosition += __pTableView->GetBoundsF().height; while ((pItem = FindItem(itemTag)) != null) { if (itemTag.itemIndex != -1) { - bounds = pItem->GetBounds(); + bounds = pItem->GetBoundsF(); if (bounds.y > scrollPosition) { UnloadItem(itemTag); @@ -2740,25 +2864,41 @@ _TableViewPresenter::UnloadInvisibleItems(void) } -int -_TableViewPresenter::ScrollToInternal(int newPosition) +float +_TableViewPresenter::ScrollToInternal(float newPosition) { if (!IsScrollEnabled()) { return 0; } - int previousScrollPosition = _ScrollPanelPresenter::GetScrollPosition(); - int scrollAreaHeight = _ScrollPanelPresenter::GetScrollAreaBounds().height; - int currentScrollPosition = (newPosition < 0) ? 0 : (newPosition > scrollAreaHeight ? scrollAreaHeight : newPosition); + if (IsScrollAnimationRunning()) + { + if (__scrollPositionOnFlickStarted > newPosition) + { + newPosition += GetScrollAreaBounds().height - __scrollHeightOnFlickStarted; + } + } + + float currentScrollPosition = GetScrollPosition(); + float currentscrollAreaHeight = GetScrollAreaBounds().height; + float newScrollPosition = (newPosition < 0) ? 0 : (newPosition > currentscrollAreaHeight ? currentscrollAreaHeight : newPosition); + float newScrollAreaHeight = 0; - LoadItemWithScrollPosition(previousScrollPosition, currentScrollPosition); + LoadItemWithScrollPosition(currentScrollPosition, newScrollPosition); + + if (currentScrollPosition > newScrollPosition) + { + newScrollAreaHeight = GetScrollAreaBounds().height; + newScrollPosition += newScrollAreaHeight - currentscrollAreaHeight; + } - return _ScrollPanelPresenter::ScrollToInternal(newPosition); + return _ScrollPanelPresenter::ScrollToInternal(newScrollPosition); } + void -_TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int currentScrollPos) +_TableViewPresenter::LoadItemWithScrollPosition(float previousScrollPosition, float currentScrollPos) { ClearLastResult(); @@ -2769,13 +2909,13 @@ _TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int if (currentScrollPos > previousScrollPosition && lastLoadedItemPos.groupIndex != -1) { - _TableViewItem* lastItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(lastLoadedItemPos.groupIndex, lastLoadedItemPos.itemIndex)); - if (lastItem == null) + _TableViewItem* pLastItem = FindItem(lastLoadedItemPos); + if (pLastItem == null) { return; } - while (lastItem->GetBounds().y <= currentScrollPos + __pTableView->GetBounds().height) + while (pLastItem->GetBoundsF().y <= currentScrollPos + __pTableView->GetBoundsF().height) { TableViewItemTag nextItemPos = {-1, -1}; if (GetNextItemPosition(lastLoadedItemPos, nextItemPos)) @@ -2794,8 +2934,8 @@ _TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int { _TableViewItem* item = LoadItem(nextItemPos.groupIndex, nextItemPos.itemIndex); - Rectangle scrollAreaBounds = _ScrollPanelPresenter::GetScrollAreaBounds(); - if (item->GetBounds().y + item->GetBounds().height >= scrollAreaBounds.height) + FloatRectangle scrollAreaBounds = GetScrollAreaBounds(); + if (item->GetBoundsF().y + item->GetBoundsF().height >= scrollAreaBounds.height) { AdjustClientAreaBounds(true); } @@ -2807,26 +2947,37 @@ _TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int } lastLoadedItemPos = nextItemPos; - lastItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(lastLoadedItemPos.groupIndex, lastLoadedItemPos.itemIndex)); + pLastItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(lastLoadedItemPos.groupIndex, lastLoadedItemPos.itemIndex)); } } if (currentScrollPos < previousScrollPosition && firstLoadedItemPos.groupIndex != -1) { - _TableViewItem* firstItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(firstLoadedItemPos.groupIndex, firstLoadedItemPos.itemIndex)); - if (firstItem == null) + _TableViewItem* pFirstItem = FindItem(firstLoadedItemPos); + _TableViewItem* pPrevItem = null; + if (pFirstItem == null) { return; } - while (firstItem->GetBounds().y + firstItem->GetBounds().height >= currentScrollPos) + float scrollOffsetFromBottom = GetScrollAreaBounds().height - currentScrollPos; + + while (1) { + FloatRectangle scrollAreaBounds = GetScrollAreaBounds(); + float itemOffsetFromBottom = scrollAreaBounds.height - (pFirstItem->GetBoundsF().y + pFirstItem->GetBoundsF().height); + + if (scrollOffsetFromBottom < itemOffsetFromBottom) + { + break; + } + TableViewItemTag prevItemPos = {-1, -1}; if (GetPreviousItemPosition(firstLoadedItemPos, prevItemPos)) { if (prevItemPos.itemIndex == -1) { - LoadItem(prevItemPos.groupIndex, prevItemPos.itemIndex); + pPrevItem = LoadItem(prevItemPos.groupIndex, prevItemPos.itemIndex); if (!GetPreviousItemPosition(prevItemPos, prevItemPos)) { @@ -2836,7 +2987,7 @@ _TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int if (prevItemPos.groupIndex != -1) { - LoadItem(prevItemPos.groupIndex, prevItemPos.itemIndex); + pPrevItem = LoadItem(prevItemPos.groupIndex, prevItemPos.itemIndex); } } else @@ -2845,13 +2996,13 @@ _TableViewPresenter::LoadItemWithScrollPosition(int previousScrollPosition, int } firstLoadedItemPos = prevItemPos; - firstItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(firstLoadedItemPos.groupIndex, firstLoadedItemPos.itemIndex)); + pFirstItem = FindItem(firstLoadedItemPos); } } } void -_TableViewPresenter::ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment, int shiftingDistance) +_TableViewPresenter::ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment, float shiftingDistance) { TableViewItemTag itemPos = {groupIndex, itemIndex}; @@ -2867,7 +3018,7 @@ _TableViewPresenter::ScrollToItem(int groupIndex, int itemIndex, TableViewScroll return; } - int scrollPosition = pItem->GetBounds().y; + float scrollPosition = pItem->GetBoundsF().y; scrollPosition = scrollPosition + shiftingDistance; @@ -2875,12 +3026,12 @@ _TableViewPresenter::ScrollToItem(int groupIndex, int itemIndex, TableViewScroll if (itemAlignment == TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM) { - SetScrollPosition(scrollPosition - (__pTableView->GetBounds().height - pItem->GetBounds().height), false); + SetScrollPosition(scrollPosition - (__pTableView->GetBoundsF().height - pItem->GetBoundsF().height), false); } } result -_TableViewPresenter::ScrollByPixel(int scrollDistance) +_TableViewPresenter::ScrollByPixel(float scrollDistance) { FadeInScrollBar(); result r = GetLastResult(); @@ -2934,6 +3085,13 @@ _TableViewPresenter::ResetSweepItem(void) } } +void +_TableViewPresenter::GetSweepItemIndex(int& groupIndex, int& itemIndex) const +{ + groupIndex = __sweptItemTag.groupIndex; + itemIndex = __sweptItemTag.itemIndex; +} + int _TableViewPresenter::GetPressedItemCount(void) { @@ -2967,12 +3125,18 @@ _TableViewPresenter::GetPressedItemCount(void) return count; } -int +void +_TableViewPresenter::BlockAnimationCallback(bool blocked) +{ + __isAnimationCallbackBlocked = blocked; +} + +float _TableViewPresenter::CalculateItemPositionY(int groupIndex, int itemIndex) { TableViewItemTag itemPos = {-1, -1}; TableViewItemTag currentItemPos = {-1, -1}; - int positionY = 0; + float positionY = 0.0f; GetFirstItem(itemPos); @@ -2992,7 +3156,7 @@ _TableViewPresenter::CalculateItemPositionY(int groupIndex, int itemIndex) { currentItemPos = itemPos; - int itemHeight = GetItemHeight(itemPos); + float itemHeight = GetItemHeight(itemPos); positionY += itemHeight; @@ -3061,9 +3225,10 @@ _TableViewPresenter::FadeOutScrollBar(void) } void -_TableViewPresenter::SweepItem(int x) +_TableViewPresenter::SweepItem(float x) { - if (x != 0) + //if (x != 0.0f) + if (!_FloatCompare(x, 0.0f)) { _TableViewItem* pItem = static_cast<_TableViewItem*>(__pListModel->LoadItem(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex)); @@ -3073,10 +3238,10 @@ _TableViewPresenter::SweepItem(int x) if (pContextItem != null) { - int currentPosition = __sweptItemPosition.x + x; - int sweepDistance = __pTableView->GetBounds().width; - int sweepMargin = 0; - int contextItemWidth = pItem->GetBounds().width; + float currentPosition = __sweptItemPosition.x + x; + float sweepDistance = __pTableView->GetBoundsF().width; + float sweepMargin = 0.0f; + float contextItemWidth = pItem->GetBoundsF().width; bool activated = pItem->IsContextItemActivated(); bool needToFireEvent = false; @@ -3107,10 +3272,12 @@ _TableViewPresenter::SweepItem(int x) contextItemWidth = ((contextItemWidth > (__sweptItemPosition.x - __leftMargin)) ? (__sweptItemPosition.x - __leftMargin) : contextItemWidth); - pContextItem->ExposeContextItem(Rectangle(__leftMargin, __sweptItemPosition.y, contextItemWidth, pContextItem->GetSize().height), pItem->GetSize().width); + pContextItem->ExposeContextItem(FloatRectangle(__leftMargin, __sweptItemPosition.y, contextItemWidth, pContextItem->GetSizeF().height), pItem->GetSize().width); if (needToFireEvent) { + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_SLIDER_SWEEP); + activated = !activated; // ContextItem Activation State Changed __pTableView->FireTableViewContextItemActivationEvent(__sweptItemTag.groupIndex, __sweptItemTag.itemIndex, pContextItem, activated); @@ -3133,7 +3300,21 @@ _TableViewPresenter::ResetSweptItem(void) if (pItem != null) { - pItem->SetPosition(Point(__leftMargin, __sweptItemPosition.y)); + _VisualElement* pVisualElement = __pTableView->GetVisualElement(); + + if (pVisualElement != null) + { + String animationName(L"SWEEP_ITEM_ANIMATION"); + VisualElementAnimation* pContextItemAnimation = pVisualElement->GetAnimationN(animationName); + if (pContextItemAnimation != null) + { + pVisualElement->RemoveAnimation(animationName); + + delete pContextItemAnimation; + } + } + + pItem->SetPosition(FloatPoint(__leftMargin, __sweptItemPosition.y)); _TableViewItem* pContextItem = pItem->GetContextItem(); if (pContextItem != null) @@ -3154,23 +3335,23 @@ _TableViewPresenter::ResetSweptItem(void) __sweptItemTag.itemIndex = -1; __sweptItemTag.groupIndex = -1; - __sweptItemPosition.SetPosition(-1, -1); + __sweptItemPosition.SetPosition(-1.0f, -1.0f); __sweepOccured = false; } void _TableViewPresenter::AdjustSweptItemPosition(bool withAnimation) { - int itemWidth = __pTableView->GetBounds().width; - int sweepDistance = 0; + float itemWidth = __pTableView->GetBoundsF().width; + float sweepDistance = 0.0f; - if (__sweptItemPosition.x == __leftMargin) + if (_FloatCompare(__sweptItemPosition.x, __leftMargin)) { ResetSweptItem(); return; } - int sweepMargin = 0; + float sweepMargin = 0.0f; GET_SHAPE_CONFIG(TABLEVIEW::CONTEXTITEM_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, sweepMargin); if (__sweptItemPosition.x > (itemWidth - sweepMargin) / 2) @@ -3192,37 +3373,21 @@ _TableViewPresenter::AdjustSweptItemPosition(bool withAnimation) if (pItem != null) { - VisualElementValueAnimation* pAnimation = null; _VisualElement* pVisualElement = __pTableView->GetVisualElement(); if (pVisualElement != null) { - int startValue = __sweptItemPosition.x; - int endValue = ((sweepDistance > 0) ? (itemWidth - sweepMargin) : __leftMargin); - - pVisualElement->SetImplicitAnimationEnabled(false); - String animationName(L"SWEEP_ITEM_ANIMATION"); - pAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); - - if (pAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - } + float startValue = __sweptItemPosition.x; + float endValue = ((sweepDistance > 0) ? (itemWidth - sweepMargin) : __leftMargin); - pAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryReturnVoidResult(NID_UI_CTRL, pAnimation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + pVisualElement->SetImplicitAnimationEnabled(false); + VisualElementValueAnimation* pAnimation = __pTableView->GetVisualElementValueAnimation(animationName); pAnimation->SetStartValue(Variant(startValue)); pAnimation->SetEndValue(Variant(endValue)); - pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseInOut")); pAnimation->SetDuration(SWEEP_ITEM_ANIMATION_DURATION); - pAnimation->SetVisualElementAnimationStatusEventListener(this); - pAnimation->SetVisualElementAnimationTickEventListener(this); - pVisualElement->AddAnimation(animationName, *pAnimation); - - delete pAnimation; } } } @@ -3245,7 +3410,7 @@ _TableViewPresenter::AdjustLoadedItemWidth(void) continue; } - Dimension itemSize = pItem->GetSize(); + FloatDimension itemSize = pItem->GetSizeF(); itemSize.width = __pProviderAdaptor->GetListWidth(); pItem->SetItemChanged(true); @@ -3283,6 +3448,30 @@ _TableViewPresenter::IsValidDrawnItem(int groupIndex, int itemIndex) return false; } +void +_TableViewPresenter::StopAllItemAnimation(void) +{ + TableViewItemTag currentItemTag = {-1, -1}; + TableViewItemTag lastItemTag = {-1, -1}; + + __pListModel->GetFirstLoadedItemIndex(currentItemTag.groupIndex, currentItemTag.itemIndex); + __pListModel->GetLastLoadedItemIndex(lastItemTag.groupIndex, lastItemTag.itemIndex); + + do + { + _TableViewItem *pItem = FindItem(currentItemTag); + if (pItem != null) + { + pItem->StopAllAnimation(); + } + + if (currentItemTag.groupIndex == lastItemTag.groupIndex && currentItemTag.itemIndex == lastItemTag.itemIndex) + { + break; + } + + }while (GetNextItemPosition(currentItemTag, currentItemTag)); +} bool _TableViewPresenter::GetTableViewItemPosition(_TableViewItem& item, TableViewItemTag& itemTag) @@ -3312,10 +3501,10 @@ _TableViewPresenter::GetTableViewItemPosition(_TableViewItem& item, TableViewIte return false; } -int +float _TableViewPresenter::GetItemHeight(TableViewItemTag itemTag) const { - int itemHeight = 0; + float itemHeight = 0.0f; if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SECTION && itemTag.itemIndex != -1) { @@ -3324,7 +3513,6 @@ _TableViewPresenter::GetItemHeight(TableViewItemTag itemTag) const if (itemTag.itemIndex == GetItemCountAt(itemTag.groupIndex) - 1) { GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHeight); - return itemHeight; } } @@ -3351,8 +3539,8 @@ _TableViewPresenter::GetItemHeight(TableViewItemTag itemTag) const return itemHeight; } -int -_TableViewPresenter::SetItemHeight(TableViewItemTag itemTag, int height) +float +_TableViewPresenter::SetItemHeight(TableViewItemTag itemTag, float height) { int startIndex = 0; @@ -3366,7 +3554,7 @@ _TableViewPresenter::SetItemHeight(TableViewItemTag itemTag, int height) itemTag.itemIndex++; itemTag.itemIndex = startIndex + itemTag.itemIndex; - int oldHeight = 0; + float oldHeight = 0.0f; __itemHeightList.GetAt(itemTag.itemIndex, oldHeight); __itemHeightList.SetAt(height, itemTag.itemIndex); @@ -3401,8 +3589,11 @@ _TableViewPresenter::SetReorderMode(bool enabled) { if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex)) { - Point itemPosition = pItem->GetPosition(); - Point touchPosition = pItem->GetLastTouchPressedPosition(); + FloatPoint itemPosition = pItem->GetPositionF(); + // +++ check floating + //FloatPoint touchPosition = pItem->GetLastTouchPressedPosition(); + FloatPoint touchPosition = _CoordinateSystemUtils::ConvertToFloat(pItem->GetLastTouchPressedPosition()); + __reorderInfo.touchPressedPositionY = itemPosition.y + touchPosition.y - GetScrollPosition(); __reorderInfo.blockedTouchReleaseState = true; @@ -3440,7 +3631,7 @@ _TableViewPresenter::SelectReorderItem(int groupIndex, int itemIndex) pItem->SetItemChanged(true); pItem->Invalidate(); - __reorderInfo.itemBounds = pItem->GetBounds(); + __reorderInfo.itemBounds = pItem->GetBoundsF(); __reorderInfo.itemIndex = itemIndex; __reorderInfo.groupIndex = groupIndex; __reorderInfo.originGroupIndex = groupIndex; @@ -3451,9 +3642,9 @@ _TableViewPresenter::SelectReorderItem(int groupIndex, int itemIndex) pItem->GetVisualElement()->SetZOrder(null, true); - if (GetScrollAreaBounds().height < __pTableView->GetBounds().height) + if (GetScrollAreaBounds().height < __pTableView->GetBoundsF().height) { - int itemHeight = pItem->GetBounds().height; + float itemHeight = pItem->GetBoundsF().height; __pListModel->GetLastLoadedItemIndex(itemPos.groupIndex, itemPos.itemIndex); @@ -3461,7 +3652,7 @@ _TableViewPresenter::SelectReorderItem(int groupIndex, int itemIndex) if (pItem != null) { - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); __reorderInfo.nonScrollableLimitArea = itemBounds.y + itemBounds.height - itemHeight; } } @@ -3488,7 +3679,9 @@ _TableViewPresenter::ResetReorderItem(int groupIndex, int itemIndex) pItem->SetItemChanged(true); pItem->Invalidate(); - Point position = Point(__reorderInfo.itemBounds.x, __reorderInfo.itemBounds.y); + PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_LIST_REORDER); + + FloatPoint position = FloatPoint(__reorderInfo.itemBounds.x, __reorderInfo.itemBounds.y); pItem->SetPosition(position); if (__reorderInfo.originGroupIndex != __reorderInfo.groupIndex || __reorderInfo.originItemIndex != __reorderInfo.itemIndex) @@ -3517,11 +3710,11 @@ _TableViewPresenter::ResetReorderItem(int groupIndex, int itemIndex) bool _TableViewPresenter::CheckReorderItemScrollAnimation(_TableViewItem *pItem) { - int currentScrollPosition = GetScrollPosition(); - int limitTopPositionY = currentScrollPosition; - int limitBottomPositionY = currentScrollPosition + __pTableView->GetBounds().height - __reorderInfo.itemBounds.height; + float currentScrollPosition = GetScrollPosition(); + float limitTopPositionY = currentScrollPosition; + float limitBottomPositionY = currentScrollPosition + __pTableView->GetBoundsF().height - __reorderInfo.itemBounds.height; - int itemPositionY = pItem->GetPosition().y; + float itemPositionY = pItem->GetPositionF().y; if (itemPositionY < limitTopPositionY) { @@ -3546,7 +3739,7 @@ _TableViewPresenter::CheckReorderItemScrollAnimation(_TableViewItem *pItem) } bool -_TableViewPresenter::DragSelectedItem(int distance, bool relativeCoordinate) +_TableViewPresenter::DragSelectedItem(float distance, bool relativeCoordinate) { TableViewItemTag itemPos = {__reorderInfo.groupIndex, __reorderInfo.itemIndex}; _TableViewItem* pItem = FindItem(itemPos); @@ -3569,7 +3762,7 @@ _TableViewPresenter::DragSelectedItem(int distance, bool relativeCoordinate) __firstTouchMoved = false; } - Point itemPosition = pItem->GetPosition(); + FloatPoint itemPosition = pItem->GetPositionF(); if (relativeCoordinate) { @@ -3587,9 +3780,9 @@ _TableViewPresenter::DragSelectedItem(int distance, bool relativeCoordinate) itemPosition.y = 0; } - int scrollAreaHeight = GetScrollAreaBounds().height; - int screenHeight = __pTableView->GetBounds().height; - int limitBottomPositionY = 0; + float scrollAreaHeight = GetScrollAreaBounds().height; + float screenHeight = __pTableView->GetBoundsF().height; + float limitBottomPositionY = 0.0f; if (scrollAreaHeight < screenHeight) { @@ -3640,7 +3833,7 @@ _TableViewPresenter::DragSelectedItem(int distance, bool relativeCoordinate) if (moveItemTag.groupIndex == 0 || !__pProviderAdaptor->IsReorderable(__reorderInfo.groupIndex, destGroupIndex)) { // ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex); -// itemPosition = pItem->GetPosition(); +// itemPosition = pItem->GetPositionF(); // // _TableViewItem* pGroupItem = FindItem(moveItemTag); // @@ -3649,7 +3842,7 @@ _TableViewPresenter::DragSelectedItem(int distance, bool relativeCoordinate) // return false; // } // -// Rectangle groupItemBounds = pGroupItem->GetBounds(); +// FloatRectangle groupItemBounds = pGroupItem->GetBoundsF(); // // if (__reorderInfo.groupIndex < moveItemTag.groupIndex) // { @@ -3677,15 +3870,15 @@ _TableViewPresenter::CheckReorderItemPosition(_TableViewItem* pItem, TableViewIt TableViewItemTag previousItemTag = {-1, -1}; TableViewItemTag nextItemTag = {-1, -1}; - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); if (GetPreviousItemPosition(currentItemTag, previousItemTag)) { - _TableViewItem* pPreviousItem = FindItem(previousItemTag); + _TableViewItem* pPreviousItem = LoadItem(previousItemTag.groupIndex, previousItemTag.itemIndex); if (pPreviousItem != null) { - Rectangle previousItemBounds = pPreviousItem->GetBounds(); + FloatRectangle previousItemBounds = pPreviousItem->GetBoundsF(); if (itemBounds.y < previousItemBounds.y + (previousItemBounds.height / 2)) { @@ -3700,11 +3893,11 @@ _TableViewPresenter::CheckReorderItemPosition(_TableViewItem* pItem, TableViewIt if (GetNextItemPosition(currentItemTag, nextItemTag)) { - _TableViewItem* pNextItem = FindItem(nextItemTag); + _TableViewItem* pNextItem = LoadItem(nextItemTag.groupIndex, nextItemTag.itemIndex); if (pNextItem != null) { - Rectangle nextItemBounds = pNextItem->GetBounds(); + FloatRectangle nextItemBounds = pNextItem->GetBoundsF(); if (itemBounds.y + itemBounds.height > nextItemBounds.y + (nextItemBounds.height / 2)) { @@ -3740,9 +3933,9 @@ _TableViewPresenter::ReorderItem(int destinationGroupIndex, int destinationItemI return false; } - Rectangle destinationItemBounds = pItem->GetBounds(); + FloatRectangle destinationItemBounds = pItem->GetBoundsF(); - Point destinationItemPosition = Point(destinationItemBounds.x, 0); + FloatPoint destinationItemPosition = FloatPoint(destinationItemBounds.x, 0.0f); if ( __reorderInfo.itemIndex > destinationItemIndex && __reorderInfo.groupIndex == destinationGroupIndex) { @@ -3832,16 +4025,16 @@ _TableViewPresenter::CheckItemHeightAndRefreshLayout(TableViewItemTag itemTag, b return false; } - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); if (GetItemHeight(itemTag) == itemBounds.height) { return false; } - int newHeight = itemBounds.height; - int originHeight = SetItemHeight(itemTag, newHeight); - int dist = newHeight - originHeight; + float newHeight = itemBounds.height; + float originHeight = SetItemHeight(itemTag, newHeight); + float dist = newHeight - originHeight; AdjustClientAreaBounds(false, dist); @@ -3860,8 +4053,6 @@ bool _TableViewPresenter::CreateItemHeightList(void) { int groupCount = GetGroupCount(); - int defaultItemHeight = __pProviderAdaptor->GetDefaultItemHeight(); - int defaultGroupItemHeight = __pProviderAdaptor->GetDefaultGroupItemHeight(); result r = __itemHeightList.SetCapacity(GetItemCount()); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); @@ -3876,12 +4067,12 @@ _TableViewPresenter::CreateItemHeightList(void) } else { - __itemHeightList.Add(defaultGroupItemHeight); + __itemHeightList.Add(-1); } for (int j = 1; j <= itemCount; j++) { - __itemHeightList.Add(defaultItemHeight); + __itemHeightList.Add(-1); } } @@ -3896,8 +4087,8 @@ CATCH: bool _TableViewPresenter::RefreshItemHeightList(int groupIndex, int itemIndex, TableViewRefreshType refreshType) { - int defaultItemHeight = __pProviderAdaptor->GetDefaultItemHeight(); - int defaultGroupItemHeight = __pProviderAdaptor->GetDefaultGroupItemHeight(); + float defaultItemHeight = __pProviderAdaptor->GetDefaultItemHeight(); + float defaultGroupItemHeight = __pProviderAdaptor->GetDefaultGroupItemHeight(); int startIndex = 0; for (int i = 0; i < groupIndex; i++) @@ -3960,15 +4151,16 @@ _TableViewPresenter::CaptureAndStartRemoveItemAnimation(int groupIndex, int item return; } - Rectangle itemBounds = pItem->GetBounds(); + FloatRectangle itemBounds = pItem->GetBoundsF(); result r = E_SUCCESS; _VisualElement* pVisualElement = null; - VisualElementValueAnimation* pAnimation = null; + String animationName(L"REMOVE_ITEM_ANIMATION"); Canvas* pCanvas = null; + VisualElementValueAnimation* pAnimation = __pTableView->GetVisualElementValueAnimation(animationName); - Dimension startValue(100, itemBounds.height); - Dimension endValue(0, 0); + FloatDimension startValue(100.0f, itemBounds.height); + FloatDimension endValue(0.0f, 0.0f); Tizen::Graphics::Bitmap* pBitmap = pItem->GetCapturedBitmapN(true); @@ -3989,26 +4181,18 @@ _TableViewPresenter::CaptureAndStartRemoveItemAnimation(int groupIndex, int item pVisualElement->SetBounds(FloatRectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height)); pVisualElement->SetShowState(true); - GetView()->GetVisualElement()->AttachChild(*pVisualElement); - pCanvas = pVisualElement->GetCanvasN(); SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); pCanvas->Clear(); - pCanvas->DrawBitmap(Rectangle(0, 0, itemBounds.width, itemBounds.height), *pBitmap); - - pAnimation = new (std::nothrow) VisualElementValueAnimation(); - SysTryCatch(NID_UI_CTRL, pAnimation != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient."); + pCanvas->DrawBitmap(FloatRectangle(0, 0, itemBounds.width, itemBounds.height), *pBitmap); - pAnimation->SetTimingFunction(VisualElementAnimation::GetTimingFunctionByName(L"EaseIn")); - pAnimation->SetDuration(REMOVE_ITEM_MOVE_ANIMATION_DURATION); pAnimation->SetDelay(0); pAnimation->SetStartValue(Variant(startValue)); pAnimation->SetEndValue(Variant(endValue)); - pAnimation->SetVisualElementAnimationStatusEventListener(GetView()); - pAnimation->SetVisualElementAnimationTickEventListener(GetView()); + pAnimation->SetDuration(REMOVE_ITEM_MOVE_ANIMATION_DURATION); - r = pVisualElement->AddAnimation(L"RemoveTableViewItem", *pAnimation); + r = pVisualElement->AddAnimation(animationName, *pAnimation); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete pAnimation; @@ -4029,6 +4213,35 @@ _TableViewPresenter::DeleteItemHeightList(void) __itemHeightList.RemoveAll(); } +void +_TableViewPresenter::PresetItemHeightList(void) +{ + int groupCount = GetGroupCount(); + float defaultGroupItemHeight = __pProviderAdaptor->GetDefaultGroupItemHeight(); + float defaultItemHeight = __pProviderAdaptor->GetDefaultItemHeight(); + + for (int i = 0; i < groupCount; i++) + { + TableViewItemTag itemTag = {i, -1}; + int itemCount = GetItemCountAt(i); + + if (GetItemHeight(itemTag) == -1) + { + SetItemHeight(itemTag, defaultGroupItemHeight); + } + + for (int j = 1; j <= itemCount; j++) + { + itemTag.itemIndex = j; + if (GetItemHeight(itemTag) == -1) + { + SetItemHeight(itemTag, defaultItemHeight); + } + } + } +} + + _TableViewItem* _TableViewPresenter::GetTableViewItemFromControl(const _Control& source) { @@ -4051,10 +4264,10 @@ _TableViewPresenter::GetTableViewItemFromControl(const _Control& source) } void -_TableViewPresenter::SetLoadedItemsVisibleFromPosition(int position, bool visible) +_TableViewPresenter::SetLoadedItemsVisibleFromPosition(float position, bool visible) { _TableViewItem* pItem; - Rectangle itemBounds; + FloatRectangle itemBounds; TableViewItemTag current; current.groupIndex = __expandableItemTag.groupIndex; current.itemIndex = __expandableItemTag.itemIndex; @@ -4079,7 +4292,7 @@ _TableViewPresenter::SetLoadedItemsVisibleFromPosition(int position, bool visibl break; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); if (visible) { @@ -4102,10 +4315,10 @@ _TableViewPresenter::SetLoadedItemsVisibleFromPosition(int position, bool visibl } void -_TableViewPresenter::MoveLoadedItemsFromPosition(int position) +_TableViewPresenter::MoveLoadedItemsFromPosition(float position) { - Rectangle itemBounds; - int itemPosition = position; + FloatRectangle itemBounds; + float itemPosition = position; TableViewItemTag current; TableViewItemTag next; @@ -4113,8 +4326,8 @@ _TableViewPresenter::MoveLoadedItemsFromPosition(int position) current.groupIndex = __expandableItemTag.groupIndex; current.itemIndex = __pListModel->GetItemCountInGroup(__expandableItemTag.groupIndex) -1; - int screenPosition = GetScrollPosition(); - Rectangle screenBounds = __pTableView->GetBounds(); + float screenPosition = GetScrollPosition(); + FloatRectangle screenBounds = __pTableView->GetBoundsF(); screenPosition += screenBounds.height; _TableViewItem* pItem = null; @@ -4134,7 +4347,7 @@ _TableViewPresenter::MoveLoadedItemsFromPosition(int position) break; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); itemBounds.y = itemPosition; pItem->SetBounds(itemBounds); itemPosition += itemBounds.height; @@ -4146,17 +4359,25 @@ _TableViewPresenter::MoveLoadedItemsFromPosition(int position) void _TableViewPresenter::OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target) { - if (keyName == L"RemoveTableViewItem") + if (keyName == L"REMOVE_ITEM_ANIMATION") { return; } + + if (keyName == L"SCROLL_PANEL_SCROLLING_ANIMATION") + { + __scrollHeightOnFlickStarted = GetScrollAreaBounds().height; + __scrollPositionOnFlickStarted = GetScrollPosition(); + + } + _ScrollPanelPresenter::OnVisualElementAnimationStarted(animation, keyName, target); } void _TableViewPresenter::OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount) { - if (keyName == L"RemoveTableViewItem") + if (keyName == L"REMOVE_ITEM_ANIMATION") { return; } @@ -4166,7 +4387,12 @@ _TableViewPresenter::OnVisualElementAnimationRepeated(const Tizen::Ui::Animation void _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally) { - if (keyName == L"RemoveTableViewItem") + if (__isAnimationCallbackBlocked) + { + return; + } + + if (keyName == L"REMOVE_ITEM_ANIMATION") { _VisualElement* pVisualElement = GetView()->GetVisualElement(); @@ -4189,10 +4415,15 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation _TableViewItem* pCurrentItem = null; pCurrentItem = LoadItem(current.groupIndex, current.itemIndex); - Rectangle itemBounds; - Rectangle screenBounds = __pTableView->GetBounds(); - int screenPosition = GetScrollPosition() + screenBounds.height; - int nextItemPositionY = pCurrentItem->GetBounds().y + pCurrentItem->GetBounds().height; + if (pCurrentItem == null) + { + return; + } + + FloatRectangle itemBounds; + FloatRectangle screenBounds = __pTableView->GetBoundsF(); + float screenPosition = GetScrollPosition() + screenBounds.height; + float nextItemPositionY = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height; while (GetNextItemPosition(current, next)) { @@ -4209,8 +4440,8 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation break; } - itemBounds = pNextItem->GetBounds(); - itemBounds.y = pCurrentItem->GetBounds().y + pCurrentItem->GetBounds().height; + itemBounds = pNextItem->GetBoundsF(); + itemBounds.y = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height; pNextItem->SetBounds(itemBounds); nextItemPositionY = itemBounds.y + itemBounds.height; } @@ -4273,11 +4504,11 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation SysTryReturnVoidResult(NID_UI_CTRL, pCurrentItem != null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.") } - Rectangle itemBounds; - int nextItemPositionY = pCurrentItem->GetBounds().y + pCurrentItem->GetBounds().height; + FloatRectangle itemBounds; + float nextItemPositionY = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height; - Rectangle screenBounds = __pTableView->GetBounds(); - int screenPosition = GetScrollPosition() + screenBounds.height; + FloatRectangle screenBounds = __pTableView->GetBoundsF(); + float screenPosition = GetScrollPosition() + screenBounds.height; while (GetNextItemPosition(current, next)) { @@ -4290,11 +4521,11 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation break; } - itemBounds = pCurrentItem->GetBounds(); + itemBounds = pCurrentItem->GetBoundsF(); itemBounds.y = nextItemPositionY; pCurrentItem->SetBounds(itemBounds); - nextItemPositionY = pCurrentItem->GetBounds().y + pCurrentItem->GetBounds().height; + nextItemPositionY = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height; } else { @@ -4304,7 +4535,7 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation } else { - int scrollPosition = GetScrollPosition(); + float scrollPosition = GetScrollPosition(); int groupItemsHeight = 0; _IListItemCommon* pItem = null; @@ -4315,7 +4546,7 @@ _TableViewPresenter::OnVisualElementAnimationFinished(const Tizen::Ui::Animation } _TableViewItem* pTableViewItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, __expandableItemTag.itemIndex)); - Rectangle itemBounds = pTableViewItem->GetBounds(); + FloatRectangle itemBounds = pTableViewItem->GetBoundsF(); groupItemsHeight += (scrollPosition - itemBounds.y); int currentGroupIndex = -1; @@ -4364,7 +4595,7 @@ _TableViewPresenter::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAn return; } - if (keyName == L"RemoveTableViewItem") + if (keyName == L"REMOVE_ITEM_ANIMATION") { Dimension value = currentValue.ToDimension(); target.SetOpacity(value.width); @@ -4379,7 +4610,7 @@ _TableViewPresenter::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAn } else if (keyName == L"EXPAND_GROUP_ANIMATION") { - int currentPosition = currentValue.ToInt(); + float currentPosition = currentValue.ToFloat(); SetLoadedItemsVisibleFromPosition(currentPosition, true); MoveLoadedItemsFromPosition(currentPosition); @@ -4387,7 +4618,7 @@ _TableViewPresenter::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAn } else if (keyName == L"COLLAPSE_GROUP_ANIMATION") { - int currentPosition = currentValue.ToInt(); + float currentPosition = currentValue.ToFloat(); SetLoadedItemsVisibleFromPosition(currentPosition, false); MoveLoadedItemsFromPosition(currentPosition); @@ -4395,8 +4626,8 @@ _TableViewPresenter::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAn } else if (keyName == L"SWEEP_ITEM_ANIMATION") { - int currentPosition = currentValue.ToInt(); - int moveDestance = currentPosition - __sweptItemPosition.x; + float currentPosition = currentValue.ToFloat(); + float moveDestance = currentPosition - __sweptItemPosition.x; SweepItem(moveDestance); return; @@ -4405,4 +4636,70 @@ _TableViewPresenter::OnTickOccurred(const Tizen::Ui::Animations::VisualElementAn _ScrollPanelPresenter::OnTickOccurred(animation, keyName, target, currentValue); } +bool +_TableViewPresenter::OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction) +{ + TableViewItemTag itemPos = {-1, -1}; + + if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_NEXT) + { + GetFirstItem(itemPos); + if (GetAccessibilityElementFocusedState() == false && FindItem(itemPos) == null) + { + ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP); + + return true; + } + } + else if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS) + { + GetLastItem(itemPos); + if (GetAccessibilityElementFocusedState() == false && FindItem(itemPos) == null) + { + ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM); + + return true; + } + } + + return false; +} + +bool +_TableViewPresenter::GetAccessibilityElementFocusedState(void) +{ + _TableViewItem* pItem = null; + TableViewItemTag itemPos = {-1, -1}; + TableViewItemTag lastItemPos = {-1, -1}; + + __pListModel->GetFirstLoadedItemIndex(itemPos.groupIndex, itemPos.itemIndex); + __pListModel->GetLastLoadedItemIndex(lastItemPos.groupIndex, lastItemPos.itemIndex); + + do + { + pItem = static_cast <_TableViewItem*>(__pListModel->LoadItem(itemPos.groupIndex, itemPos.itemIndex)); + SysTryReturn(NID_UI_CTRL, pItem != null, false, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is out of range."); + + _AccessibilityContainer* pContainer = pItem->GetAccessibilityContainer(); + _AccessibilityElement* pElement = null; + + if (pContainer != null) + { + pElement = pContainer->GetCurrentFocusedElement(); + if (pElement != null) + { + return true; + } + } + + if ((itemPos.itemIndex == lastItemPos.itemIndex) && (itemPos.groupIndex == lastItemPos.groupIndex)) + { + break; + } + + } while (GetNextItemPosition(itemPos, itemPos) == true); + + return false; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_TextBlockEvent.cpp b/src/ui/controls/FUiCtrl_TextBlockEvent.cpp index e5d3043..9ce4465 100644 --- a/src/ui/controls/FUiCtrl_TextBlockEvent.cpp +++ b/src/ui/controls/FUiCtrl_TextBlockEvent.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TextBlockEvent.cpp * @brief This is the implementation for the _TextBlockEvent class. diff --git a/src/ui/controls/FUiCtrl_TextBoxImpl.cpp b/src/ui/controls/FUiCtrl_TextBoxImpl.cpp index 7c7f50a..919ca9b 100644 --- a/src/ui/controls/FUiCtrl_TextBoxImpl.cpp +++ b/src/ui/controls/FUiCtrl_TextBoxImpl.cpp @@ -22,6 +22,9 @@ #include #include +#include +#include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiBuilder.h" #include "FUiCtrl_TextBoxImpl.h" #include "FUiCtrl_PublicTextBlockEvent.h" @@ -285,14 +288,26 @@ _TextBoxImpl::SetText(const String& text) int _TextBoxImpl::GetLineSpacing(void) const { - return __pEdit->GetLineSpacing(); + return _CoordinateSystemUtils::ConvertToInteger(GetLineSpacingF()); +} + +float +_TextBoxImpl::GetLineSpacingF(void) const +{ + return __pEdit->GetLineSpacingF(); } result _TextBoxImpl::SetLineSpacing(int multiplier, int extra) { + return SetLineSpacing(multiplier, _CoordinateSystemUtils::ConvertToFloat(extra)); +} + +result +_TextBoxImpl::SetLineSpacing(int multiplier, float extra) +{ SysTryReturn(NID_UI_CTRL, multiplier >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); - SysTryReturn(NID_UI_CTRL, extra >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); + SysTryReturn(NID_UI_CTRL, extra >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid argument is given."); return __pEdit->SetLineSpacing(DEFAULT_LINE_SPACE * multiplier + extra); } @@ -312,19 +327,37 @@ _TextBoxImpl::SetTextAlignment(HorizontalAlignment alignment) int _TextBoxImpl::GetTextSize(void) const { - return __pEdit->GetTextSize(); + return _CoordinateSystemUtils::ConvertToInteger(GetTextSizeF()); +} + +float +_TextBoxImpl::GetTextSizeF(void) const +{ + return __pEdit->GetTextSizeF(); } result _TextBoxImpl::SetTextSize(int size) { + return __pEdit->SetTextSize(_CoordinateSystemUtils::ConvertToFloat(size)); +} + +result +_TextBoxImpl::SetTextSize(float size) +{ return __pEdit->SetTextSize(size); } int _TextBoxImpl::GetTextTotalHeight(void) const { - return __pEdit->GetTextTotalHeight(); + return _CoordinateSystemUtils::ConvertToInteger(GetTextTotalHeightF()); +} + +float +_TextBoxImpl::GetTextTotalHeightF(void) const +{ + return __pEdit->GetTextTotalHeightF(); } result @@ -539,6 +572,12 @@ _TextBoxImpl::OnBoundsChanged(const Rectangle& oldRect, const Rectangle& newRect return E_SUCCESS; } +result +_TextBoxImpl::OnBoundsChanged(const FloatRectangle& oldRect, const FloatRectangle& newRect) +{ + return E_SUCCESS; +} + void _TextBoxImpl::OnLinkClicked(_Control& source, const String& text, LinkType linkType, const String& link) @@ -776,6 +815,19 @@ protected: pTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, color); } + if (pControl->GetElement(L"accessibilityHint", elementString)) + { + AccessibilityContainer* pContainer = pTextBox->GetAccessibilityContainer(); + if (pContainer) + { + AccessibilityElement* pElement = pContainer->GetElement(L"EditText"); + if (pElement) + { + pElement->SetHint(elementString); + } + } + } + return pTextBox; } }; diff --git a/src/ui/controls/FUiCtrl_TextEvent.cpp b/src/ui/controls/FUiCtrl_TextEvent.cpp index b305a49..84e16ab 100644 --- a/src/ui/controls/FUiCtrl_TextEvent.cpp +++ b/src/ui/controls/FUiCtrl_TextEvent.cpp @@ -14,8 +14,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** -* @file FUiCtrl_TextEvent.cpp +* @file FUiCtrl_TextEvent.cpp * @brief This is the implementation for the TextEvent class. * @version 1.0 */ diff --git a/src/ui/controls/FUiCtrl_TimePickerImpl.cpp b/src/ui/controls/FUiCtrl_TimePickerImpl.cpp index 638d91d..952f641 100644 --- a/src/ui/controls/FUiCtrl_TimePickerImpl.cpp +++ b/src/ui/controls/FUiCtrl_TimePickerImpl.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TimePickerImpl.cpp * @brief This is the implementation file for the _TimePickerImpl class. @@ -34,13 +35,13 @@ using namespace Tizen::Graphics; namespace Tizen { namespace Ui { namespace Controls { -Dimension -_TimePickerImpl::TimePickerSizeInfo::GetDefaultMinimumSize(_ControlOrientation orientation) const +FloatDimension +_TimePickerImpl::TimePickerSizeInfo::GetDefaultMinimumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { @@ -51,13 +52,13 @@ _TimePickerImpl::TimePickerSizeInfo::GetDefaultMinimumSize(_ControlOrientation o return pickerSize; } -Dimension -_TimePickerImpl::TimePickerSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const +FloatDimension +_TimePickerImpl::TimePickerSizeInfo::GetDefaultMaximumSizeF(_ControlOrientation orientation) const { - Dimension pickerSize(0, 0); - Dimension screenSize(0, 0); + FloatDimension pickerSize(0.0f, 0.0f); + FloatDimension screenSize(0.0f, 0.0f); - screenSize = _ControlManager::GetInstance()->GetScreenSize(); + screenSize = _ControlManager::GetInstance()->GetScreenSizeF(); pickerSize = screenSize; if (orientation == _CONTROL_ORIENTATION_LANDSCAPE) { diff --git a/src/ui/controls/FUiCtrl_TokenEdit.cpp b/src/ui/controls/FUiCtrl_TokenEdit.cpp old mode 100644 new mode 100755 index 29c2868..0039c42 --- a/src/ui/controls/FUiCtrl_TokenEdit.cpp +++ b/src/ui/controls/FUiCtrl_TokenEdit.cpp @@ -44,11 +44,11 @@ _TokenEdit::_TokenEdit(void) , __pHiddenTokenCountAccessibilityElement(null) , __pExpandableButtonAccessibilityElement(null) { - GET_COLOR_CONFIG(TOKENEDIT::TOKEN_BG_NORMAL, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL]); - GET_COLOR_CONFIG(TOKENEDIT::TOKEN_BG_SELECTED, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]); + GET_COLOR_CONFIG(TOKENEDIT::BG_NORMAL, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL]); + GET_COLOR_CONFIG(TOKENEDIT::BG_SELECTED, __tokenColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]); - GET_COLOR_CONFIG(TOKENEDIT::TOKEN_TEXT_NORMAL, __tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL]); - GET_COLOR_CONFIG(TOKENEDIT::TOKEN_TEXT_SELECTED, __tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]); + GET_COLOR_CONFIG(TOKENEDIT::TEXT_NORMAL, __tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL]); + GET_COLOR_CONFIG(TOKENEDIT::TEXT_SELECTED, __tokenTextColor[EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED]); _AccessibilityContainer* pContainer = null; pContainer = GetAccessibilityContainer(); @@ -129,7 +129,7 @@ _TokenEdit::AppendToken(const String& token) SysAssertf(__pTokenEditPresenter != null, "_TokenEditPresenter instance is null"); - r = __pTokenEditPresenter->MakeToken(token); + r = __pTokenEditPresenter->AppendToken(token); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); return r; @@ -302,6 +302,7 @@ _TokenEdit::SetTitleText(const String& title) r = __pTokenEditPresenter->SetInitialBounds(); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + Invalidate(true); return r; } diff --git a/src/ui/controls/FUiCtrl_TokenEditModel.cpp b/src/ui/controls/FUiCtrl_TokenEditModel.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp index 2699751..986f106 100644 --- a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp @@ -26,8 +26,11 @@ #include "FUiCtrl_TokenEdit.h" #include "FUiCtrl_TokenEditPresenter.h" #include "FUiCtrl_Scroll.h" +#include "FUi_Math.h" +#include "FUi_CoordinateSystemUtils.h" using namespace Tizen::Base; +using namespace Tizen::Base::Runtime; using namespace Tizen::Media; using namespace Tizen::Ui::Animations; using namespace Tizen::Graphics; @@ -65,16 +68,16 @@ class _Token public: _Token(const String& text, Font* pEditFont); virtual ~_Token(void); - int GetTextPixelWidth(void) const; + float GetTextPixelWidth(void) const; wchar_t* GetText(void) const; result ResetToken(const String& text); - result SetBounds(Rectangle bounds); + result SetBounds(FloatRectangle bounds); _VisualElement* GetVisualElement(void) const; _Token(const _Token& src); _Token& operator =(const _Token& value); public: - Rectangle displayRect; + FloatRectangle displayRect; TextObject* pTextObject; Font* pFont; int currTokenLength; @@ -82,8 +85,8 @@ public: bool isTextCut; private: wchar_t* __pTextBuffer; - int __textPixelWidth; - int __textPixelHeight; + float __textPixelWidth; + float __textPixelHeight; _VisualElement* __pVisualElement; }; // _Token @@ -94,8 +97,8 @@ _Token::_Token(const String& text, Font* pEditFont) , isImplicitAnimation(true) , isTextCut(false) , __pTextBuffer(null) - , __textPixelWidth(0) - , __textPixelHeight(0) + , __textPixelWidth(0.0f) + , __textPixelHeight(0.0f) , __pVisualElement(null) { result r = E_SUCCESS; @@ -160,7 +163,7 @@ result _Token::ResetToken(const String& text) { result r = E_SUCCESS; - Dimension textSize; + FloatDimension textSize; if (__pTextBuffer) { @@ -189,7 +192,7 @@ _Token::ResetToken(const String& text) r = pTextObject->AppendElement(*pSimpleText); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - textSize = pTextObject->GetTextExtent(0, length); + textSize = pTextObject->GetTextExtentF(0, length); __textPixelWidth = textSize.width; __textPixelHeight = textSize.height; @@ -210,13 +213,13 @@ CATCH: } result -_Token::SetBounds(Rectangle bounds) +_Token::SetBounds(FloatRectangle bounds) { result r = E_SUCCESS; displayRect = bounds; if (__pVisualElement) { - __pVisualElement->SetBounds(FloatRectangle(bounds.x, bounds.y, bounds.width, bounds.height)); + __pVisualElement->SetBounds(bounds); } return r; } @@ -245,7 +248,7 @@ _Token::~_Token(void) } } -int +float _Token::GetTextPixelWidth(void) const { return __textPixelWidth; @@ -261,42 +264,43 @@ _TokenEditPresenter::_TokenEditPresenter(void) : __pTokenEdit(null) , __pTokenList(null) , __pTokenBgBitmap(null) + , __pTokenBgNormalEffectBitmap(null) + , __pTokenBgPressedEffectBitmap(null) , __pressedTokenIndex(-1) , __isEditingToken(false) , __edittingTokenIndex(-1) - , __clientRect(Rectangle(0, 0, 0, 0)) - , __initTextRect(Rectangle(0, 0, 0, 0)) + , __clientRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __initTextRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __isEditModeEnabled(true) , __pDescriptionTextVisualElement(null) , __pDescriptionTextTextObject(null) , __pDescriptionTextFont(null) , __isTokenEditingFinished(false) - , __prevScrollValue(0) - , __scrollValue(0) + , __prevScrollValue(0.0f) + , __scrollValue(0.0f) , __isTokenScrolling(false) , __isNeedToScroll(false) - , __maxScrollValue(0) + , __maxScrollValue(0.0f) , __autoShrink(false) - , __hiddenTokenDisplayCountBounds(Rectangle()) - , __pHiddenTokenCountVisualElement(null) - , __autoShrinkAlignmentValue(0) - , __pHiddenTokenCountTextObject(null) , __descriptionText(String()) , __isPopupVisible(false) , __isLongPressed(false) - , __lineSpacing(0) + , __lineSpacing(0.0f) , __animatingIndex(-1) , __lastTokenIndex(-1) , __pTimingFunction(null) - , __descriptionTextRectForScroll(Rectangle(0, 0, 0, 0)) - , __previousTitleWidth(-1) - , __previousEditBounds(Rectangle(0, 0, 0, 0)) + , __descriptionTextRectForScroll(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __previousTitleWidth(-1.0f) + , __previousEditBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __isTokenEditPresenterInitialized(false) , __isFocus(false) , __previousCursorPosition(0) , __isScrollValueChanged(false) , __lineAdded(0) , __isScrollValueModified(false) + , __isTouchMoveInProgress(false) + , __isTitleSliding(false) + , __touchPressInfo(Point(-1, -1)) { } @@ -376,6 +380,12 @@ _TokenEditPresenter::DisposeTokenEditPresenter(void) delete __pTokenBgBitmap; __pTokenBgBitmap = null; + delete __pTokenBgNormalEffectBitmap; + __pTokenBgNormalEffectBitmap = null; + + delete __pTokenBgPressedEffectBitmap; + __pTokenBgPressedEffectBitmap = null; + if (__pDescriptionTextVisualElement) { __pDescriptionTextVisualElement->Destroy(); @@ -391,15 +401,6 @@ _TokenEditPresenter::DisposeTokenEditPresenter(void) __pDescriptionTextFont = null; } - if (__pHiddenTokenCountVisualElement) - { - __pHiddenTokenCountVisualElement->Destroy(); - __pHiddenTokenCountVisualElement = null; - } - - delete __pHiddenTokenCountTextObject; - __pHiddenTokenCountTextObject = null; - if (__pTimingFunction) { delete __pTimingFunction; @@ -463,12 +464,12 @@ _TokenEditPresenter::Initialize(const _Control& control) // For drawing token in specific area __clientRect.x = tokenLeftMargin; __clientRect.y = tokenTopMargin; - __clientRect.width = __pTokenEdit->GetBounds().width - tokenLeftMargin - tokenRightMargin; - __clientRect.height = __pTokenEdit->GetBounds().height - tokenTopMargin - tokenBottomMargin; + __clientRect.width = __pTokenEdit->GetBoundsF().width - tokenLeftMargin - tokenRightMargin; + __clientRect.height = __pTokenEdit->GetBoundsF().height - tokenTopMargin - tokenBottomMargin; - __initTextRect = GetTextBounds(); + __initTextRect = GetTextBoundsF(); - Rectangle tempDspRect(__initTextRect.x, __initTextRect.y, __clientRect.width, tokenHeight); + FloatRectangle tempDspRect(__initTextRect.x, __initTextRect.y, __clientRect.width, tokenHeight); SetTextBounds(tempDspRect); int textSize = 0; @@ -489,9 +490,17 @@ _TokenEditPresenter::Initialize(const _Control& control) SysTryCatch(NID_UI_CTRL, __pTokenList != null, , r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); __delimiter = L"\n"; - GET_BITMAP_CONFIG_N(TOKENEDIT::TOKEN_BG, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgBitmap); - __previousEditBounds = __pTokenEdit->GetBounds(); + r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_NORMAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgNormalEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(TOKENEDIT::BG_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTokenBgPressedEffectBitmap); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + __previousEditBounds = __pTokenEdit->GetBoundsF(); __isTokenEditPresenterInitialized = true; @@ -507,9 +516,67 @@ CATCH: delete pFont; pFont = null; + delete __pTokenBgBitmap; + __pTokenBgBitmap = null; + + delete __pTokenBgNormalEffectBitmap; + __pTokenBgNormalEffectBitmap = null; + return r; } +void +_TokenEditPresenter::DrawText(void) +{ + //Checking IsBlocked() is additional check for handler movement in token edit mode + if ((__isEditingToken) && (__edittingTokenIndex >= 0)) + { + _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex)); + if (pToken) + { + _VisualElement* pTokenVisualElement = pToken->GetVisualElement(); + SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element of token."); + + Canvas* pTokenCanvas = pTokenVisualElement->GetCanvasN(); + SysTryReturnVoidResult(NID_UI_CTRL, pTokenCanvas != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get canvas of the token."); + + FloatRectangle tokenRect(0.0f, 0.0f, pToken->displayRect.width, pToken->displayRect.height); + pTokenCanvas->SetBackgroundColor(Color(0)); + pTokenCanvas->Clear(); + + Color selectedTokenColor = GetTokenEditColor(EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED); + if (__pTokenBgBitmap) + { + Bitmap* pReplacementColorBackgroundBitmap = null; + pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pTokenBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedTokenColor); + + if (pReplacementColorBackgroundBitmap->IsNinePatchedBitmap()) + { + pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *pReplacementColorBackgroundBitmap); + } + else + { + pTokenCanvas->DrawBitmap(tokenRect, *pReplacementColorBackgroundBitmap); + } + } + else + { + pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect); + } + //TODO: Token Effect bitmap draw + + _EditPresenter::DrawText(*pTokenCanvas); + + delete pTokenCanvas; + pTokenCanvas = null; + } + } + else + { + _EditPresenter::DrawText(); + } +} + result _TokenEditPresenter::Draw(Canvas& canvas) { @@ -540,11 +607,6 @@ _TokenEditPresenter::Draw(Canvas& canvas) DrawToken(); } - if (__autoShrink) - { - DrawHiddenTokenCount(); - } - _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement(); SysTryReturnResult(NID_UI_CTRL, pEditVisualElement != null, E_SYSTEM, "A system error has occurred. Failed to get root visual element."); @@ -563,9 +625,7 @@ _TokenEditPresenter::Draw(Canvas& canvas) Canvas* pTokenCanvas = pTokenVisualElement->GetCanvasN(); SysTryReturnResult(NID_UI_CTRL, pTokenCanvas != null, E_SYSTEM, "A system error has occurred. Failed to get canvas of the token."); - _EditPresenter::SetFont(*(pToken->pFont)); - - DrawText(*pTokenCanvas); + _EditPresenter::DrawText(*pTokenCanvas); InitializeCursor(); delete pTokenCanvas; @@ -605,12 +665,17 @@ _TokenEditPresenter::DrawToken(int count) int drawStartIndex = 0; int tokenCount = 0; int tokenTextLeftMargin = 0; + int tokenVerticalSpacing = 0; + bool isCustomBitmap = false; SysTryReturn(NID_UI_CTRL, __pTokenEdit != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); _ControlOrientation orientation = __pTokenEdit->GetOrientation(); GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); + GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing); + + isCustomBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_NORMAL); if (count == -1) { @@ -652,7 +717,9 @@ _TokenEditPresenter::DrawToken(int count) SysLog(NID_UI_CTRL, "[E_SYSTEM] A system error has occurred. The Canvas instance is null"); break; } - Rectangle tokenRect(0, 0 , pToken->displayRect.width, pToken->displayRect.height); + FloatRectangle tokenRect(0.0f, 0.0f, pToken->displayRect.width, pToken->displayRect.height); + pTokenCanvas->SetBackgroundColor(Color(0)); + pTokenCanvas->Clear(); if (__pressedTokenIndex == i && IsFocused()) { @@ -674,6 +741,8 @@ _TokenEditPresenter::DrawToken(int count) pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect); } + //TODO: Token Effect bitmap draw + isSelected = true; } else @@ -695,6 +764,8 @@ _TokenEditPresenter::DrawToken(int count) { pTokenCanvas->FillRectangle(normalTokenColor, tokenRect); } + + //TODO: Token Effect bitmap draw } pTokenElement->SetAnimationProvider(null); @@ -709,13 +780,10 @@ _TokenEditPresenter::DrawToken(int count) if (!__isEditingToken || __pressedTokenIndex != i) { Color textColor; - Rectangle textRect(0, 0, pToken->displayRect.width - ((tokenTextLeftMargin * 2)), pToken->displayRect.height); + FloatRectangle textRect(0.0f, 0.0f, pToken->displayRect.width - ((tokenTextLeftMargin * 2.0f)), pToken->displayRect.height - tokenVerticalSpacing); textRect.x += tokenTextLeftMargin; - if (pToken->displayRect.width > pToken->GetTextPixelWidth()) - { - textRect.width = pToken->GetTextPixelWidth() + 1; - } + textRect.y += (tokenVerticalSpacing / 2.0f); if (isSelected) { @@ -749,9 +817,13 @@ _TokenEditPresenter::GetTokenEditColor(const ExpandableEditAreaTokenStatus statu Color color; if (status == EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL) + { color = __pTokenEdit->GetTokenColor(EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL); + } else + { color = __pTokenEdit->GetTokenColor(EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED); + } return color; } @@ -764,9 +836,13 @@ _TokenEditPresenter::GetTokenEditTextColor(const ExpandableEditAreaTokenStatus s Color color; if (status == EXPANDABLE_EDIT_AREA_TOKEN_STATUS_NORMAL) + { color = __pTokenEdit->GetTokenTextColor(); + } else + { color = __pTokenEdit->GetSelectedTokenTextColor(); + } return color; } @@ -853,6 +929,23 @@ _TokenEditPresenter::MakeToken(void) } result +_TokenEditPresenter::AppendToken(const Tizen::Base::String& token) +{ + result r = E_SUCCESS; + + r = MakeToken(token); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (__edittingTokenIndex >= 0) + { + SetEditingTokenTextBounds(__edittingTokenIndex); + _EditPresenter::SetCursorPosition(__previousCursorPosition); + } + + return r; +} + +result _TokenEditPresenter::InsertTokenAt(int index, const String& token, bool isUser) { SysTryReturnResult(NID_UI_CTRL, index >= 0, E_INVALID_ARG, "Invalid argument is used. index is (%d).", index); @@ -1022,6 +1115,11 @@ _TokenEditPresenter::RemoveTokenAt(int index, bool isClearText) if (isClearText) { + if (index > __edittingTokenIndex) + { + SetEditingTokenTextBounds(__edittingTokenIndex); + _EditPresenter::SetCursorPosition(__previousCursorPosition); + } if (index < __edittingTokenIndex) { if (__edittingTokenIndex > 0) @@ -1116,10 +1214,10 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa int index = startIndex; - Rectangle tokenEditBounds = __pTokenEdit->GetBounds(); + FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF(); String titleText = __pTokenEdit->GetTitleText(); - if (GetDescriptionTextRect().width != __previousTitleWidth) + if(!_FloatCompare(GetDescriptionTextRect().width, __previousTitleWidth)) { __descriptionTextRectForScroll = GetDescriptionTextRect(); __previousTitleWidth = GetDescriptionTextRect().width; @@ -1141,8 +1239,8 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa } else // Set description text. { - pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN) + __lineSpacing; + pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + __lineSpacing; } pToken->displayRect.width = tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin; @@ -1156,10 +1254,10 @@ _TokenEditPresenter::CalculateTokenPositionFromIndex(int startIndex, bool leftWa findPrevTokenLoopFlag = false; } - int tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth) // Line change { - pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); pToken->displayRect.y = pPreviousToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing; __lineAdded++; } @@ -1238,26 +1336,26 @@ _TokenEditPresenter::SetInitialBounds(void) { int tokenCount = __pTokenList->GetCount(); - Rectangle tokenEditBounds = __pTokenEdit->GetBounds(); - Rectangle tokenTextRect = tokenEditBounds; + FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF(); + FloatRectangle tokenTextRect = tokenEditBounds; if (tokenCount == 0) { if (__pTokenEdit->GetTitleText().GetLength()) { - Rectangle descriptionTextRect = GetDescriptionTextRect(); + FloatRectangle descriptionTextRect = GetDescriptionTextRect(); tokenTextRect.x = descriptionTextRect.x + descriptionTextRect.width + tokenVerticalSpacing; - tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + descriptionTextRect.width + 2 * __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN)); + tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + descriptionTextRect.width + 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN)); } else { tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); - tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + 2 * __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN)); + tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN)); } - tokenTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN); - tokenTextRect.height = __pTokenEdit->GetTextSize() + (2 * tokenTopMargin); + tokenTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); + tokenTextRect.height = __pTokenEdit->GetTextSizeF() + (2 * tokenTopMargin); SetTextBounds(tokenTextRect); @@ -1269,23 +1367,23 @@ _TokenEditPresenter::SetInitialBounds(void) pToken = static_cast <_Token*>(__pTokenList->GetAt(tokenCount - 1)); SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null"); - int tempTextRectWidth = 0; - tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + float tempTextRectWidth = 0.0f; + tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); if (tokenMinWidth > tempTextRectWidth) // Line change { - tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN); + tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); tokenTextRect.y = pToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing; - tokenTextRect.width = tokenEditBounds.width - tokenTextLeftMargin - tokenTextRightMargin - 2 * __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + tokenTextRect.width = tokenEditBounds.width - tokenTextLeftMargin - tokenTextRightMargin - 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); } else { tokenTextRect.x = pToken->displayRect.x + pToken->displayRect.width + tokenHorizontalSpacing; tokenTextRect.y = pToken->displayRect.y; tokenTextRect.width = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - - tokenTextRightMargin - __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN) - tokenTextLeftMargin; + tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN) - tokenTextLeftMargin; } - tokenTextRect.height = __pTokenEdit->GetTextSize() + (2 * tokenTopMargin); + tokenTextRect.height = __pTokenEdit->GetTextSizeF() + (2 * tokenTopMargin); SetTextBounds(tokenTextRect); } @@ -1298,7 +1396,7 @@ _TokenEditPresenter::SetInitialBounds(void) } result -_TokenEditPresenter::SetDescriptionTextRect(const Rectangle& rect) +_TokenEditPresenter::SetDescriptionTextRect(const FloatRectangle& rect) { result r = E_SUCCESS; @@ -1307,7 +1405,7 @@ _TokenEditPresenter::SetDescriptionTextRect(const Rectangle& rect) return r; } -Rectangle +FloatRectangle _TokenEditPresenter::GetDescriptionTextRect() const { return __descriptionTextRect; @@ -1323,9 +1421,13 @@ _TokenEditPresenter::GetTextBounds(void) const _ControlOrientation orientation = __pTokenEdit->GetOrientation(); int tokenTextLeftMargin = 0; + int tokenTextVerticalMargin = 0; GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); + GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenTextVerticalMargin); + + FloatRectangle textBoundsF(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin /2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin); + Rectangle textBounds = _CoordinateSystemUtils::ConvertToInteger(textBoundsF); - Rectangle textBounds(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y, pToken->displayRect.width, pToken->displayRect.height); return textBounds; } else @@ -1334,6 +1436,30 @@ _TokenEditPresenter::GetTextBounds(void) const } } +FloatRectangle +_TokenEditPresenter::GetTextBoundsF(void) const +{ + if ((__isPopupVisible == true || __isLongPressed == true) && __pressedTokenIndex >= 0) + { + _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex)); + SysTryReturn(NID_UI_CTRL, pToken, FloatRectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to get valid token."); + + _ControlOrientation orientation = __pTokenEdit->GetOrientation(); + int tokenTextLeftMargin = 0; + int tokenTextVerticalMargin = 0; + GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); + GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenTextVerticalMargin); + + FloatRectangle textBounds(pToken->displayRect.x + tokenTextLeftMargin, pToken->displayRect.y + (tokenTextVerticalMargin /2.0f), pToken->displayRect.width - (tokenTextLeftMargin * 2.0f), pToken->displayRect.height - tokenTextVerticalMargin); + + return textBounds; + } + else + { + return _EditPresenter::GetTextBoundsF(); + } +} + result _TokenEditPresenter::CutText(void) { @@ -1355,9 +1481,24 @@ _TokenEditPresenter::SetLineSpacing(int linePixelGap) return E_SUCCESS; } +result +_TokenEditPresenter::SetLineSpacing(float linePixelGap) +{ + __lineSpacing = linePixelGap; + + return E_SUCCESS; +} + int _TokenEditPresenter::GetLineSpacing(void) const { + int lineSpacing = _CoordinateSystemUtils::ConvertToInteger(__lineSpacing); + return lineSpacing; +} + +float +_TokenEditPresenter::GetLineSpacingF(void) const +{ return __lineSpacing; } @@ -1452,7 +1593,7 @@ _TokenEditPresenter::CalculateDescriptionTextRect(const String& descriptionText) GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TITLE_RECT_WIDTH, orientation, tokenTitleWidth); int length = descriptionText.GetLength(); - Dimension textSize; + FloatDimension textSize; wchar_t* pTempString = const_cast (descriptionText.GetPointer()); @@ -1462,35 +1603,59 @@ _TokenEditPresenter::CalculateDescriptionTextRect(const String& descriptionText) pSimpleText = new (std::nothrow)TextSimple(pTempString, length, TEXT_ELEMENT_SOURCE_TYPE_INTERNAL); __pDescriptionTextTextObject->AppendElement(*pSimpleText); - textSize = __pDescriptionTextTextObject->GetTextExtent(0, length); + textSize = __pDescriptionTextTextObject->GetTextExtentF(0, length); r = __pDescriptionTextTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); r = __pDescriptionTextTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - __descriptionTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);; - __descriptionTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMargin(EDIT_TEXT_TOP_MARGIN);; + __descriptionTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN); + __descriptionTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN); if (textSize.width > tokenTitleWidth) { textSize.width = tokenTitleWidth; - __pDescriptionTextTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); __pDescriptionTextTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL); } + __descriptionTextRect.width = tokenTextLeftMargin + textSize.width + tokenTextRightMargin; __descriptionTextRect.height = tokenHeight; __pDescriptionTextTextObject->SetBounds(__descriptionTextRect); + if (__pDescriptionTextTextObject->IsChanged()) + { + _EditPresenter::StopTitleSlidingTimer(); + __isTitleSliding = false; + } + r = __pDescriptionTextTextObject->Compose(); return r; } bool +_TokenEditPresenter::IsGuideTextActivated(void) const +{ + bool isGuideTextActivated = _EditPresenter::IsGuideTextActivated(); + + if (__isTokenEditPresenterInitialized) + { + if (GetTokenCount()) + { + return false; + } + } + + return isGuideTextActivated; +} + +bool _TokenEditPresenter::DrawDescriptionText(void) { result r = E_SUCCESS; - Rectangle tempDescriptionTextRect; + FloatRectangle tempDescriptionTextRect; Canvas* pDescriptionTextCanvas = null; Font* pDescriptionFont = null; + TextObjectActionType titleAction; + _VisualElement* pRootElement = null; if (__pDescriptionTextTextObject->GetFont(0)->GetFaceName() != GetTitleFontFaceName()) { @@ -1501,20 +1666,11 @@ _TokenEditPresenter::DrawDescriptionText(void) SysTryReturn(NID_UI_CTRL, pDescriptionFont != null, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); r = pDescriptionFont->Construct(GetTitleFontFaceName(), FONT_STYLE_PLAIN, descriptionTextSize); - if (r != E_SUCCESS) - { - delete pDescriptionFont; - pDescriptionFont = null; - } - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); r = __pDescriptionTextTextObject->SetFont(pDescriptionFont, 0, __pDescriptionTextTextObject->GetTextLength()); - if (r != E_SUCCESS) - { - delete pDescriptionFont; - pDescriptionFont = null; - } - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); + + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); delete __pDescriptionTextFont; __pDescriptionTextFont = null; @@ -1522,24 +1678,23 @@ _TokenEditPresenter::DrawDescriptionText(void) __pDescriptionTextFont = pDescriptionFont; } - _VisualElement* pRootElement = __pTokenEdit->GetVisualElement(); - SysTryReturn(NID_UI_CTRL, pRootElement, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element."); + pRootElement = __pTokenEdit->GetVisualElement(); + SysTryCatch(NID_UI_CTRL, pRootElement, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element."); - if (__pDescriptionTextVisualElement) + if (!__pDescriptionTextVisualElement) { - __pDescriptionTextVisualElement->Destroy(); - __pDescriptionTextVisualElement = null; + __pDescriptionTextVisualElement = new (std::nothrow) _VisualElement(); + SysTryCatch(NID_UI_CTRL, __pDescriptionTextVisualElement, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + r = __pDescriptionTextVisualElement->Construct(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[E_SYSTEM] A system error has occurred. Failed to construct _VisualElement"); + __pDescriptionTextVisualElement->SetImplicitAnimationEnabled(false); + __pDescriptionTextVisualElement->SetShowState(true); + + r = pRootElement->AttachChild(*__pDescriptionTextVisualElement); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } - __pDescriptionTextVisualElement = new (std::nothrow) _VisualElement(); - SysTryReturn(NID_UI_CTRL, __pDescriptionTextVisualElement, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - r = __pDescriptionTextVisualElement->Construct(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[E_SYSTEM] A system error has occurred. Failed to construct _VisualElement"); - __pDescriptionTextVisualElement->SetImplicitAnimationEnabled(false); - __pDescriptionTextVisualElement->SetBounds(FloatRectangle(__descriptionTextRect.x, __descriptionTextRect.y, __descriptionTextRect.width, __descriptionTextRect.height)); // TBD. - __pDescriptionTextVisualElement->SetShowState(true); - r = pRootElement->AttachChild(*__pDescriptionTextVisualElement); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + __pDescriptionTextVisualElement->SetBounds(FloatRectangle(__descriptionTextRect.x, (__descriptionTextRectForScroll.y + __scrollValue), __descriptionTextRect.width, __descriptionTextRect.height)); pDescriptionTextCanvas = __pDescriptionTextVisualElement->GetCanvasN(); if (pDescriptionTextCanvas == null) @@ -1549,23 +1704,72 @@ _TokenEditPresenter::DrawDescriptionText(void) } tempDescriptionTextRect = __descriptionTextRect; - tempDescriptionTextRect.x = 0; - tempDescriptionTextRect.y = 0; + tempDescriptionTextRect.x = 0.0f; + tempDescriptionTextRect.y = 0.0f; + + titleAction = __pDescriptionTextTextObject->GetAction(); + pDescriptionTextCanvas->SetBackgroundColor(Color(0)); + pDescriptionTextCanvas->Clear(); __pDescriptionTextTextObject->SetForegroundColor(__pTokenEdit->GetTitleTextColor(GetCurrentStatus()), 0, __pDescriptionTextTextObject->GetTextLength()); - pDescriptionTextCanvas->FillRectangle(__pTokenEdit->GetColor(GetCurrentStatus()), tempDescriptionTextRect); + if (IsFocused() == true) + { + if (__pDescriptionTextTextObject->GetTextLengthAt(0) < __pDescriptionTextTextObject->GetTextLength()) + { + if (titleAction != TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT) + { + __pDescriptionTextTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT); + __pDescriptionTextTextObject->Compose(); + } + } + else + { + if (titleAction != TEXT_OBJECT_ACTION_TYPE_NONE) + { + __pDescriptionTextTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); + __pDescriptionTextTextObject->Compose(); + } + } + + if (!__isTitleSliding) + { + _EditPresenter::StopTitleSlidingTimer(); + if (__pDescriptionTextTextObject->IsActionOn() == true) + { + _EditPresenter::StartTitleSlidingTimer(); + __isTitleSliding = true; + } + } + } + else + { + if (titleAction != TEXT_OBJECT_ACTION_TYPE_ABBREV) + { + __pDescriptionTextTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + __pDescriptionTextTextObject->Compose(); + } + } + + // Draw title text __pDescriptionTextTextObject->SetBounds(tempDescriptionTextRect); - __pDescriptionTextTextObject->Compose(); __pDescriptionTextTextObject->Draw(*_CanvasImpl::GetInstance(*pDescriptionTextCanvas)); - __pDescriptionTextVisualElement->SetFlushNeeded(); delete pDescriptionTextCanvas; - return true; CATCH: - __pDescriptionTextVisualElement->Destroy(); - __pDescriptionTextVisualElement = null; + if (pDescriptionFont == __pDescriptionTextFont) + { + __pDescriptionTextFont = null; + } + + delete pDescriptionFont; + + if (__pDescriptionTextVisualElement != null) + { + __pDescriptionTextVisualElement->Destroy(); + __pDescriptionTextVisualElement = null; + } return false; } @@ -1586,14 +1790,14 @@ _TokenEditPresenter::TrimTokenAndAdjustEllipsisAt(int index) pToken = static_cast <_Token*>(__pTokenList->GetAt(index)); SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null"); - Rectangle tokenEditBounds = __pTokenEdit->GetBounds(); - Rectangle tokenRect = pToken->displayRect; + FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF(); + FloatRectangle tokenRect = pToken->displayRect; - int remainWidth = tokenEditBounds.width - tokenTextRightMargin - __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN);; - int dspTokenWidth = tokenRect.x + tokenRect.width; - int dspTokenGap = dspTokenWidth - remainWidth; + float remainWidth = tokenEditBounds.width - tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);; + float dspTokenWidth = tokenRect.x + tokenRect.width; + float dspTokenGap = dspTokenWidth - remainWidth; - if (dspTokenGap > 0) + if (dspTokenGap > 0.0f) { if (pToken->displayRect.width >= tokenMinimumSize) { @@ -1626,8 +1830,8 @@ _TokenEditPresenter::GetTokenIndexFromCoordinate(const Point point) const _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); if (pToken) { - Rectangle tokenRect = pToken->displayRect; - if (tokenRect.Contains(point)) + FloatRectangle tokenRect = pToken->displayRect; + if (tokenRect.Contains(FloatPoint(point.x, point.y))) { tokenIndex = i; break; @@ -1654,11 +1858,11 @@ _TokenEditPresenter::SetEditingTokenTextBounds(int index, bool isSetText) _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(index)); SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null"); - Rectangle tempTextDspRect; + FloatRectangle tempTextDspRect; tempTextDspRect.x += tokenTextLeftMargin; - tempTextDspRect.y += tokenVerticalSpacing / 2; - tempTextDspRect.width = pToken->GetTextPixelWidth(); - tempTextDspRect.height = tokenHeight; + tempTextDspRect.y += tokenVerticalSpacing / 2.0f; + tempTextDspRect.width = pToken->displayRect.width - (tokenTextLeftMargin * 2.0f); + tempTextDspRect.height = tokenHeight - tokenVerticalSpacing; if (isSetText) { @@ -1668,6 +1872,7 @@ _TokenEditPresenter::SetEditingTokenTextBounds(int index, bool isSetText) } pToken->pTextObject->RemoveAll(); } + _EditPresenter::SetFont(*(pToken->pFont)); SetTextBounds(tempTextDspRect); @@ -1675,7 +1880,7 @@ _TokenEditPresenter::SetEditingTokenTextBounds(int index, bool isSetText) } result -_TokenEditPresenter::RecalculateTokenBounds(int position) +_TokenEditPresenter::RecalculateTokenBounds(float position) { result r = E_SUCCESS; @@ -1715,9 +1920,9 @@ result _TokenEditPresenter::SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo) { result r = E_SUCCESS; - int currentYPosition = touchinfo.GetCurrentPosition().y; + int currentYPosition = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).y; - if (__prevScrollValue == 0) + if(_FloatCompare(__prevScrollValue, 0.0f)) { __prevScrollValue = currentYPosition; } @@ -1725,7 +1930,7 @@ _TokenEditPresenter::SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo) { if (__isNeedToScroll) // Need to scroll { - int tempDefference = __prevScrollValue - currentYPosition; + float tempDefference = __prevScrollValue - currentYPosition; __prevScrollValue = currentYPosition; __scrollValue -= tempDefference; @@ -1737,9 +1942,9 @@ _TokenEditPresenter::SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo) return E_SUCCESS; } - if (__scrollValue > 0) + if (__scrollValue > 0.0f) { - __scrollValue = 0; + __scrollValue = 0.0f; return E_SUCCESS; } @@ -1769,8 +1974,8 @@ _TokenEditPresenter::SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo) } else { - __prevScrollValue = 0; - __scrollValue = 0; + __prevScrollValue = 0.0f; + __scrollValue = 0.0f; } } @@ -1783,25 +1988,29 @@ _TokenEditPresenter::SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo) result _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _TouchInfo& touchinfo) { - int tokenIndex = GetTokenIndexFromCoordinate(touchinfo.GetCurrentPosition()); + int tokenIndex = GetTokenIndexFromCoordinate(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition())); int prevPressedTokenIndex = __pressedTokenIndex; + int prevEditedTokenIndex = __edittingTokenIndex; result r = E_SUCCESS; if (IsFocused()) { if (__isEditModeEnabled && __pressedTokenIndex != -1 && __pressedTokenIndex == tokenIndex) { - /*__edittingTokenIndex = __pressedTokenIndex; + //Comment below to Block Copy & Paste functionality in Token Edit mode + __edittingTokenIndex = __pressedTokenIndex; __isEditingToken = true; - SetEditingTokenTextBounds(__edittingTokenIndex); - SetCursorDisabled(false);*/ + if (prevEditedTokenIndex != __edittingTokenIndex) + { + SetEditingTokenTextBounds(__edittingTokenIndex); + } + SetCursorDisabled(false); } - __pressedTokenIndex = tokenIndex; } - if (__pressedTokenIndex != -1) + if (tokenIndex != -1) { - if (__isEditingToken && (prevPressedTokenIndex != __pressedTokenIndex)) // Selected another token while editing. + if (__isEditingToken && (prevPressedTokenIndex != tokenIndex)) // Selected another token while editing. { __isPopupVisible = false; __isLongPressed = false; @@ -1835,21 +2044,34 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _ } } + String inputTokenString = GetText(); + String replacementString = inputTokenString; + bool enable = false; + + __pTokenEdit->ProcessTokenFiltering(inputTokenString, replacementString, enable); + if (enable) + { + inputTokenString = replacementString; + } + + __pressedTokenIndex = tokenIndex; + r = RemoveTokenAt(prevPressedTokenIndex); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); - if (GetText().GetLength() > 0) + if (inputTokenString.GetLength() > 0) { - r = InsertTokenAt(prevPressedTokenIndex, GetText()); + r = InsertTokenAt(prevPressedTokenIndex, inputTokenString); SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); pToken = static_cast <_Token*>(__pTokenList->GetAt(prevPressedTokenIndex)); if (pToken) { - pToken->currTokenLength = GetText().GetLength(); + pToken->currTokenLength = inputTokenString.GetLength(); } } + ClearText(); __edittingTokenIndex = -1; __isTokenEditingFinished = true; __isEditingToken = false; @@ -1857,6 +2079,7 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _ } else { + __pressedTokenIndex = tokenIndex; if (GetText().GetLength() > 0 && __pressedTokenIndex != prevPressedTokenIndex) { r = MakeToken(); @@ -1946,6 +2169,7 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _ { inputTokenString = replacementString; } + __pressedTokenIndex = tokenIndex; RemoveTokenAt(__edittingTokenIndex); @@ -1957,24 +2181,22 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _ { pToken->currTokenLength = inputTokenString.GetLength(); } - __isTokenEditingFinished = true; - __isEditingToken = false; - __edittingTokenIndex = -1; } - else - { - __isTokenEditingFinished = true; - __isEditingToken = false; - __edittingTokenIndex = -1; - SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. Token length is (%d)", inputTokenString.GetLength()); - return E_INVALID_ARG; - } + __isEditingToken = false; + __edittingTokenIndex = -1; + _EditPresenter::SetDefaultFont(); + __isTokenEditingFinished = false; + + ClearText(); + + SysTryReturnResult(NID_UI_CTRL, (inputTokenString.GetLength() > 0), E_INVALID_ARG, "Invalid argument is used. Token length is (%d)", inputTokenString.GetLength()); DrawText(); } else { + __pressedTokenIndex = tokenIndex; if (pCursorVisualElement->GetParent() != pEditVisualElement) { r = (pCursorVisualElement->GetParent())->DetachChild(*pCursorVisualElement); @@ -2014,7 +2236,7 @@ _TokenEditPresenter::CheckTokenScrolling(bool scrollToCursorPosition) if (tokenCount == 0) // There is no token to scroll { __isNeedToScroll = false; - __maxScrollValue = 0; + __maxScrollValue = 0.0f; __isTokenScrolling = false; return E_SUCCESS; @@ -2023,22 +2245,22 @@ _TokenEditPresenter::CheckTokenScrolling(bool scrollToCursorPosition) _Token* pToken = static_cast<_Token*>(__pTokenList->GetAt(tokenCount - 1)); SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - int newScrollValue = 0; + float newScrollValue = 0.0f; if (scrollToCursorPosition) { - Rectangle cursorBounds; + FloatRectangle cursorBounds; GetCursorBounds(false, cursorBounds); - newScrollValue = cursorBounds.y + cursorBounds.height - __scrollValue + tokenBottomMargin - __pTokenEdit->GetBounds().height; + newScrollValue = cursorBounds.y + cursorBounds.height - __scrollValue + tokenBottomMargin - __pTokenEdit->GetBoundsF().height; __isScrollValueModified = true; } else { - newScrollValue = GetTextBounds().y + GetTextBounds().height - __scrollValue + tokenBottomMargin - __pTokenEdit->GetBounds().height; + newScrollValue = GetTextBoundsF().y + GetTextBoundsF().height - __scrollValue + tokenBottomMargin - __pTokenEdit->GetBoundsF().height; __isScrollValueModified = true; } - needToScroll = (newScrollValue > 0) ? (true) : (false); + needToScroll = (newScrollValue > 0.0f) ? (true) : (false); __isNeedToScroll = needToScroll; @@ -2051,10 +2273,10 @@ _TokenEditPresenter::CheckTokenScrolling(bool scrollToCursorPosition) } else { - if (__scrollValue != 0) + if(!_FloatCompare(__scrollValue, 0.0f)) { - __scrollValue = 0; - __maxScrollValue = 0; // To prevent unnecessary token scrolling. + __scrollValue = 0.0f; + __maxScrollValue = 0.0f; // To prevent unnecessary token scrolling. RecalculateTokenBounds(__scrollValue); __isTokenScrolling = false; } @@ -2064,7 +2286,7 @@ _TokenEditPresenter::CheckTokenScrolling(bool scrollToCursorPosition) } result -_TokenEditPresenter::SetTokenVisualElementBounds(int index, const Rectangle& bounds) +_TokenEditPresenter::SetTokenVisualElementBounds(int index, const FloatRectangle& bounds) { _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(index)); SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null."); @@ -2077,11 +2299,11 @@ _TokenEditPresenter::AdjustFlexibleHeight(void) { result r = E_SUCCESS; - Rectangle editRect = __pTokenEdit->GetBounds(); - Rectangle displayScrollBounds = GetDisplayScrollBounds(); - int calcHeight = CalculateFlexibleHeight(); + FloatRectangle editRect = __pTokenEdit->GetBoundsF(); + FloatRectangle displayScrollBounds = GetDisplayScrollBoundsF(); + float calcHeight = CalculateFlexibleHeightF(); - if (editRect.height != calcHeight) + if(!_FloatCompare(editRect.height, calcHeight)) { displayScrollBounds.height = calcHeight; SetScrollBarBounds(displayScrollBounds); @@ -2096,12 +2318,12 @@ _TokenEditPresenter::AdjustFlexibleHeight(void) return r; } -int -_TokenEditPresenter::CalculateFlexibleHeight(void) +float +_TokenEditPresenter::CalculateFlexibleHeightF(void) { int tokenHeight = 0; int tokenVerticalSpacing = 0; - int tokenTopMargin =0; + int tokenTopMargin = 0; int tokenBottomMargin = 0; _ControlOrientation orientation = __pTokenEdit->GetOrientation(); @@ -2110,11 +2332,11 @@ _TokenEditPresenter::CalculateFlexibleHeight(void) GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin); GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin); - int height = 0; + float height = 0.0f; int maxLinecount = GetMaxLineCount(); - int expectedEditHeight = GetTextBounds().y + GetTextBounds().height - __scrollValue + tokenBottomMargin; - int initialHeight = GetInitialBounds().height; - int maximumLineHeight = tokenTopMargin + maxLinecount * tokenHeight + tokenVerticalSpacing * (maxLinecount - 1) + tokenBottomMargin; + float expectedEditHeight = GetTextBoundsF().y + GetTextBoundsF().height - __scrollValue + tokenBottomMargin; + float initialHeight = GetInitialBoundsF().height; + float maximumLineHeight = tokenTopMargin + maxLinecount * tokenHeight + tokenVerticalSpacing * (maxLinecount - 1) + tokenBottomMargin; if (initialHeight < expectedEditHeight) { @@ -2148,8 +2370,11 @@ _TokenEditPresenter::DrawScrollBar(void) if (IsFocused() == false) { - pScroll->SetScrollVisibility(false); - return E_SUCCESS; + if (__isTouchMoveInProgress == false) + { + pScroll->SetScrollVisibility(false); + return E_SUCCESS; + } } _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(GetTokenCount() - 1)); @@ -2161,44 +2386,39 @@ _TokenEditPresenter::DrawScrollBar(void) int tokenBottomMargin = 0; GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, tokenBottomMargin); - int totalHeight = GetTextBounds().y + GetTextBounds().height - __scrollValue + tokenBottomMargin; - int dspHeight = __pTokenEdit->GetBounds().height; - int firstDspY = -__scrollValue; + float totalHeight = GetTextBoundsF().y + GetTextBoundsF().height - __scrollValue + tokenBottomMargin; + float dspHeight = __pTokenEdit->GetBoundsF().height; + float firstDspY = -__scrollValue; if (totalHeight <= dspHeight) { pScroll->SetScrollVisibility(false); pScroll->SetScrollRange(1, 1); - pScroll->SetScrollPosition(0); + pScroll->SetScrollPosition(0.0f); SetScrollBarVisible(false); - SetPreviousScrollBarPosition(0); - SetMaximumPreviousScrollBarPosition(0); + SetPreviousScrollBarPosition(0.0f); + SetMaximumPreviousScrollBarPosition(0.0f); } else { - pScroll->SetScrollVisibility(true); -// if (_pScroll->IsVisible()) -// { - if (firstDspY > 0) - { - pScroll->SetScrollRange(dspHeight, totalHeight); - pScroll->SetScrollPosition(firstDspY); - - SetScrollBarVisible(true); - SetMaximumPreviousScrollBarPosition(totalHeight - dspHeight); - } - else - { - pScroll->SetScrollRange(dspHeight, totalHeight); - pScroll->SetScrollPosition(0); - - SetScrollBarVisible(true); - SetMaximumPreviousScrollBarPosition(0); - } + if (firstDspY > 0.0f) + { + pScroll->SetScrollRange(dspHeight, totalHeight); + pScroll->SetScrollPosition(firstDspY); + SetMaximumPreviousScrollBarPosition(totalHeight - dspHeight); + } + else + { + pScroll->SetScrollRange(dspHeight, totalHeight); + pScroll->SetScrollPosition(0.0f); + SetMaximumPreviousScrollBarPosition(0.0f); + } + if (pScroll->GetScrollVisibility()) + { SetScrollBarVisible(true); -// } + } SetPreviousScrollBarPosition(firstDspY); } @@ -2235,22 +2455,19 @@ _TokenEditPresenter::CalculateVisibleTokenCount(void) { int visibleTokenCount = 0; - Rectangle intialBounds = GetInitialBounds(); - Rectangle tempInitialBounds = intialBounds; - Rectangle hiddenTokenDisplayBounds; + FloatRectangle intialBounds = GetInitialBoundsF(); + FloatRectangle tempInitialBounds = intialBounds; + FloatRectangle hiddenTokenDisplayBounds; int tokenCount = GetTokenCount(); for (int i = 0; i < tokenCount; i++) { tempInitialBounds = intialBounds; + _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); + SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - hiddenTokenDisplayBounds = CalculateHiddenTokenCountDisplayBounds(tokenCount - i - 1); - tempInitialBounds.width -= hiddenTokenDisplayBounds.width; - - Point leftTop(hiddenTokenDisplayBounds.x, hiddenTokenDisplayBounds.y); - Point rightBottom(hiddenTokenDisplayBounds.x + hiddenTokenDisplayBounds.width, hiddenTokenDisplayBounds.y + hiddenTokenDisplayBounds.height); - - if (tempInitialBounds.Contains(leftTop) == false || tempInitialBounds.Contains(rightBottom) == false) + FloatRectangle displayBounds = pToken->displayRect; + if ((tempInitialBounds.y + displayBounds.y) > (tempInitialBounds.y + tempInitialBounds.height)) { break; } @@ -2259,161 +2476,22 @@ _TokenEditPresenter::CalculateVisibleTokenCount(void) return visibleTokenCount; } -Rectangle -_TokenEditPresenter::CalculateHiddenTokenCountDisplayBounds(int hiddenTokenCount) +bool +_TokenEditPresenter::OnFocusGained(void) { - result r = E_SUCCESS; - Rectangle displayBounds; - - int textSize = 0; - int margin = 0; - int height = 0; - int horizontalSpace = 0; - Dimension textDim; - TextSimple* pSimpleText = null; - Font* pFont = null; - - GET_SHAPE_CONFIG(TOKENEDIT::HIDDEN_TOKEN_COUNT_DISPLAY_TEXT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, textSize); - GET_SHAPE_CONFIG(TOKENEDIT::HIDDEN_TOKEN_COUNT_DISPLAY_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin); - GET_SHAPE_CONFIG(TOKENEDIT::HIDDEN_TOKEN_COUNT_DISPLAY_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height); - GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HORIZONTAL_SPACING, _CONTROL_ORIENTATION_PORTRAIT, horizontalSpace); + __isTitleSliding = false; + if (__autoShrink) + { + float tempHeight = CalculateFlexibleHeightF(); + FloatRectangle tempRect = GetInitialBoundsF(); + tempRect.height = tempHeight; - int tokenIndex = GetTokenCount() - hiddenTokenCount - 1; - _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(tokenIndex)); - SysTryReturn(NID_UI_CTRL, pToken != null && pToken->pTextObject != null, Rectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); + _Token* pToken = null; + int tokenCount = GetTokenCount(); - displayBounds.x = pToken->displayRect.x + pToken->displayRect.width + margin; - displayBounds.y = pToken->displayRect.y; - displayBounds.height = height; - - String hiddenTokenCountString("+"); - hiddenTokenCountString.Append(hiddenTokenCount); - - int length = hiddenTokenCountString.GetLength(); - wchar_t* pTempString = const_cast (hiddenTokenCountString.GetPointer()); - - if (__pHiddenTokenCountTextObject) - { - delete __pHiddenTokenCountTextObject; - __pHiddenTokenCountTextObject = null; - } - - __pHiddenTokenCountTextObject = new (std::nothrow) TextObject; - SysTryReturn(NID_UI_CTRL, __pHiddenTokenCountTextObject != null, Rectangle(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = __pHiddenTokenCountTextObject->Construct(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - pSimpleText = new (std::nothrow) TextSimple(pTempString, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); - SysTryCatch(NID_UI_CTRL, pSimpleText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - __pHiddenTokenCountTextObject->AppendElement(*pSimpleText); - __pHiddenTokenCountTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE); - __pHiddenTokenCountTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - - pFont = new (std::nothrow) Font; - SysTryCatch(NID_UI_CTRL, pFont != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - r = pFont->Construct(FONT_STYLE_PLAIN, textSize); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - __pHiddenTokenCountTextObject->SetFont(pFont, 0, __pHiddenTokenCountTextObject->GetTextLength()); - - textDim = __pHiddenTokenCountTextObject->GetTextExtent(0, length); - displayBounds.width = margin + textDim.width + margin; - - delete pFont; - pFont = null; - - return displayBounds; - -CATCH: - - delete __pHiddenTokenCountTextObject; - __pHiddenTokenCountTextObject = null; - - delete pSimpleText; - pSimpleText = null; - - delete pFont; - pFont = null; - - return Rectangle(); -} - -int -_TokenEditPresenter::CalculateAutoShrinkAlignmentValue(int visibleTokenCount) const -{ - int value = 0; - - _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(visibleTokenCount - 1)); - SysTryReturn(NID_UI_CTRL, pToken != null && pToken->pTextObject != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null"); - - value = pToken->displayRect.y; - - pToken = static_cast <_Token*>(__pTokenList->GetAt(0)); - SysTryReturn(NID_UI_CTRL, pToken != null && pToken->pTextObject != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - - value = pToken->displayRect.y + pToken->displayRect.height - value; - - int initialHeight = GetInitialBounds().height; - - value = (initialHeight - value) / 2; - - int topMargin = 0; - GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, topMargin); - - value -= topMargin; - - if (value < 0) - { - value = 0; - } - - return value; -} - -result -_TokenEditPresenter::DrawHiddenTokenCount(void) -{ - result r = E_SUCCESS; - - if (__pHiddenTokenCountVisualElement) - { - Canvas* pHiddenTokenCountCanvas = __pHiddenTokenCountVisualElement->GetCanvasN(); - - if (pHiddenTokenCountCanvas) - { - __pHiddenTokenCountTextObject->SetForegroundColor(Color::GetColor(COLOR_ID_WHITE), 0, __pHiddenTokenCountTextObject->GetTextLength()); - __pHiddenTokenCountTextObject->Compose(); - __pHiddenTokenCountTextObject->SetBounds(__hiddenTokenDisplayCountBounds); - __pHiddenTokenCountTextObject->Draw(*_CanvasImpl::GetInstance(*pHiddenTokenCountCanvas)); - - delete pHiddenTokenCountCanvas; - pHiddenTokenCountCanvas = null; - } - - __pHiddenTokenCountVisualElement->SetFlushNeeded(); - } - - return r; -} - -bool -_TokenEditPresenter::OnFocusGained(void) -{ - if (__autoShrink) - { - int tempHeight = CalculateFlexibleHeight(); - Rectangle tempRect = GetInitialBounds(); - tempRect.height = tempHeight; - - _Token* pToken = null; - int tokenCount = GetTokenCount(); - - for (int i = 0; i < tokenCount; i++) - { - pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); + for (int i = 0; i < tokenCount; i++) + { + pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); if (pToken) { @@ -2425,23 +2503,6 @@ _TokenEditPresenter::OnFocusGained(void) } } - if (__autoShrink) - { - _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement(); - SysTryReturn(NID_UI_CTRL, pEditVisualElement, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element."); - - if (__pHiddenTokenCountVisualElement) - { - pEditVisualElement->DetachChild(*__pHiddenTokenCountVisualElement); - __pHiddenTokenCountVisualElement->Destroy(); - __pHiddenTokenCountVisualElement = null; - } - - __scrollValue = -__autoShrinkAlignmentValue; - __autoShrinkAlignmentValue = 0; - CalculateTokenPositionFromIndex(0); - } - SetFlexBounds(tempRect); SetEditingTokenTextBounds(__edittingTokenIndex, false); @@ -2454,10 +2515,23 @@ _TokenEditPresenter::OnFocusGained(void) if (__isScrollValueChanged && !__isScrollValueModified) { - __maxScrollValue = __maxScrollValue - (__pTokenEdit->GetBounds().height - GetInitialBounds().height); + __maxScrollValue = __maxScrollValue - (__pTokenEdit->GetBoundsF().height - GetInitialBoundsF().height); __isScrollValueChanged = false; } } + + if (GetTokenCount()) + { + CheckTokenScrolling(); + } + + TextObject* pTextObject = GetTextObject(); + if (pTextObject) + { + pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE); + pTextObject->Compose(); + } + return _EditPresenter::OnFocusGained(); } @@ -2465,9 +2539,11 @@ bool _TokenEditPresenter::OnFocusLost(void) { result r = E_SUCCESS; - __isFocus = false; + _EditPresenter::StopTitleSlidingTimer(); + __isTitleSliding = false; + if (__edittingTokenIndex >= 0) { _Token* pToken = null; @@ -2495,7 +2571,7 @@ _TokenEditPresenter::OnFocusLost(void) { pScroll->SetScrollVisibility(false); } - __scrollValue = 0; + __scrollValue = 0.0f; int tokenCount = GetTokenCount(); _Token* pToken = null; @@ -2511,55 +2587,26 @@ _TokenEditPresenter::OnFocusLost(void) r = SetInitialBounds(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating", GetErrorMessage(r)); - int visibleTokenCount = CalculateVisibleTokenCount(); - __hiddenTokenDisplayCountBounds = CalculateHiddenTokenCountDisplayBounds(tokenCount - visibleTokenCount); + __scrollValue = 0.0f; + r = CalculateTokenPositionFromIndex(0); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); - __autoShrinkAlignmentValue = CalculateAutoShrinkAlignmentValue(visibleTokenCount); + int visibleTokenCount = CalculateVisibleTokenCount(); - if (visibleTokenCount > 0) + for (int i = visibleTokenCount; i < tokenCount; i++) { - _Token* pToken = null; - for (int i = visibleTokenCount; i < tokenCount; i++) + pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); + if (pToken) { - pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); - if (pToken) + _VisualElement* pTokenVisualElement = pToken->GetVisualElement(); + if (pTokenVisualElement) { - _VisualElement* pTokenVisualElement = pToken->GetVisualElement(); - if (pTokenVisualElement) - { - pTokenVisualElement->SetShowState(false); - } + pTokenVisualElement->SetShowState(false); } } - - _VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement(); - SysTryReturn(NID_UI_CTRL, pEditVisualElement != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element."); - - if (__pHiddenTokenCountVisualElement) - { - pEditVisualElement->DetachChild(*__pHiddenTokenCountVisualElement); - __pHiddenTokenCountVisualElement->Destroy(); - __pHiddenTokenCountVisualElement = null; - } - - __pHiddenTokenCountVisualElement = new (std::nothrow) _VisualElement; - if (__pHiddenTokenCountVisualElement) - { - r = __pHiddenTokenCountVisualElement->Construct(); - __pHiddenTokenCountVisualElement->SetShowState(true); - // Draw hidden token count - __pHiddenTokenCountVisualElement->SetBounds(FloatRectangle(__hiddenTokenDisplayCountBounds.x, - __hiddenTokenDisplayCountBounds.y, __hiddenTokenDisplayCountBounds.width, __hiddenTokenDisplayCountBounds.height)); - - pEditVisualElement->AttachChild(*__pHiddenTokenCountVisualElement); - } } - __scrollValue = __autoShrinkAlignmentValue; - r = CalculateTokenPositionFromIndex(0); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); - - int totalScrollValue = __maxScrollValue + (__pTokenEdit->GetBounds().height - GetInitialBounds().height); + float totalScrollValue = __maxScrollValue + (__pTokenEdit->GetBoundsF().height - GetInitialBoundsF().height); if (totalScrollValue > 0) { @@ -2573,7 +2620,7 @@ _TokenEditPresenter::OnFocusLost(void) } } - Rectangle intialWindowBounds = GetInitialBounds(); + FloatRectangle intialWindowBounds = GetInitialBoundsF(); SetFlexBounds(intialWindowBounds); SetEditingTokenTextBounds(__edittingTokenIndex, false); @@ -2581,13 +2628,20 @@ _TokenEditPresenter::OnFocusLost(void) __descriptionTextRect.y = __descriptionTextRectForScroll.y + __scrollValue; } + TextObject* pTextObject = GetTextObject(); + if (pTextObject) + { + pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + pTextObject->Compose(); + } + return _EditPresenter::OnFocusLost(); } result -_TokenEditPresenter::SetFlexBounds(const Rectangle& bounds) +_TokenEditPresenter::SetFlexBounds(const FloatRectangle& bounds) { - if (__pTokenEdit->GetBounds().height > bounds.height) + if (__pTokenEdit->GetBoundsF().height > bounds.height) { if (__lineAdded > 0) { @@ -2600,10 +2654,15 @@ _TokenEditPresenter::SetFlexBounds(const Rectangle& bounds) bool _TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { - int tokenIndex = GetTokenIndexFromCoordinate(touchinfo.GetCurrentPosition()); + int tokenIndex = GetTokenIndexFromCoordinate(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition())); if (tokenIndex != -1) { + if (tokenIndex == __edittingTokenIndex) + { + __touchPressInfo.x = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).x; + __touchPressInfo.y = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).y; + } return false; } @@ -2613,11 +2672,27 @@ _TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& to bool _TokenEditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) { + __touchPressInfo = Point(-1, -1); + ProcessTokeningByTouchEvent(source, touchinfo); + if (GetTokenCount()) + { + //Set token bounds appropriately On Fast flick of scroll bar + if (!(__isEditingToken || __edittingTokenIndex >= 0)) + { + SetTokenBoundsByTouchInfo(touchinfo); + } + } + + _Scroll* pScroll = GetScrollBar(); + if (pScroll) + { + pScroll->SetScrollVisibility(false); + } if (__prevScrollValue) { - __prevScrollValue = 0; + __prevScrollValue = 0.0f; __isTokenScrolling = false; } @@ -2628,7 +2703,9 @@ _TokenEditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& t pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex)); if (pToken) { - Point point(touchinfo.GetCurrentPosition().x - pToken->displayRect.x, touchinfo.GetCurrentPosition().y - pToken->displayRect.y); + int tokenX = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.x); + int tokenY = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.y); + Point point(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).x - tokenX, _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).y - tokenY); TouchInfo.SetTouchInfo(touchinfo.GetPointId(), touchinfo.GetTouchStatus(), point, touchinfo.IsFlicked(), touchinfo.GetTimeStamp()); } _EditPresenter::OnTouchReleased(source, TouchInfo); @@ -2639,6 +2716,8 @@ _TokenEditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& t _EditPresenter::OnTouchReleased(source, touchinfo); } + __isTouchMoveInProgress = false; + return false; } @@ -2725,12 +2804,13 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText) __edittingTokenIndex = -1; __isEditingToken = false; + AdjustFlexibleHeight(); + CheckTokenScrolling(); SetCursorDisabled(false); if (inputTokenString.GetLength() <= 0) { SysLog(NID_UI_CTRL, "[E_INVALID_ARG] Invalid argument is used. Token length is (%d)", inputTokenString.GetLength()); - return; } } @@ -2775,16 +2855,12 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText) GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing); GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); - Rectangle tempTextDspRect; + FloatRectangle tempTextDspRect; tempTextDspRect.x += tokenTextLeftMargin; - tempTextDspRect.y += tokenVerticalSpacing / 2; - tempTextDspRect.width = pToken->GetTextPixelWidth(); - tempTextDspRect.height = tokenHeight; + tempTextDspRect.y += tokenVerticalSpacing / 2.0f; + tempTextDspRect.width = pToken->displayRect.width - (tokenTextLeftMargin * 2.0f); + tempTextDspRect.height = tokenHeight - tokenVerticalSpacing; - if (pToken->GetTextPixelWidth() > (pToken->displayRect.width - tokenTextLeftMargin - 20)) - { - tempTextDspRect.width = pToken->displayRect.width - tokenTextLeftMargin - 20; - } SetTextBounds(tempTextDspRect); if (GetCursorPosition() > pToken->currTokenLength) @@ -2809,13 +2885,16 @@ _TokenEditPresenter::OnTextCommitted(const String& commitText) _ControlOrientation orientation = __pTokenEdit->GetOrientation(); GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin); - Rectangle textBounds = GetTextBounds(); - textBounds.height = __pTokenEdit->GetTextSize() + (2 * tokenTopMargin); + FloatRectangle textBounds = GetTextBoundsF(); + textBounds.height = __pTokenEdit->GetTextSizeF() + (2.0f * tokenTopMargin); SetTextBounds(textBounds); } - CheckTokenScrolling(true); + if (__edittingTokenIndex < 0) + { + CheckTokenScrolling(); + } __pTokenEdit->Draw(); return; @@ -2884,7 +2963,11 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) __pressedTokenIndex = -1; __edittingTokenIndex = -1; __isEditingToken = false; - __isTokenEditingFinished = true; + _EditPresenter::SetDefaultFont(); + __isTokenEditingFinished = false; + + AdjustFlexibleHeight(); + CheckTokenScrolling(); } else if (__pressedTokenIndex != -1) { @@ -2975,6 +3058,7 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) delete pAnimation; } } + DrawText(); __pTokenEdit->Invalidate(); return; @@ -3011,7 +3095,7 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) DeleteText(start, end); __previousCursorPosition = start; - if (IsCopyPastePopupVisible()) + if (IsCopyPasteManagerExist()) { InitializeCopyPasteManager(); } @@ -3060,7 +3144,6 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) int tokenVerticalSpacing = 0; int tokenTextLeftMargin = 0; - SetText(GetText()); SetCursorPosition(__previousCursorPosition); _ControlOrientation orientation = __pTokenEdit->GetOrientation(); @@ -3068,11 +3151,11 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing); GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); - Rectangle tempTextDspRect; + FloatRectangle tempTextDspRect; tempTextDspRect.x += tokenTextLeftMargin; - tempTextDspRect.y += tokenVerticalSpacing/2; - tempTextDspRect.width = pToken->GetTextPixelWidth(); - tempTextDspRect.height = tokenHeight; + tempTextDspRect.y += tokenVerticalSpacing / 2.0f; + tempTextDspRect.width = pToken->displayRect.width - (tokenTextLeftMargin * 2.0f); + tempTextDspRect.height = tokenHeight - tokenVerticalSpacing; SetTextBounds(tempTextDspRect); _EditPresenter::SetCursorPosition(start); @@ -3088,23 +3171,52 @@ _TokenEditPresenter::OnSurroundingTextDeleted(int offset, int charCount) bool _TokenEditPresenter::OnTapGestureDetected(void) { - __isPopupVisible = true; - - if (__pressedTokenIndex != -1) + if (__edittingTokenIndex >= 0) { - return true; + __isPopupVisible = true; } + + //Uncomment below to Block Copy & Paste functionality in Token Edit mode + //if (__pressedTokenIndex != -1) + //{ + // return true; + //} return _EditPresenter::OnTapGestureDetected(); } bool +_TokenEditPresenter::CheckCopyPastePopupShowStatus(void) +{ + if (__edittingTokenIndex < 0) + { + float controlHeight = __pTokenEdit->GetBoundsF().height; + FloatRectangle cursorBounds; + GetCursorBounds(false, cursorBounds); + if (cursorBounds.y > controlHeight) + { + return true; + } + } + + return false; +} + +bool _TokenEditPresenter::OnLongPressGestureDetected(void) { - __isLongPressed = true; - if (__pressedTokenIndex != -1) + if (CheckCopyPastePopupShowStatus()) { + //TextBounds bigger than control height. Dont show Copy paste popup return true; } + + __isLongPressed = true; + + //Uncomment below to Block Copy & Paste functionality in Token Edit mode + //if (__pressedTokenIndex != -1) + //{ + // return true; + //} return _EditPresenter::OnLongPressGestureDetected(); } @@ -3119,14 +3231,14 @@ _TokenEditPresenter::OnCursorTimerExpired(void) return; } - Rectangle cursorRect; + FloatRectangle cursorRect; _Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex)); SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null"); - Rectangle cursorDspRect = pToken->displayRect; - cursorDspRect.x = 12; - cursorDspRect.y = 10; + //Set Editing token bounds for text scroll and cursor position calculation (SetTextBounds should have been done prior to this) + FloatRectangle cursorDspRect = _EditPresenter::GetTextBoundsF(); + if (CalculateCursorBounds(cursorDspRect, cursorRect) != E_SUCCESS) { StartCursorTimer(); @@ -3141,7 +3253,7 @@ _TokenEditPresenter::OnCursorTimerExpired(void) bool cursorEnable = IsCursorEnabled(); - pCursorVisualElement->SetBounds(FloatRectangle(cursorRect.x, cursorRect.y, cursorRect.width, cursorRect.height)); + pCursorVisualElement->SetBounds(cursorRect); DrawCursor(*pCursorCanvas, cursorRect, cursorEnable); if (cursorEnable) @@ -3166,11 +3278,79 @@ _TokenEditPresenter::OnCursorTimerExpired(void) } bool +_TokenEditPresenter::IsTextBlockedInTokenEdit(void) const +{ + if ((IsBlocked() == true) && (__isEditingToken) && (__edittingTokenIndex >= 0)) + { + return true; + } + return false; +} + +bool _TokenEditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { + __isTouchMoveInProgress = true; + if (GetTokenCount()) { + //Scrolling is blocked when a popup is visible or when a text is blocked + if (IsBlocked() == true || __isLongPressed == true) + { + return false; + } + + //Allow touch move only in horizontal direction when editing token + _TouchInfo TouchInfo(touchinfo); + _Token* pToken = null; + if (__edittingTokenIndex >= 0) + { + if (__touchPressInfo.y > 0) + { + pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex)); + if (pToken) + { + int tokenX = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.x); + int tokenY = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.y); + Point point(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).x - tokenX, __touchPressInfo.y - tokenY); + TouchInfo.SetTouchInfo(touchinfo.GetPointId(), touchinfo.GetTouchStatus(), point, touchinfo.IsFlicked(), touchinfo.GetTimeStamp()); + } + + bool retValue = _EditPresenter::OnTouchMoved(source, TouchInfo); + __previousCursorPosition = GetCursorPosition(); + + return retValue; + } + else + { + return false; + } + } + SetTokenBoundsByTouchInfo(touchinfo); + + if (!(__pTokenEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL)) + { + _Scroll* pScroll = GetScrollBar(); + if (pScroll) + { + int tokenBottomMargin = 0; + GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, tokenBottomMargin); + + float totalHeight = GetTextBoundsF().y + GetTextBoundsF().height - __scrollValue + tokenBottomMargin; + float controlHeight = __pTokenEdit->GetBoundsF().height; + + if (totalHeight > controlHeight) + { + pScroll->SetScrollVisibility(true); + } + else + { + pScroll->SetScrollVisibility(false); + } + } + } + return false; // Event through } else @@ -3209,17 +3389,17 @@ _TokenEditPresenter::OnVisualElementAnimationFinished (const Tizen::Ui::Animatio return; } -int -_TokenEditPresenter::ResizeTokenAndAdjustEllipsis(int index, int value, bool isTokenShrink) +float +_TokenEditPresenter::ResizeTokenAndAdjustEllipsis(int index, float value, bool isTokenShrink) { if (isTokenShrink) { - int trimValue = value; - int extraTrimValue = 0; + float trimValue = value; + float extraTrimValue = 0.0f; _Token* pToken = null; pToken = static_cast <_Token*>(__pTokenList->GetAt(index)); - SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); + SysTryReturn(NID_UI_CTRL, pToken != null, -1.0f, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); int tokenMinimumSize = 0; @@ -3246,12 +3426,12 @@ _TokenEditPresenter::ResizeTokenAndAdjustEllipsis(int index, int value, bool isT } else { - int expandValue = value; - int extraExpandValue = 0; + float expandValue = value; + float extraExpandValue = 0.0f; _Token* pToken = null; pToken = static_cast <_Token*>(__pTokenList->GetAt(index)); - SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); + SysTryReturn(NID_UI_CTRL, pToken != null, -1.0f, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); int tokenTextLeftMargin = 0; int tokenTextRightMargin = 0; @@ -3261,9 +3441,9 @@ _TokenEditPresenter::ResizeTokenAndAdjustEllipsis(int index, int value, bool isT GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin); GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_RIGHT_MARGIN, orientation, tokenTextRightMargin); - int tokenTextWidth = pToken->GetTextPixelWidth(); + float tokenTextWidth = pToken->GetTextPixelWidth(); - int tokenDisplayRectWidth = tokenTextLeftMargin + tokenTextWidth + tokenTextRightMargin; + float tokenDisplayRectWidth = _CoordinateSystemUtils::ConvertToFloat(tokenTextLeftMargin + tokenTextWidth + tokenTextRightMargin); if ((pToken->displayRect.width + expandValue) <= tokenDisplayRectWidth) { pToken->displayRect.width += expandValue; @@ -3286,7 +3466,7 @@ _TokenEditPresenter::ResizeTokenAndAdjustEllipsis(int index, int value, bool isT } int -_TokenEditPresenter::PickToken(int index, Rectangle tokenDispRect, bool isTokenShrink) +_TokenEditPresenter::PickToken(int index, FloatRectangle tokenDispRect, bool isTokenShrink) { int tokenCount = __pTokenList->GetCount(); @@ -3310,10 +3490,11 @@ _TokenEditPresenter::PickToken(int index, Rectangle tokenDispRect, bool isTokenS pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle tokenRect = pToken->displayRect; - if (tokenDispRect.y == tokenRect.y) + FloatRectangle tokenRect = pToken->displayRect; + if (_FloatCompare(tokenDispRect.y, tokenRect.y)) { - if (tokenRect.width > tokenMinimumSize) + float tokenMinSize = _CoordinateSystemUtils::ConvertToFloat(tokenMinimumSize); + if (tokenRect.width > tokenMinSize) { return i; } @@ -3329,12 +3510,13 @@ _TokenEditPresenter::PickToken(int index, Rectangle tokenDispRect, bool isTokenS pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); SysTryReturn(NID_UI_CTRL, pToken != null, -1, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle tokenRect = pToken->displayRect; - if (tokenDispRect.y == tokenRect.y) + FloatRectangle tokenRect = pToken->displayRect; + if (_FloatCompare(tokenDispRect.y, tokenRect.y)) { - int tokenTextWidth = pToken->GetTextPixelWidth(); + float tokenTextWidth = pToken->GetTextPixelWidth(); + float currentTokenWidth = _CoordinateSystemUtils::ConvertToFloat(tokenTextLeftMargin + tokenTextWidth + tokenTextRightMargin); - if (tokenRect.width < (tokenTextLeftMargin + tokenTextWidth + tokenTextRightMargin)) + if (tokenRect.width < currentTokenWidth) { return i; } @@ -3346,7 +3528,7 @@ _TokenEditPresenter::PickToken(int index, Rectangle tokenDispRect, bool isTokenS } void -_TokenEditPresenter::RepositionToken(int currentTokenIndex, int moveDistance, bool isTokenShrink) +_TokenEditPresenter::RepositionToken(int currentTokenIndex, float moveDistance, bool isTokenShrink) { int tokenCount = __pTokenList->GetCount(); @@ -3354,7 +3536,7 @@ _TokenEditPresenter::RepositionToken(int currentTokenIndex, int moveDistance, bo pCurrentToken = static_cast <_Token*>(__pTokenList->GetAt(currentTokenIndex)); SysTryReturnVoidResult(NID_UI_CTRL, pCurrentToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle currentTokenRect = pCurrentToken->displayRect; + FloatRectangle currentTokenRect = pCurrentToken->displayRect; if (currentTokenIndex < (tokenCount - 1)) { @@ -3366,8 +3548,8 @@ _TokenEditPresenter::RepositionToken(int currentTokenIndex, int moveDistance, bo if (pToken) { - Rectangle tokenRect = pToken->displayRect; - if (currentTokenRect.y == tokenRect.y) + FloatRectangle tokenRect = pToken->displayRect; + if (_FloatCompare(currentTokenRect.y, tokenRect.y)) { if (isTokenShrink) { @@ -3400,7 +3582,7 @@ _TokenEditPresenter::ShrinkTokens() GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_RIGHT_MARGIN, orientation, tokenTextRightMargin); int tokenCount = __pTokenList->GetCount(); - Rectangle currentEditBounds = __pTokenEdit->GetBounds(); + FloatRectangle currentEditBounds = __pTokenEdit->GetBoundsF(); for (int i = 0; i < tokenCount; i++) { @@ -3411,9 +3593,9 @@ _TokenEditPresenter::ShrinkTokens() pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle tokenRect = pToken->displayRect; + FloatRectangle tokenRect = pToken->displayRect; - Rectangle nextTokenRect; + FloatRectangle nextTokenRect; if (i < tokenCount - 1) { pNextToken = static_cast <_Token*>(__pTokenList->GetAt(i + 1)); @@ -3440,28 +3622,28 @@ _TokenEditPresenter::ShrinkTokens() continue; } - int tokenEndPoint = tokenRect.x + tokenRect.width + tokenTextRightMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN); + float tokenEndPoint = tokenRect.x + tokenRect.width + tokenTextRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN); if (tokenEndPoint <= currentEditBounds.width) { continue; } //Trimming Token required - int trimValue = tokenEndPoint - currentEditBounds.width; + float trimValue = tokenEndPoint - currentEditBounds.width; - while (trimValue > 0) + while (trimValue > 0.0f) { int tokenIndex = PickToken(i, tokenRect, true); if (tokenIndex >= 0) { - int extraTrimValue = ResizeTokenAndAdjustEllipsis(tokenIndex, trimValue, true); - if (extraTrimValue < 0) + float extraTrimValue = ResizeTokenAndAdjustEllipsis(tokenIndex, trimValue, true); + if (extraTrimValue < 0.0f) { SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); break; } - if ((trimValue - extraTrimValue) > 0) + if ((trimValue - extraTrimValue) > 0.0f) { RepositionToken(tokenIndex, (trimValue - extraTrimValue), true); } @@ -3478,18 +3660,18 @@ _TokenEditPresenter::ShrinkTokens() return; } -int -_TokenEditPresenter::GetPickedTokenEndPoint(int index, Tizen::Graphics::Rectangle tokenDispRect) +float +_TokenEditPresenter::GetPickedTokenEndPoint(int index, Tizen::Graphics::FloatRectangle tokenDispRect) { int tokenTextRightMargin = 0; - int endValue = 0; + float endValue = 0.0f; _ControlOrientation orientation = __pTokenEdit->GetOrientation(); GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_RIGHT_MARGIN, orientation, tokenTextRightMargin); - int marginValue = tokenTextRightMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_RIGHT_MARGIN);; + float marginValue = tokenTextRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);; - Rectangle lastTokenRect(0,0,0,0); + FloatRectangle lastTokenRect(0.0f, 0.0f, 0.0f, 0.0f); int tokenCount = __pTokenList->GetCount(); for (int i = index; i < tokenCount; i++) @@ -3498,8 +3680,8 @@ _TokenEditPresenter::GetPickedTokenEndPoint(int index, Tizen::Graphics::Rectangl pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); SysTryReturn(NID_UI_CTRL, pToken != null, 0, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle tokenRect = pToken->displayRect; - if (tokenDispRect.y == tokenRect.y) + FloatRectangle tokenRect = pToken->displayRect; + if (_FloatCompare(tokenDispRect.y, tokenRect.y)) { lastTokenRect = tokenRect; } @@ -3518,7 +3700,7 @@ void _TokenEditPresenter::ExpandTokens() { int tokenCount = __pTokenList->GetCount(); - Rectangle currentEditBounds = __pTokenEdit->GetBounds(); + FloatRectangle currentEditBounds = __pTokenEdit->GetBoundsF(); for (int i = tokenCount - 1; i >= 0; i--) { @@ -3529,10 +3711,10 @@ _TokenEditPresenter::ExpandTokens() pToken = static_cast <_Token*>(__pTokenList->GetAt(i)); SysTryReturnVoidResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); - Rectangle tokenRect = pToken->displayRect; + FloatRectangle tokenRect = pToken->displayRect; - Rectangle prevTokenRect; - if (i > 0) + FloatRectangle prevTokenRect; + if (i > 0) { pPrevToken = static_cast <_Token*>(__pTokenList->GetAt(i - 1)); SysTryReturnVoidResult(NID_UI_CTRL, pPrevToken != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); @@ -3558,29 +3740,29 @@ _TokenEditPresenter::ExpandTokens() continue; } - int tokenEndPoint = GetPickedTokenEndPoint(i, tokenRect);; + float tokenEndPoint = GetPickedTokenEndPoint(i, tokenRect);; - if ((tokenEndPoint == 0) || (tokenEndPoint >= currentEditBounds.width)) + if ((_FloatCompare(tokenEndPoint, 0.0f)) || (tokenEndPoint >= currentEditBounds.width)) { continue; } //Expanding Token required - int expandValue = currentEditBounds.width - tokenEndPoint; + float expandValue = currentEditBounds.width - tokenEndPoint; - while (expandValue > 0) + while (expandValue > 0.0f) { int tokenIndex = PickToken(i, tokenRect, false); if (tokenIndex >= 0) { - int extraExpandValue = ResizeTokenAndAdjustEllipsis(tokenIndex, expandValue, false); - if (extraExpandValue < 0) + float extraExpandValue = ResizeTokenAndAdjustEllipsis(tokenIndex, expandValue, false); + if (extraExpandValue < 0.0f) { SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null."); break; } - if ((expandValue - extraExpandValue) > 0) + if ((expandValue - extraExpandValue) > 0.0f) { RepositionToken(tokenIndex, (expandValue - extraExpandValue), false); } @@ -3608,7 +3790,7 @@ _TokenEditPresenter::OnBoundsChanged(void) int tokenCount = __pTokenList->GetCount(); SysTryReturnVoidResult(NID_UI_CTRL, tokenCount > 0, E_SUCCESS, "No Tokens available."); - Rectangle tokenEditBounds = __pTokenEdit->GetBounds(); + FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF(); if (tokenEditBounds.width < __previousEditBounds.width) { @@ -3624,5 +3806,128 @@ _TokenEditPresenter::OnBoundsChanged(void) return; } +void +_TokenEditPresenter::OnTimerExpired(Timer& timer) +{ + Timer* onTimer = &timer; + Canvas* pDescriptionTextCanvas = null; + + if (onTimer == _EditPresenter::__pTitleSlidingTimer) + { + if (!IsFocused()) + { + _EditPresenter::StopTitleSlidingTimer(); + __isTitleSliding = false; + return; + } + + FloatRectangle tempDescriptionTextRect = __descriptionTextRect; + tempDescriptionTextRect.x = 0.0f; + tempDescriptionTextRect.y = 0.0f; + + pDescriptionTextCanvas = __pDescriptionTextVisualElement->GetCanvasN(); + SysTryReturnVoidResult(NID_UI_CTRL, pDescriptionTextCanvas, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pDescriptionTextCanvas is invalid!"); + + pDescriptionTextCanvas->SetBackgroundColor(Color(0)); + pDescriptionTextCanvas->Clear(); + __pDescriptionTextTextObject->SetBounds(tempDescriptionTextRect); + __pDescriptionTextTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pDescriptionTextCanvas)); + Rectangle descriptionTextRect = _CoordinateSystemUtils::ConvertToInteger(tempDescriptionTextRect); + pDescriptionTextCanvas->Show(descriptionTextRect); + + delete pDescriptionTextCanvas; + + _EditPresenter::StartTitleSlidingTimer(); + __isTitleSliding = true; + } + else + { + _EditPresenter::OnTimerExpired(timer); + } +} + +result +_TokenEditPresenter::ChangeInternalLayout(_ControlOrientation orientation) +{ + result r = E_SUCCESS; + + __scrollValue = 0.0f; + __maxScrollValue = 0.0f; + int tokenBottomMargin = 0; + float newScrollValue = 0.0f; + + FloatRectangle windowBounds = GetInitialBoundsF(); + + GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin); + + r = CalculateTokenPositionFromIndex(0); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + r = SetInitialBounds(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + if (__isEditingToken) + { + if (__edittingTokenIndex >= 0 && __edittingTokenIndex < GetTokenCount()) + { + String inputTokenString = GetText(); + String replacementString = inputTokenString; + bool enable = false; + + __pTokenEdit->ProcessTokenFiltering(inputTokenString, replacementString, enable); + if (enable) + { + inputTokenString = replacementString; + } + + if (inputTokenString.GetLength() > 0) + { + int index = __edittingTokenIndex; + RemoveTokenAt(__edittingTokenIndex, true); + InsertTokenAt(index, inputTokenString); + } + } + } + + if (IsFocused()) + { + r = AdjustFlexibleHeight(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + r = CheckTokenScrolling(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + } + else + { + if (!__autoShrink) + { + r = AdjustFlexibleHeight(); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + windowBounds = __pTokenEdit->GetBoundsF(); + } + + newScrollValue = GetTextBoundsF().y + GetTextBoundsF().height - __scrollValue + tokenBottomMargin - windowBounds.height; + if (newScrollValue > 0.0f) + { + __maxScrollValue = newScrollValue; + __isNeedToScroll = true; + } + } + return r; +} + +result +_TokenEditPresenter::ChangeLayout(_ControlOrientation orientation) +{ + result r = E_SUCCESS; + + r = _EditPresenter::ChangeLayout(orientation); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating."); + + r = ChangeInternalLayout(orientation); + + return r; +} }}} //Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_Toolbar.cpp b/src/ui/controls/FUiCtrl_Toolbar.cpp old mode 100644 new mode 100755 index 5c49457..da859e5 --- a/src/ui/controls/FUiCtrl_Toolbar.cpp +++ b/src/ui/controls/FUiCtrl_Toolbar.cpp @@ -21,9 +21,12 @@ #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_AccessibilityContainer.h" #include "FUi_AccessibilityElement.h" #include "FUi_AccessibilityManager.h" +#include "FUi_IAccessibilityListener.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_TouchLongPressGestureDetector.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_ActionEvent.h" @@ -37,6 +40,31 @@ using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; using namespace Tizen::Ui; +namespace +{ +class FooterItemAccessibilityListener + : public _IAccessibilityListener +{ +public: + FooterItemAccessibilityListener(void){} + virtual ~FooterItemAccessibilityListener(void){} + virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;} + virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) + { + _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM_OF_CONTENTS); + return true; + } +}; +FooterItemAccessibilityListener footerItemAccessibilityListener; +} + namespace Tizen { namespace Ui { namespace Controls { @@ -48,20 +76,21 @@ _Toolbar::_Toolbar(void) , __pActionEventListener(null) , __pBackEventListener(null) , __pLongPressGesture(null) + , __pFlickGesture(null) , __pToolbarBackgroundBitmap(null) , __pTitleIcon(null) , __titleText(L"") , __descriptionText(L"") , __titleTextAlignment(ALIGNMENT_LEFT) , __pItems(null) - , __pAnimationFrameList(null) + , __pTitleBadgeIcon(null) , __backActionId(-1) , __itemCount(0) , __style(TOOLBAR_TITLE) , __transparent(false) , __isUserBackgroundBitmap(false) - , __titleTextArea(Rectangle(0, 0, 0, 0)) - , __itemArea(Rectangle(0, 0, 0, 0)) + , __titleTextArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __itemArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __pTitleTextElement(null) { _AccessibilityContainer* pContainer = null; @@ -74,6 +103,7 @@ _Toolbar::_Toolbar(void) for (int i = 0; i < TOOLBAR_ANIMATION_POSITION_MAX; i++) { __pAnimation[i] = null; + __pAnimationFrameList[i] = null; } Color bgColor; @@ -144,6 +174,15 @@ _Toolbar::~_Toolbar(void) __pLongPressGesture = null; } + if (__pFlickGesture != null) + { + __pFlickGesture->RemoveGestureListener(*this); + RemoveGestureDetector(*__pFlickGesture); + + delete __pFlickGesture; + __pFlickGesture = null; + } + if (__pToolbarBackgroundBitmap) { delete __pToolbarBackgroundBitmap; @@ -156,10 +195,15 @@ _Toolbar::~_Toolbar(void) __pTitleIcon = null; } - if (__pAnimationFrameList) + for (int i = 0; i < TOOLBAR_ANIMATION_POSITION_MAX; i++) { - delete __pAnimationFrameList; - __pAnimationFrameList = null; + if (__pAnimationFrameList[i]) + { + __pAnimationFrameList[i]->RemoveAll(true); + + delete __pAnimationFrameList[i]; + __pAnimationFrameList[i] = null; + } } if (__pAnimation[TOOLBAR_ANIMATION_POSITION_TITLE]) @@ -169,6 +213,14 @@ _Toolbar::~_Toolbar(void) __pAnimation[TOOLBAR_ANIMATION_POSITION_TITLE] = null; } + if (__pTitleBadgeIcon) + { + DetachChild(*__pTitleBadgeIcon); + + delete __pTitleBadgeIcon; + __pTitleBadgeIcon = null; + } + if (__pTitleTextElement) { __pTitleTextElement->Activate(false); @@ -198,6 +250,12 @@ _Toolbar::Initialize(bool header) return E_SUCCESS; } +bool +_Toolbar::IsHeader(void) +{ + return __header; +} + result _Toolbar::InitToolbarColor(void) { @@ -222,7 +280,21 @@ _Toolbar::InitToolbarColor(void) GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, __itemTransTextColor[_BUTTON_STATUS_HIGHLIGHTED]); //GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TRANSLUCENT_TEXT_SELECTED, __itemTransTextColor[_BUTTON_STATUS_SELECTED]); } - else + else if (__style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_BG_NORMAL, __itemTransBackgroundColor[_BUTTON_STATUS_NORMAL]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_BG_DISABLED, __itemTransBackgroundColor[_BUTTON_STATUS_DISABLED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_BG_PRESSED, __itemTransBackgroundColor[_BUTTON_STATUS_PRESSED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, __itemTransBackgroundColor[_BUTTON_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_BG_SELECTED, __itemTransBackgroundColor[_BUTTON_STATUS_SELECTED]); + + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_TEXT_NORMAL, __itemTransTextColor[_BUTTON_STATUS_NORMAL]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_TEXT_DISABLED, __itemTransTextColor[_BUTTON_STATUS_DISABLED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_TEXT_PRESSED, __itemTransTextColor[_BUTTON_STATUS_PRESSED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, __itemTransTextColor[_BUTTON_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TRANSLUCENT_TEXT_SELECTED, __itemTransTextColor[_BUTTON_STATUS_SELECTED]); + } + else // TOOLBAR_TITLE, TOOLBAR_HEADER_SEGMENTED, TOOLBAR_HEADER_SEGMENTED_WITH_TITLE { GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TRANSLUCENT_BG_NORMAL, __itemTransBackgroundColor[_BUTTON_STATUS_NORMAL]); GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TRANSLUCENT_BG_DISABLED, __itemTransBackgroundColor[_BUTTON_STATUS_DISABLED]); @@ -308,7 +380,51 @@ _Toolbar::InitToolbarColor(void) // GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TEXT_SELECTED, __itemTextColor[_BUTTON_STATUS_SELECTED]); //} } - else + else if (__style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE) // header + { + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_BG_NORMAL, __itemBackgroundColor[_BUTTON_STATUS_NORMAL]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_DISABLED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_BG_DISABLED, __itemBackgroundColor[_BUTTON_STATUS_DISABLED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_PRESSED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_BG_PRESSED, __itemBackgroundColor[_BUTTON_STATUS_PRESSED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_BG_HIGHLIGHTED, __itemBackgroundColor[_BUTTON_STATUS_HIGHLIGHTED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_SELECTED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_BG_SELECTED, __itemBackgroundColor[_BUTTON_STATUS_SELECTED]); + } + + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_NORMAL]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TEXT_NORMAL, __itemTextColor[_BUTTON_STATUS_NORMAL]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_DISABLED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TEXT_DISABLED, __itemTextColor[_BUTTON_STATUS_DISABLED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_PRESSED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TEXT_PRESSED, __itemTextColor[_BUTTON_STATUS_PRESSED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TEXT_HIGHLIGHTED, __itemTextColor[_BUTTON_STATUS_HIGHLIGHTED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_SELECTED]) + { + GET_COLOR_CONFIG(HEADER::TAB_ITEM_TEXT_SELECTED, __itemTextColor[_BUTTON_STATUS_SELECTED]); + } + } + else // TOOLBAR_TITLE, TOOLBAR_HEADER_SEGMENTED, TOOLBAR_HEADER_SEGMENTED_WITH_TITLE, { if (!__isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL]) { @@ -406,7 +522,21 @@ _Toolbar::InitToolbarColor(void) GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, __itemTransTextColor[_BUTTON_STATUS_HIGHLIGHTED]); //GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TRANSLUCENT_TEXT_SELECTED, __itemTransTextColor[_BUTTON_STATUS_SELECTED]); } - else + else if (__style == TOOLBAR_TAB) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_BG_NORMAL, __itemTransBackgroundColor[_BUTTON_STATUS_NORMAL]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_BG_DISABLED, __itemTransBackgroundColor[_BUTTON_STATUS_DISABLED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_BG_PRESSED, __itemTransBackgroundColor[_BUTTON_STATUS_PRESSED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, __itemTransBackgroundColor[_BUTTON_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_BG_SELECTED, __itemTransBackgroundColor[_BUTTON_STATUS_SELECTED]); + + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_TEXT_NORMAL, __itemTransTextColor[_BUTTON_STATUS_NORMAL]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_TEXT_DISABLED, __itemTransTextColor[_BUTTON_STATUS_DISABLED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_TEXT_PRESSED, __itemTransTextColor[_BUTTON_STATUS_PRESSED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, __itemTransTextColor[_BUTTON_STATUS_HIGHLIGHTED]); + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TRANSLUCENT_TEXT_SELECTED, __itemTransTextColor[_BUTTON_STATUS_SELECTED]); + } + else // TOOLBAR_SEGMENTED { GET_COLOR_CONFIG(FOOTER::SEGMENTED_ITEM_TRANSLUCENT_BG_NORMAL, __itemTransBackgroundColor[_BUTTON_STATUS_NORMAL]); GET_COLOR_CONFIG(FOOTER::SEGMENTED_ITEM_TRANSLUCENT_BG_DISABLED, __itemTransBackgroundColor[_BUTTON_STATUS_DISABLED]); @@ -489,7 +619,51 @@ _Toolbar::InitToolbarColor(void) // GET_COLOR_CONFIG(FOOTER::BUTTON_ITEM_TEXT_SELECTED, __itemTextColor[_BUTTON_STATUS_SELECTED]); //} } - else + else if (__style == TOOLBAR_TAB) + { + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_BG_NORMAL, __itemBackgroundColor[_BUTTON_STATUS_NORMAL]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_DISABLED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_BG_DISABLED, __itemBackgroundColor[_BUTTON_STATUS_DISABLED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_PRESSED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_BG_PRESSED, __itemBackgroundColor[_BUTTON_STATUS_PRESSED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_BG_HIGHLIGHTED, __itemBackgroundColor[_BUTTON_STATUS_HIGHLIGHTED]); + } + if (!__isItemBgColorSetByUser[_BUTTON_STATUS_SELECTED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_BG_SELECTED, __itemBackgroundColor[_BUTTON_STATUS_SELECTED]); + } + + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_NORMAL]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TEXT_NORMAL, __itemTextColor[_BUTTON_STATUS_NORMAL]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_DISABLED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TEXT_DISABLED, __itemTextColor[_BUTTON_STATUS_DISABLED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_PRESSED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TEXT_PRESSED, __itemTextColor[_BUTTON_STATUS_PRESSED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TEXT_HIGHLIGHTED, __itemTextColor[_BUTTON_STATUS_HIGHLIGHTED]); + } + if (!__isItemTextColorSetByUser[_BUTTON_STATUS_SELECTED]) + { + GET_COLOR_CONFIG(FOOTER::TAB_ITEM_TEXT_SELECTED, __itemTextColor[_BUTTON_STATUS_SELECTED]); + } + } + else // TOOLBAR_SEGMENTED { if (!__isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL]) { @@ -593,6 +767,23 @@ _Toolbar::InitializeLongPressGesture(void) } result +_Toolbar::InitializeFlickGesture(void) +{ + result r = E_SUCCESS; + + __pFlickGesture = new (std::nothrow) _TouchFlickGestureDetector(); + SysTryReturn(NID_UI_CTRL, __pFlickGesture, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create flick gesture."); + + r = AddGestureDetector(*__pFlickGesture); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture detector", GetErrorMessage(r)); + + r = __pFlickGesture->AddGestureListener(*(dynamic_cast<_ITouchFlickGestureEventListener*>(this))); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to add gesture listener", GetErrorMessage(r)); + + return r; +} + +result _Toolbar::Construct(void) { result r = E_SUCCESS; @@ -620,7 +811,7 @@ _Toolbar::AddItem(_Button* pButton) RearrangeItems(); - AddAccessibilityItem(pButton); + AddAccessibilityElement(pButton); return E_SUCCESS; } @@ -658,6 +849,12 @@ _Toolbar::GetButton(ToolbarButton position) const return __pButtonItems[position]; } +_Label* +_Toolbar::GetTitleBadgeIcon(void) const +{ + return __pTitleBadgeIcon; +} + Color _Toolbar::GetButtonColor(_ButtonStatus status) const { @@ -666,19 +863,19 @@ _Toolbar::GetButtonColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalButtonColor"); + color = GetProperty(L"normalButtonColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledButtonColor"); + color = GetProperty(L"disabledButtonColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedButtonColor"); + color = GetProperty(L"pressedButtonColor"); break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedButtonColor"); + color = GetProperty(L"highlightedButtonColor"); break; default: - color = GetProperty("normalButtonColor"); + color = GetProperty(L"normalButtonColor"); break; } @@ -699,19 +896,19 @@ _Toolbar::GetButtonTextColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalButtonTextColor"); + color = GetProperty(L"normalButtonTextColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledButtonTextColor"); + color = GetProperty(L"disabledButtonTextColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedButtonTextColor"); + color = GetProperty(L"pressedButtonTextColor"); break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedButtonTextColor"); + color = GetProperty(L"highlightedButtonTextColor"); break; default: - color = GetProperty("normalButtonTextColor"); + color = GetProperty(L"normalButtonTextColor"); break; } @@ -721,7 +918,7 @@ _Toolbar::GetButtonTextColor(_ButtonStatus status) const Color _Toolbar::GetColor(void) const { - Variant color = GetProperty("color"); + Variant color = GetProperty(L"color"); return color.ToColor(); } @@ -729,7 +926,7 @@ _Toolbar::GetColor(void) const String _Toolbar::GetDescriptionText(void) const { - Variant text = GetProperty("descriptionText"); + Variant text = GetProperty(L"descriptionText"); return text.ToString(); } @@ -737,7 +934,7 @@ _Toolbar::GetDescriptionText(void) const Color _Toolbar::GetDescriptionTextColor(void) const { - Variant color = GetProperty("descriptionTextColor"); + Variant color = GetProperty(L"descriptionTextColor"); return color.ToColor(); } @@ -779,22 +976,22 @@ _Toolbar::GetItemColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalItemColor"); + color = GetProperty(L"normalItemColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledItemColor"); + color = GetProperty(L"disabledItemColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedItemColor"); + color = GetProperty(L"pressedItemColor"); break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedItemColor"); + color = GetProperty(L"highlightedItemColor"); break; case _BUTTON_STATUS_SELECTED: - color = GetProperty("selectedItemColor"); + color = GetProperty(L"selectedItemColor"); break; default: - color = GetProperty("normalItemColor"); + color = GetProperty(L"normalItemColor"); break; } @@ -808,7 +1005,7 @@ _Toolbar::GetItemCount(void) const } int -_Toolbar::GetItemIndexFromPosition(const Point& point) const +_Toolbar::GetItemIndexFromPosition(const FloatPoint& point) const { if (__itemCount <= 0) { @@ -817,7 +1014,7 @@ _Toolbar::GetItemIndexFromPosition(const Point& point) const for (int i = 0; i < __itemCount; i++) { - Rectangle bounds = __pItems.at(i)->GetBounds(); + FloatRectangle bounds = __pItems.at(i)->GetBoundsF(); if (bounds.Contains(point) && __pItems.at(i)->GetVisibleState() == true) { @@ -849,22 +1046,22 @@ _Toolbar::GetItemTextColor(_ButtonStatus status) const switch (status) { case _BUTTON_STATUS_NORMAL: - color = GetProperty("normalItemTextColor"); + color = GetProperty(L"normalItemTextColor"); break; case _BUTTON_STATUS_DISABLED: - color = GetProperty("disabledItemTextColor"); + color = GetProperty(L"disabledItemTextColor"); break; case _BUTTON_STATUS_PRESSED: - color = GetProperty("pressedItemTextColor"); + color = GetProperty(L"pressedItemTextColor"); break; case _BUTTON_STATUS_HIGHLIGHTED: - color = GetProperty("highlightedItemTextColor"); + color = GetProperty(L"highlightedItemTextColor"); break; case _BUTTON_STATUS_SELECTED: - color = GetProperty("selectedItemTextColor"); + color = GetProperty(L"selectedItemTextColor"); break; default: - color = GetProperty("normalItemTextColor"); + color = GetProperty(L"normalItemTextColor"); break; } @@ -897,14 +1094,14 @@ _Toolbar::GetTitleIcon(void) const String _Toolbar::GetTitleText(void) const { - Variant text = GetProperty("titleText"); + Variant text = GetProperty(L"titleText"); return text.ToString(); } Color _Toolbar::GetTitleTextColor(void) const { - Variant color = GetProperty("titleTextColor"); + Variant color = GetProperty(L"titleTextColor"); return color.ToColor(); } @@ -976,7 +1173,8 @@ _Toolbar::InsertItemAt(int itemIndex, _Button* pButton) ApplyUserGUI(TOOLBAR_ITEM, pButton); RearrangeItems(); - AddAccessibilityItem(pButton); + + AddAccessibilityElement(pButton); return E_SUCCESS; } @@ -1022,6 +1220,12 @@ _Toolbar::MoveItem(const int srcIndex, const int destIndex) for (int i = 0; i < __itemCount; i++) { __pItems.at(i)->SetButtonStatus(_BUTTON_STATUS_NORMAL); + _AccessibilityElement* pElement = __pItems.at(i)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } } SetItemSelected(destIndex, true); @@ -1260,56 +1464,47 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton) { SysTryReturnResult(NID_UI_CTRL, (pButton), E_INVALID_ARG, "[E_INVALID_ARG] The pButton is invalid."); - int buttonWidth = pButton->GetSize().width; + float buttonWidth = pButton->GetSizeF().width; - int toolbarWidth = GetBounds().width; + float toolbarWidth = GetBoundsF().width; if (CalculateMinimumToolbarWidth() > toolbarWidth) { toolbarWidth = CalculateMinimumToolbarWidth(); } - int horizontalMargin = 0; - int verticalMargin = 0; + float horizontalMargin = 0.0f; + float verticalMargin = 0.0f; if (__header == true && __style != TOOLBAR_TEXT) { - int buttonItemGap = 0; - int buttonTopMargin = 0; - - if (__style == TOOLBAR_TITLE) - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), buttonTopMargin); - } - else if (__style == TOOLBAR_HEADER_SEGMENTED) - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN_OF_SEGMENTED, GetOrientation(), buttonTopMargin); - } + float buttonItemGap = 0.0f; + float buttonTopMargin = 0.0f; + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), buttonTopMargin); GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_GAP, GetOrientation(), buttonItemGap); - switch (position) { case RIGHT_BUTTON: if (__pButtonItems[LEFT_BUTTON]) { - pButton->SetPosition(Point(toolbarWidth - buttonWidth , buttonTopMargin)); - __pButtonItems[LEFT_BUTTON]->SetPosition(Point(toolbarWidth - buttonWidth *2 - buttonItemGap, buttonTopMargin)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth , buttonTopMargin)); + __pButtonItems[LEFT_BUTTON]->SetPosition(FloatPoint(toolbarWidth - buttonWidth *2 - buttonItemGap, buttonTopMargin)); } else { - pButton->SetPosition(Point(toolbarWidth - buttonWidth , buttonTopMargin)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth , buttonTopMargin)); } break; case LEFT_BUTTON: if (__pButtonItems[RIGHT_BUTTON]) { - pButton->SetPosition(Point(toolbarWidth - buttonWidth * 2 - buttonItemGap, buttonTopMargin)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth * 2 - buttonItemGap, buttonTopMargin)); } else { - pButton->SetPosition(Point(toolbarWidth - buttonWidth, buttonTopMargin)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth, buttonTopMargin)); } break; @@ -1322,15 +1517,15 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton) switch (position) { case LEFT_BUTTON: - pButton->SetPosition(Point(horizontalMargin, verticalMargin)); + pButton->SetPosition(FloatPoint(horizontalMargin, verticalMargin)); break; case RIGHT_BUTTON: - pButton->SetPosition(Point(toolbarWidth - buttonWidth - horizontalMargin, verticalMargin)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth - horizontalMargin, verticalMargin)); break; case BACK_BUTTON: - pButton->SetPosition(Point(toolbarWidth - buttonWidth, 0)); + pButton->SetPosition(FloatPoint(toolbarWidth - buttonWidth, 0.0f)); if (__pBackEventListener) { pButton->AddActionEventListener(*__pBackEventListener); @@ -1339,7 +1534,7 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton) break; case MIDDLE_BUTTON: - pButton->SetPosition(Point((toolbarWidth - buttonWidth - horizontalMargin)/2, verticalMargin)); + pButton->SetPosition(FloatPoint((toolbarWidth - buttonWidth - horizontalMargin)/2, verticalMargin)); break; default: @@ -1390,7 +1585,7 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton) } RearrangeItems(); - + AddAccessibilityElement(position, pButton); return E_SUCCESS; } @@ -1401,23 +1596,23 @@ _Toolbar::SetButtonColor(_ButtonStatus status, const Color& color) { case _BUTTON_STATUS_NORMAL: __isButtonBgColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalButtonColor", Variant(color)); + return SetProperty(L"normalButtonColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: __isButtonBgColorSetByUser[_BUTTON_STATUS_DISABLED] = true; - return SetProperty("disabledButtonColor", Variant(color)); + return SetProperty(L"disabledButtonColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: __isButtonBgColorSetByUser[_BUTTON_STATUS_PRESSED] = true; - return SetProperty("pressedButtonColor", Variant(color)); + return SetProperty(L"pressedButtonColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: __isButtonBgColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED] = true; - return SetProperty("highlightedButtonColor", Variant(color)); + return SetProperty(L"highlightedButtonColor", Variant(color)); break; default: __isButtonBgColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalButtonColor", Variant(color)); + return SetProperty(L"normalButtonColor", Variant(color)); break; } } @@ -1431,10 +1626,22 @@ _Toolbar::SetButtonEnabled(ToolbarButton position, bool enabled) if (enabled) { __pButtonItems[position]->SetButtonStatus(_BUTTON_STATUS_NORMAL); + _AccessibilityElement* pElement = __pButtonItems[position]->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } } else { __pButtonItems[position]->SetButtonStatus(_BUTTON_STATUS_DISABLED); + _AccessibilityElement* pElement = __pButtonItems[position]->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } } return E_SUCCESS; @@ -1447,23 +1654,23 @@ _Toolbar::SetButtonTextColor(_ButtonStatus status, const Color& color) { case _BUTTON_STATUS_NORMAL: __isButtonTextColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalButtonTextColor", Variant(color)); + return SetProperty(L"normalButtonTextColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: __isButtonTextColorSetByUser[_BUTTON_STATUS_DISABLED] = true; - return SetProperty("disabledButtonTextColor", Variant(color)); + return SetProperty(L"disabledButtonTextColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: __isButtonTextColorSetByUser[_BUTTON_STATUS_PRESSED] = true; - return SetProperty("pressedButtonTextColor", Variant(color)); + return SetProperty(L"pressedButtonTextColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: __isButtonTextColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED] = true; - return SetProperty("highlightedButtonTextColor", Variant(color)); + return SetProperty(L"highlightedButtonTextColor", Variant(color)); break; default: __isButtonTextColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalButtonTextColor", Variant(color)); + return SetProperty(L"normalButtonTextColor", Variant(color)); break; } } @@ -1496,14 +1703,23 @@ _Toolbar::SetButtonBadgeIcon(ToolbarButton position, const Bitmap* pBadgeIcon) return E_SUCCESS; } - Rectangle bounds = __pButtonItems[position]->GetBounds(); + FloatRectangle bounds = __pButtonItems[position]->GetBoundsF(); + + float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF(); + float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF(); + + bounds.y = bounds.y + topTouchMargin; + bounds.width = bounds.width - rightTouchMargin; + + float height = 0.0f; + + GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT_WITH_BUTTON, GetOrientation(), height); _Label* pBadgeIconLabel = _Label::CreateLabelN(); if (pBadgeIconLabel) { - pBadgeIconLabel->SetBounds(Rectangle((bounds.width - pBadgeIcon->GetWidth()), 0, - pBadgeIcon->GetWidth(), pBadgeIcon->GetHeight())); + pBadgeIconLabel->SetBounds(FloatRectangle(bounds.width - height, bounds.y, height, height)); pBadgeIconLabel->SetBackgroundBitmap(*pBadgeIcon); __pButtonItems[position]->AttachChild(*pBadgeIconLabel); @@ -1587,7 +1803,12 @@ _Toolbar::SetButtonNumberedBadgeIcon(ToolbarButton position, int number) Color badgeIconTextColor; GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconBitmap); - GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconEffectBitmap); + + bool themeBadgeNormalBackgroundBitmap = IS_CUSTOM_BITMAP(HEADER::BADGE_ICON_BG_NORMAL); + if (!themeBadgeNormalBackgroundBitmap) + { + GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconEffectBitmap); + } GET_COLOR_CONFIG(HEADER::BADGE_ICON_BG_NORMAL, badgeIconBgColor); GET_COLOR_CONFIG(HEADER::BADGE_ICON_TEXT_NORMAL, badgeIconTextColor); @@ -1613,7 +1834,7 @@ _Toolbar::SetButtonNumberedBadgeIcon(ToolbarButton position, int number) pLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER); pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); pLabel->SetTextColor(badgeIconTextColor); - pLabel->SetMargin(0, 0); + pLabel->SetMargin(10, 0, 5, 0); __pButtonItems[position]->AttachChild(*pLabel); __pButtonItems[position]->SetChildAlwaysOnTop(*pLabel); @@ -1623,7 +1844,15 @@ _Toolbar::SetButtonNumberedBadgeIcon(ToolbarButton position, int number) SysTryReturnResult(NID_UI_CTRL, (existingBadgeIcon), E_INVALID_STATE, "[E_INVALID_STATE] Failed to set a BadgeIcon."); - Rectangle bounds = __pButtonItems[position]->GetBounds(); + FloatRectangle bounds = __pButtonItems[position]->GetBoundsF(); + + float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF(); + float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF(); + + bounds.y = bounds.y + topTouchMargin; + bounds.width = bounds.width - rightTouchMargin; + + // SetButtonNumberedBadgeIcon Integer tempNumber(number); @@ -1631,40 +1860,40 @@ _Toolbar::SetButtonNumberedBadgeIcon(ToolbarButton position, int number) { existingBadgeIcon->SetText(tempNumber.ToString()); - int fontSize = 0; - int height = 0; - int width = 0; - - GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE, GetOrientation(), fontSize); - GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT, GetOrientation(), height); + float fontSize = 0.0f; + float height = 0.0f; + float width = 0.0f; - existingBadgeIcon->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL); + GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT_WITH_BUTTON, GetOrientation(), height); if (number < 10) { + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE_WITH_BUTTON, GetOrientation(), fontSize); GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_1DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } else if (number < 100) { - GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE_WITH_BUTTON, GetOrientation(), fontSize); + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_1DIGIT, GetOrientation(), width); } else if (number < 1000) { - GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_3DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE_WITH_BUTTON, GetOrientation(), fontSize); + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); } else if (number < 10000) { - GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_4DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE_WITH_BUTTON, GetOrientation(), fontSize); + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); } else { - GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_5DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE_WITH_BUTTON_2, GetOrientation(), fontSize); + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); } + + existingBadgeIcon->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL); + existingBadgeIcon->SetBounds(FloatRectangle(bounds.width - width, bounds.y, width, height)); } } @@ -1674,19 +1903,19 @@ _Toolbar::SetButtonNumberedBadgeIcon(ToolbarButton position, int number) result _Toolbar::SetColor(const Color& color) { - return SetProperty("color", Variant(color)); + return SetProperty(L"color", Variant(color)); } result _Toolbar::SetDescriptionText(const String& text) { - return SetProperty("descriptionText", Variant(text)); + return SetProperty(L"descriptionText", Variant(text)); } result _Toolbar::SetDescriptionTextColor(const Color& color) { - return SetProperty("descriptionTextColor", Variant(color)); + return SetProperty(L"descriptionTextColor", Variant(color)); } result @@ -1719,13 +1948,13 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) __pItems.at(itemIndex)->SetActionId(pButton->GetActionId()); Bitmap* pIconBitmap = null; - Point iconPosition = Point(0,0); + FloatPoint iconPosition(0.0f, 0.0f); pIconBitmap = const_cast(pButton->GetBitmap(_BUTTON_STATUS_NORMAL)); if (pIconBitmap) { - iconPosition = pButton->GetBitmapPosition(_BUTTON_STATUS_NORMAL); + iconPosition = pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_NORMAL, iconPosition, *pIconBitmap); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_PRESSED, iconPosition, *pIconBitmap); @@ -1738,7 +1967,7 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) if (pIconBitmap) { - iconPosition = pButton->GetBitmapPosition(_BUTTON_STATUS_PRESSED); + iconPosition = pButton->GetBitmapPositionF(_BUTTON_STATUS_PRESSED); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_PRESSED, iconPosition, *pIconBitmap); } @@ -1747,7 +1976,7 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) if (pIconBitmap) { - iconPosition = pButton->GetBitmapPosition(_BUTTON_STATUS_SELECTED); + iconPosition = pButton->GetBitmapPositionF(_BUTTON_STATUS_SELECTED); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_SELECTED, iconPosition, *pIconBitmap); } @@ -1756,7 +1985,7 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) if (pIconBitmap) { - iconPosition = pButton->GetBitmapPosition(_BUTTON_STATUS_HIGHLIGHTED); + iconPosition = pButton->GetBitmapPositionF(_BUTTON_STATUS_HIGHLIGHTED); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, iconPosition, *pIconBitmap); } @@ -1765,7 +1994,7 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) if (pIconBitmap) { - iconPosition = pButton->GetBitmapPosition(_BUTTON_STATUS_DISABLED); + iconPosition = pButton->GetBitmapPositionF(_BUTTON_STATUS_DISABLED); __pItems.at(itemIndex)->SetBitmap(_BUTTON_STATUS_DISABLED, iconPosition, *pIconBitmap); } @@ -1774,7 +2003,7 @@ _Toolbar::SetItemAt(int itemIndex, const _Button* pButton) RearrangeItems(); - RealignIcon(__pItems.at(itemIndex)); + RealignItem(__pItems.at(itemIndex)); delete pButton; @@ -1808,14 +2037,17 @@ _Toolbar::SetItemBadgeIcon(int itemIndex, const Bitmap* pBadgeIcon) return E_SUCCESS; } - Rectangle bounds = __pItems.at(itemIndex)->GetBounds(); + FloatRectangle bounds = __pItems.at(itemIndex)->GetBoundsF(); _Label* pBadgeIconLabel = _Label::CreateLabelN(); + float height = 0.0f; + + GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT, GetOrientation(), height); + if (pBadgeIconLabel) { - pBadgeIconLabel->SetBounds(Rectangle((bounds.width - pBadgeIcon->GetWidth()), 0, - pBadgeIcon->GetWidth(), pBadgeIcon->GetHeight())); + pBadgeIconLabel->SetBounds(FloatRectangle(bounds.width - height, 0.0f, height, height)); pBadgeIconLabel->SetBackgroundBitmap(*pBadgeIcon); __pItems.at(itemIndex)->AttachChild(*pBadgeIconLabel); @@ -1832,27 +2064,27 @@ _Toolbar::SetItemColor(_ButtonStatus status, const Color& color) { case _BUTTON_STATUS_NORMAL: __isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalItemColor", Variant(color)); + return SetProperty(L"normalItemColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: __isItemBgColorSetByUser[_BUTTON_STATUS_DISABLED] = true; - return SetProperty("disabledItemColor", Variant(color)); + return SetProperty(L"disabledItemColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: __isItemBgColorSetByUser[_BUTTON_STATUS_PRESSED] = true; - return SetProperty("pressedItemColor", Variant(color)); + return SetProperty(L"pressedItemColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: __isItemBgColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED] = true; - return SetProperty("highlightedItemColor", Variant(color)); + return SetProperty(L"highlightedItemColor", Variant(color)); break; case _BUTTON_STATUS_SELECTED: __isItemBgColorSetByUser[_BUTTON_STATUS_SELECTED] = true; - return SetProperty("selectedItemColor", Variant(color)); + return SetProperty(L"selectedItemColor", Variant(color)); break; default: __isItemBgColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalItemColor", Variant(color)); + return SetProperty(L"normalItemColor", Variant(color)); break; } } @@ -1865,10 +2097,22 @@ _Toolbar::SetItemEnabled(int itemIndex, bool enabled) if (enabled) { + _AccessibilityElement* pElement = __pItems.at(itemIndex)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } return __pItems.at(itemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL); } else { + _AccessibilityElement* pElement = __pItems.at(itemIndex)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(true); + } return __pItems.at(itemIndex)->SetButtonStatus(_BUTTON_STATUS_DISABLED); } @@ -1922,7 +2166,12 @@ _Toolbar::SetItemNumberedBadgeIcon(int itemIndex, int number) Color badgeIconTextColor; GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconBitmap); - GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconEffectBitmap); + + bool themeBadgeNormalBackgroundBitmap = IS_CUSTOM_BITMAP(HEADER::BADGE_ICON_BG_NORMAL); + if (!themeBadgeNormalBackgroundBitmap) + { + GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconEffectBitmap); + } GET_COLOR_CONFIG(HEADER::BADGE_ICON_BG_NORMAL, badgeIconBgColor); GET_COLOR_CONFIG(HEADER::BADGE_ICON_TEXT_NORMAL, badgeIconTextColor); @@ -1945,18 +2194,20 @@ _Toolbar::SetItemNumberedBadgeIcon(int itemIndex, int number) delete pNumberedBadgeIconEffectBitmap; } - pLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER); + pLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT); pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); pLabel->SetTextColor(badgeIconTextColor); - pLabel->SetMargin(0, 0); + pLabel->SetMargin(0, 10); __pItems.at(itemIndex)->AttachChild(*pLabel); __pItems.at(itemIndex)->SetChildAlwaysOnTop(*pLabel); } + // SetItemNumberedBadgeIcon + _Label* existingBadgeIcon = dynamic_cast<_Label*>(__pItems.at(itemIndex)->GetChild(0)); - Rectangle bounds = __pItems.at(itemIndex)->GetBounds(); + FloatRectangle bounds = __pItems.at(itemIndex)->GetBoundsF(); Integer tempNumber(number); @@ -1964,9 +2215,9 @@ _Toolbar::SetItemNumberedBadgeIcon(int itemIndex, int number) { existingBadgeIcon->SetText(tempNumber.ToString()); - int fontSize = 0; - int height = 0; - int width = 0; + float fontSize = 0.0f; + float height = 0.0f; + float width = 0.0f; GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE, GetOrientation(), fontSize); GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT, GetOrientation(), height); @@ -1976,28 +2227,25 @@ _Toolbar::SetItemNumberedBadgeIcon(int itemIndex, int number) if (number < 10) { GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_1DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } else if (number < 100) { GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } else if (number < 1000) { GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_3DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } else if (number < 10000) { GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_4DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } else { GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_5DIGIT, GetOrientation(), width); - existingBadgeIcon->SetBounds(Rectangle(bounds.width - width, 0, width, height)); } + + existingBadgeIcon->SetBounds(FloatRectangle(bounds.width - width, 0.0f, width, height)); } } @@ -2020,10 +2268,16 @@ _Toolbar::SetItemSelected(int itemIndex, bool fire) r = __pToolbarPresenter->SetItemSelected(itemIndex); } - if (itemIndex != -1 && itemIndex == currentSelectedItemIndex && __pItems.at(itemIndex) != null) + if (itemIndex != -1 && itemIndex == currentSelectedItemIndex && __pItems.at(itemIndex) != null) // same item selected { __pItems.at(itemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, fire); __pItems.at(itemIndex)->Draw(); + _AccessibilityElement* pElement = __pItems.at(currentSelectedItemIndex)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L"Selected"); + pElement->SetHintDisabled(true); + } return r; } @@ -2038,6 +2292,12 @@ _Toolbar::SetItemSelected(int itemIndex, bool fire) if (__pItems.at(itemIndex) != null) { __pItems.at(itemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, fire); + _AccessibilityElement* pElement = __pItems.at(itemIndex)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L"Selected"); + pElement->SetHintDisabled(true); + } } if (__itemCount == 0 || __itemCount > TAB_ITEM_MAX || itemIndex == -1) @@ -2049,6 +2309,12 @@ _Toolbar::SetItemSelected(int itemIndex, bool fire) { __pItems.at(currentSelectedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL); __pItems.at(currentSelectedItemIndex)->Draw(); + _AccessibilityElement* pElement = __pItems.at(currentSelectedItemIndex)->GetAccessibilityContainer()->GetChildElement(0); + if (pElement) + { + pElement->SetStatus(L""); + pElement->SetHintDisabled(false); + } } if (__pItems.at(itemIndex) != null) @@ -2066,27 +2332,27 @@ _Toolbar::SetItemTextColor(_ButtonStatus status, const Color& color) { case _BUTTON_STATUS_NORMAL: __isItemTextColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalItemTextColor", Variant(color)); + return SetProperty(L"normalItemTextColor", Variant(color)); break; case _BUTTON_STATUS_DISABLED: __isItemTextColorSetByUser[_BUTTON_STATUS_DISABLED] = true; - return SetProperty("disabledItemTextColor", Variant(color)); + return SetProperty(L"disabledItemTextColor", Variant(color)); break; case _BUTTON_STATUS_PRESSED: __isItemTextColorSetByUser[_BUTTON_STATUS_PRESSED] = true; - return SetProperty("pressedItemTextColor", Variant(color)); + return SetProperty(L"pressedItemTextColor", Variant(color)); break; case _BUTTON_STATUS_HIGHLIGHTED: __isItemTextColorSetByUser[_BUTTON_STATUS_HIGHLIGHTED] = true; - return SetProperty("highlightedItemTextColor", Variant(color)); + return SetProperty(L"highlightedItemTextColor", Variant(color)); break; case _BUTTON_STATUS_SELECTED: __isItemTextColorSetByUser[_BUTTON_STATUS_SELECTED] = true; - return SetProperty("selectedItemTextColor", Variant(color)); + return SetProperty(L"selectedItemTextColor", Variant(color)); break; default: __isItemTextColorSetByUser[_BUTTON_STATUS_NORMAL] = true; - return SetProperty("normalItemTextColor", Variant(color)); + return SetProperty(L"normalItemTextColor", Variant(color)); break; } } @@ -2114,11 +2380,21 @@ _Toolbar::SetStyle(ToolbarStyle style) __descriptionText = L""; - if(__pTitleTextElement) + if (__style == TOOLBAR_TITLE || __style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) { - __pTitleTextElement->SetLabel(L""); + if(__pTitleTextElement) + { + __pTitleTextElement->SetLabel(L""); + } + } + else + { + if(__pTitleTextElement) + { + GetAccessibilityContainer()->RemoveElement(*__pTitleTextElement); + __pTitleTextElement = null; + } } - return E_SUCCESS; } @@ -2126,8 +2402,20 @@ _Toolbar::SetStyle(ToolbarStyle style) result _Toolbar::AdjustToolbarBounds(void) { - int width = 0; - int height = 0; + float width = 0.0f; + float height = 0.0f; + + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); + + if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + width = portraitSize.width; + } + else + { + width = landscapeSize.width; + } SetResizable(true); @@ -2135,20 +2423,26 @@ _Toolbar::AdjustToolbarBounds(void) { if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) { - GET_SHAPE_CONFIG(HEADER::WIDTH, GetOrientation(), width); + //GET_SHAPE_CONFIG(HEADER::WIDTH, GetOrientation(), width); GET_SHAPE_CONFIG(HEADER::TITLE_TOTAL_HEIGHT_WITH_SEGMENTED_ITEM, GetOrientation(), height); - SetSize(Dimension(width, height)); + SetSize(FloatDimension(width, height)); + } + else if (__style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) // sip & landscape => footer height + { + //GET_SHAPE_CONFIG(HEADER::WIDTH, GetOrientation(), width); + GET_SHAPE_CONFIG(FOOTER::HEIGHT, GetOrientation(), height); + SetSize(FloatDimension(width, height)); } else { - GET_SHAPE_CONFIG(HEADER::WIDTH, GetOrientation(), width); + //GET_SHAPE_CONFIG(HEADER::WIDTH, GetOrientation(), width); GET_SHAPE_CONFIG(HEADER::HEIGHT, GetOrientation(), height); - SetSize(Dimension(width, height)); + SetSize(FloatDimension(width, height)); } } else { - GET_SHAPE_CONFIG(FOOTER::WIDTH, GetOrientation(), width); + //GET_SHAPE_CONFIG(FOOTER::WIDTH, GetOrientation(), width); if (__style == TOOLBAR_SOFTKEY) { @@ -2159,7 +2453,7 @@ _Toolbar::AdjustToolbarBounds(void) GET_SHAPE_CONFIG(FOOTER::HEIGHT, GetOrientation(), height); } - SetSize(Dimension(width, height)); + SetSize(FloatDimension(width, height)); } SetResizable(false); @@ -2172,7 +2466,10 @@ _Toolbar::AdjustToolbarBounds(void) if (__header == false) { - Rectangle bounds(0, pParent->GetBounds().height - height, width, height); + FloatRectangle bounds(0.0f, pParent->GetClientBoundsF().y + pParent->GetClientBoundsF().height, width, height); + FloatDimension dimension(width, height); + dimension = pParent->TranslateSize(dimension); + bounds.height = dimension.height; pParent->SetFooterBounds(bounds); } @@ -2217,6 +2514,7 @@ _Toolbar::SetTitleIcon(const Bitmap& bitmap) result _Toolbar::SetTitleText(const String& text, HorizontalAlignment alignment) { + result r = E_SYSTEM; __titleText = text; __titleTextAlignment = alignment; @@ -2224,14 +2522,40 @@ _Toolbar::SetTitleText(const String& text, HorizontalAlignment alignment) if (__pToolbarPresenter) { - return __pToolbarPresenter->SetTitleText(__titleText, __titleTextAlignment); + r = __pToolbarPresenter->SetTitleText(__titleText, __titleTextAlignment); } - if(__pTitleTextElement) + if(likely(!(_AccessibilityManager::IsActivated()))) { - __pTitleTextElement->SetLabel(__titleText + L", " + __descriptionText); + return r ; } - return E_SUCCESS; + + if (__pTitleTextElement == null) + { + __pTitleTextElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnResult(NID_UI_CTRL, __pTitleTextElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + GetAccessibilityContainer()->SetPriority(ACCESSIBILITY_PRIORITY_TOP); + GetAccessibilityContainer()->AddElement(*__pTitleTextElement); + } + + if( __descriptionText.IsEmpty()) + { + __pTitleTextElement->SetLabel(__titleText); + __pTitleTextElement->SetBounds(FloatRectangle(__pToolbarPresenter->GetTitleTextBoundsF())); + } + else + { + __pTitleTextElement->SetLabel(__titleText + L"," + __descriptionText); + + FloatRectangle descriptionBounds = __pToolbarPresenter->GetDescriptionBoundsF(); + FloatRectangle titleBounds = __pToolbarPresenter->GetTitleTextBoundsF(); + + __pTitleTextElement->SetBounds(FloatRectangle(titleBounds.x, titleBounds.y, titleBounds.width, titleBounds.height + descriptionBounds.height)); + } + __pTitleTextElement->SetTrait(L"Title"); + __pTitleTextElement->SetName(L"HeaderTitleText"); + + return r; } result @@ -2334,11 +2658,11 @@ _Toolbar::SetTransparent(bool transparent) } result -_Toolbar::SetWaitingAnimationPosition(ToolbarAnimationPosition animationPos, int x, int y) +_Toolbar::SetWaitingAnimationPosition(ToolbarAnimationPosition animationPos, float x, float y) { if (__pAnimation[animationPos]) { - __pAnimation[animationPos]->SetPosition(Point(x, y)); + __pAnimation[animationPos]->SetPosition(FloatPoint(x, y)); } return E_SUCCESS; @@ -2398,189 +2722,113 @@ _Toolbar::OnAnimationStopped(const _Control& source) result _Toolbar::OnAttachedToMainTree(void) { - InitializeAccessibilityElement(); - return E_SUCCESS; } void -_Toolbar::InitializeAccessibilityElement(void) +_Toolbar::AddAccessibilityElement(ToolbarButton position, _Button* pButton) { if(likely(!(_AccessibilityManager::IsActivated()))) { return; } - - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - _AccessibilityElement* pButtonElement = null; - if(pContainer == null) - { - return; - } - int priorty = 0; - if(__header) + String name = L""; + switch(position) { - priorty = ACCESSIBILITY_PRIORTY_TOP; + case LEFT_BUTTON: + name = L"LeftButtonText"; + break; + case RIGHT_BUTTON: + name = L"RightButtonText"; + break; + case BACK_BUTTON: + name = L"BackButtonText"; + break; + case MIDDLE_BUTTON: + name = L"MiddleButtonText"; + break; + default: + return; + break; } - else + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + _AccessibilityElement* pButtonElement = null; + + _AccessibilityContainer* pButtonContainer = pButton->GetAccessibilityContainer(); + + if (pButtonContainer) { - priorty = ACCESSIBILITY_PRIORTY_BOTTOM; + pButtonContainer->SetPriority(__header?ACCESSIBILITY_PRIORITY_TOP:ACCESSIBILITY_PRIORITY_BOTTOM); + pContainer->AddChildContainer(*pButtonContainer); + pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); } - pContainer->SetPriority(priorty); - ToolbarStyle style = GetStyle(); - if(style == TOOLBAR_TITLE || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) + if(pButtonElement) { - if (__pTitleTextElement == null) - { - __pTitleTextElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pTitleTextElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); - pContainer->AddElement(*__pTitleTextElement); - } + pButtonElement->SetName(name); - __pTitleTextElement->SetBounds(__pToolbarPresenter->GetTitleTextBounds()); - if( __descriptionText.IsEmpty()) + if (position == BACK_BUTTON) { - __pTitleTextElement->SetLabel(__titleText); + pButtonElement->SetLabel("Back"); + pButtonElement->SetTrait("Back Button"); } else { - __pTitleTextElement->SetLabel(__titleText + L"," + __descriptionText); + pButtonElement->SetTrait(L"Button"); } - __pTitleTextElement->SetTrait(L"Title"); - __pTitleTextElement->SetName(L"HeaderTitleText"); } - else +} + +void +_Toolbar::AddAccessibilityElement(_Button* pButton) +{ + if(likely(!(_AccessibilityManager::IsActivated()))) { - if(__pTitleTextElement) - { - pContainer->RemoveElement(*__pTitleTextElement); - __pTitleTextElement = null; - } + return; } - if (__pButtonItems[LEFT_BUTTON]) + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + if(pContainer == null) { - _AccessibilityContainer* pButtonContainer = __pButtonItems[LEFT_BUTTON]->GetAccessibilityContainer(); - - if (pButtonContainer) - { - pButtonContainer->SetPriority(priorty); - pContainer->AddChildContainer(*pButtonContainer); - pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - } - - if(pButtonElement) - { - pButtonElement->SetName(L"LeftButton"); - pButtonElement->SetTrait(L"Button"); - pButtonElement = null; - } - } - - if (__pButtonItems[RIGHT_BUTTON]) - { - _AccessibilityContainer* pButtonContainer = __pButtonItems[RIGHT_BUTTON]->GetAccessibilityContainer(); - - if (pButtonContainer) - { - pButtonContainer->SetPriority(priorty); - pContainer->AddChildContainer(*pButtonContainer); - pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - } - - if(pButtonElement) - { - pButtonElement->SetName(L"RightButton"); - pButtonElement->SetTrait(L"Button"); - pButtonElement = null; - } - } - - if (__pButtonItems[BACK_BUTTON]) - { - _AccessibilityContainer* pButtonContainer = __pButtonItems[BACK_BUTTON]->GetAccessibilityContainer(); - - if (pButtonContainer) - { - pButtonContainer->SetPriority(priorty); - pContainer->AddChildContainer(*pButtonContainer); - pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - } - - if(pButtonElement) - { - pButtonElement->SetName(L"BackButton"); - pButtonElement->SetLabel(L"Back"); - pButtonElement->SetTrait(L"Back button"); - pButtonElement = null; - } - } - - if (__pButtonItems[MIDDLE_BUTTON]) - { - _AccessibilityContainer* pButtonContainer = __pButtonItems[MIDDLE_BUTTON]->GetAccessibilityContainer(); - - if (pButtonContainer) - { - pButtonContainer->SetPriority(priorty); - pContainer->AddChildContainer(*pButtonContainer); - pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - } - - if(pButtonElement) - { - pButtonElement->SetName(L"MiddleButton"); - pButtonElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON); - pButtonElement = null; - } - } - - return; -} - -void -_Toolbar::AddAccessibilityItem(_Button* pButton) -{ - if(likely(!(_AccessibilityManager::IsActivated()))) - { - return; - } - - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if(pContainer == null) - { - return; - } + return; + } int priorty = 0; if(__header) { - priorty = ACCESSIBILITY_PRIORTY_TOP; + priorty = ACCESSIBILITY_PRIORITY_TOP; } else { - priorty = ACCESSIBILITY_PRIORTY_BOTTOM; + priorty = ACCESSIBILITY_PRIORITY_BOTTOM; } pContainer->SetPriority(priorty); ToolbarStyle style = GetStyle(); - AccessibilityTraits trait = ACCESSIBILITY_TRAITS_BUTTON; - String name = L"Button" + Integer::ToString(__itemCount); - + String trait = L""; + String name = L""; switch (style) { + case TOOLBAR_HEADER_SEGMENTED: + //fall through case TOOLBAR_HEADER_SEGMENTED_WITH_TITLE: //fall through case TOOLBAR_SEGMENTED: name = L"Segment" + Integer::ToString(__itemCount); - trait = ACCESSIBILITY_TRAITS_SEGMENT; + name.Append(L"Text"); + trait = L"Segmented control"; break; + case TOOLBAR_TAB_WITH_TITLE: + //fall through case TOOLBAR_TAB: name = L"Tab" + Integer::ToString(__itemCount); - trait = ACCESSIBILITY_TRAITS_TAB; + name.Append(L"Text"); + trait = L"Tab"; break; default: + name = L"Button" + Integer::ToString(__itemCount); + name.Append(L"Text"); + trait = L"Button"; break; } @@ -2600,7 +2848,13 @@ _Toolbar::AddAccessibilityItem(_Button* pButton) { pElement->SetName(name); pElement->SetTrait(trait); - pElement->SetHint(L"Double tap to move to contents"); + if(style == TOOLBAR_HEADER_SEGMENTED || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE + || style == TOOLBAR_SEGMENTED || style == TOOLBAR_TAB_WITH_TITLE + || style == TOOLBAR_TAB) + { + pElement->SetHint(L"Double tap to move to contents"); + pButton->GetAccessibilityContainer()->AddListener(footerItemAccessibilityListener); + } } } @@ -2610,13 +2864,27 @@ _Toolbar::AddAccessibilityItem(_Button* pButton) void _Toolbar::OnBoundsChanged(void) { - if(__pTitleTextElement) + RearrangeItems(); + + if(likely(!(_AccessibilityManager::IsActivated()))) { - __pTitleTextElement->SetBounds(__pToolbarPresenter->GetTitleTextBounds()); + return; } - RearrangeItems(); + if(__pTitleTextElement) + { + if( __descriptionText.IsEmpty()) + { + __pTitleTextElement->SetBounds(FloatRectangle(__pToolbarPresenter->GetTitleTextBoundsF())); + } + else + { + FloatRectangle descriptionBounds = __pToolbarPresenter->GetDescriptionBoundsF(); + FloatRectangle titleBounds = __pToolbarPresenter->GetTitleTextBoundsF(); + __pTitleTextElement->SetBounds(FloatRectangle(titleBounds.x, titleBounds.y, titleBounds.width, titleBounds.height + descriptionBounds.height)); + } + } return; } @@ -2639,7 +2907,7 @@ _Toolbar::OnFontInfoRequested(unsigned long& style, int& size) void _Toolbar::OnChangeLayout(_ControlOrientation orientationStatus) { - int toolbarWidth = GetBounds().width; + float toolbarWidth = GetBoundsF().width; if (CalculateMinimumToolbarWidth() > toolbarWidth) { @@ -2650,6 +2918,8 @@ _Toolbar::OnChangeLayout(_ControlOrientation orientationStatus) RearrangeItems(); + __pToolbarPresenter->OnChangeLayout(orientationStatus); + return; } @@ -2661,31 +2931,48 @@ _Toolbar::OnDraw(void) if (__pToolbarPresenter) { __pToolbarPresenter->Draw(); - - InitializeAccessibilityElement(); } + if(likely(!(_AccessibilityManager::IsActivated()))) + { + return; + } + if(__pTitleTextElement) + { + if( __descriptionText.IsEmpty()) + { + __pTitleTextElement->SetBounds(FloatRectangle(__pToolbarPresenter->GetTitleTextBoundsF())); + } + else + { + FloatRectangle descriptionBounds = __pToolbarPresenter->GetDescriptionBoundsF(); + FloatRectangle titleBounds = __pToolbarPresenter->GetTitleTextBoundsF(); + __pTitleTextElement->SetBounds(FloatRectangle(titleBounds.x, titleBounds.y, titleBounds.width, titleBounds.height + descriptionBounds.height)); + } + } return; } bool _Toolbar::OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture) { - //if (__tabExpanded != true) - //{ - // return true; - //} + return __pToolbarPresenter->OnLongPressGestureDetected(); +} - //if (__pToolbarPresenter) - //{ - // return __pToolbarPresenter->OnLongPressGestureDetected(); - //} +bool +_Toolbar::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture) +{ + return false; +} - return true; +bool +_Toolbar::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) +{ + return __pToolbarPresenter->OnFlickGestureDetected(gesture); } bool -_Toolbar::OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture) +_Toolbar::OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture) { return false; } @@ -2814,11 +3101,11 @@ _Toolbar::ApplyUserGUI(ButtonType buttonType, _Button* pButton) if (__header) { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); } else { - GET_BITMAP_CONFIG_N(FOOTER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); } if (__transparent) @@ -2897,15 +3184,30 @@ _Toolbar::ApplyUserGUI(ButtonType buttonType, _Button* pButton) if (__style == TOOLBAR_TEXT || __style == TOOLBAR_ICON || __style == TOOLBAR_ICON_TEXT) { GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundEffectBitmap); - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundEffectBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundBitmap); + + bool themeNormalBackgroundBitmap = IS_CUSTOM_BITMAP(FOOTER::BUTTON_ITEM_BG_NORMAL); + if (!themeNormalBackgroundBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundEffectBitmap); + } + + bool themePressedBackgroundBitmap = IS_CUSTOM_BITMAP(FOOTER::BUTTON_ITEM_BG_PRESSED); + if (!themePressedBackgroundBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundEffectBitmap); + } } - else + else if (__style == TOOLBAR_HEADER_SEGMENTED || __style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE) { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundBitmap); } + else + { + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBackgroundBitmap); + } if (pNormalBackgroundEffectBitmap) { @@ -3018,9 +3320,98 @@ _Toolbar::ApplyUserGUI(ButtonType buttonType, _Button* pButton) int _Toolbar::CalculateMinimumToolbarWidth(void) { - int totalWidth = 0; - int itemMinimumWidth = 0; - int horizontalMargin = 0; + float totalWidth = 0.0f; + float itemMinimumWidth = 0.0f; + float horizontalMargin = 0.0f; + + if (__header == true && __style == TOOLBAR_TEXT) + { + if (IsButtonSet(LEFT_BUTTON)) + { + //if (__pButtonItems[LEFT_BUTTON]->GetText().IsEmpty()) + //{ + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth); + //} + //else + //{ + // GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_WITH_TEXT, GetOrientation(), itemMinimumWidth); + //} + + totalWidth += itemMinimumWidth; + } + if (IsButtonSet(RIGHT_BUTTON)) + { + //if (__pButtonItems[RIGHT_BUTTON]->GetText().IsEmpty()) + //{ + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth); + //} + //else + //{ + // GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_WITH_TEXT, GetOrientation(), itemMinimumWidth); + //} + + totalWidth += itemMinimumWidth; + } + } + else // footer or HEADER_TITLE_BUTTON + { + if (IsButtonSet(LEFT_BUTTON)) + { + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth); + totalWidth += itemMinimumWidth; + } + if (IsButtonSet(RIGHT_BUTTON)) + { + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth); + totalWidth += itemMinimumWidth; + } + else if (IsButtonSet(BACK_BUTTON)) + { + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth); + totalWidth += itemMinimumWidth; + } + } + + if (__style == TOOLBAR_TITLE) + { + GET_SHAPE_CONFIG(HEADER::TITLE_MINIMUM_WIDTH, GetOrientation(), itemMinimumWidth); + totalWidth += itemMinimumWidth; + } + else if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_HEADER_SEGMENTED) + { + GET_SHAPE_CONFIG(HEADER::ITEM_MINIMUM_WIDTH, GetOrientation(), itemMinimumWidth); + GET_SHAPE_CONFIG(HEADER::COMMON_MINIMUM_MARGIN, GetOrientation(), horizontalMargin); + totalWidth += itemMinimumWidth * __itemCount + horizontalMargin * 2; + } + else if (__style == TOOLBAR_SEGMENTED) + { + GET_SHAPE_CONFIG(FOOTER::ITEM_MINIMUM_WIDTH, GetOrientation(), itemMinimumWidth); + GET_SHAPE_CONFIG(FOOTER::COMMON_MINIMUM_MARGIN, GetOrientation(), horizontalMargin); + totalWidth += itemMinimumWidth * __itemCount + horizontalMargin * 2; + } + else + { + GET_SHAPE_CONFIG(FOOTER::ITEM_MINIMUM_WIDTH, GetOrientation(), itemMinimumWidth); + + if ((__style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE) && __itemCount > 4) + { + totalWidth += itemMinimumWidth * 4; + } + else + { + totalWidth += itemMinimumWidth * __itemCount; + } + } + + return totalWidth; +} + +float +_Toolbar::CalculateMinimumToolbarWidthF(void) +{ + float totalWidth = 0.0f; + float itemMinimumWidth = 0.0f; + float horizontalMargin = 0.0f; if (__header == true && __style == TOOLBAR_TEXT) { @@ -3105,19 +3496,24 @@ _Toolbar::CalculateMinimumToolbarWidth(void) } result -_Toolbar::RealignIcon(_Button* pButton) +_Toolbar::RealignItem(_Button* pButton) { SysTryReturnResult(NID_UI_CTRL, pButton, E_INVALID_STATE, "[E_INVALID_STATE] pButton doesn't exist."); - int buttonItemWidth = pButton->GetSize().width; - int buttonItemHeight = pButton->GetSize().height; - int sideMargin = 0; - int buttonTextTopMargin = 0; - int iconTextGap = 0; - int contentLength = 0; - int textExtentSize = pButton->GetTextExtentSize(); - int segmentedTextAreaHeight = 0; - int revisedTopMargin = 5; + float buttonItemWidth = pButton->GetSizeF().width; + float buttonItemHeight = pButton->GetSizeF().height; + float sideMargin = 0.0f; + float buttonTextTopMargin = 0.0f; + float iconTextGap = 0.0f; + float contentLength = 0.0f; + float textExtentSize = pButton->GetTextExtentSizeF(); + float segmentedTextAreaHeight = 0.0f; + float revisedTopMargin = 5.0f; + + float leftTouchMargin = pButton->GetLeftTouchMarginF(); + float topTouchMargin = pButton->GetTopTouchMarginF(); + float rightTouchMargin = pButton->GetRightTouchMarginF(); + float bottomTouchMargin = pButton->GetBottomTouchMarginF(); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_TEXT_LEFT_MARGIN, GetOrientation(), sideMargin); GET_SHAPE_CONFIG(HEADER::ICON_TEXT_GAP, GetOrientation(), iconTextGap); @@ -3143,11 +3539,11 @@ _Toolbar::RealignIcon(_Button* pButton) if (pButton->GetText() != L"") { - int iconAreaWidth = 0; + float iconAreaWidth = 0.0f; if (pButton->GetBitmap(_BUTTON_STATUS_NORMAL) != null) { - iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_NORMAL)->GetWidth(); + iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_NORMAL)->GetWidthF(); contentLength = iconAreaWidth + iconTextGap + textExtentSize; if (contentLength > buttonItemWidth - sideMargin * 2) @@ -3156,12 +3552,12 @@ _Toolbar::RealignIcon(_Button* pButton) } pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_NORMAL))); } if (pButton->GetBitmap(_BUTTON_STATUS_PRESSED) != null) { - iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_PRESSED)->GetWidth(); + iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_PRESSED)->GetWidthF(); contentLength = iconAreaWidth + iconTextGap + textExtentSize; if (contentLength > buttonItemWidth - sideMargin * 2) @@ -3170,12 +3566,12 @@ _Toolbar::RealignIcon(_Button* pButton) } pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_PRESSED))); } if (pButton->GetBitmap(_BUTTON_STATUS_SELECTED) != null) { - iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_SELECTED)->GetWidth(); + iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_SELECTED)->GetWidthF(); contentLength = iconAreaWidth + iconTextGap + textExtentSize; if (contentLength > buttonItemWidth - sideMargin * 2) @@ -3184,12 +3580,12 @@ _Toolbar::RealignIcon(_Button* pButton) } pButton->SetBitmap(_BUTTON_STATUS_SELECTED, - Point((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_SELECTED))); } if (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null) { - iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED)->GetWidth(); + iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED)->GetWidthF(); contentLength = iconAreaWidth + iconTextGap + textExtentSize; if (contentLength > buttonItemWidth - sideMargin * 2) @@ -3198,12 +3594,12 @@ _Toolbar::RealignIcon(_Button* pButton) } pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))); } if (pButton->GetBitmap(_BUTTON_STATUS_DISABLED) != null) { - iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_DISABLED)->GetWidth(); + iconAreaWidth = pButton->GetBitmap(_BUTTON_STATUS_DISABLED)->GetWidthF(); contentLength = iconAreaWidth + iconTextGap + textExtentSize; if (contentLength > buttonItemWidth - sideMargin * 2) @@ -3212,18 +3608,18 @@ _Toolbar::RealignIcon(_Button* pButton) } pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - contentLength) / 2, (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_DISABLED))); } if (iconAreaWidth != 0) { pButton->SetTextHorizontalAlignment(ALIGNMENT_LEFT); - pButton->SetUserDefinedTextArea(Rectangle((buttonItemWidth - contentLength) / 2 + iconAreaWidth + iconTextGap, buttonTextTopMargin, buttonItemWidth - iconAreaWidth - iconTextGap - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); + pButton->SetUserDefinedTextArea(FloatRectangle((buttonItemWidth - contentLength) / 2 + iconAreaWidth + iconTextGap, buttonTextTopMargin, buttonItemWidth - iconAreaWidth - iconTextGap - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); } else { - pButton->SetUserDefinedTextArea(Rectangle(sideMargin, buttonTextTopMargin, buttonItemWidth - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); + pButton->SetUserDefinedTextArea(FloatRectangle(sideMargin, buttonTextTopMargin, buttonItemWidth - sideMargin * 2, buttonItemHeight - buttonTextTopMargin * 2)); } } else @@ -3231,78 +3627,92 @@ _Toolbar::RealignIcon(_Button* pButton) if (pButton->GetBitmap(_BUTTON_STATUS_NORMAL) != null) { pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidth()) / 2, - (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_NORMAL))); } if (pButton->GetBitmap(_BUTTON_STATUS_PRESSED) != null) { pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidth()) / 2, - (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_PRESSED))); } if (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null) { pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidth()) / 2, - (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))); } if (pButton->GetBitmap(_BUTTON_STATUS_DISABLED) != null) { pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidth()) / 2, - (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_DISABLED))); } if (pButton->GetBitmap(_BUTTON_STATUS_SELECTED) != null) { pButton->SetBitmap(_BUTTON_STATUS_SELECTED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidth()) / 2, - (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeight()) / 2), + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2), *(pButton->GetBitmap(_BUTTON_STATUS_SELECTED))); } - pButton->SetMargin(buttonTextTopMargin, sideMargin); + pButton->SetMargin(sideMargin, buttonTextTopMargin, sideMargin, buttonTextTopMargin); } return E_SUCCESS; } result -_Toolbar::RealignButtonIcon(_Button* pButton) +_Toolbar::RealignButtonItem(_Button* pButton) { SysTryReturnResult(NID_UI_CTRL, pButton, E_INVALID_STATE, "[E_INVALID_STATE] pButton doesn't exist."); - int buttonItemWidth = pButton->GetSize().width; - int iconTopMargin = 0; - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_ICON_TOP_MARGIN, GetOrientation(), iconTopMargin); + float buttonItemWidth = pButton->GetSizeF().width; + float buttonItemHeight = pButton->GetSizeF().height; + + float leftTouchMargin = pButton->GetLeftTouchMarginF(); + float topTouchMargin = pButton->GetTopTouchMarginF(); + float rightTouchMargin = pButton->GetRightTouchMarginF(); + float bottomTouchMargin = pButton->GetBottomTouchMarginF(); if (pButton->GetBitmap(_BUTTON_STATUS_NORMAL) != null) { pButton->SetBitmap(_BUTTON_STATUS_NORMAL, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidth()) / 2, iconTopMargin), *(pButton->GetBitmap(_BUTTON_STATUS_NORMAL))); + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2), + *(pButton->GetBitmap(_BUTTON_STATUS_NORMAL))); } if (pButton->GetBitmap(_BUTTON_STATUS_PRESSED) != null) { pButton->SetBitmap(_BUTTON_STATUS_PRESSED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidth()) / 2, iconTopMargin), *(pButton->GetBitmap(_BUTTON_STATUS_PRESSED))); + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2), + *(pButton->GetBitmap(_BUTTON_STATUS_PRESSED))); } if (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null) { pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidth()) / 2, iconTopMargin), *(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))); + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2), + *(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))); } if (pButton->GetBitmap(_BUTTON_STATUS_DISABLED) != null) { pButton->SetBitmap(_BUTTON_STATUS_DISABLED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidth()) / 2, iconTopMargin), *(pButton->GetBitmap(_BUTTON_STATUS_DISABLED))); + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2), + *(pButton->GetBitmap(_BUTTON_STATUS_DISABLED))); } if (pButton->GetBitmap(_BUTTON_STATUS_SELECTED) != null) { pButton->SetBitmap(_BUTTON_STATUS_SELECTED, - Point((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidth()) / 2, iconTopMargin), *(pButton->GetBitmap(_BUTTON_STATUS_SELECTED))); + FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2, + (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2), + *(pButton->GetBitmap(_BUTTON_STATUS_SELECTED))); } return E_SUCCESS; @@ -3311,10 +3721,10 @@ _Toolbar::RealignButtonIcon(_Button* pButton) result _Toolbar::RearrangeItems(void) { - __titleTextArea = _Control::GetBounds(); + __titleTextArea = _Control::GetBoundsF(); - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); if (CalculateMinimumToolbarWidth() > __titleTextArea.width) { @@ -3338,63 +3748,42 @@ _Toolbar::RearrangeItems(void) __itemArea = __titleTextArea; - if (__header == true && __style != TOOLBAR_TEXT) + if (__header == true && __style != TOOLBAR_TEXT) // right align { - int headerLeftButtonWidth = 0; - int headerRightButtonWidth = 0; - int headerTopMargin = 0; - int vmargin = 0; - int buttonItemGap = 0; - int headerButtonItemHeight = 0; - int headerLeftMargin = 0; - int headerRightMargin = 0; - int segmentedButtonWidth = 0; - int segmentedButtonWidth2 = 0; - int tabLeftMargin = 0; + float headerLeftButtonWidth = 0.0f; + float headerRightButtonWidth = 0.0f; + float headerTopMargin = 0.0f; + float vmargin = 0.0f; + float buttonItemGap = 0.0f; + float headerButtonItemHeight = 0.0f; + float headerLeftMargin = 0.0f; + float headerRightMargin = 0.0f; + float tabLeftMargin = 0.0f; + + float leftTouchMargin = 0.0f; + float topTouchMargin = 0.0f; + float rightTouchMargin = 0.0f; + float bottomTouchMargin = 0.0f; GET_SHAPE_CONFIG(HEADER::TOP_MARGIN, GetOrientation(), headerTopMargin); GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_GAP, GetOrientation(), buttonItemGap); GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), headerLeftMargin); GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN, GetOrientation(), headerRightMargin); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_OF_SEGMENTED, GetOrientation(), segmentedButtonWidth); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH_OF_SEGMENTED_2, GetOrientation(), segmentedButtonWidth2); GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin); + if (__pButtonItems[LEFT_BUTTON]) { - headerLeftButtonWidth = __pButtonItems[LEFT_BUTTON]->GetSize().width; + headerLeftButtonWidth = __pButtonItems[LEFT_BUTTON]->GetSizeF().width; } if (__pButtonItems[RIGHT_BUTTON]) { - headerRightButtonWidth = __pButtonItems[RIGHT_BUTTON]->GetSize().width; - } - - if (__style == TOOLBAR_HEADER_SEGMENTED || __style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) - { - if (__pButtonItems[LEFT_BUTTON]) - { - if (__pButtonItems[RIGHT_BUTTON]) - { - headerLeftButtonWidth = segmentedButtonWidth2; - headerRightButtonWidth = segmentedButtonWidth2; - } - else - { - headerLeftButtonWidth = segmentedButtonWidth; - } - - GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN_WITH_SEGMENTED_BUTTON, GetOrientation(), headerRightMargin); - } - else - { - if (__pButtonItems[RIGHT_BUTTON]) - { - headerRightButtonWidth = segmentedButtonWidth; - - GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN_WITH_SEGMENTED_BUTTON, GetOrientation(), headerRightMargin); - } - } + headerRightButtonWidth = __pButtonItems[RIGHT_BUTTON]->GetSizeF().width; } if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) @@ -3404,16 +3793,8 @@ _Toolbar::RearrangeItems(void) } else { - if (__style == TOOLBAR_TITLE) - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetOrientation(), headerButtonItemHeight); - } - else if(__style == TOOLBAR_HEADER_SEGMENTED) - { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN_OF_SEGMENTED, GetOrientation(), vmargin); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT_OF_SEGMENTED, GetOrientation(), headerButtonItemHeight); - } + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetOrientation(), headerButtonItemHeight); } __titleTextArea.x = headerLeftMargin; @@ -3423,204 +3804,374 @@ _Toolbar::RearrangeItems(void) { if (__pButtonItems[LEFT_BUTTON]) { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin, vmargin, - headerRightButtonWidth, headerButtonItemHeight)); - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(__titleTextArea.width - headerRightButtonWidth - headerLeftButtonWidth - buttonItemGap - headerRightMargin, vmargin, - headerLeftButtonWidth, headerButtonItemHeight)); + if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") + { + if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") + { + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerLeftButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin * 2); + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + + __titleTextArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin * 2); + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin * 2); + } + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerLeftButtonWidth - headerRightMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); - if (!(__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)) + __titleTextArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + } + } + } + else { - __titleTextArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + buttonItemGap + headerLeftMargin); + if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") + { + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerLeftButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + } + else + { + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + + __titleTextArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + headerLeftMargin - leftTouchMargin); + } + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerLeftButtonWidth - buttonItemGap - headerRightMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + buttonItemGap + headerLeftMargin); + } + else + { + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + + __titleTextArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + buttonItemGap + headerLeftMargin); + __itemArea.width -= (headerLeftButtonWidth + headerRightButtonWidth + buttonItemGap + headerLeftMargin); + } + } } } else { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin, vmargin, - headerRightButtonWidth, headerButtonItemHeight)); + if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") + { + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + + __itemArea.width -= (headerRightButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); - if (!(__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)) + __titleTextArea.width -= (headerRightButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + __itemArea.width -= (headerRightButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + } + } + else { - __titleTextArea.width -= (headerRightButtonWidth + headerLeftMargin); + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - headerRightMargin, vmargin, + headerRightButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + + __itemArea.width -= (headerRightButtonWidth + headerLeftMargin); + } + else + { + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + + __titleTextArea.width -= (headerRightButtonWidth + headerLeftMargin); + __itemArea.width -= (headerRightButtonWidth + headerLeftMargin); + } } } } else if (__pButtonItems[LEFT_BUTTON]) { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(__titleTextArea.width - headerLeftButtonWidth - headerRightMargin, vmargin, - headerLeftButtonWidth, headerButtonItemHeight)); + if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") + { + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerLeftButtonWidth - headerRightMargin + rightTouchMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); - if (!(__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)) + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f); + + __itemArea.width -= (headerLeftButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + } + else + { + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + + __titleTextArea.width -= (headerLeftButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + __itemArea.width -= (headerLeftButtonWidth + headerLeftMargin - leftTouchMargin - rightTouchMargin); + } + } + else { - __titleTextArea.width -= (headerLeftButtonWidth + headerLeftMargin); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerLeftButtonWidth - headerRightMargin, vmargin, + headerLeftButtonWidth, headerButtonItemHeight)); + + if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE) + { + //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0); + + __itemArea.width -= (headerLeftButtonWidth + headerLeftMargin); + } + else + { + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin); + + __titleTextArea.width -= (headerLeftButtonWidth + headerLeftMargin); + __itemArea.width -= (headerLeftButtonWidth + headerLeftMargin); + } } } - if (!(__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)) + if ((__style == TOOLBAR_HEADER_SEGMENTED || __style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) + && __pButtonItems[LEFT_BUTTON] == null && __pButtonItems[RIGHT_BUTTON] == null) + { + // segment style with no button's right margin is same as left + __titleTextArea.width -= (headerLeftMargin + headerRightMargin); + __itemArea.width -= (headerLeftMargin + headerLeftMargin); + } + else if (!(__style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)) + { + __titleTextArea.width -= (headerLeftMargin + headerRightMargin); + __itemArea.width -= (headerLeftMargin + headerRightMargin); + } + + if (__style == TOOLBAR_TAB_WITH_TITLE) { __titleTextArea.width -= (headerLeftMargin + headerRightMargin); } - else // TOOLBAR_HEADER_SEGMENTED_WITH_TITLE or TOOLBAR_TAB_WITH_TITLE + + float processingAnimationIconSize = 0.0f; + + GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_SIZE, GetOrientation(), processingAnimationIconSize); + + if (__pButtonItems[LEFT_BUTTON] && GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT) != ANIMATION_STOPPED) { - __titleTextArea.width -= (headerLeftMargin + tabLeftMargin); + SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT, + (__pButtonItems[LEFT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2, + topTouchMargin + (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2); } - if (__style == TOOLBAR_HEADER_SEGMENTED) + if (__pButtonItems[RIGHT_BUTTON] && GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT) != ANIMATION_STOPPED) { - if (__pButtonItems[RIGHT_BUTTON]) - { - RealignButtonIcon(__pButtonItems[RIGHT_BUTTON]); - } - if (__pButtonItems[LEFT_BUTTON]) - { - RealignButtonIcon(__pButtonItems[LEFT_BUTTON]); - } + SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT, + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2, + topTouchMargin + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2); } - else if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) + } + else // footer or edit or HEADER_STYLE_BUTTON // side align + { + float footerButtonItemWidth = 0.0f; + float footerButtonItemHeight = 0.0f; + float sipButtonItemTopMargin = 0.0f; + float footerLeftMargin = 0.0f; + FloatDimension softkeyDimension(0.0f, 0.0f); + + float leftTouchMargin = 0.0f; + float topTouchMargin = 0.0f; + float rightTouchMargin = 0.0f; + float bottomTouchMargin = 0.0f; + + if (__header == true && __style == TOOLBAR_TEXT) // sip { - if (__pButtonItems[RIGHT_BUTTON]) + GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin); + GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin); + GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin); + GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin); + } + else + { + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin); + } + + if (__header == true && __style == TOOLBAR_TEXT) + { + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetOrientation(), footerButtonItemWidth); + + if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip && portrait { - RealignIcon(__pButtonItems[RIGHT_BUTTON]); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetOrientation(), footerButtonItemHeight); } - if (__pButtonItems[LEFT_BUTTON]) + else { - RealignIcon(__pButtonItems[LEFT_BUTTON]); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetOrientation(), footerButtonItemHeight); } } - } - else // footer or edit or HEADER_STYLE_BUTTON - { - int footerButtonItemWidth = 0; - int footerButtonItemHeight = 0; - int sipButtonItemTopMargin = 0; - int footerLeftMargin = 0; - Dimension softkeyDimension(0, 0); + else + { + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), footerButtonItemWidth); + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetOrientation(), footerButtonItemHeight); + } - GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), footerButtonItemWidth); - GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, GetOrientation(), footerButtonItemHeight); GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_TOP_MARGIN, GetOrientation(), sipButtonItemTopMargin); GET_SHAPE_CONFIG(FOOTER::LEFT_MARGIN, GetOrientation(), footerLeftMargin); GET_DIMENSION_CONFIG(FOOTER::SOFTKEY_RECT_WITH_TEXT, GetOrientation(), softkeyDimension); if (__pButtonItems[MIDDLE_BUTTON]) { - __pButtonItems[MIDDLE_BUTTON]->SetPosition(Point((__itemArea.width - __pButtonItems[MIDDLE_BUTTON]->GetSize().width) / 2, - __itemArea.height - __pButtonItems[MIDDLE_BUTTON]->GetSize().height)); + __pButtonItems[MIDDLE_BUTTON]->SetPosition(FloatPoint((__itemArea.width - __pButtonItems[MIDDLE_BUTTON]->GetSizeF().width) / 2, + __itemArea.height - __pButtonItems[MIDDLE_BUTTON]->GetSizeF().height)); } + // footer or edit or HEADER_STYLE_BUTTON // side align if (__pButtonItems[RIGHT_BUTTON]) { if (__pButtonItems[LEFT_BUTTON]) { - if (__pButtonItems[BACK_BUTTON]) //321 + if (__pButtonItems[BACK_BUTTON]) { - if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); - - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, sipButtonItemTopMargin, - footerButtonItemWidth, footerButtonItemHeight)); - } - else - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, + (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, (__itemArea.height - footerButtonItemHeight) / 2, - footerButtonItemWidth, footerButtonItemHeight)); - } + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2, + footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } - else //21 + else { - if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip + if (__style != TOOLBAR_SOFTKEY) { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, + (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, sipButtonItemTopMargin, + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } else { - if (__style != TOOLBAR_SOFTKEY) + if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[RIGHT_BUTTON]->SetPosition(FloatPoint(__itemArea.width - __pButtonItems[RIGHT_BUTTON]->GetSizeF().width, + __itemArea.height - __pButtonItems[RIGHT_BUTTON]->GetSizeF().height)); } else { - if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") - { - __pButtonItems[RIGHT_BUTTON]->SetPosition(Point(__itemArea.width - __pButtonItems[RIGHT_BUTTON]->GetSize().width, - __itemArea.height - __pButtonItems[RIGHT_BUTTON]->GetSize().height)); - } - else - { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - softkeyDimension.width, 0, - softkeyDimension.width, softkeyDimension.height)); - } + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - softkeyDimension.width, 0.0f, + softkeyDimension.width, softkeyDimension.height)); } + } - if (__style != TOOLBAR_SOFTKEY) - { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, (__itemArea.height - footerButtonItemHeight) / 2, + if (__style != TOOLBAR_SOFTKEY) + { + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + } + else + { + if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") + { + __pButtonItems[LEFT_BUTTON]->SetPosition(FloatPoint(0.0f, __itemArea.height - __pButtonItems[LEFT_BUTTON]->GetSizeF().height)); } else { - if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") - { - __pButtonItems[LEFT_BUTTON]->SetPosition(Point(0, __itemArea.height - __pButtonItems[LEFT_BUTTON]->GetSize().height)); - } - else - { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(0, 0, softkeyDimension.width, softkeyDimension.height)); - } + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, 0.0f, softkeyDimension.width, softkeyDimension.height)); } } } } else { - if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip + if (__pButtonItems[BACK_BUTTON]) { - if (__pButtonItems[BACK_BUTTON])//31 - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); - } - else //1 - { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); - } + __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, + (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } else { - if (__pButtonItems[BACK_BUTTON])//31 + if (__style != TOOLBAR_SOFTKEY) { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } - else //1 + else { - if (__style != TOOLBAR_SOFTKEY) + if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[RIGHT_BUTTON]->SetPosition(FloatPoint(__itemArea.width - __pButtonItems[RIGHT_BUTTON]->GetSizeF().width, + __itemArea.height - __pButtonItems[RIGHT_BUTTON]->GetSizeF().height)); } else { - if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"") - { - __pButtonItems[RIGHT_BUTTON]->SetPosition(Point(__itemArea.width - __pButtonItems[RIGHT_BUTTON]->GetSize().width, - __itemArea.height - __pButtonItems[RIGHT_BUTTON]->GetSize().height)); - } - else - { - __pButtonItems[RIGHT_BUTTON]->SetBounds(Rectangle(__itemArea.width - softkeyDimension.width, 0, - softkeyDimension.width, softkeyDimension.height)); - } + __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - softkeyDimension.width, 0.0f, + softkeyDimension.width, softkeyDimension.height)); } } } @@ -3628,75 +4179,62 @@ _Toolbar::RearrangeItems(void) } else if (__pButtonItems[LEFT_BUTTON]) { - if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip + if (__pButtonItems[BACK_BUTTON]) { - if (__pButtonItems[BACK_BUTTON]) //32 - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, + (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, sipButtonItemTopMargin, - footerButtonItemWidth, footerButtonItemHeight)); - } - else //2 - { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, sipButtonItemTopMargin, - footerButtonItemWidth, footerButtonItemHeight)); - } + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2, + footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } else { - if (__pButtonItems[BACK_BUTTON]) //32 + if (__style != TOOLBAR_SOFTKEY) { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2, + footerButtonItemWidth, footerButtonItemHeight)); - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, (__itemArea.height - footerButtonItemHeight) / 2, - footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } - else //2 + else { - if (__style != TOOLBAR_SOFTKEY) + if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(footerLeftMargin, (__itemArea.height - footerButtonItemHeight) / 2, - footerButtonItemWidth, footerButtonItemHeight)); + __pButtonItems[LEFT_BUTTON]->SetPosition(FloatPoint(0, __itemArea.height - __pButtonItems[LEFT_BUTTON]->GetSizeF().height)); } else { - if (__pButtonItems[LEFT_BUTTON]->GetText() == L"") - { - __pButtonItems[LEFT_BUTTON]->SetPosition(Point(0, __itemArea.height - __pButtonItems[LEFT_BUTTON]->GetSize().height)); - } - else - { - __pButtonItems[LEFT_BUTTON]->SetBounds(Rectangle(0, 0, softkeyDimension.width, softkeyDimension.height)); - } + __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, 0.0f, softkeyDimension.width, softkeyDimension.height)); } } } } else { - if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip + if (__pButtonItems[BACK_BUTTON]) { - if (__pButtonItems[BACK_BUTTON]) - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - sipButtonItemTopMargin, footerButtonItemWidth, footerButtonItemHeight)); - } + __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin, + (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); + + __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin); } - else + } + } + + if (__style != TOOLBAR_SOFTKEY) + { + for (int i = 0; i < BUTTON_MAX; i++) + { + if (__pButtonItems[i] != null) { - if (__pButtonItems[BACK_BUTTON]) - { - __pButtonItems[BACK_BUTTON]->SetBounds(Rectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin, - (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight)); - } + RealignButtonItem(__pButtonItems[i]); } } } - if (__pToolbarPresenter) { __pToolbarPresenter->SetUsableAreaBounds(__titleTextArea); @@ -3736,60 +4274,36 @@ _Toolbar::RearrangeItems(void) result _Toolbar::RearrangeHeaderSegmentedItems(void) { - int segmentedItemHeight = 0; - int tabLeftMargin = 0; - int separatorWidth = 0; - int segmentedRightMarginWithButton = 0; - int vmargin = 0; - int blockWidth[__itemCount]; - int fontSize = 0; + float segmentedItemHeight = 0.0f; + float leftMargin = 0.0f; + float dividerWidth = 0.0f; + float vmargin = 0.0f; + float blockWidth[__itemCount]; + float fontSize = 0.0f; - GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, GetOrientation(), separatorWidth); - GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN_WITH_SEGMENTED_BUTTON, GetOrientation(), segmentedRightMarginWithButton); + GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), leftMargin); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth); if (__style == TOOLBAR_HEADER_SEGMENTED) { - segmentedItemHeight = __titleTextArea.height; - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN_OF_SEGMENTED, GetOrientation(), vmargin); + segmentedItemHeight = __itemArea.height; + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin); + GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_FONT_SIZE, GetOrientation(), fontSize); } else if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) { GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, GetOrientation(), segmentedItemHeight); GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, GetOrientation(), vmargin); - } - - if (__pButtonItems[LEFT_BUTTON]) - { - if (__pButtonItems[RIGHT_BUTTON]) - { - __itemArea.width -= (tabLeftMargin + tabLeftMargin + __pButtonItems[LEFT_BUTTON]->GetSize().width + separatorWidth - + __pButtonItems[RIGHT_BUTTON]->GetSize().width + segmentedRightMarginWithButton); - } - else - { - __itemArea.width -= (tabLeftMargin + tabLeftMargin + __pButtonItems[LEFT_BUTTON]->GetSize().width + segmentedRightMarginWithButton); - } - } - else - { - if (__pButtonItems[RIGHT_BUTTON]) - { - __itemArea.width -= (tabLeftMargin + tabLeftMargin + __pButtonItems[RIGHT_BUTTON]->GetSize().width + segmentedRightMarginWithButton); - } - else - { - __itemArea.width -= tabLeftMargin * 2; - } + GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_4_ITEM, GetOrientation(), fontSize); } if (__itemCount == 1 || __itemCount == 2) { - blockWidth[0] = blockWidth[1] = (__itemArea.width - separatorWidth) / 2; + blockWidth[0] = blockWidth[1] = (__itemArea.width - dividerWidth) / 2; for (int i = 0; i < __itemCount ; i++) { - __pItems.at(i)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] * i + separatorWidth * i, vmargin, blockWidth[i], segmentedItemHeight)); + __pItems.at(i)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] * i + dividerWidth * i, vmargin, blockWidth[i], segmentedItemHeight)); if (__pItems.at(i)->GetChildCount() != 0) { @@ -3797,7 +4311,7 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[1] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[1] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -3805,11 +4319,11 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) } else if (__itemCount == 3) { - blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - separatorWidth * 2) / 3; + blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - dividerWidth * 2) / 3; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, blockWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, vmargin, blockWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(leftMargin, vmargin, blockWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, vmargin, blockWidth[2], segmentedItemHeight)); for (int i = 0; i < __itemCount; i++) @@ -3820,7 +4334,7 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -3828,13 +4342,13 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) } else if (__itemCount == 4) { - blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - separatorWidth * 3) / 4; + blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, blockWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, vmargin, blockWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(leftMargin, vmargin, blockWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, vmargin, blockWidth[2], segmentedItemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, + __pItems.at(3)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, vmargin, blockWidth[3], segmentedItemHeight)); for (int i = 0; i < __itemCount ; i++) @@ -3845,7 +4359,7 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -3854,14 +4368,9 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) for (int i = 0; i < __itemCount; i++) { - if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) - { - GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_4_ITEM, GetOrientation(), fontSize); - - __pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD); - } + __pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD); - RealignIcon(__pItems.at(i)); + RealignItem(__pItems.at(i)); } return E_SUCCESS; @@ -3870,38 +4379,38 @@ _Toolbar::RearrangeHeaderSegmentedItems(void) result _Toolbar::RearrangeFooterSegmentedItems(void) { - int segmentedItemHeight = __itemArea.height; + float segmentedItemHeight = __itemArea.height; - int tabLeftMargin = 0; - int tabRightMargin = 0; - int footerLeftMargin = 0; - int iconSize = 0; - int separatorWidth = 0; - int blockWidth[__itemCount]; - int fontSize = 0; + float leftMargin = 0.0f; + float rightMargin = 0.0f; + float footerLeftMargin = 0.0f; + float iconSize = 0.0f; + float dividerWidth = 0.0f; + float blockWidth[__itemCount]; + float fontSize = 0.0f; - int itemButtonLeftGap = 0; - int itemButtonRightGap = 0; + float itemButtonLeftGap = 0.0f; + float itemButtonRightGap = 0.0f; - GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin); + GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), leftMargin); GET_SHAPE_CONFIG(FOOTER::LEFT_MARGIN, GetOrientation(), footerLeftMargin); GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_ICON_SIZE, GetOrientation(), iconSize); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, GetOrientation(), separatorWidth); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth); - tabRightMargin = tabLeftMargin; + rightMargin = leftMargin; if (__itemCount == 1 || __itemCount == 2) { - tabLeftMargin = footerLeftMargin; + leftMargin = footerLeftMargin; itemButtonLeftGap = footerLeftMargin; - __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2); + __itemArea.width -= ((leftMargin + iconSize + itemButtonLeftGap) * 2); - blockWidth[0] = blockWidth[1] = (__itemArea.width - separatorWidth) / 2; + blockWidth[0] = blockWidth[1] = (__itemArea.width - dividerWidth) / 2; for (int i = 0; i < __itemCount ; i++) { - __pItems.at(i)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] * i + separatorWidth * i, - (GetSize().height - segmentedItemHeight) / 2, blockWidth[i], segmentedItemHeight)); + __pItems.at(i)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] * i + dividerWidth * i, + (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[i], segmentedItemHeight)); if (__pItems.at(i)->GetChildCount() != 0) { @@ -3909,7 +4418,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -3923,39 +4432,39 @@ _Toolbar::RearrangeFooterSegmentedItems(void) { if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) { - tabLeftMargin = footerLeftMargin; + leftMargin = footerLeftMargin; itemButtonLeftGap = footerLeftMargin; - __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2); + __itemArea.width -= ((leftMargin + iconSize + itemButtonLeftGap) * 2); } else { - tabLeftMargin = footerLeftMargin; + leftMargin = footerLeftMargin; itemButtonLeftGap = footerLeftMargin; - __itemArea.width -= (tabLeftMargin + iconSize + itemButtonLeftGap + tabRightMargin); + __itemArea.width -= (leftMargin + iconSize + itemButtonLeftGap + rightMargin); } } else { if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) { - tabRightMargin = footerLeftMargin; + rightMargin = footerLeftMargin; itemButtonRightGap = footerLeftMargin; - __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin); + __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + rightMargin); } else { - __itemArea.width -= tabLeftMargin * 2; + __itemArea.width -= leftMargin * 2; } iconSize = 0; } - blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - separatorWidth * 2) / 3; + blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - dividerWidth * 2) / 3; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSize().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + separatorWidth, (GetSize().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + separatorWidth * 2, - (GetSize().height - segmentedItemHeight) / 2, blockWidth[2], segmentedItemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2, + (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2], segmentedItemHeight)); for (int i = 0; i < __itemCount ; i++) { @@ -3965,7 +4474,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -3977,23 +4486,23 @@ _Toolbar::RearrangeFooterSegmentedItems(void) { if (__pButtonItems[BACK_BUTTON]) { - tabRightMargin = footerLeftMargin; + rightMargin = footerLeftMargin; itemButtonRightGap = footerLeftMargin; - __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin); + __itemArea.width -= (leftMargin + itemButtonRightGap + iconSize + rightMargin); } else { - __itemArea.width -= tabLeftMargin * 2; + __itemArea.width -= leftMargin * 2; } - blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - separatorWidth * 3) / 4; + blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, (GetSize().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, (GetSize().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, - (GetSize().height - segmentedItemHeight) / 2, blockWidth[2], segmentedItemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, - (GetSize().height - segmentedItemHeight) / 2, blockWidth[3], segmentedItemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(leftMargin, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, + (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2], segmentedItemHeight)); + __pItems.at(3)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, + (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[3], segmentedItemHeight)); for (int i = 0; i < __itemCount ; i++) { @@ -4003,7 +4512,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -4016,7 +4525,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void) { __pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD); - RealignIcon(__pItems.at(i)); + RealignItem(__pItems.at(i)); } return E_SUCCESS; @@ -4025,15 +4534,15 @@ _Toolbar::RearrangeFooterSegmentedItems(void) result _Toolbar::RearrangeTabItmes(void) { - int itemWidth[__itemCount]; - int fontSize = 0; - int segmentedItemHeight = 0; - int tabLeftMargin = 0; - int vmargin = 0; - int separatorWidth = 0; + float itemWidth[__itemCount]; + float fontSize = 0.0f; + float segmentedItemHeight = 0.0f; + float tabLeftMargin = 0.0f; + float vmargin = 0.0f; + float dividerWidth = 0.0f; GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, GetOrientation(), separatorWidth); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth); if (__style == TOOLBAR_TAB) { @@ -4048,7 +4557,7 @@ _Toolbar::RearrangeTabItmes(void) if (__itemCount == 1) { itemWidth[0] = __itemArea.width - tabLeftMargin * 2; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); if (__style == TOOLBAR_TAB) { @@ -4061,10 +4570,10 @@ _Toolbar::RearrangeTabItmes(void) } else if (__itemCount == 2) { - itemWidth[0] = itemWidth[1] = (__itemArea.width - tabLeftMargin * 2 - separatorWidth) / 2; + itemWidth[0] = itemWidth[1] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth) / 2; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + separatorWidth, vmargin, itemWidth[1], segmentedItemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1], segmentedItemHeight)); if (__style == TOOLBAR_TAB) { @@ -4077,11 +4586,11 @@ _Toolbar::RearrangeTabItmes(void) } else if (__itemCount == 3) { - itemWidth[0] = itemWidth[1] = itemWidth[2] = (__itemArea.width - tabLeftMargin * 2 - separatorWidth * 2) / 3; + itemWidth[0] = itemWidth[1] = itemWidth[2] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth * 2) / 3; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + separatorWidth, vmargin, itemWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + separatorWidth * 2, vmargin, itemWidth[2], segmentedItemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + dividerWidth * 2, vmargin, itemWidth[2], segmentedItemHeight)); if (__style == TOOLBAR_TAB) { @@ -4094,13 +4603,13 @@ _Toolbar::RearrangeTabItmes(void) } else { - itemWidth[0] = itemWidth[1] = itemWidth[2] = itemWidth[3] = (__itemArea.width - tabLeftMargin * 2 - separatorWidth * 3) / 4; + itemWidth[0] = itemWidth[1] = itemWidth[2] = itemWidth[3] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth * 3) / 4; - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + separatorWidth, vmargin, itemWidth[1], segmentedItemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1], segmentedItemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + dividerWidth * 2, vmargin, itemWidth[2], segmentedItemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + itemWidth[2] + separatorWidth * 3, + __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + itemWidth[2] + dividerWidth * 3, vmargin, itemWidth[3], segmentedItemHeight)); GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_4_ITEM, GetOrientation(), fontSize); @@ -4110,7 +4619,7 @@ _Toolbar::RearrangeTabItmes(void) { itemWidth[i] = itemWidth[0]; - __pItems.at(i)->SetBounds(Rectangle(__pItems.at(i-1)->GetBounds().x + separatorWidth + itemWidth[i], vmargin, itemWidth[i], segmentedItemHeight)); + __pItems.at(i)->SetBounds(FloatRectangle(__pItems.at(i-1)->GetBoundsF().x + dividerWidth + itemWidth[i], vmargin, itemWidth[i], segmentedItemHeight)); } for (int i = 0; i < __itemCount ; i++) @@ -4123,12 +4632,12 @@ _Toolbar::RearrangeTabItmes(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(__pItems.at(i)->GetSize().width - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(__pItems.at(i)->GetSizeF().width - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } - RealignIcon(__pItems.at(i)); + RealignItem(__pItems.at(i)); } return E_SUCCESS; @@ -4137,37 +4646,36 @@ _Toolbar::RearrangeTabItmes(void) result _Toolbar::RearrangeButtonItems(void) { - int itemHeight = 0; - int maxItemLength = 0; - int minItemLength = 0; - int iconSizeWithText = 0; - int sideMargin = 0; - int vmargin = 0; - int itemButtonLeftGap = 0; - int itemButtonRightGap = 0; - int tabLeftMargin = 0; - int tabRightMargin = 0; - int sipFooterItemTopMargin = 0; - int separatorWidth = 0; - int iconSize = 0; - int footerLeftMargin = 0; - int headerButtonItemHeight = 0; - int headerLeftMargin = 0; - int blockWidth[__itemCount]; + float itemHeight = 0.0f; + float maxItemLength = 0.0f; + float minItemLength = 0.0f; + float iconSizeWithText = 0.0f; + float sideMargin = 0.0f; + float topMargin = 0.0f; + float itemButtonLeftGap = 0.0f; + float itemButtonRightGap = 0.0f; + float tabLeftMargin = 0.0f; + float sipFooterItemTopMargin = 0.0f; + float dividerWidth = 0.0f; + float iconSize = 0.0f; + float footerLeftMargin = 0.0f; + float segmentedItemHeight = 0.0f; + float headerLeftMargin = 0.0f; + float blockWidth[__itemCount]; GET_SHAPE_CONFIG(HEADER::SIP_FOOTER_ITEM_TOP_MARGIN, GetOrientation(), sipFooterItemTopMargin); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, GetOrientation(), separatorWidth); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth); GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_ICON_SIZE, GetOrientation(), iconSize); GET_SHAPE_CONFIG(FOOTER::LEFT_MARGIN, GetOrientation(), footerLeftMargin); GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin); GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_WIDTH_1_MAX, GetOrientation(), maxItemLength); GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_WIDTH_1_MIN, GetOrientation(), minItemLength); GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_BUTTON_STYLE_SIDE_MARGIN, GetOrientation(), sideMargin); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, GetOrientation(), headerButtonItemHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_ICON_TOP_MARGIN, GetOrientation(), topMargin); + GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, GetOrientation(), segmentedItemHeight); GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), headerLeftMargin); - tabRightMargin = tabLeftMargin; + float tabRightMargin = tabLeftMargin; if (__style == TOOLBAR_TEXT || __style == TOOLBAR_ICON || __style == TOOLBAR_ICON_TEXT) { @@ -4175,7 +4683,7 @@ _Toolbar::RearrangeButtonItems(void) } else { - itemHeight = GetSize().height; + itemHeight = GetSizeF().height; } if (__itemCount == 1) @@ -4183,9 +4691,9 @@ _Toolbar::RearrangeButtonItems(void) if (__style == TOOLBAR_TITLE) // item 1, HEADER_STYLE_TITLE_BUTTON { blockWidth[0] = __titleTextArea.width; - itemHeight = headerButtonItemHeight; - __pItems.at(0)->SetBounds(Rectangle(headerLeftMargin, vmargin, blockWidth[0], itemHeight)); - __pItems.at(0)->SetMargin(0,0); + itemHeight = segmentedItemHeight; + __pItems.at(0)->SetBounds(FloatRectangle(headerLeftMargin, topMargin, blockWidth[0], itemHeight)); + __pItems.at(0)->SetMargin(0.0f, 0.0f, 0.0f, 0.0f); } else { @@ -4211,11 +4719,11 @@ _Toolbar::RearrangeButtonItems(void) if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip { - __pItems.at(0)->SetBounds(Rectangle((GetSize().width - blockWidth[0]) / 2, sipFooterItemTopMargin, blockWidth[0], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle((GetSizeF().width - blockWidth[0]) / 2, sipFooterItemTopMargin, blockWidth[0], itemHeight)); } else { - __pItems.at(0)->SetBounds(Rectangle((GetSize().width - blockWidth[0]) / 2, (GetSize().height - itemHeight) / 2, blockWidth[0], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle((GetSizeF().width - blockWidth[0]) / 2, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight)); } } @@ -4227,7 +4735,7 @@ _Toolbar::RearrangeButtonItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -4239,17 +4747,17 @@ _Toolbar::RearrangeButtonItems(void) itemButtonLeftGap = footerLeftMargin; __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2); - blockWidth[0] = blockWidth[1] = (__itemArea.width - separatorWidth) / 2; + blockWidth[0] = blockWidth[1] = (__itemArea.width - dividerWidth) / 2; if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap, sipFooterItemTopMargin, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + separatorWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, sipFooterItemTopMargin, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); } else { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSize().height - itemHeight) / 2, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + separatorWidth, (GetSize().height - itemHeight) / 2, blockWidth[1], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight)); } for (int i = 0; i < __itemCount; i++) @@ -4260,7 +4768,7 @@ _Toolbar::RearrangeButtonItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -4299,21 +4807,21 @@ _Toolbar::RearrangeButtonItems(void) iconSize = 0; } - blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - separatorWidth * 2) / 3; + blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - dividerWidth * 2) / 3; if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap, sipFooterItemTopMargin, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + separatorWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, sipFooterItemTopMargin, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2, sipFooterItemTopMargin, blockWidth[2], itemHeight)); } else { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSize().height - itemHeight) / 2, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + separatorWidth, (GetSize().height - itemHeight) / 2, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + separatorWidth * 2, - (GetSize().height - itemHeight) / 2, blockWidth[2], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2, + (GetSizeF().height - itemHeight) / 2, blockWidth[2], itemHeight)); } for (int i = 0; i < __itemCount; i++) @@ -4324,7 +4832,7 @@ _Toolbar::RearrangeButtonItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -4343,25 +4851,25 @@ _Toolbar::RearrangeButtonItems(void) __itemArea.width -= tabLeftMargin * 2; } - blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - separatorWidth * 3) / 4; + blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4; if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, sipFooterItemTopMargin, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, sipFooterItemTopMargin, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, sipFooterItemTopMargin, blockWidth[2], itemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, + __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, sipFooterItemTopMargin, blockWidth[3], itemHeight)); } else { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, (GetSize().height - itemHeight) / 2, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, (GetSize().height - itemHeight) / 2, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, - (GetSize().height - itemHeight) / 2, blockWidth[2], itemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, - (GetSize().height - itemHeight) / 2, blockWidth[3], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, + (GetSizeF().height - itemHeight) / 2, blockWidth[2], itemHeight)); + __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, + (GetSizeF().height - itemHeight) / 2, blockWidth[3], itemHeight)); } for (int i = 0; i < __itemCount; i++) @@ -4372,7 +4880,7 @@ _Toolbar::RearrangeButtonItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } @@ -4391,29 +4899,29 @@ _Toolbar::RearrangeButtonItems(void) __itemArea.width -= tabLeftMargin * 2; } - blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = blockWidth[4] = (__itemArea.width - separatorWidth * 4) / 5; + blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = blockWidth[4] = (__itemArea.width - dividerWidth * 4) / 5; if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, sipFooterItemTopMargin, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, sipFooterItemTopMargin, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, sipFooterItemTopMargin, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, sipFooterItemTopMargin, blockWidth[2], itemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, + __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, sipFooterItemTopMargin, blockWidth[3], itemHeight)); - __pItems.at(4)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3] + separatorWidth * 4, + __pItems.at(4)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3] + dividerWidth * 4, sipFooterItemTopMargin, blockWidth[4], itemHeight)); } else { - __pItems.at(0)->SetBounds(Rectangle(tabLeftMargin, (GetSize().height - itemHeight) / 2, blockWidth[0], itemHeight)); - __pItems.at(1)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + separatorWidth, (GetSize().height - itemHeight) / 2, blockWidth[1], itemHeight)); - __pItems.at(2)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + separatorWidth * 2, - (GetSize().height - itemHeight) / 2, blockWidth[2], itemHeight)); - __pItems.at(3)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + separatorWidth * 3, - (GetSize().height - itemHeight) / 2, blockWidth[3], itemHeight)); - __pItems.at(4)->SetBounds(Rectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3] + separatorWidth * 4, - (GetSize().height - itemHeight) / 2, blockWidth[4], itemHeight)); + __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight)); + __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight)); + __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2, + (GetSizeF().height - itemHeight) / 2, blockWidth[2], itemHeight)); + __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3, + (GetSizeF().height - itemHeight) / 2, blockWidth[3], itemHeight)); + __pItems.at(4)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3] + dividerWidth * 4, + (GetSizeF().height - itemHeight) / 2, blockWidth[4], itemHeight)); } for (int i = 0; i < __itemCount; i++) @@ -4424,14 +4932,14 @@ _Toolbar::RearrangeButtonItems(void) if (existingBadgeIcon) { - existingBadgeIcon->SetPosition(Point(blockWidth[i] - existingBadgeIcon->GetSize().width, 0)); + existingBadgeIcon->SetPosition(FloatPoint(blockWidth[i] - existingBadgeIcon->GetSizeF().width, 0)); existingBadgeIcon = null; } } } } - int buttonTextFontSize = 0; + float buttonTextFontSize = 0.0f; for (int i = 0; i < __itemCount; i++) { @@ -4476,7 +4984,7 @@ _Toolbar::RearrangeButtonItems(void) __pItems.at(i)->SetTextSize(buttonTextFontSize, FONT_STYLE_BOLD); - RealignIcon(__pItems.at(i)); + RealignItem(__pItems.at(i)); } return E_SUCCESS; @@ -4496,93 +5004,37 @@ _Toolbar::SetAnimation(ToolbarAnimationPosition animationPos) } } - Bitmap* pProcessingBitmap[PROCESSING_ANIMATION_COUNT]; - - for (int i = 0; i < PROCESSING_ANIMATION_COUNT ; i++) - { - pProcessingBitmap[i] = null; - } - - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_01, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[0]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_02, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[1]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_03, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[2]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_04, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[3]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_05, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[4]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_06, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[5]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_07, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[6]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_08, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[7]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_09, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[8]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_10, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[9]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_11, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[10]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_12, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[11]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_13, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[12]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_14, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[13]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_15, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[14]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_16, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[15]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_17, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[16]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_18, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[17]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_19, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[18]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_20, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[19]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_21, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[20]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_22, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[21]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_23, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[22]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_24, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[23]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_25, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[24]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_26, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[25]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_27, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[26]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_28, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[27]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_29, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[28]); - GET_BITMAP_CONFIG_N(HEADER::PROCESSING_ANIMATION_30, BITMAP_PIXEL_FORMAT_ARGB8888, pProcessingBitmap[29]); - - // Create AnimationFrames - long duration = 500 / PROCESSING_ANIMATION_COUNT; - - AnimationFrame* pAniFrame[PROCESSING_ANIMATION_COUNT]; - - for (int i = 0; i < PROCESSING_ANIMATION_COUNT ; i++) - { - pAniFrame[i] = new (std::nothrow) AnimationFrame(*pProcessingBitmap[i], duration); - } - - __pAnimationFrameList = new (std::nothrow) ArrayList(); - if (__pAnimationFrameList) + if (__pAnimationFrameList[animationPos]) { - __pAnimationFrameList->Construct(); + __pAnimationFrameList[animationPos]->RemoveAll(true); - for (int i = 0; i < PROCESSING_ANIMATION_COUNT ; i++) - { - __pAnimationFrameList->Add(*pAniFrame[i]); - } + delete __pAnimationFrameList[animationPos]; + __pAnimationFrameList[animationPos] = null; } - // Deallocate a Bitmap. - for (int i = 0 ; i < PROCESSING_ANIMATION_COUNT ; i++) - { - delete pProcessingBitmap[i]; - pProcessingBitmap[i] = null; - } + result r = GET_ANIMATION_CONFIG_N(HEADER::PROCESSING_ANIMATION, __pAnimationFrameList[animationPos]); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Couldn't get an animationframe."); delete __pAnimation[animationPos]; __pAnimation[animationPos] = null; __pAnimation[animationPos] = _Animation::CreateAnimationN(); - int processingAnimationIconSize = 0; + float processingAnimationIconSize = 0.0f; GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_SIZE, GetOrientation(), processingAnimationIconSize); if (__pAnimation[animationPos]) { - __pAnimation[animationPos]->SetSize(Dimension(processingAnimationIconSize, processingAnimationIconSize)); + __pAnimation[animationPos]->SetSize(FloatDimension(processingAnimationIconSize, processingAnimationIconSize)); - if (__pAnimationFrameList) + if (__pAnimationFrameList[animationPos]) { - __pAnimation[animationPos]->SetAnimationFrames(*__pAnimationFrameList); + __pAnimation[animationPos]->SetAnimationFrames(*__pAnimationFrameList[animationPos]); + __pAnimation[animationPos]->SetImageCount(__pAnimationFrameList[animationPos]->GetCount()); + __pAnimation[animationPos]->SetRepeatCount(100); + __pAnimation[animationPos]->AddAnimationEventListener(*this); } - __pAnimation[animationPos]->SetImageCount(PROCESSING_ANIMATION_COUNT); - __pAnimation[animationPos]->SetRepeatCount(100); - __pAnimation[animationPos]->AddAnimationEventListener(*this); - if (animationPos == TOOLBAR_ANIMATION_POSITION_TITLE) { @@ -4592,17 +5044,28 @@ _Toolbar::SetAnimation(ToolbarAnimationPosition animationPos) { __pButtonItems[LEFT_BUTTON]->AttachChild(*__pAnimation[animationPos]); + float topTouchMargin = __pButtonItems[LEFT_BUTTON]->GetTopTouchMarginF(); + float bottomTouchMargin = __pButtonItems[LEFT_BUTTON]->GetBottomTouchMarginF(); + SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT, - (__pButtonItems[LEFT_BUTTON]->GetSize().width - processingAnimationIconSize) / 2, - (__pButtonItems[LEFT_BUTTON]->GetSize().height - processingAnimationIconSize) / 2); + (__pButtonItems[LEFT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2, + topTouchMargin + (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2); } else if (animationPos == TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT) { __pButtonItems[RIGHT_BUTTON]->AttachChild(*__pAnimation[animationPos]); + float topTouchMargin = __pButtonItems[RIGHT_BUTTON]->GetTopTouchMarginF(); + float bottomTouchMargin = __pButtonItems[RIGHT_BUTTON]->GetBottomTouchMarginF(); + SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT, - (__pButtonItems[RIGHT_BUTTON]->GetSize().width - processingAnimationIconSize) / 2, - (__pButtonItems[RIGHT_BUTTON]->GetSize().height - processingAnimationIconSize) / 2); + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2, + topTouchMargin + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2); + } + _AccessibilityContainer* pContainer = __pAnimation[animationPos]->GetAccessibilityContainer(); + if (pContainer) + { + pContainer->Activate(false); } } @@ -4737,7 +5200,7 @@ _Toolbar::SetPropertyDisabledButtonColor(const Variant& color) Bitmap* __pBaseBackgroundBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); for (int i = 0; i < BUTTON_MAX; i++) { @@ -4790,7 +5253,7 @@ _Toolbar::SetPropertyHighlightedButtonColor(const Variant& color) Bitmap* __pBaseBackgroundBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); for (int i = 0; i < BUTTON_MAX; i++) { @@ -4843,7 +5306,7 @@ _Toolbar::SetPropertyNormalButtonColor(const Variant& color) Bitmap* __pBaseBackgroundBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); for (int i = 0; i < BUTTON_MAX; i++) { @@ -4896,7 +5359,7 @@ _Toolbar::SetPropertyPressedButtonColor(const Variant& color) Bitmap* __pBaseBackgroundBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); for (int i = 0; i < BUTTON_MAX; i++) { @@ -4951,11 +5414,11 @@ _Toolbar::SetPropertyDisabledItemColor(const Variant& color) if (__style == TOOLBAR_TEXT || __style == TOOLBAR_ICON || __style == TOOLBAR_ICON_TEXT) { - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } else { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } for (int i = 0; i < __itemCount; i++) @@ -5011,11 +5474,11 @@ _Toolbar::SetPropertyHighlightedItemColor(const Variant& color) if (__style == TOOLBAR_TEXT || __style == TOOLBAR_ICON || __style == TOOLBAR_ICON_TEXT) { - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } else { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } for (int i = 0; i < __itemCount; i++) @@ -5075,7 +5538,7 @@ _Toolbar::SetPropertyNormalItemColor(const Variant& color) } else { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } for (int i = 0; i < __itemCount; i++) @@ -5131,12 +5594,16 @@ _Toolbar::SetPropertyPressedItemColor(const Variant& color) if (__style == TOOLBAR_TEXT || __style == TOOLBAR_ICON || __style == TOOLBAR_ICON_TEXT) { - GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(FOOTER::BUTTON_ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } - else + else if (__style == TOOLBAR_HEADER_SEGMENTED || __style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE) { GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } + else + { + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + } for (int i = 0; i < __itemCount; i++) { @@ -5195,7 +5662,7 @@ _Toolbar::SetPropertySelectedItemColor(const Variant& color) } else { - GET_BITMAP_CONFIG_N(HEADER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); + GET_BITMAP_CONFIG_N(HEADER::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBaseBackgroundBitmap); } for (int i = 0; i < __itemCount; i++) @@ -5245,7 +5712,253 @@ _Toolbar::GetPropertySelectedItemTextColor(void) const Rectangle _Toolbar::GetButtonBounds(ToolbarButton position) const { - return __pButtonItems[position]->GetBounds(); + return _CoordinateSystemUtils::ConvertToInteger(GetButtonBoundsF(position)); +} + +FloatRectangle +_Toolbar::GetButtonBoundsF(ToolbarButton position) const +{ + FloatRectangle bounds = __pButtonItems[position]->GetBoundsF(); + + float leftTouchMargin = __pButtonItems[position]->GetLeftTouchMarginF(); + float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF(); + float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF(); + float bottomTouchMargin = __pButtonItems[position]->GetBottomTouchMarginF(); + + bounds.x = bounds.x + leftTouchMargin; + bounds.y = bounds.y + topTouchMargin; + bounds.width = bounds.width - (leftTouchMargin + rightTouchMargin); + bounds.height = bounds.height - (topTouchMargin + bottomTouchMargin); + + return bounds; +} + +result +_Toolbar::SetTitleBadgeIcon(const Bitmap* pBadgeIcon) +{ + if (pBadgeIcon == null) + { + return E_SUCCESS; + } + + if (__pTitleBadgeIcon) + { + DetachChild(*__pTitleBadgeIcon); + + delete __pTitleBadgeIcon; + __pTitleBadgeIcon = null; + } + + float height = 0.0f; + GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT, GetOrientation(), height); + + __pTitleBadgeIcon = _Label::CreateLabelN(); + + if (__pTitleBadgeIcon) + { + __pTitleBadgeIcon->SetBounds(FloatRectangle(0.0f, 0.0f, height, height)); + __pTitleBadgeIcon->SetBackgroundBitmap(*pBadgeIcon); + + AttachChild(*__pTitleBadgeIcon); + SetChildAlwaysOnTop(*__pTitleBadgeIcon); + } + + return E_SUCCESS; +} + +result +_Toolbar::SetTitleNumberedBadgeIcon(int number) +{ + SysTryReturnResult(NID_UI_CTRL, (number >= 0 && number < 100000), E_INVALID_ARG, + "[E_INVALID_ARG] The number is out of bounds."); + + if (__pTitleBadgeIcon) + { + DetachChild(*__pTitleBadgeIcon); + + delete __pTitleBadgeIcon; + __pTitleBadgeIcon = null; + } + + if (number != 0) + { + __pTitleBadgeIcon = _Label::CreateLabelN(); + + SysTryReturnResult(NID_UI_CTRL, __pTitleBadgeIcon, E_INVALID_STATE, "[E_INVALID_STATE] The badge icon instance isn't constructed."); + + Bitmap* pNumberedBadgeIconBitmap = null; + Bitmap* pNumberedBadgeIconEffectBitmap = null; + Bitmap* pColorReplacedBitmap = null; + Color badgeIconBgColor; + Color badgeIconTextColor; + + GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconBitmap); + + bool themeBadgeNormalBackgroundBitmap = IS_CUSTOM_BITMAP(HEADER::BADGE_ICON_BG_NORMAL); + if (!themeBadgeNormalBackgroundBitmap) + { + GET_BITMAP_CONFIG_N(HEADER::BADGE_ICON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNumberedBadgeIconEffectBitmap); + } + + GET_COLOR_CONFIG(HEADER::BADGE_ICON_BG_NORMAL, badgeIconBgColor); + GET_COLOR_CONFIG(HEADER::BADGE_ICON_TEXT_NORMAL, badgeIconTextColor); + + if (pNumberedBadgeIconBitmap) + { + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pNumberedBadgeIconBitmap, + Color::GetColor(COLOR_ID_MAGENTA), badgeIconBgColor); + + __pTitleBadgeIcon->SetBackgroundBitmap(*pColorReplacedBitmap); + + delete pColorReplacedBitmap; + delete pNumberedBadgeIconBitmap; + } + + if (pNumberedBadgeIconEffectBitmap) + { + __pTitleBadgeIcon->SetBackgroundEffectBitmap(*pNumberedBadgeIconEffectBitmap); + + delete pNumberedBadgeIconEffectBitmap; + } + + __pTitleBadgeIcon->SetTextHorizontalAlignment(ALIGNMENT_RIGHT); + __pTitleBadgeIcon->SetTextVerticalAlignment(ALIGNMENT_MIDDLE); + __pTitleBadgeIcon->SetTextColor(badgeIconTextColor); + __pTitleBadgeIcon->SetMargin(0, 10); + + // SetTitleNumberedBadgeIcon + + Integer tempNumber(number); + + __pTitleBadgeIcon->SetText(tempNumber.ToString()); + + float fontSize = 0.0f; + float height = 0.0f; + float width = 0.0f; + + GET_SHAPE_CONFIG(HEADER::BADGE_FONT_SIZE, GetOrientation(), fontSize); + GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT, GetOrientation(), height); + + __pTitleBadgeIcon->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL); + + if (number < 10) + { + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_1DIGIT, GetOrientation(), width); + } + else if (number < 100) + { + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width); + } + else if (number < 1000) + { + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_3DIGIT, GetOrientation(), width); + } + else if (number < 10000) + { + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_4DIGIT, GetOrientation(), width); + } + else + { + GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_5DIGIT, GetOrientation(), width); + } + + __pTitleBadgeIcon->SetBounds(FloatRectangle(0.0f, 0.0f, width, height)); + + AttachChild(*__pTitleBadgeIcon); + SetChildAlwaysOnTop(*__pTitleBadgeIcon); + } + + return E_SUCCESS; +} + +result +_Toolbar::SetHideButton(bool hideButton) +{ + SysTryReturnResult(NID_UI_CTRL, __pButtonItems[BACK_BUTTON], E_INVALID_OPERATION, + "[E_INVALID_OPERATION] BackButton is not exist."); + + Bitmap* pColorReplacedBitmap = null; + Bitmap* pIconNormalBitmap = null; + Bitmap* pIconNormalEffectBitmap = null; + + float iconSize = 0.0f; + float buttonWidth = __pButtonItems[BACK_BUTTON]->GetSizeF().width; + float buttonHeight = __pButtonItems[BACK_BUTTON]->GetSizeF().height; + bool themeBackNormalBitmap = IS_CUSTOM_BITMAP(FOOTER::BACK_ICON_NORMAL); + + GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_ICON_SIZE, GetOrientation(), iconSize); + + if (hideButton) + { + GET_BITMAP_CONFIG_N(FOOTER::HIDE_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconNormalBitmap); + + if (!themeBackNormalBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::HIDE_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconNormalEffectBitmap); + } + } + else + { + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconNormalBitmap); + + if (!themeBackNormalBitmap) + { + GET_BITMAP_CONFIG_N(FOOTER::BACK_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pIconNormalEffectBitmap); + } + } + + if (pIconNormalBitmap) + { + Color normalColor; + Color pressedColor; + Color disabledColor; + + GET_COLOR_CONFIG(FOOTER::BACK_ICON_NORMAL, normalColor); + GET_COLOR_CONFIG(FOOTER::BACK_ICON_PRESSED, pressedColor); + GET_COLOR_CONFIG(FOOTER::BACK_ICON_DISABLED, disabledColor); + + pIconNormalBitmap->Scale(FloatDimension(iconSize, iconSize)); + + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), normalColor); + if (pColorReplacedBitmap) + { + __pButtonItems[BACK_BUTTON]->SetBitmap(_BUTTON_STATUS_NORMAL, + FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + + delete pColorReplacedBitmap; + } + + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedColor); + if (pColorReplacedBitmap) + { + __pButtonItems[BACK_BUTTON]->SetBitmap(_BUTTON_STATUS_PRESSED, + FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + delete pColorReplacedBitmap; + } + + pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pIconNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), disabledColor); + if (pColorReplacedBitmap) + { + __pButtonItems[BACK_BUTTON]->SetBitmap(_BUTTON_STATUS_DISABLED, + FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pColorReplacedBitmap); + delete pColorReplacedBitmap; + } + + delete pIconNormalBitmap; + } + + if (pIconNormalEffectBitmap) + { + __pButtonItems[BACK_BUTTON]->SetEffectBitmap(_BUTTON_STATUS_NORMAL, FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pIconNormalEffectBitmap); + __pButtonItems[BACK_BUTTON]->SetEffectBitmap(_BUTTON_STATUS_PRESSED, FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pIconNormalEffectBitmap); + __pButtonItems[BACK_BUTTON]->SetEffectBitmap(_BUTTON_STATUS_SELECTED, FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pIconNormalEffectBitmap); + __pButtonItems[BACK_BUTTON]->SetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED, FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pIconNormalEffectBitmap); + __pButtonItems[BACK_BUTTON]->SetEffectBitmap(_BUTTON_STATUS_DISABLED, FloatPoint((buttonWidth - iconSize) / 2, (buttonHeight - iconSize) / 2), *pIconNormalEffectBitmap); + + delete pIconNormalEffectBitmap; + } + + return E_SUCCESS; } }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp b/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp index af6abb1..7cccc47 100644 --- a/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ToolbarPresenter.cpp @@ -20,11 +20,15 @@ */ #include +#include +#include #include #include #include #include #include +#include "FUiAnim_VisualElementImpl.h" +#include "FUi_CoordinateSystemUtils.h" #include "FUi_UiTouchEvent.h" #include "FUi_ResourceManager.h" #include "FUiCtrl_Label.h" @@ -35,6 +39,7 @@ using namespace Tizen::Base; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Graphics::_Text; +using namespace Tizen::Ui::Animations; namespace Tizen { namespace Ui { namespace Controls { @@ -47,24 +52,42 @@ _ToolbarPresenter::_ToolbarPresenter(void) , __beingEdited(false) , __touchInitiatedInToolbar(false) , __editItemIndex(-1) - , __initialPressedItemIndex(-1) + , __pressedItemIndex(-1) , __initialPressesItemStatus(_BUTTON_STATUS_NORMAL) , __pEditItem(null) , __pTitleBackgroundBitmap(null) + , __pBouncingEffectBitmap(null) , __pTitleSlideTimer(null) - , __titleRect(Rectangle(0, 0, 0, 0)) - , __descriptionRect(Rectangle(0, 0, 0, 0)) + , __pFlickAnimationTimer(null) + , __titleRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) + , __descriptionRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f)) , __titleText(L"") , __pTitleTextFont(null) , __pTextFont(null) , __pDescriptionTextObject(null) , __pTitleTextObject(null) - , __titleSlidingAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT) + , __pBouncingEffectVe(null) + , __flickAnimation() + , __moveDistance(0.0f) + , __flickMove(0.0f) + , __flickDistance(0.0f) + , __flickFlag(0) + , __firstLoadedItemIndex(0) + , __lastLoadedItemIndex(0) + , __tabSlideLeft(false) + , __tabSlideRight(false) + , __portraitSize(FloatDimension(0.0f, 0.0f)) + , __landscapeSize(FloatDimension(0.0f, 0.0f)) , __fontStyle(0) - , __fontSize(0) - , __touchMoveHandled(false) + , __fontSize(0.0f) + , __tabMoved(false) + , __isBouncingEffectStarted(false) + , __bouncingEffectWidth(0.0f) + , __bouncingEffectHeight(0.0f) + , __titlePressed(false) + , __titleSliding(false) { - __currentTouchPosition = Point(0, 0); + __currentTouchPosition = FloatPoint(0.0f, 0.0f); } _ToolbarPresenter::~_ToolbarPresenter(void) @@ -88,12 +111,24 @@ _ToolbarPresenter::~_ToolbarPresenter(void) __pTitleBackgroundBitmap = null; } + if (__pBouncingEffectBitmap) + { + delete __pBouncingEffectBitmap; + __pBouncingEffectBitmap = null; + } + if (__pTitleSlideTimer) { delete __pTitleSlideTimer; __pTitleSlideTimer = null; } + if (__pFlickAnimationTimer) + { + delete __pFlickAnimationTimer; + __pFlickAnimationTimer = null; + } + if (__pDescriptionTextObject) { delete __pDescriptionTextObject; @@ -105,6 +140,13 @@ _ToolbarPresenter::~_ToolbarPresenter(void) delete __pTitleTextObject; __pTitleTextObject = null; } + + if (__pBouncingEffectVe) + { + __pBouncingEffectVe->RemoveAllAnimations(); + __pBouncingEffectVe->Destroy(); + __pBouncingEffectVe = null; + } } result @@ -112,8 +154,29 @@ _ToolbarPresenter::Construct(const _Toolbar& toolbar) { __pToolbar = const_cast<_Toolbar*>(&toolbar); + float width = 0.0f; + float height = 0.0f; + __fontStyle = FONT_STYLE_BOLD; + __portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + __landscapeSize = FloatDimension(__portraitSize.height, __portraitSize.width); + + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + width = __portraitSize.width; + height = __portraitSize.height; + } + else + { + width = __landscapeSize.width; + height = __landscapeSize.height; + } + + __flickAnimation.SetSizeInformation(width, height, DEVICE_SIZE_HORIZONTAL, DEVICE_SIZE_VERTICAL); + __flickAnimation.SetSensitivity(FLICK_ANIMATION_FPS_TAB, FLICK_ANIMATION_SENSITIVITY_TAB); + __flickAnimation.SetDirection(FD_HORIZONTAL); + return E_SUCCESS; } @@ -134,7 +197,7 @@ _ToolbarPresenter::Draw(void) { result r = E_SUCCESS; - ToolbarStyle toolbarStyle = __pToolbar->GetStyle(); + ToolbarStyle style = __pToolbar->GetStyle(); DrawBackground(); @@ -149,57 +212,61 @@ _ToolbarPresenter::Draw(void) return E_SYSTEM; } - int buttonItemGap = 0; - int headerButtonItemHeight = 0; - int separatorHeight = 0; - int rightMargin = 0; + float buttonItemGap = 0.0f; + float dividerBaseHeight = 0.0f; + float dividerHeight = 0.0f; - int footerButtonItemWidth = 0; - int footerButtonItemHeight = 0; - int fontSize; + float footerButtonItemWidth = 0.0f; + float footerButtonItemHeight = 0.0f; + float fontSize = 0.0f; - Rectangle bounds(0, 0, __pToolbar->GetBounds().width, __pToolbar->GetBounds().height); + float rightMargin = 0.0f; + float dividerTopMargin = 0.0f; + float segmentedItemHeight = 0.0f; - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + FloatRectangle bounds(0.0f, 0.0f, __pToolbar->GetBoundsF().width, __pToolbar->GetBoundsF().height); + + int itemCount = __pToolbar->GetItemCount(); + + __portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + __landscapeSize = FloatDimension(__portraitSize.height, __portraitSize.width); if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) { - if (bounds.width > portraitSize.width) + if (bounds.width > __portraitSize.width) { - bounds.width = portraitSize.width; + bounds.width = __portraitSize.width; } } else { - if (bounds.width > landscapeSize.width) + if (bounds.width > __landscapeSize.width) { - bounds.width = landscapeSize.width; + bounds.width = __landscapeSize.width; } } - int segmentedTitleTextAreaHeight = 0; - - if (toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || toolbarStyle == TOOLBAR_TAB_WITH_TITLE) + if (style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE) { - GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, __pToolbar->GetOrientation(), headerButtonItemHeight); - GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), segmentedTitleTextAreaHeight); + GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, __pToolbar->GetOrientation(), dividerBaseHeight); + GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), dividerTopMargin); } else { - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_HEIGHT, __pToolbar->GetOrientation(), headerButtonItemHeight); - GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, __pToolbar->GetOrientation(), segmentedTitleTextAreaHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_ICON_SIZE, __pToolbar->GetOrientation(), dividerBaseHeight); + GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_ICON_TOP_MARGIN, __pToolbar->GetOrientation(), dividerTopMargin); } - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, __pToolbar->GetOrientation(), buttonItemGap); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_HEIGHT, __pToolbar->GetOrientation(), separatorHeight); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, __pToolbar->GetOrientation(), buttonItemGap); + GET_SHAPE_CONFIG(HEADER::DIVIDER_HEIGHT, __pToolbar->GetOrientation(), dividerHeight); GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN, __pToolbar->GetOrientation(), rightMargin); + GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, __pToolbar->GetOrientation(), segmentedItemHeight); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, __pToolbar->GetOrientation(), footerButtonItemWidth); GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_HEIGHT, __pToolbar->GetOrientation(), footerButtonItemHeight); - if ((toolbarStyle == TOOLBAR_TITLE || toolbarStyle == TOOLBAR_HEADER_SEGMENTED || toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE - || toolbarStyle == TOOLBAR_TAB || toolbarStyle == TOOLBAR_TAB_WITH_TITLE || toolbarStyle == TOOLBAR_TEXT)) + if ((style == TOOLBAR_TITLE || style == TOOLBAR_HEADER_SEGMENTED || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE + || style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE || style == TOOLBAR_TEXT)) { if (__pTitleBackgroundBitmap) { @@ -207,7 +274,7 @@ _ToolbarPresenter::Draw(void) __pTitleBackgroundBitmap = null; } - if (toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || toolbarStyle == TOOLBAR_TAB_WITH_TITLE) + if (style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE) { GET_SHAPE_CONFIG(HEADER::TITLE_FONT_SIZE_WITH_SEGMENTED, __pToolbar->GetOrientation(), fontSize); @@ -222,7 +289,7 @@ _ToolbarPresenter::Draw(void) __pTitleTextObject->SetFont(__pTitleTextFont, 0, __pTitleTextObject->GetTextLength()); } } - else if (toolbarStyle == TOOLBAR_TITLE && __pToolbar->GetDescriptionText() != L"" + else if (style == TOOLBAR_TITLE && __pToolbar->GetDescriptionText() != L"" && __pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) == ANIMATION_STOPPED) { GET_SHAPE_CONFIG(HEADER::TITLE_TOP_MARGIN_WITH_DESCRIPTION, __pToolbar->GetOrientation(), __titleRect.y); @@ -249,7 +316,7 @@ _ToolbarPresenter::Draw(void) DrawTitleText(pCanvas); } - if (toolbarStyle == TOOLBAR_TITLE || toolbarStyle == TOOLBAR_HEADER_SEGMENTED || toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) + if (style == TOOLBAR_TITLE || style == TOOLBAR_HEADER_SEGMENTED || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) { if (__pToolbar->GetButton(RIGHT_BUTTON)) { @@ -257,49 +324,44 @@ _ToolbarPresenter::Draw(void) { if (__pToolbar->GetButton(LEFT_BUTTON)->GetText() != L"" && __pToolbar->GetButton(RIGHT_BUTTON)->GetText() != L"") { - DrawSeparator(TOOLBAR_SEPARATOR_HEADER_BUTTON, Point(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBounds().width - buttonItemGap - rightMargin, - segmentedTitleTextAreaHeight + (headerButtonItemHeight - separatorHeight) / 2), pCanvas); + DrawDivider(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap - rightMargin, + dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas); } } } } - - int itemCount = __pToolbar->GetItemCount(); - if (itemCount == 1) { - //DrawSeparator(TOOLBAR_SEPARATOR_FOOTER_BUTTON, Point(__pToolbar->GetItem(0)->GetBounds().x + __pToolbar->GetItem(0)->GetBounds().width, - // (__pToolbar->GetBounds().height - separatorHeight) / 2), pCanvas); + ; // empty } else { - if (toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || toolbarStyle == TOOLBAR_TAB_WITH_TITLE) + if (style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE) { for (int i = 0; i < itemCount - 1 ; i++) { - DrawSeparator(TOOLBAR_SEPARATOR_FOOTER_BUTTON, Point(__pToolbar->GetItem(i)->GetBounds().x + __pToolbar->GetItem(i)->GetBounds().width, - segmentedTitleTextAreaHeight + (headerButtonItemHeight - separatorHeight) / 2), pCanvas); + DrawDivider(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width, + dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas); } } else { for (int i = 0; i < itemCount - 1 ; i++) { - if (!(toolbarStyle == TOOLBAR_TEXT || toolbarStyle == TOOLBAR_ICON || toolbarStyle == TOOLBAR_ICON_TEXT)) + if (!(style == TOOLBAR_TEXT || style == TOOLBAR_ICON || style == TOOLBAR_ICON_TEXT)) { - DrawSeparator(TOOLBAR_SEPARATOR_FOOTER_BUTTON, Point(__pToolbar->GetItem(i)->GetBounds().x + __pToolbar->GetItem(i)->GetBounds().width, - (__pToolbar->GetBounds().height - separatorHeight) / 2), pCanvas); + DrawDivider(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width, + (__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas); } } } } - if (__initialDraw) { - if ((toolbarStyle == TOOLBAR_TAB || toolbarStyle == TOOLBAR_TAB_WITH_TITLE - || toolbarStyle == TOOLBAR_SEGMENTED || toolbarStyle == TOOLBAR_HEADER_SEGMENTED || toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) + if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE + || style == TOOLBAR_SEGMENTED || style == TOOLBAR_HEADER_SEGMENTED || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE) && __pToolbar->GetItemCount() > 0 && __pToolbarModel->GetSelectedItemIndex() == -1) { int firstEnabledItemIndex = __pToolbar->GetFirstEnabledItemIndex(); @@ -330,11 +392,11 @@ _ToolbarPresenter::DrawBackground(void) return; } + ToolbarStyle style = __pToolbar->GetStyle(); + pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); - ToolbarStyle style = __pToolbar->GetStyle(); - if (style == TOOLBAR_SOFTKEY) { delete pCanvas; @@ -345,23 +407,23 @@ _ToolbarPresenter::DrawBackground(void) Bitmap* pReplacementColorBackgroundBitmap = null; Bitmap* pBackgroundBitmap = null; - Rectangle bounds(0, 0, __pToolbar->GetBounds().width, __pToolbar->GetBounds().height); + FloatRectangle bounds(0.0f, 0.0f, __pToolbar->GetBoundsF().width, __pToolbar->GetBoundsF().height); - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + __portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + __landscapeSize = FloatDimension(__portraitSize.height, __portraitSize.width); if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) { - if (bounds.width > portraitSize.width) + if (bounds.width > __portraitSize.width) { - bounds.width = portraitSize.width; + bounds.width = __portraitSize.width; } } else { - if (bounds.width > landscapeSize.width) + if (bounds.width > __landscapeSize.width) { - bounds.width = landscapeSize.width; + bounds.width = __landscapeSize.width; } } @@ -380,7 +442,7 @@ _ToolbarPresenter::DrawBackground(void) } else { - pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, Rectangle(0, 0, pBackgroundBitmap->GetWidth(), pBackgroundBitmap->GetHeight())); + pCanvas->DrawBitmap(bounds, *pBackgroundBitmap, FloatRectangle(0.0f, 0.0f, pBackgroundBitmap->GetWidthF(), pBackgroundBitmap->GetHeightF())); } } else @@ -398,8 +460,7 @@ _ToolbarPresenter::DrawBackground(void) } else { - pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, Rectangle(0, 0, pReplacementColorBackgroundBitmap->GetWidth(), - pReplacementColorBackgroundBitmap->GetHeight())); + pCanvas->DrawBitmap(bounds, *pReplacementColorBackgroundBitmap, FloatRectangle(0.0f, 0.0f, pReplacementColorBackgroundBitmap->GetWidthF(), pReplacementColorBackgroundBitmap->GetHeightF())); } } else @@ -419,9 +480,9 @@ _ToolbarPresenter::DrawDescriptionText(void) { result r = E_SUCCESS; - int textAreaHeight = 0; - int fontSize = 0; - int titleIconWidth = 0; + float textAreaHeight = 0.0f; + float fontSize = 0.0f; + float titleIconWidth = 0.0f; GET_SHAPE_CONFIG(HEADER::DESCRIPTION_TEXT_HEIGHT, __pToolbar->GetOrientation(), textAreaHeight); GET_SHAPE_CONFIG(HEADER::DESCRIPTION_TEXT_FONT_SIZE, __pToolbar->GetOrientation(), fontSize); @@ -474,17 +535,17 @@ _ToolbarPresenter::DrawDescriptionText(void) } void -_ToolbarPresenter::DrawEditItem(const Point& point) +_ToolbarPresenter::DrawEditItem(const FloatPoint& point) { if (__pEditItem == null ) { return; } - Point anchor = Point(0,0); + FloatPoint anchor = FloatPoint(0.0f, 0.0f); - anchor.x = point.x - (__pEditItem->GetSize().width / 2); - anchor.y = point.y - (__pEditItem->GetSize().width / 2); + anchor.x = point.x - (__pEditItem->GetSizeF().width / 2); + anchor.y = point.y - (__pEditItem->GetSizeF().height / 2); __pEditItem->SetPosition(anchor); @@ -494,55 +555,57 @@ _ToolbarPresenter::DrawEditItem(const Point& point) } void -_ToolbarPresenter::DrawSeparator(ToolbarSeparatorType type, const Point& point, Canvas* pCanvas) +_ToolbarPresenter::DrawDivider(const FloatPoint& point, Canvas* pCanvas) { - if (__pToolbar->GetStyle() == TOOLBAR_SOFTKEY) + ToolbarStyle style = __pToolbar->GetStyle(); + + if (style == TOOLBAR_SOFTKEY) { return ; } - int separatorWidth = 0; - int separatorHeight = 0; + float dividerWidth = 0.0f; + float dividerHeight = 0.0f; - GET_SHAPE_CONFIG(HEADER::SEPARATOR_WIDTH, __pToolbar->GetOrientation(), separatorWidth); - GET_SHAPE_CONFIG(HEADER::SEPARATOR_HEIGHT, __pToolbar->GetOrientation(), separatorHeight); + GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, __pToolbar->GetOrientation(), dividerWidth); + GET_SHAPE_CONFIG(HEADER::DIVIDER_HEIGHT, __pToolbar->GetOrientation(), dividerHeight); if (!__pToolbar->IsTransparent()) { - Bitmap* pSeparatorBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::DIVIDER_LINE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pSeparatorBitmap); + Bitmap* pDividerBitmap = null; + GET_BITMAP_CONFIG_N(HEADER::DIVIDER_LINE_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDividerBitmap); - if (pSeparatorBitmap) + if (pDividerBitmap) { - if (pSeparatorBitmap->IsNinePatchedBitmap()) + if (pDividerBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(point.x, point.y, separatorWidth, separatorHeight), *pSeparatorBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(point.x, point.y, dividerWidth, dividerHeight)), *pDividerBitmap); } else { - pCanvas->DrawBitmap(Point(point.x, point.y), *pSeparatorBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(point.x, point.y)), *pDividerBitmap); } - delete pSeparatorBitmap; + delete pDividerBitmap; } } else { - Bitmap* pTranslucentSeparatorBitmap = null; - GET_BITMAP_CONFIG_N(HEADER::DIVIDER_LINE_TRANSLUCENT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTranslucentSeparatorBitmap); + Bitmap* pTranslucentDividerBitmap = null; + GET_BITMAP_CONFIG_N(HEADER::DIVIDER_LINE_TRANSLUCENT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTranslucentDividerBitmap); - if (pTranslucentSeparatorBitmap) + if (pTranslucentDividerBitmap) { - if (pTranslucentSeparatorBitmap->IsNinePatchedBitmap()) + if (pTranslucentDividerBitmap->IsNinePatchedBitmap()) { - pCanvas->DrawNinePatchedBitmap(Rectangle(point.x, point.y, separatorWidth, separatorHeight), *pTranslucentSeparatorBitmap); + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(point.x, point.y, dividerWidth, dividerHeight)), *pTranslucentDividerBitmap); } else { - pCanvas->DrawBitmap(Point(point.x, point.y), *pTranslucentSeparatorBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(point.x, point.y)), *pTranslucentDividerBitmap); } - delete pTranslucentSeparatorBitmap; + delete pTranslucentDividerBitmap; } } @@ -550,6 +613,98 @@ _ToolbarPresenter::DrawSeparator(ToolbarSeparatorType type, const Point& point, } void +_ToolbarPresenter::LoadBouncingEffectBitmap(ToolbarStyle style, bool isHeader, bool moveRight) +{ + if (__pBouncingEffectBitmap != null) + { + delete __pBouncingEffectBitmap; + } + + if (style == TOOLBAR_TAB) + { + if (isHeader) + { + if (moveRight) + { + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + else + { + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + } + else + { + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + else + { + GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + } + } + else // FOOTER_TAB + { + if (moveRight) + { + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + else + { + GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + } + else + { + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + else + { + GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + } + } + } + else if (style == TOOLBAR_TAB_WITH_TITLE) + { + if (moveRight) + { + GET_BITMAP_CONFIG_N(HEADER::TITLE_TAB_ITEM_BOUNCING_EFFECT_LEFT, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + else + { + GET_BITMAP_CONFIG_N(HEADER::TITLE_TAB_ITEM_BOUNCING_EFFECT_RIGHT, + BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap); + } + } + + if (__pBouncingEffectBitmap) + { + __bouncingEffectWidth = __pBouncingEffectBitmap->GetWidthF(); + __bouncingEffectHeight = __pBouncingEffectBitmap->GetHeightF(); + } + + return; +} + +void _ToolbarPresenter::DrawItems(void) { result r = E_SUCCESS; @@ -558,54 +713,61 @@ _ToolbarPresenter::DrawItems(void) SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, E_INVALID_STATE, "[E_INVALID_STATE] System error occurred."); - Rectangle usableArea = __toolbarUsableArea; - - Bitmap* pTitleIcon = __pToolbar->GetTitleIcon(); - - int iconWidth = 0; - int titleDisplayHeight = 0; - int iconAreaHeight = 0; - int leftMargin = 0; - int headerTopMargin = 0; - int processingAnimationIconSize = 0; - int processingAnimationIconGap = 0; - int titleCharacterCount = 0; - int fontSize = 0; - Dimension titleTextDimension(0, 0); - int totalWidth = 0; - int titleHeight = 0; + ToolbarStyle style = __pToolbar->GetStyle(); - ToolbarStyle toolbarStyle = __pToolbar->GetStyle(); + FloatRectangle usableArea = __toolbarUsableArea; - GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, __pToolbar->GetOrientation(), leftMargin); // 16 - GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_SIZE, __pToolbar->GetOrientation(), processingAnimationIconSize); // 32 - GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_GAP, __pToolbar->GetOrientation(), processingAnimationIconGap); // 32 + Bitmap* pTitleIcon = __pToolbar->GetTitleIcon(); - if (__pToolbar->GetStyle() == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE) + _Label* pTitleBadgeIcon = __pToolbar->GetTitleBadgeIcon(); + + float iconWidth = 0.0f; + float titleDisplayHeight = 0.0f; + float iconAreaHeight = 0.0f; + float leftMargin = 0.0f; + float headerTopMargin = 0.0f; + float processingAnimationIconSize = 0.0f; + float processingAnimationIconGap = 0.0f; + float titleCharacterCount = 0.0f; + float titleBadgeIconGap = 0.0f; + float titleBadgeIconTopMargin = 0.0f; + float fontSize = 0.0f; + FloatDimension titleTextDimension(0.0f, 0.0f); + float totalWidth = 0.0f; + float titleHeight = 0.0f; + + GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, __pToolbar->GetOrientation(), leftMargin); + GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_SIZE, __pToolbar->GetOrientation(), processingAnimationIconSize); + GET_SHAPE_CONFIG(HEADER::PROCESSING_ANIMATION_ICON_GAP, __pToolbar->GetOrientation(), processingAnimationIconGap); + + GET_SHAPE_CONFIG(HEADER::TITLE_BADGE_ICON_GAP, __pToolbar->GetOrientation(), titleBadgeIconGap); + GET_SHAPE_CONFIG(HEADER::TITLE_BADGE_TOP_MARGIN, __pToolbar->GetOrientation(), titleBadgeIconTopMargin); + + if (style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE) { - GET_SHAPE_CONFIG(HEADER::TITLE_TOP_MARGIN_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), headerTopMargin); // 18, 17 - GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), titleDisplayHeight); // 60 + GET_SHAPE_CONFIG(HEADER::TITLE_TOP_MARGIN_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), headerTopMargin); + GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), titleDisplayHeight); } else { - GET_SHAPE_CONFIG(HEADER::TOP_MARGIN, __pToolbar->GetOrientation(), headerTopMargin); // 34, 17 - GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT, __pToolbar->GetOrientation(), titleDisplayHeight); //64, 64 + GET_SHAPE_CONFIG(HEADER::TOP_MARGIN, __pToolbar->GetOrientation(), headerTopMargin); + GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT, __pToolbar->GetOrientation(), titleDisplayHeight); } - GET_SHAPE_CONFIG(HEADER::ICON_WIDTH, __pToolbar->GetOrientation(), iconWidth); // 38 + GET_SHAPE_CONFIG(HEADER::ICON_WIDTH, __pToolbar->GetOrientation(), iconWidth); - GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT_WITH_DESCRIPTION, __pToolbar->GetOrientation(), iconAreaHeight);//50, 42 + GET_SHAPE_CONFIG(HEADER::TITLE_DISPLAY_HEIGHT_WITH_DESCRIPTION, __pToolbar->GetOrientation(), iconAreaHeight); if (!__titleText.IsEmpty()) { titleCharacterCount = __titleText.GetLength(); // alphabet count - if (toolbarStyle == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || toolbarStyle == TOOLBAR_TAB_WITH_TITLE) + if (style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE) { r = GET_SHAPE_CONFIG(HEADER::TITLE_FONT_SIZE_WITH_SEGMENTED, __pToolbar->GetOrientation(), fontSize); } - else if (toolbarStyle == TOOLBAR_TITLE && __pToolbar->GetDescriptionText() != L"" + else if (style == TOOLBAR_TITLE && __pToolbar->GetDescriptionText() != L"" && __pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) == ANIMATION_STOPPED) { r = GET_SHAPE_CONFIG(HEADER::TITLE_FONT_SIZE_WITH_DESCRIPTION, __pToolbar->GetOrientation(), fontSize); @@ -640,15 +802,20 @@ _ToolbarPresenter::DrawItems(void) if (pTitleIcon) { - pTitleIcon->Scale(Dimension(iconWidth, iconWidth)); + pTitleIcon->Scale(FloatDimension(iconWidth, iconWidth)); } if (pTitleIcon) { - totalWidth += (pTitleIcon->GetWidth() + usableArea.x); + totalWidth += (pTitleIcon->GetWidthF() + usableArea.x); } - if ((__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE)) != ANIMATION_STOPPED) + + if (pTitleBadgeIcon) + { + totalWidth += pTitleBadgeIcon->GetBoundsF().width + titleBadgeIconGap; + } + else if ((__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE)) != ANIMATION_STOPPED) { totalWidth += processingAnimationIconSize + processingAnimationIconGap; } @@ -659,17 +826,23 @@ _ToolbarPresenter::DrawItems(void) if (pTitleIcon) { - pCanvas->DrawBitmap(Point(usableArea.x, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeight()) / 2), *(pTitleIcon)); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(usableArea.x, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); - __titleRect.x = usableArea.x + pTitleIcon->GetWidth() + usableArea.x; + __titleRect.x = usableArea.x + pTitleIcon->GetWidthF() + usableArea.x; __titleRect.y = headerTopMargin + (titleDisplayHeight - titleHeight) / 2; if (__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) != ANIMATION_STOPPED) { __pToolbar->SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_TITLE, - usableArea.x + (pTitleIcon->GetWidth() + processingAnimationIconGap) + __titleRect.width + processingAnimationIconGap, + usableArea.x + (pTitleIcon->GetWidthF() + processingAnimationIconGap) + __titleRect.width + processingAnimationIconGap, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); } + + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(usableArea.x + (pTitleIcon->GetWidthF() + processingAnimationIconGap) + __titleRect.width + titleBadgeIconGap, + titleBadgeIconTopMargin)); + } } else { @@ -682,6 +855,11 @@ _ToolbarPresenter::DrawItems(void) usableArea.x + __titleRect.width + processingAnimationIconGap, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); } + + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(usableArea.x + __titleRect.width + titleBadgeIconGap, titleBadgeIconTopMargin)); + } } } else @@ -690,28 +868,34 @@ _ToolbarPresenter::DrawItems(void) if (pTitleIcon) { - __titleRect.x = leftMargin + pTitleIcon->GetWidth() + leftMargin; + __titleRect.x = leftMargin + pTitleIcon->GetWidthF() + leftMargin; __titleRect.y = headerTopMargin + (titleDisplayHeight - titleHeight) / 2; if(__pTitleTextObject->GetAlignment() & TEXT_OBJECT_ALIGNMENT_CENTER) { - leftMargin = (__titleRect.width - titleTextDimension.width) / 2; + leftMargin = (__titleRect.width - titleTextDimension.width) / 2 - leftMargin; } else if(__pTitleTextObject->GetAlignment() & TEXT_OBJECT_ALIGNMENT_RIGHT) { - leftMargin = __titleRect.width - titleTextDimension.width - leftMargin * 2; + leftMargin = __titleRect.width - titleTextDimension.width - leftMargin * 3; } - pCanvas->DrawBitmap(Point(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeight()) / 2), *(pTitleIcon)); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); if (__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) != ANIMATION_STOPPED) { __pToolbar->SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_TITLE, - usableArea.x + (pTitleIcon->GetWidth() + processingAnimationIconGap) + titleTextDimension.width + processingAnimationIconGap, + usableArea.x + (pTitleIcon->GetWidthF() + processingAnimationIconGap) + titleTextDimension.width + processingAnimationIconGap, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); } - __titleRect.width -= (pTitleIcon->GetWidth() + usableArea.x); + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(usableArea.x + (pTitleIcon->GetWidthF() + processingAnimationIconGap) + titleTextDimension.width + titleBadgeIconGap, + titleBadgeIconTopMargin)); + } + + __titleRect.width -= (pTitleIcon->GetWidthF() + usableArea.x); } else { @@ -724,6 +908,11 @@ _ToolbarPresenter::DrawItems(void) leftMargin + titleTextDimension.width + processingAnimationIconGap, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); } + + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(leftMargin + titleTextDimension.width + titleBadgeIconGap, titleBadgeIconTopMargin)); + } } } } @@ -731,26 +920,31 @@ _ToolbarPresenter::DrawItems(void) { if (pTitleIcon && __pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) != ANIMATION_STOPPED) { - pTitleIcon->Scale(Dimension(iconWidth, iconWidth)); + pTitleIcon->Scale(FloatDimension(iconWidth, iconWidth)); if(__pToolbar->GetTitleTextHorizontalAlignment() == ALIGNMENT_CENTER) { - leftMargin = (leftMargin + usableArea.width - (pTitleIcon->GetWidth() + processingAnimationIconGap + processingAnimationIconSize)) / 2; + leftMargin = (leftMargin + usableArea.width - (pTitleIcon->GetWidthF() + processingAnimationIconGap + processingAnimationIconSize)) / 2; } else if(__pToolbar->GetTitleTextHorizontalAlignment() == ALIGNMENT_RIGHT) { - leftMargin = leftMargin + usableArea.width - (pTitleIcon->GetWidth() + processingAnimationIconGap + processingAnimationIconSize); + leftMargin = leftMargin + usableArea.width - (pTitleIcon->GetWidthF() + processingAnimationIconGap + processingAnimationIconSize); } - pCanvas->DrawBitmap(Point(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeight()) / 2), *(pTitleIcon)); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); __pToolbar->SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_TITLE, leftMargin + processingAnimationIconGap + processingAnimationIconSize, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); + + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(leftMargin + processingAnimationIconGap + titleBadgeIconGap, titleBadgeIconTopMargin)); + } } else if (pTitleIcon) { - pTitleIcon->Scale(Dimension(iconWidth, iconWidth)); + pTitleIcon->Scale(FloatDimension(iconWidth, iconWidth)); if(__pToolbar->GetTitleTextHorizontalAlignment() == ALIGNMENT_CENTER) { @@ -758,10 +952,10 @@ _ToolbarPresenter::DrawItems(void) } else if(__pToolbar->GetTitleTextHorizontalAlignment() == ALIGNMENT_RIGHT) { - leftMargin = usableArea.width - pTitleIcon->GetWidth(); + leftMargin = usableArea.width - pTitleIcon->GetWidthF(); } - pCanvas->DrawBitmap(Point(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeight()) / 2), *(pTitleIcon)); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(FloatPoint(leftMargin, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2)), *(pTitleIcon)); } else { @@ -776,6 +970,11 @@ _ToolbarPresenter::DrawItems(void) __pToolbar->SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_TITLE, leftMargin, headerTopMargin + (titleDisplayHeight - processingAnimationIconSize) / 2); + + if (pTitleBadgeIcon) + { + pTitleBadgeIcon->SetPosition(FloatPoint(leftMargin, titleBadgeIconTopMargin)); + } } } @@ -797,14 +996,18 @@ _ToolbarPresenter::DrawTitleText(Canvas* pCanvas) __pTitleTextObject->SetForegroundColor(__pToolbar->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength()); __pTitleTextObject->SetBounds(__titleRect); __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT); __pTitleTextObject->Compose(); - __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); if (__pTitleTextObject->IsActionOn() == true) { + __pTitleTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas)); + TimerForTitleSlideStart(); } + else + { + __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + } return E_SUCCESS; } @@ -832,8 +1035,8 @@ _ToolbarPresenter::SetDescriptionText(const String& description) { result r = E_SUCCESS; - int length = description.GetLength(); - int fontSize = 0; + float length = description.GetLength(); + float fontSize = 0.0f; wchar_t* tempString = const_cast(description.GetPointer()); @@ -878,9 +1081,11 @@ _ToolbarPresenter::SetItemSelected(int itemIndex) result _ToolbarPresenter::SetInitialDrawState(bool state) { - DrawBackground(); + //DrawBackground(); // remove since 2.1 __initialDraw = state; __titleText = L""; + __titlePressed = false; + __titleSliding = false; return E_SUCCESS; } @@ -898,7 +1103,7 @@ _ToolbarPresenter::SetTitleText(const String& title, HorizontalAlignment alignme { result r = E_SUCCESS; - int length = title.GetLength(); + float length = title.GetLength(); __titleText = String(title); wchar_t* tempString = const_cast(__titleText.GetPointer()); @@ -920,7 +1125,7 @@ _ToolbarPresenter::SetTitleText(const String& title, HorizontalAlignment alignme TextSimple* pSimpleText = new (std::nothrow) TextSimple(tempString, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); __pTitleTextObject->AppendElement(*pSimpleText); - __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT); + __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); switch (alignment) { @@ -938,7 +1143,7 @@ _ToolbarPresenter::SetTitleText(const String& title, HorizontalAlignment alignme break; } - int fontSize; + float fontSize = 0.0f; r = GET_SHAPE_CONFIG(HEADER::TITLE_FONT_SIZE, __pToolbar->GetOrientation(), fontSize); @@ -954,7 +1159,7 @@ _ToolbarPresenter::SetTitleText(const String& title, HorizontalAlignment alignme } result -_ToolbarPresenter::SetUsableAreaBounds(const Rectangle& rect) +_ToolbarPresenter::SetUsableAreaBounds(const FloatRectangle& rect) { __toolbarUsableArea = rect; @@ -964,19 +1169,36 @@ _ToolbarPresenter::SetUsableAreaBounds(const Rectangle& rect) bool _ToolbarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { + ResetFlickAnimationTimer(); + + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + __touchInitiatedInToolbar = true; __currentTouchPosition = touchinfo.GetCurrentPosition(); - __initialPressedItemIndex = __pToolbar->GetItemIndexFromPosition(__currentTouchPosition); + ToolbarStyle style = __pToolbar->GetStyle(); - if (__initialPressedItemIndex == -1) + if (__titleRect.Contains(__currentTouchPosition) + && (style == TOOLBAR_TITLE || style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || style == TOOLBAR_TAB_WITH_TITLE)) + { + __titlePressed = true; + } + else + { + __titlePressed = false; + } + + __pressedItemIndex = __pToolbar->GetItemIndexFromPosition(__currentTouchPosition); + + if (__pressedItemIndex == -1) { return true; } else { - _Button* pPressedButton = __pToolbar->GetItem(__initialPressedItemIndex); + _Button* pPressedButton = __pToolbar->GetItem(__pressedItemIndex); __initialPressesItemStatus = pPressedButton->GetButtonStatus(); @@ -1001,37 +1223,77 @@ _ToolbarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& tou return false; } + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); + + if (__titlePressed && __titleRect.Contains(touchPoint)) + { + if (__titleSliding == true) + { + __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + __pTitleTextObject->Compose(); + + __titleSliding = false; + } + else + { + __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT); + __pTitleTextObject->Compose(); + + __titleSliding = true; + + TimerForTitleSlideStart(); + } + } + + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + + ToolbarStyle style = __pToolbar->GetStyle(); + __touchInitiatedInToolbar = false; - Point touchPoint = touchinfo.GetCurrentPosition(); + if (__pBouncingEffectVe) + { + __pBouncingEffectVe->RemoveAllAnimations(); + __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe); + __pBouncingEffectVe->Destroy(); + __pBouncingEffectVe = null; + } - int currentItemIndex = __pToolbar->GetItemIndexFromPosition(touchPoint); + int releasedItemIndex = __pToolbar->GetItemIndexFromPosition(touchPoint); + float tabLeftMargin = 0.0f; - if ((__pToolbar->GetStyle() == TOOLBAR_TAB || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE)&& __beingEdited == true) + GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin); + + if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __beingEdited == true) { __beingEdited = false; - if (currentItemIndex == -1) + if (releasedItemIndex == -1) { if (__pEditItem) { __pToolbar->DetachChild(*__pEditItem); + delete __pEditItem; __pEditItem = null; } - if (__initialPressedItemIndex != -1) + if (__pressedItemIndex != -1) { - __pToolbar->GetItem(__initialPressedItemIndex)->SetButtonStatus(__initialPressesItemStatus); + __pToolbar->GetItem(__pressedItemIndex)->SetButtonStatus(__initialPressesItemStatus); } } else { - __pToolbar->MoveItem(__editItemIndex, currentItemIndex); + __pToolbar->MoveItem(__editItemIndex, releasedItemIndex); + + AdjustItemPositionX(-__pToolbar->GetItem(__firstLoadedItemIndex)->GetBoundsF().x + tabLeftMargin); // move auto focus if (__pEditItem) { __pToolbar->DetachChild(*__pEditItem); + delete __pEditItem; __pEditItem = null; } @@ -1039,39 +1301,38 @@ _ToolbarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& tou } else { - if ((__pToolbar->GetStyle() == TOOLBAR_TAB || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE) - && __pToolbar->GetItemCount() > 4)// && pMoreButton != null) + if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > 4) { - if (__initialPressedItemIndex != -1) + if (__pressedItemIndex != -1) { - if (currentItemIndex == __initialPressedItemIndex) + if (releasedItemIndex == __pressedItemIndex) { - if (__initialPressesItemStatus != _BUTTON_STATUS_DISABLED && __touchMoveHandled != true) + if (__initialPressesItemStatus != _BUTTON_STATUS_DISABLED && __tabMoved != true) { - __pToolbar->SetItemSelected(currentItemIndex, true); + __pToolbar->SetItemSelected(releasedItemIndex, true); } else { - __pToolbar->GetItem(__initialPressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); + __pToolbar->GetItem(__pressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); } } else { - __pToolbar->GetItem(__initialPressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); + __pToolbar->GetItem(__pressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); } } } else { - if (__initialPressedItemIndex != -1 && (currentItemIndex != __initialPressedItemIndex)) + if (__pressedItemIndex != -1 && (releasedItemIndex != __pressedItemIndex)) { - __pToolbar->GetItem(__initialPressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); + __pToolbar->GetItem(__pressedItemIndex)->SetButtonStatus(__initialPressesItemStatus, false); } else { - if (__initialPressedItemIndex != -1 && __initialPressesItemStatus != _BUTTON_STATUS_DISABLED) + if (__pressedItemIndex != -1 && __initialPressesItemStatus != _BUTTON_STATUS_DISABLED) { - __pToolbar->SetItemSelected(currentItemIndex, true); + __pToolbar->SetItemSelected(releasedItemIndex, true); } return true; @@ -1079,7 +1340,9 @@ _ToolbarPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& tou } } - __touchMoveHandled = false; + __tabMoved = false; + + __isBouncingEffectStarted = false; // Restore status of other buttons to _BUTTON_STATUS_NORMAL // this can be removed int itemCount = __pToolbar->GetItemCount(); @@ -1106,83 +1369,97 @@ _ToolbarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchi return false; } - if ((__pToolbar->GetStyle() == TOOLBAR_TAB || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE) - && __pToolbar->GetItemCount() > 4) + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + + ToolbarStyle style = __pToolbar->GetStyle(); + FloatPoint touchPoint = touchinfo.GetCurrentPosition(); + + if (__pressedItemIndex == -1) { - __touchMoveHandled = true; + return true; } - Point touchPoint = touchinfo.GetCurrentPosition(); + _Button* pCurrentButton = __pToolbar->GetItem(__pressedItemIndex); - if ((__pToolbar->GetStyle() == TOOLBAR_TAB || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE) - && __beingEdited == true) + if (pCurrentButton == null) { - DrawEditItem(touchinfo.GetCurrentPosition()); + return true; } - else if (__initialPressedItemIndex != -1) + + FloatRectangle itemBounds = pCurrentButton->GetBoundsF(); + + if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __pToolbar->GetItemCount() > 4) { - if (__initialPressesItemStatus == _BUTTON_STATUS_DISABLED) + if (itemBounds.Contains(touchPoint)) { - return false; + __tabMoved = true; } + } - _Button* pCurrentButton = __pToolbar->GetItem(__initialPressedItemIndex); - - if (pCurrentButton == null) + if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) && __beingEdited == true) + { + DrawEditItem(touchinfo.GetCurrentPosition()); + } + else + { + if (__initialPressesItemStatus == _BUTTON_STATUS_DISABLED) { return false; } - Rectangle itemBounds = pCurrentButton->GetBounds(); - - if (__touchMoveHandled) - { - pCurrentButton->SetButtonStatus(_BUTTON_STATUS_NORMAL); - } - else if (itemBounds.Contains(touchPoint)) + if (__tabMoved) { - pCurrentButton->SetButtonStatus(_BUTTON_STATUS_PRESSED); + pCurrentButton->SetButtonStatus(__initialPressesItemStatus, false); } else { - pCurrentButton->SetButtonStatus(__initialPressesItemStatus, false); + if (itemBounds.Contains(touchPoint)) + { + pCurrentButton->SetButtonStatus(_BUTTON_STATUS_PRESSED); + } + else + { + pCurrentButton->SetButtonStatus(__initialPressesItemStatus, false); + } } pCurrentButton->Invalidate(false); } - if ((__pToolbar->GetStyle() == TOOLBAR_TAB || __pToolbar->GetStyle() == TOOLBAR_TAB_WITH_TITLE) - && __pToolbar->GetItemCount() > 4) + if (__tabMoved) { - int distance = (touchinfo.GetCurrentPosition()).x - __currentTouchPosition.x; - int sideMargin = 0; + float distance = (touchinfo.GetCurrentPosition()).x - __currentTouchPosition.x; + float sideMargin = 0.0f; + float startX = 0.0f; + float startY = 0.0f; GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), sideMargin); - Rectangle clientBounds = __pToolbar->GetBounds(); + FloatRectangle clientBounds = __pToolbar->GetBoundsF(); - const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize(); - const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width); + __portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); + __landscapeSize = FloatDimension(__portraitSize.height, __portraitSize.width); if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) { - if (clientBounds.width > portraitSize.width) + if (clientBounds.width > __portraitSize.width) { - clientBounds.width = portraitSize.width; + clientBounds.width = __portraitSize.width; } } else { - if (clientBounds.width > landscapeSize.width) + if (clientBounds.width > __landscapeSize.width) { - clientBounds.width = landscapeSize.width; + clientBounds.width = __landscapeSize.width; } } __currentTouchPosition = touchinfo.GetCurrentPosition(); _Button* pItem = null; - Rectangle itemBounds; + FloatRectangle itemBounds; int itemCount = __pToolbar->GetItemCount(); if (distance > 0) // right move @@ -1193,19 +1470,42 @@ _ToolbarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchi return true; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); - if (itemBounds.x == 0) + if (itemBounds.x + distance >= sideMargin && !__beingEdited) { - return true; - } + distance = sideMargin - itemBounds.x; + + if (!__isBouncingEffectStarted) + { + LoadBouncingEffectBitmap(style, __pToolbar->IsHeader(), true); + + if (style == TOOLBAR_TAB_WITH_TITLE) + { + GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), startY); + } - if (itemBounds.x + distance >= sideMargin) + SetBouncingVisualElement(startX, startY); + + StartBouncingEffect(); + + __isBouncingEffectStarted = true; + } + } + else { - distance = sideMargin - itemBounds.x; + if (__pBouncingEffectVe) + { + __pBouncingEffectVe->RemoveAllAnimations(); + __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe); + __pBouncingEffectVe->Destroy(); + __pBouncingEffectVe = null; + } + + __isBouncingEffectStarted = false; } } - else + else if (distance < 0) { pItem = __pToolbar->GetItem(itemCount - 1); @@ -1214,20 +1514,83 @@ _ToolbarPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchi return true; } - itemBounds = pItem->GetBounds(); + itemBounds = pItem->GetBoundsF(); - if (itemBounds.x + itemBounds.width == clientBounds.width - sideMargin) + if (itemBounds.x + itemBounds.width + distance <= clientBounds.width - sideMargin && !__beingEdited) { - return true; - } + distance = (clientBounds.width - sideMargin) - (itemBounds.x + itemBounds.width); + + if (!__isBouncingEffectStarted) + { + LoadBouncingEffectBitmap(style, __pToolbar->IsHeader(), false); - if (itemBounds.x + itemBounds.width + distance <= clientBounds.width - sideMargin) + startX = clientBounds.width - __bouncingEffectWidth; + + if (style == TOOLBAR_TAB_WITH_TITLE) + { + GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), startY); + } + + SetBouncingVisualElement(startX, startY); + + StartBouncingEffect(); + + __isBouncingEffectStarted = true; + } + } + else { - distance = (clientBounds.width - sideMargin) - (itemBounds.x + itemBounds.width); + if (__pBouncingEffectVe) + { + __pBouncingEffectVe->RemoveAllAnimations(); + __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe); + __pBouncingEffectVe->Destroy(); + __pBouncingEffectVe = null; + } + + __isBouncingEffectStarted = false; } } - AdjustItemPositionX(distance); + if (__beingEdited) + { + float tabLeftMargin = 0.0f; + + GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin); + + if (distance > 0) // right move + { + __tabSlideRight = false; + + if (__pToolbar->GetItem(__lastLoadedItemIndex - 1)->GetBoundsF().x <= __pEditItem->GetBoundsF().x) + { + __tabSlideLeft = true; + } + + if (__tabSlideLeft && __pToolbar->GetItem(itemCount-1)->GetBoundsF().x + __pToolbar->GetItem(itemCount-1)->GetBoundsF().width > clientBounds.width - tabLeftMargin) + { + AdjustItemPositionX(-distance * 5); // move auto focus + } + } + else if (distance < 0) + { + __tabSlideLeft = false; + + if (__pToolbar->GetItem(__firstLoadedItemIndex + 1)->GetBoundsF().x >= __pEditItem->GetBoundsF().x) + { + __tabSlideRight = true; + } + + if (__tabSlideRight && __pToolbar->GetItem(0)->GetBoundsF().x < tabLeftMargin) + { + AdjustItemPositionX(-distance * 5); // move auto focus + } + } + } + else + { + AdjustItemPositionX(distance); + } Draw(); } @@ -1257,6 +1620,14 @@ _ToolbarPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& tou return true; } +void +_ToolbarPresenter::OnChangeLayout(Tizen::Ui::_ControlOrientation orientation) +{ + ResetFlickAnimationTimer(); + + return; +} + bool _ToolbarPresenter::OnLongPressGestureDetected(void) { @@ -1279,11 +1650,12 @@ _ToolbarPresenter::OnLongPressGestureDetected(void) pButton->SetButtonStatus(_BUTTON_STATUS_NORMAL); - Rectangle itemBounds = pButton->GetBounds(); + FloatRectangle itemBounds = pButton->GetBoundsF(); if (__pEditItem) { __pToolbar->DetachChild(*__pEditItem); + delete __pEditItem; __pEditItem = null; } @@ -1295,7 +1667,7 @@ _ToolbarPresenter::OnLongPressGestureDetected(void) SysTryCatch(NID_UI_CTRL, pCanvas, , E_INVALID_STATE, "[E_INVALID_STATE] Unable to retrieve a Canvas."); Bitmap* pEditItemBitmap = new (std::nothrow) Bitmap(); - result r = pEditItemBitmap->Construct(*pCanvas, Rectangle(0, 0, itemBounds.width, itemBounds.height)); + result r = pEditItemBitmap->Construct(*pCanvas, FloatRectangle(0.0f, 0.0f, itemBounds.width, itemBounds.height)); if (IsFailed(r)) { @@ -1331,6 +1703,87 @@ CATCH: return true; } +bool +_ToolbarPresenter::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture) +{ + ToolbarStyle style = __pToolbar->GetStyle(); + + if (!(style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE) || __pToolbar->GetItemCount() <= 4 || __beingEdited == true || __tabMoved == false) + { + return true; + } + + if (gesture.GetDirection() != _FLICK_DIRECTION_RIGHT && gesture.GetDirection() != _FLICK_DIRECTION_LEFT) + { + return false; + } + + float distanceX = 0.0f; + float distanceY = 0.0f; + float xPosition = 0.0f; + float itemsBeyondScreen = 0.0f; + + gesture.GetDistance(distanceX, distanceY); + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + int itemCount = __pToolbar->GetItemCount(); + float itemWidth = __pToolbar->GetItem(0)->GetBoundsF().width; + + if (distanceX < 0) //left + { + itemsBeyondScreen = (itemCount - 1) - __lastLoadedItemIndex; + xPosition = __pToolbar->GetItem(__lastLoadedItemIndex)->GetBoundsF().x; + if (xPosition < (3 * itemWidth)) + { + __flickDistance = xPosition - (4 * itemWidth); + } + } + else //Right + { + itemsBeyondScreen = __firstLoadedItemIndex; + xPosition = __pToolbar->GetItem(__firstLoadedItemIndex)->GetBoundsF().x; + if (xPosition < 0) + { + __flickDistance = -xPosition; + } + + } + + int itemMaxCount = 4; + + if (itemsBeyondScreen >= (itemMaxCount - 1)) + { + __flickDistance = (3 * itemWidth); + } + else + { + __flickDistance = (itemsBeyondScreen * itemWidth); + } + + if (distanceX < 0) //Left flick + { + __flickMove = 0.006f; + __flickFlag = 0; + } + else if (distanceX > 0) //Right flick + { + __flickMove = 0.006f; + __flickDistance = -(__flickDistance); + __flickFlag = 0; + } + else + { + __flickMove = 0.0f; + __flickDistance = 0.0f; + __flickFlag = 0; + __moveDistance = 0.0f; + } + + StartFlickAnimationTimer(); + + return true; +} + void _ToolbarPresenter::OnTimerExpired(Timer& timer) { @@ -1341,6 +1794,11 @@ _ToolbarPresenter::OnTimerExpired(Timer& timer) TimerForTitleSlideTimeout(); } + if (onTimer == __pFlickAnimationTimer) + { + StartFlickAnimation(); + } + return; } @@ -1373,6 +1831,7 @@ _ToolbarPresenter::TimerForTitleSlideStart(void) } r = __pTitleSlideTimer->Construct(*this); + if (IsFailed(r)) { delete __pTitleSlideTimer; @@ -1381,6 +1840,7 @@ _ToolbarPresenter::TimerForTitleSlideStart(void) } r = __pTitleSlideTimer->Start(100); + if (IsFailed(r)) { goto CATCH; @@ -1393,8 +1853,6 @@ CATCH: result _ToolbarPresenter::TimerForTitleSlideTimeout(void) { - result r = E_SUCCESS; - Canvas* pCanvas = __pToolbar->GetCanvasN(); SysTryReturnResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pCanvas is invalid!"); @@ -1403,7 +1861,7 @@ _ToolbarPresenter::TimerForTitleSlideTimeout(void) if (__pTitleBackgroundBitmap) { - pCanvas->DrawBitmap(__titleRect, *__pTitleBackgroundBitmap); + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(__titleRect), *__pTitleBackgroundBitmap); } if (__pTitleTextObject->IsChanged()) @@ -1411,17 +1869,24 @@ _ToolbarPresenter::TimerForTitleSlideTimeout(void) DrawTitleText(pCanvas); } - __pTitleTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas)); + if (__pTitleTextObject->IsActionOn() == true) + { + __pTitleTextObject->DrawWithOffset(*_CanvasImpl::GetInstance(*pCanvas)); - delete pCanvas; + TimerForTitleSlideStart(); + } + else + { + __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + } - r = TimerForTitleSlideStart(); + delete pCanvas; - return r; + return E_SUCCESS; } result -_ToolbarPresenter::AdjustItemPositionX(int distance) +_ToolbarPresenter::AdjustItemPositionX(float distance) { int index = 0; int itemCount = __pToolbar->GetItemCount(); @@ -1429,7 +1894,7 @@ _ToolbarPresenter::AdjustItemPositionX(int distance) while (pItem != null) { - Rectangle bounds = pItem->GetBounds(); + FloatRectangle bounds = pItem->GetBoundsF(); bounds.x += distance; pItem->SetBounds(bounds); index++; @@ -1447,14 +1912,14 @@ _ToolbarPresenter::AdjustItemPositionX(int distance) return E_SUCCESS; } -Rectangle -_ToolbarPresenter::GetTitleTextBounds(void) const +FloatRectangle +_ToolbarPresenter::GetTitleTextBoundsF(void) const { return __titleRect; } -Rectangle -_ToolbarPresenter::GetDescriptionBounds(void) const +FloatRectangle +_ToolbarPresenter::GetDescriptionBoundsF(void) const { return __descriptionRect; } @@ -1480,13 +1945,22 @@ void _ToolbarPresenter::OnFontInfoRequested(unsigned long& style, int& size) { style = __fontStyle; + size = _CoordinateSystemUtils::ConvertToInteger(__fontSize); + + return; +} + +void +_ToolbarPresenter::OnFontInfoRequested(unsigned long& style, float& size) +{ + style = __fontStyle; size = __fontSize; return; } void -_ToolbarPresenter::SetFontInfo(unsigned long style, int size) +_ToolbarPresenter::SetFontInfo(unsigned long style, float size) { __fontStyle = style; __fontSize = size; @@ -1494,4 +1968,277 @@ _ToolbarPresenter::SetFontInfo(unsigned long style, int size) return; } +void +_ToolbarPresenter::SetBouncingVisualElement(float startX, float startY) +{ + Canvas * pCanvas = null; + int Z_ORDER_GROUP_CONTROL = 2001; + + if (__pBouncingEffectVe == null) + { + __pBouncingEffectVe = new (std::nothrow) VisualElement(); + SysTryReturnVoidResult(NID_UI_CTRL, __pBouncingEffectVe, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + __pBouncingEffectVe->Construct(); + __pBouncingEffectVe->SetName(L"BouncingEffect"); + } + + __pBouncingEffectVe->SetBounds(FloatRectangle(startX, startY, __bouncingEffectWidth, __bouncingEffectHeight)); + __pBouncingEffectVe->SetShowState(true); + __pBouncingEffectVe->SetImplicitAnimationEnabled(true); + + _VisualElementImpl::GetInstance(*__pBouncingEffectVe)->SetZOrderGroup(Z_ORDER_GROUP_CONTROL + 1); + __pToolbar->GetVisualElement()->AttachChild(*__pBouncingEffectVe); + + pCanvas = __pBouncingEffectVe->GetCanvasN(); + + if (!pCanvas) + { + __pBouncingEffectVe->Destroy(); + __pBouncingEffectVe = null; + + SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + return; + } + + Color backgroundColor(0, 0, 0, 0); + pCanvas->SetBackgroundColor(backgroundColor); + pCanvas->Clear(); + + FloatRectangle rect(0.0f, 0.0f, __bouncingEffectWidth, __bouncingEffectHeight); + + if (__pBouncingEffectBitmap) + { + if (__pBouncingEffectBitmap->IsNinePatchedBitmap()) + { + pCanvas->DrawNinePatchedBitmap(_CoordinateSystemUtils::ConvertToInteger(rect), *__pBouncingEffectBitmap); + + } + else + { + pCanvas->DrawBitmap(_CoordinateSystemUtils::ConvertToInteger(rect), *__pBouncingEffectBitmap); + } + } + + delete pCanvas; + + return; +} + +void +_ToolbarPresenter::StartBouncingEffect(void) +{ + float startOpacity = 0.0f; + float endOpacity = 1.0f; + + VisualElementPropertyAnimation* pAnimation = new (std::nothrow) VisualElementPropertyAnimation(); + SysTryReturnVoidResult(NID_UI_CTRL, pAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + pAnimation->SetPropertyName(L"BouncingEffect"); + pAnimation->SetStartValue(Variant(startOpacity)); + pAnimation->SetEndValue(Variant(endOpacity)); + pAnimation->SetDuration(500); + pAnimation->SetVisualElementAnimationStatusEventListener(this); + + String bouncing(L"BouncingEffect"); + __pBouncingEffectVe->AddAnimation(bouncing, *pAnimation); + + delete pAnimation; + + return; +} + +void +_ToolbarPresenter::StartFlickAnimation(void) +{ + float distance = CalculateProgress(__flickMove); + + __moveDistance = -(__flickDistance * distance); + __flickDistance = (__flickDistance + __moveDistance); + __flickMove = __flickMove + 0.006; + __flickFlag++; + + if (__flickFlag <= FLICK_ANIMATION_COUNT) + { + StartFlickAnimationTimer(); + } + else + { + ResetFlickAnimationTimer(); + SetItemFit(__firstLoadedItemIndex); + } + + AdjustItemPositionX(__moveDistance); + + SetFirstLoadedItemIndex(); + SetLastLoadedItemIndex(); + + Draw(); + + return; +} + +result +_ToolbarPresenter::StartFlickAnimationTimer(void) +{ + result r = E_SUCCESS; + + if (__pFlickAnimationTimer == null) + { + __pFlickAnimationTimer = new (std::nothrow) Timer(); + SysTryReturn(NID_UI_CTRL, (__pFlickAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + r = __pFlickAnimationTimer->Construct(*this); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + __pFlickAnimationTimer->Cancel(); + } + + r = __pFlickAnimationTimer->Start(FLICK_ANIMATION_TIMER_PERIOD); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + ResetFlickAnimationTimer(); + return r; +} + +result +_ToolbarPresenter::ResetFlickAnimationTimer(void) +{ + if (__pFlickAnimationTimer) + { + delete __pFlickAnimationTimer; + __pFlickAnimationTimer = null; + } + + __moveDistance = 0.0f; + + return E_SUCCESS; +} + +void +_ToolbarPresenter::SetFirstLoadedItemIndex(void) +{ + int itemCount = __pToolbar->GetItemCount(); + + for (int i = 0; i < itemCount; i++) + { + if (__pToolbar->GetItem(i)->GetBoundsF().x + (__pToolbar->GetItem(i)->GetBoundsF().width / 2) <= __pToolbar->GetItem(i)->GetBoundsF().width) + { + __firstLoadedItemIndex = i; + } + } + + return; +} + +void +_ToolbarPresenter::SetLastLoadedItemIndex(void) +{ + float width = 0.0f; + int itemCount = __pToolbar->GetItemCount(); + + if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) + { + width = __portraitSize.width; + } + else + { + width = __landscapeSize.width; + } + + for (int i = 0; i < itemCount; i++) + { + float X = __pToolbar->GetItem(i)->GetBoundsF().x; + + if ((X + (__pToolbar->GetItem(i)->GetBoundsF().width / 2)) < width) + { + __lastLoadedItemIndex = i; + } + } + + return; +} + +float +_ToolbarPresenter::CalculateProgress(float timeProgress) const +{ + const float segments[3][3] = {{0.0f, 0.01f, 0.45f}, {0.45f, 0.80f, 0.908f}, {0.908f, 0.9999f, 1.0f}}; + float loc_5 = timeProgress / 1; + int loc_6 = 3; //Length of the segments array + int loc_9 = (int)floor(loc_6 * loc_5); + + if (loc_9 >= loc_6) + { + loc_9 = loc_6 - 1; + } + + float loc_7 = (loc_5 - loc_9 * (1.0 / loc_6)) * loc_6; + float loc_8[3]; + + for (int i = 0; i < 3; i++) + { + loc_8[i] = segments[loc_9][i]; + } + + float ret = 0 + 1 * (loc_8[0] + loc_7 * (2 * (1 - loc_7) * (loc_8[1] - loc_8[0]) + loc_7 * (loc_8[2] - loc_8[0]))); + + return ret; +} + +void +_ToolbarPresenter::SetItemFit(int index) +{ + FloatPoint pt(0.0f, 0.0f); + FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); + + float fitDistance = 0.0f; + float tabLeftMargin = 0.0f; + int itemCount = __pToolbar->GetItemCount(); + + GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin); + + _Button* pItem = __pToolbar->GetItem(index); + SysTryReturnVoidResult(NID_UI_CTRL, pItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + bounds = pItem->GetBoundsF(); + + fitDistance = -bounds.x + tabLeftMargin; + + for (int i = 0; i < itemCount; i++) + { + pItem = __pToolbar->GetItem(i); + SysTryReturnVoidResult(NID_UI_CTRL, pItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + bounds = pItem->GetBoundsF(); + bounds.x = bounds.x + fitDistance; + pItem->SetBounds(bounds); + } + + return; +} + +void +_ToolbarPresenter::OnVisualElementAnimationStarted(const VisualElementAnimation& animation, const String& keyName, VisualElement& target) +{ + return; +} + +void +_ToolbarPresenter::OnVisualElementAnimationRepeated(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, long currentRepeatCount) +{ + return; +} + +void +_ToolbarPresenter::OnVisualElementAnimationFinished(const VisualElementAnimation& animation, const String& keyName, VisualElement& target, bool completedNormally) +{ + return; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_UiIconListItemEvent.cpp b/src/ui/controls/FUiCtrl_UiIconListItemEvent.cpp old mode 100644 new mode 100755 diff --git a/src/ui/controls/FUiCtrl_UiListViewItemEvent.cpp b/src/ui/controls/FUiCtrl_UiListViewItemEvent.cpp index f07c0f4..9a0f3fa 100644 --- a/src/ui/controls/FUiCtrl_UiListViewItemEvent.cpp +++ b/src/ui/controls/FUiCtrl_UiListViewItemEvent.cpp @@ -71,10 +71,6 @@ _UiListViewItemEvent::FireImpl(IEventListener& listener, const IEventArg& arg) switch (pEventArg->GetNotifyType()) { - case NOTIFY_TYPE_ITEM_LONGPRESSED: - pListener->OnListViewItemLongPressed(*__pSource, index1, index2, index3); - break; - case NOTIFY_TYPE_CONTEXTITEM_SELCTED: pListener->OnListViewContextItemStateChanged(*__pSource, index1, index2, index3, LIST_CONTEXT_ITEM_STATUS_SELECTED); break; diff --git a/src/ui/controls/FUiCtrl_UiScrollEvent.cpp b/src/ui/controls/FUiCtrl_UiScrollEvent.cpp index bf532dd..98f719e 100644 --- a/src/ui/controls/FUiCtrl_UiScrollEvent.cpp +++ b/src/ui/controls/FUiCtrl_UiScrollEvent.cpp @@ -93,6 +93,9 @@ _UiScrollEvent::FireImpl(IEventListener& listener, const IEventArg& arg) case SCROLL_EVENT_ON_SCROLL_END_REACHED: pScrollEventListener->OnScrollEndReached(*pArg->GetSource(), pArg->GetScrollType()); break; + case SCROLL_EVENT_ON_SCROLL_JUMP_TO_TOP: + pScrollEventListener->OnScrollJumpToTop(*pArg->GetSource()); + break; default: SysTryReturnVoidResult(NID_UI_CTRL, false, E_INVALID_ARG, "The invalid Event Argument was given."); break; diff --git a/src/ui/controls/FUiCtrl_UiScrollEventArg.cpp b/src/ui/controls/FUiCtrl_UiScrollEventArg.cpp index a52c7bc..ff5c380 100644 --- a/src/ui/controls/FUiCtrl_UiScrollEventArg.cpp +++ b/src/ui/controls/FUiCtrl_UiScrollEventArg.cpp @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui { namespace Controls //////////////////////////////////////////////////////////////////////////////// /// _UiScrollEventArg class Lifecycle -_UiScrollEventArg::_UiScrollEventArg(_ScrollEventType eventType, const _Control& source, int scrollPosition, ScrollEndEvent scrollType) +_UiScrollEventArg::_UiScrollEventArg(_ScrollEventType eventType, const _Control& source, float scrollPosition, ScrollEndEvent scrollType) : __eventType(eventType) , __pSource(const_cast <_Control*>(&source)) , __scrollPosition(scrollPosition) @@ -56,7 +56,16 @@ _UiScrollEventArg::GetScrollEventArgN(const _Control& source) } _UiScrollEventArg* -_UiScrollEventArg::GetScrollEventArgN(const _Control& source, int scrollPosition) +_UiScrollEventArg::GetScrollJumpToTopEventArgN(const _Control& source) +{ + _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_JUMP_TO_TOP, source); + SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); + + return pEventArg; +} + +_UiScrollEventArg* +_UiScrollEventArg::GetScrollEventArgN(const _Control& source, float scrollPosition) { _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED, source, scrollPosition); SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); @@ -67,7 +76,7 @@ _UiScrollEventArg::GetScrollEventArgN(const _Control& source, int scrollPosition _UiScrollEventArg* _UiScrollEventArg::GetScrollEventArgN(const _Control& source, ScrollEndEvent scrollType) { - _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1, scrollType); + _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1.0f, scrollType); SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); return pEventArg; @@ -96,7 +105,7 @@ _UiScrollEventArg::GetScrollType(void) const return __scrollType; } -int +float _UiScrollEventArg::GetScrollPosition(void) const { ClearLastResult(); diff --git a/src/ui/effects/FUiEffects_EffectManagerImpl.cpp b/src/ui/effects/FUiEffects_EffectManagerImpl.cpp index 5ba19ba..665eda6 100644 --- a/src/ui/effects/FUiEffects_EffectManagerImpl.cpp +++ b/src/ui/effects/FUiEffects_EffectManagerImpl.cpp @@ -171,14 +171,19 @@ _EffectManagerImpl::GetInstance(void) { SetLastResult(E_SUCCESS); + static result res = E_SUCCESS; + if (pEffectManagerImpl == null) { SysAssertf(pEffectManager == null, _UiEffectError::INTERNAL_ERROR); pthread_once(&once_block, InitSingleton); - result res = GetLastResult(); - SysTryReturn(NID_UI_EFFECT, res == E_SUCCESS, std::make_pair(static_cast(null), static_cast<_EffectManagerImpl*>(null)), res, "[%s] Propagating.", GetErrorMessage(res)); + res = GetLastResult(); } + SysTryReturn(NID_UI_EFFECT, !(res == E_OUT_OF_MEMORY), std::make_pair(static_cast(null), static_cast<_EffectManagerImpl*>(null)), res, "[%s] Propagating.", GetErrorMessage(res)); + + SysTryReturn(NID_UI_EFFECT, !(res == E_OPERATION_FAILED), std::make_pair(pEffectManager, pEffectManagerImpl), res, "[%s] Propagating.", GetErrorMessage(res)); + return std::make_pair(pEffectManager, pEffectManagerImpl); } diff --git a/src/ui/effects/renderer/FUiEffects_RendererEffectRenderer.cpp b/src/ui/effects/renderer/FUiEffects_RendererEffectRenderer.cpp index 1230dc7..a1116d0 100644 --- a/src/ui/effects/renderer/FUiEffects_RendererEffectRenderer.cpp +++ b/src/ui/effects/renderer/FUiEffects_RendererEffectRenderer.cpp @@ -150,14 +150,14 @@ EffectRenderer::CheckOpenGlesInitialized(void) EGLSurface EffectRenderer::CreateSurface(EGLNativeWindowType wnd) { - EGLSurface newsurface = eglCreateWindowSurface(__eglDisplay, __eglConfig, wnd, 0); + EGLSurface newSurface = eglCreateWindowSurface(__eglDisplay, __eglConfig, wnd, 0); EGL_ASSERT_NOERRORS - SysTryReturn(NID_UI_EFFECT, newsurface != EGL_NO_SURFACE && CheckEglNoErrors(), EGL_NO_SURFACE, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Effects. There was an error while performing function eglCreateWindowSurface (EGL_NO_SURFACE)"); + SysTryReturn(NID_UI_EFFECT, newSurface != EGL_NO_SURFACE && CheckEglNoErrors(), EGL_NO_SURFACE, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Effects. There was an error while performing function eglCreateWindowSurface - (%#x)", (unsigned int) newSurface); EGL_ASSERT_NOERRORS - return newsurface; + return newSurface; } void @@ -175,7 +175,7 @@ EffectRenderer::CreateContext(EGLContext shareContext) { EGLContext newContext = eglCreateContext(__eglDisplay, __eglConfig, EGL_NO_CONTEXT, RENDERER_EGL_DEFAULT_CONTEXT_ATTRIBS); - SysTryReturn(NID_UI_EFFECT, newContext != EGL_NO_CONTEXT && CheckEglNoErrors(), EGL_NO_CONTEXT, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Effects. There was an error while performing function eglCreateContext (EGL_NO_CONTEXT)"); + SysTryReturn(NID_UI_EFFECT, newContext != EGL_NO_CONTEXT && CheckEglNoErrors(), EGL_NO_CONTEXT, E_OPERATION_FAILED, "[E_OPERATION_FAILED] Effects. There was an error while performing function eglCreateContext - (%#x)", (unsigned int) newContext); EGL_ASSERT_NOERRORS return newContext; diff --git a/src/ui/inc/FUiAnim_VisualElementCanvas.h b/src/ui/inc/FUiAnim_VisualElementCanvas.h index 4bc9344..dcb69e5 100644 --- a/src/ui/inc/FUiAnim_VisualElementCanvas.h +++ b/src/ui/inc/FUiAnim_VisualElementCanvas.h @@ -44,6 +44,7 @@ public: virtual ~_VisualElementCanvas(void); result Construct(const VisualElementSurface& surface, const Tizen::Graphics::Rectangle& rectangle); + result Construct(const VisualElementSurface& surface, const Tizen::Graphics::FloatRectangle& rectangle); private: _VisualElementCanvas(const _VisualElementCanvas& rhs); diff --git a/src/ui/inc/FUiAnim_VisualElementCoordinateSystem.h b/src/ui/inc/FUiAnim_VisualElementCoordinateSystem.h index 4c2b0fc..e218bad 100644 --- a/src/ui/inc/FUiAnim_VisualElementCoordinateSystem.h +++ b/src/ui/inc/FUiAnim_VisualElementCoordinateSystem.h @@ -88,8 +88,9 @@ public: // Because auto-scaling coordinate system of graphics ceils only for down-scaling, we do the same ! // CHECKME: // Separate Horz/Vert handling ? - MakeIntegralDimension(width, height); } + + MakeIntegralDimension(width, height); } static void ConvertDimensionToPhysicalIntegral(float width, float height, int& intWidth, int& intHeight) @@ -110,8 +111,9 @@ public: // Because auto-scaling coordinate system of graphics ceils only for down-scaling, we do the same ! // CHECKME: // Separate Horz/Vert handling ? - MakeIntegralDimension(width, height); } + + MakeIntegralDimension(width, height); } static void ConvertDimensionToLogicalIntegral(float width, float height, int& intWidth, int& intHeight) @@ -148,6 +150,30 @@ public: } } + static void MakeLogicalWidthForPhysicalOne(float& width) + { + if (unlikely(needScale)) + { + width = 1.0f / scaleFactorX; + } + else + { + width = 1.0f; + } + } + + static void MakeLogicalHeightForPhysicalOne(float& height) + { + if (unlikely(needScale)) + { + height = 1.0f / scaleFactorY; + } + else + { + height = 1.0f; + } + } + public: // WARNING: // Some float functions like sin and cos emit too-much float-error. diff --git a/src/ui/inc/FUiAnim_VisualElementImpl.h b/src/ui/inc/FUiAnim_VisualElementImpl.h index 4d0444d..d93c09a 100644 --- a/src/ui/inc/FUiAnim_VisualElementImpl.h +++ b/src/ui/inc/FUiAnim_VisualElementImpl.h @@ -45,6 +45,7 @@ #include "FUiAnim_TransformMatrix3Df.h" #include "FUiAnim_VisualElementCoordinateSystem.h" +//#define OLD #define SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION namespace Tizen { namespace Ui @@ -564,6 +565,7 @@ public: result Draw(void); Tizen::Graphics::Canvas* GetCanvasN(void); Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds); + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds); /** * Gets the top-most child VisualElement indicated by @c point. @@ -598,23 +600,13 @@ public: */ result ConvertCoordinates(float* x, float* y, float* z, int count, const _VisualElementImpl* pFromElement) const; + Tizen::Graphics::FloatPoint3 TransformVectorFromOrigin(const Tizen::Graphics::FloatPoint3& originPoint, const _VisualElementImpl* pOriginVisualElement) const; + result AddAnimation(const Tizen::Base::String* keyName, VisualElementAnimation& animation); result RemoveAnimation(const Tizen::Base::String& keyName); VisualElementAnimation* GetAnimationN(const Tizen::Base::String& keyName) const; - /** - * Gets the animation playing for the specified property. - * - * @since 2.0 - * @return The pointer to the animation - * @param[in] property The name of the property. - * @exception E_SUCCESS The method was successful. - * @see AddAnimation() - * @see RemoveAnimation() - */ - VisualElementAnimation* GetAnimationForPropertyN(const Tizen::Base::String& property) const; - result RemoveAllAnimations(void); /** @@ -791,8 +783,12 @@ public: */ VisualElementAnimation* CreateAnimationForPropertyI(const Tizen::Base::String& property); + // Internal callback functions for Window surface typedef void (*BoundsChangedCallback)(void*); void SetBoundsChangedCallback(BoundsChangedCallback pCallback, void* pData); + + typedef void (*DestroyedCallback)(void*); + void SetDestroyedCallback(DestroyedCallback pCallback, void* pData); protected: // virtual _VisualElementImpl* CloneN(void); @@ -995,19 +991,7 @@ private: static void AdjustSizeForSurface(float& width, float& height) { - float originalWidth = width; - float originalHeight = height; _VisualElementCoordinateSystem::MakeIntegralDimension(width, height); - - if (originalWidth > 0.0f && width == 0.0f) - { - width = 1.0f; - } - - if (originalHeight > 0.0f && height == 0.0f) - { - height = 1.0f; - } } result SetBoundsI(const Tizen::Graphics::FloatRectangle& bounds); @@ -1059,7 +1043,11 @@ private: void SetRootNeedsContentUpdate(void) { +#ifdef OLD if (unlikely(__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT)) +#else + if (unlikely(GetSharedData().childrenInvalidated)) +#endif { _RootVisualElement* pRoot = GetRootPublic(); if (likely(pRoot)) @@ -1086,7 +1074,6 @@ private: return false; } // Presentation update method(observer) - void UpdatePresentationWhenChildRemoved(_VisualElementImpl& child, bool deallocate); void UpdatePresentationWhenZOrderChanged(const _VisualElementImpl* pReferenceModel, bool above); result UpdatePresentationWhenCustomPropertyChanged(const Tizen::Base::String& property, const Variant& value); @@ -1218,6 +1205,7 @@ private: void DrawRectangleIfNeeded(const Tizen::Graphics::FloatRectangle& drawRect); void DrawRectangle(const Tizen::Graphics::FloatRectangle& drawRect); + result DrawForAnimation(void); void LockInvalidate(bool lock); void InvalidateHierarchyPropsDownward(int invalidProps, bool broadcastToChildren, bool propagateToParentsOnly); @@ -1283,10 +1271,16 @@ protected: HIERARCHY_PROPERTY_SHOWSTATE = 0x04, HIERARCHY_PROPERTY_CONTENTOPACITY = 0x08, HIERARCHY_PROPERTY_NATIVENODE = HIERARCHY_PROPERTY_CONTENTOPACITY, +#ifdef OLD HIERARCHY_PROPERTY_SURFACE = 0x10, // only for presentation element HIERARCHY_PROPERTY_CONTENT = 0x20, +#endif HIERARCHY_PROPERTY_CONTENTBOUNDS = 0x40, +#ifdef OLD HIERARCHY_PROPERTY_MASK = 0x7F +#else + HIERARCHY_PROPERTY_MASK = 0x4F +#endif }; int _zOrderGroup; @@ -1374,6 +1368,9 @@ private: BoundsChangedCallback __pBoundsChangedCallback; void* __pBoundsChangedCallbackData; + DestroyedCallback __pDestroyedCallback; + void* __pDestroyedCallbackData; + friend class _VeDebug; friend class _EflNode; friend class _VisualElementModelObserver; @@ -1382,6 +1379,7 @@ private: friend class _ControlVisualElement; friend class _RootVisualElement; friend class _AnimationManager; + friend class _TransactionNode; friend class _DisplayManager; }; // _VisualElementImpl diff --git a/src/ui/inc/FUiAnim_VisualElementSharedData.h b/src/ui/inc/FUiAnim_VisualElementSharedData.h index ee41c11..8c13d72 100644 --- a/src/ui/inc/FUiAnim_VisualElementSharedData.h +++ b/src/ui/inc/FUiAnim_VisualElementSharedData.h @@ -58,23 +58,23 @@ public: return pNativeNode->Reconfigure(pSurface, presentation, surfaceOnly); } - result CreateSurface(const Tizen::Graphics::Dimension& size, _NativeLayer& layer); + result CreateSurface(const Tizen::Graphics::FloatDimension& size, _NativeLayer& layer); void RemoveSurface(_VisualElementImpl& presentation); result SetImage(const Tizen::Base::String& fileName); bool NeedNativeReconfigure(void) const { - return (invalidatedNativeProps != 0) || surfaceChanged; + return (invalidatedNativeProps != 0 || surfaceChanged); } public: int invalidatedNativeProps; + bool childrenInvalidated; bool surfaceChanged; _INativeNode* pNativeNode; VisualElementSurface* pSurface; Tizen::Graphics::FloatRectangle invalidatedRegion; - bool drawOnPresentation; bool needSurface; bool redrawOnResize; bool isSurfaceOpaque; diff --git a/src/ui/inc/FUiAnim_VisualElementSurfaceImpl.h b/src/ui/inc/FUiAnim_VisualElementSurfaceImpl.h index 405c082..7fe6c0d 100644 --- a/src/ui/inc/FUiAnim_VisualElementSurfaceImpl.h +++ b/src/ui/inc/FUiAnim_VisualElementSurfaceImpl.h @@ -47,14 +47,15 @@ class _VisualElementSurfaceImpl { protected: _VisualElementSurfaceImpl(const Tizen::Graphics::Dimension& size); + _VisualElementSurfaceImpl(const Tizen::Graphics::FloatDimension& size); public: virtual ~_VisualElementSurfaceImpl(void); public: - static VisualElementSurface* CreateSurfaceN(const Handle handle, const Tizen::Graphics::Dimension& size); // create public instance + static VisualElementSurface* CreateSurfaceN(const Handle handle, const Tizen::Graphics::FloatDimension& size); // create public instance static VisualElementSurface* CreateSurfaceUsingExistingObjectN(const DisplayContext& displayContext, const Handle handle, const Tizen::Graphics::Dimension& size); - static _VisualElementSurfaceImpl* CreateInstanceN(const DisplayContext& displayContext, const Tizen::Graphics::Dimension& size); // create internal instance + static _VisualElementSurfaceImpl* CreateInstanceN(const DisplayContext& displayContext, const Tizen::Graphics::FloatDimension& size); // create internal instance virtual Handle GetNativeHandle(void) const = 0; virtual result SetImage(const Tizen::Base::String& fileName); @@ -67,6 +68,11 @@ public: return __logicalSize; } + Tizen::Graphics::FloatDimension GetSizeF(void) const + { + return __logicalSizeF; + } + virtual bool Equals(const Tizen::Base::Object& obj) const; virtual int GetHashCode(void) const; @@ -92,6 +98,7 @@ private: private: int __refCount; Tizen::Graphics::Dimension __logicalSize; + Tizen::Graphics::FloatDimension __logicalSizeF; }; // _VisualElementSurfaceImpl }}} // Tizen::Ui::Animations diff --git a/src/ui/inc/FUiCtrl_AdjustmentEvent.h b/src/ui/inc/FUiCtrl_AdjustmentEvent.h index 316f58a..4a117c3 100644 --- a/src/ui/inc/FUiCtrl_AdjustmentEvent.h +++ b/src/ui/inc/FUiCtrl_AdjustmentEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AdjustmentEvent.h * @brief This is the header file for _AdjustmentEvent class. diff --git a/src/ui/inc/FUiCtrl_Animation.h b/src/ui/inc/FUiCtrl_Animation.h index f0b4e84..193fd9f 100644 --- a/src/ui/inc/FUiCtrl_Animation.h +++ b/src/ui/inc/FUiCtrl_Animation.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Animation.h * @brief This is the header file for the _Animation class. diff --git a/src/ui/inc/FUiCtrl_AnimationEvent.h b/src/ui/inc/FUiCtrl_AnimationEvent.h index dab429a..a6b84be 100644 --- a/src/ui/inc/FUiCtrl_AnimationEvent.h +++ b/src/ui/inc/FUiCtrl_AnimationEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationEvent.h * @brief This is the header file for _AnimationEvent class. diff --git a/src/ui/inc/FUiCtrl_AnimationFrameImpl.h b/src/ui/inc/FUiCtrl_AnimationFrameImpl.h index fc47f4c..7cf9f0c 100644 --- a/src/ui/inc/FUiCtrl_AnimationFrameImpl.h +++ b/src/ui/inc/FUiCtrl_AnimationFrameImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationFrameImpl.h * @brief This is the header file for the _AnimationFrameImpl class. diff --git a/src/ui/inc/FUiCtrl_AnimationImpl.h b/src/ui/inc/FUiCtrl_AnimationImpl.h index 902b82a..ea66f81 100644 --- a/src/ui/inc/FUiCtrl_AnimationImpl.h +++ b/src/ui/inc/FUiCtrl_AnimationImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationImpl.h * @brief This is the header file for the _AnimationImpl class. diff --git a/src/ui/inc/FUiCtrl_AnimationModel.h b/src/ui/inc/FUiCtrl_AnimationModel.h index 459e138..c3f9858 100644 --- a/src/ui/inc/FUiCtrl_AnimationModel.h +++ b/src/ui/inc/FUiCtrl_AnimationModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationModel.h * @brief This is the header file for the _AnimationModel class. diff --git a/src/ui/inc/FUiCtrl_AnimationPresenter.h b/src/ui/inc/FUiCtrl_AnimationPresenter.h index f26735e..e62cac6 100644 --- a/src/ui/inc/FUiCtrl_AnimationPresenter.h +++ b/src/ui/inc/FUiCtrl_AnimationPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_AnimationPresenter.h * @brief This is the header file for the _AnimationPresenter class. diff --git a/src/ui/inc/FUiCtrl_Button.h b/src/ui/inc/FUiCtrl_Button.h index bc3fce8..47ab2a2 100644 --- a/src/ui/inc/FUiCtrl_Button.h +++ b/src/ui/inc/FUiCtrl_Button.h @@ -40,7 +40,7 @@ class _ButtonPresenter; /** * @class _Button * @brief - * @since 1.0 + * @since 2.0 * * * @@ -133,7 +133,9 @@ public: virtual void OnBoundsChanged(void); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; public: result SetText(const Tizen::Base::String& text); @@ -160,6 +162,16 @@ public: Tizen::Graphics::Bitmap* GetBitmap(_ButtonStatus status) const; Tizen::Graphics::Point GetBitmapPosition(_ButtonStatus status) const; + result SetBitmap(_ButtonStatus status, const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + Tizen::Graphics::FloatPoint GetBitmapPositionF(_ButtonStatus status) const; + + result SetEffectBitmap(_ButtonStatus status, const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + Tizen::Graphics::Bitmap* GetEffectBitmap(_ButtonStatus status) const; + Tizen::Graphics::Point GetEffectBitmapPosition(_ButtonStatus status) const; + + result SetEffectBitmap(_ButtonStatus status, const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + Tizen::Graphics::FloatPoint GetEffectBitmapPositionF(_ButtonStatus status) const; + result SetToolbarItemBackgroundBitmap(_ButtonStatus status, const Tizen::Graphics::Bitmap& bitmap); Tizen::Graphics::Bitmap* GetToolbarItemBackgroundBitmap(_ButtonStatus status) const; @@ -175,11 +187,15 @@ public: result SetTextSize(int size, unsigned long fontStyle = Tizen::Graphics::FONT_STYLE_PLAIN); int GetTextSize(void) const; + result SetTextSize(float size, unsigned long fontStyle = Tizen::Graphics::FONT_STYLE_PLAIN); + float GetTextSizeF(void) const; + result SetButtonStyle(_ButtonStyle buttonStyle); _ButtonStyle GetButtonStyle(void) const; result SetButtonStatus(_ButtonStatus buttonStatus, bool fire = true); _ButtonStatus GetButtonStatus(void) const; + _ButtonStatus GetPrevButtonStatus(void) const; result SetTextMaxLine(int textMaxLine); int GetTextMaxLine(void) const; @@ -193,17 +209,40 @@ public: result FireActionEvent(void); result SetUserDefinedTextArea(const Tizen::Graphics::Rectangle& bounds); + result SetUserDefinedTextArea(const Tizen::Graphics::FloatRectangle& bounds); Tizen::Graphics::Rectangle GetUserDefinedTextArea(void) const; + Tizen::Graphics::FloatRectangle GetUserDefinedTextAreaF(void) const; bool UserDefinedText(void) const; bool IsDrawInner(void) const; - result SetMargin(int topMargin, int leftMargin); - int GetTopMargin(void) const; + result SetMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin); int GetLeftMargin(void) const; - - Tizen::Graphics::Dimension GetContentSizeInternal(void) const; + int GetTopMargin(void) const; + int GetRightMargin(void) const; + int GetBottomMargin(void) const; + + result SetTouchMargin(int leftTouchMargin, int topTouchMargin, int rightTouchMargin, int bottomTouchMargin); + int GetLeftTouchMargin(void) const; + int GetTopTouchMargin(void) const; + int GetRightTouchMargin(void) const; + int GetBottomTouchMargin(void) const; + + result SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin); + float GetLeftMarginF(void) const; + float GetTopMarginF(void) const; + float GetRightMarginF(void) const; + float GetBottomMarginF(void) const; + + result SetTouchMargin(float leftTouchMargin, float topTouchMargin, float rightTouchMargin, float bottomTouchMargin); + float GetLeftTouchMarginF(void) const; + float GetTopTouchMarginF(void) const; + float GetRightTouchMarginF(void) const; + float GetBottomTouchMarginF(void) const; + + Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const; int GetTextExtentSize(void) const; + float GetTextExtentSizeF(void) const; protected: result SetPresenter(const _ButtonPresenter& buttonPresenter); @@ -234,7 +273,10 @@ private: Tizen::Graphics::Color __color[NUMBER_OF_BUTTON_STATUS]; Tizen::Graphics::Bitmap* __pBitmap[NUMBER_OF_BUTTON_STATUS]; - Tizen::Graphics::Point __bitmapPosition[NUMBER_OF_BUTTON_STATUS]; + Tizen::Graphics::FloatPoint __bitmapPosition[NUMBER_OF_BUTTON_STATUS]; + + Tizen::Graphics::Bitmap* __pEffectBitmap[NUMBER_OF_BUTTON_STATUS]; + Tizen::Graphics::FloatPoint __effectBitmapPosition[NUMBER_OF_BUTTON_STATUS]; Tizen::Graphics::Bitmap* __pToolbarItemBackgroundBitmap[NUMBER_OF_BUTTON_STATUS]; Tizen::Graphics::Bitmap* __pBackgroundBitmap[NUMBER_OF_BUTTON_STATUS]; @@ -245,13 +287,12 @@ private: VerticalAlignment __verticalAlignment; _ButtonStatus __buttonStatus; + _ButtonStatus __prevButtonStatus; _ButtonStyle __buttonStyle; - int __textSize; + float __textSize; int __textMaxLine; - int __parentMoveDistance; - bool __isUserBackgroundBitmap[NUMBER_OF_BUTTON_STATUS]; bool __isUserBackgroundEffectBitmap[NUMBER_OF_BUTTON_STATUS]; @@ -259,12 +300,19 @@ private: bool __userDefinedText; - int __topMargin; - int __leftMargin; + float __leftMargin; + float __topMargin; + float __rightMargin; + float __bottomMargin; + + float __leftTouchMargin; + float __topTouchMargin; + float __rightTouchMargin; + float __bottomTouchMargin; bool __drawInner; - Tizen::Graphics::Rectangle __userDefinedTextArea; + Tizen::Graphics::FloatRectangle __userDefinedTextArea; Tizen::Ui::_AccessibilityElement* __pTextElement; }; // _Button diff --git a/src/ui/inc/FUiCtrl_ButtonImpl.h b/src/ui/inc/FUiCtrl_ButtonImpl.h index 4679ab8..ae96590 100644 --- a/src/ui/inc/FUiCtrl_ButtonImpl.h +++ b/src/ui/inc/FUiCtrl_ButtonImpl.h @@ -47,11 +47,13 @@ public: class ButtonSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // ButtonSizeInfo public: virtual ~_ButtonImpl(void); static _ButtonImpl* CreateButtonImplN(Button* pControl, const Tizen::Graphics::Rectangle& bounds); + static _ButtonImpl* CreateButtonImplN(Button* pControl, const Tizen::Graphics::FloatRectangle& bounds); virtual const char* GetPublicClassName(void) const; virtual const Button& GetPublic(void) const; @@ -89,14 +91,24 @@ public: result SetNormalBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); result SetDisabledBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); result SetPressedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + result SetHighlightedBitmap(const Tizen::Graphics::Point& position, const Tizen::Graphics::Bitmap& bitmap); + + result SetNormalBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + result SetDisabledBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + result SetPressedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); + result SetHighlightedBitmap(const Tizen::Graphics::FloatPoint& position, const Tizen::Graphics::Bitmap& bitmap); result SetNormalBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); + result SetDisabledBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); result SetPressedBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); result SetHighlightedBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); result SetTextSize(int size); int GetTextSize(void) const; + result SetTextSize(float size); + float GetTextSizeF(void) const; + virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); virtual result OnAttachedToMainTree(void); @@ -106,6 +118,7 @@ public: virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; public: static const Tizen::Graphics::Color GetColorOnError(void); diff --git a/src/ui/inc/FUiCtrl_ButtonItemImpl.h b/src/ui/inc/FUiCtrl_ButtonItemImpl.h index 9d32817..f6ece3e 100644 --- a/src/ui/inc/FUiCtrl_ButtonItemImpl.h +++ b/src/ui/inc/FUiCtrl_ButtonItemImpl.h @@ -65,6 +65,7 @@ public: result SetText(const Tizen::Base::String& text); + void SetAccessibilityHint(const Tizen::Base::String& hint); private: _ButtonItemImpl(const _ButtonItemImpl& buttonItem); @@ -76,6 +77,7 @@ private: int __actionId; ButtonItemStyle __itemStyle; Tizen::Base::String __itemText; + Tizen::Base::String __accessibilityHint; const Tizen::Graphics::Bitmap* __pIconBitmap[BUTTON_ITEM_MAX_STATE_COUNT]; const Tizen::Graphics::Bitmap* __pButtonItemBackgroundBitmap[BUTTON_ITEM_MAX_STATE_COUNT]; diff --git a/src/ui/inc/FUiCtrl_ButtonModel.h b/src/ui/inc/FUiCtrl_ButtonModel.h index ee57e8c..7f6e507 100644 --- a/src/ui/inc/FUiCtrl_ButtonModel.h +++ b/src/ui/inc/FUiCtrl_ButtonModel.h @@ -30,7 +30,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _ButtonModel * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_ButtonPresenter.h b/src/ui/inc/FUiCtrl_ButtonPresenter.h index a60e2ac..1636fc8 100644 --- a/src/ui/inc/FUiCtrl_ButtonPresenter.h +++ b/src/ui/inc/FUiCtrl_ButtonPresenter.h @@ -40,7 +40,7 @@ class _ButtonModel; /** * @class _ButtonPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -67,12 +67,17 @@ public: void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); + void OnFontInfoRequested(unsigned long& style, float& size); void SetTextSize(int size, unsigned long fontStyle = Tizen::Graphics::FONT_STYLE_PLAIN); + void SetTextSize(float size, unsigned long fontStyle = Tizen::Graphics::FONT_STYLE_PLAIN); void SetFontInfo(unsigned long style, int size); + void SetFontInfo(unsigned long style, float size); Tizen::Graphics::_Text::TextObject* GetTextObject(void) const; result InitTextObject(void); + Tizen::Graphics::Font* GetFont(void) const; + protected: result SetModel(const _ButtonModel& buttonModel); @@ -100,7 +105,7 @@ private: Tizen::Ui::Animations::_VisualElement* __pBase; unsigned long __fontStyle; - int __fontSize; + float __fontSize; }; // _ButtonPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_CheckButton.h b/src/ui/inc/FUiCtrl_CheckButton.h index 678d3a2..e678332 100644 --- a/src/ui/inc/FUiCtrl_CheckButton.h +++ b/src/ui/inc/FUiCtrl_CheckButton.h @@ -41,7 +41,7 @@ class _CheckButtonPresenter; /** * @class _CheckButton * @brief - * @since 1.0 + * @since 2.0 * * * @@ -182,6 +182,8 @@ public: int GetTextSize(void) const; int GetTitleTextSize(void) const; + float GetTextSizeF(void) const; + float GetTitleTextSizeF(void) const; result SetCheckButtonStyle(const CheckButtonStyle& checkButtonStyle); result SetBackgroundStyle(const BackgroundStyle& backgroundStyle); @@ -203,10 +205,12 @@ public: Tizen::Graphics::Bitmap* GetOnOffBgPressedBitmap(void) const; Tizen::Graphics::Bitmap* GetOnOffBitmap(void) const; - Tizen::Graphics::Bitmap* GetOnOffSlidingOnBitmap(void) const; - Tizen::Graphics::Bitmap* GetOnOffSlidingOffBitmap(void) const; - Tizen::Graphics::Bitmap* GetDimOnOffSlidingOnBitmap(void) const; - Tizen::Graphics::Bitmap* GetDimOnOffSlidingOffBitmap(void) const; + Tizen::Graphics::Bitmap* GetOnOffSlidingOnBgBitmap(void) const; + Tizen::Graphics::Bitmap* GetOnOffSlidingOffBgBitmap(void) const; + Tizen::Graphics::Bitmap* GetDimOnOffSlidingOnBgBitmap(void) const; + Tizen::Graphics::Bitmap* GetDimOnOffSlidingOffBgBitmap(void) const; + Tizen::Graphics::Bitmap* GetOnOffSlidingHandlerBitmap(void) const; + Tizen::Graphics::Bitmap* GetDimOnOffSlidingHandlerBitmap(void) const; Tizen::Graphics::Bitmap* GetCircleBitmap(void) const; Tizen::Graphics::Bitmap* GetCircleNormalEffectBitmap(void) const; @@ -279,10 +283,12 @@ private: Tizen::Graphics::Bitmap* __pOnOffBgPressedBitmap; Tizen::Graphics::Bitmap* __pOnOffBitmap; - Tizen::Graphics::Bitmap* __pOnOffSlidingOnBitmap; - Tizen::Graphics::Bitmap* __pOnOffSlidingOffBitmap; - Tizen::Graphics::Bitmap* __pDimOnOffSlidingOnBitmap; - Tizen::Graphics::Bitmap* __pDimOnOffSlidingOffBitmap; + Tizen::Graphics::Bitmap* __pOnOffSlidingOnBgBitmap; + Tizen::Graphics::Bitmap* __pOnOffSlidingOffBgBitmap; + Tizen::Graphics::Bitmap* __pDimOnOffSlidingOnBgBitmap; + Tizen::Graphics::Bitmap* __pDimOnOffSlidingOffBgBitmap; + Tizen::Graphics::Bitmap* __pOnOffSlidingHandlerBitmap; + Tizen::Graphics::Bitmap* __pDimOnOffSlidingHandlerBitmap; Tizen::Graphics::Bitmap* __pCircleBitmap; Tizen::Graphics::Bitmap* __pCircleNormalEffectBitmap; @@ -308,10 +314,9 @@ private: HorizontalAlignment __horizontalAlignment; VerticalAlignment __verticalAlignment; - int __textSize; - int __titleTextSize; + float __textSize; + float __titleTextSize; - int __parentMoveDistance; bool __previousTouchArea; _Control* __pRadioGroup; diff --git a/src/ui/inc/FUiCtrl_CheckButtonImpl.h b/src/ui/inc/FUiCtrl_CheckButtonImpl.h index f550055..1cbab57 100644 --- a/src/ui/inc/FUiCtrl_CheckButtonImpl.h +++ b/src/ui/inc/FUiCtrl_CheckButtonImpl.h @@ -46,11 +46,13 @@ public: class CheckButtonSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // CheckButtonSizeInfo public: virtual ~_CheckButtonImpl(void); static _CheckButtonImpl* CreateCheckButtonImplN(CheckButton* pControl, const Tizen::Graphics::Rectangle& bounds); + static _CheckButtonImpl* CreateCheckButtonImplN(CheckButton* pControl, const Tizen::Graphics::FloatRectangle& bounds); virtual const char* GetPublicClassName(void) const; virtual const CheckButton& GetPublic(void) const; diff --git a/src/ui/inc/FUiCtrl_CheckButtonModel.h b/src/ui/inc/FUiCtrl_CheckButtonModel.h index 99c3f71..159abc6 100644 --- a/src/ui/inc/FUiCtrl_CheckButtonModel.h +++ b/src/ui/inc/FUiCtrl_CheckButtonModel.h @@ -30,7 +30,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _CheckButtonModel * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_CheckButtonPresenter.h b/src/ui/inc/FUiCtrl_CheckButtonPresenter.h index d2249c8..8585c16 100644 --- a/src/ui/inc/FUiCtrl_CheckButtonPresenter.h +++ b/src/ui/inc/FUiCtrl_CheckButtonPresenter.h @@ -40,7 +40,7 @@ class _CheckButtonModel; /** * @class _CHeckButtonPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -70,13 +70,14 @@ public: void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void SetFontInfo(unsigned long style, int size); + void OnFontInfoRequested(unsigned long& style, float& size); + void SetFontInfo(unsigned long style, float size); - Tizen::Graphics::Rectangle GetTitleTextBounds(void) const; - Tizen::Graphics::Rectangle GetTextBounds(void) const; - Tizen::Graphics::Rectangle GetDefaultButtonBounds(void) const; - Tizen::Graphics::Rectangle GetOnOffSlidingButtonBounds(void) const; - Tizen::Graphics::Rectangle GetDetailedButtonBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleTextBoundsF(void) const; + Tizen::Graphics::FloatRectangle GetTextBoundsF(void) const; + Tizen::Graphics::FloatRectangle GetDefaultButtonBoundsF(void) const; + Tizen::Graphics::FloatRectangle GetOnOffSlidingButtonBoundsF(void) const; + Tizen::Graphics::FloatRectangle GetDetailedButtonBoundsF(void) const; result StartCheckAnimationTimer(void); result ResetCheckAnimationTimer(void); @@ -110,14 +111,14 @@ private: Tizen::Graphics::_Text::TextObject* __pTextObject; Tizen::Graphics::_Text::TextObject* __pTitleTextObject; - Tizen::Graphics::Rectangle __titleTextBounds; - Tizen::Graphics::Rectangle __textBounds; - Tizen::Graphics::Rectangle __defaultButtonBounds; - Tizen::Graphics::Rectangle __onOffSlidingButtonBounds; - Tizen::Graphics::Rectangle __detailedButtonBounds; + Tizen::Graphics::FloatRectangle __titleTextBounds; + Tizen::Graphics::FloatRectangle __textBounds; + Tizen::Graphics::FloatRectangle __defaultButtonBounds; + Tizen::Graphics::FloatRectangle __onOffSlidingButtonBounds; + Tizen::Graphics::FloatRectangle __detailedButtonBounds; unsigned long __fontStyle; - int __fontSize; + float __fontSize; static const int CHECK_ACTION_TIMER_PERIOD = 10; static const int RATIO_MAX = 10; diff --git a/src/ui/inc/FUiCtrl_ColorChangeEvent.h b/src/ui/inc/FUiCtrl_ColorChangeEvent.h index 3280a58..19dbd47 100644 --- a/src/ui/inc/FUiCtrl_ColorChangeEvent.h +++ b/src/ui/inc/FUiCtrl_ColorChangeEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorChangeEvent.h * @brief This is the header file for _ColorChangeEvent class. diff --git a/src/ui/inc/FUiCtrl_ColorPicker.h b/src/ui/inc/FUiCtrl_ColorPicker.h index db52e7c..7b1fb2d 100644 --- a/src/ui/inc/FUiCtrl_ColorPicker.h +++ b/src/ui/inc/FUiCtrl_ColorPicker.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPicker.h * @brief This is the header file for the _ColorPicker class. @@ -131,7 +132,8 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} @@ -157,18 +159,6 @@ private: Tizen::Ui::Animations::_VisualElement* __pLuminanceHandler; - Tizen::Ui::_AccessibilityElement* __pDecreaseHueButtonElement; - - Tizen::Ui::_AccessibilityElement* __pIncreaseHueButtonElement; - - Tizen::Ui::_AccessibilityElement* __pDecreaseSaturationButtonElement; - - Tizen::Ui::_AccessibilityElement* __pIncreaseSaturationButtonElement; - - Tizen::Ui::_AccessibilityElement* __pDecreaseLuminanceButtonElement; - - Tizen::Ui::_AccessibilityElement* __pIncreaseLuminanceButtonElement; - Tizen::Ui::_AccessibilityElement* __pHueBarElement; Tizen::Ui::_AccessibilityElement* __pSaturationBarElement; diff --git a/src/ui/inc/FUiCtrl_ColorPickerImpl.h b/src/ui/inc/FUiCtrl_ColorPickerImpl.h index 75d5daf..32d69a4 100644 --- a/src/ui/inc/FUiCtrl_ColorPickerImpl.h +++ b/src/ui/inc/FUiCtrl_ColorPickerImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerImpl.h * @brief This is the header file for the _ColorPickerImpl class. diff --git a/src/ui/inc/FUiCtrl_ColorPickerModel.h b/src/ui/inc/FUiCtrl_ColorPickerModel.h index deae6b9..b9e5b96 100644 --- a/src/ui/inc/FUiCtrl_ColorPickerModel.h +++ b/src/ui/inc/FUiCtrl_ColorPickerModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerModel.h * @brief This is the header file for the _ColorPickerModel class. diff --git a/src/ui/inc/FUiCtrl_ColorPickerPresenter.h b/src/ui/inc/FUiCtrl_ColorPickerPresenter.h index a7a4b4f..f16829a 100644 --- a/src/ui/inc/FUiCtrl_ColorPickerPresenter.h +++ b/src/ui/inc/FUiCtrl_ColorPickerPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ColorPickerPresenter.h * @brief This is the header file for the _ColorPicker class. @@ -29,8 +30,8 @@ namespace Tizen { namespace Graphics { -class Point; -class Rectangle; +class FloatPoint; +class FloatRectangle; class Canvas; class Color; }} //Tizen::Graphics @@ -92,7 +93,7 @@ public: result SetLuminance(int luminance); - void LoadDrawingProperties(const Tizen::Graphics::Rectangle& controlBounds); + void LoadDrawingProperties(const Tizen::Graphics::FloatRectangle& controlBounds); void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); @@ -124,7 +125,7 @@ private: result DrawLine(Tizen::Graphics::Canvas& canvas); - result DrawArrowButton(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& rcButton, bool isSelected, bool drawLeftButton); + result DrawArrowButton(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& rcButton, bool isSelected, bool drawLeftButton); result DrawArrowButtons(Tizen::Graphics::Canvas& canvas); @@ -132,9 +133,9 @@ private: result TouchButton(void); - result TouchHandler(int x); + result TouchHandler(float x); - result SetHandlerPosition(_ColorPickerComponentType handlerType, int position); + result SetHandlerPosition(_ColorPickerComponentType handlerType, float position); result SetHandlerPositionByRatio(_ColorPickerComponentType handlerType, double ratio); @@ -142,11 +143,11 @@ private: bool IsLeftButton(_ColorPickerComponentType buttonType); - Tizen::Graphics::Rectangle& GetBarBoundsFromHandler(_ColorPickerComponentType handlerType); + Tizen::Graphics::FloatRectangle& GetBarBoundsFromHandler(_ColorPickerComponentType handlerType); - _ColorPickerComponentType GetTouchActionType(const Tizen::Graphics::Point& position) const; + _ColorPickerComponentType GetTouchActionType(const Tizen::Graphics::FloatPoint& position) const; - result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); + result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); _ColorPickerPresenter(_ColorPicker& colorPicker); @@ -167,15 +168,15 @@ private: _ColorPickerComponentType __eventType; - int __topMargin; + float __topMargin; - int __blockMargin; + float __blockMargin; - int __blockHeight; - int __dividerMargin; - int __dividerWidth; + float __blockHeight; + float __dividerMargin; + float __dividerWidth; - Tizen::Graphics::Rectangle __componentBounds[COMPONENT_TYPE_MAX]; + Tizen::Graphics::FloatRectangle __componentBounds[COMPONENT_TYPE_MAX]; Tizen::Graphics::Color __hueColor; @@ -189,9 +190,9 @@ private: Tizen::Graphics::Bitmap* __pColorNormalReplacementBgBitmap; Tizen::Graphics::Bitmap* __pColorPressedReplacementBgBitmap; Tizen::Graphics::Bitmap* __pColorDisabledReplacementBgBitmap; - Tizen::Graphics::Bitmap* __pColorNormalEffectReplacementBgBitmap; - Tizen::Graphics::Bitmap* __pColorPressedEffectReplacementBgBitmap; - Tizen::Graphics::Bitmap* __pColorDisabledEffectReplacementBgBitmap; + Tizen::Graphics::Bitmap* __pNormalEffectBgBitmap; + Tizen::Graphics::Bitmap* __pPressedEffectBgBitmap; + Tizen::Graphics::Bitmap* __pDisabledEffectBgBitmap; Tizen::Graphics::Bitmap* __pLeftArrowNormalBitmap; Tizen::Graphics::Bitmap* __pLeftArrowPressedBitmap; Tizen::Graphics::Bitmap* __pLeftArrowDisabledBitmap; diff --git a/src/ui/inc/FUiCtrl_ContextMenu.h b/src/ui/inc/FUiCtrl_ContextMenu.h index a4ce7eb..5d4dc1c 100644 --- a/src/ui/inc/FUiCtrl_ContextMenu.h +++ b/src/ui/inc/FUiCtrl_ContextMenu.h @@ -134,10 +134,10 @@ class _OSP_EXPORT_ _ContextMenu // Lifecycle public: - _ContextMenu(const Tizen::Graphics::Point& point, enum ContextMenuCoreStyle style + _ContextMenu(const Tizen::Graphics::FloatPoint& point, enum ContextMenuCoreStyle style , enum ContextMenuCoreAlign contextMenuAlign = CONTEXT_MENU_CORE_ALIGN_AUTO); virtual ~_ContextMenu(void); - static _ContextMenu* CreateContextMenuN(const Tizen::Graphics::Point& point + static _ContextMenu* CreateContextMenuN(const Tizen::Graphics::FloatPoint& point , enum ContextMenuCoreStyle style, enum ContextMenuCoreAlign contextMenuAlign); // Operation @@ -157,14 +157,14 @@ public: int GetShowItemMaxCount(void) const; int GetItemIndexAt(int actionId) const; int GetItemActionIdAt(int index) const; - result SetAnchorPosition(int x, int y); - Tizen::Graphics::Point GetAnchorPosition(void) const; - result SetBodyRect(const Tizen::Graphics::Rectangle& rect); - Tizen::Graphics::Rectangle GetBodyRect(void) const; - result SetArrowRect(const Tizen::Graphics::Rectangle& rect); - Tizen::Graphics::Rectangle GetArrowRect(void) const; - result SetWindowRect(const Tizen::Graphics::Rectangle& rect); - Tizen::Graphics::Rectangle GetWindowRect(void) const; + result SetAnchorPosition(float x, float y); + Tizen::Graphics::FloatPoint GetAnchorPosition(void) const; + result SetBodyRect(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::FloatRectangle GetBodyRect(void) const; + result SetArrowRect(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::FloatRectangle GetArrowRect(void) const; + result SetWindowRect(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::FloatRectangle GetWindowRect(void) const; result SetTextColor(enum ContextMenuCoreItemStatus status, const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetTextColor(enum ContextMenuCoreItemStatus status) const; result SetColor(const Tizen::Graphics::Color& color); @@ -195,7 +195,7 @@ public: virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void OnVisibleStateChanged(void); virtual void OnChangeLayout(_ControlOrientation orientation); @@ -204,7 +204,7 @@ public: Tizen::Ui::_AccessibilityElement* GetAccessibilityElement(const int mainIndex) const; void AddAccessibilityElement(const _AccessibilityElement& element); - _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::Point& position) const; + _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const; _ContextMenuItemInfo FindItem(int index) const; result SetTopDrawnItemIndex(int index); @@ -235,10 +235,10 @@ private: bool __ownerInputEnableState; // attribute for position fo the window - Tizen::Graphics::Point __anchorPoint; // the anchor point on whole screen area. - Tizen::Graphics::Rectangle __bodyRect; // the body area of the ContextMenu area. - Tizen::Graphics::Rectangle __arrowRect; // the arrow area of the ContextMenu area. - Tizen::Graphics::Rectangle __windowRect; // the ContextMenu area on whole screen area. + Tizen::Graphics::FloatPoint __anchorPoint; // the anchor point on whole screen area. + Tizen::Graphics::FloatRectangle __bodyRect; // the body area of the ContextMenu area. + Tizen::Graphics::FloatRectangle __arrowRect; // the arrow area of the ContextMenu area. + Tizen::Graphics::FloatRectangle __windowRect; // the ContextMenu area on whole screen area. // attribute for event _ActionEvent* __pActionEvent; diff --git a/src/ui/inc/FUiCtrl_ContextMenuGridPresenter.h b/src/ui/inc/FUiCtrl_ContextMenuGridPresenter.h index 44544a8..fc7b653 100644 --- a/src/ui/inc/FUiCtrl_ContextMenuGridPresenter.h +++ b/src/ui/inc/FUiCtrl_ContextMenuGridPresenter.h @@ -78,29 +78,29 @@ public: virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void SetAllAccessibilityElement(void); - virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::Point& position); + virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position); virtual _ContextMenuItemInfo FindItem(int index); virtual result SetTopDrawnItemIndex(int index); - virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); private: void LoadShape(void); result CalculateRect(void); void AdjustItemLayout(void); void AdjustItemPosition(void); - Tizen::Graphics::Dimension AdjustItemLayoutIconStyle(void); - Tizen::Graphics::Dimension AdjustItemLayoutTabStyle(void); + Tizen::Graphics::FloatDimension AdjustItemLayoutIconStyle(void); + Tizen::Graphics::FloatDimension AdjustItemLayoutTabStyle(void); bool IsLayoutBitmapOnly(void); _ContextMenuItem* CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap); result DrawItem(Tizen::Graphics::Canvas* pCanvas); - result DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Point point1, Tizen::Graphics::Point point2, bool drawVLine); + result DrawLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatPoint point1, Tizen::Graphics::FloatPoint point2, bool drawVLine); void SetItemSize(_ContextMenuItem* pItem); - int GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const; int GetCountPerLine(int count, int min, int max) const; private: _ContextMenuGridPresenter(const _ContextMenuGridPresenter& rhs); @@ -113,33 +113,33 @@ private: Tizen::Graphics::_Text::TextObject* __pTextObject; Tizen::Graphics::Font* __pFont; - Tizen::Graphics::Dimension __layoutSize; + Tizen::Graphics::FloatDimension __layoutSize; bool __touchOutRect; int __selectedIndex; int __pressedIndex; - int __maxWidth; - int __minWidth; - int __topMargin; - int __bottomMargin; - int __leftMargin; - int __rightMargin; - int __screenTopMargin; - int __screenBottomMargin; - int __screenLeftMargin; - int __screenRightMargin; - int __arrowMargin; - int __arrowWidth; - int __arrowHeight; - int __itemWidth; - int __itemHeight; - int __itemMaxWidth; - int __itemTextMargin; - int __itemGap; - int __itemBitmapWidth; - int __itemBitmapHeight; - int __itemFontSize; - int __dividerHeight; + float __maxWidth; + float __minWidth; + float __topMargin; + float __bottomMargin; + float __leftMargin; + float __rightMargin; + float __screenTopMargin; + float __screenBottomMargin; + float __screenLeftMargin; + float __screenRightMargin; + float __arrowMargin; + float __arrowWidth; + float __arrowHeight; + float __itemWidth; + float __itemHeight; + float __itemMaxWidth; + float __itemTextMargin; + float __itemGap; + float __itemBitmapWidth; + float __itemBitmapHeight; + float __itemFontSize; + float __dividerHeight; }; // _ContextMenuGridPresenter }}} // Tizen::Ui: Control diff --git a/src/ui/inc/FUiCtrl_ContextMenuImpl.h b/src/ui/inc/FUiCtrl_ContextMenuImpl.h index c5e7755..843fab4 100644 --- a/src/ui/inc/FUiCtrl_ContextMenuImpl.h +++ b/src/ui/inc/FUiCtrl_ContextMenuImpl.h @@ -56,7 +56,7 @@ class _ContextMenuImpl // Lifecycle public: virtual ~_ContextMenuImpl(void); - static _ContextMenuImpl* CreateContextMenuImplN(ContextMenu* pPublic, const Tizen::Graphics::Point& point, ContextMenuStyle style, ContextMenuAnchorDirection direction); + static _ContextMenuImpl* CreateContextMenuImplN(ContextMenu* pPublic, const Tizen::Graphics::FloatPoint& point, ContextMenuStyle style, ContextMenuAnchorDirection direction); // Operation public: result AddItem(const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap); @@ -69,8 +69,8 @@ public: int GetMaxVisibleItemsCount(void) const; int GetItemIndexFromActionId(int actionId) const; int GetItemActionIdAt(int index) const; - result SetAnchorPosition(int x, int y); - Tizen::Graphics::Point GetAnchorPosition(void) const; + result SetAnchorPosition(float x, float y); + Tizen::Graphics::FloatPoint GetAnchorPosition(void) const; result SetColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetColor(void) const; result SetItemTextColor(ContextMenuItemStatus status, const Tizen::Graphics::Color& color); @@ -81,7 +81,6 @@ public: result AddActionEventListener(Tizen::Ui::IActionEventListener& listener); result RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener); - virtual result OnAttachedToMainTree(void); virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); // Accessor diff --git a/src/ui/inc/FUiCtrl_ContextMenuItem.h b/src/ui/inc/FUiCtrl_ContextMenuItem.h index 3b291a5..a702c26 100644 --- a/src/ui/inc/FUiCtrl_ContextMenuItem.h +++ b/src/ui/inc/FUiCtrl_ContextMenuItem.h @@ -80,7 +80,7 @@ public: void SetDivider(bool drawDivider); bool GetDivider(void) const; - void SetTextSize(int size); + void SetTextSize(float size); result SetText(const Tizen::Base::String& text); const Tizen::Base::String& GetText(void) const; @@ -88,11 +88,11 @@ public: result SetBitmap(ContextMenuItemDrawingStatus status, const Tizen::Graphics::Bitmap* pBitmap); const Tizen::Graphics::Bitmap* GetBitmap(ContextMenuItemDrawingStatus status) const; - void SetSize(Tizen::Graphics::Dimension size); - Tizen::Graphics::Dimension GetSize(void) const; + void SetSize(Tizen::Graphics::FloatDimension size); + Tizen::Graphics::FloatDimension GetSize(void) const; - void SetDrawRect(Tizen::Graphics::Rectangle rect); - Tizen::Graphics::Rectangle GetDrawRect(void) const; + void SetDrawRect(Tizen::Graphics::FloatRectangle rect); + Tizen::Graphics::FloatRectangle GetDrawRect(void) const; void SetParentScrollEnable(bool enable); bool GetParentScrollEnable() const; @@ -101,7 +101,7 @@ public: int Release(void); - void Reset(void); + void SetAndInvalidate(bool flag); // draw virtual void OnDraw(void); @@ -110,6 +110,7 @@ public: void SetTextLabel(_Label* pLabel); void DrawItemDivider(void); + void TouchMoved(const _Control& source, const _TouchInfo& touchinfo); // event handler for ITouchEventListener virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo); @@ -120,7 +121,7 @@ public: virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); private: _ContextMenuItem(const _ContextMenuItem& rhs); @@ -136,11 +137,11 @@ private: bool __selected; bool __parentScrollEnable; - int __textSize; + float __textSize; Tizen::Base::String __text; Tizen::Graphics::Bitmap* __pBitmap[CONTEXT_MENU_ITEM_DRAWING_STATUS_MAX]; - Tizen::Graphics::Dimension __size; - Tizen::Graphics::Rectangle __drawRect; + Tizen::Graphics::FloatDimension __size; + Tizen::Graphics::FloatRectangle __drawRect; _Label* __pBitmapLabel; _Label* __pTextLabel; diff --git a/src/ui/inc/FUiCtrl_ContextMenuListPresenter.h b/src/ui/inc/FUiCtrl_ContextMenuListPresenter.h index 89c5d4a..f8bafc9 100644 --- a/src/ui/inc/FUiCtrl_ContextMenuListPresenter.h +++ b/src/ui/inc/FUiCtrl_ContextMenuListPresenter.h @@ -78,24 +78,24 @@ public: virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void SetAllAccessibilityElement(void); - virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::Point& position); + virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position); virtual _ContextMenuItemInfo FindItem(int index); virtual result SetTopDrawnItemIndex(int index); - virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); private: void LoadShape(void); result CalculateRect(void); void AdjustItemLayout(void); void AdjustItemPosition(void); - Tizen::Graphics::Dimension AdjustItemLayoutStyle(void); + Tizen::Graphics::FloatDimension AdjustItemLayoutStyle(void); _ContextMenuItem* CreateItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap); - int GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const; private: _ContextMenuListPresenter(const _ContextMenuListPresenter& rhs); @@ -107,35 +107,34 @@ private: _ContextMenuModel* __pModel; Tizen::Graphics::Font* __pFont; - Tizen::Graphics::Dimension __layoutSize; + Tizen::Graphics::FloatDimension __layoutSize; bool __touchOutRect; int __selectedIndex; bool __scrollEnable; - int __maxWidth; - int __minWidth; - int __topMargin; - int __bottomMargin; - int __leftMargin; - int __rightMargin; - int __screenTopMargin; - int __screenBottomMargin; - int __screenLeftMargin; - int __screenRightMargin; - int __arrowMargin; - int __arrowWidth; - int __arrowHeight; - int __itemWidth; - int __itemMinWidth; - int __itemHeight; - int __itemMaxWidth; - int __itemGap; - int __itemBitmapWidth; - int __itemBitmapHeight; - int __itemFontSize; - int __dividerHeight; - + float __maxWidth; + float __minWidth; + float __topMargin; + float __bottomMargin; + float __leftMargin; + float __rightMargin; + float __screenTopMargin; + float __screenBottomMargin; + float __screenLeftMargin; + float __screenRightMargin; + float __arrowMargin; + float __arrowWidth; + float __arrowHeight; + float __itemWidth; + float __itemMinWidth; + float __itemHeight; + float __itemMaxWidth; + float __itemGap; + float __itemBitmapWidth; + float __itemBitmapHeight; + float __itemFontSize; + float __dividerHeight; }; // _ContextMenuListPresenter }}} // Tizen::Ui: Control diff --git a/src/ui/inc/FUiCtrl_CustomElement.h b/src/ui/inc/FUiCtrl_CustomElement.h index ec125e9..74da5c3 100644 --- a/src/ui/inc/FUiCtrl_CustomElement.h +++ b/src/ui/inc/FUiCtrl_CustomElement.h @@ -40,7 +40,7 @@ public: ~_CustomElement(void); public: - virtual bool DrawElement(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& rect, ListViewItemDrawingStatus status); + virtual bool DrawElement(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatRectangle& rect, ListViewItemDrawingStatus status); void SetElement(const Tizen::Ui::Controls::ICustomElement& element); diff --git a/src/ui/inc/FUiCtrl_CustomItemImpl.h b/src/ui/inc/FUiCtrl_CustomItemImpl.h index 5b055e2..1413394 100644 --- a/src/ui/inc/FUiCtrl_CustomItemImpl.h +++ b/src/ui/inc/FUiCtrl_CustomItemImpl.h @@ -37,7 +37,7 @@ class _CustomItemImpl : public _ListItemBaseImpl { public: - static _CustomItemImpl* CreateCustomItemImplN(CustomItem* pPublic, const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + static _CustomItemImpl* CreateCustomItemImplN(CustomItem* pPublic, const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); virtual ~_CustomItemImpl(void); @@ -45,20 +45,20 @@ public: virtual const char* GetPublicClassName(void) const; - virtual result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + virtual result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); - result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::EnrichedText& text); + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::EnrichedText& text); - result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = true); + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = true); - result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Base::String& text, int textSize, + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, float textSize, const Tizen::Graphics::Color& normalTextColor, const Tizen::Graphics::Color& pressedTextColor, const Tizen::Graphics::Color& highlightedTextColor, bool textSliding = true); - result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::Bitmap& normalBitmap, + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = null, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null); - result AddElement(const Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Ui::Controls::ICustomElement& element); + result AddElement(const Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Ui::Controls::ICustomElement& element); result RemoveAllElements(void); diff --git a/src/ui/inc/FUiCtrl_CustomListImpl.h b/src/ui/inc/FUiCtrl_CustomListImpl.h index ad47a92..8b7a2f9 100644 --- a/src/ui/inc/FUiCtrl_CustomListImpl.h +++ b/src/ui/inc/FUiCtrl_CustomListImpl.h @@ -133,6 +133,7 @@ private: private: _CustomListItemDataProvider* __pItemProvider; Tizen::Base::Collection::LinkedList __itemListenersList; + bool __directDelete; friend class _CustomListItemDataProvider; friend class _ExpandableListImpl; diff --git a/src/ui/inc/FUiCtrl_DatePickerImpl.h b/src/ui/inc/FUiCtrl_DatePickerImpl.h index ca061bf..9e8694d 100644 --- a/src/ui/inc/FUiCtrl_DatePickerImpl.h +++ b/src/ui/inc/FUiCtrl_DatePickerImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DatePickerImpl.h * @brief This is the header file for the _DatePickerImpl class. @@ -44,8 +45,8 @@ class _DatePickerImpl public: class DatePickerSizeInfo : public _ControlImpl::SizeInfo { - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMaximumSizeF(_ControlOrientation orientation) const; }; public: diff --git a/src/ui/inc/FUiCtrl_DateTimeBar.h b/src/ui/inc/FUiCtrl_DateTimeBar.h index 7ae9ef7..0cc5277 100644 --- a/src/ui/inc/FUiCtrl_DateTimeBar.h +++ b/src/ui/inc/FUiCtrl_DateTimeBar.h @@ -60,7 +60,7 @@ public: static _DateTimeBar* CreateDateTimeBarN(void); public: - result SetPositionAndAlignment(const Tizen::Graphics::Point& point, _DateTimeBarAlignment alignment); + result SetPositionAndAlignment(const Tizen::Graphics::FloatPoint& point, _DateTimeBarAlignment alignment); result SetInitialValue(int minValue, int maxValue, int displayValue, _DateTimeId boxId); result RemoveAllItems(void); @@ -77,36 +77,35 @@ public: result AddDateTimeChangeEventListener(const _IDateTimeChangeEventListener& listener); result RemoveDateTimeChangeEventListener(const _IDateTimeChangeEventListener& listener); - result CalculateArrowBounds(const Tizen::Graphics::Rectangle& bounds); + result CalculateArrowBounds(const Tizen::Graphics::FloatRectangle& bounds); result FireActionEvent(int actionId); result FireDateTimeChangeEvent(_DateTimeChangeStatus status); + virtual bool IsActivatedOnOpen(void) const; virtual void OnDraw(void); virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control); - virtual result OnAttachingToMainTree(const Tizen::Ui::_Control* pParent); virtual result OnAttachedToMainTree(void); virtual result OnDetachingFromMainTree(void); - virtual void OnActivated(void); - virtual void OnDeactivated(void); virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture); virtual bool OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture); - void AddAccessibilityElement(const Tizen::Graphics::Rectangle& itemBounds, const Tizen::Base::String& itemText); + void AddAccessibilityElement(const Tizen::Graphics::FloatRectangle& itemBounds, const Tizen::Base::String& itemText); void RemoveAllAccessibilityElement(void); Tizen::Ui::AccessibilityTraits GetAccessibilityTraitValue(); Tizen::Base::String GetMonthValue(int month) const; void SetFont(Tizen::Graphics::Font& pFont); - void SetParentWindowBounds(Tizen::Graphics::Rectangle& parentWindowBounds); - Tizen::Graphics::Rectangle GetParentWindowBounds() const; + void SetParentWindowBounds(Tizen::Graphics::FloatRectangle& parentWindowBounds); + Tizen::Graphics::FloatRectangle GetParentWindowBounds() const; // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); @@ -131,7 +130,9 @@ private: _DateTimeChangeEvent* __pDateTimeChangeEvent; _TouchFlickGestureDetector* __pGestureFlick; Tizen::Base::Collection::LinkedListT<_AccessibilityElement*> __accessibilityElements; - Tizen::Graphics::Rectangle __parentWindowBounds; + Tizen::Graphics::FloatRectangle __parentWindowBounds; + bool __isAttachedToMainTree; + bool __ownerInputEnableState; }; // _DateTimeBar }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_DateTimeBarItem.h b/src/ui/inc/FUiCtrl_DateTimeBarItem.h index a5f9d22..a7127bb 100644 --- a/src/ui/inc/FUiCtrl_DateTimeBarItem.h +++ b/src/ui/inc/FUiCtrl_DateTimeBarItem.h @@ -37,7 +37,7 @@ public: ~_DateTimeBarItem(void); public: - static _DateTimeBarItem* CreateInstanceN(_DateTimeBarAlignment alignment, int itemWidth); + static _DateTimeBarItem* CreateInstanceN(_DateTimeBarAlignment alignment, float itemWidth); void SetActionId(int actionId); int GetActionId(void) const; @@ -47,8 +47,8 @@ public: void SetStatus(_DateTimeBarItemStatus status); _DateTimeBarItemStatus GetStatus(void) const; - void SetBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetBounds(void) const; + void SetBounds(const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle GetBounds(void) const; private: _DateTimeBarItem(void); @@ -60,7 +60,7 @@ private: int __actionId; Tizen::Base::String __text; _DateTimeBarItemStatus __status; - Tizen::Graphics::Rectangle __bounds; + Tizen::Graphics::FloatRectangle __bounds; }; // _DateTimeBarItem }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_DateTimeBarModel.h b/src/ui/inc/FUiCtrl_DateTimeBarModel.h index fd07c48..9087dcd 100644 --- a/src/ui/inc/FUiCtrl_DateTimeBarModel.h +++ b/src/ui/inc/FUiCtrl_DateTimeBarModel.h @@ -46,8 +46,8 @@ public: int GetItemCount(void) const; - result AddItem(const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, int itemWidth, int margin); - result InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, int itemWidth, int margin); + result AddItem(const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, float itemWidth, float margin); + result InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _DateTimeBarAlignment alignment, float itemWidth, float margin); result RemoveItemAt(int index); void RemoveAllItems(void); @@ -62,7 +62,7 @@ public: void SetMaximumValue(int maxValue); int GetMaxCachingSize(void) const; - result SetItemStartPosition(int positionX); + result SetItemStartPosition(float positionX); private: _DateTimeBarModel(const _DateTimeBarModel&); @@ -77,7 +77,7 @@ private: int __minValue; int __maxValue; int __maxCachingSize; - int __itemStartPositionX; + float __itemStartPositionX; }; // _DateTimeBarModel }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_DateTimeBarPresenter.h b/src/ui/inc/FUiCtrl_DateTimeBarPresenter.h index a9e74d3..38d442f 100644 --- a/src/ui/inc/FUiCtrl_DateTimeBarPresenter.h +++ b/src/ui/inc/FUiCtrl_DateTimeBarPresenter.h @@ -53,10 +53,10 @@ public: result AddItems(int actionId); result RemoveAllItems(void); - Tizen::Graphics::Rectangle GetBodyBounds(void) const; - void SetArrowBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetWindowBounds(void) const; - Tizen::Graphics::Rectangle GetArrowBounds(void) const; + Tizen::Graphics::FloatRectangle GetBodyBounds(void) const; + void SetArrowBounds(const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle GetWindowBounds(void) const; + Tizen::Graphics::FloatRectangle GetArrowBounds(void) const; int GetItemCount(void) const; _DateTimeBarItem* GetItemAt(int index) const; @@ -69,10 +69,10 @@ public: int GetMaximumValue(void) const; void SetMaximumValue(int maxValue); - int GetItemWidth(void) const; - int GetItemMargin(void) const; - int GetFontSize(void) const; - int GetLeftRightMargin(void) const; + float GetItemWidth(void) const; + float GetItemMargin(void) const; + float GetFontSize(void) const; + float GetLeftRightMargin(void) const; virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -111,11 +111,11 @@ private: int GetSelectedItemIndex(void) const; void SetFirstDrawnItemIndex(int index); - int GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const; - void SetWindowBounds(const Tizen::Graphics::Rectangle& bounds); - void SetBodyBounds(const Tizen::Graphics::Rectangle& bounds); - result AdjustItemPosition(int distance); + void SetWindowBounds(const Tizen::Graphics::FloatRectangle& bounds); + void SetBodyBounds(const Tizen::Graphics::FloatRectangle& bounds); + result AdjustItemPosition(float distance); Tizen::Base::String GetDisplayedText(int value) const; result LoadResource(void); @@ -130,11 +130,12 @@ private: _DateTimeBar* __pDateTimeBar; _DateTimeBarModel* __pDateTimeBarModel; - Tizen::Graphics::Point __currentPoint; + Tizen::Graphics::FloatPoint __currentPoint; bool __isTouchMoved; bool __touchMoveHandled; bool __isFlickEnabled; - int __distance; + bool __isFlickInProgress; + float __distance; Tizen::Base::Runtime::Timer* __pFlickAnimationTimer; _FlickAnimation __flickAnimation; Tizen::Base::String __selectedText; @@ -143,9 +144,9 @@ private: static const int FLICK_ANIMATION_FPS_DATE_TIME_BAR = 30; static const int FLICK_ANIMATION_SENSITIVITY_DATE_TIME_BAR = 30; - Tizen::Graphics::Rectangle __bodyAreaBounds; - Tizen::Graphics::Rectangle __arrowAreaBounds; - Tizen::Graphics::Rectangle __windowAreaBounds; + Tizen::Graphics::FloatRectangle __bodyAreaBounds; + Tizen::Graphics::FloatRectangle __arrowAreaBounds; + Tizen::Graphics::FloatRectangle __windowAreaBounds; Tizen::Graphics::Bitmap* __pBgColorReplacementBitmap; Tizen::Graphics::Bitmap* __pArrowColorReplacementBitmap; bool __isInitialAnimation; diff --git a/src/ui/inc/FUiCtrl_DateTimeChangeEvent.h b/src/ui/inc/FUiCtrl_DateTimeChangeEvent.h index 44caa5e..7eae4dc 100644 --- a/src/ui/inc/FUiCtrl_DateTimeChangeEvent.h +++ b/src/ui/inc/FUiCtrl_DateTimeChangeEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeChangeEvent.h * @brief This is the header file for the _DateTimeChangeEvent and _DateTimeChangeEventArg classes. diff --git a/src/ui/inc/FUiCtrl_DateTimeDisplayBox.h b/src/ui/inc/FUiCtrl_DateTimeDisplayBox.h index 70b33c2..a0fa8fd 100644 --- a/src/ui/inc/FUiCtrl_DateTimeDisplayBox.h +++ b/src/ui/inc/FUiCtrl_DateTimeDisplayBox.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeDisplayBox.h * @brief This is the header file for the _DateTimeDisplayBox class. @@ -32,13 +33,13 @@ class _DateTimeDisplayBox : public Tizen::Base::Object { public: - _DateTimeDisplayBox(const Tizen::Graphics::Rectangle& bounds, int boxId); + _DateTimeDisplayBox(const Tizen::Graphics::FloatRectangle& bounds, int boxId); virtual ~_DateTimeDisplayBox(void); void DrawDisplayBox(Tizen::Graphics::Canvas& canvas, DateTimePickerStatus status); - Tizen::Graphics::Rectangle GetDisplayBoxBounds(void) const; + Tizen::Graphics::FloatRectangle GetDisplayBoxBounds(void) const; bool SetText(const Tizen::Base::String& text); @@ -51,7 +52,7 @@ public: void SetBackgroundBitmap(Tizen::Graphics::Bitmap* pNormalBitmap, Tizen::Graphics::Bitmap* pEffectBitmap, Tizen::Graphics::Bitmap* pPressedEffectBitmap, Tizen::Graphics::Bitmap* pDisabledEffectBitmap); - void UpdateDisplayBoxBounds(Tizen::Graphics::Rectangle& bounds); + void UpdateDisplayBoxBounds(Tizen::Graphics::FloatRectangle& bounds); void SetFont(Tizen::Graphics::Font* pFont); @@ -66,7 +67,7 @@ private: _DateTimeDisplayBox& operator =(const _DateTimeDisplayBox&); private: - Tizen::Graphics::Rectangle __windowBounds; + Tizen::Graphics::FloatRectangle __windowBounds; int __boxId; diff --git a/src/ui/inc/FUiCtrl_DateTimeModel.h b/src/ui/inc/FUiCtrl_DateTimeModel.h index edbec95..9d857c2 100644 --- a/src/ui/inc/FUiCtrl_DateTimeModel.h +++ b/src/ui/inc/FUiCtrl_DateTimeModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimeModel.h * @brief This is the header file for the _DateTimeModel class. diff --git a/src/ui/inc/FUiCtrl_DateTimePicker.h b/src/ui/inc/FUiCtrl_DateTimePicker.h index 2e859f6..e5d004a 100644 --- a/src/ui/inc/FUiCtrl_DateTimePicker.h +++ b/src/ui/inc/FUiCtrl_DateTimePicker.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePicker.h * @brief This is the header file for the _DateTimePicker class. @@ -146,7 +147,8 @@ public: virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} @@ -163,10 +165,10 @@ public: result CreateFooter(void); result DestroyFooter(void); - Tizen::Graphics::Rectangle GetHeaderBounds(void); + Tizen::Graphics::FloatRectangle GetHeaderBounds(void); result CreateDisplayVisualElement(void); - void SetDisplayVisualElementBounds(Tizen::Graphics::Rectangle bounds); + void SetDisplayVisualElementBounds(Tizen::Graphics::FloatRectangle bounds); Tizen::Ui::Animations::_VisualElement* GetDisplayVisualElement(void); private: diff --git a/src/ui/inc/FUiCtrl_DateTimePickerImpl.h b/src/ui/inc/FUiCtrl_DateTimePickerImpl.h index 63d88f3..b12f694 100644 --- a/src/ui/inc/FUiCtrl_DateTimePickerImpl.h +++ b/src/ui/inc/FUiCtrl_DateTimePickerImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePickerImpl.h * @brief This is the header file for the _DateTimePickerImpl class. @@ -44,8 +45,8 @@ class _DateTimePickerImpl public: class DateTimePickerSizeInfo : public _ControlImpl::SizeInfo { - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMaximumSizeF(_ControlOrientation orientation) const; }; public: static _DateTimePickerImpl* CreateDateTimePickerImplN(DateTimePicker* pControl, const Tizen::Base::String& title = L""); diff --git a/src/ui/inc/FUiCtrl_DateTimePresenter.h b/src/ui/inc/FUiCtrl_DateTimePresenter.h index 0072f54..63578ef 100644 --- a/src/ui/inc/FUiCtrl_DateTimePresenter.h +++ b/src/ui/inc/FUiCtrl_DateTimePresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_DateTimePresenter.h * @brief This is the header file for the _DateTimePresenter class. @@ -100,6 +101,7 @@ public: virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); + void PlaySoundFeedback(int inputPadReturnValue); virtual void OnInputPadValueChanged(const Tizen::Ui::_Control& source, int inputPadReturnValue); virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); @@ -119,11 +121,11 @@ private: void ChangeInputPadStyle(int boxId); - Tizen::Graphics::Rectangle GetOutputArea(void); + Tizen::Graphics::FloatRectangle GetOutputArea(void); - int CalculateTouchArea(int posX, int posY); + int CalculateTouchArea(float posX, float posY); - int CalculateTouchOutputArea(int posX, int posY); + int CalculateTouchOutputArea(float posX, float posY); int CalculateTwoDigit(int originalNumber, int number); diff --git a/src/ui/inc/FUiCtrl_Edit.h b/src/ui/inc/FUiCtrl_Edit.h old mode 100644 new mode 100755 index 5ac4644..aa8e947 --- a/src/ui/inc/FUiCtrl_Edit.h +++ b/src/ui/inc/FUiCtrl_Edit.h @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -64,7 +65,6 @@ #include "FUiCtrl_TextBlockEvent.h" #include "FUiCtrl_TextEvent.h" - namespace Tizen { namespace Ui { class _AccessibilityElement; @@ -123,7 +123,6 @@ enum EditTextVerticalMargin enum EditAccessibilityElementType { - EDIT_ACCESSIBILITY_ELEMENT_TYPE_TITLE_TEXT, EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT, EDIT_ACCESSIBILITY_ELEMENT_TYPE_CLEAR_ICON }; @@ -148,7 +147,7 @@ const int EDIT_FIELD_DEFAULT_LIMIT_LENGTH = 100; const int EDIT_COLOR_MAX = 4; const int EDIT_TEXT_COLOR_MAX = 4; const int EDIT_MARGIN_COUNT_MAX = 2; -const int DEFAULT_LINE_SPACE = 1; +const float DEFAULT_LINE_SPACE = 1.0f; /** * @class _Edit @@ -172,6 +171,7 @@ class _OSP_EXPORT_ _Edit , public _ITouchLongPressGestureEventListener , public _ITouchTapGestureEventListener , public IClipboardPopupEventListener + , public _IEditTextFilter { public: DECLARE_CLASS_BEGIN(_Edit, _Control); @@ -301,6 +301,7 @@ public: void SetGuideText(const Tizen::Base::String& guideText); result SetGuideTextColor(const Tizen::Graphics::Color& color); result SetHorizontalMargin(int margin, EditTextHorizontalMargin marginType = EDIT_TEXT_HORIZONTAL_MARGIN); + result SetHorizontalMargin(float margin, EditTextHorizontalMargin marginType = EDIT_TEXT_HORIZONTAL_MARGIN); result SetKeypadAction(CoreKeypadAction keypadAction); result SetKeypadActionEnabled(bool enabled); void SetKeypadEnabled(bool enable); @@ -309,6 +310,7 @@ public: result SetTextPredictionEnabled(bool enable); result SetLimitLength(int limitLength); result SetLineSpacing(int linePixelGap); + result SetLineSpacing(float linePixelGap); void SetLowerCaseModeEnabled(bool enable); void SetMaxLineCount(int maxLineCount); result SetKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId); @@ -318,10 +320,12 @@ public: result SetTextAlignment(HorizontalAlignment alignment); result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color); result SetTextSize(int size); + result SetTextSize(float size); virtual result SetTitleText(const Tizen::Base::String& title); result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color); result SetViewModeEnabled(bool enable); result SetVerticalMargin(int margin, EditTextVerticalMargin marginType = EDIT_TEXT_VERTICAL_MARGIN); + result SetVerticalMargin(float margin, EditTextVerticalMargin marginType = EDIT_TEXT_VERTICAL_MARGIN); void SetEditStyle(unsigned long style); void SetBorderRoundStyleEnabled(bool enable); @@ -339,7 +343,9 @@ public: void GetCurrentTextRange(int& start, int& end) const; int GetCursorPosition(void) const; int GetCursorPositionAt(const Tizen::Graphics::Point& point) const; + int GetCursorPositionAt(const Tizen::Graphics::FloatPoint& point) const; result GetCursorBounds(bool isAbsRect, Tizen::Graphics::Rectangle& cursorBounds) const; + result GetCursorBounds(bool isAbsRect, Tizen::Graphics::FloatRectangle& cursorBounds) const; void GetCutlinkColorInfo(EditCutLinkType type, EditCutlinkColor* colorInfo) const; EllipsisPosition GetEllipsisPosition(void) const; void GetFontType(Tizen::Base::String& typefaceName, unsigned long& styleMask) const; @@ -347,13 +353,16 @@ public: Tizen::Base::String GetGuideText(void) const; Tizen::Graphics::Color GetGuideTextColor(void) const; int GetHorizontalMargin(EditTextHorizontalMargin marginType) const; + float GetHorizontalMarginF(EditTextHorizontalMargin marginType) const; InputStyle GetInputStyle(void) const; CoreKeypadAction GetKeypadAction(void) const; bool GetKeypadActionEnabled(void) const; result GetKeypadBounds(Tizen::Graphics::Rectangle& rect) const; + result GetKeypadBounds(Tizen::Graphics::FloatRectangle& rect) const; KeypadStyle GetKeypadStyle(void) const; int GetTextLimitLength(void) const; int GetLineSpacing(void) const; + float GetLineSpacingF(void) const; int GetMaxLineCount(void) const; int GetKeypadCommandButtonActionId(CommandButtonPosition position) const; Tizen::Base::String GetKeypadCommandButtonText(CommandButtonPosition position) const; @@ -366,10 +375,13 @@ public: int GetTextLength(void) const; int GetTextLineCount(void) const; int GetTextSize(void) const; + float GetTextSizeF(void) const; int GetTextTotalHeight(void) const; + float GetTextTotalHeightF(void) const; virtual Tizen::Base::String GetTitleText(void) const; Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const; int GetVerticalMargin(EditTextVerticalMargin marginType) const; + float GetVerticalMarginF(EditTextVerticalMargin marginType) const; unsigned long GetEditStyle(void) const; void GetWordPosition(int cursorPos, int& startPos, int& endPos) const; result GetTextImageRangeAt(int postion, int& startPosition, int& endPosition) const; @@ -378,12 +390,15 @@ public: result AppendText(const Tizen::Base::String& text); result BeginTextBlock(void); bool CalculateAbsoluteCursorBounds(int index ,Tizen::Graphics::Rectangle& absCursorRect); + bool CalculateAbsoluteCursorBounds(int index ,Tizen::Graphics::FloatRectangle& absCursorRect); result ClearText(void); result CopyText(void); result CutText(void); result DeleteCharacterAt(int index); result DeleteCharacterAtCursorPosition(void); void SetCursorDisabled(bool disabled); + void SetPressedGuideTextColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetPressedGuideTextColor(void) const; result HideKeypad(void); void InitializeColorInformation(void); void SetViewModeColorInformation(bool enabled); @@ -407,6 +422,7 @@ public: bool IsBorderRoundStyleEnabled(void) const; bool IsUsbKeyboardConnected(void) const; bool IsKeypadExist(void) const; + bool IsDestroyed(void) const; virtual void SetAutoShrinkModeEnabled(bool enable); virtual bool IsAutoShrinkModeEnabled(void) const; @@ -467,12 +483,19 @@ public: virtual bool OnNotifiedN(const _Control& source, Tizen::Base::Collection::IList* pArgs); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void OnAncestorEnableStateChanged(const _Control& control); + virtual result OnDetachingFromMainTree(void); + virtual void OnVisibleStateChanged(void); _EditPresenter* GetPresenter(void) const; Tizen::Graphics::Dimension GetContentSizeInternal(void) const; + Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const; + bool IsInternalFocused(void) const; + bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); protected: result SetPresenter(const _EditPresenter& pPresenter); @@ -483,12 +506,12 @@ private: _EditPresenter* _pEditPresenter; private: - int __bottomMargin; - int __leftMargin; - int __lineSpacing; - int __rightMargin; - int __textSize; - int __topMargin; + float __bottomMargin; + float __leftMargin; + float __lineSpacing; + float __rightMargin; + float __textSize; + float __topMargin; int __editStyle; bool __borderRoundStyle; @@ -500,6 +523,7 @@ private: EditBlockTextColor __blockTextColor; EditCutlinkColor __cutlinkColor[EDIT_LINK_TYPE_MAX]; Tizen::Graphics::Color __guideTextColor; + Tizen::Graphics::Color __pressedGuideTextColor; bool __isSettingGuideTextColor; Tizen::Graphics::Bitmap* __pBackgroundBitmap[EDIT_COLOR_MAX]; @@ -520,12 +544,14 @@ private: _ScrollPanelEvent* __pScrollPanelEvent; _TextBlockEvent* __pTextBlockEvent; _TextEvent* __pTextEvent; - Tizen::Ui::_AccessibilityElement* __pTitleTextAccessibilityElement; Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement; Tizen::Ui::_AccessibilityElement* __pClearButtonTextAccessibilityElement; Tizen::Ui::_AccessibilityElement* __pToolbarAccessibilityElement; bool __isAccessibilityCreated; bool __isFullScreenKeypadEdit; + bool __internalFocus; + bool __isDestroyed; + IEditTextFilter* __pTextFilter; }; // _Edit }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_EditAreaImpl.h b/src/ui/inc/FUiCtrl_EditAreaImpl.h old mode 100644 new mode 100755 index 62288e4..e4dc30c --- a/src/ui/inc/FUiCtrl_EditAreaImpl.h +++ b/src/ui/inc/FUiCtrl_EditAreaImpl.h @@ -61,6 +61,7 @@ public: class EditAreaSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(Tizen::Ui::_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(Tizen::Ui::_ControlOrientation orientation) const; }; public: @@ -68,6 +69,7 @@ public: virtual ~_EditAreaImpl(void); static _EditAreaImpl* CreateEditAreaImplN(EditArea* pControl, const Tizen::Graphics::Rectangle& rect); + static _EditAreaImpl* CreateEditAreaImplN(EditArea* pControl, const Tizen::Graphics::FloatRectangle& rect); result Initialize(InputStyle inputStyle = INPUT_STYLE_FULLSCREEN, int limitLength = 1000); virtual const _Edit& GetCore(void) const; @@ -90,14 +92,17 @@ public: void SetKeypadEnabled(bool enable); result SetKeypadStyle(KeypadStyle keypadStyle); result SetLineSpacing(int multiplier, int extra); + result SetLineSpacing(int multiplier, float extra); void SetLowerCaseModeEnabled(bool enable); result SetMargin(EditMarginType marginType, int margin); + result SetMargin(EditMarginType marginType, float margin); result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId); result SetOverlayKeypadCommandButtonVisible(bool visible); result SetText(const Tizen::Base::String& text); result SetTextAlignment(HorizontalAlignment alignment); result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color); result SetTextSize(int size); + result SetTextSize(float size); result SetViewModeEnabled(bool enable); result SetTextPredictionEnabled(bool enable); @@ -118,10 +123,13 @@ public: int GetTextLength(void) const; int GetTextLineCount(void) const; int GetTextSize(void) const; + float GetTextSizeF(void) const; Tizen::Ui::KeypadAction GetKeypadAction(void) const; KeypadStyle GetKeypadStyle(void) const; int GetLineSpacing(void) const; + float GetLineSpacingF(void) const; int GetMargin(EditMarginType marginType) const; + float GetMarginF(EditMarginType marginType) const; int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const; Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const; int GetRemainingLength(void) const; @@ -182,6 +190,8 @@ public: virtual void OnTextBlockSelected(Tizen::Ui::_Control& source, int start, int end); virtual void OnTextValueChanged(const Tizen::Ui::_Control& source); virtual void OnTextValueChangeCanceled(const Tizen::Ui::_Control& source); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); public: static _EditAreaImpl* GetInstance(EditArea& editArea); diff --git a/src/ui/inc/FUiCtrl_EditCopyPasteEvent.h b/src/ui/inc/FUiCtrl_EditCopyPasteEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_EditCopyPasteManager.h b/src/ui/inc/FUiCtrl_EditCopyPasteManager.h old mode 100644 new mode 100755 index d1df7ab..c1a9200 --- a/src/ui/inc/FUiCtrl_EditCopyPasteManager.h +++ b/src/ui/inc/FUiCtrl_EditCopyPasteManager.h @@ -83,39 +83,44 @@ public: // Operations public: void CreateCopyPastePopup(void); - void CreateHandle(void); - void Show(void); + void CreateHandle(void); + void Show(void); bool CheckHandleBounds(const Tizen::Graphics::Point& point); + bool CheckHandleBounds(const Tizen::Graphics::FloatPoint& point); bool CheckHandlePosition(bool leftHandle, int cursorPosition); - void CheckVisibleState(bool leftHandle); - void HideHandle(void); - void RefreshBlock(bool changeVisibleState, bool isLeftHandle = false); + void RefreshBlock(bool isLeftHandle = false); Tizen::Graphics::Rectangle GetCursorBounds(bool isAbsRect) const; + Tizen::Graphics::FloatRectangle GetCursorBoundsF(bool isAbsRect) const; int GetCursorPositionAt(const Tizen::Graphics::Point& touchPoint) const; + int GetCursorPositionAt(const Tizen::Graphics::FloatPoint& touchPoint) const; result SetCursorPosition(int position); int GetCursorPosition(void) const; int GetHandlerCursorPosition(bool rightHandler) const; void SendTextBlockEvent(void); void Release(void); void ReleaseCopyPastePopup(void); - void SwitchHandle(void); bool IsCopyPastePopup(const _Control& control) const; + bool IsCopyPasteHandle(const _Control& control) const; void AdjustBounds(void); result AddCopyPasteEventListener(const _IEditCopyPasteEventListener& listener); result SendCopyPasteEvent(Tizen::Ui::Controls::CoreCopyPasteStatus status, Tizen::Ui::Controls::CoreCopyPasteAction action); + void LaunchSearch(void); void PrintLog(const Tizen::Graphics::Point& point); + void PrintLog(const Tizen::Graphics::FloatPoint& point); bool GetTextBlockReleaseFlag(void) const; void SetTextBlockReleaseFlag(bool enabled); + bool IsCopyPasteHandleExist(void) const; // virtual function virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); - void ScrollText(int distance); _Edit* GetEdit(void) const; void MoveHandler(HandlerMoveType moveType); bool IsHandlerMovingEnabled(void) const; void SetHandlerMovingEnabled(bool enabled); Tizen::Graphics::Rectangle GetEditVisibleArea(void) const; + Tizen::Graphics::FloatRectangle GetEditVisibleAreaF(void) const; + _ContextMenu* GetCopyPastePopup(void) const; private: _EditCopyPasteManager(const _EditCopyPasteManager& value); _EditCopyPasteManager& operator =(const _EditCopyPasteManager& value); @@ -126,10 +131,10 @@ private: _EditCopyPasteHandler* __pHandle[HANDLER_TYPE_MAX]; _EditCopyPasteEvent* __pCoreCopyPasteEvent; _Edit* __pEdit; - int __contextMenuHeight; + float __contextMenuHeight; bool __needToReleaseBlock; bool __isHandlerMoving; - Tizen::Graphics::Rectangle __editVisibleArea; + Tizen::Graphics::FloatRectangle __editVisibleArea; }; // _EditCopyPasteManager }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_EditDate.h b/src/ui/inc/FUiCtrl_EditDate.h index 8a2e4ec..01adea6 100644 --- a/src/ui/inc/FUiCtrl_EditDate.h +++ b/src/ui/inc/FUiCtrl_EditDate.h @@ -25,6 +25,7 @@ #ifndef _FUI_CTRL_INTERNAL_EDITDATE_H_ #define _FUI_CTRL_INTERNAL_EDITDATE_H_ +#include #include "FUi_Control.h" #include "FUi_UiTouchEvent.h" #include "FUiCtrl_IDateTimeChangeEventListener.h" @@ -48,6 +49,7 @@ class _OSP_EXPORT_ _EditDate , virtual public Tizen::Base::Runtime::IEventListener , virtual public _IUiEventListener , virtual public _IUiEventPreviewer + , virtual public Tizen::System::ISettingEventListener { DECLARE_CLASS_BEGIN(_EditDate, _Control); DECLARE_PROPERTY("date", GetPropertyDate, SetPropertyDate); @@ -115,7 +117,6 @@ public: _DateTimeBar* GetDateTimeBar(void) const; virtual void OnDraw(void); - virtual result OnAttachedToMainTree(void); virtual void OnBoundsChanged(void); virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -129,7 +130,8 @@ public: virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); - Tizen::Graphics::Rectangle GetParentWindowBounds(void) const; + virtual void OnSettingChanged(Tizen::Base::String& key); + Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const; private: _EditDate(void); @@ -141,15 +143,16 @@ private: result CalculateDateTimeBarPosition(void); result FireDateChangeEvent(_DateTimeChangeStatus status); void AdjustDay(int year, int month); + void CreateAccessibilityElement(void); void UpdateAccessibilityElement(void); private: _EditDatePresenter* __pEditDatePresenter; _DateTimeChangeEvent* __pDateChangeEvent; _DateTimeBar* __pDateTimeBar; - Tizen::Graphics::Rectangle __absoluteBounds; + Tizen::Graphics::FloatRectangle __absoluteBounds; Tizen::Base::String __title; - Tizen::Ui::_AccessibilityElement* __pAccessibilityTitleElement; + Tizen::Ui::_AccessibilityElement* __pAccessibilityEditDateElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityYearElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityMonthElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityDayElement; diff --git a/src/ui/inc/FUiCtrl_EditDateImpl.h b/src/ui/inc/FUiCtrl_EditDateImpl.h index 9e79f32..c0ec8aa 100644 --- a/src/ui/inc/FUiCtrl_EditDateImpl.h +++ b/src/ui/inc/FUiCtrl_EditDateImpl.h @@ -39,23 +39,11 @@ class _EditDateImpl , public _IDateTimeChangeEventListener , virtual public Tizen::Base::Runtime::IEventListener { -public: - class EditDateSizeInfo : public Tizen::Ui::_ControlImpl::SizeInfo - { - public: - EditDateSizeInfo(void); - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(Tizen::Ui::_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(Tizen::Ui::_ControlOrientation orientation) const; - void SetTitleStyle(bool titleStyle = false); - - private: - bool __isTitle; - }; public: virtual ~_EditDateImpl(void); static _EditDateImpl* CreateEditDateImplN(EditDate* pControl, const Tizen::Graphics::Point& point, const Tizen::Base::String& title); - + static _EditDateImpl* CreateEditDateImplFN(EditDate* pControl, const Tizen::Graphics::FloatPoint& point, const Tizen::Base::String& title); virtual const char* GetPublicClassName(void) const; virtual const EditDate& GetPublic(void) const; virtual EditDate& GetPublic(void); @@ -63,6 +51,8 @@ public: virtual _EditDate& GetCore(void); public: + void SetInitialPosition(const Tizen::Graphics::FloatPoint& point); + result OnAttachedToMainTree(void); result AddDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); result RemoveDateChangeEventListener(Tizen::Ui::IDateChangeEventListener& listener); Tizen::Base::DateTime GetDate(void) const; @@ -94,6 +84,7 @@ private: private: _PublicDateTimeChangeEvent* __pPublicDateChangeEvent; + Tizen::Graphics::FloatRectangle __defaultBounds; }; // _EditDateImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_EditDatePresenter.h b/src/ui/inc/FUiCtrl_EditDatePresenter.h index 1d4cec4..39bf7ad 100644 --- a/src/ui/inc/FUiCtrl_EditDatePresenter.h +++ b/src/ui/inc/FUiCtrl_EditDatePresenter.h @@ -66,8 +66,8 @@ public: result Draw(void); _DateTimeId GetLastSelectedId(void) const; - Tizen::Graphics::Rectangle GetDateAreaBounds(_DateTimeId id) const; - Tizen::Graphics::Rectangle GetTitleBounds(void) const; + Tizen::Graphics::FloatRectangle GetDateAreaBounds(_DateTimeId id) const; + Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; int GetLocaleDateFormat(void) const; void Animate(void); @@ -78,7 +78,6 @@ public: virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control); void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally); virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){} @@ -94,19 +93,19 @@ private: result CalculateAreaBounds(void); result DrawTitle(Tizen::Graphics::Canvas& canvas); - result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Base::String& text); + result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& text); result DrawDividers(Tizen::Graphics::Canvas& canvas); - _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::Point& point) const; + _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const; void SetLastSelectedId(_DateTimeId boxId); private: _DateTimeModel* __pEditDateTimeModel; _EditDate* __pEditDate; - Tizen::Graphics::Rectangle __dayBounds; - Tizen::Graphics::Rectangle __monthBounds; - Tizen::Graphics::Rectangle __yearBounds; - Tizen::Graphics::Rectangle __titleBounds; + Tizen::Graphics::FloatRectangle __dayBounds; + Tizen::Graphics::FloatRectangle __monthBounds; + Tizen::Graphics::FloatRectangle __yearBounds; + Tizen::Graphics::FloatRectangle __titleBounds; Tizen::Base::String __title; Tizen::Base::String __lastSelectedValue; @@ -118,10 +117,10 @@ private: Tizen::Graphics::_Text::TextObject __titleObject; Tizen::Graphics::_Text::TextObject __textObject; Tizen::Graphics::Font* __pFont; - int __dividerLineWidth; - int __dividerLineHeight; - int __titleFontSize; - int __dateFontSize; + float __dividerLineWidth; + float __dividerLineHeight; + float __titleFontSize; + float __dateFontSize; Tizen::Ui::Animations::VisualElement* __pContentProvider; bool __isAnimating; bool __isEditDateInitialized; diff --git a/src/ui/inc/FUiCtrl_EditFieldImpl.h b/src/ui/inc/FUiCtrl_EditFieldImpl.h old mode 100644 new mode 100755 index 31e823e..d7363ce --- a/src/ui/inc/FUiCtrl_EditFieldImpl.h +++ b/src/ui/inc/FUiCtrl_EditFieldImpl.h @@ -67,6 +67,7 @@ public: public: EditFieldSizeInfo(void); virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(Tizen::Ui::_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(Tizen::Ui::_ControlOrientation orientation) const; void SetTitleStyle(EditFieldTitleStyle titleStyle); void SetSmallStyle(bool isSmallStyle); @@ -80,6 +81,7 @@ public: virtual ~_EditFieldImpl(void); static _EditFieldImpl* CreateEditFieldImplN(EditField* pControl, const Tizen::Graphics::Rectangle& rect, EditFieldStyle style, EditFieldTitleStyle titleStyle = EDIT_FIELD_TITLE_STYLE_NONE); + static _EditFieldImpl* CreateEditFieldImplN(EditField* pControl, const Tizen::Graphics::FloatRectangle& rect, EditFieldStyle style, EditFieldTitleStyle titleStyle = EDIT_FIELD_TITLE_STYLE_NONE); result Initialize(EditFieldStyle style = EDIT_FIELD_STYLE_NORMAL, InputStyle inputStyle = INPUT_STYLE_OVERLAY, EditFieldTitleStyle titleStlye = EDIT_FIELD_TITLE_STYLE_NONE, bool enableClear = false, int limitLength = 100, GroupStyle groupStyle = GROUP_STYLE_NONE); virtual const _Edit& GetCore(void) const; @@ -103,12 +105,14 @@ public: void SetKeypadEnabled(bool enable); void SetLowerCaseModeEnabled(bool enable); result SetMargin(EditMarginType marginType, int margin); + result SetMargin(EditMarginType marginType, float margin); result SetOverlayKeypadCommandButton(CommandButtonPosition position, const Tizen::Base::String& text, int actionId); result SetOverlayKeypadCommandButtonVisible(bool visible); result SetText(const Tizen::Base::String& text); result SetTextAlignment(HorizontalAlignment alignment); result SetTextColor(EditTextColor type, const Tizen::Graphics::Color& color); result SetTextSize(int size); + result SetTextSize(float size); result SetTitleText(const Tizen::Base::String& title); result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color); result SetViewModeEnabled(bool enable); @@ -128,6 +132,7 @@ public: Tizen::Ui::KeypadAction GetKeypadAction(void) const; KeypadStyle GetKeypadStyle(void) const; int GetMargin(EditMarginType marginType) const; + float GetMarginF(EditMarginType marginType) const; int GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const; Tizen::Base::String GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const; int GetRemainingLength(void) const; @@ -137,6 +142,7 @@ public: Tizen::Graphics::Color GetTextColor(EditTextColor type) const; int GetTextLength(void) const; int GetTextSize(void) const; + float GetTextSizeF(void) const; Tizen::Base::String GetTitleText(void) const; Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const; @@ -195,6 +201,8 @@ public: virtual void OnTextBlockSelected(Tizen::Ui::_Control& source, int start, int end); virtual void OnTextValueChanged(const Tizen::Ui::_Control& source); virtual void OnTextValueChangeCanceled(const Tizen::Ui::_Control& source); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); public: static _EditFieldImpl* GetInstance(EditField& editField); diff --git a/src/ui/inc/FUiCtrl_EditModel.h b/src/ui/inc/FUiCtrl_EditModel.h old mode 100644 new mode 100755 index 6053ea4..27b87a5 --- a/src/ui/inc/FUiCtrl_EditModel.h +++ b/src/ui/inc/FUiCtrl_EditModel.h @@ -36,7 +36,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _EditModel * @brief - * @since 1.0 + * @since 2.0 * * * @@ -161,7 +161,7 @@ public: /** * Sets the input language. * - * @since 1.0 + * @since 2.0 * @return An error code * @param[in] language The language to set * @exception E_SUCCESS The method was successful. @@ -174,7 +174,7 @@ public: /** * Gets the current input language. * - * @since 1.0 + * @since 2.0 * @return An error code * @param[out] language The current input language * @exception E_SUCCESS The method was successful. @@ -207,7 +207,7 @@ public: /** * Enables or disables the keypad. * - * @since 1.0 + * @since 2.0 * @param[in] enable A Boolean value indicating whether the keypad is enabled. */ void SetKeypadEnabled(bool enable); @@ -215,7 +215,7 @@ public: /** * Checks whether the keypad is enabled. * - * @since 1.0 + * @since 2.0 * @return @c true if the keypad is enabled @n * @c false, otherwise */ @@ -224,7 +224,7 @@ public: /** * Enables or disables the lowercase mode. * - * @since 1.0 + * @since 2.0 * @param[in] enable Set to @c true to enable lowercase mode @n * @c false, otherwise */ @@ -233,7 +233,7 @@ public: /** * Checks whether the lowercase mode is enabled. * - * @since 1.0 + * @since 2.0 * @return @c true if the lowercase mode is set @n * @c false, otherwise */ diff --git a/src/ui/inc/FUiCtrl_EditPresenter.h b/src/ui/inc/FUiCtrl_EditPresenter.h index e6b1290..34ef343 100644 --- a/src/ui/inc/FUiCtrl_EditPresenter.h +++ b/src/ui/inc/FUiCtrl_EditPresenter.h @@ -30,6 +30,8 @@ #include #include #include +#include "FUi_Clipboard.h" +#include "FUi_IClipboardPopupEventListener.h" #include "FUi_InputConnectionImpl.h" #include "FUi_UiTouchEvent.h" #include "FUiCtrl_Edit.h" @@ -68,9 +70,9 @@ enum _EditFontChange struct _EditScrollEffectInfo { - int previousY; - int currentY; - int effectGap; + float previousY; + float currentY; + float effectGap; int effectFrame; int touchScrollFrameLevel[EDIT_SCROLLFRAME_MAX]; }; @@ -101,7 +103,9 @@ class _EditPresenter , public IInputConnectionProvider , public Tizen::Base::Runtime::ITimerEventListener , public _IEditCopyPasteEventListener + , public _IClipboardPopupEventListener , virtual public _IFrameEventListener + , public Tizen::Ui::Controls::IEditTextFilter { public: _EditPresenter(void); @@ -125,6 +129,7 @@ public: virtual result SetInitialBounds(void); virtual result Draw(Tizen::Graphics::Canvas& canvas); virtual result DrawCursor(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::Rectangle& cursorRect, bool isCursorOpaque); + virtual result DrawCursor(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::FloatRectangle& cursorRect, bool isCursorOpaque); virtual result DrawScrollBar(void); virtual bool OnFocusGained(void); virtual bool OnFocusLost(void); @@ -132,13 +137,17 @@ public: virtual bool OnNotifiedN(Tizen::Base::Collection::IList* pArgs); virtual void OnFrameActivated(const Tizen::Ui::Controls::_Frame& source); virtual void OnFrameDeactivated(const Tizen::Ui::Controls::_Frame& source); + virtual void OnFrameMinimized(const Tizen::Ui::Controls::_Frame& source); + virtual void OnFrameRestored(const Tizen::Ui::Controls::_Frame& source); virtual result SetLineSpacing(int linePixelGap); + virtual result SetLineSpacing(float linePixelGap); virtual int GetLineSpacing(void) const; + virtual float GetLineSpacingF(void) const; void OnScrollPanelBoundsChanged(void); - void OnFontInfoRequested(unsigned long& style, int& size); + void OnFontInfoRequested(unsigned long& style, float& size); void OnFontChanged(Tizen::Graphics::Font* pFont); result SetAutoLinkMask(unsigned long autoLinks); @@ -150,7 +159,9 @@ public: void SetClientBounds(void); result SetEllipsisPosition(EllipsisPosition position); virtual result SetFlexBounds(const Tizen::Graphics::Rectangle& bounds); + virtual result SetFlexBounds(const Tizen::Graphics::FloatRectangle& bounds); result SetTextSize(const int size); + result SetTextSize(const float size); result SetFont(const Tizen::Graphics::Font& font); result AdjustFont(Tizen::Graphics::Font& font, _EditFontChange fontChange = EDIT_FONT_CHANGE_CONTENT); result SetFontType(const Tizen::Base::String& typefaceName, unsigned long styleMask); @@ -171,9 +182,11 @@ public: _Toolbar* GetKeypadCommandButton(void) const; result SetKeypadCommandButtonVisible(bool visible); bool SetKeypadBounds(const Tizen::Graphics::Rectangle& bounds); + bool SetKeypadBounds(const Tizen::Graphics::FloatRectangle& bounds); result SetText(const Tizen::Base::String& text); result SetTextAlignment(HorizontalAlignment alignment); result SetTextBounds(Tizen::Graphics::Rectangle& bounds); + result SetTextBounds(Tizen::Graphics::FloatRectangle& bounds); result SetTitleText(const Tizen::Base::String& title); result SetViewModeEnabled(bool enable); unsigned long GetAutoLinkMask(void) const; @@ -182,8 +195,11 @@ public: result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; void GetCurrentTextRange(int& start, int& end) const; int GetCursorPositionAt(const Tizen::Graphics::Point& touchPoint) const; + int GetCursorPositionAt(const Tizen::Graphics::FloatPoint& touchPoint) const; + virtual bool IsTextBlockedInTokenEdit(void) const; int GetCursorPosition(void) const; result GetCursorBounds(bool isAbsRect, Tizen::Graphics::Rectangle& cursorBounds); + result GetCursorBounds(bool isAbsRect, Tizen::Graphics::FloatRectangle& cursorBounds); EllipsisPosition GetEllipsisPosition(void) const; Tizen::Graphics::Font* GetFont(void) const; Tizen::Graphics::Font* CopyFontN(const Tizen::Graphics::Font* pFont); @@ -196,15 +212,18 @@ public: unsigned long GetTextStyle(void) const; Tizen::Base::String GetGuideText(void) const; int GetTextSize(void) const; + float GetTextSizeF(void) const; unsigned long GetInputModeCategory(void) const; CoreKeypadAction GetKeypadAction(void) const; result GetKeypadBounds(Tizen::Graphics::Rectangle& bounds) const; + result GetKeypadBounds(Tizen::Graphics::FloatRectangle& bounds) const; KeypadStyle GetKeypadStyle(void) const; int GetTextLimitLength(void) const; int GetMaxLineCount(void) const; int GetKeypadCommandButtonActionId(CommandButtonPosition position) const; Tizen::Base::String GetKeypadCommandButtonText(CommandButtonPosition position) const; _Form* GetParentForm(void); + _ScrollPanel* GetParentPanel(void) const; int GetRemainingLength(void) const; Tizen::Base::String GetText(void) const; Tizen::Base::String GetText(int start, int end) const; @@ -212,6 +231,7 @@ public: int GetTextLength(void) const; int GetTextLineCount(void) const; int GetTextTotalHeight(void) const; + float GetTextTotalHeightF(void) const; Tizen::Base::String GetTitleText(void) const; void GetWordPosition(int cursorPos, int& startPos, int& endPos) const; result GetTextImageRangeAt(int postion, int& startPosition, int& endPosition) const; @@ -219,6 +239,7 @@ public: bool IsBlocked(void) const; bool IsClipped(void) const; bool IsFocused(void) const; + bool IsInternalFocused(void) const; bool IsKeypadActionEnabled(void) ; bool IsKeypadEnabled(void) ; bool IsLowerCaseModeEnabled(void) const; @@ -234,7 +255,8 @@ public: result AppendText(const Tizen::Base::String& text); result BeginTextBlock(void); result CalculateAbsoluteCursorBounds(int index, Tizen::Graphics::Rectangle& absCursorBounds); - result ChangeLayout(_ControlOrientation orientation); + result CalculateAbsoluteCursorBounds(int index, Tizen::Graphics::FloatRectangle& absCursorBounds); + virtual result ChangeLayout(_ControlOrientation orientation); result ClearText(void); result CopyText(void); virtual result CutText(void); @@ -253,19 +275,25 @@ public: result RemoveTextBlock(void); result Resize(void); result ShowKeypad(bool focus = true); - result StartFlickAnimation(const Tizen::Graphics::Point& flickPosition, int flickTime); + result StartFlickAnimation(const Tizen::Graphics::FloatPoint& flickPosition, int flickTime); Tizen::Graphics::Rectangle GetTextAreaBounds(void) const; + Tizen::Graphics::FloatRectangle GetTextAreaBoundsF(void) const; Tizen::Graphics::Rectangle GetTitleBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleBoundsF(void) const; Tizen::Graphics::Rectangle GetClearIconBounds(void) const; + Tizen::Graphics::FloatRectangle GetClearIconBoundsF(void) const; void FinishTextComposition(void); void InitializeCopyPasteManager(void); - bool IsCopyPastePopupVisible(void) const; + bool IsCopyPasteManagerExist(void) const; bool GetTextCompositionState(void) const; bool IsCopyPastePopup(const _Control& control) const; + bool IsCopyPasteHandle(const _Control& control) const; Tizen::Graphics::_Text::TextObject* GetTextObject(void) const; EditStatus GetCurrentStatus(void) const; result ScrollContents(int moveY); - void DrawText(void); + result ScrollContents(float moveY); + virtual void DrawText(void); + virtual bool IsGuideTextActivated(void) const; result UpdateComponentInformation(void); void SetCursorChangedFlag(bool enabled); bool GetCursorChangedFlag(void) const; @@ -278,16 +306,28 @@ public: bool GetSearchBarFlag(void) const; void SetKeypadClosedEventSkipped(bool skipped); void PostInternalEvent(const Tizen::Base::String& type); + void ReleaseCopyPastePopup(void); + bool IsCopyPastePopupExist(void) const; + bool IsCopyPasteHandleExist(void) const; + void DeleteFullscreenKeypad(void); + void SetBlockRangeWithShiftArrowkey(_KeyCode keyCode); + void SetEditTextFilter(_IEditTextFilter* pFilter); + virtual bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText); + void SendOpaqueCommand (const Tizen::Base::String& command); protected: + void StopTitleSlidingTimer(void); + result StartTitleSlidingTimer(void); virtual void OnInputConnectionTextCommitted(InputConnection& source, const Tizen::Base::String& committedText); virtual void DeleteSurroundingText(InputConnection& source, int offset, int chars); virtual void OnTextCommitted(const Tizen::Base::String& commitText); virtual void OnSurroundingTextDeleted(int offset, int charCount); result InitializeAtFirstDrawing(void); result CalculateCursorBounds(const Tizen::Graphics::Rectangle& textBounds, Tizen::Graphics::Rectangle& cursorBounds, int curPos = -1); + result CalculateCursorBounds(const Tizen::Graphics::FloatRectangle& textBounds, Tizen::Graphics::FloatRectangle& cursorBounds, int curPos = -1); Tizen::Ui::Animations::_VisualElement* GetCursorVisualElement(void) const; virtual Tizen::Graphics::Rectangle GetTextBounds(void) const; + virtual Tizen::Graphics::FloatRectangle GetTextBoundsF(void) const; result DrawBackground(Tizen::Graphics::Canvas& canvas, bool drawTitleText = true); result InitializeCursor(void); result DrawText(Tizen::Graphics::Canvas& canvas); @@ -297,15 +337,22 @@ protected: virtual void OnCursorTimerExpired(void); virtual result SetModel(const _EditModel& editModel); virtual int CalculateFlexibleHeight(void); + virtual float CalculateFlexibleHeightF(void); void SetCursorEnabled(bool enable); bool IsCursorEnabled(void) const; void SetScrollBarVisible(bool enable); void SetScrollBarBounds(const Tizen::Graphics::Rectangle& bounds); + void SetScrollBarBounds(const Tizen::Graphics::FloatRectangle& bounds); Tizen::Graphics::Rectangle GetDisplayScrollBounds(void) const; + Tizen::Graphics::FloatRectangle GetDisplayScrollBoundsF(void) const; Tizen::Graphics::Rectangle GetInitialBounds(void) const; + Tizen::Graphics::FloatRectangle GetInitialBoundsF(void) const; void SetPreviousScrollBarPosition(int position); + void SetPreviousScrollBarPosition(float position); int GetPreviousScrollPosition(void) const; + float GetPreviousScrollPositionF(void) const; void SetMaximumPreviousScrollBarPosition(int position); + void SetMaximumPreviousScrollBarPosition(float position); _Scroll* GetScrollBar(void) const; _Edit* GetEditView(void) const; @@ -317,6 +364,9 @@ private: virtual void OnInputConnectionTextPredictionShowStateChanged(InputConnection& source, bool isShown); virtual void OnInputConnectionTextPredictionBoundsChanged(InputConnection& source, const Tizen::Graphics::Rectangle& bounds); virtual void OnInputConnectionComposingTextChanged(InputConnection& source, const Tizen::Base::String& composingText, int cursorPosition); + virtual void OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopupSize); + virtual void OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipboardPopupSize); + virtual void OnClipboardPopupClosed(void); virtual void GetPreviousText(InputConnection& source, Tizen::Base::String& text, int& cursorPosition); void OnComposingTextChanged(const Tizen::Base::String& preeditText, int cursorPosition); void OnKeypadStateChanged(void *data, InputPanelShowState showState); @@ -326,12 +376,11 @@ private: result InitializeEditFieldClientRect(void); result SetInitialEditFieldBounds(void); virtual result AdjustFlexibleHeight(void); - result SetKeypadCommandButton(const Tizen::Graphics::Rectangle& bounds); + result SetKeypadCommandButton(const Tizen::Graphics::FloatRectangle& bounds); result SetTitleTextSlidingAction(Tizen::Graphics::_Text::TextObjectActionType action); result SetWrap(Tizen::Graphics::_Text::TextObjectWrapType wrapMode); - bool IsGuideTextActivated(void) const; - bool IsContained(Tizen::Graphics::Rectangle& paramRect) const; - int CalculateMaximumFlexibleHeight(void); + bool IsContained(Tizen::Graphics::FloatRectangle& paramRect) const; + float CalculateMaximumFlexibleHeight(void); result ChangePasswordToEchoCharacter(int cursorPos, int textLength); result ConvertLinkType(void); int GetLinkElementOffsetInTextBuffer(int elementIndex) const; @@ -345,8 +394,8 @@ private: result DrawSingleLineBackgroundBitmap(Tizen::Graphics::Canvas& canvas, bool focused); // todo : move to DrawText result DrawTextForEntireFontSetting(Tizen::Graphics::Canvas& canvas); - result DrawTitleText(Tizen::Graphics::Canvas& canvas); - result MoveCursor(const Tizen::Graphics::Rectangle& fromRect, const Tizen::Graphics::Rectangle& toRect); + result DrawTitleText(void); + result MoveCursor(const Tizen::Graphics::FloatRectangle& fromRect, const Tizen::Graphics::FloatRectangle& toRect); bool IsHorizontalDirection(const _TouchInfo& touchInfo); result ScrollContentsOnFlick(void); result ChangePasswordToEchoCharacter(wchar_t* dspStrBuffer, wchar_t echoChar); @@ -354,17 +403,15 @@ private: result ReplaceTextIntoPasswordHyphenString(void); // todo : delete, do not use result SetFocused(void); - void ScrollText(int distance); + void ScrollText(float distance); void FadeOutScrollBar(void); // todo : move to OperateFlickScrollEffect - bool ScrollOnFlick(int moveDistanceY); + bool ScrollOnFlick(float moveDistanceY); result StartFlickTimer(int flickVelocityX, int flickVelocityY); void StopFlickTimer(void); void StopPasswordTimer(void); result StartPasswordTimer(void); result OnPasswordTimerExpired(void); - void StopTitleSlidingTimer(void); - result StartTitleSlidingTimer(void); result OnTitleSlidingTimerExpired(void); result OnFlickTimerExpired(void); bool IsDelimiter(wchar_t character) const; @@ -377,11 +424,15 @@ private: InputPanelAction ConvertKeypadAction(CoreKeypadAction keypadAction); void ScrollPanelToTop(bool show); void ScrollPanelToExposedRegion(bool show); + bool IsUnsupportedChracterExist(const KeypadStyle keypadStyle, const Tizen::Base::String& text); result Dispose(void); _EditPresenter(const _EditPresenter&); _EditPresenter& operator =(const _EditPresenter&); +protected: + Tizen::Base::Runtime::Timer* __pTitleSlidingTimer; + private: _Edit* __pEdit; wchar_t* __pTextBuffer; @@ -393,22 +444,22 @@ private: int __limitLength; HorizontalAlignment __horizontalAlignment; bool __isScrollBarVisible; - Tizen::Graphics::Rectangle __scrollBarBounds; - Tizen::Graphics::Rectangle __initialBounds; - int __previousScrollBarPos; // First save prev scroll and if scroll pos is changed then draw scroll - int __previousScrollBarMaxPos; // When scroll max value is changed then draw scroll + Tizen::Graphics::FloatRectangle __scrollBarBounds; + Tizen::Graphics::FloatRectangle __initialBounds; + float __previousScrollBarPos; // First save prev scroll and if scroll pos is changed then draw scroll + float __previousScrollBarMaxPos; // When scroll max value is changed then draw scroll _IActionEventListener* __pActionEventListener; Tizen::Base::Runtime::Timer* __pCursorTimer; Tizen::Base::Runtime::Timer* __pFlickAnimationTimer; Tizen::Base::Runtime::Timer* __pPasswordTimer; - Tizen::Base::Runtime::Timer* __pTitleSlidingTimer; Tizen::Graphics::Font* __pFont; Tizen::Ui::Animations::_VisualElement* __pCursorVisualElement; Tizen::Ui::Animations::_VisualElement* __pTextVisualElement; + Tizen::Ui::Animations::_VisualElement* __pTitleTextVisualElement; _EditCopyPasteManager* __pCopyPasteManager; _FlickAnimation* __pFlickAnimation; @@ -420,20 +471,22 @@ private: _InputConnectionImpl* __pInputConnection; bool __isInputConnectionBound; + _Clipboard* __pClipboard; + Tizen::Base::String __guideText; Tizen::Base::String __titleText; - Tizen::Graphics::Point __pressedPoint; + Tizen::Graphics::FloatPoint __pressedPoint; bool __isCopyPastePopupMoving; - Tizen::Graphics::Point __pressedAbsolutePoint; + Tizen::Graphics::FloatPoint __pressedAbsolutePoint; - Tizen::Graphics::Rectangle __clearIconBounds; - Tizen::Graphics::Rectangle __textBoxBounds; - Tizen::Graphics::Rectangle __textObjectBounds; - Tizen::Graphics::Rectangle __titleBounds; - Tizen::Graphics::Rectangle __clientBounds; - Tizen::Graphics::Rectangle __previousCursorBounds; - Tizen::Graphics::Rectangle __keypadBounds; + Tizen::Graphics::FloatRectangle __clearIconBounds; + Tizen::Graphics::FloatRectangle __textBoxBounds; + Tizen::Graphics::FloatRectangle __textObjectBounds; + Tizen::Graphics::FloatRectangle __titleBounds; + Tizen::Graphics::FloatRectangle __clientBounds; + Tizen::Graphics::FloatRectangle __previousCursorBounds; + Tizen::Graphics::FloatRectangle __keypadBounds; Tizen::Graphics::_Text::TextObject* __pTextObject; Tizen::Graphics::_Text::TextObject* __pGuideTextObject; @@ -446,7 +499,7 @@ private: bool __isKeypadCommandButtonVisible; bool __isKeypadHiding; bool __isTextComposing; - bool __isCopyPastePopupVisible; + bool __isCopyPasteManagerExist; bool __isCursorChanged; bool __isCursorInitialized; bool __isCursorDisabled; @@ -467,18 +520,20 @@ private: int __blockStartPos; int __cursorPos; - int __maximumFlexibleHeight; - int __prevTotalTextHeight; + float __maximumFlexibleHeight; + float __prevTotalTextHeight; int __textLength; int __composingTextLength; - int __titleWidth; - int __verticalMargin; + float __titleWidth; + float __verticalMargin; bool __isUSBKeyboardConnected; bool __rotated; bool __isCutLinkParserEnabled; static bool __isKeypadExist; - static int __initialParentHeight; + static bool __isClipboardExist; + static float __initialParentHeight; + static float __clipboardHeight; static bool __isPanelBoundsChanging; wchar_t __echoChar; @@ -493,14 +548,17 @@ private: GroupStyle __groupStyle; bool __isFontInitialized; - int __contentFontSize; - int __titleFontSize; + float __contentFontSize; + float __titleFontSize; unsigned long __contentFontStyle; unsigned long __contentTextStyle; Tizen::Base::String __titleFontFaceName; bool __isSearchBar; bool __isKeypadClosedEventSkipped; _Frame* __pCurrentFrame; + _IEditTextFilter* __pTextFilter; + bool __textBlockMoveLeft; + bool __textBlockMoving; }; // _EditPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_EditTime.h b/src/ui/inc/FUiCtrl_EditTime.h index 39c0495..0e252b2 100644 --- a/src/ui/inc/FUiCtrl_EditTime.h +++ b/src/ui/inc/FUiCtrl_EditTime.h @@ -25,6 +25,7 @@ #ifndef _FUI_CTRL_INTERNAL_EDITTIME_H_ #define _FUI_CTRL_INTERNAL_EDITTIME_H_ +#include #include "FUi_Control.h" #include "FUi_UiTouchEvent.h" #include "FUiCtrl_IDateTimeChangeEventListener.h" @@ -50,6 +51,8 @@ class _OSP_EXPORT_ _EditTime , virtual public Tizen::Base::Runtime::IEventListener , virtual public _IUiEventListener , virtual public _IUiEventPreviewer + , virtual public Tizen::System::ISettingEventListener + { DECLARE_CLASS_BEGIN(_EditTime, _Control); DECLARE_PROPERTY("time", GetPropertyTime, SetPropertyTime); @@ -99,7 +102,6 @@ public: _DateTimeBar* GetDateTimeBar(void) const; virtual void OnDraw(void); - virtual result OnAttachedToMainTree(void); virtual void OnBoundsChanged(void); virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -113,13 +115,17 @@ public: virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - Tizen::Graphics::Rectangle GetParentWindowBounds(void) const; - void UpdateAccessibilityElement(void); + virtual void OnSettingChanged(Tizen::Base::String& key); + Tizen::Graphics::FloatRectangle GetParentWindowBounds(void) const; + void CreateAccessibilityElement(void); + void UpdateAccessibilityElement(void); + // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); @@ -138,9 +144,9 @@ private: _EditTimePresenter* __pEditTimePresenter; _DateTimeChangeEvent* __pTimeChangeEvent; _DateTimeBar* __pDateTimeBar; - Tizen::Graphics::Rectangle __absoluteBounds; + Tizen::Graphics::FloatRectangle __absoluteBounds; Tizen::Base::String __title; - Tizen::Ui::_AccessibilityElement* __pAccessibilityTitleElement; + Tizen::Ui::_AccessibilityElement* __pAccessibilityEditTimeElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityHourElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityMinuteElement; Tizen::Ui::_AccessibilityElement* __pAccessibilityAmPmElement; diff --git a/src/ui/inc/FUiCtrl_EditTimeImpl.h b/src/ui/inc/FUiCtrl_EditTimeImpl.h index 145c564..793fc12 100644 --- a/src/ui/inc/FUiCtrl_EditTimeImpl.h +++ b/src/ui/inc/FUiCtrl_EditTimeImpl.h @@ -39,23 +39,11 @@ class _EditTimeImpl , public _IDateTimeChangeEventListener , virtual public Tizen::Base::Runtime::IEventListener { -public: - class EditTimeSizeInfo : public Tizen::Ui::_ControlImpl::SizeInfo - { - public: - EditTimeSizeInfo(void); - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(Tizen::Ui::_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(Tizen::Ui::_ControlOrientation orientation) const; - void SetTitleStyle(bool titleStyle = false); - - private: - bool __isTitle; - }; public: virtual ~_EditTimeImpl(void); static _EditTimeImpl* CreateEditTimeImplN(EditTime* pControl, const Tizen::Graphics::Point& point, const Tizen::Base::String& title); - + static _EditTimeImpl* CreateEditTimeImplFN(EditTime* pControl, const Tizen::Graphics::FloatPoint& point, const Tizen::Base::String& title); virtual const char* GetPublicClassName(void) const; virtual const EditTime& GetPublic(void) const; virtual EditTime& GetPublic(void); @@ -63,6 +51,8 @@ public: virtual _EditTime& GetCore(void); public: + void SetInitialPosition(const Tizen::Graphics::FloatPoint& point); + result OnAttachedToMainTree(void); result AddTimeChangeEventListener(Tizen::Ui::ITimeChangeEventListener& listener); result RemoveTimeChangeEventListener(Tizen::Ui::ITimeChangeEventListener& listener); Tizen::Base::DateTime GetTime(void) const; @@ -91,6 +81,7 @@ private: private: _PublicDateTimeChangeEvent* __pPublicTimeChangeEvent; + Tizen::Graphics::FloatRectangle __defaultBounds; }; // _EditTimeImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_EditTimePresenter.h b/src/ui/inc/FUiCtrl_EditTimePresenter.h index 778582c..ac4c5fb 100644 --- a/src/ui/inc/FUiCtrl_EditTimePresenter.h +++ b/src/ui/inc/FUiCtrl_EditTimePresenter.h @@ -59,9 +59,9 @@ public: bool Is24HourNotationEnabled(void) const; _DateTimeId GetLastSelectedId(void) const; - Tizen::Graphics::Rectangle GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) const; + Tizen::Graphics::FloatRectangle GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) const; void SetTitleBounds(void); - Tizen::Graphics::Rectangle GetTitleBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; void SetAmEnabled(bool amEnable); bool GetAmEnabled(void) const; @@ -76,8 +76,8 @@ public: virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control); void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); result Initialize(void); + void UpdateTimeFormat(void); virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally); virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){} @@ -92,19 +92,19 @@ private: void SetTimeConversion(void); result DrawTitle(Tizen::Graphics::Canvas& canvas); - result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Base::String& text, int textSize = 0); - result DrawColon(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds); - _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::Point& point) const; + result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& text, int textSize = 0); + result DrawColon(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds); + _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const; void SetLastSelectedId(_DateTimeId boxId); result LoadResource(void); - result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); + result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); private: _DateTimeModel* __pEditDateTimeModel; _EditTime* __pEditTime; - Tizen::Graphics::Rectangle __bounds; - Tizen::Graphics::Rectangle __titleBounds; + Tizen::Graphics::FloatRectangle __bounds; + Tizen::Graphics::FloatRectangle __titleBounds; Tizen::Base::String __ampmString; Tizen::Base::String __hourString; @@ -113,6 +113,7 @@ private: Tizen::Base::String __lastSelectedValue; bool __24hours; + bool __is24hoursSet; bool __amEnable; bool __timePickerEnabled; diff --git a/src/ui/inc/FUiCtrl_ExpandableEditAreaImpl.h b/src/ui/inc/FUiCtrl_ExpandableEditAreaImpl.h index 89ea508..a18e26e 100644 --- a/src/ui/inc/FUiCtrl_ExpandableEditAreaImpl.h +++ b/src/ui/inc/FUiCtrl_ExpandableEditAreaImpl.h @@ -57,6 +57,7 @@ class _ExpandableEditAreaImpl { public: static _ExpandableEditAreaImpl* CreateExpandableEditAreaImplN(ExpandableEditArea* pControl, const Tizen::Graphics::Rectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle); + static _ExpandableEditAreaImpl* CreateExpandableEditAreaImplFN(ExpandableEditArea* pControl, const Tizen::Graphics::FloatRectangle& fRect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle); _ExpandableEditAreaImpl(ExpandableEditArea* pPublic, _Edit* pCore); virtual ~_ExpandableEditAreaImpl(void); @@ -67,16 +68,21 @@ public: virtual _Edit& GetCore(void); result Construct(const Tizen::Graphics::Rectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxLines = 10); - result CreateExpandableEditArea(const Tizen::Graphics::Rectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxLines); + result Construct(const Tizen::Graphics::FloatRectangle& rect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxLines = 10); + result CreateExpandableEditArea(const Tizen::Graphics::FloatRectangle& fRect, ExpandableEditAreaStyle style, ExpandableEditAreaTitleStyle titleStyle, int maxLines); int GetMargin(EditMarginType marginType) const; + float GetMarginF(EditMarginType marginType) const; result SetMargin(EditMarginType marginType, int margin); + result SetMargin(EditMarginType marginType, float margin); Tizen::Ui::KeypadAction GetKeypadAction(void) const; result SetKeypadAction(Tizen::Ui::KeypadAction keypadAction); KeypadStyle GetKeypadStyle(void) const; result SetKeypadStyle(KeypadStyle keypadStyle); result HideKeypad(void); int GetTextSize(void) const; + float GetTextSizeF(void) const; result SetTextSize(int size); + result SetTextSize(float size); Tizen::Graphics::Color GetColor(EditStatus status) const; Tizen::Graphics::Color GetTextColor(EditTextColor type) const; result SetBackgroundBitmap(EditStatus status, const Tizen::Graphics::Bitmap& bitmap); @@ -116,8 +122,10 @@ public: Tizen::Base::String GetGuideText(void) const; Tizen::Graphics::Color GetGuideTextColor(void) const; result SetGuideTextColor(const Tizen::Graphics::Color& color); - int GetLineSpacing (void) const; - result SetLineSpacing (int multiplier, int extra); + int GetLineSpacing(void) const; + float GetLineSpacingF(void) const; + result SetLineSpacing(int multiplier, int extra); + result SetLineSpacing(int multiplier, float extra); Tizen::Graphics::Color GetTitleTextColor(EditStatus status) const; result SetTitleTextColor(EditStatus status, const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetTokenColor(ExpandableEditAreaTokenStatus status) const; @@ -160,6 +168,8 @@ public: result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); public: virtual result OnBoundsChanged(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect); @@ -207,6 +217,10 @@ private: _PublicLanguageEvent* __pPublicLanguageEvent; ITokenFilter* __pTokenFilter; + + static const int EXPANDABLE_EDIT_AREA_DEFAULT_MAX_LINE_COUNT = 10; + static const int EXPANDABLE_EDIT_AREA_TEXT_LENGTH_MAX = 2048; + }; // _ExpandableEditAreaImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ExpandableListData.h b/src/ui/inc/FUiCtrl_ExpandableListData.h deleted file mode 100644 index 65765e4..0000000 --- a/src/ui/inc/FUiCtrl_ExpandableListData.h +++ /dev/null @@ -1,99 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUiCtrl_ExpandableListData.h - * @brief This is the header file for the _ExpandableListData class. - * - * This header file contains the declarations of the _MainItem, _SubItem & _ExpandableListItemDataProvider class. - */ - -#ifndef _FUI_CTRL_INTERNAL_EXPANDABLELIST_DATA_H_ -#define _FUI_CTRL_INTERNAL_EXPANDABLELIST_DATA_H_ - -#include -#include -#include -#include - -namespace Tizen { namespace Ui { namespace Controls -{ - -class _CustomItemData; -class _ExpandableListImpl; - -class _MainItem - : public Tizen::Base::Object -{ -public: - _MainItem(void); - ~_MainItem(void); - -private: - _MainItem(const _MainItem& rhs); - _MainItem& operator =(const _MainItem& rhs); - -public: - bool isExpanded; - bool isEnabled; - int checkCount; - Tizen::Base::Collection::ArrayList subItemList; - Tizen::Base::Collection::ArrayList actualSubItemList; - _CustomItemData* pCustomItemData; -}; //_MainItem - - -class _SubItem - : public Tizen::Base::Object -{ -public: - _SubItem(bool removeItemData = false); - ~_SubItem(void); - -private: - _SubItem(const _SubItem& rhs); - _SubItem& operator =(const _SubItem& rhs); - -public: - bool isEnabled; - _CustomItemData* pCustomItemData; - bool isDeleteNeeded; -}; //_SubItem - - -class _ExpandableListItemDataProvider - : public Tizen::Ui::Controls::IListViewItemProvider -{ -public: - _ExpandableListItemDataProvider(_ExpandableListImpl* pList); - virtual ~_ExpandableListItemDataProvider(void); - int GetItemCount(void); - Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth); - bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth); - -private: - _ExpandableListItemDataProvider(const _ExpandableListItemDataProvider& rhs); - _ExpandableListItemDataProvider& operator =(const _ExpandableListItemDataProvider& rhs); - -private: - _ExpandableListImpl* __pList; -}; //_ExpandableListItemDataProvider - -}}} // Tizen::Ui::Controls - - -#endif //_FUI_CTRL_INTERNAL_EXPANDABLELIST_DATA_H_ diff --git a/src/ui/inc/FUiCtrl_ExpandableListImpl.h b/src/ui/inc/FUiCtrl_ExpandableListImpl.h index 2c791e3..2e7fc5b 100644 --- a/src/ui/inc/FUiCtrl_ExpandableListImpl.h +++ b/src/ui/inc/FUiCtrl_ExpandableListImpl.h @@ -73,6 +73,25 @@ private: }; //_ExpandableListItemDataProvider +class _ExpandableListArrowBitmap + : public Tizen::Ui::Controls::Panel +{ + +public: + _ExpandableListArrowBitmap(void); + virtual ~_ExpandableListArrowBitmap(void); + void SetBitmap(const Tizen::Graphics::Bitmap& pNormalBitmap, const Tizen::Graphics::Bitmap* pEffectBitmap = null); + result OnDraw(void); + +private: + _ExpandableListArrowBitmap(const _ExpandableListArrowBitmap& rhs); + _ExpandableListArrowBitmap& operator =(const _ExpandableListArrowBitmap& rhs); + +private: + const Tizen::Graphics::Bitmap*__pNormalBitmap; + const Tizen::Graphics::Bitmap*__pEffectBitmap; +}; + class _ExpandableListImpl : public _ListBaseImpl , public _ITableViewItemEventListener @@ -193,6 +212,7 @@ public: void OnTableViewItemSwept(Tizen::Ui::Controls::_TableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewSweepDirection direction); virtual void OnTouchPressed (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo); + virtual void OnTouchReleased(const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo); int GetCheckedItemCount(int mainIndex); static _ExpandableListImpl* GetInstance(ExpandableList& expandableList); @@ -215,10 +235,19 @@ private: result SetSubItemCheckedRadio(int mainIndex, int subIndex, bool check); result CreateArrowIcon(int groupIndex); + void OnBoundsChanged(void); private: Tizen::Graphics::Bitmap* __pOpenedImage; Tizen::Graphics::Bitmap* __pClosedImage; + Tizen::Graphics::Bitmap* __pEffectClosedImage; + Tizen::Graphics::Bitmap* __pEffectOpenedImage; + Tizen::Graphics::Bitmap* __pOpenedDisabledImage; + Tizen::Graphics::Bitmap* __pClosedDisabledImage; + Tizen::Graphics::Bitmap* __pOpenedPressedImage; + Tizen::Graphics::Bitmap* __pClosedPressedImage; + + friend class _ExpandableListItemDataProvider; _ExpandableListItemDataProvider* __pItemProvider; Tizen::Base::Collection::LinkedList __itemListenersList; diff --git a/src/ui/inc/FUiCtrl_FastScroll.h b/src/ui/inc/FUiCtrl_FastScroll.h index e6780c3..b42fea6 100644 --- a/src/ui/inc/FUiCtrl_FastScroll.h +++ b/src/ui/inc/FUiCtrl_FastScroll.h @@ -73,7 +73,7 @@ public: virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point); private: diff --git a/src/ui/inc/FUiCtrl_FastScrollPresenter.h b/src/ui/inc/FUiCtrl_FastScrollPresenter.h index b07f17d..2e57ce5 100644 --- a/src/ui/inc/FUiCtrl_FastScrollPresenter.h +++ b/src/ui/inc/FUiCtrl_FastScrollPresenter.h @@ -76,35 +76,33 @@ private: Tizen::Graphics::Color __indexBgColor; Tizen::Graphics::Color __indexHighlightColor; - Tizen::Graphics::Color __indexLeftLineColor; + Tizen::Graphics::Color __indexSelectedLineColor; Tizen::Graphics::Color __indexTextColor; - Tizen::Graphics::Color __indexSeparatorColor; + Tizen::Graphics::Color __indexDividerColor; Tizen::Graphics::Color __selectedIndexBgColor; Tizen::Graphics::Color __selectedIndexTextColor; - Tizen::Graphics::Color __selectedIndexOutlineColor; Tizen::Graphics::Color __popupBgColor; Tizen::Graphics::Color __popupTextColor; Tizen::Graphics::Dimension __indexSizeMin; - Tizen::Graphics::Dimension __popupSize; - - int __indexMarginRight; - int __indexMarginTop; - int __indexGap; - - int __indexLeftLineThickness; - int __indexTextSize; - int __indexSeparatorThickness; - int __selectedIndexMarginRight; - int __selectedIndexHeight; - int __popupWidthIncrement; - int __popupTextSize; - int __popupShadowRight; - int __popupShadowBottom; + Tizen::Graphics::FloatDimension __popupSize; + + float __indexMarginTop; + float __indexGap; + + float __indexLeftLineThickness; + float __indexTextSize; + float __indexSeparatorThickness; + float __selectedIndexMarginRight; + float __selectedIndexHeight; + float __popupWidthIncrement; + float __popupTextSize; + float __popupShadowRight; + float __popupShadowBottom; Tizen::Graphics::Bitmap* __pIndexBgBitmap; Tizen::Graphics::Bitmap* __pSelectedIndexBgBitmap; - Tizen::Graphics::Bitmap* __pSelectedIndexOutlineBitmap; + Tizen::Graphics::Bitmap* __pSelectedIndexlineBitmap; Tizen::Graphics::Bitmap* __pPopupBgBitmap; Tizen::Graphics::Bitmap* __pPopupBgEffectBitmap; @@ -130,19 +128,17 @@ public: result SetBaseIndex(_FastScrollIndex* pIndex); _FastScrollIndex* GetBaseIndex(void) const; - result SetIndexBounds(const Tizen::Graphics::Rectangle& indexBounds); + result SetIndexBounds(const Tizen::Graphics::FloatRectangle& indexBounds); Tizen::Graphics::Rectangle GetIndexBounds(void) const; - result SetSelectedBgBounds(const Tizen::Graphics::Rectangle& indexBounds); - Tizen::Graphics::Rectangle GetSelectedBgBounds(void) const; - result SetSelectedIndexBounds(const Tizen::Graphics::Rectangle& indexBounds); - Tizen::Graphics::Rectangle GetSelectedIndexBounds(void) const; - - _FastScrollIndex* GetIndexAtPoint(const Tizen::Graphics::Point& point) const; - _FastScrollIndex* GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const Tizen::Graphics::Point& point) const; - int GetIndexHeight(void) const; + Tizen::Graphics::FloatRectangle GetIndexBoundsF(void) const; + + _FastScrollIndex* GetIndexAtPoint(const Tizen::Graphics::FloatPoint& point) const; + _FastScrollIndex* GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const Tizen::Graphics::FloatPoint& point) const; + float GetIndexHeight(void) const; result SelectIndex(int indexOrder); result SelectIndex(_FastScrollIndex* pIndex, bool animation); int GetSelectedIndexOrder(void) const; + void SetSelectedIndex(_FastScrollIndex* pIndex); _FastScrollIndex* GetSelectedIndex(void) const; void SetSelectedIndexInOmittedIndex(_FastScrollIndex* pIndex); _FastScrollIndex* GetSelectedIndexInOmittedIndex(void) const; @@ -158,14 +154,8 @@ public: result AddAccessibilityElement(const Tizen::Ui::_AccessibilityContainer& control); result UpdateIndex(bool bNeedUpdateBaseIndex); - Tizen::Graphics::Rectangle CalculateSelectedBg(void); void OnDraw(void); - void DrawBaseIndex(void); - void DrawSelectedBg(void); - void DrawSelectedIndex(void); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& srcRect, const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Rectangle& dstRect); virtual Tizen::Ui::Animations::VisualElementAnimation* CreateAnimationForProperty(Tizen::Ui::Animations::VisualElement& target, const Tizen::Base::String& property); virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); @@ -179,6 +169,15 @@ private: _FastScrollIndexView(Tizen::Ui::Animations::_VisualElement& parentVe, _FastScrollViewConfig& viewConfig); result Construct(void); + Tizen::Graphics::FloatRectangle CalculateSelectedBg(void); + void DrawBaseIndex(void); + void DrawSelectedBg(void); + void DrawSelectedIndex(void); + + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& srcRect, const + Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::FloatRectangle& dstRect); + private: Tizen::Ui::Animations::_VisualElement& __parentVe; _FastScrollViewConfig& __viewConfig; @@ -214,10 +213,8 @@ public: result AddPopupIndexVe(int indexLevel); result RemovePopupIndexVe(int indexLevel); - result SetPopupBounds(const Tizen::Graphics::Rectangle& indexBounds); - Tizen::Graphics::Rectangle GetPopupBounds(void) const; + result SetPopupBounds(const Tizen::Graphics::FloatRectangle& indexBounds); result SetPopupIndexBounds(int indexLevel, const _FastScrollIndex* pBaseIndex); - Tizen::Graphics::Rectangle GetPopupIndexBounds(int indexLevel) const; Tizen::Ui::Animations::_VisualElement* GetIndexVe(int indexLevel) const; int GetIndexVeCount(void) const; @@ -230,12 +227,7 @@ public: result UpdateIndex(void); - void DrawPopupVe(void); - void DrawPopupIndexVe(int indexLevel, const _FastScrollIndex* pBaseIndex, const _FastScrollIndex* pSelectedIndex); - void OnDraw(int indexLevel, const _FastScrollIndex* pBaseIndex, const _FastScrollIndex* pSelectedIndex); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& srcRect, const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Rectangle& dstRect); virtual Tizen::Ui::Animations::VisualElementAnimation* CreateAnimationForProperty(Tizen::Ui::Animations::VisualElement& target, const Tizen::Base::String& property); virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); @@ -249,6 +241,12 @@ private: _FastScrollPopupView(Tizen::Ui::Animations::_VisualElement& parentVe, _FastScrollViewConfig& viewConfig); result Construct(void); + void DrawPopupVe(void); + void DrawPopupIndexVe(int indexLevel, const _FastScrollIndex* pBaseIndex, const _FastScrollIndex* pSelectedIndex); + + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& srcRect, const + Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::FloatRectangle& dstRect); private: Tizen::Ui::Animations::_VisualElement& __parentVe; _FastScrollViewConfig& __viewConfig; @@ -307,8 +305,8 @@ public: bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); void OnFontChanged(Tizen::Graphics::Font* pFont); - void OnFontInfoRequested(unsigned long& style, int& size); - result SetFontInfo(unsigned long style, int size); + void OnFontInfoRequested(unsigned long& style, float& size); + result SetFontInfo(unsigned long style, float size); Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point); virtual Tizen::Ui::Animations::VisualElementAnimation* CreateAnimationForProperty(Tizen::Ui::Animations::VisualElement& target, const Tizen::Base::String& property); @@ -328,20 +326,20 @@ private: _FastScrollPresenter(Tizen::Ui::_Control& parentCtrl, _FastScroll& fastScroll, bool visibility); result Construct(void); - Tizen::Graphics::Rectangle CalculateFastScrollBounds(int indexCount); - Tizen::Graphics::Rectangle CalculateIndexBounds(int indexLevel, _FastScrollIndex& pIndex); - Tizen::Graphics::Rectangle CalculatePopupBounds(void); + Tizen::Graphics::FloatRectangle CalculateFastScrollBounds(int indexCount); + Tizen::Graphics::FloatRectangle CalculateIndexBounds(int indexLevel, _FastScrollIndex& pIndex); + Tizen::Graphics::FloatRectangle CalculatePopupBounds(void); void RelayoutFastScrollChildren(void); - _FastScrollIndex* SelectOnIndexViews(const Tizen::Graphics::Point& point, bool animation); + _FastScrollIndex* SelectOnIndexViews(const Tizen::Graphics::FloatPoint& point, bool animation); result DeselectIndexViews(void); - result SetPopupIndex(_FastScrollIndex& popupIndex, const Tizen::Graphics::Point& point); + result SetPopupIndex(_FastScrollIndex& popupIndex, const Tizen::Graphics::FloatPoint& point); result ClearPopupIndex(void); result FireFastScrollEvent(_FastScrollIndex& selectedIndex); - bool OnTouchPressedAndMoved(const Tizen::Graphics::Point& point, bool animation); + bool OnTouchPressedAndMoved(const Tizen::Graphics::FloatPoint& point, bool animation); bool OnTouchReleasedAndCanceled(void); result AddIndexView(_FastScrollIndex& baseIndex); @@ -362,7 +360,7 @@ private: _UiFastScrollEvent* __pFastScrollEvent; _FastScrollModel* __pFastScrollModel; unsigned long __fontStyle; - int __fontSize; + float __fontSize; _FastScrollPopupView* __pPopupView; Tizen::Base::Collection::ArrayList __indexViews; diff --git a/src/ui/inc/FUiCtrl_FooterImpl.h b/src/ui/inc/FUiCtrl_FooterImpl.h index 83e0a2c..362dd42 100644 --- a/src/ui/inc/FUiCtrl_FooterImpl.h +++ b/src/ui/inc/FUiCtrl_FooterImpl.h @@ -142,6 +142,10 @@ public: result SetItemNumberedBadgeIcon(int itemIndex, int number); + result SetButtonBadgeIcon(ButtonPosition position, const Tizen::Graphics::Bitmap* pBadgeIcon); + + result SetButtonNumberedBadgeIcon(ButtonPosition position, int number); + result SetColor(const Tizen::Graphics::Color& color); result SetStyle(FooterStyle style); @@ -152,6 +156,8 @@ public: Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const; + Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const; + void AddActionEventListener(Tizen::Ui::IActionEventListener& listener); void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener); diff --git a/src/ui/inc/FUiCtrl_FooterItemImpl.h b/src/ui/inc/FUiCtrl_FooterItemImpl.h index 7b5e828..4c93c8e 100644 --- a/src/ui/inc/FUiCtrl_FooterItemImpl.h +++ b/src/ui/inc/FUiCtrl_FooterItemImpl.h @@ -66,6 +66,7 @@ public: result SetText(const Tizen::Base::String& text); + void SetAccessibilityHint(const Tizen::Base::String& hint); private: _FooterItemImpl(const _FooterItemImpl& footerItem); @@ -76,6 +77,7 @@ private: private: int __actionId; Tizen::Base::String __itemText; + Tizen::Base::String __accessibilityHint; const Tizen::Graphics::Bitmap* __pIconBitmap[FOOTER_ITEM_MAX_STATE_COUNT]; const Tizen::Graphics::Bitmap* __pFooterItemBackgroundBitmap[FOOTER_ITEM_MAX_STATE_COUNT]; diff --git a/src/ui/inc/FUiCtrl_Form.h b/src/ui/inc/FUiCtrl_Form.h index edcfe30..5130fe0 100644 --- a/src/ui/inc/FUiCtrl_Form.h +++ b/src/ui/inc/FUiCtrl_Form.h @@ -65,7 +65,7 @@ enum _Softkey /** * @class _Form * @brief - * @since 1.0 + * @since 2.0 */ class _OSP_EXPORT_ _Form @@ -94,6 +94,7 @@ public: Tizen::Base::String GetTitleText(void) const; HorizontalAlignment GetTitleTextHorizontalAlignment(void) const; OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::Rectangle& rect, OverlayRegionType regionType); + OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::FloatRectangle& rect, OverlayRegionType regionType); int GetOverlayRegionCount(void) const; Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const; int GetSoftkeyActionId(_Softkey softkey) const; @@ -130,9 +131,12 @@ public: virtual bool IsOrientationRoot(void) const; Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; bool DeflateClientRectHeight(int height); + bool DeflateClientRectHeight(float height); static _Toolbar* CreateHeaderN(void); static _Toolbar* CreateFooterN(void); @@ -140,17 +144,21 @@ public: static _Indicator* CreateIndicatorN(void); int GetToolbarHeight(bool header) const; + float GetToolbarHeightF(bool header) const; int GetTabHeight(void) const; + float GetTabHeightF(void) const; bool RemoveHeader(void); bool RemoveFooter(void); bool RemoveTab(void); bool RemoveIndicator(void); result SetHeaderBounds(Tizen::Graphics::Rectangle& bounds); - result SetHeaderFloatBounds(Tizen::Graphics::FloatRectangle& bounds); + result SetHeaderBounds(Tizen::Graphics::FloatRectangle& bounds); result SetFooterBounds(Tizen::Graphics::Rectangle& bounds); + result SetFooterBounds(Tizen::Graphics::FloatRectangle& bounds); result SetTabBounds(Tizen::Graphics::Rectangle& bounds); + result SetTabBounds(Tizen::Graphics::FloatRectangle& bounds); Tizen::Graphics::Rectangle GetIndicatorBounds(void) const; - Tizen::Graphics::FloatRectangle GetIndicatorFloatBounds(void) const; + Tizen::Graphics::FloatRectangle GetIndicatorBoundsF(void) const; void SetHeader(_Toolbar* pToolbar); void SetFooter(_Toolbar* pToolbar); @@ -176,6 +184,10 @@ public: result AddIndicatorObject(void); result DeleteIndicatorObject(void); + void SetKeypadShowState(bool state); + + Tizen::Graphics::FloatDimension TranslateSize(Tizen::Graphics::FloatDimension size) const; + //callback virtual void OnDraw(void); virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); @@ -216,7 +228,7 @@ private: bool __indicatorShowState; bool __deflated; - int __deflatedHeight; + float __deflatedHeight; int __overlayRegionCount; _OverlayRegionImpl** __ppOverlayerRegionImplArray; @@ -226,6 +238,7 @@ private: int __actionId[_SOFTKEY_COUNT + 1]; bool __enableSoftkey[_SOFTKEY_COUNT + 1]; bool __showSoftkey[_SOFTKEY_COUNT + 1]; + bool __keypadShowstate; Tizen::Base::String __softkeyText[_SOFTKEY_COUNT + 1]; @@ -234,8 +247,8 @@ private: Tizen::Graphics::Bitmap* __pSoftkeyPressedBitmap[_SOFTKEY_COUNT+1]; Tizen::Graphics::Bitmap* __pSoftkeyPressedEffectBitmap[_SOFTKEY_COUNT+1]; - Tizen::Graphics::Bitmap* __pSoftkeyNormalIcon[_SOFTKEY_COUNT]; - Tizen::Graphics::Bitmap* __pSoftkeyPressedIcon[_SOFTKEY_COUNT]; + Tizen::Graphics::Bitmap* __pSoftkeyNormalIcon[_SOFTKEY_COUNT+1]; + Tizen::Graphics::Bitmap* __pSoftkeyPressedIcon[_SOFTKEY_COUNT+1]; //Back button action ID static const int ID_BACK_BUTTON = -10; diff --git a/src/ui/inc/FUiCtrl_FormImpl.h b/src/ui/inc/FUiCtrl_FormImpl.h index 8e1cde2..cc620d3 100644 --- a/src/ui/inc/FUiCtrl_FormImpl.h +++ b/src/ui/inc/FUiCtrl_FormImpl.h @@ -44,6 +44,7 @@ public: class FormSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // FormSizeInfo // Lifecycle @@ -70,6 +71,7 @@ public: Tizen::Base::String GetTitleText(void) const; HorizontalAlignment GetTitleTextHorizontalAlignment(void) const; OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::Rectangle& rect, OverlayRegionType regionType); + OverlayRegion* GetOverlayRegionN(const Tizen::Graphics::FloatRectangle& rect, OverlayRegionType regionType); Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const; int GetSoftkeyActionId(Softkey softkey) const; int GetOptionkeyActionId(void) const; @@ -103,7 +105,9 @@ public: bool IsSoftkeyEnabled(Softkey softkey) const; Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; void AddOrientationEventListener(Tizen::Ui::IOrientationEventListener& listener); void AddOptionkeyActionListener(const Tizen::Ui::IActionEventListener& listener); @@ -121,6 +125,7 @@ public: virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); bool DeflateClientRectHeight(int height); + bool DeflateClientRectHeight(float height); virtual void OnDraw(void); DataBindingContext* GetDataBindingContextN(void) const; @@ -128,6 +133,7 @@ public: virtual result OnAttachedToMainTree(void); virtual result OnDetachingFromMainTree(void); virtual result OnAttaching(const _Control* pParent); + virtual bool OnNotifiedN(const _ControlImpl& source, Tizen::Base::Collection::IList* pArgs); virtual bool IsOpaque(void) const; diff --git a/src/ui/inc/FUiCtrl_FormModel.h b/src/ui/inc/FUiCtrl_FormModel.h index be5bd89..d286c33 100644 --- a/src/ui/inc/FUiCtrl_FormModel.h +++ b/src/ui/inc/FUiCtrl_FormModel.h @@ -31,7 +31,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _FormModel * @brief - * @since 1.0 + * @since 2.0 */ class _FormModel diff --git a/src/ui/inc/FUiCtrl_FormPresenter.h b/src/ui/inc/FUiCtrl_FormPresenter.h index 529ca3e..b6c5900 100644 --- a/src/ui/inc/FUiCtrl_FormPresenter.h +++ b/src/ui/inc/FUiCtrl_FormPresenter.h @@ -34,7 +34,7 @@ class _FormModel; /** * @class _FormPresenter * @brief - * @since 1.0 + * @since 2.0 */ class _FormPresenter diff --git a/src/ui/inc/FUiCtrl_Frame.h b/src/ui/inc/FUiCtrl_Frame.h old mode 100644 new mode 100755 index 63ad93c..ac22402 --- a/src/ui/inc/FUiCtrl_Frame.h +++ b/src/ui/inc/FUiCtrl_Frame.h @@ -37,7 +37,7 @@ class _Form; /** * @class _Frame * @brief - * @since 2.0 + * @since 2.1 */ class _OSP_EXPORT_ _Frame @@ -59,12 +59,11 @@ public: virtual bool OnNotifiedN(const Tizen::Ui::_Control& source, Tizen::Base::Collection::IList* pArgs); virtual void OnFrameActivated(void); virtual void OnFrameDeactivated(void); - virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual void OnFrameMinimized(void); + virtual void OnFrameRestored(void); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual result OnAttached(void); -#if !defined(MULTI_WINDOW) - virtual result OnAttachedToMainTree(void); - virtual void OnVisibleStateChanged(void); -#endif + virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor); // Current form void SetCurrentForm(const Tizen::Ui::Controls::_Form* pForm); @@ -72,12 +71,8 @@ public: // Focus virtual bool IsFocusableDescendant(const Tizen::Ui::_Control* pFocus) const; - virtual void SetFocusOff(Tizen::Ui::_Control* pFocus); -#if !defined(MULTI_WINDOW) // Orientation - virtual bool IsLayoutChangable(void) const; -#endif virtual bool IsOrientationRoot(void) const; // Event listeners @@ -87,6 +82,7 @@ public: // Floating void SetFloatingBounds(const Tizen::Graphics::Rectangle& rect); + void SetFloatingBounds(const Tizen::Graphics::FloatRectangle& rect); result SetShowMode(FrameShowMode showMode); FrameShowMode GetShowMode(void) const; bool IsActivated(void) const; @@ -103,10 +99,12 @@ private: private: _FramePresenter* __pFramePresenter; _FrameEvent* __pFrameEvent; - Tizen::Graphics::Rectangle __floatingBounds; + Tizen::Graphics::FloatRectangle __floatingBounds; FrameShowMode __showMode; bool __restore; + bool __minimized; bool __activated; + bool __constructed; _IFormActivationChangeEventListener* __pFormActivationChangeEventListener; }; // _Frame diff --git a/src/ui/inc/FUiCtrl_FrameEvent.h b/src/ui/inc/FUiCtrl_FrameEvent.h index 1b78203..c293587 100644 --- a/src/ui/inc/FUiCtrl_FrameEvent.h +++ b/src/ui/inc/FUiCtrl_FrameEvent.h @@ -37,7 +37,9 @@ namespace Tizen { namespace Ui { namespace Controls enum _FrameStatus { _FRAME_STATUS_ACTIVATED = 0, - _FRAME_STATUS_DEACTIVATED + _FRAME_STATUS_DEACTIVATED, + _FRAME_STATUS_MINIMIZED, + _FRAME_STATUS_RESTORED, }; class _Frame; diff --git a/src/ui/inc/FUiCtrl_FrameImpl.h b/src/ui/inc/FUiCtrl_FrameImpl.h index dea93ac..2e858c3 100644 --- a/src/ui/inc/FUiCtrl_FrameImpl.h +++ b/src/ui/inc/FUiCtrl_FrameImpl.h @@ -54,6 +54,7 @@ public: // Form managing result SetCurrentForm(const _FormImpl& formImpl); + result SetCurrentForm(_FormImpl* pFormImpl); _FormImpl* GetCurrentForm(void) const; // Event listeners @@ -75,7 +76,11 @@ public: virtual void OnChildDetached(const _Control& child); virtual void OnFrameActivated(const _Frame& source); virtual void OnFrameDeactivated(const _Frame& source); + virtual void OnFrameMinimized(const _Frame& source); + virtual void OnFrameRestored(const _Frame& source); virtual void OnBoundsChanged(void); + virtual result OnAttachedToMainTree(void); + virtual bool OnNotifiedN(const _ControlImpl& source, Tizen::Base::Collection::IList* pArgs); // Animator Tizen::Ui::Animations::FrameAnimator* GetFrameAnimator(void) const; @@ -85,6 +90,7 @@ public: // Floating void SetFloatingBounds(const Tizen::Graphics::Rectangle& rect); + void SetFloatingBounds(const Tizen::Graphics::FloatRectangle& rect); result SetShowMode(FrameShowMode showMode); FrameShowMode GetShowMode(void) const; diff --git a/src/ui/inc/FUiCtrl_FrameModel.h b/src/ui/inc/FUiCtrl_FrameModel.h index 370c3cd..33fd27f 100644 --- a/src/ui/inc/FUiCtrl_FrameModel.h +++ b/src/ui/inc/FUiCtrl_FrameModel.h @@ -31,7 +31,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _FrameModel * @brief - * @since 1.0 + * @since 2.0 */ class _FrameModel diff --git a/src/ui/inc/FUiCtrl_FramePresenter.h b/src/ui/inc/FUiCtrl_FramePresenter.h index f4761bf..4c7f97f 100644 --- a/src/ui/inc/FUiCtrl_FramePresenter.h +++ b/src/ui/inc/FUiCtrl_FramePresenter.h @@ -34,7 +34,7 @@ class _FrameModel; /** * @class _FramePresenter * @brief - * @since 1.0 + * @since 2.0 */ class _FramePresenter diff --git a/src/ui/inc/FUiCtrl_Gallery.h b/src/ui/inc/FUiCtrl_Gallery.h index 0c4b640..7ec97f5 100644 --- a/src/ui/inc/FUiCtrl_Gallery.h +++ b/src/ui/inc/FUiCtrl_Gallery.h @@ -41,6 +41,7 @@ namespace Tizen { namespace Ui { class _TouchFlickGestureDetector; class _TouchTapGestureDetector; class _TouchPinchGestureDetector; +class _AccessibilityElement; }} // Tizen::Ui namespace Tizen { namespace Ui { namespace Effects { @@ -126,6 +127,10 @@ public: void SetEffect(Tizen::Ui::Effects::Effect* pEffect); Tizen::Ui::Effects::Effect* GetEffect(void); + virtual result OnAttachedToMainTree(void); + + void ResizeGalleryAccessibilityElement(void); + private: _Gallery(void); result Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor); @@ -154,15 +159,22 @@ private: return *__pPresenter; } + void InitializeAccessibilityElement(void); + void AddGalleryAccessibilityElement(void); + void RemoveGalleryAccessibilityElements(void); + private: _GalleryRenderer* __pRenderer; _GalleryPresenter* __pPresenter; _TouchFlickGestureDetector __flickGesture; - _TouchTapGestureDetector __tapGesture; + _TouchTapGestureDetector __oneTapGesture; + _TouchTapGestureDetector __twoTapGesture; _TouchPinchGestureDetector __pinchGesture; bool __modelInitialized; + + Tizen::Ui::_AccessibilityElement* __pGalleryImageElement; }; // _Gallery }}} diff --git a/src/ui/inc/FUiCtrl_GalleryBitmap.h b/src/ui/inc/FUiCtrl_GalleryBitmap.h old mode 100644 new mode 100755 index 6d30c01..f40f902 --- a/src/ui/inc/FUiCtrl_GalleryBitmap.h +++ b/src/ui/inc/FUiCtrl_GalleryBitmap.h @@ -20,6 +20,7 @@ #include #include "FUiCtrl_GalleryTypes.h" + namespace Tizen { namespace Graphics { class Bitmap; @@ -38,9 +39,9 @@ public: static _GalleryBitmap* CreateGalleryBitmapN(Tizen::Graphics::Bitmap* pBitmap); result SetSize(const Tizen::Graphics::Dimension& size); - Tizen::Graphics::Dimension GetSize(void) const; + Tizen::Graphics::FloatDimension GetSize(void) const; - result Initialize(const Tizen::Graphics::Dimension& size, _GalleryFittingType fittingType = GALLERY_FITTING_TYPE_FIT); + result Initialize(const Tizen::Graphics::FloatDimension& size, _GalleryFittingType fittingType = GALLERY_FITTING_TYPE_FIT); result AdjustBitmapSize(const Tizen::Graphics::Dimension& size, _GalleryFittingType fittingType); result AdjustBitmapRotate(void); diff --git a/src/ui/inc/FUiCtrl_GalleryCanvas.h b/src/ui/inc/FUiCtrl_GalleryCanvas.h old mode 100644 new mode 100755 index b6984ee..ad05f20 --- a/src/ui/inc/FUiCtrl_GalleryCanvas.h +++ b/src/ui/inc/FUiCtrl_GalleryCanvas.h @@ -24,7 +24,7 @@ namespace Tizen { namespace Graphics { -class Rectangle; +class FloatRectangle; }} // Tizen::Graphics @@ -65,12 +65,13 @@ class _GalleryCanvas { public: virtual ~_GalleryCanvas(void); - static _GalleryCanvas* CreateGalleryCanvasN(Tizen::Graphics::Rectangle& canvasBounds); + static _GalleryCanvas* CreateGalleryCanvasN(Tizen::Graphics::FloatRectangle& canvasBounds); - result SetImage(const _GalleryBitmap* pImage, const Tizen::Graphics::Rectangle& viewBounds, _GalleryFittingType fittingType = GALLERY_FITTING_TYPE_FIT); + result SetImage(const _GalleryBitmap* pImage, const Tizen::Graphics::FloatRectangle& viewBounds, + _GalleryFittingType fittingType = GALLERY_FITTING_TYPE_FIT); _GalleryBitmap* GetImage(void) const; - result SetBounds(const Tizen::Graphics::Rectangle& bounds); - const Tizen::Graphics::Rectangle& GetBounds(void) const; + result SetBounds(const Tizen::Graphics::FloatRectangle& bounds); + const Tizen::Graphics::FloatRectangle& GetBounds(void) const; Tizen::Ui::Animations::_VisualElement& GetImageVisualElement(void) const; Tizen::Ui::Animations::_VisualElement& GetFrameVisualElement(void) const; Tizen::Ui::Animations::VisualElementPropertyAnimation& GetAnimation(void) const; @@ -79,12 +80,12 @@ public: result RefreshCanvas(void); result LoadImage(void); - result SetVisualElementBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetImageVisualElementBounds(void) const; + result SetVisualElementBounds(const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle GetImageVisualElementBounds(void) const; - void SetImageBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetImageBounds(void) const; - Tizen::Graphics::Rectangle GetOriginalImageBounds(void) const; + void SetImageBounds(const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle GetImageBounds(void) const; + Tizen::Graphics::FloatRectangle GetOriginalImageBounds(void) const; result SetAnimationDelegator(_GalleryAnimationProvider* pVEDelegator); void SetRootCanvas(_GalleryRootCanvas& rootCanvas); @@ -98,7 +99,7 @@ public: void SetImageAnchor(Tizen::Graphics::FloatPoint); Tizen::Graphics::FloatPoint GetImageAnchor(void) const; - Tizen::Graphics::Rectangle GetAlignBoundary(void) const; + Tizen::Graphics::FloatRectangle GetAlignBoundary(void) const; void SetClippingOfFrameVisualElement(bool clipping); @@ -107,12 +108,15 @@ public: void GetImageAlignment(_GalleryVerticalAlignment& imageVerticalAlignment , _GalleryHorizontalAlignment& imageHorizontalAlignment) const; + Tizen::Graphics::FloatDimension GetScaledBitmapSize(_GalleryBitmap& galleryBitmap, + const Tizen::Graphics::FloatDimension& size, _GalleryFittingType fittingType) const; + private: _GalleryCanvas(_GalleryCanvas& rhs); _GalleryCanvas& operator=(const _GalleryCanvas& rhs); _GalleryCanvas(void); - result Construct(Tizen::Graphics::Rectangle& canvasBounds); + result Construct(Tizen::Graphics::FloatRectangle& canvasBounds); void SetImageVisualElement(Tizen::Ui::Animations::_VisualElement& visualElement); void SetFrameVisualElement(Tizen::Ui::Animations::_VisualElement& visualElement); @@ -122,13 +126,13 @@ private: Tizen::Ui::Animations::_VisualElement* __pImageVisualElement; Tizen::Ui::Animations::_VisualElement* __pFrameVisualElement; Tizen::Ui::Animations::VisualElementPropertyAnimation* __pAnimation; - Tizen::Graphics::Rectangle __bounds; + Tizen::Graphics::FloatRectangle __bounds; _GalleryBitmap* __pImage; - Tizen::Graphics::Rectangle __visableRegionOfImage; + Tizen::Graphics::FloatRectangle __visableRegionOfImage; bool __needUpdateImage; bool __visualElementBoundsChanged; - Tizen::Graphics::Rectangle __imageBounds; - Tizen::Graphics::Rectangle __originalImageBounds; + Tizen::Graphics::FloatRectangle __imageBounds; + Tizen::Graphics::FloatRectangle __originalImageBounds; _GalleryRootCanvas* __pRootCanvas; float __factor; Tizen::Graphics::FloatPoint __imageAnchor; @@ -148,9 +152,9 @@ public: result SetBackgroundImage(const _GalleryBitmap* pImage); _GalleryBitmap* GetBackgroundImage(void) const; Tizen::Graphics::Color GetBackgroundColor(void) const; - result SetBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetBounds(void) const; - Tizen::Graphics::Dimension GetControlSize(void) const; + result SetBounds(const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle GetBounds(void) const; + Tizen::Graphics::FloatDimension GetControlSize(void) const; Tizen::Ui::Animations::_VisualElement* GetImageVisualElement(void) const; result SetVisibility(bool visibility); bool IsVisibility(void) const; diff --git a/src/ui/inc/FUiCtrl_GalleryCanvasManager.h b/src/ui/inc/FUiCtrl_GalleryCanvasManager.h old mode 100644 new mode 100755 index 0b7c071..21cdea2 --- a/src/ui/inc/FUiCtrl_GalleryCanvasManager.h +++ b/src/ui/inc/FUiCtrl_GalleryCanvasManager.h @@ -35,15 +35,15 @@ public: virtual ~_GalleryCanvasManager(void); static _GalleryCanvasManager* CreateCanvasManagerN(Tizen::Ui::_Control& control, int initialCanvasCount, - Tizen::Graphics::Rectangle& initialCanvasBounds, + Tizen::Graphics::FloatRectangle& initialCanvasBounds, _GalleryAnimationProvider* pVEDelegator); - result ResetCanvasManager(int canvasCount, Tizen::Graphics::Rectangle& canvasBounds); + result ResetCanvasManager(int canvasCount, Tizen::Graphics::FloatRectangle& canvasBounds); int GetCanvasCount(void) const; _GalleryRootCanvas& GetRootCanvas(void) const; _GalleryCanvas* GetCanvas(int canvasIndex) const; result ReleaseAllCanvasResource(void); - result ResetAllCanvas(Tizen::Graphics::Rectangle& canvasBounds); + result ResetAllCanvas(Tizen::Graphics::FloatRectangle& canvasBounds); result LoadAllCanvasImage(void); private: @@ -51,7 +51,7 @@ private: _GalleryCanvasManager& operator=(const _GalleryCanvasManager& rhs); _GalleryCanvasManager(void); - result Construct(Tizen::Ui::_Control& control, int initialCanvasCount, Tizen::Graphics::Rectangle& initialCanvasBounds); + result Construct(Tizen::Ui::_Control& control, int initialCanvasCount, Tizen::Graphics::FloatRectangle& initialCanvasBounds); result RemoveAllCanvas(void); diff --git a/src/ui/inc/FUiCtrl_GalleryImageReader.h b/src/ui/inc/FUiCtrl_GalleryImageReader.h old mode 100644 new mode 100755 index 1b43edf..f90dcdb --- a/src/ui/inc/FUiCtrl_GalleryImageReader.h +++ b/src/ui/inc/FUiCtrl_GalleryImageReader.h @@ -18,11 +18,11 @@ #define _FUI_CTRL_INTERNAL_GALLERY_IMAGE_READER_H_ #include -#include +#include namespace Tizen { namespace Graphics { -class Rectangle; +class FloatRectangle; class Bitmap; }} // Tizen::Graphics @@ -40,21 +40,21 @@ public: virtual ~_GalleryImageReader(void); //void SetPartialDecoder(); - _GalleryBitmap* GetPartialImageFromFileN(int index, const Tizen::Graphics::Rectangle& partialBounds, - const Tizen::Graphics::Dimension& imageSize) const; + _GalleryBitmap* GetPartialImageFromFileN(int index, const Tizen::Graphics::FloatRectangle& partialBounds, + const Tizen::Graphics::FloatDimension& imageSize) const; _GalleryBitmap* GetItemImage(int index) const; private: _GalleryImageReader(const _GalleryImageReader& rhs); _GalleryImageReader& operator=(const _GalleryImageReader& rhs); - void LoadPartialImageFromFile(int index, const Tizen::Graphics::Dimension& imageSize); + void LoadPartialImageFromFile(int index, const Tizen::Graphics::FloatDimension& imageSize); private: _GalleryModel& __galleryModel; Tizen::Graphics::Bitmap* __pTmpFileBitmap; int __currentLoadBitmapIndex; - Tizen::Graphics::Dimension __currentLoadBitmapSize; + Tizen::Graphics::FloatDimension __currentLoadBitmapSize; }; // _GalleryImageReader }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_GalleryItem.h b/src/ui/inc/FUiCtrl_GalleryItem.h index 99e0656..5d8c513 100644 --- a/src/ui/inc/FUiCtrl_GalleryItem.h +++ b/src/ui/inc/FUiCtrl_GalleryItem.h @@ -38,8 +38,6 @@ public: void SetGalleryItemImage(_GalleryBitmap* pImage); _GalleryBitmap* GetGalleryItemImage(void) const; - void SetOriginGalleryItemImage(_GalleryBitmap* pImage); - _GalleryBitmap* GetOriginItemImage(void) const; void SetGalleryItemFilePath(Tizen::Base::String& filePath); Tizen::Base::String GetGalleryItemFilePath(void) const; void SetGalleryRotation(_GalleryImageRotation rotation); @@ -58,7 +56,6 @@ private: _GalleryItem& operator=(const _GalleryItem& rhs); private: - _GalleryBitmap* __pOriginImage; _GalleryBitmap* __pImage; Tizen::Base::String __imageFilePath; _GalleryImageRotation __rotation; diff --git a/src/ui/inc/FUiCtrl_GalleryPresenter.h b/src/ui/inc/FUiCtrl_GalleryPresenter.h index b86a039..c735170 100644 --- a/src/ui/inc/FUiCtrl_GalleryPresenter.h +++ b/src/ui/inc/FUiCtrl_GalleryPresenter.h @@ -49,6 +49,7 @@ class _GalleryCoreEvent; class _GalleryItemProvider; class _GalleryBitmap; class _GalleryItemProviderAdaptorImpl; +class _Gallery; class _GalleryPresenter : public Tizen::Ui::_PropertyBase @@ -68,7 +69,8 @@ class _GalleryPresenter public: virtual ~_GalleryPresenter(void); - static _GalleryPresenter* CreateGalleryPresenterN(_IGalleryRenderer& galleryRenderer, _GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor); + static _GalleryPresenter* CreateGalleryPresenterN(_IGalleryRenderer& galleryRenderer, + _GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor, _Gallery* pGalleryView); int GetCurrentItemIndex(void) const; result SetCurrentItemIndex(int index, bool eventFire = true); @@ -109,6 +111,8 @@ public: bool ClickedItem(void); bool ChangedItem(void); + int SearchCanvasIndex(int itemIndex); + // model access result RequestToLoadItem(int index); result RequestToUnloadItem(int index); @@ -140,10 +144,9 @@ public: virtual void OnFontInfoRequested(unsigned long& style, int& size); - protected: _GalleryPresenter(_IGalleryRenderer& galleryRenderer); - result Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor); + result Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor, _Gallery* pGalleryView); // property getter/setter Variant GetPropertySlideShowViewDuration(void) const; @@ -161,7 +164,6 @@ private: result SetCanvasImage(int itemIndex); result SetPartialCanvasImage(void); - int SearchCanvasIndex(int itemIndex); int GetEmptyCanvasIndex(void) const; result SetCanvasIndex(int canvasIndex, int itemIndex); int ClearCanvasIndex(int currentItemIndex); @@ -200,6 +202,8 @@ private: int __emptyFontSize; Tizen::Graphics::FontStyle __emptyFontStyle; + _Gallery* __pGalleryView; + friend class _GalleryViewEventHandler; }; // _GalleryPresenter diff --git a/src/ui/inc/FUiCtrl_GalleryRenderer.h b/src/ui/inc/FUiCtrl_GalleryRenderer.h old mode 100644 new mode 100755 index 645a038..0152665 --- a/src/ui/inc/FUiCtrl_GalleryRenderer.h +++ b/src/ui/inc/FUiCtrl_GalleryRenderer.h @@ -24,7 +24,7 @@ namespace Tizen { namespace Graphics { class Color; -class Rectangle; +class FloatRectangle; }} namespace Tizen { namespace Ui { @@ -61,7 +61,7 @@ public: virtual result SetCanvasVisibility(int canvasIndex, bool visibility); virtual bool IsCanvasVisibility(int canvasIndex) const; virtual result SetCanvasShowState(int canvasIndex, bool showState); - virtual Tizen::Graphics::Rectangle GetViewRect(void) const; + virtual Tizen::Graphics::FloatRectangle GetViewRect(void) const; virtual result SetEmptyImage(const _GalleryBitmap* pImage); virtual result SetEmptyText(const Tizen::Base::String& pText); virtual result EnableEmptyView(void); @@ -69,12 +69,12 @@ public: virtual result SetCanvasImage(int canvasIndex, const _GalleryBitmap* pImage , _GalleryVerticalAlignment imageVerticalAlignment, _GalleryHorizontalAlignment imageHorizontalAlignment , _GalleryFittingType fittingType); - virtual result SetCanvasBounds(int canvasIndex, const Tizen::Graphics::Rectangle& bounds, + virtual result SetCanvasBounds(int canvasIndex, const Tizen::Graphics::FloatRectangle& bounds, const _GalleryAnimationTiming* pAnimation = null); - virtual Tizen::Graphics::Rectangle GetCanvasBounds(int canvasIndex) const; - virtual Tizen::Graphics::Rectangle GetCanvasAlignBoundary(int canvasIndex) const; - virtual result SetCanvasImageBounds(int canvasIndex, const Tizen::Graphics::Rectangle& bounds); - virtual Tizen::Graphics::Rectangle GetCanvasImageBounds(int canvasIndex) const; + virtual Tizen::Graphics::FloatRectangle GetCanvasBounds(int canvasIndex) const; + virtual Tizen::Graphics::FloatRectangle GetCanvasAlignBoundary(int canvasIndex) const; + virtual result SetCanvasImageBounds(int canvasIndex, const Tizen::Graphics::FloatRectangle& bounds); + virtual Tizen::Graphics::FloatRectangle GetCanvasImageBounds(int canvasIndex) const; virtual result RunCanvasTransition(int startCanvasIndex, int endCanvasIndex, _GalleryTransitionType transition, const _GalleryAnimationTiming* pAnimation = null); virtual void StopAllCanvasAnimation(void); diff --git a/src/ui/inc/FUiCtrl_GalleryViewEventHandler.h b/src/ui/inc/FUiCtrl_GalleryViewEventHandler.h old mode 100644 new mode 100755 index c6fe7e9..5260491 --- a/src/ui/inc/FUiCtrl_GalleryViewEventHandler.h +++ b/src/ui/inc/FUiCtrl_GalleryViewEventHandler.h @@ -24,7 +24,7 @@ namespace Tizen { namespace Graphics { -class Dimension; +class FloatDimension; }} // Tizen::Graphics @@ -72,7 +72,7 @@ public: bool IsZoomFlag(void) const; result SetVisibleCanvas(void); result AlignCanvas(bool animation = true); - bool CorrectCanvasPosition(Tizen::Graphics::Rectangle& canvasBounds, const Tizen::Graphics::Rectangle& imageBounds); + bool CorrectCanvasPosition(Tizen::Graphics::FloatRectangle& canvasBounds, const Tizen::Graphics::FloatRectangle& imageBounds); private: _GalleryViewEventHandler(const _GalleryViewEventHandler& rhs); @@ -85,9 +85,9 @@ private: result FlickToTheRight(void); result FlickToTheLeft(void); - result ZoomCanvas(int distance, const Tizen::Graphics::Point& center, bool zoomIn, _GalleryAnimationTiming* pAnimation = null); - result PinchZoomCanvas(int area, const Tizen::Graphics::Point& center, bool zoomIn); - result MoveCanvas(const Tizen::Graphics::Dimension& distance, _GalleryAnimationTiming* pAnimation = null); + result ZoomCanvas(float distance, const Tizen::Graphics::FloatPoint& center, bool zoomIn, _GalleryAnimationTiming* pAnimation = null); + result PinchZoomCanvas(int area, const Tizen::Graphics::FloatPoint& center, bool zoomIn); + result MoveCanvas(const Tizen::Graphics::FloatDimension& distance, _GalleryAnimationTiming* pAnimation = null); void SetRollbackCanvas(void); int CalculateRound(float value); @@ -98,8 +98,8 @@ private: _GalleryPresenter& __galleryPresenter; _IGalleryRenderer& __galleryRenderer; _GalleryImageReader& __galleryImageReader; - Tizen::Graphics::Point __previousPosition; - Tizen::Graphics::Point __startPinchCenterPosition; + Tizen::Graphics::FloatPoint __previousPosition; + Tizen::Graphics::FloatPoint __startPinchCenterPosition; FlickDirection __flickingDirection; int __pinchInitialArea; bool __pressed; diff --git a/src/ui/inc/FUiCtrl_GalleryViewEventInfo.h b/src/ui/inc/FUiCtrl_GalleryViewEventInfo.h old mode 100644 new mode 100755 index d4f9d5f..e5e2c46 --- a/src/ui/inc/FUiCtrl_GalleryViewEventInfo.h +++ b/src/ui/inc/FUiCtrl_GalleryViewEventInfo.h @@ -32,7 +32,7 @@ public: // touch Info access _TouchStatus GetTouchStatus(void) const; - Tizen::Graphics::Point GetCurrentPosition(void) const; + Tizen::Graphics::FloatPoint GetCurrentPosition(void) const; // flick info access void SetFlicked(bool flicked); @@ -43,8 +43,8 @@ public: int GetFlickTime(void) const; // pinch info access - void SetPinchCenterPosition(Tizen::Graphics::Point centerPos); - Tizen::Graphics::Point GetPinchCenterPosition(void) const; + void SetPinchCenterPosition(Tizen::Graphics::FloatPoint centerPos); + Tizen::Graphics::FloatPoint GetPinchCenterPosition(void) const; void SetPinchArea(int area); int GetPinchArea(void) const; @@ -61,7 +61,7 @@ private: Tizen::Graphics::Point __flickPosition; int __flickTime; - Tizen::Graphics::Point __pinchCenterPosition; + Tizen::Graphics::FloatPoint __pinchCenterPosition; int __PinchArea; }; // _GalleryViewEventInfo diff --git a/src/ui/inc/FUiCtrl_GroupContainer.h b/src/ui/inc/FUiCtrl_GroupContainer.h new file mode 100644 index 0000000..beef360 --- /dev/null +++ b/src/ui/inc/FUiCtrl_GroupContainer.h @@ -0,0 +1,160 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainer.h + * @brief This is the header file for the _GroupContainer class. + * + * This header file contains the declarations of the _GroupContainer class. + */ + +#ifndef _FUI_CTRL_INTERNAL_GROUP_CONTAINER_H_ +#define _FUI_CTRL_INTERNAL_GROUP_CONTAINER_H_ + +#include "FUi_Control.h" +#include "FUiCtrl_GroupContainerPresenter.h" + +namespace Tizen { namespace Ui { namespace Controls +{ + +class _GroupContainerPresenter; +class _GroupContainerImpl; + +class _GroupContainer + : public _Control + , virtual public Tizen::Base::Runtime::IEventListener + , virtual public _IUiEventListener + , virtual public _IUiEventPreviewer +{ + +public: + virtual ~_GroupContainer(void); + +public: + static _GroupContainer* CreateGroupContainerN(const Tizen::Graphics::FloatRectangle& rect, int rowCount, int columnCount, float lineWidth); + + result AddControlAt(Tizen::Ui::Control& control, int rowIndex, int columnIndex); + Tizen::Ui::Control* GetControlAt(int rowIndex, int columnIndex); + result RemoveControlAt(int rowIndex, int columnIndex); + result SetColumnWidth(int columnIndex, float width); + float GetColumnWidth(int columnIndex); + result SetRowHeight(int rowIndex, float height); + float GetRowHeight(int rowIndex); + result Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount); + result SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable); + result SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin); + Tizen::Graphics::FloatRectangle GetBoundsAt(int rowIndex, int columnIndex) const; + result Split(int rowIndex, int columnIndex); + result SetColumnStretchable(int columnIndex, bool stretchable); + bool IsColumnStretchable(int columnIndex); + result SetRowStretchable(int rowIndex, bool stretchable); + bool IsRowStretchable(int rowIndex); + void SetLineColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetLineColor(void); + + int GetRowCount(void); + int GetColumnCount(void); + bool IsMerged(int rowIndex, int columnIndex); + bool IsParent(int rowIndex, int columnIndex); + result ResizeControl(int rowIndex, int columnIndex); + int GetLineWidth(void); + void UpdateStretchableCellBounds(Tizen::Graphics::FloatRectangle gridRect, Tizen::Graphics::FloatRectangle controlRect); + Tizen::Graphics::FloatRectangle GetGridBounds(void); + Tizen::Ui::_Control* GetSystemChild(void); + void SetImpl(_GroupContainerImpl *pImpl); + +protected: + + _GroupContainer(void); + virtual result Initialize(const Tizen::Graphics::FloatRectangle& rect, int rows, int columns, float lineWidth); + +private: + _GroupContainer(const _GroupContainer& rhs); + _GroupContainer& operator =(const _GroupContainer& rhs); + + virtual void OnDraw(void); + virtual result OnAttachedToMainTree(void); + virtual void OnChildAttached(const Tizen::Ui::_Control& child); + virtual void OnChildDetached(const Tizen::Ui::_Control& child); + Tizen::Ui::_Control* GetControlCoreAt(int rowIndex, int columnIndex); + void CollapseCell(int rowIndex, int columnIndex, int rowStartIndex, int columnStartIndex); + bool HasChild(int rowIndex, int columnIndex); + Tizen::Graphics::Point GetLastChild(int rowIndex, int columnIndex); + + result SetChildPosition(Tizen::Ui::_Control& pControl, int rowIndex, int columnIndex, Tizen::Graphics::FloatPoint position); + result SetChildBounds(Tizen::Ui::_Control& pControl, int rowIndex, int columnIndex, Tizen::Graphics::FloatRectangle bounds); + virtual void OnChildBoundsChanged(const Tizen::Ui::_Control& child); + virtual void OnBoundsChanged(void); + +private: + + struct _CellMargin + { + float left; + float right; + float top; + float bottom; + }; + struct _MergeCellIndex + { + int row; + int column; + }; + + struct _CellInfo + { + Tizen::Graphics::FloatRectangle cellBounds; + Tizen::Graphics::FloatDimension actualSize; + _MergeCellIndex parentCell; + _CellMargin cellMargin; + bool isResizeEnabled; + bool isMerged; + _ControlHandle controlHandle; + bool isParent; + int mergedRowCount; + int mergedColumnCount; + bool isBoundsModified; + Tizen::Graphics::FloatPoint childControlPos; + }; + + _CellInfo** __pCellsArray; + _GroupContainerImpl* __pGroupContainerImpl; + _GroupContainerPresenter* __pGroupContainerPresenter; + + int __rowCount; + int __columnCount; + int __childAttachedRowIndex; + int __childAttachedColumnIndex; + float __lineWidth; + Tizen::Graphics::Color __lineColor; + bool __isChildAdding; + + + bool* __pStretchableRowIndex; + bool* __pStretchableColumnIndex; + _Control* __pSystemControl; + + _MergeCellIndex GetParentCell(const Tizen::Ui::_Control& child); + +}; // _GroupContainer + + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_INTERNAL_GROUP_CONTAINER_H_ + + diff --git a/src/ui/inc/FUiCtrl_GroupContainerImpl.h b/src/ui/inc/FUiCtrl_GroupContainerImpl.h new file mode 100644 index 0000000..35244da --- /dev/null +++ b/src/ui/inc/FUiCtrl_GroupContainerImpl.h @@ -0,0 +1,93 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainerImpl.h + * @brief This is the header file for the _GroupContainerImpl class. + * + * This header file contains the declarations of the _GroupContainerImpl class. + */ + +#ifndef _FUI_CTRL_INTERNAL_GROUP_CONTAINER_IMPL_H_ +#define _FUI_CTRL_INTERNAL_GROUP_CONTAINER_IMPL_H_ + +#include +#include "FUi_ContainerImpl.h" +#include "FUiCtrl_GroupContainer.h" + +namespace Tizen { namespace Ui +{ +class DataBindingContext; +}} // Tizen::Ui + +namespace Tizen { namespace Ui { namespace Controls +{ + +class _GroupContainerImpl + : public _ContainerImpl +{ + +// Life Cycle +public: + virtual ~_GroupContainerImpl(void); + + static _GroupContainerImpl* CreateGroupContainerImplN(GroupContainer* pControl, const Tizen::Graphics::FloatRectangle& rect, int rowCount, int columnCount, float lineWidth); + void Initialize(void); + //Accessor + + static const _GroupContainerImpl* GetInstance(const GroupContainer& grpContainer); + static _GroupContainerImpl* GetInstance(GroupContainer& grpContainer); + + virtual const char* GetPublicClassName(void) const; + virtual const GroupContainer& GetPublic(void) const; + virtual GroupContainer& GetPublic(void); + virtual const _GroupContainer& GetCore(void) const; + virtual _GroupContainer& GetCore(void); + + result AddControlAt(Control& control, int rowIndex, int columnIndex); + Tizen::Ui::Control* GetControlAt(int rowIndex, int columnIndex); + result RemoveControlAt(int rowIndex, int columnIndex); + result SetColumnWidth(int columnIndex, float width); + float GetColumnWidth(int columnIndex); + result SetRowHeight(int rowIndex, float rowHeight); + float GetRowHeight(int rowIndex); + result Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount); + result SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable); + result SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin); + result Split(int rowIndex, int columnIndex); + Tizen::Graphics::FloatRectangle GetBoundsAt(int rowIndex, int columnIndex) const; + result SetColumnStretchable(int columnIndex, bool stretchable); + bool IsColumnStretchable(int columnIndex); + result SetRowStretchable(int rowIndex, bool stretchable); + bool IsRowStretchable(int rowIndex); + void SetLineColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetLineColor(void); + +protected: + _GroupContainerImpl(Control* pPublic, _Control* pCore); + +private: + + _GroupContainerImpl(const _GroupContainerImpl& rhs); + _GroupContainerImpl& operator = (const _GroupContainerImpl& rhs); + +}; // _GroupContainerImpl + +}}} //Tizen::Ui::Controls + +#endif //_FUI_CTRL_INTERNAL_GROUP_CONTAINER_IMPL_H_ + diff --git a/src/ui/inc/FUiCtrl_GroupContainerPresenter.h b/src/ui/inc/FUiCtrl_GroupContainerPresenter.h new file mode 100644 index 0000000..d29047c --- /dev/null +++ b/src/ui/inc/FUiCtrl_GroupContainerPresenter.h @@ -0,0 +1,67 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* + * @file FUiCtrl_GroupContainerPresenter.h + * @brief This is the header file for the _GroupContainerPresenter class. + * + * This header file contains the declarations of the %_GroupContainerPresenter class. + */ + +#ifndef _FUI_CTRL_INTERNAL_GROUP_CONTAINER_PRESENTER_H_ +#define _FUI_CTRL_INTERNAL_GROUP_CONTAINER_PRESENTER_H_ + +#include +#include "FUiCtrl_GroupContainer.h" + +namespace Tizen { namespace Ui { namespace Controls +{ +class _GroupContainer; + +class _GroupContainerPresenter + : public Tizen::Base::Object +{ +public: + _GroupContainerPresenter(void); + _GroupContainerPresenter(_GroupContainer& GroupContainer); + virtual ~_GroupContainerPresenter(void); + +public: + + void Draw(void); + result LoadResourceBitmaps(void); + +private: + _GroupContainerPresenter(const _GroupContainerPresenter& rhs); + _GroupContainerPresenter& operator =(const _GroupContainerPresenter& rhs); + void DrawBackgroundBitmapForSystemChild(Tizen::Graphics::Canvas* pCanvas); + void DrawBackgroundEffectBitmapForSystemChild(Tizen::Graphics::Canvas* pCanvas); + + +private: + static const int BORDER_LINE_WIDTH = 1; + _GroupContainer* __pGroupContainer; + Tizen::Graphics::Bitmap* __pBgBitmap; + Tizen::Graphics::Bitmap* __pBgEffectBitmap; + Tizen::Graphics::Bitmap* __pBgColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pBgEffectColorReplacementBitmap; +}; // _GroupContainerPresenter; + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_INTERNAL_GROUP_CONTAINER_PRESENTER_H_ + diff --git a/src/ui/inc/FUiCtrl_GroupItemImpl.h b/src/ui/inc/FUiCtrl_GroupItemImpl.h index 47f8166..ffa41e5 100644 --- a/src/ui/inc/FUiCtrl_GroupItemImpl.h +++ b/src/ui/inc/FUiCtrl_GroupItemImpl.h @@ -38,7 +38,7 @@ class _GroupItemImpl { // Lifecycle public: - static _GroupItemImpl* CreateGroupItemImpN(GroupItem* pPublic, const Tizen::Graphics::Dimension& itemSize); + static _GroupItemImpl* CreateGroupItemImpN(GroupItem* pPublic, const Tizen::Graphics::FloatDimension& itemSize); virtual ~_GroupItemImpl(void); @@ -46,7 +46,7 @@ public: public: virtual const char* GetPublicClassName(void) const; - result Construct(const Tizen::Graphics::Dimension& itemSize); + result Construct(const Tizen::Graphics::FloatDimension& itemSize); result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap); @@ -58,9 +58,9 @@ public: Tizen::Graphics::Color GetTextColor(void) const; - result SetTextSize(int size); + result SetTextSize(float size); - int GetTextSize(void) const; + float GetTextSize(void) const; result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null); @@ -80,7 +80,7 @@ private: // Attribute private: static const float GROUP_ITEM_ELEMENT_BITMAP_SIZE_RATIO = 0.6f; - int __textSize; + float __textSize; Tizen::Graphics::Color __textColor; }; // _GroupItemImpl diff --git a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h index c3d04e0..fe1b108 100644 --- a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h +++ b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h @@ -26,11 +26,14 @@ #ifndef _FUI_CTRL_GROUPED_LIST_VIEW_IMPL_H_ #define _FUI_CTRL_GROUPED_LIST_VIEW_IMPL_H_ +#include #include "FUi_ControlImpl.h" -#include "FUi_TouchEventArg.h" +#include "FUi_ITouchLongPressGestureEventListener.h" +#include "FUi_TouchLongPressGestureDetector.h" #include "FUiCtrl_IFastScrollListener.h" #include "FUiCtrl_IScrollEventListener.h" #include "FUiCtrl_IUiListViewItemEventListener.h" +#include "FUiCtrl_ListViewTouchEventHandler.h" #include "FUiCtrl_TableView.h" namespace Tizen { namespace Ui { namespace Controls @@ -47,6 +50,7 @@ class _ScrollEvent; class _GroupedListViewImpl : public _ControlImpl , public _ITableViewItemEventListener + , public _ITouchLongPressGestureEventListener , public _IScrollEventListener , public _IUiFastScrollListener , public _IUiListViewItemEventListener @@ -71,6 +75,8 @@ public: public: result SetItemProvider(IGroupedListViewItemProvider& provider); + result SetItemProvider(IGroupedListViewItemProviderF& provider); + void AddGroupedListViewItemEventListener(IGroupedListViewItemEventListener& listener); void RemoveGroupedListViewItemEventListener(IGroupedListViewItemEventListener& listener); @@ -81,8 +87,12 @@ public: void AddScrollEventListener(IScrollEventListener& listener); + void AddScrollEventListener(IScrollEventListenerF& listener); + void RemoveScrollEventListener(IScrollEventListener& listener); + void RemoveScrollEventListener(IScrollEventListenerF& listener); + void AddUiLinkEventListener(const Tizen::Ui::IUiLinkEventListener& listener); void RemoveUiLinkEventListener(const Tizen::Ui::IUiLinkEventListener& listener); @@ -121,8 +131,12 @@ public: result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; + result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex, int& elementId) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex, int& elementId) const; + result SetSectionColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetSectionColor(void) const; @@ -151,18 +165,24 @@ public: bool IsGroupExpanded(int groupIndex) const; + result ExpandAllGroups(void); + + result CollapseAllGroups(void); + result BeginReorderingMode(void); result EndReorderingMode(void); bool IsInReorderingMode(void) const; + void SetScrollInputMode(ScrollInputMode mode); + + ScrollInputMode GetScrollInputMode(void) const; + // _IUiListViewItemEventListener virtual void OnListViewContextItemStateChanged(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status); - virtual void OnListViewItemLongPressed(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId); - // _ITableViewItemEventListener virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) {}; @@ -196,7 +216,7 @@ public: // _IScrollEventListener virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition); virtual void OnScrollStopped(Tizen::Ui::_Control& source); @@ -211,6 +231,8 @@ public: virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); + virtual bool OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo); @@ -219,8 +241,15 @@ public: virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo); + virtual bool OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture); + + virtual bool OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture); + + bool GetInputEventConsumeState(void); + public: static _GroupedListViewImpl* GetInstance(GroupedListView& groupedListView); + static const _GroupedListViewImpl* GetInstance(const GroupedListView& groupedListView); private: @@ -239,13 +268,9 @@ private: void FireListViewItemEvent(int groupIndex, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status); - void FirePublicTouchEvent(const _TouchInfo& touchInfo); - - void FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); + virtual result OnTouchEventListenerAdded(void); - void FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); - - _TouchEventArg* GetTouchEventArgN(const _TouchInfo& touchInfo); + virtual result OnTouchEventListenerRemoved(void); private: _ListItemEvent* __pListItemEvent; @@ -259,7 +284,9 @@ private: bool __redrawListView; _ListViewItem* __pItemNeedsLazyDeletion; - _ListViewItem* __pItemSwept; + + _ListViewTouchEventHandler* __pTouchEventHandler; + _TouchLongPressGestureDetector* __pLongPressedGesture; }; // _GroupedListViewImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_GroupedListViewItemProviderAdaptor.h b/src/ui/inc/FUiCtrl_GroupedListViewItemProviderAdaptor.h index ecec65f..79dd852 100644 --- a/src/ui/inc/FUiCtrl_GroupedListViewItemProviderAdaptor.h +++ b/src/ui/inc/FUiCtrl_GroupedListViewItemProviderAdaptor.h @@ -27,6 +27,7 @@ #include #include +#include #include "FUiCtrl_IUiListViewItemEventListener.h" #include "FUiCtrl_LinkedList.h" #include "FUiCtrl_ListViewTypes.h" @@ -45,11 +46,13 @@ class _GroupedListViewItemProviderAdaptor public: // Lifecycle _GroupedListViewItemProviderAdaptor(const IGroupedListViewItemProvider& provider); + _GroupedListViewItemProviderAdaptor(const IGroupedListViewItemProviderF& provider); virtual ~_GroupedListViewItemProviderAdaptor(void); // Operation void SetItemProvider(const IGroupedListViewItemProvider& provider); + void SetItemProvider(const IGroupedListViewItemProviderF& provider); virtual _IListItemCommon* LoadItem(int groupIndex, int itemIndex); @@ -63,9 +66,9 @@ public: virtual int GetGroupCount(void) const; - virtual int GetDefaultItemHeight(void); + virtual float GetDefaultItemHeight(void); - virtual int GetDefaultGroupItemHeight(void); + virtual float GetDefaultGroupItemHeight(void); virtual bool IsReorderable(int groupIndexFrom, int groupIndexTo); @@ -91,16 +94,18 @@ private: // Variable private: IGroupedListViewItemProvider* __pGroupedListViewProvider; + IGroupedListViewItemProviderF* __pGroupedListViewProviderF; _LinkedList <_ListItemPos> __descriptionTextShowItem; _IUiListViewItemEventListener* __pEventListener; Tizen::Base::String __fontName; - int __groupItemAverageHeight; - int __itemAverageHeight; + float __groupItemAverageHeight; + float __itemAverageHeight; int __groupItemLoadedCount; int __itemLoadedCount; int __countOfAllGroups; int __countOfAllItems; _ListViewItem* __pItemNeedsLazyDeletion; + bool __usingFloatingPoint; }; // _GroupedListViewItemProviderAdaptor }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_HeaderImpl.h b/src/ui/inc/FUiCtrl_HeaderImpl.h index e2bf849..cf0773d 100644 --- a/src/ui/inc/FUiCtrl_HeaderImpl.h +++ b/src/ui/inc/FUiCtrl_HeaderImpl.h @@ -184,6 +184,12 @@ public: Tizen::Graphics::Rectangle GetButtonBounds(ButtonPosition position) const; + Tizen::Graphics::FloatRectangle GetButtonBoundsF(ButtonPosition position) const; + + result SetTitleBadgeIcon(const Tizen::Graphics::Bitmap* pBadgeIcon); + + result SetTitleNumberedBadgeIcon(int number); + void AddActionEventListener(Tizen::Ui::IActionEventListener& listener); void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener); diff --git a/src/ui/inc/FUiCtrl_HeaderItemImpl.h b/src/ui/inc/FUiCtrl_HeaderItemImpl.h index 4491bd2..ba09d43 100644 --- a/src/ui/inc/FUiCtrl_HeaderItemImpl.h +++ b/src/ui/inc/FUiCtrl_HeaderItemImpl.h @@ -65,6 +65,7 @@ public: result SetText(const Tizen::Base::String& text); + void SetAccessibilityHint(const Tizen::Base::String& hint); private: _HeaderItemImpl(const _HeaderItemImpl& headerItem); @@ -75,6 +76,7 @@ private: private: int __actionId; Tizen::Base::String __itemText; + Tizen::Base::String __accessibilityHint; const Tizen::Graphics::Bitmap* __pIconBitmap[HEADER_ITEM_MAX_STATE_COUNT]; const Tizen::Graphics::Bitmap* __pHeaderItemBackgroundBitmap[HEADER_ITEM_MAX_STATE_COUNT]; diff --git a/src/ui/inc/FUiCtrl_IActionEventListener.h b/src/ui/inc/FUiCtrl_IActionEventListener.h index 5c4515b..b422482 100644 --- a/src/ui/inc/FUiCtrl_IActionEventListener.h +++ b/src/ui/inc/FUiCtrl_IActionEventListener.h @@ -39,7 +39,7 @@ namespace Tizen {namespace Ui { namespace Controls /** * @interface _IActionEventListener * @brief This interface implements the listener for _action event. - * @since 1.0 + * @since 2.0 * * The listener interface for receiving the action events. The class that processes an action event * implements this interface, and the object created with that class is registered with a _control, using the _control's @@ -52,14 +52,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IActionEventListener(void) {} /** * Notifies when an action event occurs. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @param[in] actionId The information about the action event */ diff --git a/src/ui/inc/FUiCtrl_IAdjustmentEventListener.h b/src/ui/inc/FUiCtrl_IAdjustmentEventListener.h index 5a0658a..1b51561 100644 --- a/src/ui/inc/FUiCtrl_IAdjustmentEventListener.h +++ b/src/ui/inc/FUiCtrl_IAdjustmentEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_IAdjustmentEventListener.h * @brief This is the header file for the _IAdjustmentEventListener class. @@ -39,7 +40,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _IAdjustmentEventListener * @brief This interface implements the listener for adjustment events. - * @since 1.0 + * @since 2.0 * * The _IAdjustmentEventListener interface receives adjustment events which are fired when the knob of a Slider moves. The class that is * interested in processing an adjustment event implements this interface, and the object created with that class @@ -54,14 +55,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IAdjustmentEventListener(void) {} /** * Notifies when a change event occurs. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @param[in] adjustment The adjustment value */ diff --git a/src/ui/inc/FUiCtrl_IAnimationEventListener.h b/src/ui/inc/FUiCtrl_IAnimationEventListener.h index a2ddadc..8e3d40a 100644 --- a/src/ui/inc/FUiCtrl_IAnimationEventListener.h +++ b/src/ui/inc/FUiCtrl_IAnimationEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_IAnimationEventListener.h * @brief This is the header file for the _IAnimationEventListener class. @@ -39,7 +40,7 @@ namespace Tizen {namespace Ui { namespace Controls /** * @interface _IAnimationEventListener * @brief This interface implements the listener for animation event. - * @since 2.0 + * @since 2.1 * * The listener interface for receiving the animation events. The class that processes an animation event * implements this interface, and the object created with that class is registered with a _control, using the _control's @@ -52,14 +53,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IAnimationEventListener(void) {} /** * Notifies when an animation event occurs. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnAnimationStopped(const Tizen::Ui::_Control& source) = 0; diff --git a/src/ui/inc/FUiCtrl_IColorChangeEventListener.h b/src/ui/inc/FUiCtrl_IColorChangeEventListener.h index e4e09db..b02ceb0 100644 --- a/src/ui/inc/FUiCtrl_IColorChangeEventListener.h +++ b/src/ui/inc/FUiCtrl_IColorChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_IColorChangeEventListener.h * @brief This is the header file for the _IColorChangeEventListener class. @@ -44,7 +45,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _IColorChangeEventListener * @brief This interface implements the listener for color change events. - * @since 2.0 + * @since 2.1 * * This is the listener interface for receiving color change events. The class that processes a color change event * implements this interface, and the object created with that class is registered with a UI control, using the control's @@ -58,14 +59,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IColorChangeEventListener(void) {} /** * Notifies when there is a change in Color. The color instance is passed as an input parameter. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @param[in] color The color */ diff --git a/src/ui/inc/FUiCtrl_IContextMenuPresenter.h b/src/ui/inc/FUiCtrl_IContextMenuPresenter.h index 5ccc9dd..99b1f6b 100644 --- a/src/ui/inc/FUiCtrl_IContextMenuPresenter.h +++ b/src/ui/inc/FUiCtrl_IContextMenuPresenter.h @@ -88,14 +88,14 @@ public: virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) = 0; virtual void OnFontChanged(Tizen::Graphics::Font* pFont) = 0; - virtual void OnFontInfoRequested(unsigned long& style, int& size) =0; + virtual void OnFontInfoRequested(unsigned long& style, float& size) = 0; virtual void SetAllAccessibilityElement(void) = 0; - virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::Point& position) = 0; + virtual _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) = 0; virtual _ContextMenuItemInfo FindItem(int index) = 0; virtual result SetTopDrawnItemIndex(int index) = 0; - virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) = 0; + virtual result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap) = 0; }; //_IContextMenuPresenter } // Control diff --git a/src/ui/inc/FUiCtrl_ICustomElement.h b/src/ui/inc/FUiCtrl_ICustomElement.h index 3ea922d..d7817a4 100644 --- a/src/ui/inc/FUiCtrl_ICustomElement.h +++ b/src/ui/inc/FUiCtrl_ICustomElement.h @@ -36,7 +36,7 @@ class _ICustomElement public: virtual ~_ICustomElement(void) {} - virtual bool DrawElement(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& rect, ListViewItemDrawingStatus status) = 0; + virtual bool DrawElement(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::FloatRectangle& rect, ListViewItemDrawingStatus status) = 0; }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_IDateTimeChangeEventListener.h b/src/ui/inc/FUiCtrl_IDateTimeChangeEventListener.h index 96e6643..af1e96f 100644 --- a/src/ui/inc/FUiCtrl_IDateTimeChangeEventListener.h +++ b/src/ui/inc/FUiCtrl_IDateTimeChangeEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_IDateTimeChangeEventListener.h * @brief This is the header file for the _IDateTimeChangeEventListener interface. @@ -37,7 +38,7 @@ namespace Tizen {namespace Ui { namespace Controls /** * @interface _IDateTimeChangeEventListener * @brief This interface implements the listener for Date and Time change events. - * @since 1.0 + * @since 2.0 * * The listener interface for receiving date and time change events. The class that processes date and time change event * implements this interface, and the object created with that class is registered with a UI control, using the control's @@ -51,14 +52,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IDateTimeChangeEventListener(void) {} /** * Notifies when there is a change in DateTime . The changed values of day, month, year, hour and minute are passed as input parameters. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @param[in] year The year value * @param[in] month The month value @@ -73,7 +74,7 @@ public: /** * Notifies when date and time change is canceled. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnDateTimeChangeCanceled(const Tizen::Ui::_Control& source) = 0; diff --git a/src/ui/inc/FUiCtrl_IEditCopyPasteEventListener.h b/src/ui/inc/FUiCtrl_IEditCopyPasteEventListener.h old mode 100644 new mode 100755 index 5878897..0d3bc4d --- a/src/ui/inc/FUiCtrl_IEditCopyPasteEventListener.h +++ b/src/ui/inc/FUiCtrl_IEditCopyPasteEventListener.h @@ -44,7 +44,9 @@ enum CoreCopyPasteAction CORE_COPY_PASTE_ACTION_SELECT_ALL, CORE_COPY_PASTE_ACTION_COPY, CORE_COPY_PASTE_ACTION_CUT, - CORE_COPY_PASTE_ACTION_PASTE + CORE_COPY_PASTE_ACTION_PASTE, + CORE_COPY_PASTE_ACTION_SEARCH, + CORE_COPY_PASTE_ACTION_CLIPBOARD }; /** diff --git a/src/ui/inc/FUiCtrl_IEditTextFilter.h b/src/ui/inc/FUiCtrl_IEditTextFilter.h new file mode 100644 index 0000000..89b2033 --- /dev/null +++ b/src/ui/inc/FUiCtrl_IEditTextFilter.h @@ -0,0 +1,120 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrl_IEditTextFilter.h + * @brief This is the header file for the %_IEditTextFilter interface. + * + * This header file contains the declarations of the %_IEditTextFilter interface. + * + */ +#ifndef _FUI_CTRL_INTERNAL_IEDIT_TEXT_FILTER_H_ +#define _FUI_CTRL_INTERNAL_IEDIT_TEXT_FILTER_H_ + +#include + +namespace Tizen {namespace Ui { namespace Controls +{ + +/** + * @interface _IEditTextFilter + * @brief This interface defines the text filter. + * + * @since 2.1 + * + * The %_IEditTextFilter interface is the listener interface for handling texts, for example, from EditFields. + * The class that processes a text event implements this interface, and the instance created with that class is registered with a + * UI control, using the control's SetEditTextFilter() method. + * + */ + +class _OSP_EXPORT_ _IEditTextFilter +{ +public: + /** + * This polymorphic destructor should be overridden if required. + * This way, the destructors of the derived classes are called + * when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~_IEditTextFilter(void) {} + + /** + * Checks whether the pasted text by the %Clipboard must be replaced + * + * @since 2.1 + * + * @return @c true if the pasted text needs to be replaced, @n + * else @c false + * @param[in] pastedText The pasted text + * @param[out] replacedText The user-defined replacement text + */ + virtual bool ValidatePastedText(const Tizen::Base::String& pastedText, Tizen::Base::String& replacedText) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void _IEditTextFilter_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void _IEditTextFilter_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void _IEditTextFilter_Reserved3(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void _IEditTextFilter_Reserved4(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without + // prior notice. + // + virtual void _IEditTextFilter_Reserved5(void) {} +}; // _IEditTextFilter + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_INTERNAL_IEDIT_TEXT_FILTER_H_ + + diff --git a/src/ui/inc/FUiCtrl_IExpandableEditAreaEventListener.h b/src/ui/inc/FUiCtrl_IExpandableEditAreaEventListener.h index 484355b..84501d5 100644 --- a/src/ui/inc/FUiCtrl_IExpandableEditAreaEventListener.h +++ b/src/ui/inc/FUiCtrl_IExpandableEditAreaEventListener.h @@ -41,7 +41,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _IExpandableEditAreaEventListener * @brief This interface implements the listener for _kmjaction event. - * @since 2.0 + * @since 2.1 * * The interface provides a listener to receive events related to ExpandableEditArea. * @@ -55,7 +55,7 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IExpandableEditAreaEventListener(void) {} diff --git a/src/ui/inc/FUiCtrl_IFormActivationChangeEventListener.h b/src/ui/inc/FUiCtrl_IFormActivationChangeEventListener.h index a5dfac2..6f4243b 100644 --- a/src/ui/inc/FUiCtrl_IFormActivationChangeEventListener.h +++ b/src/ui/inc/FUiCtrl_IFormActivationChangeEventListener.h @@ -36,7 +36,7 @@ class _FormImpl; /** * @interface _IFormActivationChangeEventListener * @brief This interface implements the listener for the form activation chage event. - * @since 1.0 + * @since 2.0 * * The listener interface for receiving form activation chage event. * @@ -49,7 +49,7 @@ public: * This is internal. If used in an application, the application can get rejected during the certification process. * This is the virtual destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IFormActivationChangeEventListener(void) {} diff --git a/src/ui/inc/FUiCtrl_IFrameEventListener.h b/src/ui/inc/FUiCtrl_IFrameEventListener.h index 9d3f91f..54b805d 100644 --- a/src/ui/inc/FUiCtrl_IFrameEventListener.h +++ b/src/ui/inc/FUiCtrl_IFrameEventListener.h @@ -36,7 +36,7 @@ class _Frame; /** * @interface _IFrameEventListener * @brief This interface implements the listener for the frame lifecycle event. - * @since 1.0 + * @since 2.0 * * The listener interface for receiving frame lifecycle events. * @@ -48,12 +48,14 @@ public: /** * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. * - * @since 1.0 + * @since 2.0 */ virtual ~_IFrameEventListener(void) {} virtual void OnFrameActivated(const Tizen::Ui::Controls::_Frame& source) = 0; virtual void OnFrameDeactivated(const Tizen::Ui::Controls::_Frame& source) = 0; + virtual void OnFrameMinimized(const Tizen::Ui::Controls::_Frame& source) = 0; + virtual void OnFrameRestored(const Tizen::Ui::Controls::_Frame& source) = 0; }; // _IFrameEventListener diff --git a/src/ui/inc/FUiCtrl_IGalleryRenderer.h b/src/ui/inc/FUiCtrl_IGalleryRenderer.h old mode 100644 new mode 100755 index f78c488..de22052 --- a/src/ui/inc/FUiCtrl_IGalleryRenderer.h +++ b/src/ui/inc/FUiCtrl_IGalleryRenderer.h @@ -45,7 +45,7 @@ public: virtual result SetCanvasVisibility(int canvasIndex, bool visibility) = 0; virtual result SetCanvasShowState(int canvasIndex, bool showState) = 0; virtual bool IsCanvasVisibility(int canvasIndex) const = 0; - virtual Tizen::Graphics::Rectangle GetViewRect(void) const = 0; + virtual Tizen::Graphics::FloatRectangle GetViewRect(void) const = 0; virtual result SetEmptyImage(const _GalleryBitmap* pImage) = 0; virtual result SetEmptyText(const Tizen::Base::String& pText) = 0; virtual result EnableEmptyView(void) = 0; @@ -53,12 +53,12 @@ public: virtual result SetCanvasImage(int canvasIndex, const _GalleryBitmap* pImage , _GalleryVerticalAlignment imageVerticalAlignment, _GalleryHorizontalAlignment imageHorizontalAlignment , _GalleryFittingType fittingType) = 0; - virtual result SetCanvasBounds(int canvasIndex, const Tizen::Graphics::Rectangle& bounds, + virtual result SetCanvasBounds(int canvasIndex, const Tizen::Graphics::FloatRectangle& bounds, const _GalleryAnimationTiming* pAnimation = null) = 0; - virtual Tizen::Graphics::Rectangle GetCanvasBounds(int canvasIndex) const = 0; - virtual Tizen::Graphics::Rectangle GetCanvasAlignBoundary(int canvasIndex) const = 0; - virtual result SetCanvasImageBounds(int canvasIndex, const Tizen::Graphics::Rectangle& bounds) = 0; - virtual Tizen::Graphics::Rectangle GetCanvasImageBounds(int canvasIndex) const = 0; + virtual Tizen::Graphics::FloatRectangle GetCanvasBounds(int canvasIndex) const = 0; + virtual Tizen::Graphics::FloatRectangle GetCanvasAlignBoundary(int canvasIndex) const = 0; + virtual result SetCanvasImageBounds(int canvasIndex, const Tizen::Graphics::FloatRectangle& bounds) = 0; + virtual Tizen::Graphics::FloatRectangle GetCanvasImageBounds(int canvasIndex) const = 0; virtual result RunCanvasTransition(int startCanvasIndex, int endCanvasIndex, _GalleryTransitionType transition, const _GalleryAnimationTiming* pAnimation = null) = 0; virtual void StopAllCanvasAnimation(void) = 0; diff --git a/src/ui/inc/FUiCtrl_IIconListItemEventListener.h b/src/ui/inc/FUiCtrl_IIconListItemEventListener.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_IInputPadEventListener.h b/src/ui/inc/FUiCtrl_IInputPadEventListener.h index 3bd4c0f..38c62ce 100644 --- a/src/ui/inc/FUiCtrl_IInputPadEventListener.h +++ b/src/ui/inc/FUiCtrl_IInputPadEventListener.h @@ -16,10 +16,10 @@ // /** - * @file FUiCtrl_IInputPadEventListener.h - * @brief This is the header file for the _IInputPadEventListener class. + * @file FUiCtrlIInputPadEventListener.h + * @brief This is the header file for the IInputPadEventListener class. * - * This header file contains the declarations of the _IInputPadEventListener class. + * This header file contains the declarations of the IInputPadEventListener class. * If a change event is generated, a method of this class is called. * Applications that do jobs related to change events call the methods of this class. * diff --git a/src/ui/inc/FUiCtrl_IKeypadEventListener.h b/src/ui/inc/FUiCtrl_IKeypadEventListener.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_ILanguageEventListener.h b/src/ui/inc/FUiCtrl_ILanguageEventListener.h old mode 100644 new mode 100755 index fb5dc36..48c6ca2 --- a/src/ui/inc/FUiCtrl_ILanguageEventListener.h +++ b/src/ui/inc/FUiCtrl_ILanguageEventListener.h @@ -37,7 +37,7 @@ namespace Tizen { namespace Ui { namespace Controls * This is internal. If used in an application, the application can get rejected during the certification process. * @interface ILanguageEventListener * @brief This interface implements the listener for the language event. - * @since 1.0 + * @since 2.0 * * The ILanguageEventListener interface receives language events. The class that processes a language event * implements this interface, and the instance created with that class is registered with a UI control, using the control's @@ -59,7 +59,7 @@ public: * @if PRIVCORE * This is the default constructor for this class. * - * @since 1.0 + * @since 2.0 */ _ILanguageEventListener(void) {}; @@ -68,7 +68,7 @@ public: * This is internal. If used in an application, the application can get rejected during the certification process. * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_ILanguageEventListener(void) {} @@ -76,7 +76,7 @@ public: * @if PRIVCORE * Notifies when the input language is changed. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @param[in] previousLanguage The previous input language * @param[in] currentLanguage The current input language diff --git a/src/ui/inc/FUiCtrl_IListItemCommon.h b/src/ui/inc/FUiCtrl_IListItemCommon.h index 48f4535..88c164a 100644 --- a/src/ui/inc/FUiCtrl_IListItemCommon.h +++ b/src/ui/inc/FUiCtrl_IListItemCommon.h @@ -51,8 +51,6 @@ class _IListItemCommon public: virtual ~_IListItemCommon(void) {}; - virtual bool DrawItem(Tizen::Graphics::Rectangle& rcItem, ListItemState isFocused, bool itemDivider = false) = 0; - virtual int GetItemHeight(void) const = 0; virtual void SetItemHeight(int itemHeight) = 0; diff --git a/src/ui/inc/FUiCtrl_IProgressPopupEventListener.h b/src/ui/inc/FUiCtrl_IProgressPopupEventListener.h index 5acbc5a..9763641 100644 --- a/src/ui/inc/FUiCtrl_IProgressPopupEventListener.h +++ b/src/ui/inc/FUiCtrl_IProgressPopupEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_IProgressPopupEventListener.h * @brief This is the header file for the _IProgressPopupEventListener class. @@ -42,7 +43,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _IProgressPopupEventListener * @brief This interface implements the listener for ProgressPopup event. - * @since 2.0 + * @since 2.1 * * The listener interface for receiving event to close the ProgressPopup. The class that processes a ProgressPopup event * implements this interface, and the instance created with that class is registered with a UI control, using the control's @@ -55,14 +56,14 @@ public: /** * This is the destructor for this class. * - * @since 2.0 + * @since 2.1 */ virtual ~_IProgressPopupEventListener(void) {} /** * Notifies when a ProgressPopup event occurs. * - * @since 2.0 + * @since 2.1 * @param[in] source The source of the event */ virtual void OnProgressPopupCanceled(void) = 0; diff --git a/src/ui/inc/FUiCtrl_IScrollEventListener.h b/src/ui/inc/FUiCtrl_IScrollEventListener.h index 1c58830..c044b94 100644 --- a/src/ui/inc/FUiCtrl_IScrollEventListener.h +++ b/src/ui/inc/FUiCtrl_IScrollEventListener.h @@ -73,14 +73,14 @@ public: virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type) = 0; /** - * Notifies when the scroll is scrolled by scroll bar. + * Called continuously when the control is being scrolled. * - * @since 2.0 + * @since 2.1 * * @param[in] source The source of the event - * @param[in] scrollPos The scrolled position + * @param[in] scrollPosition The scrolled position */ - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos) {}; + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition) {}; /** * Called when the control's scroll movement has come to a stop. @@ -91,6 +91,15 @@ public: */ virtual void OnScrollStopped(Tizen::Ui::_Control& source) {}; + /** + * Called when the control's scroll has requested jump to top. + * + * @since 2.1 + * + * @param[in] source The control's scroll + */ + virtual void OnScrollJumpToTop(Tizen::Ui::_Control& source) {}; + }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_IScrollPanelEventListener.h b/src/ui/inc/FUiCtrl_IScrollPanelEventListener.h index 02f03bc..e09e02d 100644 --- a/src/ui/inc/FUiCtrl_IScrollPanelEventListener.h +++ b/src/ui/inc/FUiCtrl_IScrollPanelEventListener.h @@ -16,7 +16,7 @@ // /** - * @file FUiCtrl_IScrollPanelEventListener.h + * @file FUi_IScrollPanelEventListener.h * @brief This is the header file for the _IScrollPanelEventListener class. * * This header file contains the declarations of the _IScrollPanelEventListener class. @@ -42,7 +42,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _IScrollPanelEventListener * @brief This interface implements a listener for ScrollPanel events. - * @since 1.0 + * @since 2.0 * * The interface implements a listener for receiving changes to the overlay keypad. The class that * displays and controls an overlay keypad implements this interface, and the instance created with @@ -56,14 +56,14 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_IScrollPanelEventListener(void) {} /** * Notifies when an overlay keypad is created on the ScrollPanel. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnOverlayControlCreated(const Tizen::Ui::_Control& source) = 0; @@ -71,7 +71,7 @@ public: /** * Notifies when an overlay keypad is opened on the ScrollPanel. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnOverlayControlOpened(const Tizen::Ui::_Control& source) = 0; @@ -79,7 +79,7 @@ public: /** * Notifies when an overlay keypad is closed on the ScrollPanel. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnOverlayControlClosed(const Tizen::Ui::_Control& source) = 0; @@ -87,7 +87,7 @@ public: /** * Notifies when a control on the ScrollPanel is selected. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event */ virtual void OnOtherControlSelected(const Tizen::Ui::_Control& source) = 0; diff --git a/src/ui/inc/FUiCtrl_ISliderEventListener.h b/src/ui/inc/FUiCtrl_ISliderEventListener.h index b54f361..cf71c2a 100644 --- a/src/ui/inc/FUiCtrl_ISliderEventListener.h +++ b/src/ui/inc/FUiCtrl_ISliderEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ISliderEventListener.h * @brief This is the header file for the _ISliderEventListener class. diff --git a/src/ui/inc/FUiCtrl_ISplitPanelEventListener.h b/src/ui/inc/FUiCtrl_ISplitPanelEventListener.h index bed02cd..1e0215e 100644 --- a/src/ui/inc/FUiCtrl_ISplitPanelEventListener.h +++ b/src/ui/inc/FUiCtrl_ISplitPanelEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ISplitPanelEventListener.h * @brief This is the header file for the _ISplitPanelEventListener interface. @@ -35,7 +36,7 @@ class _SplitPanel; /** * @interface _ISplitPanelEventListener * @brief This interface implements the listener for all splitpanel events. - * @since 2.0 + * @since 2.1 * * The %_ISplitPanelEventListener interface is the listener interface for receiving SplitPanel events, which are fired when the divider moves or is double pressed. * The class that processes a SplitPanel event implements this interface, and the instance created with that class is registered with @@ -51,7 +52,7 @@ public: /** * This is the destructor for this class. * - * @since 2.0 + * @since 2.1 */ virtual ~_ISplitPanelEventListener(void) {} @@ -60,7 +61,7 @@ public: * * Called when the divider moves. * - * @since 2.0 + * @since 2.1 * @param[in] source The source of the event * @param[in] position The position of the divider */ @@ -69,7 +70,7 @@ public: /** * Called when the divider is double pressed. * - * @since 2.0 + * @since 2.1 * * @param[in] source The source of the event * @remark This method is invoked when an divider is double pressed. diff --git a/src/ui/inc/FUiCtrl_ITableViewItemEventListener.h b/src/ui/inc/FUiCtrl_ITableViewItemEventListener.h index 7f054c3..5dd7de5 100644 --- a/src/ui/inc/FUiCtrl_ITableViewItemEventListener.h +++ b/src/ui/inc/FUiCtrl_ITableViewItemEventListener.h @@ -46,7 +46,7 @@ class _TableViewItem; * @interface _ITableViewItemEventListener * @brief This interface implements the listener for * internal item event. - * @since 2.0 + * @since 2.1 * * _ITableViewItemEventListener is an interface which implements a listener for receiving * item change events. The class that is interested in @@ -64,14 +64,14 @@ public: /** * This is the destructor for this class. * - * @since 2.0 + * @since 2.1 */ virtual ~_ITableViewItemEventListener(void) {} /** * Called when the state of a TableViewItem in the TableView is changed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] itemIndex The item index @@ -85,7 +85,7 @@ public: /** * Called when the TableViewContextItem is opened or closed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] itemIndex The item index @@ -98,7 +98,7 @@ public: /** * Called when the item is reordered. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] itemIndexFrom The start item index of the item @@ -110,7 +110,7 @@ public: /** * Called when the state of a TableViewGroupItem is changed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] groupIndex The group index @@ -123,7 +123,7 @@ public: /** * Called when the state of a TableViewItem in the GroupedTableView is changed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] groupIndex The group index @@ -137,7 +137,7 @@ public: /** * Called when the TableViewContextItem is opened or closed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] groupIndex The group index @@ -151,7 +151,7 @@ public: /** * Called when the item is reordered. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] groupIndexFrom The source group index of the item @@ -165,7 +165,7 @@ public: /** * Called when the state of a TableViewItem in the SectionTableView is changed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] sectionIndex The section index @@ -179,7 +179,7 @@ public: /** * Called when the TableViewContextItem is opened or closed. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] sectionIndex The section index @@ -194,7 +194,7 @@ public: /* * Called when the TableViewItem is swept. * - * @since 2.0 + * @since 2.1 * * @param[in] tableView The source of the event * @param[in] groupIndex The item index diff --git a/src/ui/inc/FUiCtrl_ITextBlockEventListener.h b/src/ui/inc/FUiCtrl_ITextBlockEventListener.h index c6603d1..613a5a1 100644 --- a/src/ui/inc/FUiCtrl_ITextBlockEventListener.h +++ b/src/ui/inc/FUiCtrl_ITextBlockEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ITextBlockEventListener.h * @brief This is the header file for the _ITextBlockEventListener interface. diff --git a/src/ui/inc/FUiCtrl_ITextEventListener.h b/src/ui/inc/FUiCtrl_ITextEventListener.h index 62a4f4b..b506013 100644 --- a/src/ui/inc/FUiCtrl_ITextEventListener.h +++ b/src/ui/inc/FUiCtrl_ITextEventListener.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ITextEventListener.h * @brief This is the header file for the _ITextEventListener class. @@ -40,7 +41,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @interface _ITextEventListener * @brief This interface implements the listener for _kmjaction event. - * @since 1.0 + * @since 2.0 * * The listener interface for receiving the action events. The class that processes an action event * implements this interface, and the object created with that class is registered with a _control, using the _control's @@ -54,7 +55,7 @@ public: /** * This is the destructor for this class. * - * @since 1.0 + * @since 2.0 */ virtual ~_ITextEventListener(void) {} @@ -64,7 +65,7 @@ public: * @if OSPCOMPAT * @brief [Compatibility] * @endif - * @since 1.0 + * @since 2.0 * @if OSPCOMPAT * @compatibility This method has compatibility issues with OSP compatible applications. @n * For more information, see @ref CompIEventListenerOnTextValueChanged "here". @@ -81,7 +82,7 @@ public: * @if OSPCOMPAT * @page CompIEventListenerOnTextValueChanged Compatibility for OnTextValueChanged() * @section CompIEventListenerOnTextValueChangedIssues Issues - * Implementing this method in OSP compatible applications has the following issues: @n + * Implementing this method in OSP compatible applications has the following issues: @n * * -# When texts are inserted by prediction feature in the predictive input mode of EditArea or EditField, OnTextValueChanged callback is not invoked. * @@ -93,7 +94,7 @@ public: /** * Notifies when a change made to the text is cancelled. * - * @since 1.0 + * @since 2.0 * @param[in] source The source of the event * @remarks This listener method is called when the user presses "Cancel" soft-key for EditField or * EditArea with INPUT_STYLE_FULLSCREEN input style. diff --git a/src/ui/inc/FUiCtrl_ITokenFilter.h b/src/ui/inc/FUiCtrl_ITokenFilter.h index 61a1904..ed00377 100644 --- a/src/ui/inc/FUiCtrl_ITokenFilter.h +++ b/src/ui/inc/FUiCtrl_ITokenFilter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ITokenFilter.h * @brief This is the header file for the _ITokenFilter interface. @@ -39,7 +40,7 @@ public: * Asks the filter if the text tokenized by the ExpandableEditArea should * be replaced. * - * @since 2.0 + * @since 2.1 * @return @c true if the text of the current token needs to be replaced. * @c false otherwise * @param[in] token The current token's text diff --git a/src/ui/inc/FUiCtrl_IUiLinkEventListener.h b/src/ui/inc/FUiCtrl_IUiLinkEventListener.h old mode 100644 new mode 100755 index a30c1e8..b87d339 --- a/src/ui/inc/FUiCtrl_IUiLinkEventListener.h +++ b/src/ui/inc/FUiCtrl_IUiLinkEventListener.h @@ -18,7 +18,7 @@ /** * @file FUiCtrl_IUiLinkEventListener.h * @brief This file defines the _IUiLinkEventListener interface. - * @version 3.0 + * @version 2.0 * * This file contains the declarations of _IUiLinkEventListener interface. */ diff --git a/src/ui/inc/FUiCtrl_IUiListViewItemEventListener.h b/src/ui/inc/FUiCtrl_IUiListViewItemEventListener.h index bf3b493..ee202be 100644 --- a/src/ui/inc/FUiCtrl_IUiListViewItemEventListener.h +++ b/src/ui/inc/FUiCtrl_IUiListViewItemEventListener.h @@ -47,14 +47,14 @@ public: * This way, the destructors of the derived classes are called * when the destructor of this interface is called. * - * @since 2.0 + * @since 2.1 */ virtual ~_IUiListViewItemEventListener(void) {} /** * Notifies when the state of an element in the ListContextItem is changed. * - * @since 2.0 + * @since 2.1 * * @param[in] groupIndex The group index of the list * @param[in] itemIndex The item index of the list @@ -63,18 +63,6 @@ public: */ virtual void OnListViewContextItemStateChanged(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status) = 0; - /** - * Called when the item or the element is long pressed. - * - * @since 2.0 - * - * @param[in] groupIndex The group index of the list - * @param[in] itemIndex The item index of the list - * @param[in] elementId The element ID - */ - virtual void OnListViewItemLongPressed(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId) = 0; - - protected: // reserved virtual methods for later extension // diff --git a/src/ui/inc/FUiCtrl_IconListItem.h b/src/ui/inc/FUiCtrl_IconListItem.h index f1f1e12..00358f0 100644 --- a/src/ui/inc/FUiCtrl_IconListItem.h +++ b/src/ui/inc/FUiCtrl_IconListItem.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -68,13 +68,13 @@ public: static _IconListItem* CreateIconListItemN(IconListViewItem* pIconListViewItem); // _ListItemCommon - virtual bool DrawItem(Tizen::Graphics::Rectangle& rcItem, ListItemState isFocused, bool itemDivider = false); + virtual bool DrawItem(Tizen::Graphics::FloatRectangle& rect, ListItemState isFocused); virtual void SetChecked(bool checked); virtual void SetItemIndex(int groupIndex, int itemIndex); virtual void GetItemIndex(int& groupIndex, int& itemIndex) const; - result DrawItemTouchAnimation(Tizen::Graphics::Rectangle& rcItem, float ratio); - result DrawItemCheckAnimation(Tizen::Graphics::Rectangle& rcItem, float ratio); + result DrawItemTouchAnimation(Tizen::Graphics::FloatRectangle& rect, float ratio); + result DrawItemCheckAnimation(Tizen::Graphics::FloatRectangle& rect, float ratio); result SetText(const Tizen::Base::String* pText); @@ -92,10 +92,12 @@ public: result SetOverlayBitmap(int overlayBitmapId, const Tizen::Graphics::Bitmap* pOverlayBitmap, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment); - int GetOverlayBitmapIdFromPosition(Tizen::Graphics::Point& position) const; + int GetOverlayBitmapIdFromPosition(Tizen::Graphics::FloatPoint& position) const; Tizen::Ui::Animations::_VisualElement* GetItemVisualElement(void) const; + bool IsDrawn(void) const; + protected: result DrawBitmap(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::Bitmap& bitmap, bool isFocused = false, float ratio = 1.0f); result DrawText(const Tizen::Graphics::Color& color); @@ -107,7 +109,7 @@ private: _IconListItem(const _IconListItem& rhs); _IconListItem& operator =(const _IconListItem& rhs); - Tizen::Graphics::Rectangle GetOverlayBitmapBounds(_OverlayBitmap* pOverlayBitmap, const Tizen::Graphics::Rectangle& parentRect, int overlayMargin) const; + Tizen::Graphics::FloatRectangle GetOverlayBitmapBounds(_OverlayBitmap* pOverlayBitmap, const Tizen::Graphics::FloatRectangle& parentRect, float overlayMargin) const; // Inquiry public: diff --git a/src/ui/inc/FUiCtrl_IconListItemDrawingProperty.h b/src/ui/inc/FUiCtrl_IconListItemDrawingProperty.h index 623502d..359ca1c 100644 --- a/src/ui/inc/FUiCtrl_IconListItemDrawingProperty.h +++ b/src/ui/inc/FUiCtrl_IconListItemDrawingProperty.h @@ -26,8 +26,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -52,9 +52,9 @@ public: public: const Tizen::Graphics::Color GetBackgroundColor(IconListViewItemDrawingStatus status) const; - result SetTextSize(int size); + result SetTextSize(float size); - int GetTextSize(void) const; + float GetTextSize(void) const; result SetFont(Tizen::Graphics::Font* pFont); @@ -70,25 +70,25 @@ public: result SetItemLayout(void); - result SetItemBitmapBounds(const Tizen::Graphics::Rectangle bounds); + result SetItemBitmapBounds(const Tizen::Graphics::FloatRectangle bounds); - const Tizen::Graphics::Rectangle GetItemBitmapBounds(void) const; + Tizen::Graphics::FloatRectangle GetItemBitmapBounds(void) const; - const Tizen::Graphics::Dimension GetItemBitmapSize(void) const; + Tizen::Graphics::FloatDimension GetItemBitmapSize(void) const; - result SetItemSize(const Tizen::Graphics::Dimension size); + result SetItemSize(const Tizen::Graphics::FloatDimension size); - const Tizen::Graphics::Dimension GetItemSize(void) const; + Tizen::Graphics::FloatDimension GetItemSize(void) const; - const int GetTextXPosition(void) const; + float GetTextXPosition(void) const; - const int GetTextYPosition(void) const; + float GetTextYPosition(void) const; - const int GetTwoLineTextYPosition(void) const; + float GetTwoLineTextYPosition(void) const; - const int GetTextAreaWidth(void) const; + float GetTextAreaWidth(void) const; - const int GetTextVerticalMargin(void) const; + float GetTextVerticalMargin(void) const; result SetCheckBoxPosition(IconListViewCheckBoxPosition position); @@ -110,11 +110,11 @@ public: const Tizen::Graphics::Bitmap* GetFocusDropShadowBitmap(void) const; - int GetDropShadowBorderWidth(void) const; + float GetDropShadowBorderWidth(void) const; - int GetDropShadowMargin(void) const; + float GetDropShadowMargin(void) const; - const Tizen::Graphics::Rectangle GetDropShadowBitmapBounds(void) const; + Tizen::Graphics::FloatRectangle GetDropShadowBitmapBounds(void) const; const Tizen::Graphics::Bitmap* GetCheckBitmap(void) const; @@ -128,11 +128,11 @@ public: bool IsItemCheckedStyle(void) const; - int GetCheckMargin(void) const; + float GetCheckMargin(void) const; - int GetOverlayMargin(void) const; + float GetOverlayMargin(void) const; - int GetSelectBackgroundMargin(void) const; + float GetSelectBackgroundMargin(void) const; void SetDrawingFlag(void); @@ -156,38 +156,38 @@ private: // Attribute private: - int __textSize; + float __textSize; Tizen::Graphics::Font* __pFont; Tizen::Graphics::Color __normalTextColor; Tizen::Graphics::Color __pressedTextColor; Tizen::Graphics::Color __highlightedTextColor; - Tizen::Graphics::Dimension __size; - Tizen::Graphics::Rectangle __bitmapBounds; + Tizen::Graphics::FloatDimension __size; + Tizen::Graphics::FloatRectangle __bitmapBounds; Tizen::Graphics::Bitmap* __pDropShadowBitmap; Tizen::Graphics::Bitmap* __pFocusDropShadowBitmap; Tizen::Graphics::Bitmap* __pDropShadowBitmapWithReplacementColor; - int __dropShadowBorderWidth; - int __dropShadowMargin; + float __dropShadowBorderWidth; + float __dropShadowMargin; Tizen::Graphics::Bitmap* __pCheckBitmap; Tizen::Graphics::Bitmap* __pCheckedBackgroundBitmap; Tizen::Graphics::Bitmap* __pUnCheckedBackgroundBitmap; Tizen::Graphics::Bitmap* __pDisabledCheckBitmap; - int __checkMargin; - int __overlayMargin; + float __checkMargin; + float __overlayMargin; Tizen::Graphics::Color __pressedBackgroundColor; Tizen::Graphics::Color __normalBorderColor; Tizen::Graphics::Color __focusBorderColor; Tizen::Graphics::Color __inTextBackgroundColor; - int __textYPos; - int __2LineTextYPos; + float __textYPos; + float __2LineTextYPos; IconListViewCheckBoxPosition __checkBoxPosition; IconListViewItemBorderStyle __borderStyle; @@ -201,13 +201,13 @@ private: bool __asAspectRatio; bool __checkedStyle; - int __verticalExtent; - int __insideOneLineTextHeight; - int __insideTwoLineTextHeight; + float __verticalExtent; + float __insideOneLineTextHeight; + float __insideTwoLineTextHeight; - int __selectBackgroundMargin; - int __itemTextHorizontalMargin; - int __itemTextVerticalMargin; + float __selectBackgroundMargin; + float __itemTextHorizontalMargin; + float __itemTextVerticalMargin; }; // _IconListItemDrawingProperty }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_IconListItemProvider.h b/src/ui/inc/FUiCtrl_IconListItemProvider.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_IconListItemProviderAdaptor.h b/src/ui/inc/FUiCtrl_IconListItemProviderAdaptor.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_IconListPresenter.h b/src/ui/inc/FUiCtrl_IconListPresenter.h index 8294a4b..f64fb83 100644 --- a/src/ui/inc/FUiCtrl_IconListPresenter.h +++ b/src/ui/inc/FUiCtrl_IconListPresenter.h @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include #include @@ -81,27 +79,15 @@ public: result SetScrollDirection(IconListViewScrollDirection scrollDirection); - result SetTopMargin(int value); + result SetMargin(MarginType type, float value); - int GetTopMargin(void) const; + float GetMargin(MarginType type) const; - result SetBottomMargin(int value); + result SetItemSpacing(float horizontalSpacing, float verticalSpacing); - int GetBottomMargin(void) const; + float GetItemHorizontalSpacing(void) const; - result SetLeftMargin(int value); - - int GetLeftMargin(void) const; - - result SetRightMargin(int value); - - int GetRightMargin(void) const; - - result SetItemSpacing(int horizontalSpacing, int verticalSpacing); - - int GetItemHorizontalSpacing(void) const; - - int GetItemVerticalSpacing(void) const; + float GetItemVerticalSpacing(void) const; void SetUseCheckedStyle(bool checkedStyle); @@ -109,9 +95,9 @@ public: bool IsItemChecked(int index) const; - int GetItemIndexFromPosition(int x, int y) const; + int GetItemIndexFromPosition(float x, float y) const; - int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; result SetTextHorizontalAlignment(HorizontalAlignment alignment); @@ -125,9 +111,9 @@ public: const Tizen::Graphics::Color GetItemTextColor(IconListViewItemDrawingStatus status) const; - result SetItemTextSize(int size); + result SetItemTextSize(float size); - int GetItemTextSize(void) const; + float GetItemTextSize(void) const; result SetCheckBoxPosition(IconListViewCheckBoxPosition position); @@ -139,25 +125,25 @@ public: result ScrollToItem(int index); - result ScrollByPixel(int pixel); + result ScrollByPixel(float pixel); result RefreshList(int index, ListRefreshType type); result UpdateList(void); - result SetItemBitmapBounds(const Tizen::Graphics::Rectangle& bounds); + result SetItemBitmapBounds(const Tizen::Graphics::FloatRectangle& bounds); - const Tizen::Graphics::Rectangle GetItemBitmapBounds(void) const; + Tizen::Graphics::FloatRectangle GetItemBitmapBounds(void) const; - result GetItemBitmapSize(int& width, int& height) const; + result GetItemBitmapSize(float& width, float& height) const; - const Tizen::Graphics::Dimension GetItemBitmapSize(void) const; + Tizen::Graphics::FloatDimension GetItemBitmapSize(void) const; - result SetItemSize(const Tizen::Graphics::Dimension& size); + result SetItemSize(const Tizen::Graphics::FloatDimension& size); - result GetItemSize(int& width, int& height) const; + result GetItemSize(float& width, float& height) const; - const Tizen::Graphics::Dimension GetItemSize(void) const; + Tizen::Graphics::FloatDimension GetItemSize(void) const; result SetMagneticScrollSize(int scrollSize); @@ -207,7 +193,7 @@ public: public: // Tizen::Ui::_Control virtual void OnBoundsChanged(void); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); // Tizen::Ui::_IKeyEventPreviewer @@ -244,14 +230,23 @@ public: // Tizen::Ui::_IScrollEventListener virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition); virtual void OnScrollStopped(Tizen::Ui::_Control& source); + virtual void OnScrollJumpToTop(Tizen::Ui::_Control& source); // Osp::Ui::Animations::IAnimationTransactionEventListener virtual void OnAnimationTransactionStarted(int transactionId); virtual void OnAnimationTransactionStopped(int transactionId); virtual void OnAnimationTransactionFinished(int transactionId); + // Tizen::Ui::Animations::IVisualElementAnimationTickEventListener + virtual void OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, const Tizen::Ui::Variant& currentValue); + + // Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener + virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); + virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount); + virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally); + protected: result Dispose(void); result Initialize(void); @@ -271,19 +266,26 @@ protected: result FireIconListViewItemEvent(_IconListViewItemEventType eventType, int index, int arg); result FireScrollEndReachedEvent(ScrollEndEvent type); - result FireScrollPositionChangedEvent(int scrollPosition); + result FireScrollPositionChangedEvent(float scrollPosition); result FireScrollStoppedEvent(); result FireScrollEvent(); - bool SetScrollPosition(int position, bool enableFadeEffect = true); + bool SetScrollPosition(float position, bool enableFadeEffect = true); + + float GetMagneticScrollPosition(void) const; + float GetMagneticScrollPosition(float scrollPosition) const; - int GetMagneticScrollPosition(void) const; + void TranslateIconListItemPosition(float& x, float& y); - void TranslateIconListItemPosition(int& x, int& y); + Tizen::Graphics::FloatRectangle GetItemBounds(int index) const; - Tizen::Graphics::Rectangle GetItemBounds(int index) const; + int CalculateFlickAmount(int distance, int duration); // visual interaction animation + void StartScrollToAnimation(float targetPosition); + void StopScrollToAnimation(void); + void StopAllAnimations(void); + void AddAnimation(_IconListItem& item, int index, int delay = 0); void RemoveAnimation(_IconListItem& item, int index); void MoveAnimation(_IconListItem& item, Tizen::Graphics::FloatRectangle& bounds, int delay = 0); @@ -296,7 +298,7 @@ protected: bool IsAnimationRunning(int transactionId); void InitializeAccessibilityElement(void); - void AddAccessibilityElement(_IconListItem& item, const Tizen::Graphics::Rectangle& rect); + void AddAccessibilityElement(_IconListItem& item, const Tizen::Graphics::FloatRectangle& rect); void RemoveAllAccessibilityElements(void); private: @@ -311,8 +313,8 @@ private: void FireEventAfterTouchRelease(int index); void PrepareReordering(void); - void DoReordering(const Tizen::Graphics::Point& movedPosition); - void CheckAndReorderItem(int movedX, int movedY); + void DoReordering(const Tizen::Graphics::FloatPoint& movedPosition); + void CheckAndReorderItem(float movedX, float movedY); void SwapReorderedItems(int toIndex, bool singleItemChanged); void FinishReordering(void); void ClearReorderingInformation(void); @@ -326,10 +328,6 @@ private: result StartTouchActionTimer(void); result ResetTouchActionTimer(void); - result StartFlickAnimationTimer(void); - result ResetFlickAnimationTimer(void); - void StartFlickAnimation(void); - result StartMagneticScrollTimer(void); result ResetMagneticScrollTimer(void); @@ -346,12 +344,13 @@ private: static const int INVALID_INDEX = -1; static const int ITEM_CACHE_SIZE_MULTIPLIER = 5; static const int MINIMUM_FLICK_EFFECT_TIME = 80; + static const int FLICK_ANIMATION_DURATION = 1000; static const int FLICK_ANIMATION_TIMER_PERIOD = 10; static const int MAGNETIC_SCROLL_TIMER_PERIOD = 10; static const int SELECTION_ANIMATION_TIMER_PERIOD = 30; static const int TOUCH_ACTION_TIMER_PERIOD = 100; static const int REORDER_SCROLL_TIMER_PERIOD = 20; - static const int REORDER_SCROLL_ANIMATION_DISTANCE = 10; + static const float REORDER_SCROLL_ANIMATION_DISTANCE = 10.0f; static const int ITEM_ANIMATION_DURATION = 333; static const int ITEM_ANIMATION_DELAY = 334; static const int MOVE_ITEM_ANIMATION_DURATION = 500; @@ -360,6 +359,10 @@ private: static const int SCREEN_HEIGHT = 800; static const int NEEDED_FLICK_COUNT_FOR_FINGER_FASTSCROLL = 3; static const int OVERSCROLLING_MAX_DISTANCE = 400; + static const int SCROLL_FLICK_IN_PIXEL_UNIT = 1000; + static const int SCROLL_FLICK_WEIGHT_VELOCITY = 1; + static const int SCROLL_FLICK_WEIGHT_DISTANCE = 5; + static const int SCROLL_FLICK_ALPHA_PER_PIXEL = 3; _ListViewModel* __pListModel; _IconListView* __pIconListView; @@ -373,33 +376,31 @@ private: int __firstDrawnIndex; int __lastDrawnIndex; IconListViewScrollDirection __scrollDirection; - int __topMargin; - int __bottomMargin; - int __leftMargin; - int __rightMargin; - int __horizontalSpacing; - int __verticalSpacing; + float __topMargin; + float __bottomMargin; + float __leftMargin; + float __rightMargin; + float __horizontalSpacing; + float __verticalSpacing; int __magneticScrollSize; int __itemCountPerAxis; HorizontalAlignment __itemHorizontalAlignment; VerticalAlignment __itemVerticalAlignment; - int __scrollPosition; - int __unitScrollLength; - int __scrollLength; - int __unitLengthOfAxis; - int __startPosOfAxis; - int __endPosOfAxis; + float __scrollPosition; + float __unitScrollLength; + float __scrollLength; + float __unitLengthOfAxis; + float __startPosOfAxis; + float __endPosOfAxis; _IconListItemDrawingProperty* __pItemDrawingProperty; Tizen::Base::Runtime::Timer* __pSelectionAnimationTimer; Tizen::Base::Runtime::Timer* __pCheckAnimationTimer; Tizen::Base::Runtime::Timer* __pTouchActionTimer; - Tizen::Base::Runtime::Timer* __pFlickAnimationTimer; Tizen::Base::Runtime::Timer* __pMagneticScrollTimer; Tizen::Base::Runtime::Timer* __pAnimationTimer; - _FlickAnimation __flickAnimation; _IconListUtils::TouchAnimation __touchAnimation; - _IconListUtils::MagneticScrollAnimation __magneticScrollAnimation; _IconListUtils::CheckAnimation __checkAnimation; + _IconListUtils::MagneticScrollAnimation __magneticScrollAnimation; bool __isTouchAnimationEnabled; bool __previousTouchAnimatinEnabled; bool __isLayoutChanged; @@ -420,21 +421,24 @@ private: bool __onReordering; int __reorderFromIndex; int __reorderToIndex; - Tizen::Graphics::Point __lastReorderedPosition; - Tizen::Graphics::Point __lastReorderedDifferences; + Tizen::Graphics::FloatPoint __lastReorderedPosition; + Tizen::Graphics::FloatPoint __lastReorderedDifferences; Tizen::Graphics::FloatRectangle __reorderItemBounds; Tizen::Base::Runtime::Timer* __pReorderScrollTimer; - int __reorderScrollAnimationDistance; - int __scrollPositionBeforeScrollAnimation; + float __reorderScrollAnimationDistance; + float __scrollPositionBeforeScrollAnimation; int __flickCount; bool __isFlickDown; + bool __flickRunning; int __animationItemIndex; int __addTransactionId; int __removeTransactionId; int __moveTransactionId; + bool __firstTouchMove; + IconListViewScrollDirection __firstTouchMoveDirection; }; // _IconListPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_IconListUtils.h b/src/ui/inc/FUiCtrl_IconListUtils.h index 6a636af..701faf2 100644 --- a/src/ui/inc/FUiCtrl_IconListUtils.h +++ b/src/ui/inc/FUiCtrl_IconListUtils.h @@ -65,16 +65,16 @@ public: virtual ~MagneticScrollAnimation(void); - bool GetMagneticScrollAnimationFrame(int& dif); + bool GetMagneticScrollAnimationFrame(float& diff); - void StartAnimation(int scroll); + void StartAnimation(float scroll); private: MagneticScrollAnimation(const MagneticScrollAnimation& rhs); MagneticScrollAnimation& operator =(const MagneticScrollAnimation& rhs); private: - int __scroll; + float __scroll; }; // _MagneticScrollAnimation class CheckAnimation diff --git a/src/ui/inc/FUiCtrl_IconListView.h b/src/ui/inc/FUiCtrl_IconListView.h index fb1d96f..8fc45e2 100644 --- a/src/ui/inc/FUiCtrl_IconListView.h +++ b/src/ui/inc/FUiCtrl_IconListView.h @@ -25,12 +25,15 @@ #include #include +#include +#include +#include #include #include #include #include +#include -#include "FUi_Control.h" #include "FUi_ITouchFlickGestureEventListener.h" #include "FUi_ITouchLongPressGestureEventListener.h" #include "FUiCtrl_Scroll.h" @@ -57,10 +60,12 @@ class _UiScrollEvent; class _OSP_EXPORT_ _IconListView : public _Control + , public _IPropertyChangeEventListener , public _ITouchFlickGestureEventListener , public _ITouchLongPressGestureEventListener - , public _IPropertyChangeEventListener , public Tizen::Ui::Animations::IAnimationTransactionEventListener + , public Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener + , public Tizen::Ui::Animations::IVisualElementAnimationTickEventListener , virtual public Tizen::Base::Runtime::IEventListener , virtual public _ITouchGestureEventListener , virtual public _IUiEventListener @@ -152,24 +157,26 @@ public: const Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const; - result SetMargin(MarginType type, int value); + result SetMargin(MarginType type, float value); - int GetMargin(MarginType type) const; + float GetMargin(MarginType type) const; - result SetItemSpacing(int horizontalSpacing, int verticalSpacing); + result SetItemSpacing(float horizontalSpacing, float verticalSpacing); - int GetItemHorizontalSpacing(void) const; + float GetItemHorizontalSpacing(void) const; - int GetItemVerticalSpacing(void) const; + float GetItemVerticalSpacing(void) const; result SetItemChecked(int index, bool check); bool IsItemChecked(int index) const; - int GetItemIndexFromPosition(int x, int y) const; + int GetItemIndexFromPosition(float x, float y) const; int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; + result SetTextHorizontalAlignment(HorizontalAlignment alignment); result SetTextVerticalAlignment(IconListViewItemTextVerticalAlignment alignment); @@ -186,17 +193,17 @@ public: const Tizen::Graphics::Color GetTextColorOfEmptyList(void) const; - result SetTextSizeOfEmptyList(int size); + result SetTextSizeOfEmptyList(float size); - int GetTextSizeOfEmptyList(void) const; + float GetTextSizeOfEmptyList(void) const; result SetItemTextColor(IconListViewItemDrawingStatus status, const Tizen::Graphics::Color& color); const Tizen::Graphics::Color GetItemTextColor(IconListViewItemDrawingStatus status) const; - result SetItemTextSize(int size); + result SetItemTextSize(float size); - int GetItemTextSize(void) const; + float GetItemTextSize(void) const; result SetCheckBoxPosition(IconListViewCheckBoxPosition position); @@ -208,7 +215,7 @@ public: result ScrollToItem(int index); - result ScrollByPixel(int pixel); + result ScrollByPixel(float pixel); result RefreshList(int index, ListRefreshType type); @@ -216,17 +223,19 @@ public: result SetItemBitmapBounds(const Tizen::Graphics::Rectangle& bounds); - const Tizen::Graphics::Rectangle GetItemBitmapBounds(void) const; + result SetItemBitmapBounds(const Tizen::Graphics::FloatRectangle& bounds); - result GetItemBitmapSize(int& width, int& height) const; + const Tizen::Graphics::FloatRectangle GetItemBitmapBounds(void) const; - const Tizen::Graphics::Dimension GetItemBitmapSize(void) const; + result GetItemBitmapSize(float& width, float& height) const; - result SetItemSize(const Tizen::Graphics::Dimension& size); + const Tizen::Graphics::FloatDimension GetItemBitmapSize(void) const; - result GetItemSize(int& width, int& height) const; + result SetItemSize(const Tizen::Graphics::FloatDimension& size); - const Tizen::Graphics::Dimension GetItemSize(void) const; + result GetItemSize(float& width, float& height) const; + + const Tizen::Graphics::FloatDimension GetItemSize(void) const; result SetMagneticScrollSize(int scrollSize); @@ -262,7 +271,7 @@ public: result RemoveAllItems(void); - result SetScroll(const Tizen::Graphics::Rectangle& bounds, _ScrollDirection scrollDirection); + result SetScroll(const Tizen::Graphics::FloatRectangle& bounds, _ScrollDirection scrollDirection); _Scroll* GetScroll(void) const; @@ -274,14 +283,21 @@ public: _UiScrollEvent* GetScrollEvent(void) const; + result SetReorderModeEnabled(bool enable); + + bool IsInReorderingMode(void) const; + + void SetScrollInputMode(ScrollInputMode mode); + + ScrollInputMode GetScrollInputMode(void) const; + // Event handling APIs _TouchLongPressGestureDetector* GetLongPressGesture(void) const; result SetLongPressGesture(_TouchLongPressGestureDetector* pLongPress); _TouchFlickGestureDetector* GetFlickGesture(void) const; result SetFlickGesture(_TouchFlickGestureDetector* pFlick); - result SetReorderModeEnabled(bool enable); - bool IsInReorderingMode(void) const; + Tizen::Ui::Animations::VisualElementValueAnimation* GetScrollingAnimation(void) const; // Inquiry public: @@ -292,6 +308,7 @@ public: virtual void OnAncestorEnableStateChanged(const _Control& control); virtual void OnChangeLayout(_ControlOrientation orientation); virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); // Tizen::Ui::_IKeyEventListenerPreviewer @@ -331,7 +348,7 @@ public: // Tizen::Ui::_IScrollEventListener virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition); virtual void OnScrollStopped(Tizen::Ui::_Control& source); // Tizen::Ui::Animations::IAnimationTransactionEventListener @@ -339,6 +356,14 @@ public: virtual void OnAnimationTransactionStopped(int transactionId); virtual void OnAnimationTransactionFinished(int transactionId); + // Tizen::Ui::Animations::IVisualElementAnimationTickEventListener + virtual void OnTickOccurred(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, const Tizen::Ui::Variant& currentValue); + + // Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener + virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); + virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount); + virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally); + private: _IconListView(void); _IconListView(const _IconListView& rhs); @@ -346,6 +371,8 @@ private: // Attribute private: + static const int SCROLL_ANIMATION_DEFAULT_REPEAT_COUNT = 1; + _IconListPresenter* __pIconListPresenter; _Scroll* __pScroll; @@ -368,11 +395,15 @@ private: Tizen::Graphics::Color __textColorOfEmptyList; - int __textSizeOfEmptyList; + float __textSizeOfEmptyList; Tizen::Graphics::Bitmap* __pBitmapOfEmptyList; bool __reorderEnabled; + + Tizen::Ui::Animations::VisualElementValueAnimation* __pScrollingAnimation; + + ScrollInputMode __scrollInputMode; }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_IconListViewImpl.h b/src/ui/inc/FUiCtrl_IconListViewImpl.h index 8defe13..ac366ce 100644 --- a/src/ui/inc/FUiCtrl_IconListViewImpl.h +++ b/src/ui/inc/FUiCtrl_IconListViewImpl.h @@ -55,7 +55,7 @@ public: // Operations public: - result Initialize(IconListView* pIconListView, const Tizen::Graphics::Dimension& itemBitmapSize, IconListViewStyle style, IconListViewScrollDirection scrollDirection, IconListViewScrollStyle scrollStyle); + result Initialize(IconListView* pIconListView, const Tizen::Graphics::FloatDimension& itemBitmapSize, IconListViewStyle style, IconListViewScrollDirection scrollDirection, IconListViewScrollStyle scrollStyle); // Accessor public: @@ -67,27 +67,31 @@ public: void AddScrollEventListener(IScrollEventListener& listener); + void AddScrollEventListener(IScrollEventListenerF& listener); + void RemoveScrollEventListener(IScrollEventListener& listener); + void RemoveScrollEventListener(IScrollEventListenerF& listener); + result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap); - result SetMargin(MarginType type, int value); + result SetMargin(MarginType type, float value); - int GetMargin(MarginType type) const; + float GetMargin(MarginType type) const; - result SetItemSpacing(int horizontalSpacing, int verticalSpacing); + result SetItemSpacing(float horizontalSpacing, float verticalSpacing); - int GetItemHorizontalSpacing(void) const; + float GetItemHorizontalSpacing(void) const; - int GetItemVerticalSpacing(void) const; + float GetItemVerticalSpacing(void) const; result SetItemChecked(int index, bool check); bool IsItemChecked(int index) const; - int GetItemIndexFromPosition(int x, int y) const; + int GetItemIndexFromPosition(float x, float y) const; - int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; result SetTextHorizontalAlignment(HorizontalAlignment alignment); @@ -109,9 +113,9 @@ public: Tizen::Graphics::Color GetItemTextColor(IconListViewItemDrawingStatus status) const; - result SetItemTextSize(int size); + result SetItemTextSize(float size); - int GetItemTextSize(void) const; + float GetItemTextSize(void) const; result SetCheckBoxPosition(IconListViewCheckBoxPosition position); @@ -123,19 +127,19 @@ public: result ScrollToItem(int index); - result ScrollByPixel(int pixel); + result ScrollByPixel(float pixel); result RefreshList(int index, ListRefreshType type); result UpdateList(void); - result GetItemBitmapSize(int& width, int& height) const; + result GetItemBitmapSize(float& width, float& height) const; - Tizen::Graphics::Dimension GetItemBitmapSize(void) const; + Tizen::Graphics::FloatDimension GetItemBitmapSize(void) const; - result GetItemSize(int& width, int& height) const; + result GetItemSize(float& width, float& height) const; - Tizen::Graphics::Dimension GetItemSize(void) const; + Tizen::Graphics::FloatDimension GetItemSize(void) const; result SetMagneticScrollSize(int scrollSize); @@ -163,6 +167,10 @@ public: bool IsInReorderingMode(void) const; + void SetScrollInputMode(ScrollInputMode mode); + + ScrollInputMode GetScrollInputMode(void) const; + // Inquiry public: // _IIconListItemEventListener @@ -172,7 +180,7 @@ public: // _IScrollEventListener virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition); virtual void OnScrollStopped(Tizen::Ui::_Control& source); // Constants diff --git a/src/ui/inc/FUiCtrl_IconListViewItemEvent.h b/src/ui/inc/FUiCtrl_IconListViewItemEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_IconListViewItemEventArg.h b/src/ui/inc/FUiCtrl_IconListViewItemEventArg.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_IconListViewItemImpl.h b/src/ui/inc/FUiCtrl_IconListViewItemImpl.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_Indicator.h b/src/ui/inc/FUiCtrl_Indicator.h index 2189141..e205266 100644 --- a/src/ui/inc/FUiCtrl_Indicator.h +++ b/src/ui/inc/FUiCtrl_Indicator.h @@ -50,9 +50,9 @@ public: result SetIndicatorOpacity(_IndicatorOpacity opacity); bool GetIndicatorShowState(void) const; _IndicatorOpacity GetIndicatorOpacity(void) const; - result AddEvasObject(_Form* pForm); - result DeleteEvasObject(void); - result SetSurface(Tizen::Ui::Animations::VisualElementSurface* pSurface); + result AddIndicatorObject(_Form* pForm); + result DeleteIndicatorObject(void); + result ChangeCurrentVisualElement(Tizen::Ui::Animations::_VisualElement* pVisualElement); virtual void OnChangeLayout(_ControlOrientation orientation); virtual result OnAttachedToMainTree(void); @@ -64,15 +64,15 @@ private: _Indicator& operator =(const _Indicator& value); Tizen::Graphics::Rectangle GetIndicatorBounds(void) const; + Tizen::Graphics::FloatRectangle GetIndicatorBoundsF(void) const; private: Evas_Object* __pPortraitIndicatorEvasObject; Evas_Object* __pLandscapeIndicatorEvasObject; Tizen::Base::Runtime::Timer* __pConnectionTimer; - Tizen::Ui::Animations::VisualElementSurface* __pPortraitSurface; - Tizen::Ui::Animations::VisualElementSurface* __pLandScapeSurface; - Tizen::Ui::Animations::VisualElementSurface* __pCurrentSurface; - Tizen::Ui::Animations::_VisualElement* __pVisualElement; + Tizen::Ui::Animations::_VisualElement* __pPortraitVisualElement; + Tizen::Ui::Animations::_VisualElement* __pLandscapeVisualElement; + Tizen::Ui::Animations::_VisualElement* __pCurrentVisualElement; bool __showstate; _IndicatorOpacity __opacity; diff --git a/src/ui/inc/FUiCtrl_IndicatorManager.h b/src/ui/inc/FUiCtrl_IndicatorManager.h index 6f4ce46..68bb38f 100644 --- a/src/ui/inc/FUiCtrl_IndicatorManager.h +++ b/src/ui/inc/FUiCtrl_IndicatorManager.h @@ -47,10 +47,12 @@ typedef struct Evas_Object* pLandscapeEvasObject; Tizen::Ui::Animations::VisualElementSurface* pPortraitSurface; Tizen::Ui::Animations::VisualElementSurface* pLandscapeSurface; - bool portraitSurfaceUsed; - bool landscapeSurfaceUsed; + Tizen::Ui::Animations::_VisualElement* pPortraitVisualElement; + Tizen::Ui::Animations::_VisualElement* pLandscapeVisualElement; + bool portraitVisualElementUsed; + bool landscapeVisualElementUsed; _Form* pForm; -} IndicatorSurface ; +} IndicatorComponent ; enum _IndicatorOrientation { @@ -66,16 +68,17 @@ public: static void InitializeInstance(void); static void ReleaseInstance(void); - Tizen::Ui::Animations::VisualElementSurface* GetSurface(_Window* pWindow, _IndicatorOrientation orientation, _Form* pForm) const; - result ReleaseSurface(_Window* pWindow, _IndicatorOrientation orientation, Tizen::Ui::Animations::VisualElementSurface* pSurface); + Tizen::Ui::Animations::_VisualElement* GetIndicatorVisualElement(_Window* pWindow, _IndicatorOrientation orientation, _Form* pForm) const; + result ReleaseIndicatorVisualElement(_Window* pWindow, _IndicatorOrientation orientation, Tizen::Ui::Animations::_VisualElement* pVisualElement); result AddWindow(_Window* pWindow); result DeleteWindow(_Window* pWindow); - IndicatorSurface* MakeEvasSurfaceArrayN(_Window* pWindow); - bool IsFull(IndicatorSurface* pIndicatorSurfaceArray) const; + IndicatorComponent* MakeIndicatorComponentArrayN(_Window* pWindow); + bool IsFull(IndicatorComponent* pIndicatorComponentArray) const; Evas_Object* GetEvasObject(_Window* pWindow, _Form* pForm, _IndicatorOrientation orientation)const; Tizen::Graphics::Dimension GetIndicatorSize(_IndicatorOrientation orientation) const; + Tizen::Graphics::FloatDimension GetIndicatorSizeF(_IndicatorOrientation orientation) const; private: ~_IndicatorManager(void); @@ -87,7 +90,7 @@ private: private: static _IndicatorManager* __pInstance; - Tizen::Base::Collection::HashMapT __indicatorMap; + Tizen::Base::Collection::HashMapT __indicatorMap; }; // _IndicatorManager }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_InputPad.h b/src/ui/inc/FUiCtrl_InputPad.h index e5b8c0d..08e8bf4 100644 --- a/src/ui/inc/FUiCtrl_InputPad.h +++ b/src/ui/inc/FUiCtrl_InputPad.h @@ -50,10 +50,10 @@ public: _InputPad(void); virtual ~_InputPad(void); - result Construct(const Tizen::Graphics::Rectangle& bounds); + result Construct(const Tizen::Graphics::FloatRectangle& bounds); result SetInputPadEventListener(const _IInputPadEventListener& listener); void SetInputPadStyle(const _InputPadStyle style); - Tizen::Base::String& GetAccessebilityElementMonthName(int number); + Tizen::Base::String& GetAccessibilityElementMonthName(int number); void SetFont(Tizen::Graphics::Font* pFont); virtual void OnBoundsChanged(void); @@ -71,7 +71,7 @@ private: void SetAllAccessibilityElement(void); void SetBoundsAllAccessibilityElement(void); void RemoveAllAccessibilityElement(void); - void InitializeAccessebilityElementMonthNames(void); + void InitializeAccessibilityElementMonthNames(void); private: _InputPadPresenter* __pInputPadPresenter; diff --git a/src/ui/inc/FUiCtrl_InputPadPresenter.h b/src/ui/inc/FUiCtrl_InputPadPresenter.h index ac7e0c7..782f8f7 100644 --- a/src/ui/inc/FUiCtrl_InputPadPresenter.h +++ b/src/ui/inc/FUiCtrl_InputPadPresenter.h @@ -47,7 +47,7 @@ public: _InputPadPresenter(_InputPad* pInputPad); virtual ~_InputPadPresenter(void); - result Construct(const Tizen::Graphics::Rectangle& bounds); + result Construct(const Tizen::Graphics::FloatRectangle& bounds); result LoadProperties(Tizen::Ui::_ControlOrientation orientation); result LoadResource(void); @@ -57,7 +57,7 @@ public: result SetInputPadStyle(const _InputPadStyle style); _InputPadStyle GetInputPadStyle(void) const; - Tizen::Graphics::Rectangle GetButtonBounds(int index) const; + Tizen::Graphics::FloatRectangle GetButtonBounds(int index) const; int GetReturnValue(int index) const; result Draw(void); @@ -74,7 +74,7 @@ private: result DrawAllButtons(Tizen::Graphics::Canvas& canvas); result DrawButton(Tizen::Graphics::Canvas& canvas, int index); result RefreshButton(int index); - int GetIndexFromTouchedPosition(const Tizen::Graphics::Point& point) const; + int GetIndexFromTouchedPosition(const Tizen::Graphics::FloatPoint& point) const; _InputPadPresenter(const _InputPadPresenter&); _InputPadPresenter& operator =(const _InputPadPresenter&); @@ -98,12 +98,12 @@ private: _InputPadStyle __inputPadStyle; - int __buttonWidth; - int __buttonHeight; - int __startX; - int __startY; - int __marginX; - int __marginY; + float __buttonWidth; + float __buttonHeight; + float __startX; + float __startY; + float __marginX; + float __marginY; int __pressedIndex; bool __isLayoutChanged; diff --git a/src/ui/inc/FUiCtrl_Keypad.h b/src/ui/inc/FUiCtrl_Keypad.h index 189c3f8..553776d 100644 --- a/src/ui/inc/FUiCtrl_Keypad.h +++ b/src/ui/inc/FUiCtrl_Keypad.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Keypad.h * @brief This is the header file for the _Keypad class. @@ -75,6 +76,8 @@ public: Tizen::Base::String GetText(void) const; void SetText(const Tizen::Base::String& text); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); result AddTextEventListener(const _ITextEventListener& listener); result RemoveTextEventListener(const _ITextEventListener& listener); @@ -89,12 +92,6 @@ public: virtual void OnChangeLayout(_ControlOrientation orientation); virtual void OnNativeWindowActivated(void); -#if defined(MULTI_WINDOW) - virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); - virtual bool IsLayoutChangable(void) const; -#endif - - private: _Keypad(void); _Keypad(const _Keypad&); @@ -102,7 +99,7 @@ private: result Dispose(void); result ChangeLayoutInternal(void); - Tizen::Graphics::Rectangle GetIndicatorBounds(void) const; + Tizen::Graphics::FloatRectangle GetIndicatorBounds(void) const; _Button* CreateButtonItemN(int actionId, const Tizen::Base::String& text); _Toolbar* CreateHeaderForSIP(void); diff --git a/src/ui/inc/FUiCtrl_KeypadEvent.h b/src/ui/inc/FUiCtrl_KeypadEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_KeypadImpl.h b/src/ui/inc/FUiCtrl_KeypadImpl.h old mode 100644 new mode 100755 index f93fec3..4d00db7 --- a/src/ui/inc/FUiCtrl_KeypadImpl.h +++ b/src/ui/inc/FUiCtrl_KeypadImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_KeypadImpl.h * @brief This is the header file for the _KeypadImpl class. @@ -72,8 +73,9 @@ public: result RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener); Tizen::Base::String GetText(void) const; - void SetText(const Tizen::Base::String& text); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); virtual result OnAttachedToMainTree(void); diff --git a/src/ui/inc/FUiCtrl_Label.h b/src/ui/inc/FUiCtrl_Label.h index 6fc0473..4f359a8 100644 --- a/src/ui/inc/FUiCtrl_Label.h +++ b/src/ui/inc/FUiCtrl_Label.h @@ -38,7 +38,7 @@ class _LabelPresenter; /** * @class _Label * @brief - * @since 1.0 + * @since 2.0 * * * @@ -81,13 +81,16 @@ public: virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; public: result SetText(const Tizen::Base::String& text); Tizen::Base::String GetText(void) const; result SetTextConfig(int size, LabelTextStyle style); + result SetTextConfig(float size, LabelTextStyle style); int GetTextSize(void) const; + float GetTextSizeF(void) const; LabelTextStyle GetTextStyle(void) const; result SetTextHorizontalAlignment(HorizontalAlignment alignment); @@ -107,10 +110,20 @@ public: unsigned long GetFontStyle(void) const; result SetMargin(int topMargin, int leftMargin); - int GetTopMargin(void) const; + result SetMargin(int leftMargin, int topMargin, int rightMargin, int bottomMargin); int GetLeftMargin(void) const; + int GetTopMargin(void) const; + int GetRightMargin(void) const; + int GetBottomMargin(void) const; + + result SetMargin(float topMargin, float leftMargin); + result SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin); + float GetLeftMarginF(void) const; + float GetTopMarginF(void) const; + float GetRightMarginF(void) const; + float GetBottomMarginF(void) const; - Tizen::Graphics::Dimension GetContentSizeInternal(void) const; + Tizen::Graphics::FloatDimension GetContentSizeInternalF(void) const; protected: result SetPresenter(const _LabelPresenter& labelPresenter); @@ -126,7 +139,7 @@ private: _LabelPresenter* __pLabelPresenter; Tizen::Base::String __text; - int __textSize; + float __textSize; HorizontalAlignment __horizontalAlignment; VerticalAlignment __verticalAlignment; @@ -136,8 +149,10 @@ private: Tizen::Graphics::Bitmap* __pBackgroundBitmap; Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap; - int __topMargin; - int __leftMargin; + float __leftMargin; + float __topMargin; + float __rightMargin; + float __bottomMargin; Tizen::Ui::_AccessibilityElement* __pTextElement; }; // _Label diff --git a/src/ui/inc/FUiCtrl_LabelImpl.h b/src/ui/inc/FUiCtrl_LabelImpl.h index e2e00d7..60ac211 100644 --- a/src/ui/inc/FUiCtrl_LabelImpl.h +++ b/src/ui/inc/FUiCtrl_LabelImpl.h @@ -48,11 +48,13 @@ public: class LabelSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // LabelSizeInfo public: virtual ~_LabelImpl(void); static _LabelImpl* CreateLabelImplN(Label* pControl, const Tizen::Graphics::Rectangle& bounds); + static _LabelImpl* CreateLabelImplN(Label* pControl, const Tizen::Graphics::FloatRectangle& bounds); virtual const char* GetPublicClassName(void) const; virtual const Label& GetPublic(void) const; @@ -67,19 +69,26 @@ public: result SetTextHorizontalAlignment(HorizontalAlignment alignment); result SetTextVerticalAlignment(VerticalAlignment alignment); result SetTextConfig(int size, LabelTextStyle style); + result SetTextConfig(float size, LabelTextStyle style); result SetMargin(int topMargin, int leftMargin); + result SetMargin(float topMargin, float leftMargin); Tizen::Base::String GetText(void) const; HorizontalAlignment GetTextHorizontalAlignment(void) const; VerticalAlignment GetTextVerticalAlignment(void) const; Tizen::Graphics::Color GetTextColor(void) const; int GetTextSize(void) const; + float GetTextSizeF(void) const; LabelTextStyle GetTextStyle(void) const; int GetTopMargin(void) const; + float GetTopMarginF(void) const; int GetLeftMargin(void) const; + float GetLeftMarginF(void) const; virtual result OnBoundsChanged(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect); + virtual result OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect); virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; public: static Tizen::Graphics::Color GetColorOnError(void); diff --git a/src/ui/inc/FUiCtrl_LabelModel.h b/src/ui/inc/FUiCtrl_LabelModel.h index 2dc876a..092945b 100644 --- a/src/ui/inc/FUiCtrl_LabelModel.h +++ b/src/ui/inc/FUiCtrl_LabelModel.h @@ -30,7 +30,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _LabelModel * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_LabelPresenter.h b/src/ui/inc/FUiCtrl_LabelPresenter.h index b9df783..85150a5 100644 --- a/src/ui/inc/FUiCtrl_LabelPresenter.h +++ b/src/ui/inc/FUiCtrl_LabelPresenter.h @@ -41,7 +41,7 @@ class _LabelModel; /** * @class _LabelPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -62,8 +62,10 @@ public: void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void SetFontInfo(unsigned long style, int size); - result SetTextConfig(int size, LabelTextStyle style); + void OnFontInfoRequested(unsigned long& style, float& size); + void SetFontInfo(unsigned long style, float size); + //result SetTextConfig(int size, LabelTextStyle style); + result SetTextConfig(float size, LabelTextStyle style); LabelTextStyle GetTextStyle(void) const; virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -98,7 +100,7 @@ private: Tizen::Ui::Animations::_VisualElement* __pBase; LabelTextStyle __textStyle; unsigned long __fontStyle; - int __fontSize; + float __fontSize; }; // _LabelPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_LanguageEvent.h b/src/ui/inc/FUiCtrl_LanguageEvent.h old mode 100644 new mode 100755 index 14269c6..171d48c --- a/src/ui/inc/FUiCtrl_LanguageEvent.h +++ b/src/ui/inc/FUiCtrl_LanguageEvent.h @@ -17,7 +17,7 @@ /** * @file FUiCtrl_LanguageEvent.h * @brief This is the header file for _LanguageEvent class. - * @version 1.0 + * @version 2.0 * * This header file contains declaration of _LanguageEvent class. */ @@ -44,7 +44,7 @@ namespace Tizen { namespace Ui { namespace Controls * The Control class has an instance of the _LanguageEvent class as a member variable. * _LanguageEvent notifies the listeners when a Keypad language is changed. * - * @since 1.0 + * @since 2.0 */ class _LanguageEvent : public Tizen::Base::Runtime::_Event diff --git a/src/ui/inc/FUiCtrl_LinkEvent.h b/src/ui/inc/FUiCtrl_LinkEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_ListBaseImpl.h b/src/ui/inc/FUiCtrl_ListBaseImpl.h index bc6134d..b92bbc8 100644 --- a/src/ui/inc/FUiCtrl_ListBaseImpl.h +++ b/src/ui/inc/FUiCtrl_ListBaseImpl.h @@ -86,8 +86,8 @@ public: void UpdateElements(const Control &source, CustomListItemStatus itemStatus); - result InsertIntoItemsList(const CustomListItem& item, int groupIndex, int itemIndex, bool updateIndexes = true); - result RemoveFromItemsList(int groupIndex, int itemIndex, bool updateIndexes = true); + result InsertIntoItemsList(const CustomListItem& item, int groupIndex, int itemIndex, bool updateIndices = true); + result RemoveFromItemsList(int groupIndex, int itemIndex, bool updateIndices = true); result SetInItemsList(const CustomListItem& item, int groupIndex, int itemIndex); void RemoveAllFromItemsList(void); @@ -113,6 +113,8 @@ public: bool IsItemNew(const CustomListItem& item) const; + virtual void OnBoundsChanged(void); + private: _ListBaseImpl(const _ListBaseImpl& rhs); _ListBaseImpl& operator =(const _ListBaseImpl& rhs); diff --git a/src/ui/inc/FUiCtrl_ListImpl.h b/src/ui/inc/FUiCtrl_ListImpl.h index d95f7d3..52fa82f 100644 --- a/src/ui/inc/FUiCtrl_ListImpl.h +++ b/src/ui/inc/FUiCtrl_ListImpl.h @@ -233,8 +233,9 @@ private: Tizen::Base::Collection::LinkedList* __pNumberElements; CustomListItemFormat* __pItemFormat; _ListItemDataProvider* __pItemProvider; - int maxCount; - bool divider; + int __maxCount; + bool __isCheckStyle; + bool __directDelete; friend class _ListItemDataProvider; friend class _CustomListItemImpl; diff --git a/src/ui/inc/FUiCtrl_ListItemBaseImpl.h b/src/ui/inc/FUiCtrl_ListItemBaseImpl.h index 9f592c4..d41ea34 100644 --- a/src/ui/inc/FUiCtrl_ListItemBaseImpl.h +++ b/src/ui/inc/FUiCtrl_ListItemBaseImpl.h @@ -26,7 +26,6 @@ #define _FUI_CTRL_LIST_ITEM_BASE_IMPL_H_ #include -#include "FUi_ITouchLongPressGestureEventListener.h" #include "FUiCtrl_IActionEventListener.h" #include "FUiCtrl_IUiListViewItemEventListener.h" @@ -40,13 +39,12 @@ class _UiListViewItemEvent; class _ListItemBaseImpl : public Tizen::Base::Object - , public Tizen::Ui::_ITouchLongPressGestureEventListener , public Tizen::Ui::Controls::_IActionEventListener , virtual public Tizen::Base::Runtime::IEventListener { public: - static _ListItemBaseImpl* CreateListItemBaseImplN(ListItemBase* pPublic, const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + static _ListItemBaseImpl* CreateListItemBaseImplN(ListItemBase* pPublic, const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); _ListItemBaseImpl(ListItemBase* pPublic); @@ -58,11 +56,11 @@ public: virtual ListItemBase& GetPublic(void); - result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); _ListViewItem* GetListViewItem(void) const; - Tizen::Graphics::Dimension GetItemSize(void) const; + Tizen::Graphics::FloatDimension GetItemSize(void) const; result SetBackgroundBitmap(ListItemDrawingStatus status, const Tizen::Graphics::Bitmap* pBitmap); @@ -78,9 +76,9 @@ public: result SetProgressValue(int value); - result SetProgressMargins(int leftMargin, int rightMargin); + result SetProgressMargins(float leftMargin, float rightMargin); - static int GetAnnexWidth(ListAnnexStyle style); + static float GetAnnexWidth(ListAnnexStyle style); ListAnnexStyle GetListItemAnnexStyle(void); @@ -94,10 +92,6 @@ public: virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); - virtual bool OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture); - - virtual bool OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture); - public: static _ListItemBaseImpl* GetInstance(ListItemBase& listItemBase); @@ -116,7 +110,7 @@ private: ListItemBase* __pPublic; _ListViewItem* __pListViewItem; - Tizen::Graphics::Dimension __itemSize; + Tizen::Graphics::FloatDimension __itemSize; ListAnnexStyle __style; _UiListViewItemEvent* __pEvent; diff --git a/src/ui/inc/FUiCtrl_ListItemCommon.h b/src/ui/inc/FUiCtrl_ListItemCommon.h index da9d5f9..20d21f4 100644 --- a/src/ui/inc/FUiCtrl_ListItemCommon.h +++ b/src/ui/inc/FUiCtrl_ListItemCommon.h @@ -38,8 +38,6 @@ class _OSP_EXPORT_ _ListItemCommon public: virtual ~_ListItemCommon(void); - virtual bool DrawItem(Tizen::Graphics::Rectangle& rcItem, ListItemState isFocused, bool itemDivider = false) = 0; - virtual int GetItemHeight(void) const; virtual void SetItemHeight(int itemHeight); diff --git a/src/ui/inc/FUiCtrl_ListViewContextItem.h b/src/ui/inc/FUiCtrl_ListViewContextItem.h index c99af06..9dcc2d1 100644 --- a/src/ui/inc/FUiCtrl_ListViewContextItem.h +++ b/src/ui/inc/FUiCtrl_ListViewContextItem.h @@ -44,11 +44,11 @@ class _ListViewContextItem : public Tizen::Ui::Controls::_TableViewItem { public: - _ListViewContextItem(int itemHeight); + _ListViewContextItem(float itemHeight); virtual ~_ListViewContextItem(void); - static _ListViewContextItem* CreateListViewContextItemN(int itemHeight); + static _ListViewContextItem* CreateListViewContextItemN(float itemHeight); bool AddElement(int elementId, const Tizen::Base::String& text, bool enable = true); @@ -58,13 +58,15 @@ public: bool AddElement(int elementId, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap, bool enable = true); - int GetElementIdFromPosition(const Tizen::Graphics::Point& position) const; + int GetElementIdFromPosition(const Tizen::Graphics::FloatPoint& position) const; void AddContextItemEventListener(Tizen::Ui::Controls::_IActionEventListener& listener); void RemoveContextItemEventListener(Tizen::Ui::Controls::_IActionEventListener& listener); - void AdjustItemBounds(Tizen::Graphics::Rectangle& bounds); + void AdjustItemBounds(Tizen::Graphics::FloatRectangle& bounds); + + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); @@ -77,15 +79,16 @@ private: bool HasElement(int elementId); - void AdjustElementLayout(void); + void AdjustElementLayout(Tizen::Graphics::FloatRectangle bounds); private: _LinkedList <_ListViewContextItemElement> __elements; - int __margin; - int __elementSpacing; - int __elementHeight; - int __textSize; + float __itemWidth; + float __margin; + float __elementSpacing; + float __elementHeight; + float __textSize; }; // _ListContextItem }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ListViewImpl.h b/src/ui/inc/FUiCtrl_ListViewImpl.h index 3d2d116..b46282c 100644 --- a/src/ui/inc/FUiCtrl_ListViewImpl.h +++ b/src/ui/inc/FUiCtrl_ListViewImpl.h @@ -28,10 +28,12 @@ #include #include "FUi_ControlImpl.h" -#include "FUi_TouchEventArg.h" +#include "FUi_ITouchLongPressGestureEventListener.h" +#include "FUi_TouchLongPressGestureDetector.h" #include "FUiCtrl_IFastScrollListener.h" #include "FUiCtrl_IScrollEventListener.h" #include "FUiCtrl_IUiListViewItemEventListener.h" +#include "FUiCtrl_ListViewTouchEventHandler.h" #include "FUiCtrl_TableView.h" namespace Tizen { namespace Ui { namespace Controls @@ -48,6 +50,7 @@ class _ListViewImpl : public _ControlImpl , public _IScrollEventListener , public _ITableViewItemEventListener + , public _ITouchLongPressGestureEventListener , public _IUiFastScrollListener , public _IUiListViewItemEventListener , virtual public Tizen::Base::Runtime::IEventListener @@ -71,6 +74,8 @@ public: result SetItemProvider(IListViewItemProvider& provider); + result SetItemProvider(IListViewItemProviderF& provider); + void AddListViewItemEventListener(IListViewItemEventListener& listener); void RemoveListViewItemEventListener(IListViewItemEventListener& listener); @@ -81,8 +86,12 @@ public: void AddScrollEventListener(IScrollEventListener& listener); + void AddScrollEventListener(IScrollEventListenerF& listener); + void RemoveScrollEventListener(IScrollEventListener& listener); + void RemoveScrollEventListener(IScrollEventListenerF& listener); + void AddUiLinkEventListener(const Tizen::Ui::IUiLinkEventListener& listener); void RemoveUiLinkEventListener(const Tizen::Ui::IUiLinkEventListener& listener); @@ -119,8 +128,12 @@ public: int GetItemIndexFromPosition(const Tizen::Graphics::Point& position) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position) const; + result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& itemIndex, int& elementId) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& itemIndex, int& elementId) const; + result SetItemDividerColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetItemDividerColor(void) const; @@ -145,11 +158,13 @@ public: bool IsInReorderingMode(void) const; + void SetScrollInputMode(ScrollInputMode mode); + + ScrollInputMode GetScrollInputMode(void) const; + virtual void OnListViewContextItemStateChanged(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status); - virtual void OnListViewItemLongPressed(Tizen::Ui::_Control& source, int groupIndex, int itemIndex, int elementId); - // _ITableViewItemEventListener virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status); @@ -183,7 +198,7 @@ public: // Event handler for _IScrollEventListener virtual void OnScrollEndReached(Tizen::Ui::_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(Tizen::Ui::_Control& source, float scrollPosition); virtual void OnScrollStopped(Tizen::Ui::_Control& source); @@ -198,6 +213,8 @@ public: virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); + virtual bool OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo); @@ -206,6 +223,12 @@ public: virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo); + virtual bool OnLongPressGestureDetected(_TouchLongPressGestureDetector& gesture); + + virtual bool OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture); + + bool GetInputEventConsumeState(void); + public: static _ListViewImpl* GetInstance(ListView& listView); @@ -224,13 +247,9 @@ private: void CheckEmptyListShowState(void); - void FirePublicTouchEvent(const _TouchInfo& touchInfo); + virtual result OnTouchEventListenerAdded(void); - void FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); - - void FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); - - _TouchEventArg* GetTouchEventArgN(const _TouchInfo& touchInfo); + virtual result OnTouchEventListenerRemoved(void); private: _ListItemEvent* __pListItemEvent; @@ -244,7 +263,9 @@ private: bool __redrawListView; _ListViewItem* __pItemNeedsLazyDeletion; - _ListViewItem* __pItemSwept; + + _ListViewTouchEventHandler* __pTouchEventHandler; + _TouchLongPressGestureDetector* __pLongPressedGesture; }; // _ListViewImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ListViewItem.h b/src/ui/inc/FUiCtrl_ListViewItem.h index d82361e..8f3e1ed 100644 --- a/src/ui/inc/FUiCtrl_ListViewItem.h +++ b/src/ui/inc/FUiCtrl_ListViewItem.h @@ -35,8 +35,6 @@ namespace Tizen { namespace Ui { class _AccessibilityElement; -class _ITouchLongPressGestureEventListener; -class _TouchLongPressGestureDetector; }} namespace Tizen { namespace Ui { namespace Controls @@ -77,12 +75,11 @@ struct _ListViewItemStateChangedInfo struct _ListViewItemElementText { - Tizen::Ui::_AccessibilityElement* pAccessibilityElement; Tizen::Ui::Animations::_VisualElement* pVE; Tizen::Graphics::_Text::TextObject* pTextObject; Tizen::Graphics::_EnrichedTextImpl* pEnrichedText; Tizen::Graphics::Color textColor[LISTVIEW_ITEM_STATUS_MAX]; - int textSize; + float textSize; bool cutlinkViewModeEnabled; bool cutlinkParseEnabled; unsigned long cutlinkMaskType; @@ -110,7 +107,7 @@ struct _ListViewItemElement _ListViewItemElementText* pTextElement; _ListViewItemElementBitmap* pBitmapElement; _ListViewItemElementCustom* pCustomElement; - Tizen::Graphics::Rectangle bounds; + Tizen::Graphics::FloatRectangle bounds; }; class _ListViewItemHitTestVEDelegator @@ -128,26 +125,22 @@ class _ListViewItem : public Tizen::Ui::Controls::_TableViewItem { public: - _ListViewItem(int itemHeight); + _ListViewItem(float itemHeight); virtual ~_ListViewItem(void); - static _ListViewItem* CreateListViewItemN(int itemHeight); + static _ListViewItem* CreateListViewItemN(float itemHeight); void SetListViewItemType(ListViewItemType type); - void AddTouchLongPressGestureEventListener(Tizen::Ui::_ITouchLongPressGestureEventListener& listener); + result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = false); - void RemoveTouchLongPressGestureEventListener(Tizen::Ui::_ITouchLongPressGestureEventListener& listener); + result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::EnrichedText* pEnrichedText, bool textSliding = false); - result AddElement(Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Base::String& text, bool textSliding = false); - - result AddElement(Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::EnrichedText* pEnrichedText, bool textSliding = false); - - result AddElement(Tizen::Graphics::Rectangle& rect, int elementId, const Tizen::Graphics::Bitmap* pNormalBitmap, + result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = null, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null); - result AddElement(Tizen::Graphics::Rectangle& rect, int elementId, const _ICustomElement* pCustom); + result AddElement(Tizen::Graphics::FloatRectangle& rect, int elementId, const _ICustomElement* pCustom); bool DeleteElement(int elementId); @@ -163,7 +156,7 @@ public: void ClearLastStateChangedInfo(void); - int GetElementIdFromPosition(const Tizen::Graphics::Point& position) const; + int GetElementIdFromPosition(const Tizen::Graphics::FloatPoint& position) const; int GetElementIdFromCurrentTouchPosition(void) const; @@ -183,7 +176,7 @@ public: bool SetTextWrapType(int elementId, Tizen::Graphics::_Text::TextObjectWrapType wrapType); - bool SetTextSize(int elementId, int textSize); + bool SetTextSize(int elementId, float textSize); bool SetTextColor(int elementId, Tizen::Graphics::Color textColor, ListViewItemDrawingStatus status = LISTVIEW_ITEM_STATUS_NORMAL); @@ -191,7 +184,7 @@ public: bool SetProgressValue(int value); - bool SetProgressMargins(int leftMargin, int rightMargin); + bool SetProgressMargins(float leftMargin, float rightMargin); bool SetDescriptionText(const Tizen::Base::String& text); @@ -206,12 +199,16 @@ public: // Window event handler virtual void OnDraw(void); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); + virtual void OnBoundsChanged(void); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); + virtual void OnAncestorEnableStateChanged(const _Control& control); // Touch event handler @@ -247,17 +244,17 @@ private: void DrawElements(void); - bool DrawText(Tizen::Graphics::Rectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementText* pText); + bool DrawText(Tizen::Graphics::FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementText* pText); - bool DrawBitmap(Tizen::Graphics::Rectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementBitmap* pBitmap); + bool DrawBitmap(Tizen::Graphics::FloatRectangle& rect, ListViewItemDrawingStatus status, _ListViewItemElementBitmap* pBitmap); void DrawDivider(void); - int GetDescriptionTextHeight(void); + float GetDescriptionTextHeight(void); void AdjustProgressBounds(void); - Tizen::Graphics::Font* GetFont(unsigned long fontStyle, int fontSize); + Tizen::Graphics::Font* GetFont(unsigned long fontStyle, float fontSize); // TextSlide void StartTextSlideTimer(void); @@ -273,29 +270,32 @@ private: // UiLink bool ParseCutlinkText(_ListViewItemElementText* pText); - bool IsCutlinkTextSelected(const Tizen::Graphics::Point& position, int* index, _ListViewItemUiLinkInfo** ppInfo) const; + bool IsCutlinkTextSelected(const Tizen::Graphics::FloatPoint& position, int* index, _ListViewItemUiLinkInfo** ppInfo) const; - bool SetCutlinkTextFocus(const Tizen::Graphics::Point& position); + bool SetCutlinkTextFocus(const Tizen::Graphics::FloatPoint& position); bool ResetCutlinkFocus(void); - void SetAccessibilityElement(void); + virtual void SetAccessibilityElement(void); + + virtual void SetAccessibilityElementLabel(void); private: - static const int TOUCH_LONGPRESSED_EVENT_DURATION = 300; static const int TEXT_SLIDING_TIMER_DURATION = 60; _LinkedList <_ListViewItemElement> __elements; ListViewItemType __itemType; + bool __needAlignContextItem; + bool __touchPressed; int __selectedElementId; - int __progressLeftMargin; + float __progressLeftMargin; - int __progressRightMargin; + float __progressRightMargin; _Progress* __pProgress; @@ -313,11 +313,11 @@ private: unsigned long __fontStyle; - int __fontSize; + float __fontSize; Tizen::Base::String __fontName; - Tizen::Graphics::Point __prevTouchPos; // for UiLink + Tizen::Graphics::FloatPoint __prevTouchPos; // for UiLink Tizen::Base::Runtime::Timer* __pTextSlideTimer; @@ -325,9 +325,9 @@ private: _ListViewItemHitTestVEDelegator __hitTestVEDelegator; - _TouchLongPressGestureDetector* __pLongPressedGesture; - _IActionEventListener* __pContextItemEventListener; + + Tizen::Ui::_AccessibilityElement* __pAccessibilityElement; }; // _ListViewItem }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ListViewItemProviderAdaptor.h b/src/ui/inc/FUiCtrl_ListViewItemProviderAdaptor.h index e85b90d..a31e80e 100644 --- a/src/ui/inc/FUiCtrl_ListViewItemProviderAdaptor.h +++ b/src/ui/inc/FUiCtrl_ListViewItemProviderAdaptor.h @@ -27,6 +27,7 @@ #include #include +#include #include "FUiCtrl_IUiListViewItemEventListener.h" #include "FUiCtrl_LinkedList.h" #include "FUiCtrl_TableViewItemProviderAdaptor.h" @@ -43,11 +44,13 @@ class _ListViewItemProviderAdaptor public: // Lifecycle _ListViewItemProviderAdaptor(const IListViewItemProvider& provider); + _ListViewItemProviderAdaptor(const IListViewItemProviderF& provider); virtual ~_ListViewItemProviderAdaptor(void); // Operation void SetItemProvider(const IListViewItemProvider& provider); + void SetItemProvider(const IListViewItemProviderF& provider); virtual _IListItemCommon* LoadItem(int groupIndex, int itemIndex); @@ -61,9 +64,9 @@ public: virtual int GetGroupCount(void) const; - virtual int GetDefaultItemHeight(void); + virtual float GetDefaultItemHeight(void); - virtual int GetDefaultGroupItemHeight(void); + virtual float GetDefaultGroupItemHeight(void); bool SetDescriptionTextShowState(int itemIndex, bool show); @@ -83,13 +86,15 @@ private: // Variable private: IListViewItemProvider* __pListViewProvider; + IListViewItemProviderF* __pListViewProviderF; _LinkedList __descriptionTextShowItem; _IUiListViewItemEventListener* __pEventListener; Tizen::Base::String __fontName; - int __itemAverageHeight; + float __itemAverageHeight; int __itemLoadedCount; int __countOfAllItems; _ListViewItem* __pItemNeedsLazyDeletion; + bool __usingFloatingPoint; }; // _ListViewItemProviderAdaptor }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ListViewModel.h b/src/ui/inc/FUiCtrl_ListViewModel.h index 8293d73..5ab1af6 100644 --- a/src/ui/inc/FUiCtrl_ListViewModel.h +++ b/src/ui/inc/FUiCtrl_ListViewModel.h @@ -71,12 +71,8 @@ public: result RegisterItemProviderAdaptor(const _IListItemProviderAdaptor* pProviderAdaptor); //item handling ( Add / Insert / Delete / Get ) - _IListItemCommon* GetGroup(int groupIndex) const; - _IListItemCommon* LoadItem(int groupIndex, int itemIndex); - _IListItemCommon* GetItemFromContainer(int groupIndex, int itemIndex) const; - _IListItemCommon* GetItemFromTemporaryBuffer(int groupIndex, int itemIndex); bool IsValidItem(int groupIndex, int itemIndex) const; @@ -135,10 +131,10 @@ public: int GetItemCountInGroup(int groupIndex) const; - // for group Expand/Collapse - result SetGroupExpandState(int groupIndex, bool state); + // for group Expand/Collapse + result SetGroupExpandState(int groupIndex, bool state); - bool IsGroupExpanded(int groupIndex) const; + bool IsGroupExpanded(int groupIndex) const; void SetAllLoadedItemStateChanged(bool state); @@ -160,6 +156,8 @@ private: _ListViewGroupNode* GetGroupNode(int groupIndex) const; + _IListItemCommon* GetItemFromContainer(int groupIndex, int itemIndex) const; + private: _ListViewModel(const _ListViewModel& rhs); @@ -183,6 +181,8 @@ private: // member variables for model int __sizeOfCachingItems; bool __overflowItemsRemovingEnabled; + + bool __onRemovingAllItems; }; // _ListViewModel }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ListViewTouchEventHandler.h b/src/ui/inc/FUiCtrl_ListViewTouchEventHandler.h new file mode 100644 index 0000000..ec8688a --- /dev/null +++ b/src/ui/inc/FUiCtrl_ListViewTouchEventHandler.h @@ -0,0 +1,89 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiCtrl_ListViewTouchEventHandler.h + * @brief This is the header file for the _ListViewTouchEventHandler class. + * + * This header file contains the declarations of the _ListViewTouchEventHandler class. + */ + +#ifndef _FUI_CTRL_INTERNAL_LIST_VIEW_TOUCH_EVENT_HANDLER_H_ +#define _FUI_CTRL_INTERNAL_LIST_VIEW_TOUCH_EVENT_HANDLER_H_ + +#include "FUi_Control.h" +#include "FUi_ControlImpl.h" +#include "FUi_ControlManager.h" +#include "FUi_TouchManager.h" +#include "FUi_TouchEventArg.h" + +namespace Tizen { namespace Ui { namespace Controls +{ +enum ListViewStyle +{ + LIST_VIEW_STYLE_SIMPLE, + LIST_VIEW_STYLE_GROUPED +}; + +class _ListViewTouchEventHandler + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + _ListViewTouchEventHandler(_ControlImpl& impl, ListViewStyle style); + + ~_ListViewTouchEventHandler(void); + + bool ProcessTouchEventListener(const _TouchInfo& touchinfo); + + bool ProcessTouchEventListener(void); + +private: + _ListViewTouchEventHandler(const _ListViewTouchEventHandler& rhs); + + _ListViewTouchEventHandler& operator =(const _ListViewTouchEventHandler& rhs); + + void ProcessTouchEvent(const _TouchInfo& touchinfo); + + bool ProcessTouchDoublePressed(const _TouchInfo& touchinfo); + + void FirePublicListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); + + void FireFocusListener(ITouchEventListener& listener, const TouchEventInfo& touchEventInfo); + + _TouchEventArg* GetTouchEventArgN(const _TouchInfo& touchInfo); + +private: + static const int DOUBLE_PRESS_TIME = 500; + static const int DOUBLE_PRESS_MOVE_ALLOWANCE = 10; + + _ControlImpl& __impl; + _Control& __core; + Control& __public; + _TouchManager* __pTouchManager; + + ListViewStyle __style; + + unsigned int __oldPreviousPressedTime; + unsigned int __previousPressedTime; + unsigned int __currentPressedTime; + Tizen::Graphics::FloatPoint __previousPressedPoint; + Tizen::Graphics::FloatPoint __currentPressedPoint; +}; // _ListViewTouchEventHandler + +}}} // Tizen::Ui::Controls + +#endif // _FUI_CTRL_INTERNAL_LIST_VIEW_TOUCH_EVENT_HANDLER_H_ diff --git a/src/ui/inc/FUiCtrl_MessageBox.h b/src/ui/inc/FUiCtrl_MessageBox.h index 30cb407..63966d5 100644 --- a/src/ui/inc/FUiCtrl_MessageBox.h +++ b/src/ui/inc/FUiCtrl_MessageBox.h @@ -38,7 +38,7 @@ class _MessageBoxPresenter; /** * @class _MessageBox * @brief - * @since 1.0 + * @since 2.0 * * * @@ -61,7 +61,7 @@ public: virtual result ShowAndWait(int& modalResult); - int GetTotalHeight(void) const; + float GetTotalHeight(void) const; virtual void OnDraw(void); diff --git a/src/ui/inc/FUiCtrl_MessageBoxImpl.h b/src/ui/inc/FUiCtrl_MessageBoxImpl.h index 16e23c0..56b85a1 100644 --- a/src/ui/inc/FUiCtrl_MessageBoxImpl.h +++ b/src/ui/inc/FUiCtrl_MessageBoxImpl.h @@ -55,7 +55,7 @@ public: virtual result ShowAndWait(int& modalResult); - Tizen::Graphics::Rectangle GetCenterAlignRect(int width, int height) const; + Tizen::Graphics::FloatRectangle GetCenterAlignRect(float width, float height) const; virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); diff --git a/src/ui/inc/FUiCtrl_MessageBoxPresenter.h b/src/ui/inc/FUiCtrl_MessageBoxPresenter.h index a6ef420..d59a882 100644 --- a/src/ui/inc/FUiCtrl_MessageBoxPresenter.h +++ b/src/ui/inc/FUiCtrl_MessageBoxPresenter.h @@ -41,7 +41,7 @@ class _Scroll; /** * @class _MessageBoxPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -78,10 +78,10 @@ public: //Accessor public: - int GetBodyTextHeight(void) const; + float GetBodyTextHeight(void) const; - Tizen::Graphics::Rectangle GetTitleBounds(void) const; - Tizen::Graphics::Rectangle GetTextBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; + Tizen::Graphics::FloatRectangle GetTextBounds(void) const; protected: virtual void ProcessEvent(void); @@ -93,8 +93,8 @@ private: result CreateButtons(void); void FindButtonAndResult(const _ControlHandle handle); - int CalculateButtonAreaHeight(void); - Tizen::Graphics::Rectangle CalculateButtonPositionAndSize(int buttonIndex); + float CalculateButtonAreaHeight(void); + Tizen::Graphics::FloatRectangle CalculateButtonPositionAndSize(int buttonIndex); void SetReturnValue(MessageBoxModalResult rtn); int GetReturnValue(void) const; @@ -134,7 +134,7 @@ private: bool __buttonPressFlag; bool __buttonReleaseState; - Tizen::Graphics::Point __point; + Tizen::Graphics::FloatPoint __point; }; // class _MessageBoxButtonListener @@ -158,18 +158,18 @@ private: Tizen::Graphics::_Text::TextObject* __pTitleTextObject; Tizen::Graphics::_Text::TextObject* __pBodyTextObject; - Tizen::Graphics::Rectangle __titleBounds; - Tizen::Graphics::Rectangle __textBounds; + Tizen::Graphics::FloatRectangle __titleBounds; + Tizen::Graphics::FloatRectangle __textBounds; Tizen::Ui::Controls::_Scroll* __pScroll; unsigned long __fontStyle; int __fontSize; - int __scrollPos; + float __scrollPos; int __buttonNum; - int __prevPositionY; - int __textObjHeight; + float __prevPositionY; + float __textObjHeight; bool __touchPressFlag; bool __scrollStart; diff --git a/src/ui/inc/FUiCtrl_OptionMenu.h b/src/ui/inc/FUiCtrl_OptionMenu.h index 79d6bb9..0a8ef57 100644 --- a/src/ui/inc/FUiCtrl_OptionMenu.h +++ b/src/ui/inc/FUiCtrl_OptionMenu.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenu.h * @brief This is the header file for the _OptionMenu class. diff --git a/src/ui/inc/FUiCtrl_OptionMenuImpl.h b/src/ui/inc/FUiCtrl_OptionMenuImpl.h index aed49d5..9ddafe8 100644 --- a/src/ui/inc/FUiCtrl_OptionMenuImpl.h +++ b/src/ui/inc/FUiCtrl_OptionMenuImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuImpl.h * @brief This is the header file for the _OptionMenuImpl class. diff --git a/src/ui/inc/FUiCtrl_OptionMenuItem.h b/src/ui/inc/FUiCtrl_OptionMenuItem.h index 638cfbc..8ec2820 100644 --- a/src/ui/inc/FUiCtrl_OptionMenuItem.h +++ b/src/ui/inc/FUiCtrl_OptionMenuItem.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuItem.h * @brief This is the header file for the _OptionMenuItem class. diff --git a/src/ui/inc/FUiCtrl_OptionMenuModel.h b/src/ui/inc/FUiCtrl_OptionMenuModel.h index c7bd9b5..70f7b0a 100644 --- a/src/ui/inc/FUiCtrl_OptionMenuModel.h +++ b/src/ui/inc/FUiCtrl_OptionMenuModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuModel.h * @brief This is the header file for the _OptionMenuModel class. diff --git a/src/ui/inc/FUiCtrl_OptionMenuPresenter.h b/src/ui/inc/FUiCtrl_OptionMenuPresenter.h index 3a58250..f695ff6 100644 --- a/src/ui/inc/FUiCtrl_OptionMenuPresenter.h +++ b/src/ui/inc/FUiCtrl_OptionMenuPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OptionMenuPresenter.h * @brief This is the header file for the _OptionMenuPresenter class. @@ -196,10 +197,14 @@ private: Tizen::Graphics::Bitmap* __pHandlePressedEffectBitmap; + Tizen::Graphics::Bitmap* __pHandleDisabledBitmap; + Tizen::Graphics::Bitmap* __pHandleArrowNormalBitmap; Tizen::Graphics::Bitmap* __pHandleArrowPressedBitmap; + Tizen::Graphics::Bitmap* __pHandleArrowDisabledBitmap; + Tizen::Graphics::_Text::TextObject __textObject; Tizen::Graphics::Font* __pFont; diff --git a/src/ui/inc/FUiCtrl_OverlayAgent.h b/src/ui/inc/FUiCtrl_OverlayAgent.h index 76ca7f5..ff976bb 100644 --- a/src/ui/inc/FUiCtrl_OverlayAgent.h +++ b/src/ui/inc/FUiCtrl_OverlayAgent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OverlayAgent.h * @brief This is the header file for the _OverlayAgent class. @@ -21,12 +22,12 @@ * This header file contains the declarations of the _OverlayAgent class. * */ + #ifndef _FUI_INTERNAL_OVERLAY_AGENT_H_ #define _FUI_INTERNAL_OVERLAY_AGENT_H_ #include #include - #include #include #include @@ -38,11 +39,6 @@ namespace Tizen { namespace Base class ByteBuffer; }} // Tizen::Base -namespace Tizen { namespace Ui -{ -class _Controls; -}} // Tizen::Base - namespace Tizen { namespace Graphics { class BufferInfo; @@ -50,13 +46,25 @@ class Dimension; class Rectangle; }} // Tizen::Graphics +namespace Tizen { namespace Ui +{ +class _Controls; +}} // Tizen::Ui + namespace Tizen { namespace Ui { namespace Animations { class _VisualElement; -} } } +} } } // Tizen::Ui::Animations namespace Tizen { namespace Ui { namespace Controls { + +enum OverlayAgentEvaluationOption +{ + OVERLAY_AGENT_EVALUATION_OPTION_GREATER_THAN, + OVERLAY_AGENT_EVALUATION_OPTION_LESS_THAN, +}; + enum _OverlayAgentRotation { _OVERLAY_AGENT_ROTATION_NONE, @@ -76,11 +84,13 @@ enum _OverlayAgentRotation enum _OverlayAgentBufferPixelFormat { - _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888, + _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MIN = 0, + _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_ARGB8888 = 1, _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_RGB565, _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR, _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_NV12, - _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_UYVY + _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_UYVY, + _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX }; enum _OverlayAgentStyle @@ -101,10 +111,9 @@ public: result Draw(void); result GetBufferInfo(Tizen::Graphics::BufferInfo& bufferInfo) const; - result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, - const Tizen::Graphics::Dimension& srcDim, _OverlayAgentBufferPixelFormat srcFormat); + result SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, _OverlayAgentBufferPixelFormat srcFormat); result SetRotation(_OverlayAgentRotation rotation); - result SetDestination(const Tizen::Graphics::Dimension& dimension); + result SetDestination(const Tizen::Graphics::FloatDimension& dimension); result SetAspectRatio(bool enable); result CreatePixmap(void); @@ -117,12 +126,30 @@ public: result Show(void) const; result AdjustImageObject(void); + void SetEvasImageDirtyCallback(void); + bool GetEvasImageDirtyFlag(void) const; + void SetEvasImageDirtyFlag(bool dirty); + + result MoveChildToTop(const _Control& child); + + bool IsValidSourceDimension(const Tizen::Graphics::Dimension& dimension) const; + bool IsValidDestinationDimension(const Tizen::Graphics::FloatDimension& dimension) const; + + Tizen::Graphics::Dimension GetPrevCbImageDimension(void) const; + result SetPrevCbImageDimension(const Tizen::Graphics::Dimension& dimension); + static int GetOverlayAgentCount(void); + static result EvaluateBounds(OverlayAgentEvaluationOption option, Tizen::Graphics::Rectangle& rect, bool& modified); + static Tizen::Base::Collection::IListT* GetPixelFormatListN(void); + static int GetDstRectMinWidth(void); static int GetDstRectMinHeight(void); static int GetSrcRectMinWidth(void); static int GetSrcRectMinHeight(void); + static int GetWidthUnit(void); + static int GetHeightUnit(void); + static int GetMaxCount(void); private: result CreateImageObjectForOverlayRegion(const _Control& control, const Tizen::Graphics::Rectangle& bounds); @@ -130,28 +157,13 @@ private: result PutXvImage(void); result PutEvasImage(void); - - bool IsValidSourceDimension(const Tizen::Graphics::Dimension& dimension) const; - bool IsValidDestinationDimension(const Tizen::Graphics::Dimension& dimension) const; + static int GetValueFromRegistry(const Tizen::Base::String& key); _OverlayAgent(_OverlayAgentStyle style, const _Control& control, const Tizen::Graphics::Rectangle& bounds); - _OverlayAgent(const _OverlayAgent& rhs); _OverlayAgent& operator=(const _OverlayAgent& rhs); private: - const static int _OVERLAYAGENT_XV_PORT = 100; - - static int overlayAgentcount; - static int overlayAgentXvPortCount; - static int baseXvPort; - static bool isPortGrapped[_OVERLAYAGENT_XV_PORT]; - - static int dstRectMinWidth; - static int dstRectMinHegith; - static int srcRectMinWidth; - static int srcRectMinHegith; - Evas_Object* __pImageObject; Evas_Object* __pRenderImageObject; Evas_Object* __pSmartObject; @@ -161,7 +173,7 @@ private: Pixmap __pixmap; Tizen::Ui::Animations::_VisualElement* __pVisualElement; - Tizen::Graphics::Color __bgColor; + Tizen::Graphics::Color __bgColor; int __xvPort; bool __grabXvPort; @@ -174,10 +186,8 @@ private: bool __aspectRatio; Tizen::Graphics::Dimension __srcDimension; - Tizen::Graphics::Dimension __destDimension; Tizen::Graphics::Rectangle __pixmapPhyRect; Tizen::Graphics::Rectangle __resizeRect; - _OverlayAgentStyle __style; XvImage* __pXvImage; @@ -187,11 +197,29 @@ private: _OverlayAgentBufferPixelFormat __overlayAgentColorFormat; const Tizen::Base::ByteBuffer* __pRefUserByteBuffer; Tizen::Base::ByteBuffer* __pOrgUserByteBuffer; - Tizen::Graphics::Dimension __orgImgDimension; + Tizen::Graphics::Dimension __orgUsrImgDimension; + Tizen::Graphics::Dimension __orgCbImgDimension; + bool __evasImageDamaged; + + const static int _OVERLAYAGENT_XV_PORT = 100; + static int __overlayAgentcount; + static int __overlayAgentXvPortCount; + static int __baseXvPort; + static bool __isPortGrapped[_OVERLAYAGENT_XV_PORT]; + + // staticutil variable + static int __dstRectMinWidth; + static int __dstRectMinHegith; + static int __srcRectMinWidth; + static int __srcRectMinHegith; + static int __overlayWidthUnit; + static int __overlayHeightUnit; + static int __overlayMaxCount; + static bool __OverlayAgentBufferPixelFormat[_OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_MAX]; }; // _OverlayAgent -}}} // Tizen::Ui +}}} // Tizen::Ui::Controls #endif // _FUI_INTERNAL_OVERLAY_AGENT_H_ diff --git a/src/ui/inc/FUiCtrl_OverlayPanel.h b/src/ui/inc/FUiCtrl_OverlayPanel.h index 08eb16a..65d031a 100644 --- a/src/ui/inc/FUiCtrl_OverlayPanel.h +++ b/src/ui/inc/FUiCtrl_OverlayPanel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_OverlayPanel.h * @brief This is the header file for the _OverlayPanel class. @@ -44,20 +45,21 @@ class _OverlayPanel , virtual public Tizen::Ui::_IUiEventPreviewer { public: - static _OverlayPanel* CreateOverlayPanelN(const Tizen::Graphics::Rectangle& bounds); + static _OverlayPanel* CreateOverlayPanelN(void); virtual ~_OverlayPanel(void); - result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, + result SetInputBuffer(const Tizen::Graphics::FloatDimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat); result SetRendererRotation(OverlayPanel::Rotation rotation); result SetRendererAspectRatio(bool aspectRatio); result SetRendererSize(const Tizen::Graphics::Dimension& dimension); + result SetRendererSize(const Tizen::Graphics::FloatDimension& dimension); result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const; Tizen::Graphics::Color GetMaskingColor(void) const; -// virtual result OnAttaching(const Tizen::Ui::_Control* pParent); + //virtual result OnAttaching(const Tizen::Ui::_Control* pParent); virtual void OnDraw(void); virtual void OnVisibleStateChanged(void); //virtual result OnAttached(void); @@ -65,11 +67,10 @@ public: virtual void OnBoundsChanged(void); virtual void OnChildDetached(const _Control& child); - + virtual void OnChildAttached(const _Control& child); private: - _OverlayPanel(const Tizen::Graphics::Rectangle& bounds); - + _OverlayPanel(void); _OverlayPanel(const _OverlayPanel& rhs); _OverlayPanel& operator=(const _OverlayPanel& rhs); diff --git a/src/ui/inc/FUiCtrl_OverlayPanelImpl.h b/src/ui/inc/FUiCtrl_OverlayPanelImpl.h index 6855287..45407b6 100644 --- a/src/ui/inc/FUiCtrl_OverlayPanelImpl.h +++ b/src/ui/inc/FUiCtrl_OverlayPanelImpl.h @@ -24,7 +24,6 @@ #ifndef _FUI_CTRL_INTERNAL_OVERLAY_PANEL_IMPL_H_ #define _FUI_CTRL_INTERNAL_OVERLAY_PANEL_IMPL_H_ -#include #include #include "FUi_ContainerImpl.h" #include "FUiCtrl_OverlayPanel.h" @@ -50,17 +49,21 @@ public: class OverlayPanelSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; }; static _OverlayPanelImpl* CreateOverlayPanelImplN(OverlayPanel* pPublic, const Tizen::Graphics::Rectangle& bounds); + static _OverlayPanelImpl* CreateOverlayPanelImplN(OverlayPanel* pPublic, const Tizen::Graphics::FloatRectangle& bounds); virtual ~_OverlayPanelImpl(void); result SetInputBuffer(const Tizen::Graphics::Dimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat); + result SetInputBuffer(const Tizen::Graphics::FloatDimension& destDim, const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayPanel::BufferPixelFormat srcFormat); void SetRendererRotation(OverlayPanel::Rotation rotation); void SetRendererAspectRatio(bool fix); void SetRendererSize(const Tizen::Graphics::Dimension& dimension); + void SetRendererSize(const Tizen::Graphics::FloatDimension& dimension); result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& bufferInfo) const; Tizen::Graphics::Color GetMaskingColor(void) const; @@ -76,15 +79,18 @@ public: static const _OverlayPanelImpl* GetInstance(const OverlayPanel& overlayPanel); static result SetPixelFormatList(void); - -private: - static bool overlayPanelPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_MAX]; + static Tizen::Base::Collection::IListT* GetSupportedBufferPixelFormatListN(void); + static int GetWidthUnit(void); + static int GetHeightUnit(void); + static int GetMaxCount(void); private: _OverlayPanelImpl(OverlayPanel* pPublic, _OverlayPanel* pCore); - _OverlayPanelImpl(const _OverlayPanelImpl& rhs); _OverlayPanelImpl& operator=(const _OverlayPanelImpl& rhs); + +private: + static bool __overlayPanelPixelFomatList[]; }; // _OverlayPanelImpl }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_OverlayRegionImpl.h b/src/ui/inc/FUiCtrl_OverlayRegionImpl.h index a304074..d244ec4 100644 --- a/src/ui/inc/FUiCtrl_OverlayRegionImpl.h +++ b/src/ui/inc/FUiCtrl_OverlayRegionImpl.h @@ -26,8 +26,6 @@ #ifndef _FUI_CTRL_INTERNAL_OVERLAY_REGION_IMPL_H_ #define _FUI_CTRL_INTERNAL_OVERLAY_REGION_IMPL_H_ -#include - #include namespace Tizen { namespace Graphics @@ -39,8 +37,8 @@ class Dimension; namespace Tizen { namespace Ui { namespace Controls { -class _Form; class OverlayRegion; +class _Form; class _OverlayAgent; } } } @@ -67,36 +65,28 @@ class _OverlayRegionImpl public: virtual ~_OverlayRegionImpl(void); - Tizen::Graphics::Rectangle GetBounds(void) const; - void GetBounds(int& x, int& y, int& width, int& height) const; + Tizen::Graphics::FloatRectangle GetBounds(void) const; + void GetBounds(float& x, float& y, float& width, float& height) const; result SetInputBuffer(const Tizen::Base::ByteBuffer& srcBuffer, const Tizen::Graphics::Dimension& srcDim, OverlayRegionBufferPixelFormat srcFormat, bool isUserInput); result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& info) const; result Show(void) const; - result Construct(_Form* pParentForm, OverlayRegionType overlayRegionType, const Tizen::Graphics::Point& leftTopPos, const Tizen::Graphics::Rectangle& userDestRect, const Tizen::Graphics::Rectangle& finalPhyRect); + result Construct(_Form* pParentForm, OverlayRegionType overlayRegionType, const Tizen::Graphics::FloatRectangle& userDestRect, const Tizen::Graphics::Rectangle& finalPhyRect); OverlayRegion* CreateOverlayRegionN(void); + OverlayRegion* GetOverlayRegion(void) const; void SetFormArrayIndex(int index); - Tizen::Ui::Controls::OverlayRegion* GetOverlayRegion(void) const; void GoForeground(void); void GoBackground(void); static result IsValidOverlayRect(Tizen::Graphics::Rectangle& userRect, Tizen::Graphics::Rectangle& overlayPhysicalRect, const Tizen::Graphics::Rectangle& basePhysicalRect, bool& modified); static result SetPixelFormatList(void); - static int GetWidthUnit(void); - static int GetHeightUnit(void); - static int GetMaxCount(void); + static Tizen::Base::Collection::IListT< OverlayRegionBufferPixelFormat >* GetSupportedBufferPixelFormatListN(void); static _OverlayRegionImpl* GetInstance(OverlayRegion& overlayRegion); static const _OverlayRegionImpl* GetInstance(const OverlayRegion& overlayRegion); -public: - static int overlayRegionWidthUnit; - static int overlayRegionHeightUnit; - static int overlayRegionMaxCount; - static bool overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_MAX]; - private: _OverlayRegionImpl(void); _OverlayRegionImpl(const _OverlayRegionImpl& rhs); @@ -106,19 +96,18 @@ private: private: Tizen::Ui::Controls::_Form* __pParentForm; Tizen::Ui::Controls::OverlayRegion* __pOverlayRegion; - Tizen::Graphics::Rectangle __destRect; Tizen::Ui::Controls::OverlayRegionType __overlayRegionType; - bool __showState; - int __myIdx; + Tizen::Ui::Controls::_OverlayAgent* __pOverlayAgent; + Tizen::Graphics::FloatRectangle __destRect; + int __myIdx; int __cameraDirection; int __cameraRotation; - // Evas version - _OverlayAgent* __pOverlayAgent; + bool __showState; + static bool __overlayRegionPixelFomatList[OVERLAY_REGION_BUFFER_PIXEL_FORMAT_MAX]; friend class _Form; - }; // OverlayRegionImpl } } } //Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_Panel.h b/src/ui/inc/FUiCtrl_Panel.h index 900c869..e2f4876 100644 --- a/src/ui/inc/FUiCtrl_Panel.h +++ b/src/ui/inc/FUiCtrl_Panel.h @@ -25,7 +25,7 @@ #ifndef _FUI_CTRL_INTERNAL_PANEL_H_ #define _FUI_CTRL_INTERNAL_PANEL_H_ -#include +#include #include "FUi_Control.h" #include "FUiCtrl_PanelPresenter.h" @@ -65,7 +65,7 @@ public: // Operations public: - static _Panel* CreatePanelN(const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); + static _Panel* CreatePanelN(const Tizen::Graphics::FloatRectangle& rect, GroupStyle groupStyle = GROUP_STYLE_NONE); virtual void OnDraw(void); diff --git a/src/ui/inc/FUiCtrl_PanelImpl.h b/src/ui/inc/FUiCtrl_PanelImpl.h index 144fedb..8f138a0 100644 --- a/src/ui/inc/FUiCtrl_PanelImpl.h +++ b/src/ui/inc/FUiCtrl_PanelImpl.h @@ -45,9 +45,9 @@ class _PanelImpl public: virtual ~_PanelImpl(void); - static _PanelImpl* CreatePanelImplN(Panel* pControl, const Tizen::Graphics::Rectangle& rect, GroupStyle groupStyle, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); + static _PanelImpl* CreatePanelImplN(Panel* pControl, const Tizen::Graphics::FloatRectangle& rect, GroupStyle groupStyle, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); -//Accessor +// Accessor public: static const _PanelImpl* GetInstance(const Panel& panel); static _PanelImpl* GetInstance(Panel& panel); @@ -64,7 +64,6 @@ public: public: void SetBackgroundColor(const Tizen::Graphics::Color& color); - void SetChildBuilderBouds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation); result SetCompositeEnabled(bool enabled); bool IsCompositeEnabled(void) const; @@ -73,6 +72,8 @@ public: protected: _PanelImpl(Control* pPublic, _Control* pCore, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); + void SetChildBuilderBouds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation); + private: // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. _PanelImpl(const _PanelImpl& rhs); diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index aaec26e..daca565 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -52,7 +52,7 @@ enum PopupModalResult /** * @class _Popup * @brief - * @since 1.0 + * @since 2.0 * * * @@ -72,7 +72,7 @@ public: // Operations public: static _Popup* CreatePopupN(void); - result Initialize(bool hasTitle, const Tizen::Graphics::Rectangle& bounds); + result Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds); virtual result DoModal(int& modalResult); result EndModal(int modalResult); @@ -80,8 +80,8 @@ public: bool HasTitle(void) const; Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const; - Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; - Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; virtual void OnDraw(void); @@ -105,10 +105,8 @@ public: virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); virtual void OnBoundsChanged(void); -#if defined(MULTI_WINDOW) virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); virtual bool IsLayoutChangable(void) const; -#endif // Accessor public: @@ -124,7 +122,7 @@ public: const Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const; const Tizen::Graphics::Bitmap* GetOutlineBitmap(void) const; - Tizen::Graphics::Rectangle GetPopupClientArea(void) const; + Tizen::Graphics::FloatRectangle GetPopupClientArea(void) const; void SetReturnValue(PopupModalResult rtn); int GetPopupReturnValue(void) const; @@ -164,7 +162,7 @@ protected: private: _PopupPresenter* __pPopupPresenter; - Tizen::Graphics::Rectangle __bounds; + Tizen::Graphics::FloatRectangle __bounds; PopupModalResult __popupResult; diff --git a/src/ui/inc/FUiCtrl_PopupImpl.h b/src/ui/inc/FUiCtrl_PopupImpl.h index 7d9f59f..6c8b95e 100644 --- a/src/ui/inc/FUiCtrl_PopupImpl.h +++ b/src/ui/inc/FUiCtrl_PopupImpl.h @@ -49,8 +49,7 @@ public: class PopupSizeInfo : public _ControlImpl::SizeInfo { - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // PopupSizeInfo public: @@ -64,21 +63,21 @@ public: virtual _Popup& GetCore(void); public: - static _PopupImpl* CreatePopupImplN(Popup* pControl, const Tizen::Graphics::Dimension& dim, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); - result Initialize(bool hasTitle, const Tizen::Graphics::Dimension& dim); + static _PopupImpl* CreatePopupImplN(Popup* pControl, const Tizen::Graphics::FloatDimension& dim, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); + result Initialize(bool hasTitle, const Tizen::Graphics::FloatDimension& dim); virtual result DoModal(int& modalResult); result EndModal(int modalResult); Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const; - Tizen::Graphics::Rectangle GetClientAreaBounds(void) const; + Tizen::Graphics::FloatRectangle GetClientAreaBounds(void) const; - Tizen::Graphics::Point TranslateFromClientAreaPosition(const Tizen::Graphics::Point& clientPosition) const; - Tizen::Graphics::Point TranslateToClientAreaPosition(const Tizen::Graphics::Point& position) const; + Tizen::Graphics::FloatPoint TranslateFromClientAreaPosition(const Tizen::Graphics::FloatPoint& clientPosition) const; + Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& position) const; DataBindingContext* GetDataBindingContextN(void) const; - Tizen::Graphics::Rectangle GetCenterAlignedRect(int width, int height) const; + Tizen::Graphics::FloatRectangle GetCenterAlignedRect(float width, float height) const; virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); virtual void OnBoundsChanged(void); @@ -93,11 +92,7 @@ public: result SetTitleTextColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetTitleTextColor(void) const; - int GetMinWidth(void) const; - int GetMinHeight(void) const; - - int GetMaxWidth(void) const; - int GetMaxHeight(void) const; + bool GetXmlBounds(Tizen::Graphics::FloatRectangle& rect); public: static _PopupImpl* GetInstance(Popup& pPopup); @@ -109,10 +104,10 @@ private: protected: bool _isModal; + bool _centerAlign; private: bool __init; - bool __centerAlign; bool __callBoundsChange; }; // _PopupImpl diff --git a/src/ui/inc/FUiCtrl_PopupPresenter.h b/src/ui/inc/FUiCtrl_PopupPresenter.h old mode 100644 new mode 100755 index 56a26c6..7e781c1 --- a/src/ui/inc/FUiCtrl_PopupPresenter.h +++ b/src/ui/inc/FUiCtrl_PopupPresenter.h @@ -39,7 +39,7 @@ class _Popup; /** * @class _PopupPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -68,13 +68,14 @@ public: Tizen::Ui::Controls::_Label* GetSystemLabel(void) const; - Tizen::Graphics::Rectangle GetTitleTextBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleTextBounds(void) const; + + void UpdateEffectBounds(void); void OnActivated(void); void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void UpdateEffectBounds(void); // Touch Event Listener virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -95,14 +96,15 @@ protected: private: _Popup* __pPopup; + Tizen::Ui::Animations::_VisualElement* __pPopupVE; Tizen::Ui::Animations::_VisualElement* __pBackgroundVE; Tizen::Graphics::_Text::TextObject* __pTextObject; Tizen::Ui::Controls::_Label* __pLabelCore; - Tizen::Graphics::Rectangle __titleBounds; + Tizen::Graphics::FloatRectangle __titleBounds; - static const int POPUP_LABEL_GAP = 8; + static const int POPUP_LABEL_GAP = 8.0f; }; // _PopupPresenter diff --git a/src/ui/inc/FUiCtrl_Progress.h b/src/ui/inc/FUiCtrl_Progress.h index ea0639f..d9a7375 100644 --- a/src/ui/inc/FUiCtrl_Progress.h +++ b/src/ui/inc/FUiCtrl_Progress.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Progress.h * @brief This is the header file for the _Progress class. @@ -47,6 +48,7 @@ class _OSP_EXPORT_ _Progress DECLARE_PROPERTY("minValue", GetPropertyMinValue, SetPropertyMinValue); DECLARE_PROPERTY("maxValue", GetPropertyMaxValue, SetPropertyMaxValue); DECLARE_PROPERTY("barColor", GetPropertyBarColor, SetPropertyBarColor); + DECLARE_PROPERTY("barBackgroundColor", GetPropertyBarBackgroundColor, SetPropertyBarBackgroundColor); DECLARE_CLASS_END(); public: @@ -56,19 +58,23 @@ public: result SetValue(int value); result SetRange(int minValue, int maxValue); result SetBarColor(const Tizen::Graphics::Color& color); + result SetBarBackgroundColor(const Tizen::Graphics::Color& color); int GetValue(void) const; result GetRange(int& minValue, int& maxValue) const; Tizen::Graphics::Color GetBarColor(void) const; + Tizen::Graphics::Color GetBarBackgroundColor(void) const; int GetPercentComplete(void) const; result SetPropertyValue(const Tizen::Ui::Variant& value); result SetPropertyMinValue(const Tizen::Ui::Variant& minValue); result SetPropertyMaxValue(const Tizen::Ui::Variant& maxValue); result SetPropertyBarColor(const Tizen::Ui::Variant& barColor); + result SetPropertyBarBackgroundColor(const Tizen::Ui::Variant& barColor); Tizen::Ui::Variant GetPropertyValue(void) const; Tizen::Ui::Variant GetPropertyMinValue(void) const; Tizen::Ui::Variant GetPropertyMaxValue(void) const; Tizen::Ui::Variant GetPropertyBarColor(void) const; + Tizen::Ui::Variant GetPropertyBarBackgroundColor(void) const; virtual void OnDraw(void); virtual result OnAttachedToMainTree(void); @@ -84,6 +90,7 @@ private: private: _ProgressPresenter* __pProgressPresenter; Tizen::Graphics::Color __barColor; + Tizen::Graphics::Color __barBgColor; Tizen::Ui::_AccessibilityElement* __pAccessibilityElement; }; // _Progress diff --git a/src/ui/inc/FUiCtrl_ProgressImpl.h b/src/ui/inc/FUiCtrl_ProgressImpl.h index cf924c4..7171bed 100644 --- a/src/ui/inc/FUiCtrl_ProgressImpl.h +++ b/src/ui/inc/FUiCtrl_ProgressImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressImpl.h * @brief This is the header file for the _ProgressImpl class. @@ -50,6 +51,8 @@ public: int GetPercentComplete(void) const; result SetBarColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetBarColor(void) const; + result SetBarBackgroundColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetBarBackgroundColor(void) const; virtual const char* GetPublicClassName(void) const; virtual const Progress& GetPublic(void) const; @@ -58,6 +61,7 @@ public: virtual _Progress& GetCore(void); static _ProgressImpl* CreateProgressImplN(Progress* pControl, const Tizen::Graphics::Rectangle& bounds); + static _ProgressImpl* CreateProgressImplFN(Progress* pControl, const Tizen::Graphics::FloatRectangle& bounds); static _ProgressImpl* GetInstance(Progress& progress); static const _ProgressImpl* GetInstance(const Progress& progress); diff --git a/src/ui/inc/FUiCtrl_ProgressModel.h b/src/ui/inc/FUiCtrl_ProgressModel.h index 0039ef4..16de6ef 100644 --- a/src/ui/inc/FUiCtrl_ProgressModel.h +++ b/src/ui/inc/FUiCtrl_ProgressModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressModel.h * @brief This is the header file for the _ProgressModel class. diff --git a/src/ui/inc/FUiCtrl_ProgressPopup.h b/src/ui/inc/FUiCtrl_ProgressPopup.h old mode 100644 new mode 100755 index 870ac51..5d9f965 --- a/src/ui/inc/FUiCtrl_ProgressPopup.h +++ b/src/ui/inc/FUiCtrl_ProgressPopup.h @@ -42,7 +42,7 @@ class _ProgressPopupPresenter; /** * @class _ProgressPopup * @brief - * @since 2.0 + * @since 2.1 * * * @@ -63,7 +63,7 @@ public: // Operations public: static _ProgressPopup* CreateProgressPopupN(void); - result Initialize(bool cancelButton, bool translucent, const Tizen::Graphics::Rectangle& animationRect); + result Initialize(bool cancelButton, bool transparent, const Tizen::Graphics::FloatRectangle& animationRect); virtual result DoModal(int& modalResult); @@ -95,7 +95,7 @@ public: bool HasText(void) const; bool HasButton(void) const; - bool IsTranslucent(void) const; + bool IsTransparent(void) const; virtual result SetTitleText(const Tizen::Base::String& title); @@ -107,8 +107,8 @@ public: result UpdateBounds(void); - int GetTotalHeight(void) const; - Tizen::Graphics::Rectangle GetAnimationRect(void) const; + float GetTotalHeight(void) const; + Tizen::Graphics::FloatRectangle GetAnimationRect(void) const; protected: result SetPresenter(const _ProgressPopupPresenter& ProgressPopupPresenter); @@ -131,13 +131,13 @@ private: Tizen::Base::String __text; Tizen::Graphics::Color __textColor; - Tizen::Graphics::Rectangle __animationRect; + Tizen::Graphics::FloatRectangle __animationRect; Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement; bool __textState; bool __buttonState; - bool __isTranslucent; + bool __isTransparent; // Cancel button action ID static const int ID_PROGRESS_POPUP_CANCEL_BUTTON = 701; diff --git a/src/ui/inc/FUiCtrl_ProgressPopupEvent.h b/src/ui/inc/FUiCtrl_ProgressPopupEvent.h index 6360d74..de31b9a 100644 --- a/src/ui/inc/FUiCtrl_ProgressPopupEvent.h +++ b/src/ui/inc/FUiCtrl_ProgressPopupEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressPopupEvent.h * @brief This is the header file for _ProgressPopupEvent class. diff --git a/src/ui/inc/FUiCtrl_ProgressPopupImpl.h b/src/ui/inc/FUiCtrl_ProgressPopupImpl.h old mode 100644 new mode 100755 index dba5e2d..962bc9c --- a/src/ui/inc/FUiCtrl_ProgressPopupImpl.h +++ b/src/ui/inc/FUiCtrl_ProgressPopupImpl.h @@ -53,7 +53,7 @@ public: public: static _ProgressPopupImpl* CreateProgressPopupImplN(ProgressPopup* pControl); - result Initialize(bool cancelButton, bool translucent); + result Initialize(bool cancelButton, bool transparent); result AddProgressPopupEventListener(Tizen::Ui::IProgressPopupEventListener& listener); result RemoveProgressPopupEventListener(Tizen::Ui::IProgressPopupEventListener& listener); @@ -61,6 +61,7 @@ public: virtual result OnAttachedToMainTree(void); virtual void OnProgressPopupCanceled(void); virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); + virtual void OnBoundsChanged(void); public: virtual result SetTitleText(const Tizen::Base::String& title); @@ -73,7 +74,7 @@ public: int GetMaxTextLength(void) const; - Tizen::Graphics::Rectangle GetCenterAlignedRect(int width, int height) const; + Tizen::Graphics::FloatRectangle GetCenterAlignedRect(float width, float height) const; public: static _ProgressPopupImpl* GetInstance(ProgressPopup& pProgressPopup); diff --git a/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h b/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h old mode 100644 new mode 100755 index 46f596e..bb94d61 --- a/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h +++ b/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h @@ -39,7 +39,7 @@ class _ProgressPopup; /** * @class _ProgressPopupPresenter * @brief - * @since 1.0 + * @since 2.0 * * * @@ -57,7 +57,7 @@ public: // Operations public: - result Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool translucent, const Tizen::Graphics::Rectangle& animationRect); + result Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool transparent, const Tizen::Graphics::FloatRectangle& animationRect); void SetTitleTextObject(void); void SetTextObject(void); @@ -66,11 +66,11 @@ public: virtual result DoModal(int& modalResult); - int GetBodyTextHeight(void) const; + float GetBodyTextHeight(void) const; - Tizen::Graphics::Rectangle GetButtonBounds(void) const; - Tizen::Graphics::Rectangle GetTitleBounds(void) const; - Tizen::Graphics::Rectangle GetTextBounds(void) const; + Tizen::Graphics::FloatRectangle GetButtonBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; + Tizen::Graphics::FloatRectangle GetTextBounds(void) const; result PlayProcessAnimation(void); result StopProcessAnimation(void); @@ -92,14 +92,6 @@ private: _ProgressPopupPresenter(const _ProgressPopupPresenter& rhs); _ProgressPopupPresenter& operator =(const _ProgressPopupPresenter& rhs); - result LoadImages(void); - -private: - enum - { - MAX_PROCESS_IMAGE_COUNT = 30 - }; - //Attribute private: _ProgressPopup* __pProgressPopup; @@ -107,11 +99,9 @@ private: Tizen::Graphics::_Text::TextObject* __pTitleTextObject; Tizen::Graphics::_Text::TextObject* __pBodyTextObject; - Tizen::Graphics::Rectangle __titleBounds; - Tizen::Graphics::Rectangle __textBounds; - Tizen::Graphics::Rectangle __animationBounds; - - Tizen::Graphics::Bitmap* __pProcessImage[MAX_PROCESS_IMAGE_COUNT]; + Tizen::Graphics::FloatRectangle __titleBounds; + Tizen::Graphics::FloatRectangle __textBounds; + Tizen::Graphics::FloatRectangle __animationBounds; _Animation* __pAnimation; Tizen::Base::Collection::ArrayList* __pAnimationFrameList; @@ -119,12 +109,12 @@ private: unsigned long __fontStyle; int __fontSize; - int __textObjectHeight; + float __textObjectHeight; int __currentIndex; bool __buttonPressState; bool __cancelButton; - bool __translucent; + bool __transparent; static const int ANIMATION_REPEAT_COUNT = 100; diff --git a/src/ui/inc/FUiCtrl_ProgressPresenter.h b/src/ui/inc/FUiCtrl_ProgressPresenter.h index 0a5417a..baf3b5c 100644 --- a/src/ui/inc/FUiCtrl_ProgressPresenter.h +++ b/src/ui/inc/FUiCtrl_ProgressPresenter.h @@ -1,4 +1,4 @@ -// +/// // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_ProgressPresenter.h * @brief This is the header file for the _ProgressPresenter class. @@ -49,7 +50,7 @@ public: static _ProgressPresenter* CreateInstanceN(const _Progress& progress); result LoadResource(void); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); private: _ProgressPresenter(void); @@ -61,12 +62,14 @@ private: _ProgressModel* __pProgressModel; Tizen::Graphics::Bitmap* __pResourceBitmap; + Tizen::Graphics::Bitmap* __pResourceBarBgBitmap; Tizen::Graphics::Bitmap* __pBarResourceEffectBitmap; Tizen::Graphics::Bitmap* __pBarBgResourceEffectBitmap; Tizen::Graphics::Bitmap* __pBarColorReplacementBitmap; Tizen::Graphics::Bitmap* __pBarBgColorReplacementBitmap; Tizen::Graphics::Color __currentBarColor; + Tizen::Graphics::Color __currentBarBgColor; }; // _ProgressPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_PublicAdjustmentEvent.h b/src/ui/inc/FUiCtrl_PublicAdjustmentEvent.h index 8194094..6c39879 100644 --- a/src/ui/inc/FUiCtrl_PublicAdjustmentEvent.h +++ b/src/ui/inc/FUiCtrl_PublicAdjustmentEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicAdjustmentEvent.h * @brief This is the header file for _PublicAdjustmentEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicAnimationEvent.h b/src/ui/inc/FUiCtrl_PublicAnimationEvent.h index d2d41b7..5091706 100644 --- a/src/ui/inc/FUiCtrl_PublicAnimationEvent.h +++ b/src/ui/inc/FUiCtrl_PublicAnimationEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicAnimationEvent.h * @brief This is the header file for _PublicAnimationEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicColorChangeEvent.h b/src/ui/inc/FUiCtrl_PublicColorChangeEvent.h index 1470554..671648f 100644 --- a/src/ui/inc/FUiCtrl_PublicColorChangeEvent.h +++ b/src/ui/inc/FUiCtrl_PublicColorChangeEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicColorChangeEvent.h * @brief This is the header file for _PublicColorChangeEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicDateTimeChangeEvent.h b/src/ui/inc/FUiCtrl_PublicDateTimeChangeEvent.h index 0a3c78d..91ebccc 100644 --- a/src/ui/inc/FUiCtrl_PublicDateTimeChangeEvent.h +++ b/src/ui/inc/FUiCtrl_PublicDateTimeChangeEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicDateTimeChangeEvent.h * @brief This is the header file for the _PublicDateTimeChangeEvent and _PublicDateTimeChangeEventArg classes. diff --git a/src/ui/inc/FUiCtrl_PublicFrameEvent.h b/src/ui/inc/FUiCtrl_PublicFrameEvent.h index ad8ba86..992eb94 100644 --- a/src/ui/inc/FUiCtrl_PublicFrameEvent.h +++ b/src/ui/inc/FUiCtrl_PublicFrameEvent.h @@ -39,6 +39,8 @@ namespace Tizen { namespace Ui { namespace Controls static const int FRAME_STATE_TERMINATING = 0x08; static const int FRAME_STATE_ACTIVATED = 0x10; static const int FRAME_STATE_DEACTIVATED = 0x20; +static const int FRAME_STATE_MINIMIZED = 0x40; +static const int FRAME_STATE_RESTORED = 0x80; class Frame; diff --git a/src/ui/inc/FUiCtrl_PublicKeypadEvent.h b/src/ui/inc/FUiCtrl_PublicKeypadEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_PublicLanguageEvent.h b/src/ui/inc/FUiCtrl_PublicLanguageEvent.h old mode 100644 new mode 100755 index 3dcc930..770f934 --- a/src/ui/inc/FUiCtrl_PublicLanguageEvent.h +++ b/src/ui/inc/FUiCtrl_PublicLanguageEvent.h @@ -17,7 +17,7 @@ /** * @file FUiCtrl_PublicLanguageEvent.h * @brief This is the header file for _LanguageEvent class. - * @version 1.0 + * @version 2.0 * * This header file contains declaration of _LanguageEvent class. */ @@ -43,7 +43,7 @@ namespace Tizen { namespace Ui { namespace Controls * * _LanguageEvent notifies the listeners when a Keypad language is changed. * - * @since 1.0 + * @since 2.0 */ class _PublicLanguageEvent : public Tizen::Base::Runtime::_Event diff --git a/src/ui/inc/FUiCtrl_PublicLinkEvent.h b/src/ui/inc/FUiCtrl_PublicLinkEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_PublicProgressPopupEvent.h b/src/ui/inc/FUiCtrl_PublicProgressPopupEvent.h index 0731eb2..9fd3dd7 100644 --- a/src/ui/inc/FUiCtrl_PublicProgressPopupEvent.h +++ b/src/ui/inc/FUiCtrl_PublicProgressPopupEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicProgressPopupEvent.h * @brief This is the header file for _PublicProgressPopupEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicScrollPanelEvent.h b/src/ui/inc/FUiCtrl_PublicScrollPanelEvent.h index 22ac77d..05735ca 100644 --- a/src/ui/inc/FUiCtrl_PublicScrollPanelEvent.h +++ b/src/ui/inc/FUiCtrl_PublicScrollPanelEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicScrollPanelEvent.h * @brief This is the header file for _PublicScrollPanelEvent class. @@ -38,7 +39,7 @@ namespace Tizen { namespace Ui { namespace Controls * Defines constants used to identify ScrollPanel's Overlay status. @n * This is used for overlay keypad support. * -* @since 1.0 +* @since 2.0 */ enum ScrollPanelStatus { diff --git a/src/ui/inc/FUiCtrl_PublicSliderEvent.h b/src/ui/inc/FUiCtrl_PublicSliderEvent.h index 39c4ad0..1b37742 100644 --- a/src/ui/inc/FUiCtrl_PublicSliderEvent.h +++ b/src/ui/inc/FUiCtrl_PublicSliderEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicSliderEvent.h * @brief This is the header file for _PublicSliderEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicSplitPanelEvent.h b/src/ui/inc/FUiCtrl_PublicSplitPanelEvent.h index 245ee5e..8a85780 100644 --- a/src/ui/inc/FUiCtrl_PublicSplitPanelEvent.h +++ b/src/ui/inc/FUiCtrl_PublicSplitPanelEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicSplitPanelEvent.h * @brief This is the header file for _PublicSplitPanelEvent class. @@ -29,6 +30,7 @@ #include #include #include +#include #include namespace Tizen { namespace Ui { namespace Controls diff --git a/src/ui/inc/FUiCtrl_PublicTextBlockEvent.h b/src/ui/inc/FUiCtrl_PublicTextBlockEvent.h index 2ee3feb..b42aa49 100644 --- a/src/ui/inc/FUiCtrl_PublicTextBlockEvent.h +++ b/src/ui/inc/FUiCtrl_PublicTextBlockEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicTextBlockEvent.h * @brief This is the header file for _PublicTextBlockEvent class. diff --git a/src/ui/inc/FUiCtrl_PublicTextEvent.h b/src/ui/inc/FUiCtrl_PublicTextEvent.h index eceac3e..f6efc22 100644 --- a/src/ui/inc/FUiCtrl_PublicTextEvent.h +++ b/src/ui/inc/FUiCtrl_PublicTextEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_PublicTextEvent.h * @brief This is the header file for _PublicTextEvent class. diff --git a/src/ui/inc/FUiCtrl_RadioGroup.h b/src/ui/inc/FUiCtrl_RadioGroup.h index 71dccde..28bead8 100644 --- a/src/ui/inc/FUiCtrl_RadioGroup.h +++ b/src/ui/inc/FUiCtrl_RadioGroup.h @@ -34,7 +34,7 @@ class _RadioGroupPresenter; /** * @class _RadioGroup * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_RadioGroupImpl.h b/src/ui/inc/FUiCtrl_RadioGroupImpl.h index 5bf3fce..51670f0 100644 --- a/src/ui/inc/FUiCtrl_RadioGroupImpl.h +++ b/src/ui/inc/FUiCtrl_RadioGroupImpl.h @@ -42,6 +42,7 @@ public: class RadioGroupSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; // RadioGroupSizeInfo public: diff --git a/src/ui/inc/FUiCtrl_RadioGroupModel.h b/src/ui/inc/FUiCtrl_RadioGroupModel.h index 2886d57..6783a69 100644 --- a/src/ui/inc/FUiCtrl_RadioGroupModel.h +++ b/src/ui/inc/FUiCtrl_RadioGroupModel.h @@ -30,7 +30,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _RadioGroupModel * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_RadioGroupPresenter.h b/src/ui/inc/FUiCtrl_RadioGroupPresenter.h index 7c90753..b59c029 100644 --- a/src/ui/inc/FUiCtrl_RadioGroupPresenter.h +++ b/src/ui/inc/FUiCtrl_RadioGroupPresenter.h @@ -39,7 +39,7 @@ class _RadioGroupModel; /** * @class _RadioGroupPresenter * @brief - * @since 1.0 + * @since 2.0 * * * diff --git a/src/ui/inc/FUiCtrl_Scroll.h b/src/ui/inc/FUiCtrl_Scroll.h index 1a0c314..7de13f7 100644 --- a/src/ui/inc/FUiCtrl_Scroll.h +++ b/src/ui/inc/FUiCtrl_Scroll.h @@ -53,16 +53,16 @@ public: bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition); + float viewRange, + float scrollRange, + float scrollPosition); result SetScrollDirection(_ScrollDirection scrollDir); _ScrollDirection GetScrollDirection(void) const; - result SetScrollRange(int viewRange, int scrollRange); - void GetScrollRange(int* pViewRange, int* pScrollRange) const; - result SetScrollPosition(int scrollPosition); - int GetScrollPosition(void) const; + result SetScrollRange(float viewRange, float scrollRange); + void GetScrollRange(float* pViewRange, float* pScrollRange) const; + result SetScrollPosition(float scrollPosition); + float GetScrollPosition(void) const; void EnableFadeEffect(bool enable); bool IsEnabledFadeEffect(void) const; @@ -107,9 +107,9 @@ private: bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition); + float viewRange, + float scrollRange, + float scrollPosition); void SetPresenter(_ScrollPresenter& scrollPresenter); _ScrollPresenter& GetPresenter(void) const; diff --git a/src/ui/inc/FUiCtrl_ScrollEventArg.h b/src/ui/inc/FUiCtrl_ScrollEventArg.h index b61c96e..7d4b328 100644 --- a/src/ui/inc/FUiCtrl_ScrollEventArg.h +++ b/src/ui/inc/FUiCtrl_ScrollEventArg.h @@ -72,7 +72,7 @@ public: * @param[in] source A pointer to the Object instance which contains this instance * @param[in] scrollPosition A scroll position of the scroll */ - static _ScrollEventArg* GetScrollEventArgN(const Control& source, int scrollPosition); + static _ScrollEventArg* GetScrollEventArgN(const Control& source, float scrollPosition); /** * General getter for %_ScrollEventArg class object when fire OnScrollEndReached event @@ -103,7 +103,7 @@ public: * * @return See the comment above. */ - int GetScrollPosition(void) const; + float GetScrollPosition(void) const; /** * This method returns the ItemStatus @@ -122,14 +122,14 @@ private: * @param[in] scrollPosition A scroll position of the scroll * @param[in] scrollType A direction of the scroll */ - _ScrollEventArg(_ScrollEventType eventType, const Control& source, int scrollPosition = -1, ScrollEndEvent scrollType = SCROLL_END_EVENT_END_TOP); + _ScrollEventArg(_ScrollEventType eventType, const Control& source, float scrollPosition = -1.0f, ScrollEndEvent scrollType = SCROLL_END_EVENT_END_TOP); /** * Event source. */ _ScrollEventType __eventType; Control* __pSource; - int __scrollPosition; + float __scrollPosition; ScrollEndEvent __scrollType; }; // _ScrollEventArg diff --git a/src/ui/inc/FUiCtrl_ScrollEventTypes.h b/src/ui/inc/FUiCtrl_ScrollEventTypes.h index 33408c6..b4a9777 100644 --- a/src/ui/inc/FUiCtrl_ScrollEventTypes.h +++ b/src/ui/inc/FUiCtrl_ScrollEventTypes.h @@ -34,7 +34,8 @@ enum _ScrollEventType { SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED, SCROLL_EVENT_ON_SCROLL_END_REACHED, - SCROLL_EVENT_ON_SCROLL_STOPPED + SCROLL_EVENT_ON_SCROLL_STOPPED, + SCROLL_EVENT_ON_SCROLL_JUMP_TO_TOP }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ScrollPanel.h b/src/ui/inc/FUiCtrl_ScrollPanel.h index 606cd1b..f36b987 100644 --- a/src/ui/inc/FUiCtrl_ScrollPanel.h +++ b/src/ui/inc/FUiCtrl_ScrollPanel.h @@ -28,7 +28,6 @@ #include #include #include -#include #include "FUi_ITouchFlickGestureEventListener.h" #include "FUi_IAccessibilityListener.h" #include "FUi_AccessibilityContainer.h" @@ -80,7 +79,7 @@ class _OSP_EXPORT_ _ScrollPanel public: virtual ~_ScrollPanel(void); - static _ScrollPanel* CreateScrollPanelN(const Tizen::Graphics::Rectangle& rect + static _ScrollPanel* CreateScrollPanelN(const Tizen::Graphics::FloatRectangle& rect , ScrollPanelScrollDirection scrollDirection = SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL , bool autoResizingEnable = true , bool pageScrollEnabled = false); @@ -88,7 +87,7 @@ public: public: // delegateas virtual void OnDraw(void); - virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnBoundsChanged(void); // listener @@ -98,7 +97,9 @@ public: // scroll event listener virtual void OnScrollEndReached(_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(_Control& source, float scrollPosition); + virtual void OnScrollStopped(_Control& source); + virtual void OnScrollJumpToTop(_Control& source); // touch Event Previewer virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -120,12 +121,15 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction); + // scroll animation event listener virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount); @@ -146,25 +150,25 @@ public: virtual bool ScrollToControl(const _Control& source); // Accessor - int GetScrollPosition(void) const; - void SetScrollPosition(int position, bool withAnimation = false); + float GetScrollPosition(void) const; + void SetScrollPosition(float position, bool withAnimation = false); // scroll position - int GetVerticalScrollPosition(void) const; - void SetVerticalScrollPosition(int position); + float GetVerticalScrollPosition(void) const; + void SetVerticalScrollPosition(float position); - int GetHorizontalScrollPosition(void) const; - void SetHorizontalScrollPosition(int position); + float GetHorizontalScrollPosition(void) const; + void SetHorizontalScrollPosition(float position); // scroll area type bool IsScrollAreaAutoResizingEnabled(void) const; void SetScrollAreaAutoResizingEnabled(bool autoResizingEnable); // scroll area bounds - Tizen::Graphics::Rectangle GetScrollAreaBounds(void) const; - result SetClientAreaHeight(int height); - result SetClientAreaWidth(int width); - result SetScrollAreaBounds(Tizen::Graphics::Rectangle& bounds); + Tizen::Graphics::FloatRectangle GetScrollAreaBounds(void) const; + result SetClientAreaHeight(float height); + result SetClientAreaWidth(float width); + result SetScrollAreaBounds(Tizen::Graphics::FloatRectangle& bounds); // scroll direction ScrollPanelScrollDirection GetScrollDirection(void) const; @@ -177,8 +181,8 @@ public: bool IsPageScrollEnabled(void) const; void SetPageScrollEnabled(bool enable); - Tizen::Graphics::Dimension GetPageScrollAlignSize(void) const; - void SetPageScrollAlignSize(Tizen::Graphics::Dimension size); + Tizen::Graphics::FloatDimension GetPageScrollAlignSize(void) const; + void SetPageScrollAlignSize(Tizen::Graphics::FloatDimension size); bool IsPageScrollFlickMoveLimitedOnePage(void) const; @@ -203,8 +207,8 @@ public: _Scroll* GetHorizontalScrollBar(void) const; void SetHorizontalScrollBar(const _Scroll* pHorizontalScrollBar); - bool IsFixingClientBoundsEnable(void) const; - void SetFixingClientBoundsEnable(bool enable); + bool IsFixingClientBoundsEnabled(void) const; + void SetFixingClientBoundsEnabled(bool enable); // VE Value Animation Tizen::Ui::Animations::VisualElementValueAnimation* GetScrollingAnimation(void) const; @@ -212,7 +216,7 @@ public: // event fire result FireOnScrollEndEvent(ScrollEndEvent scrollEndEventType); result FireOnScrollPositionChangedEvent(void); - result FireOnScrollPositionChangedEvent(int scrollPosition); + result FireOnScrollPositionChangedEvent(float scrollPosition); result FireOnScrollStoppedEvent(void); result FireScrollPanelEvent(const _Control& source, CoreScrollPanelStatus scrollPanelStatus); @@ -256,7 +260,7 @@ private: // page scroll bool __pageScrollEnabled; - Tizen::Graphics::Dimension __pageScrollAlignSize; + Tizen::Graphics::FloatDimension __pageScrollAlignSize; bool __pageScrollMoveOnlyOnePageOnFlick; // scroll bar diff --git a/src/ui/inc/FUiCtrl_ScrollPanelEvent.h b/src/ui/inc/FUiCtrl_ScrollPanelEvent.h index 1707af4..e4776ea 100644 --- a/src/ui/inc/FUiCtrl_ScrollPanelEvent.h +++ b/src/ui/inc/FUiCtrl_ScrollPanelEvent.h @@ -44,7 +44,7 @@ namespace Tizen { namespace Ui { namespace Controls * Defines constants used to identify ScrollPanel's Overlay status. @n * This is used for overlay keypad support. * -* @since 1.0 +* @since 2.0 */ enum CoreScrollPanelStatus { diff --git a/src/ui/inc/FUiCtrl_ScrollPanelImpl.h b/src/ui/inc/FUiCtrl_ScrollPanelImpl.h index 4535db6..ea47e8b 100644 --- a/src/ui/inc/FUiCtrl_ScrollPanelImpl.h +++ b/src/ui/inc/FUiCtrl_ScrollPanelImpl.h @@ -46,11 +46,11 @@ public: // Operations public: - static _ScrollPanelImpl* CreateScrollPanelImplN(ScrollPanel* pPublic, const Tizen::Graphics::Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); + static _ScrollPanelImpl* CreateScrollPanelImplN(ScrollPanel* pPublic, const Tizen::Graphics::FloatRectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null); // scroll operations - int GetScrollPosition(void) const; - void SetScrollPosition(int position, bool withAnimation); + float GetScrollPosition(void) const; + void SetScrollPosition(float position, bool withAnimation); void ScrollToBottom(void) const; void ScrollToTop(void) const; @@ -58,15 +58,18 @@ public: // scroll event listener void AddScrollEventListener(IScrollEventListener& listener); void RemoveScrollEventListener(IScrollEventListener& listener); + void AddScrollEventListener(IScrollEventListenerF& listener); + void RemoveScrollEventListener(IScrollEventListenerF& listener); + // scroll event listener virtual void OnScrollEndReached(_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(_Control& source, int scrollPosition); + virtual void OnScrollPositionChanged(_Control& source, float scrollPosition); virtual void OnScrollStopped(_Control& source); - Tizen::Graphics::Rectangle GetClientAreaBounds(void) const; - result SetClientAreaHeight(int height); - result SetClientAreaWidth(int width); + Tizen::Graphics::FloatRectangle GetClientAreaBounds(void) const; + result SetClientAreaHeight(float height); + result SetClientAreaWidth(float width); ScrollPanelScrollDirection GetScrollDirection(void) const; @@ -82,7 +85,7 @@ public: ScrollInputMode GetScrollInputMode(void) const; // dirty function for OSP 2.0 - result CloseOverlayWindow(void); // deprecate on Tizen 2.0 + result CloseOverlayWindow(void); // Accessor public: diff --git a/src/ui/inc/FUiCtrl_ScrollPanelModel.h b/src/ui/inc/FUiCtrl_ScrollPanelModel.h index 4fbb406..b425709 100644 --- a/src/ui/inc/FUiCtrl_ScrollPanelModel.h +++ b/src/ui/inc/FUiCtrl_ScrollPanelModel.h @@ -29,9 +29,9 @@ namespace Tizen { namespace Graphics { -class Point; -class Rectangle; -class Dimension; +class FloatPoint; +class FloatRectangle; +class FloatDimension; }} // Tizen::Graphics @@ -54,18 +54,18 @@ public: // Accessor public: - Tizen::Graphics::Point GetCurrentScrollPosition(void) const; - void SetCurrentScrollPosition(int currentScrollHorizontalPosition, int currentScrollVerticalPosition); - void SetCurrentScrollPosition(Tizen::Graphics::Point& currentScrollPosition); + Tizen::Graphics::FloatPoint GetCurrentScrollPosition(void) const; + void SetCurrentScrollPosition(float currentScrollHorizontalPosition, float currentScrollVerticalPosition); + void SetCurrentScrollPosition(Tizen::Graphics::FloatPoint& currentScrollPosition); - int GetCurrentVerticalScrollPosition(void) const; - void SetCurrentVerticalScrollPosition(int currentScrollVerticalPosition); + float GetCurrentVerticalScrollPosition(void) const; + void SetCurrentVerticalScrollPosition(float currentScrollVerticalPosition); - int GetCurrentHorizontalScrollPosition(void) const; - void SetCurrentHorizontalScrollPosition(int currentScrollHorizontalPosition); + float GetCurrentHorizontalScrollPosition(void) const; + void SetCurrentHorizontalScrollPosition(float currentScrollHorizontalPosition); - void SetScrollAreaBounds(Tizen::Graphics::Rectangle& areaBounds); - Tizen::Graphics::Rectangle GetScrollAreaBounds(void) const; + void SetScrollAreaBounds(Tizen::Graphics::FloatRectangle& areaBounds); + Tizen::Graphics::FloatRectangle GetScrollAreaBounds(void) const; private: // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects. @@ -76,9 +76,9 @@ private: // Attribute private: - Tizen::Graphics::Point __currentScrollPosition; // x : horizontal position, y : vertical position + Tizen::Graphics::FloatPoint __currentScrollPosition; // x : horizontal position, y : vertical position - Tizen::Graphics::Rectangle __scrollAreaBounds; + Tizen::Graphics::FloatRectangle __scrollAreaBounds; }; // _ScrollPanelModel }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ScrollPanelPresenter.h b/src/ui/inc/FUiCtrl_ScrollPanelPresenter.h index 5a044e3..86815dd 100644 --- a/src/ui/inc/FUiCtrl_ScrollPanelPresenter.h +++ b/src/ui/inc/FUiCtrl_ScrollPanelPresenter.h @@ -61,7 +61,7 @@ public: virtual result Draw(void); // Control Delegator - virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnBoundsChanged(void); // Listener @@ -89,14 +89,18 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction); // scroll event listener virtual void OnScrollEndReached(_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(_Control& source, int scrollPos); + virtual void OnScrollPositionChanged(_Control& source, float scrollPosition); + virtual void OnScrollStopped(_Control& source); + virtual void OnScrollJumpToTop(_Control& source); // Timer - Tension, FlickGesture virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); @@ -121,21 +125,21 @@ public: bool IsScrollable(void) const; // scroll area - Tizen::Graphics::Rectangle GetScrollAreaBounds(void) const; - result SetClientAreaHeight(int height); - result SetClientAreaWidth(int width); - result SetScrollAreaBounds(Tizen::Graphics::Rectangle& bounds); - void SetScrollAreaBoundsInternal(Tizen::Graphics::Rectangle& bounds); + Tizen::Graphics::FloatRectangle GetScrollAreaBounds(void) const; + result SetClientAreaHeight(float height); + result SetClientAreaWidth(float width); + result SetScrollAreaBounds(Tizen::Graphics::FloatRectangle& bounds); + void SetScrollAreaBoundsInternal(Tizen::Graphics::FloatRectangle& bounds); // scroll position - void SetScrollPosition(int position, bool withAnimation); // sets and move - int GetScrollPosition(void) const; + void SetScrollPosition(float position, bool withAnimation); // sets and move + float GetScrollPosition(void) const; - int GetVerticalScrollPosition(void) const; - void SetVerticalScrollPosition(int position); + float GetVerticalScrollPosition(void) const; + void SetVerticalScrollPosition(float position); - int GetHorizontalScrollPosition(void) const; - void SetHorizontalScrollPosition(int position); + float GetHorizontalScrollPosition(void) const; + void SetHorizontalScrollPosition(float position); protected: // Update Layout @@ -143,15 +147,15 @@ protected: // Accessor const _Control* GetPressedControl(void) const; - Tizen::Graphics::Point GetPreviousTouchPosition(void) const; - Tizen::Graphics::Point GetCurrentTouchPosition(void) const; + Tizen::Graphics::FloatPoint GetPreviousTouchPosition(void) const; + Tizen::Graphics::FloatPoint GetCurrentTouchPosition(void) const; bool IsScrollAnimationRunning(void) const; // Scroll operation - virtual int ScrollToInternal(int targetPosition); - int ScrollTo(int distance); - int ScrollTo(int distance, bool withAnimation); + virtual float ScrollToInternal(float targetPosition); + float ScrollTo(float distance); + float ScrollTo(float distance, bool withAnimation); // Scrollbar operations virtual void FadeOutScrollBar(void); @@ -169,42 +173,43 @@ private: _ScrollPanelPresenter& operator =(const _ScrollPanelPresenter& rhs); // Previous Touch Event - result RunPreviewTouchPressed(const _Control& source, const _TouchInfo& touchInfo); + result RunTouchPressed(const _Control& source, const _TouchInfo& touchInfo); result RunPreviewTouchMoved(const _Control& source, const _TouchInfo& touchInfo); - result RunPreviewTouchReleased(const _Control& source, const _TouchInfo& touchInfo); - result RunPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); + result RunTouchReleased(const _Control& source, const _TouchInfo& touchInfo); + result RunTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); // Adjust Model void AdjustModel(void); // scroll - int GetScrollPositionInternal(void) const; - void SetScrollPositionInternal(int position); + float GetScrollPositionInternal(void) const; + void SetScrollPositionInternal(float position); - int GetVerticalScrollPositionInternal(void) const; - void SetVerticalScrollPositionInternal(int position); + float GetVerticalScrollPositionInternal(void) const; + void SetVerticalScrollPositionInternal(float position); - int GetHorizontalScrollPositionInternal(void) const; - void SetHorizontalScrollPositionInternal(int position); + float GetHorizontalScrollPositionInternal(void) const; + void SetHorizontalScrollPositionInternal(float position); void StopScrollingAnimation(void); - int FixScrollPositionIntoScrollAreaBounds(int position) const; - int FixScrollPositionIntoScrollAreaBounds(int position, Tizen::Graphics::Rectangle bounds, Tizen::Graphics::Rectangle scrollArea) const; + float FixScrollPositionIntoScrollAreaBounds(float position) const; + float FixScrollPositionIntoScrollAreaBounds(float position, Tizen::Graphics::FloatRectangle bounds, Tizen::Graphics::FloatRectangle scrollArea) const; // Scrollbar operations void ChangeScrollBarRange(void); - void ChangeScrollBarPosition(int position); + void ChangeScrollBarPosition(float position); // scroll to ... bool IsControlOutOfView(const _Control& control) const; void ScrollToControlWhenOutOfView(const _Control& control); // scroll bar load effect + void DoScrollBarLoadEffect(void); void StartScrollBarLoadEffectTimer(void); void StopScrollBarLoadEffectTimer(void); // Flick - int CalculateFlickAmount(int flickDistance, int flickDuration); + float CalculateFlickAmount(float flickDistance, float flickDuration); bool DoFlickGestureRecognized(_TouchFlickGestureDetector& gesture); void StartFlickScrollEffectTimer(void); @@ -212,6 +217,13 @@ private: // Attribute private: + enum _ScrollPanelScrollBarLoadEffectStatus + { + _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_UNLOAD, + _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADING, + _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADED + }; + _ScrollPanel* __pScrollPanel; _ScrollPanelModel* __pScrollPanelModel; @@ -220,8 +232,8 @@ private: bool __touchPressed; bool __scrollOccured; - Tizen::Graphics::Point __previousTouchedPosition; - Tizen::Graphics::Point __currentMovedPosition; + Tizen::Graphics::FloatPoint __previousTouchedPosition; + Tizen::Graphics::FloatPoint __currentMovedPosition; bool __scrollAnimationRunning; bool __flickRunning; @@ -231,13 +243,15 @@ private: int __flickCount; Tizen::Base::Runtime::Timer* __pScrollBarLoadEffectTimer; - bool __scrollBarFirstLoaded; + _ScrollPanelScrollBarLoadEffectStatus __scrollBarLoadEffectStatus; + bool __firstDrawn; bool __bouncing; bool __firstTouchMove; ScrollPanelScrollDirection __firstScrollMoveDirection; + bool __jumpToTopRunning; }; // _ScrollPanelPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_ScrollPresenter.h b/src/ui/inc/FUiCtrl_ScrollPresenter.h index 9a6769a..18753c5 100644 --- a/src/ui/inc/FUiCtrl_ScrollPresenter.h +++ b/src/ui/inc/FUiCtrl_ScrollPresenter.h @@ -64,16 +64,16 @@ public: bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition); + float viewRange, + float scrollRange, + float scrollPosition); result SetScrollDirection(_ScrollDirection scrollDirection); _ScrollDirection GetScrollDirection(void) const; - result SetScrollRange(int viewRange, int scrollRange); - void GetScrollRange(int* pViewRange, int* pScrollRange) const; - result SetScrollPosition(int scrollPosition); - int GetScrollPosition(void) const; + result SetScrollRange(float viewRange, float scrollRange); + void GetScrollRange(float* pViewRange, float* pScrollRange) const; + result SetScrollPosition(float scrollPosition); + float GetScrollPosition(void) const; void EnableFadeEffect(bool enable); bool IsEnabledFadeEffect(void) const; @@ -126,9 +126,9 @@ private: bool enableJumpToTop, bool enableHandler, bool visibility, - int viewRange, - int scrollRange, - int scrollPosition); + float viewRange, + float scrollRange, + float scrollPosition); result LoadResources(_ScrollDirection scrollDirection, _ControlOrientation orientation); result LoadColorConfig(void); @@ -136,21 +136,19 @@ private: result LoadShapeConfig(_ScrollDirection scrollDirection, _ControlOrientation orientation); void ReleaseBitmapResources(void); - Tizen::Graphics::Rectangle CalculateScrollCtrlBounds(_ScrollDirection scrollDirection); - Tizen::Graphics::Rectangle CalculateThumbBounds(_ScrollDirection scrollDirection); - Tizen::Graphics::Point CalculateThumbPosition(_ScrollDirection scrollDirection); - Tizen::Graphics::Dimension CalculateThumbSize(_ScrollDirection scrollDirection); - Tizen::Graphics::Rectangle CalculateHandlerBounds(_ScrollDirection scrollDirection); - Tizen::Graphics::Point CalculateHandlerPosition(_ScrollDirection scrollDirection); - Tizen::Graphics::Dimension CalculateHandlerSize(_ScrollDirection scrollDirection); - Tizen::Graphics::Rectangle CalculateJumpToTopBounds(_ScrollDirection scrollDirection); - Tizen::Graphics::Rectangle CalculateScrollingEffectFrontBounds(_ScrollDirection scrollDirection); - Tizen::Graphics::Rectangle CalculateScrollingEffectReerBounds(_ScrollDirection scrollDirection); - - result AttachScrollChild(Tizen::Ui::Animations::_VisualElement** ppScrollVe, const Tizen::Graphics::Rectangle& bounds, bool visibility); + Tizen::Graphics::FloatRectangle CalculateScrollCtrlBounds(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatRectangle CalculateThumbBounds(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatPoint CalculateThumbPosition(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatDimension CalculateThumbSize(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatRectangle CalculateHandlerBounds(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatPoint CalculateHandlerPosition(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatDimension CalculateHandlerSize(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatRectangle CalculateJumpToTopBounds(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatRectangle CalculateScrollingEffectFrontBounds(_ScrollDirection scrollDirection); + Tizen::Graphics::FloatRectangle CalculateScrollingEffectReerBounds(_ScrollDirection scrollDirection); + + result AttachScrollChild(Tizen::Ui::Animations::_VisualElement** ppScrollVe, const Tizen::Graphics::FloatRectangle& bounds, bool visibility); void DetachScrollChild(Tizen::Ui::Animations::_VisualElement** ppScrollVe, bool destroy); - Tizen::Graphics::Rectangle GetScrollChildBounds(Tizen::Ui::Animations::_VisualElement& scrollVe) const; - result SetScrollChildBounds(Tizen::Ui::Animations::_VisualElement& scrollVe, const Tizen::Graphics::Rectangle& bounds); result RelayoutScrollChildren(_ScrollDirection scrollDirection); result SetParentBouncing(float rate); @@ -162,7 +160,7 @@ private: void DrawJumpToTop(void); void DrawHandler(void); void DrawScrollingEffect(void); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); bool OnTouchPressedJumpToTop(const _Control& source, const _TouchInfo& touchinfo); bool OnTouchReleasedJumpToTop(const _Control& source, const _TouchInfo& touchinfo); @@ -181,7 +179,6 @@ private: Tizen::Ui::_Control* __pParentCtrl; _Scroll* __pScrollCtrl; - // attributes _ScrollDirection __scrollDirection; bool __enableFadeEffect; bool __enableJumpToTop; @@ -189,14 +186,9 @@ private: bool __enableScrollingEffect; bool __enableOverScrollingEffect; bool __parentUsingViewport; - int __positionMin; - int __positionMax; - int __viewRange; - int __scrollRange; - int __scrollPositionCurr; - - // additional information - int __scrollPositionPrev; + float __viewRange; + float __scrollRange; + float __scrollPositionCurr; bool __fadeIn; bool __fadeOut; bool __scrollVisibility; @@ -208,7 +200,7 @@ private: bool __needUpdateHandler; bool __needUpdateScrollingEffect; bool __handlerTouched; - int __handlerTouchedPosition; + float __handlerTouchedPosition; bool __jumpToTopPressed; _UiScrollEvent* __pScrollEvent; @@ -221,7 +213,6 @@ private: Tizen::Ui::Animations::_VisualElement* __pReerScrollingEffectVe; Tizen::Graphics::Color __thumbColor; - Tizen::Graphics::Color __jumpToTopBgColor; Tizen::Graphics::Color __jumpToTopColor; Tizen::Graphics::Color __jumpToTopColorPressed; Tizen::Graphics::Color __buttonColor; @@ -230,32 +221,32 @@ private: Tizen::Graphics::Bitmap* __pThumbBitmap; Tizen::Graphics::Bitmap* __pThumbEffectBitmap; Tizen::Graphics::Bitmap* __pJumpToTopBitmap; + Tizen::Graphics::Bitmap* __pJumpToTopPressBitmap; Tizen::Graphics::Bitmap* __pJumpToTopEfBitmap; - Tizen::Graphics::Bitmap* __pJumpToTopLeftBitmap; - Tizen::Graphics::Bitmap* __pJumpToTopLeftEfBitmap; Tizen::Graphics::Bitmap* __pButtonBitmap; Tizen::Graphics::Bitmap* __pButtonEfBitmap; Tizen::Graphics::Bitmap* __pButtonPressBitmap; + Tizen::Graphics::Bitmap* __pButtonPressEfBitmap; Tizen::Graphics::Bitmap* __pHandlerBgBitmap; Tizen::Graphics::Bitmap* __pHandlerBgEffectBitmap; Tizen::Graphics::Bitmap* __pHandlerBitmap; Tizen::Graphics::Bitmap* __pFrontScrollingEffectBitmap; Tizen::Graphics::Bitmap* __pReerScrollingEffectBitmap; - Tizen::Graphics::Dimension __thumbSizeMin; - int __thumbMargin; - Tizen::Graphics::Dimension __jumpToTopSize; - int __jumpToTopMarginRight; - int __jumpToTopMarginTop; - Tizen::Graphics::Dimension __handlerSizeMin; - int __handlerMarginLeft; - int __handlerMarginRight; - int __handlerMarginTop; - int __handlerMarginBottom; - int __scrollingEffectWidthLeft; - int __scrollingEffectWidthRight; - int __scrollingEffectHeightTop; - int __scrollingEffectHeightBottom; + Tizen::Graphics::FloatDimension __thumbSizeMin; + float __thumbMargin; + Tizen::Graphics::FloatDimension __jumpToTopSize; + float __jumpToTopMarginRight; + float __jumpToTopMarginTop; + Tizen::Graphics::FloatDimension __handlerSizeMin; + float __handlerMarginLeft; + float __handlerMarginRight; + float __handlerMarginTop; + float __handlerMarginBottom; + float __scrollingEffectWidthLeft; + float __scrollingEffectWidthRight; + float __scrollingEffectHeightTop; + float __scrollingEffectHeightBottom; Tizen::Base::Collection::HashMap __beforeBouncingMatrixHash; }; diff --git a/src/ui/inc/FUiCtrl_SearchBar.h b/src/ui/inc/FUiCtrl_SearchBar.h old mode 100644 new mode 100755 index aeaba4a..c33297a --- a/src/ui/inc/FUiCtrl_SearchBar.h +++ b/src/ui/inc/FUiCtrl_SearchBar.h @@ -61,7 +61,7 @@ class _TextEvent; /** * @class _SearchBar * @brief - * @since 2.0 + * @since 2.1 */ class _SearchBar : public _Control @@ -129,826 +129,70 @@ class _SearchBar Tizen::Ui::Variant GetPropertyContentAreaSize(void) const; public: - /** - * This is default constructor for this class. - * - * @since 2.0 - */ _SearchBar(void); - - /** - * This is the destructor for this class. - * - * @since 2.0 - */ virtual ~_SearchBar(void); static _SearchBar* CreateSearchBarN(void); - - /** - * Initializes this instance of the SearchBar control with the specified parameters. - * - * @since 2.0 - * @return An error code - * @param[in] enableSearchBarButton Set to @c true to display the search bar button, @n - * else @c false - * @param[in] keypadAction The keypad action - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the action ID of the specified item must be a positive integer. - * @exception E_SYSTEM A system error occurred. - * @remarks By default, a "Cancel" button is displayed if @c enableSearchBarButton is set to @c true. When the user presses the cancel button, - * the SearchBar control returns to SEARCH_BAR_MODE_NORMAL automatically. - */ result Initialize(bool enableSearchBarButton = true, CoreKeypadAction keypadAction = CORE_KEYPAD_ACTION_SEARCH); - - /** - * Gets the content of %Control. - * - * @since 2.0 - * @return The control that is displayed in the SearchBar's content area in SEARCH_BAR_MODE_INPUT mode, @n - * else @c null if an error occurs - * @exception E_SUCCESS The method was successful. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ Tizen::Ui::_Control* GetContent(void) const; - - /** - * Sets the content control. - * - * @since 2.0 - * @return An error code - * @param[in] pContent The control that is to be displayed in the - * SearchBar's content area. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. @n - * The following controls cannot be set as the - * content: @n - * @li All classes derived from Window class - * @li All picker classes (ex: DateTimePicker) - * @li Form - * @li Keypad - * @li OverlayPanel - * @exception E_SYSTEM A system error occurred. - * @remarks The specified content control is displayed when the SearchBar controls mode is changed to SEARCH_BAR_MODE_INPUT. - * @see GetContentAreaSize() - * @see AddSearchBarEventListener() - * @see ISearchBarEventListener - */ result SetContent(const Tizen::Ui::_Control* pContent); - - /** - * Updates the content area of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] show A Boolean flag indicating whether to perform show on the content area. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n - * -- the current mode of SearchBar prohibits the execution of the method. @n - * @exception E_SYSTEM A system error occurred. - * @remarks The method performs Invalidate() on the content area. - */ result UpdateContentArea(bool invalidate = true); - - /** - * Sets the visibility state of the content area. - * - * @since 2.0 - * @return An error code - * @param[in] visible The visibility state of the content area. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see IsContentAreaVisible() - */ result SetContentAreaVisible(bool visible); - - /** - * Checks whether the content area is visible. - * - * @since 2.0 - * @return The visibility state of the content area. - * @exception E_SUCCESS The method was successful. - * @see SetContentAreaVisible() - */ bool IsContentAreaVisible(void) const; - - /** - * Sets the size of the content area of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] size The content area size. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. @n - * -- width and height of @c size must be greater than or equal to @c 0. - * @remarks You must resize the content area when the Form's orientation is changed once you change the - - * the size of the content area. - - * @see GetContentAreaSize() - */ result SetContentAreaSize(const Tizen::Graphics::Dimension& size); - - /** - * Gets the size of the content area of the SearchBar control. - * - * @since 2.0 - * @return The size of the content area - * @remarks The content area is the area where the 'content' of the SearchBar control is displayed. The size of the content areas can - * be changed at runtime. - * @see AddSearchBarEventListener() - * @see ISearchBarEventListener - */ Tizen::Graphics::Dimension GetContentAreaSize(void) const; - - /** - * Gets the search bar mode. - * - * @since 2.0 - * @return The search bar mode - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetMode() - */ SearchBarMode GetMode(void) const; - - /** - * Determines whether the search bar mode is locked. - * - * @since 2.0 - * @return @c true if the mode is locked, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetModeLock() - */ bool IsModeLocked(void) const; - - /** - * Sets the search bar mode. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or the mode is locked. - * @exception E_SYSTEM A system error occurred. - * @see GetMode() - * @see SetModeLock() - */ result SetMode(SearchBarMode mode); - - /** - * Locks or unlocks the search bar mode. - * - * @since 2.0 - * @return An error code - * @param[in] modeLocked The mode lock - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetMode() - */ result SetModeLocked(bool modeLocked); - - /** - * Gets the search bar button's action Id - * - * @since 2.0 - * @return The action ID, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. @n - * By default, the method returns @c -1 if no user defined search bar button is set. - */ int GetButtonActionId(void) const; - - /** - * Gets the color of the search bar button for the specified state. - * - * @since 2.0 - * @return The color of the search bar button, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search bar button's status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetButtonColor() - */ Tizen::Graphics::Color GetButtonColor(SearchBarButtonStatus status) const; - - /** - * Gets the text color of the search bar button for the specified state. - * - * @since 2.0 - * @return The text color of the search bar button, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search bar button's status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ Tizen::Graphics::Color GetButtonTextColor(SearchBarButtonStatus status) const; - - /** - * Gets the state of the search bar button. - * - * @since 2.0 - * @return The state of the search bar button - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ SearchBarButtonStatus GetButtonStatus(void) const; - - /** - * Sets the user defined search bar button text. - * - * @since 2.0 - * @return An error code - * @param[in] actionId The button action ID - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the action ID of the specified item must greater than or equal to zero. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonText(const Tizen::Base::String& text); - - /** - * Sets the user defined search bar button action ID. - * - * @since 2.0 - * @return An error code - * @param[in] actionId The button action ID - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the action ID of the specified item must greater than or equal to zero. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonActionId(int actionId); - - /** - * Enables or disables the search bar button. - * - * @since 2.0 - * @return An error code - * @param[in] enabled Set to @c true to enable the search bar button, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonEnabled(bool enabled); - - /** - * Sets the search bar button's color for the specified state. - * - * @since 2.0 - * @return An error code - * @param[in] status The button status - * @param[in] color The button color to set - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetButtonColor() - */ result SetButtonColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color); - - /** - * Sets the text color of the SearchBar control's button for the specified state. - * - * @since 2.0 - * @return An error code - * @param[in] status The button status - * @param[in] color The button text color to set - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonTextColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color); - - /** - * Appends the specified character at the end of the text. - * - * @since 2.0 - * @return An error code - * @param[in] character The character to add - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result AppendCharacter(const Tizen::Base::Character& character); - - /** - * Appends the specified text at the end of the existing text. - * - * @since 1.0 - * @return An error code - * @param[in] text The text to append - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks To denote the end of a line use '\\n'. @n - * The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result AppendText(const Tizen::Base::String& text); - - /** - * Sets the text to display. - * - * @since 2.0 - * @return An error code - * @param[in] text The text to display - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks To denote the end of a line use '\\n'. @n - * The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result SetText(const Tizen::Base::String& text); - - /** - * Inserts the character at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The position to insert the character - * @param[in] character The character to insert - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the system limitation. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result InsertCharacterAt(int index, const Tizen::Base::Character& character); - - /** - * Inserts the specified text at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The position at which to insert. - * @param[in] text The text to be inserted - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds - * of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_MAX_EXCEEDED The length of the specified @c text - * exceeds the system limitation. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result InsertTextAt(int index, const Tizen::Base::String& text); - - /** - * Deletes the character at the specified position. - * - * @since 2.0 - * @return An error code - * @param[in] index The index - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified @c index is negative. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds - * of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result DeleteCharacterAt(int index); - - /** - * Clears text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result Clear(void); - - /** - * Gets the length of the text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The length of the text, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ int GetTextLength(void) const; - - /** - * Gets the text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The text of the SearchBar control, @n - * else an empty string if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetText() - */ Tizen::Base::String GetText(void) const; - - /** - * Gets a portion of text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The specified portion of the text, @n - * else an empty string if an error occurs - * @param[in] start The starting index of range - * @param[in] end The last index of range - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetText() - */ Tizen::Base::String GetText(int start, int end) const; - - /** - * Gets the limit of the length of the text. - * - * @since 2.0 - * @return The limit length, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. @n - * The default limit length is @c 500. - * @see SetLimitLength() - */ int GetLimitLength(void) const; - - /** - * Sets the limit of the length of the text. - * - * @since 2.0 - * @return An error code - * @param[in] limitLength The limit text length to set - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified limit length cannot be negative value or zero. - * @exception E_SYSTEM A system error occurred. - * @see GetLimitLength() - */ result SetLimitLength(int limitLength); - - /** - * Opens the keypad associated with the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see HideKeypad() - */ result ShowKeypad(void) const; - - /** - * Closes the keypad associated with the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see ShowKeypad() - */ result HideKeypad(void); - - /** - * Gets the text size of the search field. - * - * @since 2.0 - * @return The size of the text, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldTextSize() - */ - int GetSearchFieldTextSize(void) const; - - /** - * Sets the text size of the SearchBar control's text field. - * - * @since 2.0 - * @return An error code - * @param[in] size The text size - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified @c size cannot be negative value. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldTextSize() - */ - result SetSearchFieldTextSize(int size); - - /** - * Gets the start and the end index of the currently selected text block. - * - * @since 2.0 - * @return An error code - * @param[out] start The start index of the text block - * @param[out] end The end index of the text block - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method returns @c start = 0 and @c end = 0 if no text block is selected. - * @see ReleaseBlock() - * @see SetBlockRange() - */ + float GetSearchFieldTextSizeF(void) const; + result SetSearchFieldTextSize(float size); result GetBlockRange(int& start, int& end) const; - - /** - * Releases the selection of the current text block. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetBlockRange() - * @see SetBlockRange() - */ result ReleaseBlock(void); - - /** - * Selects the specified block of the text. - * - * @since 2.0 - * @return An error code - * @param[in] start The start index of the text block - * @param[in] end The end index of the text block - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @see ReleaseBlock() - * @see GetBlockRange() - */ result SetBlockRange(int start, int end); - - /** - * Removes the text of the selected text block. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result RemoveTextBlock(void); - - /** - * Gets the color of the SearchBar control for the specified status. - * - * @since 2.0 - * @return The color of the SearchBar control, @n - * else RGBA(0,0,0,0) if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetColor() - */ Tizen::Graphics::Color GetColor(void) const; - - /** - * Gets the color of the search field for the specified status. - * - * @since 2.0 - * @return The color, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search field status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldColor() - */ Tizen::Graphics::Color GetSearchFieldColor(SearchFieldStatus status) const; - - /** - * Gets the text color of the search field for the specified status. - * - * @since 2.0 - * @return The text color, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search field status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldTextColor() - */ Tizen::Graphics::Color GetSearchFieldTextColor(SearchFieldStatus status) const; - - /** - * Sets the background bitmap of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] bitmap The background bitmap - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); - - /** - * Sets the color of the search bar. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of SearchBar - * @param[in] color The color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetColor() - */ result SetColor(const Tizen::Graphics::Color& color); - - /** - * Sets the color of the search field for the specified status. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of search field - * @param[in] color The text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldColor() - */ result SetSearchFieldColor(SearchFieldStatus status, const Tizen::Graphics::Color& color); - - /** - * Sets the text color of the search field for the specified status. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of search field - * @param[in] color The text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldTextColor() - */ result SetSearchFieldTextColor(SearchFieldStatus status, const Tizen::Graphics::Color& color); - - /** - * Gets the guide text. - * - * @since 2.0 - * @return The guide text, @n - * else an empty string if an error occurs - * @param[in] guideText - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see GetGuideText() - */ Tizen::Base::String GetGuideText(void) const; - - /** - * Displays the specified text when there is no text in the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] guideText The guide text - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetGuideText() - */ result SetGuideText(const Tizen::Base::String& guideText); - - /** - * Gets the text color of the guide text. - * - * @since 2.0 - * @return The text color of the guide text, @n - * else RGBA(0,0,0,0) if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetGuideTextColor() - */ Tizen::Graphics::Color GetGuideTextColor(void) const; - - /** - * Sets the text color of the guide text. - * - * @since 2.0 - * @return An error code - * @param[in] color The guide text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetGuideTextColor() - */ result SetGuideTextColor(const Tizen::Graphics::Color& color); - - /** - * Gets the current cursor position index. - * - * @since 2.0 - * @return The cursor position, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetCursorPosition() - */ int GetCursorPosition(void) const; - - /** - * Sets the cursor at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The cursor index - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure, or @c index is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @see GetCursorPosition() - */ result SetCursorPosition(int index); - - /** - * Checks whether the lowercase mode is enabled. - * - * @since 2.0 - * @return @c true if the lowercase mode is enabled, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetLowerCaseModeEnabled() - */ bool IsLowerCaseModeEnabled(void) const; - - /** - * Enables or disables the lowercase mode. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable lowercase mode, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see IsLowerCaseModeEnabled() - */ void SetLowerCaseModeEnabled(bool enable); - - /** - * Gets the ellipsis position. - * - * @since 2.0 - * @return The ellipsis position - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetEllipsisPosition() - */ EllipsisPosition GetEllipsisPosition(void) const; - - /** - * Sets the ellipsis position. - * - * @since 2.0 - * @return An error code - * @param[in] position The ellipsis position - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetEllipsisPosition() - */ result SetEllipsisPosition(EllipsisPosition position); - - /** - * Gets the keypad action type. - * - * @since 2.0 - * @return The keypad action - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ CoreKeypadAction GetKeypadAction(void) const; - - /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetTextPredictionEnabled() - */ bool IsTextPredictionEnabled(void) const; - - /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see IsTextPredictionEnabled() - */ result SetTextPredictionEnabled(bool enable); result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; @@ -982,6 +226,9 @@ public: void SetContentDimming(void); bool IsContentAttachable(const _Control* pContent); result ResizeCancelButton(void); + SearchFieldStatus GetCurrentStatus(void); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo); @@ -999,6 +246,7 @@ public: virtual void OnTextValueChangeCanceled(const Tizen::Ui::_Control& source); virtual void OnBoundsChanged(void); + virtual void OnChangeLayout(_ControlOrientation orientation); virtual result OnAttachedToMainTree(void); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); @@ -1050,8 +298,9 @@ private: Tizen::Graphics::Color __textColor[SEARCHBAR_COLOR_MAX]; Tizen::Graphics::Color __buttonColor[SEARCHBAR_BUTTON_COLOR_MAX]; Tizen::Graphics::Color __buttonTextColor[SEARCHBAR_BUTTON_COLOR_MAX]; + Tizen::Graphics::Color __guideTextColor[SEARCHBAR_COLOR_MAX]; - Tizen::Graphics::Rectangle __contentAreaBounds; + Tizen::Graphics::FloatRectangle __contentAreaBounds; _ActionEvent* __pActionEvent; _KeypadEvent* __pKeypadEvent; diff --git a/src/ui/inc/FUiCtrl_SearchBarImpl.h b/src/ui/inc/FUiCtrl_SearchBarImpl.h old mode 100644 new mode 100755 index bf5e0e0..ee34197 --- a/src/ui/inc/FUiCtrl_SearchBarImpl.h +++ b/src/ui/inc/FUiCtrl_SearchBarImpl.h @@ -57,19 +57,10 @@ class _SearchBarImpl { public: static _SearchBarImpl* CreateSearchBarImplN(SearchBar* pCore, const Tizen::Graphics::Rectangle& bounds, bool enableSearchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH); + static _SearchBarImpl* CreateSearchBarImplFN(SearchBar* pCore, const Tizen::Graphics::FloatRectangle& bounds, bool enableSearchBarButton = true, KeypadAction keypadAction = KEYPAD_ACTION_SEARCH); - /** - * This is default constructor for this class. - * - * @since 2.0 - */ _SearchBarImpl(SearchBar* pPublic, _SearchBar* pCore); - /** - * This is the destructor for this class. - * - * @since 2.0 - */ virtual ~_SearchBarImpl(void); virtual const char* GetPublicClassName(void) const; @@ -78,901 +69,90 @@ public: virtual const _SearchBar& GetCore(void) const; virtual _SearchBar& GetCore(void); - /** - * Gets the content of %Control. - * - * @since 2.0 - * @return The control that is displayed in the SearchBar's content area in SEARCH_BAR_MODE_INPUT mode, @n - * else @c null if an error occurs - * @exception E_SUCCESS The method was successful. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ Tizen::Ui::Control* GetContent(void) const; - - /** - * Sets the content control. - * - * @since 2.0 - * @return An error code - * @param[in] pContent The control that is to be displayed in the - * SearchBar's content area. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. @n - * The following controls cannot be set as the - * content: @n - * @li All classes derived from Window class - * @li All picker classes (ex: DateTimePicker) - * @li Form - * @li Keypad - * @li OverlayPanel - * @exception E_SYSTEM A system error occurred. - * @remarks The specified content control is displayed when the SearchBar controls mode is changed to SEARCH_BAR_MODE_INPUT. - * @see GetContentAreaSize() - * @see AddSearchBarEventListener() - * @see ISearchBarEventListener - */ result SetContent(const Tizen::Ui::Control* pContent); - - /** - * Updates the content area of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] show A Boolean flag indicating whether to perform show on the content area. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n - * -- the current mode of SearchBar prohibits the execution of the method. @n - * @exception E_SYSTEM A system error occurred. - * @remarks The method performs Invalidate() on the content area. - */ result UpdateContentArea(bool invalidate = true); - - /** - * Sets the visibility state of the content area. - * - * @since 2.0 - * @return An error code - * @param[in] visible The visibility state of the content area. - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see IsContentAreaVisible() - */ result SetContentAreaVisible(bool visible); - - /** - * Checks whether the content area is visible. - * - * @since 2.0 - * @return The visibility state of the content area. - * @exception E_SUCCESS The method was successful. - * @see SetContentAreaVisible() - */ bool IsContentAreaVisible(void) const; - - /** - * Sets the size of the content area of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] size The content area size. - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid. @n - * -- width and height of @c size must be greater than or equal to @c 0. - * @remarks You must resize the content area when the Form's orientation is changed once you change the - - * the size of the content area. - - * @see GetContentAreaSize() - */ result SetContentAreaSize(const Tizen::Graphics::Dimension& size); - - /** - * Gets the size of the content area of the SearchBar control. - * - * @since 2.0 - * @return The size of the content area - * @remarks The content area is the area where the 'content' of the SearchBar control is displayed. The size of the content areas can - * be changed at runtime. - * @see AddSearchBarEventListener() - * @see ISearchBarEventListener - */ + result SetContentAreaSize(const Tizen::Graphics::FloatDimension& size); Tizen::Graphics::Dimension GetContentAreaSize(void) const; - - /** - * Gets the search bar mode. - * - * @since 2.0 - * @return The search bar mode - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetMode() - */ + Tizen::Graphics::FloatDimension GetContentAreaSizeF(void) const; SearchBarMode GetMode(void) const; - - /** - * Determines whether the search bar mode is locked. - * - * @since 2.0 - * @return @c true if the mode is locked, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetModeLock() - */ bool IsModeLocked(void) const; - - /** - * Sets the search bar mode. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or the mode is locked. - * @exception E_SYSTEM A system error occurred. - * @see GetMode() - * @see SetModeLock() - */ result SetMode(SearchBarMode mode); - - /** - * Locks or unlocks the search bar mode. - * - * @since 2.0 - * @return An error code - * @param[in] modeLocked The mode lock - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetMode() - */ result SetModeLocked(bool modeLocked); - - /** - * Gets the search bar button's action Id - * - * @since 2.0 - * @return The action ID, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. @n - * By default, the method returns @c -1 if no user defined search bar button is set. - */ int GetButtonActionId(void) const; - - /** - * Gets the color of the search bar button for the specified state. - * - * @since 2.0 - * @return The color of the search bar button, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search bar button's status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetButtonColor() - */ Tizen::Graphics::Color GetButtonColor(SearchBarButtonStatus status) const; - - /** - * Gets the text color of the search bar button for the specified state. - * - * @since 2.0 - * @return The text color of the search bar button, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search bar button's status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ Tizen::Graphics::Color GetButtonTextColor(SearchBarButtonStatus status) const; - - /** - * Gets the state of the search bar button. - * - * @since 2.0 - * @return The state of the search bar button - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ SearchBarButtonStatus GetButtonStatus(void) const; - - /** - * Sets the user defined search bar button. - * - * @since 2.0 - * @return An error code - * @param[in] text The button text - * @param[in] actionId The button action ID - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the action ID of the specified item must greater than or equal to zero. - * @exception E_SYSTEM A system error occurred. - */ result SetButton(const Tizen::Base::String& text, int actionId); - - /** - * Enables or disables the search bar button. - * - * @since 2.0 - * @return An error code - * @param[in] enabled Set to @c true to enable the search bar button, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonEnabled(bool enabled); - - /** - * Sets the search bar button's color for the specified state. - * - * @since 2.0 - * @return An error code - * @param[in] status The button status - * @param[in] color The button color to set - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetButtonColor() - */ result SetButtonColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color); - - /** - * Sets the text color of the SearchBar control's button for the specified state. - * - * @since 2.0 - * @return An error code - * @param[in] status The button status - * @param[in] color The button text color to set - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetButtonTextColor(SearchBarButtonStatus status, const Tizen::Graphics::Color& color); - - /** - * Appends the specified character at the end of the text. - * - * @since 2.0 - * @return An error code - * @param[in] character The character to add - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result AppendCharacter(const Tizen::Base::Character& character); - - /** - * Appends the specified text at the end of the existing text. - * - * @since 1.0 - * @return An error code - * @param[in] text The text to append - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks To denote the end of a line use '\\n'. @n - * The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result AppendText(const Tizen::Base::String& text); - - /** - * Sets the text to display. - * - * @since 2.0 - * @return An error code - * @param[in] text The text to display - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks To denote the end of a line use '\\n'. @n - * The method modifies the text buffer that is managed by the SearchBar control. @n - * To display the changes, the control must be drawn again. - */ result SetText(const Tizen::Base::String& text); - - /** - * Inserts the character at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The position to insert the character - * @param[in] character The character to insert - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_MAX_EXCEEDED The length of the specified @c text exceeds the system limitation. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result InsertCharacterAt(int index, const Tizen::Base::Character& character); - - /** - * Inserts the specified text at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The position at which to insert. - * @param[in] text The text to be inserted - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds - * of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_MAX_EXCEEDED The length of the specified @c text - * exceeds the system limitation. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result InsertTextAt(int index, const Tizen::Base::String& text); - - /** - * Deletes the character at the specified position. - * - * @since 2.0 - * @return An error code - * @param[in] index The index - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG The specified @c index is negative. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds - * of the data structure. @n - * -- @c index is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result DeleteCharacterAt(int index); - - /** - * Clears text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method modifies the text buffer that is managed by the SearchBar control. - * To display the changes, the control must be drawn again. - */ result Clear(void); - - /** - * Gets the length of the text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The length of the text, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ int GetTextLength(void) const; - - /** - * Gets the text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The text of the SearchBar control, @n - * else an empty string if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetText() - */ Tizen::Base::String GetText(void) const; - - /** - * Gets a portion of text that is displayed by the SearchBar control. - * - * @since 2.0 - * @return The specified portion of the text, @n - * else an empty string if an error occurs - * @param[in] start The starting index of range - * @param[in] end The last index of range - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetText() - */ Tizen::Base::String GetText(int start, int end) const; - - /** - * Gets the limit of the length of the text. - * - * @since 2.0 - * @return The limit length, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. @n - * The default limit length is @c 500. - * @see SetLimitLength() - */ int GetLimitLength(void) const; - - /** - * Sets the limit of the length of the text. - * - * @since 2.0 - * @return An error code - * @param[in] limitLength The limit text length to set - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified limit length cannot be negative value or zero. - * @exception E_SYSTEM A system error occurred. - * @see GetLimitLength() - */ result SetLimitLength(int limitLength); - - /** - * Opens the keypad associated with the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see HideKeypad() - */ result ShowKeypad(void) const; - - /** - * Closes the keypad associated with the SearchBar control. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see ShowKeypad() - */ result HideKeypad(void) const; - - /** - * Gets the text size of the search field. - * - * @since 2.0 - * @return The size of the text, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldTextSize() - */ int GetSearchFieldTextSize(void) const; - - /** - * Sets the text size of the SearchBar control's text field. - * - * @since 2.0 - * @return An error code - * @param[in] size The text size - * @exception E_SUCCESS The method was successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or the specified @c size cannot be negative value. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldTextSize() - */ + float GetSearchFieldTextSizeF(void) const; result SetSearchFieldTextSize(int size); - - /** - * Gets the start and the end index of the currently selected text block. - * - * @since 2.0 - * @return An error code - * @param[out] start The start index of the text block - * @param[out] end The end index of the text block - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The method returns @c start = 0 and @c end = 0 if no text block is selected. - * @see ReleaseBlock() - * @see SetBlockRange() - */ + result SetSearchFieldTextSize(float size); result GetBlockRange(int& start, int& end) const; - - /** - * Releases the selection of the current text block. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetBlockRange() - * @see SetBlockRange() - */ result ReleaseBlock(void); - - /** - * Selects the specified block of the text. - * - * @since 2.0 - * @return An error code - * @param[in] start The start index of the text block - * @param[in] end The end index of the text block - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or either the @c start or @c end parameter is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @see ReleaseBlock() - * @see GetBlockRange() - */ result SetBlockRange(int start, int end); - - /** - * Removes the text of the selected text block. - * - * @since 2.0 - * @return An error code - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result RemoveTextBlock(void); - - /** - * Gets the color of the SearchBar control for the specified status. - * - * @since 2.0 - * @return The color of the SearchBar control, @n - * else RGBA(0,0,0,0) if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetColor() - */ Tizen::Graphics::Color GetColor(void) const; - - /** - * Gets the color of the search field for the specified status. - * - * @since 2.0 - * @return The color, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search field status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldColor() - */ Tizen::Graphics::Color GetSearchFieldColor(SearchFieldStatus status) const; - - /** - * Gets the text color of the search field for the specified status. - * - * @since 2.0 - * @return The text color, @n - * else RGBA(0,0,0,0) if an error occurs - * @param[in] status The search field status - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetSearchFieldTextColor() - */ Tizen::Graphics::Color GetSearchFieldTextColor(SearchFieldStatus status) const; - - /** - * Sets the background bitmap of the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] bitmap The background bitmap - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - */ result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); - - /** - * Sets the color of the search bar. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of SearchBar - * @param[in] color The color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetColor() - */ result SetColor(const Tizen::Graphics::Color& color); - - /** - * Sets the color of the search field for the specified status. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of search field - * @param[in] color The text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldColor() - */ result SetSearchFieldColor(SearchFieldStatus status, const Tizen::Graphics::Color& color); - - /** - * Sets the text color of the search field for the specified status. - * - * @since 2.0 - * @return An error code - * @param[in] status The state of search field - * @param[in] color The text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetSearchFieldTextColor() - */ result SetSearchFieldTextColor(SearchFieldStatus status, const Tizen::Graphics::Color& color); - - /** - * Gets the guide text. - * - * @since 2.0 - * @return The guide text, @n - * else an empty string if an error occurs - * @param[in] guideText - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see GetGuideText() - */ Tizen::Base::String GetGuideText(void) const; - - /** - * Displays the specified text when there is no text in the SearchBar control. - * - * @since 2.0 - * @return An error code - * @param[in] guideText The guide text - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetGuideText() - */ result SetGuideText(const Tizen::Base::String& guideText); - - /** - * Gets the text color of the guide text. - * - * @since 2.0 - * @return The text color of the guide text, @n - * else RGBA(0,0,0,0) if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetGuideTextColor() - */ Tizen::Graphics::Color GetGuideTextColor(void) const; - - /** - * Sets the text color of the guide text. - * - * @since 2.0 - * @return An error code - * @param[in] color The guide text color - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetGuideTextColor() - */ result SetGuideTextColor(const Tizen::Graphics::Color& color); - - /** - * Gets the current cursor position index. - * - * @since 2.0 - * @return The cursor position, @n - * else @c -1 if an error occurs - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetCursorPosition() - */ int GetCursorPosition(void) const; - - /** - * Sets the cursor at the specified index. - * - * @since 2.0 - * @return An error code - * @param[in] index The cursor index - * @exception E_SUCCESS The method was successful. - * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure, or @c index is greater than the number of elements or less than zero. - * @exception E_SYSTEM A system error occurred. - * @see GetCursorPosition() - */ result SetCursorPosition(int index); - - /** - * Checks whether the lowercase mode is enabled. - * - * @since 2.0 - * @return @c true if the lowercase mode is enabled, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetLowerCaseModeEnabled() - */ bool IsLowerCaseModeEnabled(void) const; - - /** - * Enables or disables the lowercase mode. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable lowercase mode, @n - * else @c false - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see IsLowerCaseModeEnabled() - */ void SetLowerCaseModeEnabled(bool enable); - - /** - * Gets the ellipsis position. - * - * @since 2.0 - * @return The ellipsis position - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetEllipsisPosition() - */ EllipsisPosition GetEllipsisPosition(void) const; - - /** - * Sets the ellipsis position. - * - * @since 2.0 - * @return An error code - * @param[in] position The ellipsis position - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @see GetEllipsisPosition() - */ result SetEllipsisPosition(EllipsisPosition position); - - /** - * Gets the keypad action type. - * - * @since 2.0 - * @return The keypad action - * @exception E_SUCCESS The method was successful. - * @exception E_SYSTEM A system error occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - */ KeypadAction GetKeypadAction(void) const; - - /** - * Checks whether the text prediction is enabled. - * - * @since 2.0 - * @return @c true if the text prediction is enabled, @n - * else @c false - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @remarks The specific error code can be accessed using the GetLastResult() method. - * @see SetTextPredictionEnabled() - */ bool IsTextPredictionEnabled(void) const; - - /** - * Enables or disables the text prediction. - * - * @since 2.0 - * @param[in] enable Set to @c true to enable the text prediction, @n - * else @c false - * @return An error code - * @exception E_SUCCESS The method is successful. - * @exception E_SYSTEM A system error has occurred. - * @see IsTextPredictionEnabled() - */ result SetTextPredictionEnabled(bool enable); result GetCurrentLanguage(Tizen::Locales::LanguageCode& language) const; result SetCurrentLanguage(Tizen::Locales::LanguageCode languageCode); - /** - * Adds an action event listener. @n - * The added listener is notified when the user clicks the search bar button. - * - * @since 2.0 - * @param[in] listener The event listener to add - * @see RemoveActionEventListener() - */ result AddActionEventListener(Tizen::Ui::IActionEventListener& listener); - - /** - * Removes the specified action event listener. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to remove - * @see AddActionEventListener() - */ result RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener); - - /** - * Adds a text event listener. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to add - * @remarks The added listener is notified when: @n - * @li the user presses a key on the software keypad. - * @li the user selects a word in the candidate list. - * @li the user pastes a text. - * @see RemoveTextEventListener() - */ result AddTextEventListener(Tizen::Ui::ITextEventListener& listener); - - /** - * Removes the specified text event listener. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to remove - * @see AddTextEventListener() - */ result RemoveTextEventListener(Tizen::Ui::ITextEventListener& listener); - - /** - * Adds a search bar event listener. @n - * The added listener can listen to events on the specified event dispatcher's context when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to add - * @remarks The added listener is notified when: @n - * @li the user presses a key on the software keypad. - * @li the user selects a word in the candidate list. - * @li the user pastes a text. - * @see AddSearchBarEventListener() - */ result AddSearchBarEventListener(const ISearchBarEventListener& listener); - - /** - * Removes the specified search bar event listener. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to remove - * @see RemoveTextEventListener() - */ result RemoveSearchBarEventListener(const ISearchBarEventListener& listener); - - /** - * Adds a text block event listener. - * - * @since 2.0 - * @param[in] listener The event listener to add - * @remarks Programmatically, modification of the text selection does not cause - * the text block selection event to fire. - * @see RemoveTextBlockEventListener() - */ result AddTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener); - - /** - * Removes the specified text block event listener. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to remove - * @see AddTextBlockEventListener() - */ result RemoveTextBlockEventListener(Tizen::Ui::ITextBlockEventListener& listener); - - /** - * Adds a keypad event listener. @n - * The added listener is notified when the keypad associated with this text - * editor is opened or closed. - * - * @since 2.0 - * @param[in] listener The event listener to add - * @see RemoveKeypadEventListener() - */ result AddKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener); - - /** - * Removes the specified keypad event listener. @n - * The removed listener cannot listen to events when they are fired. - * - * @since 2.0 - * @param[in] listener The event listener to remove - * @see AddKeypadEventListener() - */ result RemoveKeypadEventListener(Tizen::Ui::IKeypadEventListener& listener); result AddLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); result RemoveLanguageEventListener(Tizen::Ui::ILanguageEventListener& listener); + void SetEditTextFilter(IEditTextFilter* pFilter); + void SendOpaqueCommand (const Tizen::Base::String& command); + virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId); virtual void OnKeypadWillOpen(void); diff --git a/src/ui/inc/FUiCtrl_SearchBarModel.h b/src/ui/inc/FUiCtrl_SearchBarModel.h index dddbbc7..7457b09 100644 --- a/src/ui/inc/FUiCtrl_SearchBarModel.h +++ b/src/ui/inc/FUiCtrl_SearchBarModel.h @@ -33,7 +33,7 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _SearchBarModel * @brief - * @since 2.0 + * @since 2.1 */ class _SearchBarModel : public Tizen::Base::Object diff --git a/src/ui/inc/FUiCtrl_SearchBarPresenter.h b/src/ui/inc/FUiCtrl_SearchBarPresenter.h old mode 100644 new mode 100755 index 950479b..a27206a --- a/src/ui/inc/FUiCtrl_SearchBarPresenter.h +++ b/src/ui/inc/FUiCtrl_SearchBarPresenter.h @@ -42,7 +42,7 @@ class _SearchBarModel; /** * @class _SearchBarPresenter * @brief - * @since 2.0 + * @since 2.1 */ class _SearchBarPresenter : public Tizen::Base::Object @@ -71,7 +71,7 @@ public: * * @since 2.0 * @return An error code - * @param[in] show A Boolean flag indicating whether to perform show on the content area. + * @param[in] invalidate A Boolean flag indicating whether to perform invalidate on the content area. * @exception E_SUCCESS The method was successful. * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n * -- the current mode of SearchBar prohibits the execution of the method. @n @@ -186,7 +186,7 @@ private: _Edit* __pEdit; _Control* __pContainer; - Tizen::Graphics::Rectangle __searchFieldBounds; + Tizen::Graphics::FloatRectangle __searchFieldBounds; Tizen::Ui::Animations::_VisualElement* __pIconElement; diff --git a/src/ui/inc/FUiCtrl_SimpleItemImpl.h b/src/ui/inc/FUiCtrl_SimpleItemImpl.h index 923d0f2..2c93897 100644 --- a/src/ui/inc/FUiCtrl_SimpleItemImpl.h +++ b/src/ui/inc/FUiCtrl_SimpleItemImpl.h @@ -36,7 +36,7 @@ class _SimpleItemImpl : public _ListItemBaseImpl { public: - static _SimpleItemImpl* CreateSimpleItemImplN(SimpleItem* pPublic, const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + static _SimpleItemImpl* CreateSimpleItemImplN(SimpleItem* pPublic, const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); virtual ~_SimpleItemImpl(void); @@ -46,7 +46,7 @@ public: virtual SimpleItem& GetPublic(void); - virtual result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style); + virtual result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style); result SetElement(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null); diff --git a/src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h b/src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h index f2283be..dee2f14 100644 --- a/src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h +++ b/src/ui/inc/FUiCtrl_SlidableGroupedListImpl.h @@ -15,6 +15,7 @@ // limitations under the License. // + /** * @file FUiCtrl_SlidableGroupedListImpl.h * @brief This is the header file for _SlidableGroupedListImpl class. @@ -61,7 +62,7 @@ public: int GetDefaultGroupItemHeight(void); int GetDefaultItemHeight(void); - result UpdateCheckStatus(_TableViewItemData* pTableViewItemData, int groupIndex, int itemIndex); + result UpdateCheckStatus(int groupIndex, int itemIndex); result CallLoadToTopCb(int groupIndex, int itemIndex); result ModifyIndicesAfterTopLoad(); _TableViewItemData* LoadAtTop(int groupIndex, int itemIndex); @@ -156,8 +157,6 @@ public: //@See doxygen result GetNextCheckedItemIndexAfter(int& groupIndex, int& index) const; //@See doxygen - Tizen::Graphics::Color GetTextColorOfEmptyList(void) const; - //@See doxygen result GetTopDrawnItemIndex(int& groupIndex, int& itemIndex) const; //@See doxygen bool IsItemChecked(int groupIndex, int index) const; @@ -220,10 +219,6 @@ public: //@See doxygen result SetLoadedItemEnabled(int groupIndex, int index, bool enable); //@See doxygen - void SetTextColorOfEmptyList(const Tizen::Graphics::Color& color); - //@See doxygen - void SetTextOfEmptyList(const Tizen::Base::String& text); - //@See doxygen result SetGroupAt(int groupIndex, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBackgroundBitmap, int groupId); void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status); @@ -279,6 +274,7 @@ private: Tizen::Base::Collection::LinkedList __groupsList; Tizen::Ui::IFastScrollEventListener* __pFastScrollListener; Tizen::Base::String __mainScrollIndex; + Tizen::Base::String __subScrollIndex; int __bottomGroup; int __topGroup; diff --git a/src/ui/inc/FUiCtrl_SlidableListImpl.h b/src/ui/inc/FUiCtrl_SlidableListImpl.h index 46f4de0..62d7810 100644 --- a/src/ui/inc/FUiCtrl_SlidableListImpl.h +++ b/src/ui/inc/FUiCtrl_SlidableListImpl.h @@ -51,7 +51,7 @@ public: virtual void UpdateItem(int itemIndex, TableViewItem* pItem); virtual int GetDefaultItemHeight(void); - result UpdateCheckStatus(_TableViewItemData* pTableViewItemData, int index); + result UpdateCheckStatus(int index); result CallLoadToTopCb(int index); _TableViewItemData* LoadAtTop(int index); result CallLoadToBottomCb(int index); @@ -114,8 +114,6 @@ public: //@See doxygen int GetNextCheckedItemIndexAfter(int index) const; //@See doxygen - Tizen::Graphics::Color GetTextColorOfEmptyList(void) const; - //@See doxygen int GetTopDrawnItemIndex(void) const; //@See doxygen result InsertItemAt(int index, const CustomListItem& item, int itemId = LIST_ITEM_UNSPECIFIED_ID); @@ -163,10 +161,6 @@ public: result SetItemChecked(int groupindex, int index, bool check); //@See doxygen result SetLoadedItemEnabled(int index, bool enable); - //@See doxygen - void SetTextColorOfEmptyList(const Tizen::Graphics::Color& color); - //@See doxygen - void SetTextOfEmptyList(const Tizen::Base::String& text); virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::_TableView& tableView, int itemIndex, Tizen::Ui::Controls::_TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status); @@ -224,9 +218,10 @@ private: int __totalItemCount; int __topIndex; _SlidableListItemProvider* __pItemProvider; - bool __isDirectDelete; + bool __isFullUpdate; bool __isCreating; int __itemCacheSize; + bool __isForcedScroll; static const int LISTVIEW_MAX_ITEM_COUNT = 30; static const int LISTVIEW_ITEM_HEIGHT = 100; friend class _SlidableListItemProvider; diff --git a/src/ui/inc/FUiCtrl_Slider.h b/src/ui/inc/FUiCtrl_Slider.h index 9da4ff3..43f3e65 100644 --- a/src/ui/inc/FUiCtrl_Slider.h +++ b/src/ui/inc/FUiCtrl_Slider.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Slider.h * @brief This is the header file for the _Slider class. @@ -62,6 +63,7 @@ class _OSP_EXPORT_ _Slider DECLARE_PROPERTY("minValue", GetPropertyMinValue, SetPropertyMinValue); DECLARE_PROPERTY("maxValue", GetPropertyMaxValue, SetPropertyMaxValue); DECLARE_PROPERTY("barColor", GetPropertyBarColor, SetPropertyBarColor); + DECLARE_PROPERTY("barBackgroundColor", GetPropertyBarBackgroundColor, SetPropertyBarBackgroundColor); DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor); DECLARE_PROPERTY("titleText", GetPropertyTitleText, SetPropertyTitleText); DECLARE_PROPERTY("titleTextColor", GetPropertyTitleTextColor, SetPropertyTitleTextColor); @@ -72,6 +74,7 @@ public: result SetPropertyMinValue(const Tizen::Ui::Variant& minValue); result SetPropertyMaxValue(const Tizen::Ui::Variant& maxValue); result SetPropertyBarColor(const Tizen::Ui::Variant& barColor); + result SetPropertyBarBackgroundColor(const Tizen::Ui::Variant& barBackgroundColor); result SetPropertyTitleText(const Tizen::Ui::Variant& titleText); result SetPropertyTitleTextColor(const Tizen::Ui::Variant& titleTextColor); result SetPropertyColor(const Tizen::Ui::Variant& color); @@ -81,6 +84,7 @@ public: Tizen::Ui::Variant GetPropertyMinValue(void) const; Tizen::Ui::Variant GetPropertyMaxValue(void) const; Tizen::Ui::Variant GetPropertyBarColor(void) const; + Tizen::Ui::Variant GetPropertyBarBackgroundColor(void) const; Tizen::Ui::Variant GetPropertyTitleText(void) const; Tizen::Ui::Variant GetPropertyTitleTextColor(void) const; Tizen::Ui::Variant GetPropertyColor(void) const; @@ -93,7 +97,7 @@ public: Tizen::Graphics::Canvas* GetHandleCanvasN(void) const; Animations::_VisualElement* GetHandle(void) const; void SetGroupStyle(GroupStyle groupStyle); - result UpdateHandle(const Tizen::Graphics::Rectangle& handleRect); + result UpdateHandle(const Tizen::Graphics::FloatRectangle& handleRect); result SetRange(int minValue, int maxValue); result GetRange(int& minValue, int& maxValue) const; @@ -112,6 +116,8 @@ public: result SetBarColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetBarColor(void) const; result SetColor(const Tizen::Graphics::Color& color); + result SetBarBackgroundColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetBarBackgroundColor(void) const; Tizen::Graphics::Color GetColor(void) const; Tizen::Base::Runtime::_Event* GetAdjustmentEvent(void) const; _SliderEvent* GetSliderEvent(void) const; @@ -132,7 +138,8 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} @@ -159,6 +166,7 @@ private: Tizen::Graphics::Color __bgColor; Tizen::Graphics::Color __barColor; + Tizen::Graphics::Color __barBgColor; Tizen::Graphics::Color __titleTextColor; int __sliderStyle; diff --git a/src/ui/inc/FUiCtrl_SliderEvent.h b/src/ui/inc/FUiCtrl_SliderEvent.h index be919c0..499439d 100644 --- a/src/ui/inc/FUiCtrl_SliderEvent.h +++ b/src/ui/inc/FUiCtrl_SliderEvent.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderEvent.h * @brief This is the header file for __SliderEvent class. diff --git a/src/ui/inc/FUiCtrl_SliderImpl.h b/src/ui/inc/FUiCtrl_SliderImpl.h index 0f364c5..7bb077f 100644 --- a/src/ui/inc/FUiCtrl_SliderImpl.h +++ b/src/ui/inc/FUiCtrl_SliderImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderImpl.h * @brief This is the header file for the _SliderImpl class. @@ -64,6 +65,8 @@ public: result RemoveSliderEventListener(const ISliderEventListener& listener); result SetBarColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetBarColor(void) const; + result SetBarBackgroundColor(const Tizen::Graphics::Color& color); + Tizen::Graphics::Color GetBarBackgroundColor(void) const; result SetColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetColor(void) const; result SetThumbBitmap(SliderThumbStatus status, const Tizen::Graphics::Bitmap& bitmap); @@ -78,6 +81,7 @@ public: virtual void OnSliderBarMoved(_Slider& source, int value); static _SliderImpl* CreateSliderImplN(Slider* pControl, const Tizen::Graphics::Rectangle& rect, int sliderStyle); + static _SliderImpl* CreateSliderImplFN(Slider* pControl, const Tizen::Graphics::FloatRectangle& rect, int sliderStyle); static _SliderImpl* GetInstance(Slider& slider); static const _SliderImpl* GetInstance(const Slider& slider); diff --git a/src/ui/inc/FUiCtrl_SliderModel.h b/src/ui/inc/FUiCtrl_SliderModel.h index 792e9f2..2bfb1c0 100644 --- a/src/ui/inc/FUiCtrl_SliderModel.h +++ b/src/ui/inc/FUiCtrl_SliderModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderModel.h * @brief This is the header file for the _SliderModel class. diff --git a/src/ui/inc/FUiCtrl_SliderOverlay.h b/src/ui/inc/FUiCtrl_SliderOverlay.h index 9fef4e5..ef21e51 100644 --- a/src/ui/inc/FUiCtrl_SliderOverlay.h +++ b/src/ui/inc/FUiCtrl_SliderOverlay.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderOverlay.h * @brief This is the header file for the _SliderOverlay class. @@ -41,14 +42,14 @@ public: virtual ~_SliderOverlay(void); result Construct(void); - result SetSliderRect(Tizen::Graphics::Rectangle& sliderRect, Tizen::Graphics::Rectangle& sliderTouchRect); + result SetSliderRect(Tizen::Graphics::FloatRectangle& sliderRect, Tizen::Graphics::FloatRectangle& sliderTouchRect); void SetFont(Tizen::Graphics::Font* pFont); result DrawSliderOverlay(int positionX,int handleWidth, int value); virtual bool IsActivatedOnOpen(void) const; private: - result LoadBitmaps(Tizen::Graphics::Dimension& dim); + result LoadBitmaps(Tizen::Graphics::FloatDimension& dim); _SliderOverlay(const _SliderOverlay&); _SliderOverlay& operator =(const _SliderOverlay&); @@ -58,9 +59,9 @@ private: static const int SLIDER_OVERLAY_THREE_DIGIT = 3; static const int SLIDER_OVERLAY_TWO_DIGIT = 2; - Tizen::Graphics::Rectangle __sliderRect; - Tizen::Graphics::Rectangle __sliderTouchRect; - Tizen::Graphics::Rectangle __sliderOverlayRect; + Tizen::Graphics::FloatRectangle __sliderRect; + Tizen::Graphics::FloatRectangle __sliderTouchRect; + Tizen::Graphics::FloatRectangle __sliderOverlayRect; Tizen::Graphics::Bitmap* __pOverlayBgBitmap; Tizen::Graphics::Bitmap* __pOverlayBgEffectBitmap; Tizen::Graphics::Bitmap* __pOverlayBottomBgBitmap; diff --git a/src/ui/inc/FUiCtrl_SliderPresenter.h b/src/ui/inc/FUiCtrl_SliderPresenter.h index c741d01..5b6d41e 100644 --- a/src/ui/inc/FUiCtrl_SliderPresenter.h +++ b/src/ui/inc/FUiCtrl_SliderPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SliderPresenter.h * @brief This is the header file for the _SliderPresenter class. @@ -51,9 +52,9 @@ public: void SetNeedUpdate(void); void SetGroupStyle(GroupStyle groupStyle); - Tizen::Graphics::Rectangle GetTitleTextBounds(void) const; - Tizen::Graphics::Rectangle GetIconBounds(IconPosition iconPosition) const; - Tizen::Graphics::Rectangle GetTouchBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleTextBounds(void) const; + Tizen::Graphics::FloatRectangle GetIconBounds(IconPosition iconPosition) const; + Tizen::Graphics::FloatRectangle GetTouchBounds(void) const; virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -79,7 +80,7 @@ private: result DrawIcon(Tizen::Graphics::Canvas& canvas); result DrawSliderOverlay(int value); result DrawSliderBarNumber(int value); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); _SliderPresenter(void); _SliderPresenter(const _SliderPresenter&); @@ -93,11 +94,11 @@ private: _Slider* __pSlider; _SliderModel* __pSliderModel; _SliderOverlay* __pSliderOverlay; - Tizen::Graphics::Rectangle __rect; - Tizen::Graphics::Rectangle __touchRect; - Tizen::Graphics::Rectangle __barBgRect; - Tizen::Graphics::Rectangle __barRect; - Tizen::Graphics::Rectangle __handleRect; + Tizen::Graphics::FloatRectangle __rect; + Tizen::Graphics::FloatRectangle __touchRect; + Tizen::Graphics::FloatRectangle __barBgRect; + Tizen::Graphics::FloatRectangle __barRect; + Tizen::Graphics::FloatRectangle __handleRect; Tizen::Graphics::Bitmap* __pResourceBgTopBitmap; Tizen::Graphics::Bitmap* __pResourceBgMiddleBitmap; @@ -116,8 +117,8 @@ private: Tizen::Graphics::Bitmap* __pBgBottomEffectBitmap; Tizen::Graphics::Bitmap* __pBgSingleEffectBitmap; - Tizen::Graphics::Bitmap* __pResourceBarBitmap; + Tizen::Graphics::Bitmap* __pResourceBarBgBitmap; Tizen::Graphics::Bitmap* __pBarResourceEffectBitmap; Tizen::Graphics::Bitmap* __pBarBgResourceEffectBitmap; Tizen::Graphics::Bitmap* __pBarColorReplacementBitmap; @@ -134,6 +135,7 @@ private: Tizen::Graphics::Bitmap* __pHandleHighlightedEffectBitmap; Tizen::Graphics::Color __currentBarColor; + Tizen::Graphics::Color __currentBarBgColor; Tizen::Graphics::Color __currentBgColor; Tizen::Graphics::Color __currentGrpStyleNoneColor; @@ -156,6 +158,7 @@ private: bool __isCustomPressedTextColor; GroupStyle __groupStyle; int __fontSize; + float __barOffset; }; // _SliderPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_SplitPanel.h b/src/ui/inc/FUiCtrl_SplitPanel.h index 923c990..41d3135 100644 --- a/src/ui/inc/FUiCtrl_SplitPanel.h +++ b/src/ui/inc/FUiCtrl_SplitPanel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanel.h * @brief This is the header file for the _SplitPanel class. @@ -57,7 +58,7 @@ const int _SPLIT_PANEL_DIVIDER_STATE = 4; /** * @class _SplitPanel * @brief - * @since 1.0 + * @since 2.0 * * * @@ -77,7 +78,7 @@ public: virtual ~_SplitPanel(void); public: - static _SplitPanel* CreateSplitPanelN(const Tizen::Graphics::Rectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); + static _SplitPanel* CreateSplitPanelN(const Tizen::Graphics::FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); result Construct(SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); virtual void OnDraw(void); @@ -96,7 +97,8 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;} @@ -114,14 +116,14 @@ public: result SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle); SplitPanelDividerStyle GetDividerStyle(void) const; - result SetDividerPosition(int position); - int GetDividerPosition(void) const; + result SetDividerPosition(float position); + float GetDividerPosition(void) const; - result SetMaximumDividerPosition(int position); - int GetMaximumDividerPosition(void) const; + result SetMaximumDividerPosition(float position); + float GetMaximumDividerPosition(void) const; - result SetMinimumDividerPosition(int position); - int GetMinimumDividerPosition(void) const; + result SetMinimumDividerPosition(float position); + float GetMinimumDividerPosition(void) const; void SetDividerDirection(SplitPanelDividerDirection dividerDirection); SplitPanelDividerDirection GetDividerDirection(void) const; @@ -139,7 +141,7 @@ public: Tizen::Ui::Animations::VisualElement* GetDividerVisualElement(void); - void SetDividerVisualElementBounds(Tizen::Graphics::Rectangle& bounds); + void SetDividerVisualElementBounds(Tizen::Graphics::FloatRectangle& bounds); protected: result SetPresenter(const _SplitPanelPresenter& splitPanelPresenter); @@ -158,9 +160,9 @@ private: Tizen::Ui::_Control* __pFirstPane; Tizen::Ui::_Control* __pSecondPane; - int __dividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; - int __minimumDividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; - int __maximumDividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; + float __dividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; + float __minimumDividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; + float __maximumDividerPosition[_SPLIT_PANEL_DIVIDER_STATE]; SplitPanelDividerDirection __splitPanelDividerDirection; @@ -172,11 +174,6 @@ private: Tizen::Ui::Animations::VisualElement* __pDividerVisualElement; - bool __isDividerPositionInitialized; - bool __isDividerMaximumPositionInitialized; - bool __isDividerMinimumPositionInitialized; - bool __isFirstTimeOrientationChanged; - }; // _SplitPanel }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_SplitPanelImpl.h b/src/ui/inc/FUiCtrl_SplitPanelImpl.h index c90c794..bcabfe9 100644 --- a/src/ui/inc/FUiCtrl_SplitPanelImpl.h +++ b/src/ui/inc/FUiCtrl_SplitPanelImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanelImpl.h * @brief This is the header file for the _SplitPanelImpl class. @@ -47,8 +48,10 @@ class _SplitPanelImpl public: virtual ~_SplitPanelImpl(void); static _SplitPanelImpl* CreateSplitPanelImplN(SplitPanel* pControl, const Tizen::Graphics::Rectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); + static _SplitPanelImpl* CreateSplitPanelImplFN(SplitPanel* pControl, const Tizen::Graphics::FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); result Initialize(const Tizen::Graphics::Rectangle& rect); + result InitializeF(const Tizen::Graphics::FloatRectangle& rect); virtual const char* GetPublicClassName(void) const; virtual const SplitPanel& GetPublic(void) const; @@ -64,18 +67,30 @@ public: result AddSplitPanelEventListener(ISplitPanelEventListener& listener); result RemoveSplitPanelEventListener(ISplitPanelEventListener& listener); + result AddSplitPanelEventListener(ISplitPanelEventListenerF& listener); + result RemoveSplitPanelEventListener(ISplitPanelEventListenerF& listener); + result SetPane(_ControlImpl* pControl, SplitPanelPaneOrder paneOrder); _ControlImpl* GetPane(SplitPanelPaneOrder paneOrder) const; result SetDividerPosition(int position); int GetDividerPosition(void) const; + result SetDividerPosition(float position); + float GetDividerPositionF(void) const; + result SetMaximumDividerPosition(int position); int GetMaximumDividerPosition(void) const; + result SetMaximumDividerPosition(float position); + float GetMaximumDividerPositionF(void) const; + result SetMinimumDividerPosition(int position); int GetMinimumDividerPosition(void) const; + result SetMinimumDividerPosition(float position); + float GetMinimumDividerPositionF(void) const; + result MaximizePane(SplitPanelPaneOrder paneOrder); bool IsPaneMaximized(SplitPanelPaneOrder paneOrder) const; result RestorePane(void); diff --git a/src/ui/inc/FUiCtrl_SplitPanelModel.h b/src/ui/inc/FUiCtrl_SplitPanelModel.h index d22b6a4..6e14a47 100644 --- a/src/ui/inc/FUiCtrl_SplitPanelModel.h +++ b/src/ui/inc/FUiCtrl_SplitPanelModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanelModel.h * @brief This is the header file for the _SplitPanelModel class. diff --git a/src/ui/inc/FUiCtrl_SplitPanelPresenter.h b/src/ui/inc/FUiCtrl_SplitPanelPresenter.h index 5619bd8..d6fb447 100644 --- a/src/ui/inc/FUiCtrl_SplitPanelPresenter.h +++ b/src/ui/inc/FUiCtrl_SplitPanelPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_SplitPanelPresenter.h * @brief This is the header file for the _SplitPanelPresenter class. @@ -60,7 +61,7 @@ public: // Operations virtual result Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection); - bool CheckDividerTouchRegion(int positionX, int positionY); + bool CheckDividerTouchRegion(float positionX, float positionY); virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); @@ -73,7 +74,7 @@ public: result SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle); SplitPanelDividerStyle GetDividerStyle(void) const; - Tizen::Graphics::Rectangle GetDividerRectangle(void) const; + Tizen::Graphics::FloatRectangle GetDividerRectangle(void) const; result MaximizePane(SplitPanelPaneOrder paneOrder); bool IsPaneMaximized(SplitPanelPaneOrder paneOrder) const; @@ -102,7 +103,7 @@ private: result AnimatePane(int destination); Tizen::Ui::Control* GetPaneControl(SplitPanelPaneOrder paneOrder); Tizen::Ui::Animations::AnimatorStatus GetAnimationStatus(void); - Tizen::Graphics::Rectangle GetRestorePaneBounds(SplitPanelPaneOrder paneOrder); + Tizen::Graphics::FloatRectangle GetRestorePaneBounds(SplitPanelPaneOrder paneOrder); private: _SplitPanelPresenter(const _SplitPanelPresenter& value); @@ -112,13 +113,13 @@ private: _SplitPanel* __pSplitPanel; _SplitPanelModel* __pSplitPanelModel; - int __dividerMaximumPosition; - int __dividerMinimumPosition; + float __dividerMaximumPosition; + float __dividerMinimumPosition; bool __splitPanelDividerPressed; bool __setFirstDividerPositionChangeEvent; - Tizen::Graphics::Rectangle __dividerRectangle; - Tizen::Graphics::Rectangle __dividerThumbRectangle; + Tizen::Graphics::FloatRectangle __dividerRectangle; + Tizen::Graphics::FloatRectangle __dividerThumbRectangle; Tizen::Graphics::Bitmap* __pDividerPressedBackgroundBitmap; Tizen::Graphics::Bitmap* __pDividerBackgroundBitmap; Tizen::Graphics::Bitmap* __pDividerBackgroundEffectBitmap; diff --git a/src/ui/inc/FUiCtrl_Tab.h b/src/ui/inc/FUiCtrl_Tab.h index f64cbd7..472d819 100644 --- a/src/ui/inc/FUiCtrl_Tab.h +++ b/src/ui/inc/FUiCtrl_Tab.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_Tab.h * @brief This is the header file for the _Tab class. @@ -68,7 +69,7 @@ enum _TabStyle /** * @class _Tab * @brief - * @since 2.0 + * @since 2.1 * * * @@ -133,14 +134,15 @@ public: void SetFirstDrawnItemIndex(int index); int GetFirstDrawnItemIndex(void) const; - void SetEditModeEnabled(bool enable); + void SetEditModeEnabled(bool isEnabled); bool IsEditModeEnabled(void) const; result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const; + Tizen::Graphics::Bitmap* GetDisabledBackgroundBitmap(void) const; - result SetPressedItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); Tizen::Graphics::Bitmap* GetPressedItemBackgroundBitmap(void) const; + Tizen::Graphics::Bitmap* GetPressedItemBackgroundEffectBitmap(void) const; result SetSelectedItemBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); Tizen::Graphics::Bitmap* GetSelectedItemBackgroundBitmap(void) const; @@ -151,7 +153,6 @@ public: void SetItemBackgroundColor(Tizen::Graphics::Color color); Tizen::Graphics::Color GetItemBackgroundColor(void) const; - void SetPressedItemBackgroundColor(Tizen::Graphics::Color color); Tizen::Graphics::Color GetPressedItemBackgroundColor(void) const; void SetSelectedItemBackgroundColor(Tizen::Graphics::Color color); @@ -160,9 +161,13 @@ public: void SetHighlightedItemBackgroundColor(Tizen::Graphics::Color color); Tizen::Graphics::Color GetHighlightedItemBackgroundColor(void) const; + Tizen::Graphics::Color GetDisabledItemBackgroundColor(void) const; + void SetTextColor(const Tizen::Graphics::Color& textColor); Tizen::Graphics::Color GetTextColor(void) const; + Tizen::Graphics::Color GetDisabledTextColor(void) const; + void SetPressedTextColor(const Tizen::Graphics::Color& textColor); Tizen::Graphics::Color GetPressedTextColor(void) const; @@ -198,10 +203,12 @@ public: void AddAccessibilityElement(const Tizen::Graphics::Rectangle& itemBounds, const Tizen::Base::String& itemText, _TabItemStatus status); void RemoveAllAccessibilityElement(void); + virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); @@ -226,7 +233,9 @@ private: _TouchFlickGestureDetector* __pFlickGesture; Tizen::Graphics::Bitmap* __pBackgroundBitmap; + Tizen::Graphics::Bitmap* __pDisabledBackgroundBitmap; Tizen::Graphics::Bitmap* __pPressedItemBackgroundBitmap; + Tizen::Graphics::Bitmap* __pPressedItemBackgroundEffectBitmap; Tizen::Graphics::Bitmap* __pSelectedItemBackgroundBitmap; Tizen::Graphics::Bitmap* __pHighlightedItemBackgroundBitmap; diff --git a/src/ui/inc/FUiCtrl_TabBar.h b/src/ui/inc/FUiCtrl_TabBar.h index 1cdc7d6..2435d34 100644 --- a/src/ui/inc/FUiCtrl_TabBar.h +++ b/src/ui/inc/FUiCtrl_TabBar.h @@ -25,10 +25,13 @@ #include "FUi_Control.h" +#include "FUiCtrl_ActionEvent.h" + +#include "FUi_IAccessibilityListener.h" +#include "FUiCtrl_IActionEventListener.h" + #include "FUiCtrl_TabBarItem.h" #include "FUiCtrl_TabBarPresenter.h" -#include "FUiCtrl_IActionEventListener.h" -#include "FUiCtrl_ActionEvent.h" namespace Tizen { namespace Ui { class _AccessibilityElement; @@ -53,6 +56,7 @@ class _OSP_EXPORT_ _TabBar , virtual public Tizen::Base::Runtime::IEventListener , virtual public _IUiEventListener , virtual public _IUiEventPreviewer + , public _IAccessibilityListener { DECLARE_CLASS_BEGIN(_TabBar, _Control); DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor); @@ -112,12 +116,12 @@ public: result SetItemSelected(int index); int GetSelectedItemIndex(void) const; - _TabBarItem* GetItemFromPosition(const Tizen::Graphics::Point& position) const; + _TabBarItem* GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const; result SetTopDrawnItemIndex(int index); int GetItemCount(void) const; - result SetWidth(int width); + result SetWidth(float width); void AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener); void RemoveActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener); @@ -128,13 +132,24 @@ public: virtual void OnDraw(void); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); virtual void OnBoundsChanged(void); + virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction); + protected: result SetPresenter(const _TabBarPresenter& tabBarPresenter); diff --git a/src/ui/inc/FUiCtrl_TabBarImpl.h b/src/ui/inc/FUiCtrl_TabBarImpl.h index 67d27dc..c086bd7 100644 --- a/src/ui/inc/FUiCtrl_TabBarImpl.h +++ b/src/ui/inc/FUiCtrl_TabBarImpl.h @@ -39,12 +39,13 @@ public: class TabBarSizeInfo : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; public: virtual ~_TabBarImpl(void); - static _TabBarImpl* CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::Rectangle& bounds); + static _TabBarImpl* CreateTabBarImplN(TabBar* pTabBar, const Tizen::Graphics::FloatRectangle& bounds); result AddItem(const Tizen::Base::String& text, int actionId); result InsertItemAt(int index, const Tizen::Base::String& text, int actionId); @@ -67,7 +68,7 @@ public: int GetItemCount(void) const; - result SetWidth(int width); + result SetWidth(float width); void AddActionEventListener(Tizen::Ui::IActionEventListener& listener); void RemoveActionEventListener(Tizen::Ui::IActionEventListener& listener); diff --git a/src/ui/inc/FUiCtrl_TabBarItem.h b/src/ui/inc/FUiCtrl_TabBarItem.h index 815506c..a318ebc 100644 --- a/src/ui/inc/FUiCtrl_TabBarItem.h +++ b/src/ui/inc/FUiCtrl_TabBarItem.h @@ -29,6 +29,10 @@ #include #include "FUi_Control.h" +namespace Tizen { namespace Ui +{ +class _AccessibilityElement; +}} //namespace Tizen::Ui namespace Tizen { namespace Ui { namespace Controls { @@ -72,9 +76,13 @@ public: _TabBarItemStatus GetStatus(void) const; - void SetBounds(const Tizen::Graphics::Rectangle& bounds); + void SetBounds(const Tizen::Graphics::FloatRectangle& bounds); + + Tizen::Graphics::FloatRectangle GetBounds(void) const; - Tizen::Graphics::Rectangle GetBounds(void) const; + void SetAccessibilityElement(_AccessibilityElement* pElement); + + _AccessibilityElement* GetAccessibilityElement(void); private: _TabBarItem(const _TabBarItem& rhs); @@ -88,7 +96,9 @@ private: _TabBarItemStatus __status; - Tizen::Graphics::Rectangle __bounds; + Tizen::Graphics::FloatRectangle __bounds; + + Tizen::Ui::_AccessibilityElement* __pElement; }; // _TabBarItem diff --git a/src/ui/inc/FUiCtrl_TabBarModel.h b/src/ui/inc/FUiCtrl_TabBarModel.h index e74f66d..4c6c0ab 100644 --- a/src/ui/inc/FUiCtrl_TabBarModel.h +++ b/src/ui/inc/FUiCtrl_TabBarModel.h @@ -54,8 +54,10 @@ public: int GetSelectedItemIndex(void) const; void SetFirstDrawnItemIndex(int index); int GetFirstDrawnItemIndex(void) const; + void SetLastDrawnItemIndex(int index); + int GetLastDrawnItemIndex(void) const; int GetItemCount(void) const; - int GetWidthOfAllItems(void) const; + float GetWidthOfAllItems(void) const; result AddItem(const Tizen::Base::String& text, int actionId, _ControlOrientation orientation); result InsertItemAt(int index, const Tizen::Base::String& text, int actionId, _ControlOrientation orientation); @@ -76,7 +78,8 @@ private: int __selectedItemIndex; int __firstDrawnItemIndex; - int __widthOfAllItems; + int __lastDrawnItemIndex; + float __widthOfAllItems; }; // _TabBarModel diff --git a/src/ui/inc/FUiCtrl_TabBarPresenter.h b/src/ui/inc/FUiCtrl_TabBarPresenter.h index 4570b8c..f99004a 100644 --- a/src/ui/inc/FUiCtrl_TabBarPresenter.h +++ b/src/ui/inc/FUiCtrl_TabBarPresenter.h @@ -69,8 +69,9 @@ public: int GetSelectedItemIndex(void) const; int GetItemCount(void) const; - int GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const; - _TabBarItem* GetItemFromPosition(const Tizen::Graphics::Point& position) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const; + int GetItemIndexFromAbsPosition(const Tizen::Graphics::FloatPoint& point) const; + _TabBarItem* GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const; result SetTopDrawnItemIndex(int index); result SetReplacementColor(const Tizen::Graphics::Color& color); @@ -80,7 +81,7 @@ public: void InitItemPositionX(void); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); - virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); @@ -88,16 +89,34 @@ public: void OnBoundsChanged(void); void SetAllAccessibilityElement(void); + /* Calling sequence of OnAccessibilityCallbacks + * OnItemRefresh if only scroll with direction + * OnFocusOut if only same control just before, element is also before one + * OnFocusIn + * OnFocusMoveNext / Prev if only scroll with direction + * OnReadingElement + * OnReadedElement if Not read, Not on + */ + bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction); private: result LoadBitmap(void); - result AdjustItemPositionX(int distance); + result AdjustItemPositionX(float distance); _TabBarItemStatus GetItemStatus(int index) const; result SetItemStatus(int index, _TabBarItemStatus status); void DrawBackground(Tizen::Graphics::Canvas* pCanvas); void DrawItem(Tizen::Graphics::Canvas* pCanvas); void DrawArrow(Tizen::Graphics::Canvas* pCanvas); - result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + result DrawBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); private: _TabBarPresenter(const _TabBarPresenter& rhs); @@ -109,16 +128,15 @@ private: Tizen::Graphics::Font* __pFont; Tizen::Graphics::_Text::TextObject* __pTextObject; - Tizen::Graphics::Point __startPosition; + Tizen::Graphics::FloatPoint __startPosition; int __highlightedItemIndex; bool __touchMoved; bool __touchBubblingBlocked; Tizen::Graphics::Bitmap* __pBgBitmapCached; + Tizen::Graphics::Bitmap* __pBgEffectBitmapCached; Tizen::Graphics::Bitmap* __pItemBgBitmapCached[ITEM_STATUS_MAX]; - Tizen::Graphics::Bitmap* __pLeftArrowBgBitmapCached; - Tizen::Graphics::Bitmap* __pRightArrowBgBitmapCached; Tizen::Graphics::Bitmap* __pLeftArrowBitmapCached; Tizen::Graphics::Bitmap* __pRightArrowBitmapCached; }; // _TabBarPresenter diff --git a/src/ui/inc/FUiCtrl_TabImpl.h b/src/ui/inc/FUiCtrl_TabImpl.h index 4a67c30..f21bea0 100644 --- a/src/ui/inc/FUiCtrl_TabImpl.h +++ b/src/ui/inc/FUiCtrl_TabImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabImpl.h * @brief This is the header file for the _TabImpl class. @@ -38,7 +39,7 @@ namespace Tizen { namespace Ui { namespace Controls { /** * @class _TabImpl * @brief - * @since 2.0 + * @since 2.1 * * * diff --git a/src/ui/inc/FUiCtrl_TabItem.h b/src/ui/inc/FUiCtrl_TabItem.h index fc96dc1..31ffc00 100644 --- a/src/ui/inc/FUiCtrl_TabItem.h +++ b/src/ui/inc/FUiCtrl_TabItem.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabItem.h * @brief This is the header file for the _TabItem class. @@ -56,7 +57,7 @@ enum _TabItemStyle /** * @class _TabItem * @brief - * @since 2.0 + * @since 2.1 * * * diff --git a/src/ui/inc/FUiCtrl_TabModel.h b/src/ui/inc/FUiCtrl_TabModel.h index 69e7046..043b6ed 100644 --- a/src/ui/inc/FUiCtrl_TabModel.h +++ b/src/ui/inc/FUiCtrl_TabModel.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabModel.h * @brief This is the header file for the _TabModel class. @@ -30,7 +31,7 @@ namespace Tizen { namespace Ui { namespace Controls { /** * @class _TabModel * @brief - * @since 2.0 + * @since 2.1 * * * diff --git a/src/ui/inc/FUiCtrl_TabPresenter.h b/src/ui/inc/FUiCtrl_TabPresenter.h index 1a35102..f86ad22 100644 --- a/src/ui/inc/FUiCtrl_TabPresenter.h +++ b/src/ui/inc/FUiCtrl_TabPresenter.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TabPresenter.h * @brief This is the header file for the _TabPresenter class. @@ -58,7 +59,7 @@ const int _TAB_ITEM_MAXCOUNT = 14; /** * @class _TabPresenter * @brief - * @since 2.0 + * @since 2.1 * * * @@ -88,7 +89,7 @@ public: void SetFirstDrawnItemIndex(int index); int GetFirstDrawnItemIndex(void) const; - void SetEditModeEnabled(bool enable); + void SetEditModeEnabled(bool isEnable); bool IsEditModeEnabled(void) const; int GetItemCount(void) const; @@ -101,14 +102,13 @@ public: int GetNextItemIndexFromPosition(const Tizen::Graphics::Point& point, int currentIndex) const; void Draw(void); - void SetReCalculateItemBounds(bool reCalculationRequired); + void SetRecalculateItemBounds(bool isRecalculationRequired); float CalculateProgress(float timeProgress) const; result StartReorderTimer(int); - result ResetReorderTimer(int index = 0); - result CancelReorderTimer(void); - result StopReorderTimer(void); + result CancelReorderTimer(int index = 0); + result ResetReorderTimer(void); void StartReorderAnimation(int, int); void FreeHorizontalLineBitmap(); @@ -118,7 +118,7 @@ public: virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount); - virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally); + virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool isCompletedNormally); virtual bool OnLongPressGestureDetected(void); virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture); @@ -126,6 +126,8 @@ public: void OnFontInfoRequested(unsigned long& style, int& size); void OnBoundsChanged(void); + void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); + virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element); protected: @@ -137,23 +139,28 @@ private: void DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); void DrawTextItem(Tizen::Graphics::Canvas* pCanvas); + void DrawEditTextItem(Tizen::Graphics::Canvas* pCanvas); void DrawItemBackground(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& itemRect); - void DrawFocusItemBackground(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& itemRect); + void DrawPressedItemBackground(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& itemRect); + void DrawHighlightedItemBackground(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& itemRect); void DrawSelectedItemBackground(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& itemRect); void DrawIconItem(Tizen::Graphics::Canvas* pCanvas); + void DrawEditIconItem(Tizen::Graphics::Canvas* pCanvas); + void DrawItem(Tizen::Graphics::Canvas* pCanvas); + void DrawEditIconTextItem(Tizen::Graphics::Canvas* pCanvas); - void DrawEditItem(const Tizen::Graphics::Point& point); - void DrawItemDivisionVerticalLine(Tizen::Graphics::Canvas* pCanvas, Tizen::Graphics::Rectangle& lineRect); + void SetEditItemBounds(const Tizen::Graphics::Point& point); + void DrawItemDivider(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::Rectangle& lineRect); void DrawHorizontal(void); void DrawBadgeIcon(_TabItem* pDrawItem, Tizen::Graphics::Canvas* pCanvas); void CalcItemBounds(void); - void CalcTabBounds(bool bReset); + void CalcTabBounds(bool isReset); void StartFlickAnimation(void); result StartFlickAnimationTimer(void); @@ -197,8 +204,8 @@ private: struct ReorderAnimationInfo *__pAnimInfo[_TAB_ITEM_MAXCOUNT]; struct TimerInfo *__pTimerInfo[_TIMER_COUNT]; - bool __recalc; - bool __editMode; + bool __isRecalculateNeeded; + bool __isEditMode; int __editItemIndex; @@ -224,6 +231,9 @@ private: static const int FLICK_ANIMATION_FPS_TAB = 30; static const int FLICK_ANIMATION_SENSITIVITY_TAB = 30; static const int SCROLL_ANIMATION_TIMER_PERIOD = 500; + static const int FLICK_ANIMATION_COUNT = 50; + static const int REORDER_ANIMATION_COUNT = 50; + static const int OVERSCROLL_ANIMATION_DURATION = 500; static const int REORDER_TIMER_PERIOD = 1; @@ -233,8 +243,8 @@ private: int __itemWidth; int __itemHeight; int __rearIndex; - bool __isRightScrolable; - bool __isLeftScrolable; + bool __isRightScrollable; + bool __isLeftScrollable; bool __isDirectionRight; bool __isTimerCanceled; @@ -257,6 +267,7 @@ private: bool __isTouchMove; int __scrollFlag; int __tabMinimumSize; + int __fontChangeItemCount; }; diff --git a/src/ui/inc/FUiCtrl_TableView.h b/src/ui/inc/FUiCtrl_TableView.h index 4bfb6e9..7deb10b 100644 --- a/src/ui/inc/FUiCtrl_TableView.h +++ b/src/ui/inc/FUiCtrl_TableView.h @@ -18,9 +18,8 @@ /** * @file FUiCtrl_TableView.h * @brief This file defines the _TableView class. - * @version 3.0 * - * This file contains the declarations of TableView Control class and its helper classes. + * This header file contains the declarations of the %_TableView class. */ #ifndef _FUI_CTRL_INTERNAL_TABLE_VIEW_H_ @@ -128,7 +127,7 @@ public: result GetBottomDrawnItemIndex(int& groupIndex, int& itemIndex) const; result SetBottomDrawnItemIndex(int groupIndex, int itemIndex); // ScrollToItem(); - result ScrollByPixel(int scrollDistance); + result ScrollByPixel(float scrollDistance); void SetScrollEnabled(bool enable); bool IsScrollEnabled(void) const; @@ -142,11 +141,11 @@ public: int GetItemCountAt(int groupIndex) const; result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type, bool animation = true); + result RefreshAllItems(void); result UpdateTableView(void); result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; - - result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex, int& elementId) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; Tizen::Graphics::Color GetItemDividerColor(void) const; result SetItemDividerColor(const Tizen::Graphics::Color& color); @@ -166,11 +165,11 @@ public: Tizen::Graphics::Color GetSectionColor(void) const; result SetSectionColor(const Tizen::Graphics::Color& color); - int GetTopMargin(void) const; - result SetTopMargin(int topMargin); + float GetTopMargin(void) const; + result SetTopMargin(float topMargin); - int GetBottomMargin(void) const; - result SetBottomMargin(int bottomMargin); + float GetBottomMargin(void) const; + result SetBottomMargin(float bottomMargin); bool IsItemChecked(int index) const; result SetItemChecked(int index, bool check); @@ -187,6 +186,7 @@ public: void GetFirstLoadedItemIndex(int& groupIndex, int& itemIndex) const; void GetLastLoadedItemIndex(int& groupIndex, int& itemIndex) const; void ResetSweepItem(void); + void GetSweepItemIndex(int& groupIndex, int& itemIndex) const; int GetPressedItemCount(void); void FireTableViewItemEvent(int groupIndex, int itemIndex, TableViewNotifyType type, _TableViewItem* pItem); @@ -217,6 +217,9 @@ public: result SetTableViewStatusChanged(bool changed); + // VE Value Animation + Tizen::Ui::Animations::VisualElementValueAnimation* GetVisualElementValueAnimation(const Tizen::Base::String& keyName) const; + protected: // Properties result SetPropertyItemDividerColor(const Variant& itemDividerColor); @@ -263,6 +266,11 @@ private: Tizen::Base::String __textOfEmptyTableView; Tizen::Graphics::Color __textColorOfEmptyTableView; Tizen::Graphics::Color __sectionStyleColor; + + Tizen::Ui::Animations::VisualElementValueAnimation* __pExpandGroupAnimation; + Tizen::Ui::Animations::VisualElementValueAnimation* __pCollapseGroupAnimation; + Tizen::Ui::Animations::VisualElementValueAnimation* __pSweptAnimation; + Tizen::Ui::Animations::VisualElementValueAnimation* __pRemoveItemtAnimation; }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_TableViewImpl.h b/src/ui/inc/FUiCtrl_TableViewImpl.h index 038f390..326fbb2 100644 --- a/src/ui/inc/FUiCtrl_TableViewImpl.h +++ b/src/ui/inc/FUiCtrl_TableViewImpl.h @@ -47,6 +47,9 @@ class ISectionTableViewItemEventListener; class ITableViewItemProvider; class IGroupedTableViewItemProvider; class ISectionTableViewItemProvider; +class ITableViewItemProviderF; +class IGroupedTableViewItemProviderF; +class ISectionTableViewItemProviderF; class _ScrollEvent; class _FastScrollEvent; @@ -85,10 +88,7 @@ private: public: virtual ~_TableViewImpl(void); - static _TableViewImpl* CreateTableViewImplN(Container* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle); - static _TableViewImpl* CreateTableViewImplN(TableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle); - static _TableViewImpl* CreateGroupedTableViewImplN(GroupedTableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle); - static _TableViewImpl* CreateSectionTableViewImplN(SectionTableView* pPublic, Tizen::Graphics::Rectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle); + static _TableViewImpl* CreateTableViewImplN(Container* pPublic, Tizen::Graphics::FloatRectangle bounds, TableViewStyle style, bool itemDivider, TableViewScrollBarStyle scrollStyle); virtual const char* GetPublicClassName(void) const; // virtual const _TableViewPublic& GetPublic(void) const; @@ -101,6 +101,10 @@ public: result SetGroupedStyleItemProvider(IGroupedTableViewItemProvider* pProvider); result SetSectionStyleItemProvider(ISectionTableViewItemProvider* pProvider); + result SetSimpleStyleItemProviderF(ITableViewItemProviderF* pProvider); + result SetGroupedStyleItemProviderF(IGroupedTableViewItemProviderF* pProvider); + result SetSectionStyleItemProviderF(ISectionTableViewItemProviderF* pProvider); + result AddTableViewItemEventListener(ITableViewItemEventListener& listener); result RemoveTableViewItemEventListener(ITableViewItemEventListener& listener); result AddGroupedTableViewItemEventListener(IGroupedTableViewItemEventListener& listener); @@ -113,6 +117,9 @@ public: result AddScrollEventListener(IScrollEventListener& listener); result RemoveScrollEventListener(IScrollEventListener& listener); + result AddScrollEventListener(IScrollEventListenerF& listener); + result RemoveScrollEventListener(IScrollEventListenerF& listener); + result SetSweepEnabled(bool enable); result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon); @@ -121,8 +128,8 @@ public: result ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment); - result ScrollByPixel(int scrollDistance); - int GetCurrentScrollPosition(void) const; + result ScrollByPixel(float scrollDistance); + float GetCurrentScrollPosition(void) const; void SetScrollEnabled(bool enable); bool IsScrollEnabled(void) const; @@ -137,10 +144,11 @@ public: int GetItemCountAt(int groupIndex) const; result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type); + result RefreshAllItems(void); result UpdateTableView(void); - result GetItemIndexFromPosition(int x, int y, int& groupIndex, int& itemIndex) const; result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; result SetSectionColor(const Tizen::Graphics::Color& color); Tizen::Graphics::Color GetSectionColor(void) const; @@ -190,7 +198,7 @@ public: // _IScrollEventListener virtual void OnScrollEndReached(_Control& source, ScrollEndEvent type); - virtual void OnScrollPositionChanged(_Control& source, int scrollPosition); + virtual void OnScrollPositionChanged(_Control& source, float scrollPosition); virtual void OnScrollStopped(_Control& source); // event handler for _IUiFastScrollListener diff --git a/src/ui/inc/FUiCtrl_TableViewItem.h b/src/ui/inc/FUiCtrl_TableViewItem.h index 249123b..8e32b33 100644 --- a/src/ui/inc/FUiCtrl_TableViewItem.h +++ b/src/ui/inc/FUiCtrl_TableViewItem.h @@ -73,6 +73,13 @@ enum TableViewSimpleItemDrawingStatus TABLE_VIEW_SIMPLEITEM_DRAWING_STATUS_DISABLED = 5, }; +enum TableViewItemPressedControl +{ + TABLE_VIEW_ITEM_PRESSED_NONE = 0, + TABLE_VIEW_ITEM_PRESSED_ITEM, + TABLE_VIEW_ITEM_PRESSED_ANNEX, + TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL +}; struct _ItemDrawingProperty { @@ -82,12 +89,36 @@ struct _ItemDrawingProperty Tizen::Graphics::Color sectionStyleBgColor; bool groupedLookEnabled; bool reorderMode; - int leftMargin; - int scrollMargin; - int width; + float leftMargin; + float scrollMargin; + float width; bool propertyChanged; }; +// TableViewItemControl +class _TableViewItemControl + : public Tizen::Ui::_Control +{ +public: + virtual ~_TableViewItemControl(void); + virtual void OnDraw(void); + virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point); + +public: + static _TableViewItemControl* CreateTableViewItemControlN(void); + result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap); + Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const; + +private: + Tizen::Graphics::Bitmap* __pBackgroundBitmap; + +private: + _TableViewItemControl(void); + _TableViewItemControl(const _TableViewItemControl& rhs); + _TableViewItemControl& operator =(const _TableViewItemControl rhs); +}; + + class _OSP_EXPORT_ _TableViewItem : public Tizen::Ui::_Control , public _IListItemCommon @@ -99,15 +130,18 @@ class _OSP_EXPORT_ _TableViewItem , virtual public Tizen::Ui::_IUiEventListener , virtual public Tizen::Ui::_IUiEventPreviewer { + public: virtual ~_TableViewItem(); - static _TableViewItem* CreateTableViewItemN(int itemHeight); + static _TableViewItem* CreateTableViewItemN(float itemHeight); - virtual bool DrawItem(Tizen::Graphics::Rectangle& rcItem, ListItemState isFocused, bool itemDivider = false); + virtual bool DrawItem(Tizen::Graphics::FloatRectangle& rcItem, ListItemState isFocused, bool itemDivider = false); - virtual int GetItemHeight(void) const; - virtual void SetItemHeight(int itemHeight); + virtual int GetItemHeight(void) const; // +++ check floating + virtual float GetItemHeightF(void) const; + virtual void SetItemHeight(int itemHeight); // +++ check floating + virtual void SetItemHeight(float itemHeight); virtual void SetChecked(bool checked); virtual bool IsChecked(void) const; @@ -136,13 +170,13 @@ public: bool IsContextItemActivated(void) const; result CreateItemDimLayer(void); - void ExposeContextItem(Tizen::Graphics::Rectangle itemBounds, int targetWidth); + void ExposeContextItem(Tizen::Graphics::FloatRectangle itemBounds, float targetWidth); void DrawItemDimLayer(bool visible); void SetItemStyle(TableViewAnnexStyle style); TableViewAnnexStyle GetItemStyle(void) const; - void SetItemWidth(int width); + void SetItemWidth(float width); bool SetItemBackgroundBitmap(ListItemState itemState, const Tizen::Graphics::Bitmap* pBitmap); Tizen::Graphics::Bitmap* GetItemBackgroundBitmap(ListItemState itemState) const; @@ -159,7 +193,7 @@ public: int AddRef(void); int Release(void); - void FireItemEvent(bool selectedBody = true); + void FireItemEvent(bool selectedItem = true); void FireItemSweepEvent(TableViewSweepDirection direction); void SetDrawingProperty(_ItemDrawingProperty* pDrawingProperty); @@ -173,7 +207,7 @@ public: void AdjustContextItemBounds(void); void AdjustChildControlCenterAlign(void); void SetChildControlCenterAlign(bool centerAlign); - void SetItemCustomHeight(int height); + void SetItemCustomHeight(float height); void AdjustAnnexBounds(void); //Simple Item @@ -183,12 +217,14 @@ public: result SetSimpleItemTextSize(int size); int GetSimpleItemTextSize(void) const; - bool MoveItem(Tizen::Graphics::Point position, int duration, int delay, Tizen::Base::String* pName = null); + bool MoveItem(Tizen::Graphics::FloatPoint position, int duration, int delay, Tizen::Base::String* pName = null); bool FadeInOutItem(bool fadeOut, int duration, int delay, Tizen::Base::String* pName = null); bool ZoomInOutItem(bool zoomOut, int duration, int delay, Tizen::Base::String* pName = null); Tizen::Graphics::Point GetLastTouchPressedPosition(void); + Tizen::Graphics::FloatPoint GetLastTouchPressedPositionF(void); void SetLastTouchPressedPosition(Tizen::Graphics::Point position); + void SetLastTouchPressedPosition(Tizen::Graphics::FloatPoint position); bool GetSelectionState(void); void SetSelectionState(bool selected); @@ -205,6 +241,17 @@ public: result StartCheckBoxAnimation(void); void StopCheckBoxAnimation(void); + void SetItemLayoutEnabled(bool enabled); + bool GetItemLayoutEnabled(void); + bool IsAnnexOnOffSliding(void); + + // Accessibility + virtual void SetAccessibilityElement(void); + Tizen::Ui::_AccessibilityElement* GetAccessibilityElement(void); + virtual void SetAccessibilityElementLabel(void); + + virtual result OnAttachedToMainTree(void); + // event handler for ITouchEventListener virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); @@ -231,7 +278,8 @@ public: // accessibility listener virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); @@ -239,12 +287,9 @@ public: virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); protected: - _TableViewItem(int nItemHeight); + _TableViewItem(float nItemHeight); result Initialize(void); - // Accessibility - virtual void SetAccessibilityElement(void); - private: _TableViewItem(const _TableViewItem&); _TableViewItem& operator =(const _TableViewItem&); @@ -252,19 +297,23 @@ private: private: void DrawItemBackground(void); void DrawSectionStyleBackground(void); + void DrawSectionStyleBackgroundCover(void); void DrawAnnexStyle(void); void DrawCheckBox(void); void DrawRadioBox(void); void DrawOnOffButton(void); + void DrawAnnexOnOffHandler(float position); + void AdjustAnnexOnOffHandlerPosition(); void DrawDetailButton(void); void DrawItemDivider(void); + void DrawItemAnnexDivider(void); void DrawGroupedLook(void); - result DrawBitmap (Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); + result DrawBitmap (Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Graphics::Bitmap& bitmap); - result SetItemHighlightBounds(Tizen::Ui::Animations::_VisualElement& highlightVisualElement, const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle CalculateItemHighlightBounds(void); - Tizen::Graphics::Rectangle CalculateAnnexBitmapBounds(int annexWidth, int annexHeight, const Tizen::Graphics::Bitmap& bitmap); + result SetItemHighlightBounds(Tizen::Ui::Animations::_VisualElement& highlightVisualElement, const Tizen::Graphics::FloatRectangle& bounds); + Tizen::Graphics::FloatRectangle CalculateItemHighlightBounds(void); + Tizen::Graphics::FloatRectangle CalculateAnnexBitmapBounds(float annexWidth, float annexHeight, const Tizen::Graphics::Bitmap& bitmap); bool IsTitleStyleItem(void) const; bool IsValidSelectionState(void); @@ -272,12 +321,19 @@ private: //Simple Item void DrawSimpleItem(void); result CreateSimpleItemContents(bool textOnly); - int GetAnnexWidth(TableViewAnnexStyle style); + float GetAnnexWidth(TableViewAnnexStyle style); + + result CreateItemCover(void); + result CreateItemDivider(void); + result CreateItemAnnexDivider(void); + + result StartTouchPressedTimer(const _Control& source, const _TouchInfo& touchinfo); + void StopTouchPressedTimer(void); private: void* __pAppInfo; int __refCount; - int __itemHeight; + float __itemHeight; int __itemGroupIndex; int __itemIndex; @@ -298,11 +354,14 @@ private: bool __isContextItemActivated; bool __checkItemHeightNeeded; - _Label* __pItemDivider; - _Label* __pItemTopDivider; + _TableViewItemControl* __pItemDivider; + _TableViewItemControl* __pItemTopDivider; _Label* __pItemAnnex; + _TableViewItemControl* __pItemCover; + _TableViewItemControl* __pItemAnnexLeftDivider; + _TableViewItemControl* __pItemAnnexRightDivider; - int __itemWidth; + float __itemWidth; Tizen::Graphics::Bitmap* __pItemBgBitmap[3]; Tizen::Graphics::Color __colorItemBg[3]; @@ -319,30 +378,51 @@ private: _Label* __pDimLayer; - Tizen::Graphics::Point __touchStartPosition; - bool __isTouchMoved; + Tizen::Graphics::FloatPoint __touchStartPosition; + float __annexOnOffTouchPosition; + bool __annexOnOffHandlerMoved; + float __annexOnOffHandlerLastPosition; bool __childControlCenterAlign; - int __customHeight; + float __customHeight; int __animationCount; Tizen::Base::Collection::ArrayList __individualSelectionControls; Tizen::Ui::_AccessibilityElement* __pAccessibilityElement; + Tizen::Base::Runtime::Timer* __pPressedTimer; + bool __isPressedTimerEnabled; + TableViewItemPressedControl __pressedControl; + Tizen::Base::Runtime::Timer* __pCheckedTimer; bool __isCheckedTimerEnabled; bool __isCheckedAnimationEnabled; int __checkedCount; - Tizen::Graphics::Rectangle __checkedBounds; + Tizen::Graphics::FloatRectangle __checkedBounds; + + bool __isItemLayoutEnabled; + + bool __isMoveItemAnimationEnabled; + bool __isZoomInOutItemAnimationEnabled; + bool __isFadeInOutItemAnimationEnabled; + bool __isAnimationCallbackBlocked; Tizen::Ui::Animations::_VisualElement* __pHighlightVisualElement; + Tizen::Ui::Animations::_VisualElement* __pBitmapVisualElement; + + Tizen::Ui::Animations::VisualElementValueAnimation* __pMoveItemAnimation; + Tizen::Ui::Animations::VisualElementValueAnimation* __pZoomInOutItemAnimation; + Tizen::Ui::Animations::VisualElementValueAnimation* __pFadeInOutItemtAnimation; static const float SIMPLE_ITEM_ELEMENT_BITMAP_SIZE_RATIO = 0.6f; static const float BACKGROUND_DIMMED_OPACITY = 0.7f; static const float BACKGROUND_DISABLED_OPACITY = 0.3f; static const int DEFAULT_CAPTURED_CONTROL_COUNT = 10; static const int CHECKED_ANIMATION_DURATION = 30; + static const int TOUCH_PRESSED_DURATION = 100; static const int MAX_CHECKED_COUNT = 10; + static const float INSENSITIVE = 0.16f; + static const float SENSITIVE = 0.08f; }; }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_TableViewItemImpl.h b/src/ui/inc/FUiCtrl_TableViewItemImpl.h index 30ef636..22eb3b5 100644 --- a/src/ui/inc/FUiCtrl_TableViewItemImpl.h +++ b/src/ui/inc/FUiCtrl_TableViewItemImpl.h @@ -30,6 +30,7 @@ #include "FUi_ContainerImpl.h" #include "FUiCtrl_TableViewItem.h" + namespace Tizen { namespace Ui { namespace Controls { @@ -43,10 +44,11 @@ public: : public _ControlImpl::SizeInfo { virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; }; public: - static _TableViewItemImpl* CreateTableViewItemImplN(TableViewItemBase* pPublic, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style=TABLE_VIEW_ANNEX_STYLE_NORMAL, Layout* pPublicPortraitLayout=null, Layout* pPublicLandscapeLayout=null); + static _TableViewItemImpl* CreateTableViewItemImplN(TableViewItemBase* pPublic, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style=TABLE_VIEW_ANNEX_STYLE_NORMAL, Layout* pPublicPortraitLayout=null, Layout* pPublicLandscapeLayout=null); virtual ~_TableViewItemImpl(void); virtual const char* GetPublicClassName(void) const; @@ -55,11 +57,11 @@ public: virtual const _TableViewItem& GetCore(void) const; virtual _TableViewItem& GetCore(void); - virtual result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style); + virtual result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style); result SetContextItem(_TableViewItemImpl* pItem); - static int GetAnnexWidth(TableViewAnnexStyle style); + static float GetAnnexWidth(TableViewAnnexStyle style); result SetSelectionStyle(TableViewItemSelectionStyle style); TableViewItemSelectionStyle GetSelectionStyle(void) const; diff --git a/src/ui/inc/FUiCtrl_TableViewItemProvider.h b/src/ui/inc/FUiCtrl_TableViewItemProvider.h index 05ff5be..4cf8a3d 100644 --- a/src/ui/inc/FUiCtrl_TableViewItemProvider.h +++ b/src/ui/inc/FUiCtrl_TableViewItemProvider.h @@ -18,7 +18,6 @@ /** * @file FUiCtrl_TableViewItemProvider.h * @brief This file defines the _TableViewItemProvider class. - * @version 3.0 * * This header file contains the declarations of the _TableViewItemProvider class. */ @@ -35,8 +34,11 @@ namespace Tizen { namespace Ui { namespace Controls class TableViewItem; class TableViewGroupItem; class ITableViewItemProvider; +class ITableViewItemProviderF; class IGroupedTableViewItemProvider; +class IGroupedTableViewItemProviderF; class ISectionTableViewItemProvider; +class ISectionTableViewItemProviderF; struct TableViewItemTag; class _TableViewItemProvider @@ -44,19 +46,23 @@ class _TableViewItemProvider public: virtual ~_TableViewItemProvider(void); - static _TableViewItemProvider* CreateTableViewItemProviderN(TableViewStyle style); + static _TableViewItemProvider* CreateTableViewItemProviderN(TableViewStyle style, bool useFloatingPoint = false); result SetSimpleStyleItemProvider(ITableViewItemProvider* pProvider); result SetGroupedStyleItemProvider(IGroupedTableViewItemProvider* pProvider); result SetSectionStyleItemProvider(ISectionTableViewItemProvider* pProvider); + result SetSimpleStyleItemProviderF(ITableViewItemProviderF* pProvider); + result SetGroupedStyleItemProviderF(IGroupedTableViewItemProviderF* pProvider); + result SetSectionStyleItemProviderF(ISectionTableViewItemProviderF* pProvider); + int GetGroupCount(void); int GetItemCount(int groupIndex); - int GetGroupItemHeight(int groupIndex); - int GetItemHeight(const TableViewItemTag& itemTag); - TableViewGroupItem* CreateGroupItem(int groupIndex, int itemWidth); + float GetGroupItemHeight(int groupIndex); + float GetItemHeight(const TableViewItemTag& itemTag); + TableViewGroupItem* CreateGroupItem(int groupIndex, float itemWidth); bool DeleteGroupItem(int groupIndex, TableViewGroupItem* pItem); - TableViewItem* CreateItem(const TableViewItemTag& itemTag, int itemWidth); + TableViewItem* CreateItem(const TableViewItemTag& itemTag, float itemWidth); bool DeleteItem(const TableViewItemTag& itemTag, TableViewItem* pItem); bool UpdateItem(const TableViewItemTag& itemTag, TableViewItem *pItem); bool UpdateGroupItem(int groupIndex, TableViewGroupItem *pItem); @@ -64,13 +70,13 @@ public: bool HasSectionHeader(int groupIndex); Tizen::Base::String GetSectionFooter(int groupIndex); bool HasSectionFooter(int groupIndex); - int GetDefaultItemHeight(void); - int GetDefaultGroupItemHeight(void); + float GetDefaultItemHeight(void); + float GetDefaultGroupItemHeight(void); bool IsReorderable(int groupIndexFrom, int groupIndexTo); bool IsOnProcessing(); protected: - _TableViewItemProvider(TableViewStyle style); + _TableViewItemProvider(TableViewStyle style, bool useFloatingPoint); private: _TableViewItemProvider(_TableViewItemProvider& rhs); @@ -81,8 +87,14 @@ private: ITableViewItemProvider* __pSimpleProvider; IGroupedTableViewItemProvider* __pGroupedProvider; ISectionTableViewItemProvider* __pSectionProvider; + + ITableViewItemProviderF* __pSimpleProviderF; + IGroupedTableViewItemProviderF* __pGroupedProviderF; + ISectionTableViewItemProviderF* __pSectionProviderF; + TableViewStyle __style; bool __onProcessing; + bool __useFloatingPoint; }; // _TableViewItemProvider diff --git a/src/ui/inc/FUiCtrl_TableViewItemProviderAdaptor.h b/src/ui/inc/FUiCtrl_TableViewItemProviderAdaptor.h index ea7518c..41a676a 100644 --- a/src/ui/inc/FUiCtrl_TableViewItemProviderAdaptor.h +++ b/src/ui/inc/FUiCtrl_TableViewItemProviderAdaptor.h @@ -57,25 +57,24 @@ public: virtual result DeleteItem(_IListItemCommon* pItem, int groupIndex, int itemIndex); virtual bool UpdateItem(_IListItemCommon* pItem, int groupIndex, int itemIndex); - virtual int GetItemHeight(int groupIndex, int itemIndex); - virtual int GetDefaultItemHeight(void); - virtual int GetDefaultGroupItemHeight(void); + + float GetItemHeight(int groupIndex, int itemIndex); + virtual float GetDefaultItemHeight(void); + virtual float GetDefaultGroupItemHeight(void); + virtual bool HasSectionHeader(int groupIndex) const; virtual bool HasSectionFooter(int groupIndex) const; virtual bool IsReorderable(int groupIndexFrom, int groupIndexTo); bool IsOnProcessing(); - result SetListWidth(int width); - int GetListWidth(void); + result SetListWidth(float width); + float GetListWidth(void); result SetTableViewStyle(int style); _TableViewItem* GetDefaultItem(void); // Operation private: - void SetAnnexToItem(TableViewItem* pItem); - -private: _TableViewItemProviderAdaptor(const _TableViewItemProviderAdaptor&); _TableViewItemProviderAdaptor& operator =(const _TableViewItemProviderAdaptor&); @@ -84,7 +83,7 @@ private: _TableViewItemProvider* __pTableViewProvider; _TableViewItem* __pDefaultItem; - int __listWidth; + float __listWidth; int __style; }; // _TableViewItemProviderAdaptor diff --git a/src/ui/inc/FUiCtrl_TableViewPresenter.h b/src/ui/inc/FUiCtrl_TableViewPresenter.h index 30b3396..2adceeb 100644 --- a/src/ui/inc/FUiCtrl_TableViewPresenter.h +++ b/src/ui/inc/FUiCtrl_TableViewPresenter.h @@ -51,23 +51,24 @@ struct _TableViewReorderInfo int itemIndex; int originGroupIndex; int originItemIndex; - int touchPressedPositionY; - int itemBasisPositionY; + float touchPressedPositionY; + float itemBasisPositionY; int isScrollDirectionUp; - int nonScrollableLimitArea; + float nonScrollableLimitArea; bool blockedTouchReleaseState; long long touchPressedTick; - Tizen::Graphics::Rectangle itemBounds; + Tizen::Graphics::FloatRectangle itemBounds; + _TableViewReorderInfo(void) : groupIndex(-1) , itemIndex(-1) , originGroupIndex(-1) , originItemIndex(-1) - , touchPressedPositionY(0) - , itemBasisPositionY(0) + , touchPressedPositionY(0.0f) + , itemBasisPositionY(0.0f) , isScrollDirectionUp(false) - , nonScrollableLimitArea(0) + , nonScrollableLimitArea(0.0f) , blockedTouchReleaseState(false) , touchPressedTick(0) , itemBounds() @@ -101,8 +102,6 @@ public: // set ItemProvider result SetItemProvider(const _TableViewItemProvider* pProvider); - virtual void PreloadItem(void); - void SetTableViewItemProviderAdaptor(_TableViewItemProviderAdaptor* pProviderAdaptor); _TableViewItemProviderAdaptor* GetTableViewItemProviderAdaptor(void) const; @@ -136,13 +135,17 @@ public: // Timer Event virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); + // accessibility + virtual bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction); + void Dispose(void); result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type, bool animation); + result RefreshAllItems(void); result UpdateTableView(void); - result GetItemIndexFromPosition(const Tizen::Graphics::Point& position, int& groupIndex, int& itemIndex) const; - result GetItemFromPosition(const Tizen::Graphics::Point& position, TableViewItemTag& itemPos) const; + result GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& position, int& groupIndex, int& itemIndex) const; + result GetItemFromPosition(const Tizen::Graphics::FloatPoint& position, TableViewItemTag& itemPos) const; result GetTopDrawnItem(TableViewItemTag& itemPos) const; result SetTopDrawnItem(TableViewItemTag& itemPos); @@ -159,14 +162,14 @@ public: int GetItemCountAt(int groupIndex) const; bool HasSectionFooter(int groupIndex) const; - int GetTopMargin(void) const; - result SetTopMargin(int topMargin); + float GetTopMargin(void) const; + result SetTopMargin(float topMargin); - int GetBottomMargin(void) const; - result SetBottomMargin(int bottomMargin); + float GetBottomMargin(void) const; + result SetBottomMargin(float bottomMargin); - int GetLeftMargin(void) const; - result SetLeftMargin(int leftMargin); + float GetLeftMargin(void) const; + result SetLeftMargin(float leftMargin); bool IsItemChecked(int groupIndex, int itemIndex) const; result SetItemChecked(int groupIndex, int itemIndex, bool checked); @@ -192,18 +195,20 @@ public: bool CheckItemHeightAndRefreshLayout(TableViewItemTag itemTag, bool downScroll); - result ScrollByPixel(int scrollDistance); + result ScrollByPixel(float scrollDistance); void SetScrollEnabled(bool enable); bool IsScrollEnabled(void) const; bool GetFirstDrawnFlag(void) const; int GetMaxItemCachingSize(void) const; void ResetSweepItem(void); + void GetSweepItemIndex(int& groupIndex, int& itemIndex) const; int GetPressedItemCount(void); -protected: - virtual int ScrollToInternal(int targetPosition); + void BlockAnimationCallback(bool blocked); +protected: + virtual float ScrollToInternal(float targetPosition); virtual void FadeInScrollBar(void); virtual void FadeOutScrollBar(void); @@ -218,19 +223,24 @@ private: _ListViewModel* __pListModel; _TableViewItemProviderAdaptor* __pProviderAdaptor; + bool PreloadItem(void); + bool PreloadItem(int topDrawnGroupIndex, int topDrawnItemIndex, int shiftingDistance); + bool GetFirstItem(TableViewItemTag& firstItem) const; + bool GetLastItem(TableViewItemTag& lastItem) const; bool GetPreviousItemPosition(const TableViewItemTag& currentItem, TableViewItemTag& prevItem) const; bool GetNextItemPosition(const TableViewItemTag& currentItem, TableViewItemTag& nextItem) const; int GetItemCount(void) const; - int GetHeightOfAllItems(void) const; + float GetHeightOfAllItems(void) const; void SetItemLayout(_TableViewItem* pItem, TableViewItemTag& itemPos); - int CalculateItemPositionY(int groupIndex, int itemIndex); - void AdjustLayoutItems(int scrollPosition); + float CalculateItemPositionY(int groupIndex, int itemIndex); + void AdjustLayoutItems(float scrollPosition); void ResetItemLayout(TableViewItemTag& topDrawnItemTag); void RefreshItemLayout(TableViewItemTag& topDrawnItemTag, TableViewItemTag& refreshItemTag, TableViewRefreshType type, bool animation); void RefreshItemBounds(_TableViewItem* pItem, TableViewItemTag& itemPos); - void ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment, int shiftingDistance = 0); + void ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment, float shiftingDistance = 0.0f); + _TableViewItem* GetTableViewItemFromControl(const _Control& source); @@ -247,7 +257,8 @@ private: bool IsEmpty(void) const; result DrawEmptyTableView(void); - void LoadItemWithScrollPosition(int previousScrollPosition, int currentScrollPos); + void LoadItemWithScrollPosition(float previousScrollPosition, float currentScrollPos); + bool GetTableViewItemPosition(_TableViewItem& item, TableViewItemTag& itemTag); // item must exist between from tag and end tag @@ -258,59 +269,60 @@ private: bool IsAnyItemInGroupLoaded(int groupIndex) const; bool IsAnyItemInLoadedIndex(int groupIndex, int itemIndex); void ScrollToHideNonClientArea(TableViewItemTag& bottomTag); - void AdjustClientAreaBounds(bool reset, int dist = 0); - void SetClientAreaHeight(int height); + void AdjustClientAreaBounds(bool reset, float dist = 0.0f); + void SetClientAreaHeight(float height); void UnloadInvisibleItems(void); // reordering bool SelectReorderItem(int groupIndex, int itemIndex); bool ResetReorderItem(int groupIndex, int itemIndex); - bool DragSelectedItem(int distance, bool relativeCoordinate); + bool DragSelectedItem(float distance, bool relativeCoordinate); bool CheckReorderItemScrollAnimation(_TableViewItem *pItem); bool CheckReorderItemPosition(_TableViewItem* pItem, TableViewItemTag& reorderItemTag); - void AdjustReorderItemLimitPositionY(int& positionY); + void AdjustReorderItemLimitPositionY(float& positionY); bool ReorderItem(int destinationGroupIndex, int destinationItemIndex); void StartReorderScrollTimer(void); void StopReorderScrollTimer(void); // item height - int GetItemHeight(TableViewItemTag itemTag) const; - int SetItemHeight(TableViewItemTag itemTag, int height); + float GetItemHeight(TableViewItemTag itemTag) const; + float SetItemHeight(TableViewItemTag itemTag, float height); bool CreateItemHeightList(void); void DeleteItemHeightList(void); + void PresetItemHeightList(void); bool RefreshItemHeightList(int groupIndex, int itemIndex, TableViewRefreshType refreshType); void CaptureAndStartRemoveItemAnimation(int groupIndex, int itemIndex); - void SetLoadedItemsVisibleFromPosition(int position, bool visible); - void MoveLoadedItemsFromPosition(int position); + void SetLoadedItemsVisibleFromPosition(float position, bool visible); + void MoveLoadedItemsFromPosition(float position); - void SweepItem(int x); + void SweepItem(float x); void ResetSweptItem(void); void AdjustSweptItemPosition(bool withAnimation = false); void AdjustLoadedItemWidth(void); bool IsValidDrawnItem(int groupIndex, int itemIndex); + void StopAllItemAnimation(void); + + bool GetAccessibilityElementFocusedState(void); private: - int __topMargin; - int __bottomMargin; - int __leftMargin; + float __topMargin; + float __bottomMargin; + float __leftMargin; bool __modelInitialized; bool __firstDrawnFlag; bool __statusChangedFlag; bool __scrolling; - // Scroll Bar - int __movedPos; - _ItemDrawingProperty* __pItemDrawingProperty; Tizen::Ui::Animations::_VisualElement* __pBaseVisualElement; bool __sweepOccured; - Tizen::Graphics::Point __sweptItemPosition; + Tizen::Graphics::FloatPoint __sweptItemPosition; TableViewItemTag __sweptItemTag; TableViewItemTag __reservedScrollItemIndex; @@ -322,17 +334,22 @@ private: _TableViewReorderInfo __reorderInfo; - Tizen::Base::Collection::ArrayListT __itemHeightList; - int __itemTotalHeight; + Tizen::Base::Collection::ArrayListT __itemHeightList; + float __itemTotalHeight; TableViewItemTag __expandableItemTag; Tizen::Base::Runtime::Timer* __pFastScrollTimer; bool __isFastScrollTimerEnabled; + float __scrollHeightOnFlickStarted; + float __scrollPositionOnFlickStarted; + + bool __isAnimationCallbackBlocked; + static const int TABLEVIEW_MAX_ITEM_COUNT = 30; static const int REORDER_SCROLL_ANIMATION_TIMER_DURATION = 10; - static const int REORDER_SCROLL_ANIMATION_DISTANCE = 10; + static const float REORDER_SCROLL_ANIMATION_DISTANCE = 10.0f; static const int REORDER_TOUCH_UIACTIVATE_DURATION = 100; static const int FAST_SCROLL_FADE_OUT_DURATION = 500; diff --git a/src/ui/inc/FUiCtrl_TextBlockEvent.h b/src/ui/inc/FUiCtrl_TextBlockEvent.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_TextBoxImpl.h b/src/ui/inc/FUiCtrl_TextBoxImpl.h old mode 100644 new mode 100755 index c60f719..e92c95f --- a/src/ui/inc/FUiCtrl_TextBoxImpl.h +++ b/src/ui/inc/FUiCtrl_TextBoxImpl.h @@ -154,7 +154,7 @@ public: /** * Appends the specified text at the end of the text. * - * @since 1.0 + * @since 2.0 * @return An error code * @param[in] text The text to append * @exception E_SUCCESS The method was successful. @@ -285,6 +285,18 @@ public: int GetLineSpacing(void) const; /** + * Gets the line spacing. + * + * @since 2.1 + * @return The line spacing, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method was successful. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetLineSpacing() + */ + float GetLineSpacingF(void) const; + + /** * Sets the line spacing. @n * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. * @code @@ -302,6 +314,24 @@ public: */ result SetLineSpacing(int multiplier, int extra); + /** + * Sets the line spacing. @n + * The line spacing is determined by multiplying @c multiplier to the default line spacing and adding @c extra. + * @code + * The line spacing = (default line spacing) * multiplier + extra + * @endcode + * @since 2.1 + * @return An error code + * @param[in] multiplier The line spacing multiplier + * @param[in] extra The extra line spacing + * @exception E_SUCCESS The method was successful. + * @exception E_INVALID_ARG A specified parameter is invalid. @n + * -- The specified line spacing value cannot be supported. + * @exception E_SYSTEM A system error occurred. + * @see GetLineSpacingF() + */ + result SetLineSpacing(int multiplier, float extra); + // Text Alignment /** * Gets the horizontal text alignment. @@ -342,6 +372,19 @@ public: int GetTextSize(void) const; /** + * Gets the text size of the TextBox control. + * + * @since 2.1 + * @return The size of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method was successful. + * @exception E_SYSTEM A system error occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + * @see SetTextSize() + */ + float GetTextSizeF(void) const; + + /** * Gets the text total height of the TextBox control. * * @since 2.0 @@ -354,6 +397,18 @@ public: int GetTextTotalHeight(void) const; /** + * Gets the text total height of the TextBox control. + * + * @since 2.1 + * @return The total height of the text, @n + * else @c -1 if an error occurs + * @exception E_SUCCESS The method was successful. + * @exception E_SYSTEM A system error occurred. + * @remarks The specific error code can be accessed using the GetLastResult() method. + */ + float GetTextTotalHeightF(void) const; + + /** * Sets the text size. * * @since 2.0 @@ -367,6 +422,20 @@ public: */ result SetTextSize(int size); + /** + * Sets the text size. + * + * @since 2.1 + * @return An error code + * @param[in] size The text size + * @exception E_SUCCESS The method was successful. + * @exception E_INVALID_ARG A specified input parameter is invalid.@n + * -- The specified @c size cannot be negative integer. + * @exception E_SYSTEM A system error occurred. + * @see GetTextSizeF() + */ + result SetTextSize(float size); + // Text Font /** * Gets the font typeface name and the style mask of the TextBox control. @@ -554,6 +623,7 @@ public: public: // callback virtual result OnBoundsChanged(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect); + virtual result OnBoundsChanged(const Tizen::Graphics::FloatRectangle& oldRect, const Tizen::Graphics::FloatRectangle& newRect); virtual void OnLinkClicked(Tizen::Ui::_Control& source, const Tizen::Base::String& text, Tizen::Base::Utility::LinkType linkType, const Tizen::Base::String& link); virtual void OnTextBlockSelected(Tizen::Ui::_Control& source, int start, int end); diff --git a/src/ui/inc/FUiCtrl_TextEvent.h b/src/ui/inc/FUiCtrl_TextEvent.h old mode 100644 new mode 100755 index 0efebce..5c49339 --- a/src/ui/inc/FUiCtrl_TextEvent.h +++ b/src/ui/inc/FUiCtrl_TextEvent.h @@ -17,7 +17,7 @@ /** * @file FUiCtrl_TextEvent.h * @brief This is the header file for _TextEvent class. - * @version 3.0 + * @version 2.0 * * This header file contains declaration of _TextEvent class. * diff --git a/src/ui/inc/FUiCtrl_TimePickerImpl.h b/src/ui/inc/FUiCtrl_TimePickerImpl.h index 6fe1945..f0fa214 100644 --- a/src/ui/inc/FUiCtrl_TimePickerImpl.h +++ b/src/ui/inc/FUiCtrl_TimePickerImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUiCtrl_TimePickerImpl.h * @brief This is the header file for the _TimePickerImpl class. @@ -44,8 +45,8 @@ class _TimePickerImpl public: class TimePickerSizeInfo : public _ControlImpl::SizeInfo { - virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; - virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; + virtual Tizen::Graphics::FloatDimension GetDefaultMaximumSizeF(_ControlOrientation orientation) const; }; public: diff --git a/src/ui/inc/FUiCtrl_TokenEdit.h b/src/ui/inc/FUiCtrl_TokenEdit.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_TokenEditModel.h b/src/ui/inc/FUiCtrl_TokenEditModel.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUiCtrl_TokenEditPresenter.h b/src/ui/inc/FUiCtrl_TokenEditPresenter.h old mode 100644 new mode 100755 index e4d5151..3a5ad91 --- a/src/ui/inc/FUiCtrl_TokenEditPresenter.h +++ b/src/ui/inc/FUiCtrl_TokenEditPresenter.h @@ -68,6 +68,8 @@ public: result MakeToken(void); + result AppendToken(const Tizen::Base::String& token); + result InsertTokenAt(int index, const Tizen::Base::String& token, bool isUser = false); Tizen::Base::String GetTokenAt(int index) const; @@ -94,7 +96,7 @@ public: virtual result AdjustFlexibleHeight(void); - virtual int CalculateFlexibleHeight(void); + virtual float CalculateFlexibleHeightF(void); virtual result DrawScrollBar(void); @@ -106,20 +108,30 @@ public: Tizen::Base::String GetDescriptionText(void) const; + Tizen::Graphics::FloatRectangle GetTextBoundsF(void) const; + Tizen::Graphics::Rectangle GetTextBounds(void) const; virtual result CutText(void); - result SetLineSpacing(int linePixelGap); + virtual result SetLineSpacing(int linePixelGap); + + virtual result SetLineSpacing(float linePixelGap); int GetLineSpacing() const; + float GetLineSpacingF() const; + Tizen::Ui::Animations::VisualElementAnimation* CreateAnimationN(Tizen::Ui::Animations::VisualElement& source, bool create); + virtual bool IsGuideTextActivated(void) const; + virtual void DrawText(void); + virtual bool IsTextBlockedInTokenEdit(void) const; + virtual bool OnFocusGained(void); virtual bool OnFocusLost(void); - virtual result SetFlexBounds(const Tizen::Graphics::Rectangle& bounds); + virtual result SetFlexBounds(const Tizen::Graphics::FloatRectangle& bounds); // Touch callbacks virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -139,35 +151,38 @@ public: virtual void OnVisualElementAnimationStarted (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target){} void OnBoundsChanged(void); + virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); + virtual result ChangeLayout(_ControlOrientation orientation); + private: bool DrawToken(int count = -1); Tizen::Graphics::Color GetTokenEditColor(const ExpandableEditAreaTokenStatus status) const; Tizen::Graphics::Color GetTokenEditTextColor(const ExpandableEditAreaTokenStatus status) const; result InitializeTokenVisibilityAt(int index); bool DrawDescriptionText(void); - result SetDescriptionTextRect(const Tizen::Graphics::Rectangle& rect); - Tizen::Graphics::Rectangle GetDescriptionTextRect(void) const; + result SetDescriptionTextRect(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::FloatRectangle GetDescriptionTextRect(void) const; result TrimTokenAndAdjustEllipsisAt(int index); int GetTokenIndexFromCoordinate(const Tizen::Graphics::Point point) const; result SetEditingTokenTextBounds(int index, bool isSetText = true); result ProcessTokeningByTouchEvent(const _Control& source, const _TouchInfo& touchinfo); result SetTokenBoundsByTouchInfo(const _TouchInfo& touchinfo); - result RecalculateTokenBounds(int position); + result RecalculateTokenBounds(float position); result CheckTokenScrolling(bool scrollToCursorPosition = false); - result SetTokenVisualElementBounds(int index, const Tizen::Graphics::Rectangle& bounds); + result SetTokenVisualElementBounds(int index, const Tizen::Graphics::FloatRectangle& bounds); int CalculateVisibleTokenCount(void); - Tizen::Graphics::Rectangle CalculateHiddenTokenCountDisplayBounds(int visibleTokenCount); - int CalculateAutoShrinkAlignmentValue(int hiddenTokenCount) const; - result DrawHiddenTokenCount(void); result InitializeDescriptionText(void); + bool CheckCopyPastePopupShowStatus(void); - int ResizeTokenAndAdjustEllipsis(int index, int value, bool isTokenShrink); - int PickToken(int index, Tizen::Graphics::Rectangle tokenDispRect, bool isTokenShrink); - void RepositionToken(int currentTokenIndex, int moveDistance, bool isTokenShrink); - int GetPickedTokenEndPoint(int index, Tizen::Graphics::Rectangle tokenDispRect); + float ResizeTokenAndAdjustEllipsis(int index, float value, bool isTokenShrink); + int PickToken(int index, Tizen::Graphics::FloatRectangle tokenDispRect, bool isTokenShrink); + void RepositionToken(int currentTokenIndex, float moveDistance, bool isTokenShrink); + float GetPickedTokenEndPoint(int index, Tizen::Graphics::FloatRectangle tokenDispRect); void ShrinkTokens(); void ExpandTokens(); + result ChangeInternalLayout(_ControlOrientation orientation); + private: Tizen::Ui::Controls::_TokenEdit* __pTokenEdit; @@ -176,6 +191,8 @@ private: Tizen::Base::String __delimiter; Tizen::Graphics::Bitmap* __pTokenBgBitmap; + Tizen::Graphics::Bitmap* __pTokenBgNormalEffectBitmap; + Tizen::Graphics::Bitmap* __pTokenBgPressedEffectBitmap; int __pressedTokenIndex; @@ -183,8 +200,8 @@ private: int __edittingTokenIndex; - Tizen::Graphics::Rectangle __clientRect; - Tizen::Graphics::Rectangle __initTextRect; + Tizen::Graphics::FloatRectangle __clientRect; + Tizen::Graphics::FloatRectangle __initTextRect; bool __isEditModeEnabled; @@ -192,39 +209,31 @@ private: Tizen::Graphics::_Text::TextObject* __pDescriptionTextTextObject; - Tizen::Graphics::Rectangle __descriptionTextRect; + Tizen::Graphics::FloatRectangle __descriptionTextRect; Tizen::Graphics::Font* __pDescriptionTextFont; bool __isTokenEditingFinished; - int __prevScrollValue; + float __prevScrollValue; - int __scrollValue; + float __scrollValue; bool __isTokenScrolling; bool __isNeedToScroll; - int __maxScrollValue; + float __maxScrollValue; bool __autoShrink; - Tizen::Graphics::Rectangle __hiddenTokenDisplayCountBounds; - - Tizen::Ui::Animations::_VisualElement* __pHiddenTokenCountVisualElement; - - int __autoShrinkAlignmentValue; - - Tizen::Graphics::_Text::TextObject* __pHiddenTokenCountTextObject; - Tizen::Base::String __descriptionText; bool __isPopupVisible; bool __isLongPressed; - - int __lineSpacing; + + float __lineSpacing; int __animatingIndex; @@ -232,11 +241,11 @@ private: const Tizen::Ui::Animations::IVisualElementAnimationTimingFunction* __pTimingFunction; - Tizen::Graphics::Rectangle __descriptionTextRectForScroll; + Tizen::Graphics::FloatRectangle __descriptionTextRectForScroll; - int __previousTitleWidth; + float __previousTitleWidth; - Tizen::Graphics::Rectangle __previousEditBounds; + Tizen::Graphics::FloatRectangle __previousEditBounds; bool __isTokenEditPresenterInitialized; @@ -250,6 +259,13 @@ private: bool __isScrollValueModified; + bool __isTouchMoveInProgress; + + bool __isTitleSliding; + + Tizen::Graphics::Point __touchPressInfo; + + }; // _TokenEditPresenter }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_Toolbar.h b/src/ui/inc/FUiCtrl_Toolbar.h index 900bb51..b6a3215 100644 --- a/src/ui/inc/FUiCtrl_Toolbar.h +++ b/src/ui/inc/FUiCtrl_Toolbar.h @@ -29,6 +29,7 @@ #include #include "FUi_Control.h" #include "FUi_ITouchLongPressGestureEventListener.h" +#include "FUi_ITouchFlickGestureEventListener.h" #include "FUi_ITouchEventListener.h" #include "FUiCtrl_Animation.h" #include "FUiCtrl_Button.h" @@ -57,7 +58,6 @@ const int TOOLBAR_ACTION_ID_MAX = (int) 0x7FFFFFFF; const int TOOLBAR_MORE_BUTTON_ID = -2; const int TAB_ITEM_MAX = 15; const int SEGMENTED_ITEM_MAX = 4; -const int PROCESSING_ANIMATION_COUNT = 30; enum ToolbarStyle { @@ -109,6 +109,7 @@ class _OSP_EXPORT_ _Toolbar , virtual public Tizen::Ui::_IUiEventListener , virtual public Tizen::Ui::_IUiEventPreviewer , virtual public Tizen::Ui::_ITouchGestureEventListener + , virtual public Tizen::Ui::_ITouchFlickGestureEventListener { DECLARE_CLASS_BEGIN(_Toolbar, _Control); DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor); @@ -200,6 +201,8 @@ public: _Button* GetButton(ToolbarButton position) const; + _Label* GetTitleBadgeIcon(void) const; + Tizen::Graphics::Color GetButtonColor(_ButtonStatus status) const; _ButtonStatus GetButtonStatus(ToolbarButton position) const; @@ -220,7 +223,7 @@ public: int GetItemCount(void) const; - int GetItemIndexFromPosition(const Tizen::Graphics::Point& point) const; + int GetItemIndexFromPosition(const Tizen::Graphics::FloatPoint& point) const; result GetItemStatus(int itemIndex, _ButtonStatus& status) const; // Temporarily uses GetItem() instead of this method @@ -314,12 +317,14 @@ public: result SetTransparent(bool transparent); - result SetWaitingAnimationPosition(ToolbarAnimationPosition animationPos, int x, int y); + result SetWaitingAnimationPosition(ToolbarAnimationPosition animationPos, float x, float y); result StopWaitingAnimation(ToolbarAnimationPosition animationPos); result InitializeLongPressGesture(void); + result InitializeFlickGesture(void); + virtual void OnAnimationStopped(const Tizen::Ui::_Control& source); virtual void OnBoundsChanged(void); @@ -332,6 +337,10 @@ public: virtual bool OnLongPressGestureCanceled(_TouchLongPressGestureDetector& gesture); + virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture); + + virtual bool OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture); + virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); @@ -354,12 +363,22 @@ public: Tizen::Graphics::Rectangle GetButtonBounds(ToolbarButton position) const; - result RealignIcon(_Button* pButton); + Tizen::Graphics::FloatRectangle GetButtonBoundsF(ToolbarButton position) const; + + result SetTitleBadgeIcon(const Tizen::Graphics::Bitmap* pBadgeIcon); + + result SetTitleNumberedBadgeIcon(int number); + + result RealignItem(_Button* pButton); - result RealignButtonIcon(_Button* pButton); + result RealignButtonItem(_Button* pButton); result RearrangeItems(void); + bool IsHeader(void); + + result SetHideButton(bool hideButton); + protected: result SetPresenter(const _ToolbarPresenter& toolbarPresenter); @@ -373,6 +392,8 @@ private: int CalculateMinimumToolbarWidth(void); + float CalculateMinimumToolbarWidthF(void); + result RearrangeHeaderSegmentedItems(void); result RearrangeFooterSegmentedItems(void); @@ -385,11 +406,11 @@ private: result SetColorReplacedBitmap(_Button* pButton, const _ButtonStatus status, const Tizen::Graphics::Color& color, const Tizen::Graphics::Bitmap* pBitmap); - void InitializeAccessibilityElement(void); + void AddAccessibilityElement(ToolbarButton position, _Button* pButton); - result AdjustToolbarBounds(void); + void AddAccessibilityElement(_Button* pButton); - void AddAccessibilityItem(_Button* pButton); + result AdjustToolbarBounds(void); result Initialize(bool header); @@ -406,6 +427,8 @@ private: _TouchLongPressGestureDetector* __pLongPressGesture; + _TouchFlickGestureDetector* __pFlickGesture; + Tizen::Graphics::Bitmap* __pToolbarBackgroundBitmap; Tizen::Graphics::Bitmap* __pTitleIcon; @@ -455,9 +478,11 @@ private: _Button* __pButtonItems[BUTTON_MAX]; + _Label* __pTitleBadgeIcon; + _Animation* __pAnimation[TOOLBAR_ANIMATION_POSITION_MAX]; - Tizen::Base::Collection::ArrayList* __pAnimationFrameList; + Tizen::Base::Collection::ArrayList* __pAnimationFrameList[TOOLBAR_ANIMATION_POSITION_MAX]; int __backActionId; @@ -469,9 +494,9 @@ private: bool __isUserBackgroundBitmap; - Tizen::Graphics::Rectangle __titleTextArea; + Tizen::Graphics::FloatRectangle __titleTextArea; - Tizen::Graphics::Rectangle __itemArea; + Tizen::Graphics::FloatRectangle __itemArea; Tizen::Ui::_AccessibilityElement* __pTitleTextElement; }; diff --git a/src/ui/inc/FUiCtrl_ToolbarPresenter.h b/src/ui/inc/FUiCtrl_ToolbarPresenter.h index 767821e..380b305 100644 --- a/src/ui/inc/FUiCtrl_ToolbarPresenter.h +++ b/src/ui/inc/FUiCtrl_ToolbarPresenter.h @@ -25,26 +25,22 @@ #define _FUI_CTRL_INTERNAL_TOOLBAR_PRESENTER_H_ #include +#include #include +#include "FUiCtrl_FlickAnimation.h" #include "FUiCtrl_Toolbar.h" +namespace Tizen { namespace Ui { namespace Animations { + class VisualElementAnimation; +}}} // Tizen::Ui::Animations + namespace Tizen { namespace Ui { namespace Controls { class _Toolbar; class _ToolbarModel; class _Label; - -enum ToolbarSeparatorType -{ - TOOLBAR_SEPARATOR_HEADER_BUTTON = 0, - TOOLBAR_SEPARATOR_HEADER_SEGMENT, - TOOLBAR_SEPARATOR_HEADER_SEGMENT_TITLE, - TOOLBAR_SEPARATOR_FOOTER_BUTTON, - TOOLBAR_SEPARATOR_FOOTER_SEGMENT, - TOOLBAR_SEPARATOR_FOOTER_TOOLBAR, - TOOLBAR_SEPARATOR_FOOTER_TAB -}; +class _FlickAnimation; /** * @class _ToolbarPresenter @@ -54,6 +50,7 @@ enum ToolbarSeparatorType class _ToolbarPresenter : public Tizen::Base::Object , public Tizen::Base::Runtime::ITimerEventListener + , public Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener , virtual public Tizen::Base::Runtime::IEventListener { public: @@ -71,9 +68,9 @@ public: void DrawDescriptionText(void); - void DrawEditItem(const Tizen::Graphics::Point& point); + void DrawEditItem(const Tizen::Graphics::FloatPoint& point); - void DrawSeparator(ToolbarSeparatorType type, const Tizen::Graphics::Point& point, Tizen::Graphics::Canvas* pCanvas); + void DrawDivider(const Tizen::Graphics::FloatPoint& point, Tizen::Graphics::Canvas* pCanvas); void DrawItems(void); @@ -95,7 +92,7 @@ public: result SetTitleText(const Tizen::Base::String& title, HorizontalAlignment alignment); - result SetUsableAreaBounds(const Tizen::Graphics::Rectangle& rect); + result SetUsableAreaBounds(const Tizen::Graphics::FloatRectangle& rect); bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -105,8 +102,12 @@ public: bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); + void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation); + bool OnLongPressGestureDetected(void); + virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture); + virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); result TimerForTitleSlideInit(void); @@ -115,19 +116,39 @@ public: result TimerForTitleSlideTimeout(void); - Tizen::Graphics::Rectangle GetTitleTextBounds(void) const; + Tizen::Graphics::FloatRectangle GetTitleTextBoundsF(void) const; - Tizen::Graphics::Rectangle GetDescriptionBounds(void) const; + Tizen::Graphics::FloatRectangle GetDescriptionBoundsF(void) const; void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, int& size); - void SetFontInfo(unsigned long style, int size); + void OnFontInfoRequested(unsigned long& style, float& size); + void SetFontInfo(unsigned long style, float size); + + result AdjustItemPositionX(float distance); protected: result _SetModel(const _ToolbarModel& toolbarModel); private: - result AdjustItemPositionX(int distance); + void LoadBouncingEffectBitmap(ToolbarStyle style, bool isHeader, bool moveRight); + void SetBouncingVisualElement(float startX, float startY); + void StartBouncingEffect(void); + + void StartFlickAnimation(void); + result StartFlickAnimationTimer(void); + result ResetFlickAnimationTimer(void); + + void SetFirstLoadedItemIndex(void); + void SetLastLoadedItemIndex(void); + + float CalculateProgress(float timeProgress) const; + + void SetItemFit(int); + + virtual void OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target); + virtual void OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount); + virtual void OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally); private: _Toolbar* __pToolbar; @@ -144,7 +165,7 @@ private: int __editItemIndex; - int __initialPressedItemIndex; + int __pressedItemIndex; _ButtonStatus __initialPressesItemStatus; @@ -152,15 +173,19 @@ private: Tizen::Graphics::Bitmap* __pTitleBackgroundBitmap; + Tizen::Graphics::Bitmap* __pBouncingEffectBitmap; + Tizen::Base::Runtime::Timer* __pTitleSlideTimer; - Tizen::Graphics::Rectangle __titleRect; + Tizen::Base::Runtime::Timer* __pFlickAnimationTimer; - Tizen::Graphics::Rectangle __descriptionRect; + Tizen::Graphics::FloatRectangle __titleRect; - Tizen::Graphics::Rectangle __toolbarUsableArea; + Tizen::Graphics::FloatRectangle __descriptionRect; - Tizen::Graphics::Point __currentTouchPosition; + Tizen::Graphics::FloatRectangle __toolbarUsableArea; + + Tizen::Graphics::FloatPoint __currentTouchPosition; Tizen::Base::String __titleText; @@ -172,12 +197,38 @@ private: Tizen::Graphics::_Text::TextObject* __pTitleTextObject; - Tizen::Graphics::_Text::TextObjectActionType __titleSlidingAction; + Tizen::Ui::Animations::VisualElement* __pBouncingEffectVe; + + _FlickAnimation __flickAnimation; + + static const int FLICK_ANIMATION_TIMER_PERIOD = 3; + static const int FLICK_ANIMATION_FPS_TAB = 30; + static const int FLICK_ANIMATION_SENSITIVITY_TAB = 30; + static const int FLICK_ANIMATION_COUNT = 50; + + + float __moveDistance; + float __flickMove; + float __flickDistance; + int __flickFlag; + int __firstLoadedItemIndex; + int __lastLoadedItemIndex; + bool __tabSlideLeft; + bool __tabSlideRight; + + Tizen::Graphics::FloatDimension __portraitSize; + Tizen::Graphics::FloatDimension __landscapeSize; unsigned long __fontStyle; - int __fontSize; + float __fontSize; + bool __tabMoved; + + bool __isBouncingEffectStarted; + float __bouncingEffectWidth; + float __bouncingEffectHeight; - bool __touchMoveHandled; + bool __titlePressed; + bool __titleSliding; private: _ToolbarPresenter(const _ToolbarPresenter& value); diff --git a/src/ui/inc/FUiCtrl_UiListViewItemEventArg.h b/src/ui/inc/FUiCtrl_UiListViewItemEventArg.h index 2dd431e..7e6fd0e 100644 --- a/src/ui/inc/FUiCtrl_UiListViewItemEventArg.h +++ b/src/ui/inc/FUiCtrl_UiListViewItemEventArg.h @@ -34,8 +34,7 @@ namespace Tizen { namespace Ui { namespace Controls enum ListViewItemEventNotifyType { - NOTIFY_TYPE_ITEM_LONGPRESSED = 0, - NOTIFY_TYPE_CONTEXTITEM_SELCTED, + NOTIFY_TYPE_CONTEXTITEM_SELCTED = 0, NOTIFY_TYPE_CONTEXTITEM_HIGHLIGHTED, }; diff --git a/src/ui/inc/FUiCtrl_UiScrollEventArg.h b/src/ui/inc/FUiCtrl_UiScrollEventArg.h index 0931516..1d92299 100644 --- a/src/ui/inc/FUiCtrl_UiScrollEventArg.h +++ b/src/ui/inc/FUiCtrl_UiScrollEventArg.h @@ -62,12 +62,19 @@ public: static _UiScrollEventArg* GetScrollEventArgN(const _Control& source); /** + * General getter for %_ScrollEventArg class object when fire OnScrollJumpToTop event + * + * @param[in] source A pointer to the Object instance which contains this instance + */ + static _UiScrollEventArg* GetScrollJumpToTopEventArgN(const _Control& source); + + /** * General getter for %_ScrollEventArg class object when fire OnScrollPositionChanged event * * @param[in] source A pointer to the Object instance which contains this instance * @param[in] scrollPosition A scroll position of the scroll */ - static _UiScrollEventArg* GetScrollEventArgN(const _Control& source, int scrollPosition); + static _UiScrollEventArg* GetScrollEventArgN(const _Control& source, float scrollPosition); /** * General getter for %_ScrollEventArg class object when fire OnScrollEndReached event @@ -105,7 +112,7 @@ public: * * @return See the comment above. */ - int GetScrollPosition(void) const; + float GetScrollPosition(void) const; // Attribute private: @@ -117,14 +124,14 @@ private: * @param[in] scrollPosition A scroll position of the scroll * @param[in] scrollType A direction of the scroll */ - _UiScrollEventArg(_ScrollEventType eventType, const _Control& source, int scrollPosition = -1, ScrollEndEvent scrollType = SCROLL_END_EVENT_END_TOP); + _UiScrollEventArg(_ScrollEventType eventType, const _Control& source, float scrollPosition = -1.0f, ScrollEndEvent scrollType = SCROLL_END_EVENT_END_TOP); /** * Event source. */ _ScrollEventType __eventType; _Control* __pSource; - int __scrollPosition; + float __scrollPosition; ScrollEndEvent __scrollType; }; // _UiScrollEvent diff --git a/src/ui/inc/FUi_AccessibilityContainer.h b/src/ui/inc/FUi_AccessibilityContainer.h index 5dea6a2..097b9a7 100644 --- a/src/ui/inc/FUi_AccessibilityContainer.h +++ b/src/ui/inc/FUi_AccessibilityContainer.h @@ -38,7 +38,7 @@ class String; namespace Tizen { namespace Graphics { class Point; -class Rectangle; +class FloatRectangle; }} //Tizen::Graphics namespace Tizen { namespace Ui { @@ -46,6 +46,7 @@ namespace Tizen { namespace Ui { class IAccessibilityListener; class _AccessibilityElement; class _IAccessibilityListener; +class _IAccessibilityFocusHandler; class _Control; enum AccessibilityScreenReaderSpeechRate @@ -63,7 +64,7 @@ enum AccessibilityScreenReaderSpeechRate * * Defines the trait of the accessibility element. * - * @since 2.0 + * @since 2.1 */ enum AccessibilityTraits { @@ -109,11 +110,12 @@ enum AccessibilityTraits ACCESSIBILITY_TRAITS_END }; -const int ACCESSIBILITY_PRIORTY_TOP = 55555; -const int ACCESSIBILITY_PRIORTY_NORMAL = 10000; -const int ACCESSIBILITY_PRIORTY_BOTTOM = 0; +const int ACCESSIBILITY_PRIORITY_TOP = 55555; +const int ACCESSIBILITY_PRIORITY_NORMAL = 10000; +const int ACCESSIBILITY_PRIORITY_BOTTOM = 5000; +const int ACCESSIBILITY_PRIORITY_KEYPAD = 1000; -class _AccessibilityContainer +class _OSP_EXPORT_ _AccessibilityContainer { public: _AccessibilityContainer(const _Control& owner); @@ -135,13 +137,14 @@ public: result RemoveElement(const _AccessibilityElement& element); result RemoveAllElement(void); + _AccessibilityElement* GetChildElement(int index) const; _AccessibilityElement* GetChildElement(const Tizen::Base::String& name) const; void GetElements(Tizen::Base::Collection::IListT<_AccessibilityElement*>& list) const; Tizen::Base::Collection::IListT<_AccessibilityElement*>* GetElementsN(void) const; result MoveElement(const _AccessibilityElement* pPreviousElement, const _AccessibilityElement& element); - void ManageFocus(bool set); + void SetFocusHandler(_IAccessibilityFocusHandler* pHandler); bool IsFocusManaged(void); void SetCurrentFocusedElement(_AccessibilityElement* pElement); _AccessibilityElement* GetCurrentFocusedElement(void) const; @@ -159,7 +162,7 @@ public: bool GetEnableState(void); void Activate(bool enable); bool IsActivated(void) const; - Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const; + Tizen::Graphics::FloatRectangle GetAbsoluteBounds(void) const; void ReadingAll(void); Tizen::Base::String GetCurrentGrammar(void) const; @@ -182,7 +185,7 @@ private: bool __activated; IAccessibilityListener* __pListener; bool __enableState; - bool __focusManaged; + _IAccessibilityFocusHandler* __pFocusHandler; }; //class _AccessibilityContainer }} //Tizen::Ui diff --git a/src/ui/inc/FUi_AccessibilityContainerImpl.h b/src/ui/inc/FUi_AccessibilityContainerImpl.h index ba2cea6..c16daf6 100644 --- a/src/ui/inc/FUi_AccessibilityContainerImpl.h +++ b/src/ui/inc/FUi_AccessibilityContainerImpl.h @@ -50,7 +50,7 @@ class _ControlImpl; class _AccessibilityElementImpl; class _AccessibilityContainer; -class _AccessibilityContainerImpl +class _OSP_EXPORT_ _AccessibilityContainerImpl : public Tizen::Base::Object , virtual public _IAccessibilityListener { @@ -83,7 +83,8 @@ public: virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); diff --git a/src/ui/inc/FUi_AccessibilityElement.h b/src/ui/inc/FUi_AccessibilityElement.h index 2d6df96..6d2dda0 100644 --- a/src/ui/inc/FUi_AccessibilityElement.h +++ b/src/ui/inc/FUi_AccessibilityElement.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace Tizen { namespace Ui { @@ -34,21 +35,23 @@ namespace Tizen { namespace Ui { class _AccessibilityContainer; class _AccessibilityElementImpl; -class _AccessibilityElement +class _OSP_EXPORT_ _AccessibilityElement { public: _AccessibilityElement(bool systemElement = false); virtual ~_AccessibilityElement(void); + result Construct(const Tizen::Base::String& name, const Tizen::Graphics::FloatRectangle& bounds); result Construct(const Tizen::Base::String& name, const Tizen::Graphics::Rectangle& bounds); + void SetBounds(const Tizen::Graphics::FloatRectangle& bounds); void SetBounds(const Tizen::Graphics::Rectangle& bounds); - Tizen::Graphics::Rectangle GetBounds(void) const; - Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const; + Tizen::Graphics::FloatRectangle GetBounds(void) const; + Tizen::Graphics::FloatRectangle GetAbsoluteBounds(void) const; void SetName(const Tizen::Base::String& name); Tizen::Base::String GetName(void) const; void SetLabel(const Tizen::Base::String& label); Tizen::Base::String GetLabel(void) const; - void SetHint(const Tizen::Base::String& hint); + void SetHint(const Tizen::Base::String& hint, bool setHintByUser = false); Tizen::Base::String GetHint(void) const; void SetStatus(const Tizen::Base::String& guide); Tizen::Base::String GetStatus(void) const; @@ -58,6 +61,7 @@ public: Tizen::Base::String GetTraitString(void) const; void SetValue(const Tizen::Base::String& value); Tizen::Base::String GetValue(void) const; + void SetHintDisabled(bool enable); void Activate(bool enable); bool IsActivated(void) const; void SetParent(const _AccessibilityContainer& parent); @@ -70,6 +74,7 @@ public: Tizen::Base::String GetReadingContents(void) const; bool IsSystemElement(void); + bool IsUpdated(void); private: _AccessibilityElement(const _AccessibilityElement& rhs); @@ -77,8 +82,8 @@ private: private: Tizen::Base::String __name; - Tizen::Graphics::Rectangle __bounds; - Tizen::Graphics::Rectangle __absBounds; + Tizen::Graphics::FloatRectangle __bounds; + Tizen::Graphics::FloatRectangle __absBounds; Tizen::Base::String __label; Tizen::Base::String __hint; Tizen::Base::String __status; @@ -90,6 +95,9 @@ private: bool __systemElement; bool __activated; bool __supportOperatingGesture; + bool __setHintByUser; + bool __disabledHint; + bool __updateContents; }; }} #endif //_FUI_INTERNAL_ACCESSIBILITY_ELEMENT_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_AccessibilityElementImpl.h b/src/ui/inc/FUi_AccessibilityElementImpl.h index 90352db..b1af552 100644 --- a/src/ui/inc/FUi_AccessibilityElementImpl.h +++ b/src/ui/inc/FUi_AccessibilityElementImpl.h @@ -34,7 +34,7 @@ class String; }} //Tizen::Base namespace Tizen { namespace Graphics { -class Rectangle; +class FloatRectangle; }} //Tizen::Graphics namespace Tizen { namespace Ui { @@ -43,14 +43,14 @@ class AccessibilityElement; class _AccessibilityElement; class IAccessibilityListener; -class _AccessibilityElementImpl +class _OSP_EXPORT_ _AccessibilityElementImpl { public: _AccessibilityElementImpl(const AccessibilityElement& element); _AccessibilityElementImpl(const _AccessibilityElement& element); virtual ~_AccessibilityElementImpl(void); - result Construct(const Tizen::Base::String& name, const Tizen::Graphics::Rectangle& bounds); - void SetBounds(const Tizen::Graphics::Rectangle& bounds); + result Construct(const Tizen::Base::String& name, const Tizen::Graphics::FloatRectangle& bounds); + void SetBounds(const Tizen::Graphics::FloatRectangle& bounds); void SetName(const Tizen::Base::String& name); void SetLabel(const Tizen::Base::String& label); void SetHint(const Tizen::Base::String& hint); @@ -65,7 +65,7 @@ public: _AccessibilityElement& GetCore(); const _AccessibilityElement& GetCore() const; Tizen::Base::String GetName(void) const; - Tizen::Graphics::Rectangle GetBounds(void) const; + Tizen::Graphics::FloatRectangle GetBounds(void) const; Tizen::Base::String GetLabel(void) const; Tizen::Base::String GetHint(void) const; Tizen::Base::String GetStatus(void) const; diff --git a/src/ui/inc/FUi_AccessibilityGesture.h b/src/ui/inc/FUi_AccessibilityGesture.h index 90e3c60..03a76bb 100644 --- a/src/ui/inc/FUi_AccessibilityGesture.h +++ b/src/ui/inc/FUi_AccessibilityGesture.h @@ -64,7 +64,7 @@ class _AccessibilityGesture public: _AccessibilityGesture(_AccessibilityManager& manager); virtual ~_AccessibilityGesture(void); - static bool ProcessGesture(_AccessibilityGestureType type, int x = 0, int y = 0); + static bool ProcessGesture(_AccessibilityGestureType type, float x = 0, float y = 0); private: _AccessibilityGesture(const _AccessibilityGesture& rhs); _AccessibilityGesture& operator =(const _AccessibilityGesture& rhs); diff --git a/src/ui/inc/FUi_AccessibilityManager.h b/src/ui/inc/FUi_AccessibilityManager.h index 4631242..baea0f9 100644 --- a/src/ui/inc/FUi_AccessibilityManager.h +++ b/src/ui/inc/FUi_AccessibilityManager.h @@ -26,8 +26,8 @@ #define _FUI_INTERNAL_ACCESSIBILITY_MANAGER_H_ #include -#include -#include +#include +#include #include #include #include @@ -54,6 +54,12 @@ class _AccessibilitySystemSettingLoader; class _AccessibilityContainer; class _AccessibilityElement; +enum _AccessibilityTtsMode +{ + _ACCESSIBILITY_TTS_MODE_APPEND, + _ACCESSIBILITY_TTS_MODE_REPLACE, +}; + enum _AccessibilityFocusDirection { _ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS = -1, @@ -61,7 +67,13 @@ enum _AccessibilityFocusDirection _ACCESSIBILITY_FOCUS_DIRECTION_NEXT = 1 }; -class _AccessibilityManager +enum _AccessibilityAutoReadingMode +{ + _ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM_OF_CONTENTS = -1, + _ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM = 0, + _ACCESSIBILITY_AUTO_READING_MODE_CURRENT_FOCUS = 1 +}; +class _OSP_EXPORT_ _AccessibilityManager { public: static _AccessibilityManager* GetInstance(void); @@ -69,8 +81,8 @@ public: static void ReleaseInstance(void); ~_AccessibilityManager(void); - AccessibilityScreenReaderStatus GetReadingtatus(void); - void ReadElement(int index); + AccessibilityScreenReaderStatus GetTtsStatus(void); + void ReadElement(_AccessibilityAutoReadingMode mode); result ReadElement(const _AccessibilityElement& element); result ReadContent(const Tizen::Base::String& content); result ReadingStop(void); @@ -82,16 +94,20 @@ public: void AddContainer(const _AccessibilityContainer& container); void RemoveContainer(const _AccessibilityContainer& container); - bool ProcessGesture(_AccessibilityGestureType type, const Tizen::Graphics::Point& point,const _TouchGestureDetector* pDetector = null); + bool ProcessGesture(_AccessibilityGestureType type, const Tizen::Graphics::FloatPoint& point,const _TouchGestureDetector* pDetector = null); Tizen::Base::String GetCurrentGrammar(void); + void OnChangedLocale(void); void OnAccessibilityScreenReaderIsActivated(bool set); bool IsAccessibilityActivated(void); bool IsScreenReaderActivated(void); - int GetLargeFontSize(void); + float GetLargeFontSize(void); void RequestToDrawFocusUi(void); - void RequestAutoReading(void); + void RequestAutoReading(_AccessibilityAutoReadingMode mode); + + void SetTtsMode(_AccessibilityTtsMode mode); + void SetGlobalFocusedElement(_AccessibilityElement& element); Tizen::Base::_HandleT <_AccessibilityContainer> Register(_AccessibilityContainer* pObject); void Unregister(Tizen::Base::_HandleT <_AccessibilityContainer> handle); @@ -110,7 +126,8 @@ private: _AccessibilityManager& operator =(const _AccessibilityManager& rhs); static void InitializeInstance(void); bool MoveFocus(_AccessibilityFocusDirection direction); - void DrawFocusUi(const _AccessibilityContainer& container); + void DrawFocusUi(const _AccessibilityElement& element); + void EraseFocusUi(void); void MakeList(void); void MakeList(_AccessibilityContainer* container); void Initialize(void); @@ -127,7 +144,7 @@ private: Tizen::Base::_ObjectManagerT <_AccessibilityContainer> __objectManager; _AccessibilityGesture* __pAccGesture; - _AccessibilityTtsPlayer* __pPlayer; + _AccessibilityTtsPlayer* __pTtsPlayer; _AccessibilitySystemSettingLoader* __pSettingLoader; _AccessibilityContainer* __pTargetContainer; _AccessibilityElement* __pTargetElement; @@ -136,6 +153,7 @@ private: Tizen::Base::Collection::LinkedListT<_AccessibilityElement*> __candidateList; GestureMode __mode; _ControlHandle __targetControlHandle; + _ControlHandle __focusedControlHandle; Tizen::Ui::Animations::VisualElement* __pReadingVe; Tizen::Ui::Animations::VisualElement* __pFocusVe; _Control* __pPanningControl; diff --git a/src/ui/inc/FUi_AccessibilitySystemSettingLoader.h b/src/ui/inc/FUi_AccessibilitySystemSettingLoader.h index 8e3bdc3..4a7fae4 100644 --- a/src/ui/inc/FUi_AccessibilitySystemSettingLoader.h +++ b/src/ui/inc/FUi_AccessibilitySystemSettingLoader.h @@ -26,6 +26,11 @@ #include +namespace Tizen { namespace Base +{ +class String; +}} //Tizen::Base + namespace Tizen { namespace Ui { class _AccessibilityManager; @@ -39,8 +44,10 @@ public: bool IsAccessibilityActivated(void); bool IsScreenReaderActivated(void); - int GetLargeFontSize(void); + float GetLargeFontSize(void); + Tizen::Base::String GetLocaleString(void); static void SetSystemSetting(const Tizen::Base::String key, bool value); + private: _AccessibilitySystemSettingLoader(const _AccessibilitySystemSettingLoader& rhs); diff --git a/src/ui/inc/FUi_AccessibilityTtsPlayer.h b/src/ui/inc/FUi_AccessibilityTtsPlayer.h index 2fb1b2f..3b93185 100644 --- a/src/ui/inc/FUi_AccessibilityTtsPlayer.h +++ b/src/ui/inc/FUi_AccessibilityTtsPlayer.h @@ -29,16 +29,22 @@ #include #include #include +#include namespace Tizen { namespace Base { class String; -}} +}} //namespace Tizen::Base + +namespace Tizen { namespace Locales +{ +class Locale; +}} //namespace Tizen::Locales namespace Tizen { namespace Uix { namespace Speech { class TextToSpeech; -}}} +}}} //Tizen::Uix::Speech namespace Tizen { namespace Ui { @@ -54,7 +60,9 @@ public: AccessibilityScreenReaderStatus GetStatus(void); Tizen::Base::String GetCurrentGrammar(void); - + void SetMode(_AccessibilityTtsMode mode); + void ApplyLocale(void); + void SetLocale(const Tizen::Base::String& localeString); private: _AccessibilityTtsPlayer(_AccessibilityManager& manager); result Activate(void); @@ -65,7 +73,8 @@ private: virtual void OnTextToSpeechStatusChanged (Tizen::Uix::Speech::TextToSpeechStatus status); virtual void OnTextToSpeechCompleted(void); void SetStatus(AccessibilityScreenReaderStatus status); - + Tizen::Locales::Locale GetCurrentLocale(void); + private: _AccessibilityTtsPlayer(const _AccessibilityTtsPlayer& rhs); _AccessibilityTtsPlayer& operator =(const _AccessibilityTtsPlayer& rhs); @@ -74,9 +83,9 @@ private: void* __handle; Tizen::Uix::Speech::TextToSpeech* __pTts; Tizen::Base::String __grammar; - int __localeIdx; + Tizen::Base::String __localeString; AccessibilityScreenReaderStatus __status; - + Tizen::Uix::Speech::TextToSpeechRequestMode __ttsRequestMode; _AccessibilityManager* __pManager; friend class _AccessibilityManager; }; //class _AccessibilityTtsPlayer diff --git a/src/ui/inc/FUi_ClipboardPopupEvent.h b/src/ui/inc/FUi_ClipboardPopupEvent.h new file mode 100644 index 0000000..ae3ba31 --- /dev/null +++ b/src/ui/inc/FUi_ClipboardPopupEvent.h @@ -0,0 +1,63 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_ClipboardPopupEvent.h + * @brief This is the header file containing the declaration of the _ClipboardPopupEvent class. + * + * This header file contains the declarations of the _ClipboardPopupEvent class. + */ + +#ifndef _FUI_INTERNAL_CLIPBOARD_POPUP_EVENT_H_ +#define _FUI_INTERNAL_CLIPBOARD_POPUP_EVENT_H_ + +#include +#include +#include + +namespace Tizen { namespace Ui +{ + +enum _ClipboardPopupState +{ + _CLIPBOARD_POPUP_STATE_OPENED, + _CLIPBOARD_POPUP_STATE_CLOSED, + _CLIPBOARD_POPUP_STATE_BOUNDS_CHANGED, +}; + +class _ClipboardPopupEvent + : public Tizen::Base::Runtime::_Event +{ +public: + static _ClipboardPopupEvent* CreateInstanceN(void); + static Tizen::Base::Runtime::IEventArg* CreateClipboardPopupEventArgN(_ClipboardPopupState clipboardPopupState, Tizen::Graphics::Dimension& clipboardPopupSize); + + virtual ~_ClipboardPopupEvent(void); + +protected: + virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg); + +private: + _ClipboardPopupEvent(void); + + _ClipboardPopupEvent(const _ClipboardPopupEvent& rhs); + _ClipboardPopupEvent& operator =(const _ClipboardPopupEvent& rhs); +}; // _ClipboardPopupEvent + +}} // Tizen::Ui + +#endif // _FUI_INTERNAL_CLIPBOARD_POPUP_EVENT_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_Colorf.h b/src/ui/inc/FUi_Colorf.h index 359cb7c..90c6cf0 100644 --- a/src/ui/inc/FUi_Colorf.h +++ b/src/ui/inc/FUi_Colorf.h @@ -16,7 +16,7 @@ // /** - * @file FUi_Colorf.h + * @file FUiAnim_Colorf.h * @brief Header file of _Colorf class * * This file contains declarations _Colorf class. diff --git a/src/ui/inc/FUi_ContainerImpl.h b/src/ui/inc/FUi_ContainerImpl.h old mode 100644 new mode 100755 index b565515..878415b --- a/src/ui/inc/FUi_ContainerImpl.h +++ b/src/ui/inc/FUi_ContainerImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ContainerImpl.h * @brief This is the header file for the _ContainerImp interface. @@ -41,12 +42,14 @@ public: void Initialize(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout); static _ContainerImpl* CreateContainerImplN(Container* pPublic); static _ContainerImpl* CreateContainerImplN(Container* pPublic, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); + static _ContainerImpl* CreateContainerImplN(Container* pPublic, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); virtual ~_ContainerImpl(void); static _ContainerImpl* GetInstance(Container& container); static const _ContainerImpl* GetInstance(const Container& container); //Operation // [ToDo] Must consider transforOwnership flags. + virtual result Destroy(void); result AddChild(_ControlImpl* pChild, bool transferOwnership = true); result RemoveChild(_ControlImpl* pChild, bool deallocate = true); result RemoveChild(int index); @@ -87,14 +90,17 @@ public: virtual void OnVisibleStateChanging(void); virtual void OnVisibleStateChanged(void); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnBoundsChanged(void); virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize); + virtual void OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize); void CallOnDraw(void); protected: _ContainerImpl(Control* pPublic, _Control* pCore, const Layout* pPublicPortraitLayout = null, const Layout* pPublicLandscapeLayout = null); _ContainerImpl(Control* pPublic, _Control* pCore, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); + _ContainerImpl(Control* pPublic, _Control* pCore, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); private: _ContainerImpl(const _ContainerImpl& rhs); diff --git a/src/ui/inc/FUi_Control.h b/src/ui/inc/FUi_Control.h old mode 100644 new mode 100755 index f3fb844..6883f81 --- a/src/ui/inc/FUi_Control.h +++ b/src/ui/inc/FUi_Control.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Control.h * @brief This is the header file for the _Control class. @@ -24,9 +25,11 @@ #ifndef _FUI_INTERNAL_CONTROL_H_ #define _FUI_INTERNAL_CONTROL_H_ +#include #include #include #include "FUi_Types.h" +#include "FUiAnim_VisualElement.h" #include "FUi_UiEventTypes.h" #include "FUi_IUiEventListener.h" #include "FUi_IKeyEventPreviewer.h" @@ -71,12 +74,14 @@ public: // Queries virtual Tizen::Graphics::Dimension GetContentSize(void) const = 0; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const = 0; virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point) = 0; virtual Tizen::Base::String GetDescription(void) const = 0; // Invoked by operations virtual void OnDraw(void) = 0; virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::Dimension& size) = 0; + virtual Tizen::Graphics::Canvas* OnCanvasRequestedFN(const Tizen::Graphics::FloatDimension& size) = 0; virtual Tizen::Graphics::Bitmap* OnCapturedBitmapRequestedN(void) = 0; virtual result OnAttaching(const _Control* pParent) = 0; virtual result OnAttached(void) = 0; @@ -86,8 +91,10 @@ public: virtual result OnDetachingFromMainTree(void) = 0; virtual result OnDetaching(void) = 0; virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds) = 0; + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds) = 0; virtual void OnBoundsChanged(void) = 0; virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize) = 0; + virtual void OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize) = 0; virtual void OnParentBoundsChanged(const _Control& parent) = 0; virtual void OnChildAttached(const _Control& child) = 0; virtual void OnChildDetaching(const _Control& child) = 0; @@ -102,6 +109,10 @@ public: virtual void OnAncestorEnableStateChanged(const _Control& control) = 0; virtual void OnFontChanged(Tizen::Graphics::Font* pFont) = 0; virtual void OnFontInfoRequested(unsigned long& style, int& size) =0; + virtual void OnFontInfoRequested(unsigned long& style, float& size) =0; + virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor) = 0; + virtual void OnDrawFocus(void) = 0; + virtual void OnChildControlFocusMoved(const _Control& control) = 0; }; class _IPropagatedTouchEventListener @@ -198,14 +209,16 @@ public: // Virtual Queries: Do not use directly. Use through delegate (GetControlDelegate()) virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point); virtual Tizen::Base::String GetDescription(void) const; - virtual int GetVerticalScrollPosition(void) const; - virtual int GetHorizontalScrollPosition(void) const; + virtual float GetVerticalScrollPosition(void) const; + virtual float GetHorizontalScrollPosition(void) const; // Callbacks // [ToDo] Make these callbacks protected. virtual void OnDraw(void); virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::Dimension& size); + virtual Tizen::Graphics::Canvas* OnCanvasRequestedFN(const Tizen::Graphics::FloatDimension& size); virtual Tizen::Graphics::Bitmap* OnCapturedBitmapRequestedN(void); virtual result OnAttaching(const _Control* pParent); virtual result OnAttached(void); @@ -215,8 +228,10 @@ public: virtual void OnAttachingFailed(const _Control& parent); virtual result OnDetaching(void); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnBoundsChanged(void); virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize); + virtual void OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize); virtual void OnParentBoundsChanged(const _Control& parent); virtual void OnChildAttached(const _Control& child); virtual void OnChildDetaching(const _Control& child); @@ -235,6 +250,10 @@ public: virtual void OnTouchCancelHandled(const _Control& control); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); + virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor); + virtual void OnDrawFocus(void); + virtual void OnChildControlFocusMoved(const _Control& control); // Control Hierarchy - Common bool HasParent(void) const; @@ -265,6 +284,10 @@ public: result MoveChildAfter(const _Control& targetChild, const _Control& child); result MoveChildBefore(const _Control& targetChild, const _Control& child); + result AttachOwnee(_Window& window); + void DetachOwnee(_Window& window); + void DetachAllOwnees(void); + result SetChildAlwaysOnTop(_Control& child); result SetChildAlwaysAtBottom(_Control& child); result ResetChildLayer(_Control& child); @@ -317,14 +340,21 @@ public: void Invalidate(void); void Invalidate(bool recursive); void Invalidate(const Tizen::Graphics::Rectangle& rect); + void Invalidate(const Tizen::Graphics::FloatRectangle& rect); Tizen::Graphics::Canvas* GetCanvasN(void) const; Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const; + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const; bool IsCalledGetCanvasN(void) const; Tizen::Graphics::Canvas* GetClientCanvasN(void) const; Tizen::Graphics::Color GetBackgroundColor(void) const; void SetBackgroundColor(const Tizen::Graphics::Color& color); + void SetContentAreaBounds(const Tizen::Graphics::Rectangle& rect); + void SetContentAreaBounds(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::Rectangle GetContentAreaBounds(void) const; + Tizen::Graphics::FloatRectangle GetContentAreaBoundsF(void) const; Tizen::Graphics::Bitmap* GetCapturedBitmapN(bool includeChildren) const; Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const; + Tizen::Graphics::FloatRectangle GetInvalidatedBoundsF(void) const; void SetDrawWhenVisible(bool draw); bool IsDrawWhenVisible(void); void SetTerminatingOrder(bool postOrderTraversal); @@ -333,15 +363,20 @@ public: result SetFont(const Tizen::Base::String& fontName); Tizen::Graphics::Font* GetFallbackFont(void); Tizen::Base::String GetFont(void) const; + result SetFontFromFile(const Tizen::Base::String& fileName); + Tizen::Base::String GetFontFile(void) const; // Enable bool IsEnabled(void) const; bool GetEnableState(void) const; void SetEnableState(bool enableState); - bool IsInputEnabled(void) const; + bool IsEventEnabled(void) const; + void SetEventEnableState(bool enableState); + + bool IsInputEventEnabled(void) const; bool GetInputEnableState(void) const; - void SetInputEnableState(bool inputEnableState); + void SetInputEventEnableState(bool enableState); // Visible bool IsVisible(void) const; @@ -353,10 +388,17 @@ public: void SetFocusable(bool focusable); bool IsFocused(void) const; _Control* GetFocused(void) const; - result SetFocused(void); + result SetFocused(bool on = true); + void SetFocusState(bool on); bool IsNativeObjectFocusable(void) const; void SetNativeObjectFocusable(bool focusable); +// Focus UI + void SetPreviousFocus(_Control* pPreviousFocus); + void SetNextFocus(_Control* pNextFocus); + _Control* GetPreviousFocus() const; + _Control* GetNextFocus() const; + // Clipping bool IsClipToParent(void) const; result SetClipToParent(bool clipToParent); @@ -369,27 +411,43 @@ public: void SetResizable(bool resizable); Tizen::Graphics::Rectangle GetBounds(void) const; + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; Tizen::Graphics::Point GetPosition(void) const; + Tizen::Graphics::FloatPoint GetPositionF(void) const; Tizen::Graphics::Dimension GetSize(void) const; - result SetBounds(const Tizen::Graphics::Rectangle& bounds, bool callBoundsChangeCallbacks = true); - result SetBounds(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks = true); + Tizen::Graphics::FloatDimension GetSizeF(void) const; + result SetBounds(const Tizen::Graphics::Rectangle& bounds, bool callBoundsChangeCallbacks = true, bool callUpdateBoundsOfVisualElement = true); + result SetBounds(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks = true, bool callUpdateBoundsOfVisualElement = true); result SetPosition(const Tizen::Graphics::Point& position); + result SetPosition(const Tizen::Graphics::FloatPoint& position); result SetSize(const Tizen::Graphics::Dimension& size); + result SetSize(const Tizen::Graphics::FloatDimension& size); Tizen::Graphics::Dimension GetMinimumSize(void) const; + Tizen::Graphics::FloatDimension GetMinimumSizeF(void) const; Tizen::Graphics::Dimension GetMaximumSize(void) const; + Tizen::Graphics::FloatDimension GetMaximumSizeF(void) const; result SetMinimumSize(const Tizen::Graphics::Dimension& newMinSize); + result SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinSize); result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxSize); + result SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxSize); Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const; + Tizen::Graphics::FloatPoint ConvertToControlPosition(const Tizen::Graphics::FloatPoint& screenPosition) const; Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const; + Tizen::Graphics::FloatPoint ConvertToScreenPosition(const Tizen::Graphics::FloatPoint& controlPosition) const; Tizen::Graphics::Rectangle GetClientBounds(void) const; + Tizen::Graphics::FloatRectangle GetClientBoundsF(void) const; Tizen::Graphics::Rectangle GetClientBounds(const Tizen::Graphics::Dimension& size) const; + Tizen::Graphics::FloatRectangle GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const; Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const; + Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(void) const; result SetClientBounds(const Tizen::Graphics::Rectangle& bounds); + result SetClientBounds(const Tizen::Graphics::FloatRectangle& bounds); bool IsCalledSetClientBounds(void); bool Contains(const Tizen::Graphics::Point& point) const; + bool Contains(const Tizen::Graphics::FloatPoint& point) const; _Control* GetTopmostChildAt(const Tizen::Graphics::Point& point) const; // Layout @@ -436,8 +494,9 @@ public: void SetDragEnabled(bool enabled); void SetDropEnabled(bool enabled); - void SetTouchMoveAllowance(_TouchMoveAllowance touchMoveAllowanceType); - _TouchMoveAllowance GetTouchMoveAllowance(void) const; + void SetTouchPressThreshold(float distance); + float GetTouchPressThreshold(void) const; + int GetTouchPressThresholdPixel(void) const; void SetChangingEventTarget(bool isChangingEventTarget); bool GetChangingEventTarget(void) const; @@ -464,10 +523,7 @@ public: // Visual element: Do not use visual element directly. Animations::_VisualElement* GetVisualElement(void) const; - void PrintDescription(bool printChildren = true); - - void SetEventReceivable(bool receivable); - bool IsEventReceivable(void) const; + void PrintDescription(bool printChildren, int level); protected: _Control(void); @@ -483,8 +539,8 @@ private: bool IsInSizeRange(const Tizen::Graphics::Dimension& size); result AdjustSizeToRange(void); - result SetBoundsInternal(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks); - result SetBoundsFinal(const Tizen::Graphics::FloatRectangle& newBounds, bool changeLayoutBaseRect, bool callBoundsChangeCallbacks); + result SetBoundsInternal(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement = true); + result SetBoundsFinal(const Tizen::Graphics::FloatRectangle& newBounds, bool changeLayoutBaseRect, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement = true); result UpdateBoundsOfVisualElement(const Tizen::Graphics::FloatRectangle& controlBounds); const ControlList& GetChildList(void) const; @@ -503,14 +559,9 @@ private: result CallOnDetachingFromMainTree(_Control& control); void CallOnAncestorVisibleStateChanged(void); void CallOnAncestorEnableStateChanged(void); - - result AttachOwnee(_Window& window); - void DetachOwnee(_Window& window); - void DetachAllOwnees(void); - void SetLayer(_ControlLayer layer); - int PrintDescription(bool printChildren, int depth); + int PrintDescription(bool printChildren, int depth, int level); _ITouchEventPreviewer* GetEventPreviewer(_IntToType<_UI_EVENT_TOUCH>) const; _IKeyEventPreviewer* GetEventPreviewer(_IntToType<_UI_EVENT_KEY>) const; @@ -527,14 +578,6 @@ private: void SetEventListener(_IntToType<_UI_EVENT_FOCUS>, _IFocusEventListener* pListener); void SetEventListener(_IntToType<_UI_EVENT_NOTIFICAITON>, _INotificationEventListener* pListener); - -//--[ToDo] To be removed---------------------------------------------------------------------------------------------// -private: - void SetFocusOn(void); -public: - virtual void SetFocusOff(_Control* pFocus); -//-------------------------------------------------------------------------------------------------------------------// - private: _ControlHandle __controlHandle; Tizen::Base::String __name; @@ -543,12 +586,13 @@ private: ControlList* __pChildren; WindowList* __pOwnees; - Tizen::Graphics::Rectangle __bounds; - Tizen::Graphics::Rectangle __clientBounds; - Tizen::Graphics::Rectangle __absoluteBounds; - Tizen::Graphics::Rectangle __invalidatedBounds; - Tizen::Graphics::Dimension __minSize; - Tizen::Graphics::Dimension __maxSize; + Tizen::Graphics::FloatRectangle __bounds; + Tizen::Graphics::FloatRectangle __contentAreaBounds; + Tizen::Graphics::FloatRectangle __clientBounds; + Tizen::Graphics::FloatRectangle __absoluteBounds; + Tizen::Graphics::FloatRectangle __invalidatedBounds; + Tizen::Graphics::FloatDimension __minSize; + Tizen::Graphics::FloatDimension __maxSize; Tizen::Graphics::Color __backgroundColor; bool __movable; @@ -599,7 +643,7 @@ private: Tizen::Base::Collection::IListT<_TouchGestureDetector*>* __pCoreGestureDetectors; GestureMap* __pDetectStartedGestureMap; Tizen::Base::Collection::IListT<_TouchInfo*>* __pDelayedTouchInfoList; - _TouchMoveAllowance __touchMoveAllowance; + int __touchMoveAllowance; bool __isSentDelayedEvent; bool __isSendingDelayedEvent; bool __isChangingEventTarget; @@ -612,11 +656,27 @@ private: _AccessibilityContainer* __pAccessibilityContainer; bool __destroying; - bool __isEventReceivable; + bool __isEventEnableState; - bool __isControlFontChanged; + bool __isControlFontChanged; Tizen::Graphics::Font* __pFont; Tizen::Base::String __fontName; + Tizen::Base::String __fontFileName; + + _Control* __pPreviousFocus; + _Control* __pNextFocus; + + struct _VisualElementDeleter + { + void operator()(Tizen::Ui::Animations::VisualElement* pVisualElement) + { + if (pVisualElement) + { + pVisualElement->Destroy(); + } + } + }; + std::unique_ptr __pFocusVisualElement; friend class _Window; friend class _ControlManager; diff --git a/src/ui/inc/FUi_ControlImpl.h b/src/ui/inc/FUi_ControlImpl.h old mode 100644 new mode 100755 index 864103f..4b2f355 --- a/src/ui/inc/FUi_ControlImpl.h +++ b/src/ui/inc/FUi_ControlImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlImpl.h * @brief This is the header file for the _ControlImpl class. @@ -61,20 +62,27 @@ public: public: virtual ~SizeInfo(void); virtual Tizen::Graphics::Dimension GetDefaultMinimumSize(_ControlOrientation orientation) const; // default: (0, 0) + virtual Tizen::Graphics::FloatDimension GetDefaultMinimumSizeF(_ControlOrientation orientation) const; // default: (0, 0) virtual Tizen::Graphics::Dimension GetDefaultMaximumSize(_ControlOrientation orientation) const; // default: (short_max, short_max) + virtual Tizen::Graphics::FloatDimension GetDefaultMaximumSizeF(_ControlOrientation orientation) const; // default: (short_max, short_max) virtual Tizen::Graphics::Dimension GetMinimumSizeLimit(_ControlOrientation orientation) const; // default: (0, 0) + virtual Tizen::Graphics::FloatDimension GetMinimumSizeLimitF(_ControlOrientation orientation) const; // default: (0, 0) virtual Tizen::Graphics::Dimension GetMaximumSizeLimit(_ControlOrientation orientation) const; // default: (short_max, short_max) + virtual Tizen::Graphics::FloatDimension GetMaximumSizeLimitF(_ControlOrientation orientation) const; // default: (short_max, short_max) result CheckInitialSizeValid(const Tizen::Graphics::Dimension& size,_ControlOrientation orientation) const; + result CheckInitialSizeValidF(const Tizen::Graphics::FloatDimension& size,_ControlOrientation orientation) const; }; // Constants public: static Tizen::Graphics::Rectangle GetErrorBounds(void); + static Tizen::Graphics::FloatRectangle GetErrorBoundsF(void); static CompositeMode GetErrorCompositeMode(void); static Tizen::Graphics::Color GetErrorChromaKeyColor(void); static Tizen::Graphics::Dimension GetErrorMinimumSize(void); + static Tizen::Graphics::FloatDimension GetErrorMinimumSizeF(void); static Tizen::Graphics::Dimension GetErrorMaximumSize(void); - + static Tizen::Graphics::FloatDimension GetErrorMaximumSizeF(void); static const SizeInfo& GetFullScreenSizeInfo(void); // Life Cycle @@ -82,6 +90,7 @@ public: static _ControlImpl* CreateControlImplN(Control& control); virtual ~_ControlImpl(void); + virtual result Destroy(void); static _ControlImpl* GetInstance(Control& control); static const _ControlImpl* GetInstance(const Control& control); @@ -98,11 +107,13 @@ public: result AddKeyEventListener(IKeyEventListener& listener); result AddTouchEventListener(ITouchEventListener& listener); result AddDragDropEventListener(IDragDropEventListener& listener); + result AddDragDropEventListener(IDragDropEventListenerF& listener); result AddTouchModeChangedEventListener(ITouchModeChangedEventListener& listener); result RemoveFocusEventListener(IFocusEventListener& listener); result RemoveKeyEventListener(IKeyEventListener& listener); result RemoveTouchEventListener(ITouchEventListener& listener); result RemoveDragDropEventListener(IDragDropEventListener& listener); + result RemoveDragDropEventListenerF(IDragDropEventListenerF& listener); result RemoveTouchModeChangedEventListener(ITouchModeChangedEventListener& listener); result AddGestureDetector(const TouchGestureDetector& gestureDetector); result RemoveGestureDetector(const TouchGestureDetector& gestureDetector); @@ -114,12 +125,14 @@ public: // Queries virtual Tizen::Graphics::Dimension GetContentSize(void) const; + virtual Tizen::Graphics::FloatDimension GetContentSizeF(void) const; virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point); virtual Tizen::Base::String GetDescription(void) const; // Callbacks virtual void OnDraw(void); virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::Dimension& size); + virtual Tizen::Graphics::Canvas* OnCanvasRequestedFN(const Tizen::Graphics::FloatDimension& size); virtual Tizen::Graphics::Bitmap* OnCapturedBitmapRequestedN(void); virtual result OnAttaching(const _Control* pParent); virtual void OnAttachingFailed(const _Control& parent); @@ -129,8 +142,10 @@ public: virtual result OnDetachingFromMainTree(void); virtual result OnDetaching(void); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual void OnBoundsChanged(void); virtual void OnEvaluateSize(Tizen::Graphics::Dimension& evaluatedSize); + virtual void OnEvaluateSize(Tizen::Graphics::FloatDimension& evaluatedSize); virtual void OnParentBoundsChanged(const _Control& parent); virtual void OnChildAttached(const _Control& child); virtual void OnChildDetaching(const _Control& child); @@ -149,14 +164,28 @@ public: virtual void OnTouchCancelHandled(const _Control& control); virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, int& size); + virtual void OnFontInfoRequested(unsigned long& style, float& size); + virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor); + virtual void OnDrawFocus(void); + virtual void OnChildControlFocusMoved(const _Control& control); // Event Callbacks virtual bool OnKeyPressed(const _ControlImpl& source, const _KeyInfo& keyInfo); virtual bool OnKeyReleased(const _ControlImpl& source, const _KeyInfo& keyInfo); + + virtual bool OnPreviewKeyPressed(const _ControlImpl& source, const _KeyInfo& keyInfo); + virtual bool OnPreviewKeyReleased(const _ControlImpl& source, const _KeyInfo& keyInfo); + virtual bool OnTouchPressed(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _ControlImpl& source, const _TouchInfo& touchinfo); virtual bool OnTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchinfo); + + virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _ControlImpl& source, const _TouchInfo& touchInfo); + virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _ControlImpl& source, const _TouchInfo& touchInfo); + virtual _UiTouchEventDelivery OnPreviewTouchMoved(const _ControlImpl& source, const _TouchInfo& touchInfo); + virtual _UiTouchEventDelivery OnPreviewTouchCanceled(const _ControlImpl& source, const _TouchInfo& touchInfo); + virtual bool OnFocusGained(const _ControlImpl& source); virtual bool OnFocusLost(const _ControlImpl& source); virtual bool OnNotifiedN(const _ControlImpl& source, Tizen::Base::Collection::IList* pArgs); @@ -171,8 +200,10 @@ public: result Show(void); void Invalidate(bool recursive); void Invalidate(const Tizen::Graphics::Rectangle& rect); + void Invalidate(const Tizen::Graphics::FloatRectangle& rect); Tizen::Graphics::Canvas* GetCanvasN(void) const; Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const; + Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const; Tizen::Graphics::Canvas* GetClientCanvasN(void) const; void RequestRedraw(bool show) const; @@ -188,15 +219,17 @@ public: // Font result SetFont(const Tizen::Base::String& fontName); Tizen::Base::String GetFont(void) const; + result SetFontFromFile(const Tizen::Base::String& fileName); + Tizen::Base::String GetFontFile(void) const; // Enable bool IsEnabled(void) const; bool GetEnableState(void) const; void SetEnableState(bool enableState); - bool IsInputEnabled(void) const; + bool IsInputEventEnabled(void) const; bool GetInputEnableState(void) const; - void SetInputEnableState(bool inputEnableState); + void SetInputEventEnableState(bool inputEnableState); // Visible bool IsVisible(void) const; @@ -210,6 +243,12 @@ public: result SetFocusable(bool focusable); result SetFocused(void); +// Focus UI + void SetPreviousFocus(_ControlImpl* pPreviousFocus); + void SetNextFocus(_ControlImpl* pNextFocus); + _ControlImpl* GetPreviousFocus(void) const; + _ControlImpl* GetNextFocus(void) const; + // Clipping bool IsClipToParent(void) const; result SetClipToParent(bool clipToParent); @@ -219,34 +258,61 @@ public: bool IsResizable(void) const; Tizen::Graphics::Rectangle GetBounds(void) const; + Tizen::Graphics::FloatRectangle GetBoundsF(void) const; Tizen::Graphics::Point GetPosition(void) const; + Tizen::Graphics::FloatPoint GetPositionF(void) const; Tizen::Graphics::Dimension GetSize(void) const; - result SetBounds(const Tizen::Graphics::Rectangle& bounds, bool checkMove = true); + Tizen::Graphics::FloatDimension GetSizeF(void) const; + result SetBounds(const Tizen::Graphics::Rectangle& bounds, bool callBoundsChangeCallbacks = true, bool callUpdateBoundsOfVisualElement = true); + result SetBounds(const Tizen::Graphics::FloatRectangle& bounds, bool callBoundsChangeCallbacks = true, bool callUpdateBoundsOfVisualElement = true); result SetBoundsAndUpdateLayout(const Tizen::Graphics::Rectangle& bounds); + result SetBoundsAndUpdateLayoutF(const Tizen::Graphics::FloatRectangle& bounds); result SetPosition(const Tizen::Graphics::Point& position); + result SetPosition(const Tizen::Graphics::FloatPoint& position); result SetSize(const Tizen::Graphics::Dimension& size); + result SetSize(const Tizen::Graphics::FloatDimension& size); Tizen::Graphics::Dimension GetMinimumSize(void) const; + Tizen::Graphics::FloatDimension GetMinimumSizeF(void) const; Tizen::Graphics::Dimension GetMaximumSize(void) const; + Tizen::Graphics::FloatDimension GetMaximumSizeF(void) const; result SetMinimumSize(const Tizen::Graphics::Dimension& newMinSize); + result SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinSize); result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxSize); + result SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxSize); Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const; + Tizen::Graphics::FloatPoint ConvertToControlPosition(const Tizen::Graphics::FloatPoint& screenPosition) const; Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const; + Tizen::Graphics::FloatPoint ConvertToScreenPosition(const Tizen::Graphics::FloatPoint& controlPosition) const; Tizen::Graphics::Rectangle GetClientBounds(void) const; + Tizen::Graphics::FloatRectangle GetClientBoundsF(void) const; Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const; + Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(void) const; result SetClientBounds(const Tizen::Graphics::Rectangle& bounds); + result SetClientBounds(const Tizen::Graphics::FloatRectangle& bounds); virtual Tizen::Graphics::Dimension GetMinimumSizeLimit(void) const; + virtual Tizen::Graphics::FloatDimension GetMinimumSizeLimitF(void) const; virtual Tizen::Graphics::Dimension GetMaximumSizeLimit(void) const; + virtual Tizen::Graphics::FloatDimension GetMaximumSizeLimitF(void) const; + + void SetContentAreaBounds(const Tizen::Graphics::Rectangle& rect); + void SetContentAreaBounds(const Tizen::Graphics::FloatRectangle& rect); + Tizen::Graphics::Rectangle GetContentAreaBounds(void) const; + Tizen::Graphics::FloatRectangle GetContentAreaBoundsF(void) const; Tizen::Graphics::Bitmap* GetCapturedBitmapN(void) const; Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const; + Tizen::Graphics::FloatRectangle GetInvalidatedBoundsF(void) const; bool Contains(const Tizen::Graphics::Point& point) const; + bool Contains(const Tizen::Graphics::FloatPoint& point) const; bool GetBuilderBounds(_ControlOrientation orientation, Tizen::Graphics::Rectangle& bounds) const; + bool GetBuilderBoundsF(_ControlOrientation orientation, Tizen::Graphics::FloatRectangle& bounds) const; result SetBuilderBounds(_ControlOrientation orientation, const Tizen::Graphics::Rectangle& bounds); + result SetBuilderBoundsF(_ControlOrientation orientation, const Tizen::Graphics::FloatRectangle& bounds); // Layout bool IsLayoutable(void) const; @@ -290,6 +356,15 @@ public: Tizen::Graphics::Color GetChromaKeyColor(void) const; result SetChromaKeyColor(Tizen::Graphics::Color chromaKeyColor); + result SetPublicPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener); + IPropagatedTouchEventListener* GetPublicPropagatedTouchEventListener(void) const; + + result SetPublicPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener); + IPropagatedKeyEventListener* GetPublicPropagatedKeyEventListener(void) const; + + void SetTouchPressThreshold(float distance); + float GetTouchPressThreshold(void) const; + int GetTouchPressThresholdPixel(void) const; protected: _ControlImpl(Control* pPublic, _Control* pCore); @@ -304,14 +379,20 @@ protected: // Initializing Impl's bounds result InitializeBoundsProperties(const SizeInfo& sizeInfo, _ControlOrientation orientation); result InitializeBoundsProperties(const SizeInfo& sizeInfo, const Tizen::Graphics::Rectangle& bounds, _ControlOrientation orientation); + result InitializeBoundsPropertiesF(const SizeInfo& sizeInfo, const Tizen::Graphics::FloatRectangle& bounds, _ControlOrientation orientation); result InitializeBoundsProperties(const SizeInfo& sizeInfo, const Tizen::Graphics::Dimension& size, _ControlOrientation orientation); + result InitializeBoundsPropertiesF(const SizeInfo& sizeInfo, const Tizen::Graphics::FloatDimension& size, _ControlOrientation orientation); + + bool IsInputEventConsumed(void) const; + void ResetInputEventConsumed(void); + + virtual result OnTouchEventListenerAdded(void); + virtual result OnTouchEventListenerRemoved(void); private: _ControlImpl(const _ControlImpl& rhs); _ControlImpl& operator =(const _ControlImpl& rhs); - bool IsInputEventConsumed(void) const; - void ResetInputEventConsumed(void); bool SendNotification(const _ControlImpl& source, Tizen::Base::Collection::IList* pArgs); // [ToDo] If not necessary remove. @@ -327,7 +408,7 @@ private: bool CallOnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo); private: - Tizen::Graphics::Rectangle __oldBounds; + Tizen::Graphics::FloatRectangle __oldBounds; Control* __pControlPublic; _Control* __pControlCore; Tizen::Ui::Animations::ControlAnimator* __pControlAnimator; @@ -369,13 +450,17 @@ private: class _PropagatedKeyEventListener; _PropagatedKeyEventListener* __pPropagatedKeyEventListener; - Tizen::Graphics::Rectangle* __pBuilderPortraitBounds; - Tizen::Graphics::Rectangle* __pBuilderLandscapeBounds; + Tizen::Graphics::FloatRectangle* __pBuilderPortraitBounds; + Tizen::Graphics::FloatRectangle* __pBuilderLandscapeBounds; _TouchFlickGestureDetector* __pFlickGestureDetector; _TouchLongPressGestureDetector* __pLongPressGestureDetector; Tizen::Base::Collection::IListT* __pPublicGestureDetectors; _AccessibilityContainerImpl* __pAccessibilityContainerImpl; + + IPropagatedTouchEventListener* __pPublicPropagatedTouchEventListener; + IPropagatedKeyEventListener* __pPublicPropagatedKeyEventListener; + friend class _ContainerImpl; }; // _ControlImpl diff --git a/src/ui/inc/FUi_ControlImplManager.h b/src/ui/inc/FUi_ControlImplManager.h index dd0d641..77e2182 100644 --- a/src/ui/inc/FUi_ControlImplManager.h +++ b/src/ui/inc/FUi_ControlImplManager.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlImplManager.h * @brief This is the header file for the _ControlImplManager class. @@ -37,10 +38,6 @@ namespace Tizen { namespace Ui { class _WindowImpl; class _ControlImpl; -#if defined(MULTI_WINDOW) -class _ControlImpl; -#endif - class _ControlImplManager { public: @@ -56,11 +53,7 @@ public: private: void SetOrientationStatus(OrientationStatus orientationStatus); -#if !defined(MULTI_WINDOW) - static void RotateScreen(OrientationStatus orientationStatus); -#else static void RotateScreen(_ControlImpl* pControlImpl, OrientationStatus orientationStatus); -#endif OrientationStatus GetOrientationStatus(Orientation mode) const; private: diff --git a/src/ui/inc/FUi_ControlManager.h b/src/ui/inc/FUi_ControlManager.h index 4624a7c..f792708 100644 --- a/src/ui/inc/FUi_ControlManager.h +++ b/src/ui/inc/FUi_ControlManager.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ControlManager.h * @brief This is the header file for the _ControlManager class. @@ -30,12 +31,10 @@ #include #include "FUi_Types.h" -#if defined(MULTI_WINDOW) namespace Tizen { namespace Base { namespace Collection { template class LinkedListT; }}} // Tizen::Base::Collection -#endif namespace Tizen { namespace Ui { @@ -66,10 +65,8 @@ public: _Window* GetWindow(int index) const; int GetWindowCount(void) const; _Window* GetTopWindow(void) const; -#if defined(MULTI_WINDOW) _Window* GetTopVisibleWindow(void) const; _Window* GetTopVisibleWindowAt(const Tizen::Graphics::Point& point) const; -#endif bool IsWindowOnTop(const _Window& window) const; bool IsWindowAttached(const _Window& window) const; result OpenWindow(_Window& window, bool invalidate); @@ -84,12 +81,15 @@ public: // Informations Tizen::Graphics::Dimension GetScreenSize(void) const; + Tizen::Graphics::FloatDimension GetScreenSizeF(void) const; // Font result SetDefaultFont(const Tizen::Base::String& appFontName); Tizen::Base::String GetDefaultFont(void); bool IsDefaultFontChanged(void); void SetDefaultFontChangeState(bool isDefaultFontChanged); + result SetDefaultFontFromFile(const Tizen::Base::String& fileName); + Tizen::Base::String GetDefaultFontFile(void) const; // Coordinate system info bool IsCoordinateSystemLogical(void) const; @@ -98,7 +98,7 @@ public: // Focus _Control* GetFocusedControl(void) const; - void SetFocusedControl(const _Control& control); + void SetFocusedControl(const _Control& control, bool on = true); bool TakeFocusFromControl(const _Control& control); // Queries @@ -106,12 +106,6 @@ public: _Window* GetCurrentFrame(void) const; bool IsFrameActivated(void) const; -#if !defined(MULTI_WINDOW) -// Root Control - const _Control& GetRoot(void) const; - _Control& GetRoot(void); -#endif - // Global Gesture result AddGestureDetector(const _TouchGestureDetector& gesture); result RemoveGestureDetector(const _TouchGestureDetector& gesture); @@ -120,14 +114,11 @@ public: // Do not use. System only. void SetOrientationStatus(_ControlRotation orientationStatus); - void RotateScreen(_ControlRotation screenRotation); void RotateScreen(const _Control& control, _ControlRotation screenRotation); void OnScreenRotated(int rotation); void OnWindowRotated(int rotation); -#if defined(MULTI_WINDOW) void SetTouchedWindow(unsigned int window); _Window* GetTouchedWindow(void) const; -#endif result MoveWindowToTop(const _Window& window); result MoveWindowToBottom(const _Window& window); @@ -160,12 +151,8 @@ private: private: Tizen::Base::_ObjectManagerT <_Control> __objectManager; - -#if !defined(MULTI_WINDOW) - _Control* __pRoot; -#else Tizen::Base::Collection::LinkedListT<_Window*>* __pWindowList; -#endif + bool __isCoordinateSystemLogical; int __logicalCoordinateSystem; Tizen::Graphics::_BaseScreenSize __logicalBaseScreenSize; @@ -174,17 +161,13 @@ private: _ControlRotation __screenRotation; _ControlRotation __orientationStatus; _ControlOrientation __orientation; -#if !defined(MULTI_WINDOW) - _IWindow* __pWindowPi; -#endif _Window* __pCurrentFrame; Tizen::Base::Collection::IListT<_TouchGestureDetector*>* __pGestureList; int __gestureMaxDuration; -#if defined(MULTI_WINDOW) - unsigned int __touchedWindow; // [SLP] -#endif + unsigned int __touchedWindow; bool __isDefaultFontChanged; Tizen::Base::String __defaultFontName; + Tizen::Base::String __defaultFontFileName; static _ControlManager* __pInstance; }; // _ControlManager diff --git a/src/ui/inc/FUi_CoordinateSystemUtils.h b/src/ui/inc/FUi_CoordinateSystemUtils.h old mode 100644 new mode 100755 index 1892db0..42d2b14 --- a/src/ui/inc/FUi_CoordinateSystemUtils.h +++ b/src/ui/inc/FUi_CoordinateSystemUtils.h @@ -25,7 +25,13 @@ #ifndef _FUI_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ #define _FUI_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ +#include #include +#include +#include +#include +#include +#include #include namespace Tizen { namespace Ui { @@ -33,23 +39,215 @@ namespace Tizen { namespace Ui { class _OSP_EXPORT_ _CoordinateSystemUtils { public: + // Convert To Float + static Tizen::Graphics::FloatRectangle + ConvertToFloat(const Tizen::Graphics::Rectangle& rect) + { + return Tizen::Graphics::FloatRectangle(rect.x, rect.y, rect.width, rect.height); + } + + static Tizen::Graphics::FloatRectangle + ConvertToFloat(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim) + { + return Tizen::Graphics::FloatRectangle(point.x, point.y, dim.width, dim.height); + } + + static Tizen::Graphics::FloatDimension + ConvertToFloat(const Tizen::Graphics::Dimension& dim) + { + return Tizen::Graphics::FloatDimension(dim.width, dim.height); + } + + static Tizen::Graphics::FloatPoint + ConvertToFloat(const Tizen::Graphics::Point& point) + { + return Tizen::Graphics::FloatPoint(point.x, point.y); + } + + static float + ConvertToFloat(int scalar) + { + return scalar; + } + + // Convert To Integer + static Tizen::Graphics::Rectangle + ConvertToInteger(const Tizen::Graphics::FloatRectangle& rect) + { + return Tizen::Graphics::Rectangle(floorf(rect.x + __floatIntegralEpsilon), floorf(rect.y + __floatIntegralEpsilon) + , floorf(rect.width + __floatIntegralEpsilon), floorf(rect.height + __floatIntegralEpsilon)); + } + + static Tizen::Graphics::Rectangle + ConvertToInteger(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim) + { + return Tizen::Graphics::Rectangle(floorf(point.x + __floatIntegralEpsilon), floorf(point.y + __floatIntegralEpsilon) + , floorf(dim.width + __floatIntegralEpsilon), floorf(dim.height + __floatIntegralEpsilon)); + } + + static Tizen::Graphics::Dimension + ConvertToInteger(const Tizen::Graphics::FloatDimension& dim) + { + return Tizen::Graphics::Dimension(floorf(dim.width + __floatIntegralEpsilon), floorf(dim.height + __floatIntegralEpsilon)); + } + + static Tizen::Graphics::Point + ConvertToInteger(const Tizen::Graphics::FloatPoint& point) + { + return Tizen::Graphics::Point(floorf(point.x + __floatIntegralEpsilon), floorf(point.y + __floatIntegralEpsilon)); + } + + static int + ConvertToInteger(float scalar) + { + return floorf(scalar + __floatIntegralEpsilon); + } + // Transform Utilities - static Tizen::Graphics::Rectangle Transform(const Tizen::Graphics::Rectangle& rect); - static Tizen::Graphics::Rectangle Transform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim); - static Tizen::Graphics::Dimension Transform(const Tizen::Graphics::Dimension& dim); - static Tizen::Graphics::Point Transform(const Tizen::Graphics::Point& point); - static int HorizontalTransform(int scalar); - static int VerticalTransform(int scalar); + static Tizen::Graphics::Rectangle + Transform(const Tizen::Graphics::Rectangle& rect) + { + return GetTransformer()->Transform(rect); + } + + static Tizen::Graphics::FloatRectangle + Transform(const Tizen::Graphics::FloatRectangle& rect) + { + return GetTransformer()->Transform(rect); + } + + static Tizen::Graphics::Rectangle + Transform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim) + { + return GetTransformer()->Transform(Tizen::Graphics::Rectangle(point, dim)); + } + + static Tizen::Graphics::FloatRectangle + Transform(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim) + { + return GetTransformer()->Transform(Tizen::Graphics::FloatRectangle(point, dim)); + } + + static Tizen::Graphics::Dimension + Transform(const Tizen::Graphics::Dimension& dim) + { + return GetTransformer()->Transform(dim); + } + + static Tizen::Graphics::FloatDimension + Transform(const Tizen::Graphics::FloatDimension& dim) + { + return GetTransformer()->Transform(dim); + } + + static Tizen::Graphics::Point + Transform(const Tizen::Graphics::Point& point) + { + return GetTransformer()->Transform(point); + } + + static Tizen::Graphics::FloatPoint + Transform(const Tizen::Graphics::FloatPoint& point) + { + return GetTransformer()->Transform(point); + } + static int + HorizontalTransform(int scalar) + { + return GetTransformer()->TransformHorizontal(scalar); + } - // Inverse Transform Utilities - static Tizen::Graphics::Rectangle InverseTransform(const Tizen::Graphics::Rectangle& rect); - static Tizen::Graphics::Rectangle InverseTransform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim); - static Tizen::Graphics::Dimension InverseTransform(const Tizen::Graphics::Dimension& dim); - static Tizen::Graphics::Point InverseTransform(const Tizen::Graphics::Point& point); - static int InverseHorizontalTransform(int scalar); - static int InverseVerticalTransform(int scalar); + static float + HorizontalTransform(float scalar) + { + return GetTransformer()->TransformHorizontal(scalar); + } + static int + VerticalTransform(int scalar) + { + return GetTransformer()->TransformVertical(scalar); + } + + static float + VerticalTransform(float scalar) + { + return GetTransformer()->TransformVertical(scalar); + } + + // InverseTransform Utilities + static Tizen::Graphics::Rectangle + InverseTransform(const Tizen::Graphics::Rectangle& rect) + { + return GetInverseTransformer()->Transform(rect); + } + + static Tizen::Graphics::FloatRectangle + InverseTransform(const Tizen::Graphics::FloatRectangle& rect) + { + return GetInverseTransformer()->Transform(rect); + } + + static Tizen::Graphics::Rectangle + InverseTransform(const Tizen::Graphics::Point& point, const Tizen::Graphics::Dimension& dim) + { + return GetInverseTransformer()->Transform(Tizen::Graphics::Rectangle(point, dim)); + } + + static Tizen::Graphics::FloatRectangle + InverseTransform(const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatDimension& dim) + { + return GetInverseTransformer()->Transform(Tizen::Graphics::FloatRectangle(point, dim)); + } + + static Tizen::Graphics::Dimension + InverseTransform(const Tizen::Graphics::Dimension& dim) + { + return GetInverseTransformer()->Transform(dim); + } + + static Tizen::Graphics::FloatDimension + InverseTransform(const Tizen::Graphics::FloatDimension& dim) + { + return GetInverseTransformer()->Transform(dim); + } + + static Tizen::Graphics::Point + InverseTransform(const Tizen::Graphics::Point& point) + { + return GetInverseTransformer()->Transform(point); + } + + static Tizen::Graphics::FloatPoint + InverseTransform(const Tizen::Graphics::FloatPoint& point) + { + return GetInverseTransformer()->Transform(point); + } + + static int + InverseHorizontalTransform(int scalar) + { + return GetInverseTransformer()->TransformHorizontal(scalar); + } + + static float + InverseHorizontalTransform(float scalar) + { + return GetInverseTransformer()->TransformHorizontal(scalar); + } + + static int + InverseVerticalTransform(int scalar) + { + return GetInverseTransformer()->TransformVertical(scalar); + } + + static float + InverseVerticalTransform(float scalar) + { + return GetInverseTransformer()->TransformVertical(scalar); + } private: _CoordinateSystemUtils(void); @@ -58,14 +256,31 @@ private: _CoordinateSystemUtils(const _CoordinateSystemUtils&); _CoordinateSystemUtils& operator =(const _CoordinateSystemUtils&); - static Tizen::Graphics::_ICoordinateSystemTransformer* GetTransformer(void); - static Tizen::Graphics::_ICoordinateSystemTransformer* GetInverseTransformer(void); + static Tizen::Graphics::_ICoordinateSystemTransformer* + GetTransformer(void) + { + Tizen::Graphics::_ICoordinateSystemTransformer* pTransform = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetTransformer(); + SysTryReturn(NID_UI, pTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate transformer does not exist."); -private: - static Tizen::Graphics::_CoordinateSystem* __pCoordinateSystemInstance; + return pTransform; + } + + static Tizen::Graphics::_ICoordinateSystemTransformer* + GetInverseTransformer(void) + { + Tizen::Graphics::_ICoordinateSystemTransformer* pInverseTransform= Tizen::Graphics::_CoordinateSystem::GetInstance()->GetInverseTransformer(); + SysTryReturn(NID_UI, pInverseTransform, null, E_SYSTEM, "[E_SYSTEM] The valid coordinate inverse transformer does not exist."); + return pInverseTransform; + } + +private: + // WARNING: + // Some float functions like sin and cos emit too-much float-error. + // So, the rounding const must be a bigger value than expected. + static const float __floatIntegralEpsilon = 0.01f; }; //class _CoordinateSystemUtils }} // Tizen::Ui -#endif //_FUI_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ \ No newline at end of file +#endif //_FUI_INTERNAL_COORDINATE_SYSTEM_UTILS_H_ diff --git a/src/ui/inc/FUi_CustomControlBaseImpl.h b/src/ui/inc/FUi_CustomControlBaseImpl.h old mode 100644 new mode 100755 index 9a8e71c..af51d70 --- a/src/ui/inc/FUi_CustomControlBaseImpl.h +++ b/src/ui/inc/FUi_CustomControlBaseImpl.h @@ -14,8 +14,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** - * @file FUi_CustomControlBaseImpl.h + * @file FUi_CustomControlBaseImpll.h * @brief This is the header file for the _CustomControlBaseImpl class. * * This header file contains the declarations of the _CustomControlBaseImpl class. diff --git a/src/ui/inc/FUi_Dimensionf.h b/src/ui/inc/FUi_Dimensionf.h index 13393f3..61b08b4 100644 --- a/src/ui/inc/FUi_Dimensionf.h +++ b/src/ui/inc/FUi_Dimensionf.h @@ -16,7 +16,7 @@ // /** - * @file FUi_Dimensionf.h + * @file FUiAnim_Dimensionf.h * @brief Header file of _Dimensionf class * * This file contains declarations _Dimensionf class. diff --git a/src/ui/inc/FUi_EcoreEvas.h b/src/ui/inc/FUi_EcoreEvas.h index 881a000..cb1948f 100644 --- a/src/ui/inc/FUi_EcoreEvas.h +++ b/src/ui/inc/FUi_EcoreEvas.h @@ -14,12 +14,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_EcoreEvas.h * @brief This is the header file for the _EcoreEvas class. * * This header file contains the declarations of the %_EcoreEvas class. */ + #ifndef _FUI_INTERNAL_ECORE_EVAS_H_ #define _FUI_INTERNAL_ECORE_EVAS_H_ @@ -93,122 +95,67 @@ class _OSP_EXPORT_ _EcoreEvas { public: static _EcoreEvas* CreateInstanceN(void); - virtual ~_EcoreEvas(void); - void RotateWindow(int orientation); - void RotateWindow(const _Window& window, int orientation); - - bool GetFloatingMode(void) const; - bool GetFloatingMode(const _Window& window) const; - - void AddActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener); - void RemoveActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener); - void FireActiveWindowEvent(unsigned int xid, int pid, char* pAppName); unsigned int GetActiveWindow(void); - int GetProcessId(unsigned int window); - void SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner); - void ActivateWindow(const _Window& window); - void SetRenderBackend(_RenderBackend backend); _RenderBackend GetRenderBackend(void); + void SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner); + void SetOwner(const _Window& ownee, const _Control& owner); -#if !defined(MULTI_WINDOW) - result CopyClip(_ClipFormat format, const char* pChar); - bool RetrieveClipN(int index, int* format, char** pData); - int GetClipCount(void) const; - void OpenClipboard(unsigned long clipFormats); - void CloseClipboard(void); - bool IsClipboardOpened(void); + void ActivateWindow(const _Window& window); + void MinimizeWindow(_Window& window); + void RotateWindow(const _Window& window, int orientation); + void SetWindowOrientationEnabled(const _Window& window, bool enable); + int GetWindowRotation(const _Window& window); + result SetFloatingMode(const _Window& window, bool enable); + bool GetFloatingMode(const _Window& window) const; + void SetWindowActivationEnabled(const _Window& window, bool enable); + bool IsWindowActivationEnabled(const _Window& window); + void SetWindowLevel(const _Window& window, _WindowLevel level); + _WindowLevel GetWindowLevel(const _Window& window) const; + void SetWindowBounds(const _Window& window, const Tizen::Graphics::Rectangle& bounds); + void SetWindowVisibleState(const _Window& window, bool visibleState); + void AllowSetWindowBounds(bool allow); + bool IsWindowVisible(const _Window& window); result SetEventPropagation(const _Control& control, bool enable); result SetFocus(const _Control& control, bool focus); - result SetIndicatorShowState(bool showState); - bool GetIndicatorShowState(void) const; - Tizen::Graphics::Rectangle GetIndicatorBounds(void) const; - result SetIndicatorOpacity(_IndicatorOpacity opacity); - _IndicatorOpacity GetIndicatorOpacity(void) const; - - result SetFloatingMode(bool enable); - - void SetFrame(const _Control& control); - const _Control* GetFrame(void) const; - - void SetWindowLevel(_WindowLevel level); - _WindowLevel GetWindowLevel(void) const; - - void SetWindowAlwaysOnTop(bool alwaysOnTop); - void SetWindowAlwaysAtBottom(bool alwaysAtBottom); - - void BringWindowToTop(void); - void BringWindowToBottom(void); - - - void SetWindowBounds(const Tizen::Graphics::Rectangle& bounds); - void SetWindowVisibleState(bool visibleState); - - Evas* GetEvas(void) const; - Ecore_Evas* GetEcoreEvas(void) const; - Evas_Object* GetWindowObject(void) const; - Ecore_X_Window GetXWindow(void) const; - - Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void)const; + void SetQuickPanelScrollEnabled(const _Window& window, bool enable); + bool IsQuickPanelScrollEnabled(const _Window& window); + result SetIndicatorShowState(const _Window& window, bool showState); + bool GetIndicatorShowState(const _Window& window) const; - void AllowSetWindowBounds(bool allow); -#else result CopyClip(_ClipFormat format, const char* pChar); bool RetrieveClipN(int index, int* format, char** pData); int GetClipCount(void) const; + bool GetSelectedCbhmItem(Ecore_X_Atom* pDataType, char** pBuffer) const; void OpenClipboard(unsigned long clipFormats); void CloseClipboard(void); bool IsClipboardOpened(void); - result SetEventPropagation(const _Control& control, bool enable); - result SetFocus(const _Control& control, bool focus); + bool IsAccessibilityScreenReaderActivated(void); - result SetIndicatorShowState(const _Window& window, bool showState); - bool GetIndicatorShowState(const _Window& window) const; + // [ToDo] Remove API + bool GetFloatingMode(void) const; Tizen::Graphics::Rectangle GetIndicatorBounds(const _Window& window) const; result SetIndicatorOpacity(const _Window& window, _IndicatorOpacity opacity); _IndicatorOpacity GetIndicatorOpacity(const _Window& window) const; - - void SetWindowActivationEnabled(const _Window& window, bool enable); - bool IsWindowActivationEnabled(const _Window& window); - - result SetFloatingMode(const _Window& window, bool enable); - + void AddActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener); + void RemoveActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener); + Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void)const; void SetFrame(const _Control& control); const _Control* GetFrame(void) const; - - void SetWindowLevel(const _Window& window, _WindowLevel level); - _WindowLevel GetWindowLevel(const _Window& window) const; - - void SetWindowBounds(const _Window& window, const Tizen::Graphics::Rectangle& bounds); - void SetWindowVisibleState(const _Window& window, bool visibleState); - - void SetOwner(const _Window& ownee, const _Control& owner); - - int GetWindowRotation(const _Window& window); - Evas* GetEvas(void) const; Ecore_Evas* GetEcoreEvas(void) const; Evas_Object* GetWindowObject(void) const; Ecore_X_Window GetXWindow(void) const; - Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void)const; - - void AllowSetWindowBounds(bool allow); -#endif - - bool GetSelectedCbhmItem(Ecore_X_Atom* pDataType, char** pBuffer) const; - - //[Accessibility] - bool IsAccessibilityScreenReaderActivated(void); - private: - result CreateWindow(void); + Tizen::Ui::Animations::_EflLayer* GetEflLayer(const _Window& window) const; + _EcoreEvas(void); result InitializeAtomList(void); bool IsValidClipFormat(_ClipFormat clipFormat); @@ -219,31 +166,21 @@ private: int GetCbhmItemCount(void) const; bool GetCbhmItem(int index, Ecore_X_Atom* pDataType, char** pBuffer) const; - Tizen::Ui::Animations::_EflLayer* GetEflLayer(const _Window& window) const; - - _EcoreEvas(void); _EcoreEvas(const _EcoreEvas& rhs); _EcoreEvas& operator =(const _EcoreEvas& rhs); private: - Evas* __pEvas; - Evas_Object* __pForegroundWindow; - const _Control* __pFrame; - - Ecore_Event_Handler* __pXWindowVisibility; - Ecore_Event_Handler* __pClientMessageHandler; - + Ecore_Event_Handler* __pWindowVisibilityChanged; + Ecore_Event_Handler* __pWindowPropertyChanged; + Ecore_Event_Handler* __pWindowShown; + Ecore_Event_Handler* __pClientMessageReceived; Ecore_Event_Handler* __pClearClip; Ecore_Event_Handler* __pNotifyClip; Ecore_Event_Handler* __pClipboardClosed; - Ecore_Event_Handler* __pWindowPropertyChanged; - _ActiveWindowEvent* __pActiveWindowEvent; - int __count; - - Tizen::Ui::Animations::_RootVisualElement* __pRootVE; - Tizen::Ui::Animations::_NativeLayer* __pLayer; - + Evas* __pEvas; + Evas_Object* __pForegroundWindow; + const _Control* __pFrame; bool __changeBounds; bool __openClipboard; }; // _EcoreEvas diff --git a/src/ui/inc/FUi_ErrorMessages.h b/src/ui/inc/FUi_ErrorMessages.h old mode 100644 new mode 100755 diff --git a/src/ui/inc/FUi_FingerInfo.h b/src/ui/inc/FUi_FingerInfo.h index 99072da..8b1c607 100644 --- a/src/ui/inc/FUi_FingerInfo.h +++ b/src/ui/inc/FUi_FingerInfo.h @@ -67,7 +67,7 @@ public: * * @since 2.0 */ - void SetPoint(const Tizen::Graphics::Point& screenPoint, const Tizen::Graphics::Point& point); + void SetPoint(const Tizen::Graphics::FloatPoint& screenPoint, const Tizen::Graphics::FloatPoint& point); /** * This method sets current status @@ -81,7 +81,7 @@ public: * * @since 2.0 */ - void SetStartPoint(const Tizen::Graphics::Point& point); + void SetStartPoint(const Tizen::Graphics::FloatPoint& point); /** * This method sets touch move allowance flag @@ -113,7 +113,7 @@ public: * @since 2.0 * @return The touch point */ - Tizen::Graphics::Point GetPoint(void) const; + Tizen::Graphics::FloatPoint GetPoint(void) const; /** * This method returns touch point @@ -121,7 +121,7 @@ public: * @since 2.0 * @return The touch point */ - Tizen::Graphics::Point GetScreenPoint(void) const; + Tizen::Graphics::FloatPoint GetScreenPoint(void) const; /** * This method returns current touch status @@ -137,7 +137,7 @@ public: * @since 2.0 * @return The touch start point */ - Tizen::Graphics::Point GetStartPoint(void) const; + Tizen::Graphics::FloatPoint GetStartPoint(void) const; /** * This method returns touch move allowance @@ -151,9 +151,9 @@ private: unsigned long __deviceId; unsigned long __pointId; _TouchStatus __status; - Tizen::Graphics::Point __point; - Tizen::Graphics::Point __startPoint; - Tizen::Graphics::Point __screenPoint; + Tizen::Graphics::FloatPoint __point; + Tizen::Graphics::FloatPoint __startPoint; + Tizen::Graphics::FloatPoint __screenPoint; bool __touchMoveReady; }; // _FingerInfo } } // Tizen::Ui diff --git a/src/ui/inc/FUi_FocusManagerImpl.h b/src/ui/inc/FUi_FocusManagerImpl.h index 330faee..01da62a 100644 --- a/src/ui/inc/FUi_FocusManagerImpl.h +++ b/src/ui/inc/FUi_FocusManagerImpl.h @@ -105,4 +105,4 @@ private: }}//Tizen::Ui -#endif // _FUI_INTERNAL_FOCUS_MANAGER_IMPL_H_ +#endif // _FUI_INTERNAL_FOCUS_MANAGER_IMPL_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_IAccessibilityFocusHandler.h b/src/ui/inc/FUi_IAccessibilityFocusHandler.h new file mode 100644 index 0000000..2b3dabf --- /dev/null +++ b/src/ui/inc/FUi_IAccessibilityFocusHandler.h @@ -0,0 +1,43 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUi_IAccessibilityFocusHandler.h + * @brief This is the header file for the _IAccessibilityFocusHandler class. + * + * This header file contains the declarations of the %_IAccessibilityFocusHandler class. + */ +#ifndef _FUI_INTERNAL_IACCESSIBILITY_FOCUS_HANDLER_H_ +#define _FUI_INTERNAL_IACCESSIBILITY_FOCUS_HANDLER_H_ + +#include "FUi_AccessibilityManager.h" + +namespace Tizen { namespace Graphics +{ +class Point; +}} //namespace Tizen::Graphics + +namespace Tizen { namespace Ui { + +class _OSP_EXPORT_ _IAccessibilityFocusHandler +{ +public: + virtual ~_IAccessibilityFocusHandler(void){}; + virtual bool OnMoveFocus(_AccessibilityFocusDirection direction) = 0; + virtual bool OnMoveFocus(const Tizen::Graphics::Point& point) = 0; +}; +}} //namespace Tizen::Ui +#endif //_FUI_INTERNAL_IACCESSIBILITY_FOCUS_HANDLER_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_IAccessibilityListener.h b/src/ui/inc/FUi_IAccessibilityListener.h index 045a62e..e18d781 100644 --- a/src/ui/inc/FUi_IAccessibilityListener.h +++ b/src/ui/inc/FUi_IAccessibilityListener.h @@ -15,34 +15,37 @@ // limitations under the License. // /** - * @file FUi_IAccessibilityListener.h - * @brief This is the header file for the _AccessibilityContainer class. - * - * This header file contains the declarations of the _AccessibilityContainer class. + * @file FUi_IAccessibilityListener.h + * @brief This is the header file for the _IAccessibilityListener class. * + * This header file contains the declarations of the %_IAccessibilityListener class. */ -#ifndef _FUI_INTERNAL_IACCESSIBILITY_DELEGATE_H_ -#define _FUI_INTERNAL_IACCESSIBILITY_DELEGATE_H_ +#ifndef _FUI_INTERNAL_IACCESSIBILITY_LISTENER_H_ +#define _FUI_INTERNAL_IACCESSIBILITY_LISTENER_H_ + +#include "FUi_AccessibilityManager.h" namespace Tizen { namespace Ui { class _AccessibilityContainer; class _AccessibilityElement; -class _IAccessibilityListener +class _OSP_EXPORT_ _IAccessibilityListener { public: virtual ~_IAccessibilityListener(void){}; virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; - virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; + virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) = 0; + virtual bool OnAccessibilityItemRefreshed(const _AccessibilityContainer& control, const _AccessibilityElement& element, _AccessibilityFocusDirection direction){return false;}; }; }} -#endif //_FUI_INTERNAL_IACCESSIBILITY_DELEGATE_H_ +#endif //_FUI_INTERNAL_IACCESSIBILITY_LISTENER_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_IClipboardPopupEventListener.h b/src/ui/inc/FUi_IClipboardPopupEventListener.h new file mode 100644 index 0000000..4df9e54 --- /dev/null +++ b/src/ui/inc/FUi_IClipboardPopupEventListener.h @@ -0,0 +1,79 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_IClipboardPopupEventListener.h + * @brief This is the header file for the %_IClipboardPopupEventListener interface. + * + * This header file contains the declarations of the %_IClipboardPopupEventListener interface. @n + * If the item event is generated, a method of this interface will be called. @n + * The applications that perform tasks related to the item event, must call methods of this interface. + */ + +#ifndef _FUI_INTERNAL_ICLIPBOARD_POPUP_EVENT_LISTENER_H_ +#define _FUI_INTERNAL_ICLIPBOARD_POPUP_EVENT_LISTENER_H_ + +#include +#include + +namespace Tizen { namespace Ui +{ + +class _OSP_EXPORT_ _IClipboardPopupEventListener + : virtual public Tizen::Base::Runtime::IEventListener +{ +public: + /** + * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called. + * + * @since 2.1 + */ + virtual ~_IClipboardPopupEventListener(void) {} + + virtual void OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopupSize) = 0; + virtual void OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipboardPopupSize) = 0; + virtual void OnClipboardPopupClosed(void) = 0; + +protected: + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void _IClipboardPopupEventListener_Reserved1(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void _IClipboardPopupEventListener_Reserved2(void) {} + + // + // This method is for internal use only. Using this method can cause behavioral, security-related, + // and consistency-related issues in the application. + // + // This method is reserved and may change its name at any time without prior notice. + // + virtual void _IClipboardPopupEventListener_Reserved3(void) {} +}; // _IClipboardPopupEventListener + +}} // Tizen::Ui + +#endif // _FUI_INTERNAL_ICLIPBOARD_POPUP_EVENT_LISTENER_H_ \ No newline at end of file diff --git a/src/ui/inc/FUi_IFocusEventListener.h b/src/ui/inc/FUi_IFocusEventListener.h index 599d7a1..c5928ff 100644 --- a/src/ui/inc/FUi_IFocusEventListener.h +++ b/src/ui/inc/FUi_IFocusEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_INotificationEventListener.h b/src/ui/inc/FUi_INotificationEventListener.h index 97ec01c..dc7fd93 100644 --- a/src/ui/inc/FUi_INotificationEventListener.h +++ b/src/ui/inc/FUi_INotificationEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_INotificationEventPreviewer.h b/src/ui/inc/FUi_INotificationEventPreviewer.h index acbf3ef..74ab91e 100644 --- a/src/ui/inc/FUi_INotificationEventPreviewer.h +++ b/src/ui/inc/FUi_INotificationEventPreviewer.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_IUiEventListener.h b/src/ui/inc/FUi_IUiEventListener.h index c004804..84ae3ed 100644 --- a/src/ui/inc/FUi_IUiEventListener.h +++ b/src/ui/inc/FUi_IUiEventListener.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_IUiEventManager.h b/src/ui/inc/FUi_IUiEventManager.h index aac21cc..a08823b 100644 --- a/src/ui/inc/FUi_IUiEventManager.h +++ b/src/ui/inc/FUi_IUiEventManager.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_IUiEventPreviewer.h b/src/ui/inc/FUi_IUiEventPreviewer.h index 38c6f91..b4b3858 100644 --- a/src/ui/inc/FUi_IUiEventPreviewer.h +++ b/src/ui/inc/FUi_IUiEventPreviewer.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_IWindow.h b/src/ui/inc/FUi_IWindow.h old mode 100644 new mode 100755 index 9604c20..47173bc --- a/src/ui/inc/FUi_IWindow.h +++ b/src/ui/inc/FUi_IWindow.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_IWindow.h * @brief This is the header file for the _IWindow class. diff --git a/src/ui/inc/FUi_KeyEventInfoImpl.h b/src/ui/inc/FUi_KeyEventInfoImpl.h new file mode 100644 index 0000000..d9952ac --- /dev/null +++ b/src/ui/inc/FUi_KeyEventInfoImpl.h @@ -0,0 +1,92 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** +* @file FUi_KeyEventInfoImpl.h +* @brief This is the header file for _KeyEventInfoImpl class. +* @version 3.0 +* +* This header file contains declarations of _KeyEventInfoImpl class. +*/ + +#ifndef _FUI_INTERNAL_KEY_EVENT_INFO_IMPL_H_ +#define _FUI_INTERNAL_KEY_EVENT_INFO_IMPL_H_ + +#include +#include +#include "FUi_UiKeyEvent.h" + +namespace Tizen { namespace Ui +{ + +class KeyEventInfo; +/** + * @class _KeyEventInfoImpl + * + * @brief This class is used as the argument to Key event listener. + * + * This class is used as the argument of Key event listener. When Key event event is generated, + * the @c KeyEvent instance calls the registered IKeyEventListener with an instance of this + * class as the argument. + * + */ +class _KeyEventInfoImpl + : public Tizen::Base::Object +{ +public: + static _KeyEventInfoImpl* CreateInstanceN(KeyEventInfo* pPublic); + + virtual ~_KeyEventInfoImpl(void); + + void SetKeyEventInfo(KeyCode keyCode, int keyModifiers); + + void SetKeyCode(KeyCode keyCode); + + KeyCode GetKeyCode(void) const; + + void SetKeyModifier(int keyModifiers); + + int GetKeyModifier(void) const; + +private: + /** + * This is the default class constructor. + * + * @param[in] source - A pointer to the Object instance which contains this instance. + * @param[in] status - KeyStatus + */ + _KeyEventInfoImpl(KeyEventInfo* pPublic); + + /* + * This is the copy constructor for this class. + */ + _KeyEventInfoImpl(const _KeyEventInfoImpl& rhs); + + /** + * This is the assignment operator for this class. + */ + _KeyEventInfoImpl& operator =(const _KeyEventInfoImpl& rhs); + +// Attributes +private: + KeyEventInfo* __pPublic; + KeyCode __keyCode; + int __keyModifier; +}; // KeyEventInfo + +} } // Tizen::Ui + +#endif // _FUI_INTERNAL_KEY_EVENT_INFO_IMPL_H_ diff --git a/src/ui/inc/FUi_KeyEventManagerImpl.h b/src/ui/inc/FUi_KeyEventManagerImpl.h index 3ad255b..48e61f7 100644 --- a/src/ui/inc/FUi_KeyEventManagerImpl.h +++ b/src/ui/inc/FUi_KeyEventManagerImpl.h @@ -84,7 +84,7 @@ public: */ void RemoveKeyEventListener(IKeyEventListener& listener); - _ControlImpl* GetKeyCapturingControl(KeyCode keyCode) const; + _ControlImpl* GetKeyCapturingControl(KeyCode keyCode) const; static void Initialize(void); diff --git a/src/ui/inc/FUi_LayoutAbsoluteLayout.h b/src/ui/inc/FUi_LayoutAbsoluteLayout.h old mode 100644 new mode 100755 index 1601ae7..6e9d6d3 --- a/src/ui/inc/FUi_LayoutAbsoluteLayout.h +++ b/src/ui/inc/FUi_LayoutAbsoluteLayout.h @@ -48,7 +48,7 @@ public: virtual result AddItem(LayoutItem& addItem); protected: - virtual result OnLayout(int width, int height, bool layoutUpdating); + virtual result OnLayout(float width, float height, bool layoutUpdating); private: AbsoluteLayout(const AbsoluteLayout&); diff --git a/src/ui/inc/FUi_LayoutILayoutItemHandler.h b/src/ui/inc/FUi_LayoutILayoutItemHandler.h old mode 100644 new mode 100755 index 11c615c..f8b040f --- a/src/ui/inc/FUi_LayoutILayoutItemHandler.h +++ b/src/ui/inc/FUi_LayoutILayoutItemHandler.h @@ -26,6 +26,8 @@ #include #include +#include +#include namespace Tizen { @@ -40,13 +42,13 @@ public: virtual ~ILayoutItemHandler(void) {} virtual void SetItemVisibleState(bool visible) = 0; - virtual result SetItemBounds(const Tizen::Graphics::Rectangle& rect) = 0; - virtual Tizen::Graphics::Rectangle GetItemBounds(void) const = 0; - virtual Tizen::Graphics::Rectangle GetItemClientBoundsFromSize(const Tizen::Graphics::Dimension& size) const = 0; - virtual Tizen::Graphics::Dimension GetItemContentSize(void) const = 0; - virtual Tizen::Graphics::Dimension GetItemMinimumSize(void) const = 0; - virtual Tizen::Graphics::Dimension GetItemMaximumSize(void) const = 0; - virtual result OnItemMeasure(int& width, int& height) = 0; + virtual result SetItemBounds(const Tizen::Graphics::FloatRectangle& rect) = 0; + virtual Tizen::Graphics::FloatRectangle GetItemBounds(void) const = 0; + virtual Tizen::Graphics::FloatRectangle GetItemClientBoundsFromSize(const Tizen::Graphics::FloatDimension& size) const = 0; + virtual Tizen::Graphics::FloatDimension GetItemContentSize(void) const = 0; + virtual Tizen::Graphics::FloatDimension GetItemMinimumSize(void) const = 0; + virtual Tizen::Graphics::FloatDimension GetItemMaximumSize(void) const = 0; + virtual result OnItemMeasure(float& width, float& height) = 0; }; // ILayoutItemHandler }}} diff --git a/src/ui/inc/FUi_LayoutLayout.h b/src/ui/inc/FUi_LayoutLayout.h old mode 100644 new mode 100755 index 8367544..5639ec5 --- a/src/ui/inc/FUi_LayoutLayout.h +++ b/src/ui/inc/FUi_LayoutLayout.h @@ -306,7 +306,7 @@ protected: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result OnLayout(int width, int height, bool layoutUpdating) = 0; + virtual result OnLayout(float width, float height, bool layoutUpdating) = 0; void SetPartialUpdateFlag(bool flag); void SetItemList(ProxyList* pItemList); @@ -426,10 +426,10 @@ private: private: ProxyList* __pProxyList; - int __x; - int __y; - int __width; - int __height; + float __x; + float __y; + float __width; + float __height; LayoutItemProxy* __pContainerProxy; bool __rootLayout; diff --git a/src/ui/inc/FUi_LayoutLayoutContainer.h b/src/ui/inc/FUi_LayoutLayoutContainer.h old mode 100644 new mode 100755 index 97947f5..91c2d34 --- a/src/ui/inc/FUi_LayoutLayoutContainer.h +++ b/src/ui/inc/FUi_LayoutLayoutContainer.h @@ -179,7 +179,7 @@ private: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result Measure(int width, int height); + virtual result Measure(float width, float height); /** * This method is not used currently. diff --git a/src/ui/inc/FUi_LayoutLayoutItem.h b/src/ui/inc/FUi_LayoutLayoutItem.h old mode 100644 new mode 100755 index 215f296..f519c24 --- a/src/ui/inc/FUi_LayoutLayoutItem.h +++ b/src/ui/inc/FUi_LayoutLayoutItem.h @@ -120,7 +120,7 @@ protected: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result Measure(int width, int height); + virtual result Measure(float width, float height); /** * Sets the parent container. @@ -147,7 +147,7 @@ protected: * @param[in] height * @since 2.0 */ - void SetMeasuredSize(int width, int height); + void SetMeasuredSize(float width, float height); /** * Gets the measured size. @@ -157,7 +157,7 @@ protected: * @param[out] height * @since 2.0 */ - void GetMeasuredSize(int& width, int& height) const; + void GetMeasuredSize(float& width, float& height) const; /** * Runs ILayoutItemHandler::OnItemMeasure. @@ -167,7 +167,7 @@ protected: * @param[inout] height * @since 2.0 */ - void RunItemMeasure(int& width, int& height); + void RunItemMeasure(float& width, float& height); /** * Gets the minimum size of _Control. @@ -204,6 +204,8 @@ protected: */ void GetItemWindowRect(LayoutRect& rect) const; + bool GetContentSizeState(void) const; + private: /** * This is the copy constructor for this class. @@ -235,6 +237,7 @@ private: LayoutContainer* __pParentContainer; LayoutSize __measuredSize; + bool __contentSizeState; friend class LayoutItemProxy; }; // LayoutItem diff --git a/src/ui/inc/FUi_LayoutLayoutMaker.h b/src/ui/inc/FUi_LayoutLayoutMaker.h new file mode 100755 index 0000000..5733cc0 --- /dev/null +++ b/src/ui/inc/FUi_LayoutLayoutMaker.h @@ -0,0 +1,182 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUi_LayoutLayoutMaker.h + * @brief This is the header file for the %_LayoutMaker class. + * + * This header file contains the declarations of the %_LayoutMaker class. + */ + +#ifndef _FUI_INTERNAL_LAYOUT__MAKER_H_ +#define _FUI_INTERNAL_LAYOUT__MAKER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "FUi_UiBuilderConfig.h" +#include "FUi_UiBuilderControl.h" +#include "FUi_UiBuilderControlLayout.h" + +namespace Tizen { namespace Ui +{ + +struct UiBuilderRelativeLayout +{ + Tizen::Ui::Control* pBottomRelation; + RectangleEdgeRelation bottomRelationType; + + Tizen::Ui::Control* pLeftRelation; + RectangleEdgeRelation leftRelationType; + + Tizen::Ui::Control* pRightRelation; + RectangleEdgeRelation rightRelationType; + + Tizen::Ui::Control* pTopRelation; + RectangleEdgeRelation topRelationType; + + bool centerHorizontal; + bool centerVertical; + + int height; + FitPolicy verticalFitPolicy; + + float marginBottom; + float marginLeft; + float marginRight; + float marginTop; + + float width; + FitPolicy horizontalFitPolicy; +}; + +struct UiBuilderGridLayoutContainer +{ + int maxColumn; + int maxRow; + float columnSpacing; + float rowSpacing; + bool columnCollapsed; + bool columnShrinkable; + bool columnStretchable; + bool rowCollapsed; + bool rowShrinkable; + bool rowStretchable; +}; + +struct UiBuilderGridLayoutControl +{ + float marginBottom; + float marginLeft; + float marginRight; + float marginTop; + int positionRow; + int positionColumn; + int positionRowSpan; + int positionColumnSpan; + LayoutHorizontalAlignment horizontalAlignment; + LayoutVerticalAlignment verticalAlignment; +}; + +struct UiBuilderHorizontalBoxLayoutContainer +{ + HorizontalDirection direction; +}; + +struct UiBuilderHorizontalBoxLayoutControl +{ + float height; + FitPolicy verticalFitPolicy; + LayoutVerticalAlignment verticalAlignment; + float verticalBottomMargin; + float verticalTopMargin; + float spacing; + float weight; + float width; + FitPolicy horizontalFitPolicy; +}; + +struct UiBuilderVerticalBoxLayoutContainer +{ + VerticalDirection direction; +}; + +struct UiBuilderVerticalBoxLayoutControl +{ + float height; + FitPolicy verticalFitPolicy; + LayoutHorizontalAlignment horizontalAlignment; + float horizontalLeftMargin; + float horizontalRightMargin; + float spacing; + float weight; + float width; + FitPolicy horizontalFitPolicy; +}; + +class _UiBuilder; +/** +* @class _UiBuilderControlMaker +* @brief This class is an implementation of a %_UiBuilderControlMaker. +* @since 2.1 +* +* The %_UiBuilderControlMaker Class contains that information for generating a Control and setting a layout information. +* +* +*/ +class _OSP_EXPORT_ _LayoutMaker + : public Tizen::Base::Object +{ +public: + _LayoutMaker(_UiBuilder* pUibuilder); + virtual ~_LayoutMaker(void); + Tizen::Ui::Container* GetContainer(void) const; + result SetGridLayoutContainerProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty) const; + void SetGridLayoutControlProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); + void SetHorizontalBoxLayoutProperty(HorizontalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); + void SetVerticalBoxLayoutProperty(VerticalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); + void SetRelativeLayoutProperty(RelativeLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); + result SetLayoutProperty(_UiBuilderControl* pUiBuilderControl, Control* pControl); + void SetLayoutOrientation(_UiBuilderControl* pUiBuilderCOntrol, Tizen::Ui::Control* pControl); + void GetProperty(_UiBuilderControl* pControl, _UiBuilderControlLayout** pControlProperty) const; + bool GetLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& layoutType) const; + bool GetParentLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const; + result GetGridLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; + result GetHorizontalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; + result GetVerticalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; + result GetRelativeLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; + result GetCardLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; + result GetLayoutN(_UiBuilderControl* pUiBuilderControl, Layout*& pPortraitLayout, Layout*& pLandscapeLayout) const ; + Tizen::Graphics::_ICoordinateSystemTransformer* GetTransformer(void) const; + +private: + _LayoutMaker(const _LayoutMaker& rhs); + _LayoutMaker& operator =(const _LayoutMaker& rhs); + +private: + _UiBuilder* __pUiBuilder; +}; // _LayoutMaker + +} } // Tizen::Ui + +#endif //_FUI_INTERNAL_LAYOUT__MAKER_H_ + + diff --git a/src/ui/inc/FUi_LayoutLayoutTypes.h b/src/ui/inc/FUi_LayoutLayoutTypes.h old mode 100644 new mode 100755 index 88c6ad4..44c0485 --- a/src/ui/inc/FUi_LayoutLayoutTypes.h +++ b/src/ui/inc/FUi_LayoutLayoutTypes.h @@ -35,30 +35,30 @@ namespace Tizen { namespace Ui { namespace _Layout struct LayoutRect { - int x; - int y; - int w; - int h; + float x; + float y; + float w; + float h; }; struct LayoutPoint { - int x; - int y; + float x; + float y; }; struct LayoutSize { - int w; - int h; + float w; + float h; }; struct ItemMargin { - int left; - int top; - int right; - int bottom; + float left; + float top; + float right; + float bottom; }; enum HorizontalAlign diff --git a/src/ui/inc/FUi_LayoutLinearLayout.h b/src/ui/inc/FUi_LayoutLinearLayout.h old mode 100644 new mode 100755 index 11b7cea..8e0c599 --- a/src/ui/inc/FUi_LayoutLinearLayout.h +++ b/src/ui/inc/FUi_LayoutLinearLayout.h @@ -218,7 +218,7 @@ public: * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result SetItemSpacing(LayoutItem& item, int spacing); + result SetItemSpacing(LayoutItem& item, float spacing); /** * Gets the spacing for specified item. @@ -231,7 +231,7 @@ public: * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result GetItemSpacing(const LayoutItem& item, int& spacing) const; + result GetItemSpacing(const LayoutItem& item, float& spacing) const; protected: /** @@ -245,7 +245,7 @@ protected: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result OnLayout(int width, int height, bool layoutUpdating); + virtual result OnLayout(float width, float height, bool layoutUpdating); private: /** @@ -274,7 +274,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculatePositionSize(int& rightBound, int& bottomBound); + result CalculatePositionSize(float& rightBound, float& bottomBound); /** * If orientation is horizontal, Calculates the size & position of all children. @n @@ -287,7 +287,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateHorizontalPositionSize(int& rightBound, int& bottomBound); + result CalculateHorizontalPositionSize(float& rightBound, float& bottomBound); /** * If orientation is vertical, Calculates the size & position of all children. @n @@ -300,7 +300,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateVerticalPositonSize(int& rightBound, int& bottomBound); + result CalculateVerticalPositonSize(float& rightBound, float& bottomBound); /** * Calculates the bound in empty space according to weight. @n @@ -313,7 +313,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateWeight(int& rightBound, int& bottomBound); + result CalculateWeight(float& rightBound, float& bottomBound); /** * If orientation is horizontal, Calculates the bound in empty space according to weight. @n @@ -324,7 +324,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateHorizontalWeight(int& emptySpace); + result CalculateHorizontalWeight(float& emptySpace); /** * If orientation is vertical, Calculates the bound in empty space according to weight. @n @@ -335,7 +335,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateVerticalWeight(int& emptySpace); + result CalculateVerticalWeight(float& emptySpace); /** * Checks whether container is wrap content mode, and calculate size. @n @@ -348,7 +348,7 @@ private: * @exception E_SUCCESS The method was successful. * @exception E_INVALID_STATE This instance is in an invalid state. */ - result CalculateWrapContent(LayoutItemProxy& containerProxy, int rightBound, int bottomBound, bool layoutUpdating); + result CalculateWrapContent(LayoutItemProxy& containerProxy, float rightBound, float bottomBound, bool layoutUpdating); /** * Checks whether container is match parent mode, and calculate size. @n diff --git a/src/ui/inc/FUi_LayoutRelativeLayout.h b/src/ui/inc/FUi_LayoutRelativeLayout.h old mode 100644 new mode 100755 index de8e20b..603850b --- a/src/ui/inc/FUi_LayoutRelativeLayout.h +++ b/src/ui/inc/FUi_LayoutRelativeLayout.h @@ -113,7 +113,7 @@ protected: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result OnLayout(int width, int height, bool updateLayouting); + virtual result OnLayout(float width, float height, bool updateLayouting); private: /** diff --git a/src/ui/inc/FUi_LayoutTableLayout.h b/src/ui/inc/FUi_LayoutTableLayout.h index e75f87b..64423ac 100755 --- a/src/ui/inc/FUi_LayoutTableLayout.h +++ b/src/ui/inc/FUi_LayoutTableLayout.h @@ -34,26 +34,26 @@ namespace Tizen { namespace Ui { namespace _Layout struct RowInfo { - int y; - int height; + float y; + float height; bool rowCollapsed; bool heightShrinkable; bool heightStretchable; - int heightSpacing; - int maxHeight; - int mergedHeight; + float heightSpacing; + float maxHeight; + float mergedHeight; }; struct ColumnInfo { - int x; - int width; + float x; + float width; bool columnCollapsed; bool widthShrinkable; bool widthStretchable; - int widthSpacing; - int maxWidth; - int mergedWidth; + float widthSpacing; + float maxWidth; + float mergedWidth; }; class _OSP_EXPORT_ TableLayout @@ -97,7 +97,7 @@ public: * @exception E_INVALID_ARG The specified input parameter is invalid. * @exception E_OUT_OF_MEMORY Insufficient memory. */ - result CreateTable(int row, int column, int spacing = 0); + result CreateTable(int row, int column, float spacing = 0.0f); /** * Merges from the start cell to the end cell. @@ -407,7 +407,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result SetRowSpacing(int row, int heightSpacing); + result SetRowSpacing(int row, float heightSpacing); /** * Gets the spacing of the specified row. @@ -419,7 +419,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result GetRowSpacing(int row, int& spacing) const; + result GetRowSpacing(int row, float& spacing) const; /** * Sets the spacing for specified column. @@ -431,7 +431,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result SetColumnSpacing(int column, int widthSpacing); + result SetColumnSpacing(int column, float widthSpacing); /** * Gets the spacing of the specified column. @@ -443,7 +443,7 @@ public: * @exception E_SUCCESS The method was successful. * @exception E_OUT_OF_RANGE Input Argument value over the max value. */ - result GetColumnSpacing(int column, int& spacing) const; + result GetColumnSpacing(int column, float& spacing) const; /** * Sets the fill property for specified cell. @@ -487,7 +487,7 @@ protected: * @exception E_INVALID_STATE This instance is in an invalid state. * @since 2.0 */ - virtual result OnLayout(int widht, int height, bool updateLayouting); + virtual result OnLayout(float widht, float height, bool updateLayouting); private: /** diff --git a/src/ui/inc/FUi_Math.h b/src/ui/inc/FUi_Math.h index 648a4881..8bdb193 100644 --- a/src/ui/inc/FUi_Math.h +++ b/src/ui/inc/FUi_Math.h @@ -61,13 +61,37 @@ _Max(const T& a, const T& b) static inline bool _FloatCompare(double p1, double p2) { - return (_Abs(p1 - p2) <= ALMOST_ZERO_FLOAT * _Min(_Abs(p1), _Abs(p2))); + return (p1 == p2 || _Abs(p1 - p2) <= ALMOST_ZERO_DOUBLE * _Min(_Abs(p1), _Abs(p2))); } static inline bool _FloatCompare(float p1, float p2) { - return (_Abs(p1 - p2) <= ALMOST_ZERO_DOUBLE * _Min(_Abs(p1), _Abs(p2))); + return (p1 == p2 || _Abs(p1 - p2) <= ALMOST_ZERO_FLOAT * _Min(_Abs(p1), _Abs(p2))); +} + +static inline bool +_FloatCompareGE(float p1, float p2) +{ + return (p1 >= p2 || _Abs(p1 - p2) <= ALMOST_ZERO_FLOAT * _Min(_Abs(p1), _Abs(p2))); +} + +static inline bool +_FloatCompareGE(double p1, double p2) +{ + return (p1 >= p2 || _Abs(p1 - p2) <= ALMOST_ZERO_DOUBLE * _Min(_Abs(p1), _Abs(p2))); +} + +static inline bool +_FloatCompareLE(float p1, float p2) +{ + return (p1 <= p2 || _Abs(p1 - p2) <= ALMOST_ZERO_FLOAT * _Min(_Abs(p1), _Abs(p2))); +} + +static inline bool +_FloatCompareLE(double p1, double p2) +{ + return (p1 <= p2 || _Abs(p1 - p2) <= ALMOST_ZERO_DOUBLE * _Min(_Abs(p1), _Abs(p2))); } static inline bool diff --git a/src/ui/inc/FUi_Matrix3Df.h b/src/ui/inc/FUi_Matrix3Df.h index 9e316bf..06099e3 100644 --- a/src/ui/inc/FUi_Matrix3Df.h +++ b/src/ui/inc/FUi_Matrix3Df.h @@ -16,7 +16,7 @@ // /** - * @file FUi_Matrix3Df.h + * @file FUiAnim_Matrix3Df.h * @brief Header file of _Matrix3Df class * * This file contains declarations _Matrix3Df class. diff --git a/src/ui/inc/FUi_ModalLoopManager.h b/src/ui/inc/FUi_ModalLoopManager.h old mode 100644 new mode 100755 index 0f36d4a..334af4a --- a/src/ui/inc/FUi_ModalLoopManager.h +++ b/src/ui/inc/FUi_ModalLoopManager.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ModalLoopManager.h * @brief This is the header file for the _ModalLoopManager class. @@ -56,7 +57,7 @@ class _ModalLoopManager typedef Tizen::Base::Collection::ArrayListT<_TimerInfo> TimerInfoList; public: - static void Initialize(void); + static void Initialize(void); static _ModalLoopManager* GetInstance(void); int BeginMainLoop(void); diff --git a/src/ui/inc/FUi_Pointf.h b/src/ui/inc/FUi_Pointf.h index 69a745f..40955db 100644 --- a/src/ui/inc/FUi_Pointf.h +++ b/src/ui/inc/FUi_Pointf.h @@ -16,7 +16,7 @@ // /** - * @file FUi_Pointf.h + * @file FUiAnim_Pointf.h * @brief Header file of _Pointf class * * This file contains declarations _Pointf class. diff --git a/src/ui/inc/FUi_Rectanglef.h b/src/ui/inc/FUi_Rectanglef.h index 8dc57eb..cab46e8 100644 --- a/src/ui/inc/FUi_Rectanglef.h +++ b/src/ui/inc/FUi_Rectanglef.h @@ -16,7 +16,7 @@ // /** - * @file FUi_Rectanglef.h + * @file FUiAnim_Rectanglef.h * @brief Header file of _Rectanglef class * * This file contains declarations _Rectanglef class. diff --git a/src/ui/inc/FUi_ResourceManager.h b/src/ui/inc/FUi_ResourceManager.h index bb9a387..f069172 100644 --- a/src/ui/inc/FUi_ResourceManager.h +++ b/src/ui/inc/FUi_ResourceManager.h @@ -35,6 +35,7 @@ namespace Tizen { namespace Base { class Integer; +class Float; }}//Tizen::Base:: namespace Tizen { namespace Base { namespace Collection @@ -45,6 +46,7 @@ template class ArrayListT; namespace Tizen { namespace Graphics { class Bitmap; +class FloatDimension; class Dimension; class Color; class _ICoordinateSystemTransformer; @@ -59,6 +61,60 @@ class MapContainer; namespace Tizen { namespace Ui { + +enum _ResourceFeedbackPattern +{ + _RESOURCE_FEEDBACK_PATTERN_TAP = 0, + _RESOURCE_FEEDBACK_PATTERN_SIP, + _RESOURCE_FEEDBACK_PATTERN_SIP_BACKSPACE, + _RESOURCE_FEEDBACK_PATTERN_MAX_CHARACTER, + _RESOURCE_FEEDBACK_PATTERN_KEY0, + _RESOURCE_FEEDBACK_PATTERN_KEY1, + _RESOURCE_FEEDBACK_PATTERN_KEY2, + _RESOURCE_FEEDBACK_PATTERN_KEY3, + _RESOURCE_FEEDBACK_PATTERN_KEY4, + _RESOURCE_FEEDBACK_PATTERN_KEY5, + _RESOURCE_FEEDBACK_PATTERN_KEY6, + _RESOURCE_FEEDBACK_PATTERN_KEY7, + _RESOURCE_FEEDBACK_PATTERN_KEY8, + _RESOURCE_FEEDBACK_PATTERN_KEY9, + _RESOURCE_FEEDBACK_PATTERN_KEY_STAR, + _RESOURCE_FEEDBACK_PATTERN_KEY_SHARP, + _RESOURCE_FEEDBACK_PATTERN_HOLD, + _RESOURCE_FEEDBACK_PATTERN_MULTI_TAP, + _RESOURCE_FEEDBACK_PATTERN_HW_TAP, + _RESOURCE_FEEDBACK_PATTERN_HW_HOLD, + _RESOURCE_FEEDBACK_PATTERN_MESSAGE, + _RESOURCE_FEEDBACK_PATTERN_MESSAGE_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_EMAIL, + _RESOURCE_FEEDBACK_PATTERN_EMAIL_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_WAKEUP, + _RESOURCE_FEEDBACK_PATTERN_WAKEUP_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_SCHEDULE, + _RESOURCE_FEEDBACK_PATTERN_SCHEDULE_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_TIMER, + _RESOURCE_FEEDBACK_PATTERN_TIMER_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_GENERAL, + _RESOURCE_FEEDBACK_PATTERN_GENERAL_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_POWERON, + _RESOURCE_FEEDBACK_PATTERN_POWEROFF, + _RESOURCE_FEEDBACK_PATTERN_CHARGERCONN, + _RESOURCE_FEEDBACK_PATTERN_CHARGERCONN_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_FULLCHARGED, + _RESOURCE_FEEDBACK_PATTERN_FULLCHARGED_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_LOWBATT, + _RESOURCE_FEEDBACK_PATTERN_LOWBATT_ON_CALL, + _RESOURCE_FEEDBACK_PATTERN_LOCK, + _RESOURCE_FEEDBACK_PATTERN_UNLOCK, + _RESOURCE_FEEDBACK_PATTERN_CALLCONNECT, + _RESOURCE_FEEDBACK_PATTERN_DISCALLCONNECT, + _RESOURCE_FEEDBACK_PATTERN_MINUTEMINDER, + _RESOURCE_FEEDBACK_PATTERN_VIBRATION, + _RESOURCE_FEEDBACK_PATTERN_SHUTTER, + _RESOURCE_FEEDBACK_PATTERN_LIST_REORDER, + _RESOURCE_FEEDBACK_PATTERN_SLIDER_SWEEP +}; // enum _ResourceFeedbackPattern + namespace Controls { namespace __Internal { const int OVERLAY_REGION_MIN_LENGTH = 16; @@ -82,12 +138,17 @@ namespace Tizen { namespace Ui #define GET_FIXED_VALUE_CONFIG(fixedValueId, orientation, x)\ Tizen::Ui::_ResourceManager::GetInstance()->GetFixedValue(#fixedValueId, orientation, x); +#define GET_ANIMATION_CONFIG_N(animationId, x)\ + Tizen::Ui::_ResourceManager::GetInstance()->GetAnimationN(#animationId, x); + #define IS_CUSTOM_BITMAP(bitmapId) \ Tizen::Ui::_ResourceManager::GetInstance()->IsCustomBitmap(#bitmapId); #define IS_CUSTOM_COLOR(colorId) \ Tizen::Ui::_ResourceManager::GetInstance()->IsCustomColor(#colorId); +#define PLAY_FEEDBACK(pattern) \ + Tizen::Ui::_ResourceManager::GetInstance()->PlayFeedback(pattern); class _OSP_EXPORT_ _ResourceManager { @@ -99,17 +160,23 @@ public: result GetShape(const Tizen::Base::String& shapeId, _ControlOrientation orientation, int& value); result GetFixedValue(const Tizen::Base::String& shapeId, _ControlOrientation orientation, int& value); result GetDimension(const Tizen::Base::String& dimensionId, _ControlOrientation orientation, Tizen::Graphics::Dimension& dimension); + result GetShape(const Tizen::Base::String& shapeId, _ControlOrientation orientation, float& value); + result GetFixedValue(const Tizen::Base::String& shapeId, _ControlOrientation orientation, float& value); + result GetDimension(const Tizen::Base::String& dimensionId, _ControlOrientation orientation, Tizen::Graphics::FloatDimension& dimension); + result GetAnimationN(const Tizen::Base::String& animationId, Tizen::Base::Collection::ArrayList*& pList); void GetThemeName(Tizen::Base::String& systemTheme, Tizen::Base::String& userTheme) const; void ReloadTheme(Tizen::Base::String& themeName, bool userdefine); bool IsCustomColor(const Tizen::Base::String& colorId); bool IsCustomBitmap(const Tizen::Base::String& bitmapId); - + result PlayFeedback(_ResourceFeedbackPattern pattern); private: _ResourceManager(void); ~_ResourceManager(void); static void CreateInstance(void); + void DoPostInitialization(void); + _ResourceManager(const _ResourceManager& rhs); _ResourceManager& operator =(const _ResourceManager& rhs); @@ -122,16 +189,18 @@ private: MAP_CONTAINER_TYPE_MAX = 4, }; result GetBitmapInternalN(const Tizen::Base::String& fileName, Tizen::Graphics::BitmapPixelFormat pixelFormat, _ControlOrientation orientation, Tizen::Graphics::Bitmap*& pBitmap); - result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, Tizen::Base::Integer& integer); - result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, Tizen::Graphics::Dimension& dimension); + result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, int& value); + result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, Tizen::Graphics::Dimension& value); + result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, float& value); + result GetDefaultShapeWithScaling(const Tizen::Base::String& shapeId, _ControlOrientation orientation, Tizen::Graphics::FloatDimension& value); result LoadThemeInformation(Tizen::Base::String& systemTheme, Tizen::Base::String& userTheme); bool InitializeTheme(_Resource::MapContainer& mapContainer); - void LoadConfig(const Tizen::Base::String& resolution, _Resource::MapContainer& mapContainer); + void LoadConfig(const Tizen::Base::String& resolution, _Resource::MapContainer& mapContainer, int width, int height); _Resource::MapContainer* GetMapContainer(MapContainerType type); void SetSystemColor(void); Tizen::Base::String FindImagePath(const Tizen::Base::String& fileName, int& findFolder); - bool GetDensityDirectory(const Tizen::Base::String directoryName, float scaleFactor); - bool GetResolutionDirectory(const Tizen::Base::String directoryName, float scaleFactor); + bool GetDensityDirectory(const Tizen::Base::String& directoryName, float& scaleFactor); + bool GetResolutionDirectory(const Tizen::Base::String& directoryName, float& scaleFactor); private: @@ -153,11 +222,14 @@ private: Tizen::Base::String __systemTheme; Tizen::Base::String __userTheme; bool __appliedUserTheme; + bool __initializeFeedback; int __appBaseWidth; int __appBaseHeight; int __targetWidth; int __targetHeight; int __deviceDPI; + int __logicalWidth; + int __logicalHeight; Tizen::Base::Collection::ArrayListT* __pFallbackList; }; diff --git a/src/ui/inc/FUi_ResourceSizeInfo.h b/src/ui/inc/FUi_ResourceSizeInfo.h index 6043ae4..ed5e4b4 100644 --- a/src/ui/inc/FUi_ResourceSizeInfo.h +++ b/src/ui/inc/FUi_ResourceSizeInfo.h @@ -66,8 +66,8 @@ public: static Tizen::Ui::_ControlImpl::SizeInfo& GetSlidableListSizeInfo(void); static Tizen::Ui::_ControlImpl::SizeInfo& GetWebSizeInfo(void); static Tizen::Ui::_ControlImpl::SizeInfo& GetMapSizeInfo(void); - static Tizen::Ui::_ControlImpl::SizeInfo& GetEditDateSizeInfo(bool titleStyle); - static Tizen::Ui::_ControlImpl::SizeInfo& GetEditTimeSizeInfo(bool titleStyle); + static Tizen::Ui::_ControlImpl::SizeInfo& GetEditDateSizeInfo(void); + static Tizen::Ui::_ControlImpl::SizeInfo& GetEditTimeSizeInfo(void); static Tizen::Ui::_ControlImpl::SizeInfo& GetTableViewSizeInfo(void); static Tizen::Ui::_ControlImpl::SizeInfo& GetTableViewItemSizeInfo(void); }; diff --git a/src/ui/inc/FUi_SharedPtr.h b/src/ui/inc/FUi_SharedPtr.h old mode 100644 new mode 100755 index 0a8d940..a670eaf --- a/src/ui/inc/FUi_SharedPtr.h +++ b/src/ui/inc/FUi_SharedPtr.h @@ -14,6 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // +/** + * @file FUi_SharedPtr.h + * @brief This is the header file for the _SharedPtr class. + * + * This file contains the declarations of the _SharedPtr class. + */ #ifndef _FUI_INTERNAL_SHARED_PTR_H_ #define _FUI_INTERNAL_SHARED_PTR_H_ diff --git a/src/ui/inc/FUi_SystemUtilImpl.h b/src/ui/inc/FUi_SystemUtilImpl.h new file mode 100644 index 0000000..52d784d --- /dev/null +++ b/src/ui/inc/FUi_SystemUtilImpl.h @@ -0,0 +1,162 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** +* @file FUi_SystemUtilImpl.h +* @brief This is the header file for the _SystemUtilImpl +* +* This header file contains the declarations of the _SystemUtilImpl class. +* +*/ + +#ifndef _FUI_SYSTEM_UTIL_IMPL_H_ +#define _FUI_SYSTEM_UTIL_IMPL_H_ + +#include +#include +#include "FUi_UiKeyEvent.h" + +namespace Tizen { namespace Graphics +{ +class Bitmap; +class Point; +class FloatPoint; +}} + +namespace Tizen { namespace Ui +{ + +/** +* @if VISPARTNER-MANUFACTURER +* @class _SystemUtilImpl +* @brief This is a class for system utililty such as touch, key, and capturing screen. It provides +* functionalities to simulate user inputs. +* @since 2.0 +* @final This class is not intended for extension. +* @visibility partner-manufacturer +* +* This class provides methods to generate user's input events such as +* touch and key events for helping test application and to capture current screen. +* @endif +*/ +class _OSP_EXPORT_ _SystemUtilImpl +{ +public: + /** + * @if VISPARTNER-MANUFACTURER + * Generates a key event + * + * @since 2.0 + * @visibility partner-manufacturer + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] keyEvent The event type of the key to be generated + * @param[in] keyCode The code of the key + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c keyEvent or @c keyCode is not supported. + * @endif + */ + static result GenerateKeyEvent(KeyEventType keyEvent, _KeyCode keyCode); + + /** + * @if VISPARTNER-MANUFACTURER + * Generates a touch event + * + * @since 2.0 + * @visibility partner-manufacturer + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] touchEvent The event type of the touch to be generated + * @param[in] point The point on which the touch occurs + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c touchEvent is not supported. + * @endif + */ + static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::Point& point); + + /* + * @if VISPARTNER-MANUFACTURER + * Generates a touch event + * + * @since 2.0 + * @visibility partner-manufacturer + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return An error code + * @param[in] touchEvent The event type of the touch to be generated + * @param[in] point The point on which the touch occurs + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @exception E_INVALID_ARG The specified @c touchEvent is not supported. + * @endif + */ + static result GenerateTouchEvent(TouchEventType touchEvent, const Tizen::Graphics::FloatPoint& point); + + /** + * @if VISPARTNER-MANUFACTURER + * Captures a screen + * + * @since 2.0 + * @visibility partner-manufacturer + * @privilege %http://tizen.org/privilege/inputmanager + * + * @return A pointer to the captured screen bitmap, @n + * else @c null if it fails to capture screen + * @exception E_SUCCESS The method was successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_OPERATION_FAILED An error occurred in the underlying system. + * @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer here. + * @remarks The specific error code can be accessed using the GetLastResult() method. @n + * The returned bitmap should be deleted by the application after use. + * @endif + */ + static Tizen::Graphics::Bitmap* CaptureScreenN(void); + +private: + // + // This default constructor is intentionally declared as private because this class cannot be constructed. + // + _SystemUtilImpl(void); + + // + // This destructor is intentionally declared as private because this class cannot be constructed. + // + _SystemUtilImpl(const _SystemUtilImpl& rhs); + + // + // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. + // + _SystemUtilImpl& operator =(const _SystemUtilImpl& rhs); + + // + // This is a destructor for this class. + // This destructor is intentionally declared as private because this class cannot be constructed. + // + ~_SystemUtilImpl(void); + +}; //_SystemUtilImpl + +}} //Tizen::Ui +#endif + diff --git a/src/ui/inc/FUi_TouchEventInfoImpl.h b/src/ui/inc/FUi_TouchEventInfoImpl.h index 2ac92fa..eae6abf 100644 --- a/src/ui/inc/FUi_TouchEventInfoImpl.h +++ b/src/ui/inc/FUi_TouchEventInfoImpl.h @@ -27,6 +27,7 @@ #include #include +#include #include "FUi_UiTouchEvent.h" namespace Tizen { namespace Ui @@ -57,8 +58,12 @@ public: Tizen::Graphics::Point GetStartPosition(void) const; + Tizen::Graphics::FloatPoint GetStartPositionF(void) const; + Tizen::Graphics::Point GetCurrentPosition(void) const; + Tizen::Graphics::FloatPoint GetCurrentPositionF(void) const; + _TouchStatus GetTouchStatus(void) const; bool IsFlicked(void) const; @@ -87,8 +92,8 @@ private: TouchEventInfo* __pPublic; unsigned long __pointId; _TouchStatus __touchStatus; - Tizen::Graphics::Point __startPosition; - Tizen::Graphics::Point __currentPosition; + Tizen::Graphics::FloatPoint __startPosition; + Tizen::Graphics::FloatPoint __currentPosition; bool __isFlicked; }; // TouchEventInfo diff --git a/src/ui/inc/FUi_TouchFlickGestureDetector.h b/src/ui/inc/FUi_TouchFlickGestureDetector.h index 94ef41a..e17c326 100644 --- a/src/ui/inc/FUi_TouchFlickGestureDetector.h +++ b/src/ui/inc/FUi_TouchFlickGestureDetector.h @@ -67,6 +67,8 @@ public: virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); void GetDistance(int& x, int &y) const; + void GetDistance(float& x, float &y) const; + int GetDuration(void) const; _FlickDirection GetDirection(void) const; @@ -83,8 +85,8 @@ private: _TouchFlickGestureDetector& operator =(const _TouchFlickGestureDetector&); private: - int __xDistance; - int __yDistance; + float __xDistance; + float __yDistance; int __duration; _FlickDirection __direction; int __maxMoveX; diff --git a/src/ui/inc/FUi_TouchFlickGestureDetectorImpl.h b/src/ui/inc/FUi_TouchFlickGestureDetectorImpl.h index 290037c..6d2f513 100644 --- a/src/ui/inc/FUi_TouchFlickGestureDetectorImpl.h +++ b/src/ui/inc/FUi_TouchFlickGestureDetectorImpl.h @@ -53,6 +53,8 @@ public: static const _TouchFlickGestureDetectorImpl* GetInstance(const TouchFlickGestureDetector& gestureDetector); result GetDistance(int &x, int &y) const; + result GetDistance(float &x, float &y) const; + int GetDuration(void) const; FlickDirection GetDirection(void) const; diff --git a/src/ui/inc/FUi_TouchGestureDetector.h b/src/ui/inc/FUi_TouchGestureDetector.h index 46d9c31..6a8ed0c 100644 --- a/src/ui/inc/FUi_TouchGestureDetector.h +++ b/src/ui/inc/FUi_TouchGestureDetector.h @@ -126,6 +126,9 @@ public: virtual void OnGestureDetectorStateChanged(const _TouchGestureDetector& gestureDetector); + virtual void OnTouchGestureDetectorAdded(void); + virtual void OnTouchGestureDetectorRemoved(void); + void ProcessPublicListener(_TouchGestureDetector& gesture); void ProcessCoreListener(_TouchGestureDetector& gesture); diff --git a/src/ui/inc/FUi_TouchLongPressGestureDetector.h b/src/ui/inc/FUi_TouchLongPressGestureDetector.h index 13c6ab9..02431b2 100644 --- a/src/ui/inc/FUi_TouchLongPressGestureDetector.h +++ b/src/ui/inc/FUi_TouchLongPressGestureDetector.h @@ -51,12 +51,20 @@ public: result SetMoveAllowance(int allowance); int GetMoveAllowance(void) const; + result SetMoveAllowance(float allowance); + float GetMoveAllowanceF(void) const; + result SetTouchCount(int count); int GetTouchCount(void) const; bool IsPressed(void); void ClearLongPressInfoList(void); + void ResetGestureTimerManager(void); + bool IsTouchCanceled(void) const; + + void EnableToDeleteTimer(bool deleteTimer); + virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); @@ -71,10 +79,12 @@ private: private: int __duration; - int __moveAllowance; + float __moveAllowance; int __touchCount; unsigned int __maxPointId; _TouchGestureTimerManager* __pGestureTimerManager; + bool __touchCanceled; + bool __deleteTimer; class _LongPressInfo; Tizen::Base::Collection::ArrayListT<_LongPressInfo*>* __pLongPressInfoList; diff --git a/src/ui/inc/FUi_TouchLongPressGestureDetectorImpl.h b/src/ui/inc/FUi_TouchLongPressGestureDetectorImpl.h index a890ce3..31502f5 100644 --- a/src/ui/inc/FUi_TouchLongPressGestureDetectorImpl.h +++ b/src/ui/inc/FUi_TouchLongPressGestureDetectorImpl.h @@ -58,6 +58,9 @@ public: result SetMoveAllowance(int allowance); int GetMoveAllowance(void) const; + result SetMoveAllowance(float allowance); + float GetMoveAllowanceF(void) const; + result SetTouchCount(int count); int GetTouchCount(void) const; diff --git a/src/ui/inc/FUi_TouchManager.h b/src/ui/inc/FUi_TouchManager.h index cd27ea2..b535ed5 100644 --- a/src/ui/inc/FUi_TouchManager.h +++ b/src/ui/inc/FUi_TouchManager.h @@ -81,7 +81,7 @@ public: * @since 2.0 * @return The touch position */ - Tizen::Graphics::Point GetPosition(unsigned long id) const; + Tizen::Graphics::FloatPoint GetPosition(unsigned long id) const; /** * This method returns the touch position of specific pointId. @@ -89,7 +89,7 @@ public: * @since 2.0 * @return The touch position */ - Tizen::Graphics::Point GetScreenPoint(unsigned long id) const; + Tizen::Graphics::FloatPoint GetScreenPoint(unsigned long id) const; /** * This method returns the touch status of specific pointId. @@ -105,7 +105,7 @@ public: * @since 2.0 * @return The touch start position */ - Tizen::Graphics::Point GetStartPoint(unsigned long id) const; + Tizen::Graphics::FloatPoint GetStartPoint(unsigned long id) const; /** * This method returns the touch count @@ -128,7 +128,7 @@ public: * * @since 2.0 */ - result SetFingerInfo(unsigned long pointId, const Tizen::Graphics::Point& point, const Tizen::Graphics::Point& screenPoint, _TouchStatus status); + result SetFingerInfo(unsigned long pointId, const Tizen::Graphics::FloatPoint& point, const Tizen::Graphics::FloatPoint& screenPoint, _TouchStatus status); /** * This method resets finger info @@ -188,7 +188,7 @@ public: * @since 2.0 * @return */ - result AddPoint(unsigned long pointId, const Tizen::Graphics::Point& point, _TouchStatus status); + result AddPoint(unsigned long pointId, const Tizen::Graphics::FloatPoint& point, _TouchStatus status); /** * This method returns the touch point count. @@ -204,7 +204,7 @@ public: * @since 2.0 * @return The touch position */ - Tizen::Graphics::Point GetScreenPoint(unsigned long id) const; + Tizen::Graphics::FloatPoint GetScreenPoint(unsigned long id) const; /** * This method returns the touch position. @@ -212,7 +212,7 @@ public: * @since 2.0 * @return The touch position */ - Tizen::Graphics::Point GetPosition(unsigned long id) const; + Tizen::Graphics::FloatPoint GetPosition(unsigned long id) const; /** * This method returns the touch status of specific pointId. @@ -252,7 +252,7 @@ public: * @since 2.0 * @return The touch start point(means touch pressed point) */ - Tizen::Graphics::Point GetStartPoint(unsigned long pointId) const; + Tizen::Graphics::FloatPoint GetStartPoint(unsigned long pointId) const; /** * This method makes touch event and send touch event through event manager @@ -266,7 +266,13 @@ public: * * @since 2.0 */ - void SetTouchCanceled(bool canceled, bool onlyTouchEvent = false);; + void SetTouchCanceled(bool canceled, bool onlyTouchEvent = false); + + /** + * This method sets touch released status + * open contextMenu when longpress detected, release event isn't sent because IsEventEnabled is false + */ + void SetTouchReleased(void); /** * This method sets touch allowed status @@ -369,6 +375,10 @@ public: static void ReleaseInstance(void); + void SetChangedTouchableTarget(_Control* pTarget); + + _Control* GetChangedTouchableTarget(void); + private: /** * This is the default class constructor. @@ -406,6 +416,7 @@ private: bool __captureAllowOutOfBounds; //will be deleted bool __isSendingDelayedEvent; bool __touchCanceledOnGestureSuccess; + _Control* __changedTouchableTarget; }; // _TouchManager } } // Tizen::Ui diff --git a/src/ui/inc/FUi_TouchPanningGestureDetector.h b/src/ui/inc/FUi_TouchPanningGestureDetector.h index 45a10dc..2ab9932 100644 --- a/src/ui/inc/FUi_TouchPanningGestureDetector.h +++ b/src/ui/inc/FUi_TouchPanningGestureDetector.h @@ -46,6 +46,9 @@ public: virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); + virtual void OnTouchGestureDetectorAdded(void); + virtual void OnTouchGestureDetectorRemoved(void); + result SetTouchCount(int count); int GetTouchCount(void) const; diff --git a/src/ui/inc/FUi_TouchPinchGestureDetector.h b/src/ui/inc/FUi_TouchPinchGestureDetector.h index 8aa2972..67593a7 100644 --- a/src/ui/inc/FUi_TouchPinchGestureDetector.h +++ b/src/ui/inc/FUi_TouchPinchGestureDetector.h @@ -44,7 +44,10 @@ public: virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); Tizen::Graphics::Point GetCenterPoint(void) const; + Tizen::Graphics::FloatPoint GetCenterPointF(void) const; + int GetScale(void) const; + float GetScaleF(void) const; private: _TouchPinchGestureDetector(const _TouchPinchGestureDetector&); @@ -55,12 +58,12 @@ private: int MeasureArea(void); private: - Tizen::Graphics::Point __MinimumPoint; - Tizen::Graphics::Point __MaximumPoint; - Tizen::Graphics::Point __centerPosition; + Tizen::Graphics::FloatPoint __MinimumPoint; + Tizen::Graphics::FloatPoint __MaximumPoint; + Tizen::Graphics::FloatPoint __centerPosition; Tizen::Base::Runtime::Timer* __pTimer; int __threshold; - int __scale; + float __scale; }; // _TouchPinchGestureDetector }} //Tizen::Ui diff --git a/src/ui/inc/FUi_TouchPinchGestureDetectorImpl.h b/src/ui/inc/FUi_TouchPinchGestureDetectorImpl.h index 04559ec..269a4f8 100644 --- a/src/ui/inc/FUi_TouchPinchGestureDetectorImpl.h +++ b/src/ui/inc/FUi_TouchPinchGestureDetectorImpl.h @@ -45,7 +45,10 @@ public: static const _TouchPinchGestureDetectorImpl* GetInstance(const TouchPinchGestureDetector& gestureDetector); Tizen::Graphics::Point GetCenterPoint(void) const; + Tizen::Graphics::FloatPoint GetCenterPointF(void) const; + int GetScale(void) const; + float GetScaleF(void) const; private: _TouchPinchGestureDetectorImpl(TouchPinchGestureDetector* pPublic, _TouchPinchGestureDetector* pCore); diff --git a/src/ui/inc/FUi_TouchRotationGestureDetector.h b/src/ui/inc/FUi_TouchRotationGestureDetector.h index a01b0b0..1acb995 100644 --- a/src/ui/inc/FUi_TouchRotationGestureDetector.h +++ b/src/ui/inc/FUi_TouchRotationGestureDetector.h @@ -46,9 +46,14 @@ public: virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo); + virtual void OnTouchGestureDetectorAdded(void); + virtual void OnTouchGestureDetectorRemoved(void); + float GetAngle(void) const; int GetDistance(void) const; + float GetDistanceF(void) const; + private: _TouchRotationGestureDetector(const _TouchRotationGestureDetector&); _TouchRotationGestureDetector& operator =(const _TouchRotationGestureDetector&); @@ -58,7 +63,7 @@ private: void SetDetectorStateChanged(void); private: - int __distance; + float __distance; float __angle; int __fingerCount; Tizen::Graphics::Point __firstPoint; diff --git a/src/ui/inc/FUi_TouchRotationGestureDetectorImpl.h b/src/ui/inc/FUi_TouchRotationGestureDetectorImpl.h index 1a632d4..5a6e193 100644 --- a/src/ui/inc/FUi_TouchRotationGestureDetectorImpl.h +++ b/src/ui/inc/FUi_TouchRotationGestureDetectorImpl.h @@ -52,6 +52,8 @@ public: float GetAngle(void) const; int GetDistance(void) const; + float GetDistanceF(void) const; + private: _TouchRotationGestureDetectorImpl(TouchRotationGestureDetector* pPublic, _TouchRotationGestureDetector* pCore); diff --git a/src/ui/inc/FUi_TouchTapGestureDetector.h b/src/ui/inc/FUi_TouchTapGestureDetector.h index 4d56b35..b1403dd 100644 --- a/src/ui/inc/FUi_TouchTapGestureDetector.h +++ b/src/ui/inc/FUi_TouchTapGestureDetector.h @@ -55,6 +55,10 @@ public: //apply only one touch count result SetMoveAllowance(int allowance); int GetMoveAllowance(void) const; + + result SetMoveAllowance(float allowance); + float GetMoveAllowanceF(void) const; + bool IsInBounds(void); void ClearTapInfoList(void); bool IsAllTapped(void); @@ -74,7 +78,7 @@ private: int __tapCount; int __interval; int __touchCount; - int __oneTapMoveAllowance; + float __oneTapMoveAllowance; bool __oneTapIsInBounds; unsigned int __maxPointId; Tizen::Graphics::Point __oneTapStartPoint; diff --git a/src/ui/inc/FUi_TouchTapGestureDetectorImpl.h b/src/ui/inc/FUi_TouchTapGestureDetectorImpl.h index 7dff398..d38b5aa 100644 --- a/src/ui/inc/FUi_TouchTapGestureDetectorImpl.h +++ b/src/ui/inc/FUi_TouchTapGestureDetectorImpl.h @@ -61,6 +61,9 @@ public: result SetMoveAllowance(int allowance); int GetMoveAllowance(void) const; + result SetMoveAllowance(float allowance); + float GetMoveAllowanceF(void) const; + private: _TouchTapGestureDetectorImpl(TouchTapGestureDetector* pPublic, _TouchTapGestureDetector* pCore); diff --git a/src/ui/inc/FUi_Types.h b/src/ui/inc/FUi_Types.h index 16550f9..a7160cb 100644 --- a/src/ui/inc/FUi_Types.h +++ b/src/ui/inc/FUi_Types.h @@ -24,6 +24,7 @@ #include #define MULTI_WINDOW +#define ROTATION_SYNC namespace Tizen { namespace Ui { @@ -71,13 +72,6 @@ enum _ControlZOrderUpdate _CONTROL_ZORDER_UPDATE_DOWNWARD, }; -enum _TouchMoveAllowance -{ - TOUCH_MOVE_ALLOWANCE_SENSITIVE = 0, - TOUCH_MOVE_ALLOWANCE_NORMAL, - TOUCH_MOVE_ALLOWANCE_INSENSITIVE -}; - template struct _IntToType { diff --git a/src/ui/inc/FUi_UiBuilder.h b/src/ui/inc/FUi_UiBuilder.h old mode 100644 new mode 100755 index 6f1540b..4a65dcf --- a/src/ui/inc/FUi_UiBuilder.h +++ b/src/ui/inc/FUi_UiBuilder.h @@ -39,7 +39,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilder * @brief This class is an implementation of a %_UiBuilder. -* @since 2.0 +* @since 2.1 * * The %_UiBuiler Class contains information that control register and XML parser. * diff --git a/src/ui/inc/FUi_UiBuilderConfig.h b/src/ui/inc/FUi_UiBuilderConfig.h old mode 100644 new mode 100755 index b089185..62e6b8e --- a/src/ui/inc/FUi_UiBuilderConfig.h +++ b/src/ui/inc/FUi_UiBuilderConfig.h @@ -36,7 +36,7 @@ const int UIBUILDER_ATTRIBUTE_NUM = 2; * @enum _UiBuilderLayoutType * Defines the layout mode of a UiBuilder control * -* @since 2.0 +* @since 2.1 */ enum _UiBuilderLayoutType { @@ -44,14 +44,15 @@ enum _UiBuilderLayoutType UIBUILDER_LAYOUT_GRID, UIBUILDER_LAYOUT_HORIZONTAL_BOX, UIBUILDER_LAYOUT_VERTICAL_BOX, - UIBUILDER_LAYOUT_RELATIVE + UIBUILDER_LAYOUT_RELATIVE, + UIBUILDER_LAYOUT_CARD }; /** * @enum _UiBuilderScreenRotate * Defines the screen rotate of a UiBuilder control * -* @since 2.0 +* @since 2.1 */ enum _UiBuilderScreenRotate { diff --git a/src/ui/inc/FUi_UiBuilderControl.h b/src/ui/inc/FUi_UiBuilderControl.h index 2ea723b..e76e464 100644 --- a/src/ui/inc/FUi_UiBuilderControl.h +++ b/src/ui/inc/FUi_UiBuilderControl.h @@ -34,7 +34,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilderControl * @brief This class is an implementation of a %_UiBuilderControl. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControl Class contains that informaition for generating the control. * diff --git a/src/ui/inc/FUi_UiBuilderControlElement.h b/src/ui/inc/FUi_UiBuilderControlElement.h index ea5600d..532d15f 100644 --- a/src/ui/inc/FUi_UiBuilderControlElement.h +++ b/src/ui/inc/FUi_UiBuilderControlElement.h @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilderControlElement * @brief This class is an implementation of a %_UiBuilderControlElement. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControlElement Class contains that XML attribute for UiBuilder Control. * diff --git a/src/ui/inc/FUi_UiBuilderControlItem.h b/src/ui/inc/FUi_UiBuilderControlItem.h index a84423d..c6541ee 100644 --- a/src/ui/inc/FUi_UiBuilderControlItem.h +++ b/src/ui/inc/FUi_UiBuilderControlItem.h @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilderControlItem * @brief This class is an implementation of a %_UiBuilderControlItem. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControlItem Class contains that information for information for Ui control item. * diff --git a/src/ui/inc/FUi_UiBuilderControlLayout.h b/src/ui/inc/FUi_UiBuilderControlLayout.h index f1b8d65..5c5bde6 100644 --- a/src/ui/inc/FUi_UiBuilderControlLayout.h +++ b/src/ui/inc/FUi_UiBuilderControlLayout.h @@ -32,7 +32,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilderControlLayout * @brief This class is an implementation of a %_UiBuilderControlLayout. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControlLayout Class contains that coordinates of the control. * @@ -43,14 +43,15 @@ class _OSP_EXPORT_ _UiBuilderControlLayout { public: _UiBuilderControlLayout(void); - virtual ~_UiBuilderControlLayout(void); - void SetStyle(const Tizen::Base::String& style); - void SetRect(const Tizen::Base::String& x, const Tizen::Base::String& y, Tizen::Base::String& width, Tizen::Base::String& height); - void SetRect(const int x, const int y, const int width, const int height); - void SetLayoutElement(int index, const Tizen::Base::String& name, const Tizen::Base::String& value); - Tizen::Base::String GetStyle(void) const; - Tizen::Graphics::Rectangle& GetRect(void) const; - bool GetLayoutElement(const Tizen::Base::String& layoutElementName, Tizen::Base::String& outValue) const; + virtual ~_UiBuilderControlLayout(void); + void SetStyle(const Tizen::Base::String& style); + void SetRect(const Tizen::Base::String& x, const Tizen::Base::String& y, Tizen::Base::String& width, Tizen::Base::String& height); + void SetRect(const float x, const float y, const float width, const float height); + void SetLayoutElement(int index, const Tizen::Base::String& name, const Tizen::Base::String& value); + Tizen::Base::String GetStyle(void) const; + Tizen::Graphics::Rectangle GetRect(void) const; + Tizen::Graphics::FloatRectangle GetRectF(void) const; + bool GetLayoutElement(const Tizen::Base::String& layoutElementName, Tizen::Base::String& outValue) const; private: _UiBuilderControlLayout(const _UiBuilderControlLayout& rhs); @@ -69,10 +70,10 @@ private: _UIBUILDER_FIT_HEIGHT = 0x00002 }; -protected: - Tizen::Base::String _styleInformation; /** stored the style information. It is different each control.*/ - Tizen::Graphics::Rectangle _rect; /** stored rectangle value. This values are ignored sometimes by the Docking and Fit value. */ - _UiBuilderControlElement _layoutElement[UIBUILDER_CONTROL_ELEMENT_NUMBER]; +private: + Tizen::Base::String __styleInformation; + Tizen::Graphics::FloatRectangle __floatRect; + _UiBuilderControlElement __layoutElement[UIBUILDER_CONTROL_ELEMENT_NUMBER]; }; // _UiBuilderControlLayout } } // Tizen::Ui diff --git a/src/ui/inc/FUi_UiBuilderControlMaker.h b/src/ui/inc/FUi_UiBuilderControlMaker.h old mode 100644 new mode 100755 index 51c5f71..ec692c7 --- a/src/ui/inc/FUi_UiBuilderControlMaker.h +++ b/src/ui/inc/FUi_UiBuilderControlMaker.h @@ -24,122 +24,25 @@ #ifndef _FUI_INTERNAL_UI_BUILDER_CONTROL_MAKER_H_ #define _FUI_INTERNAL_UI_BUILDER_CONTROL_MAKER_H_ +#include #include #include -#include -#include -#include -#include -#include #include #include #include #include "FUi_UiBuilderConfig.h" #include "FUi_UiBuilderControl.h" - - +#include "FUi_LayoutLayoutMaker.h" namespace Tizen { namespace Ui { -struct UiBuilderRelativeLayout -{ - Tizen::Ui::Control* pBottomRelation; - RectangleEdgeRelation bottomRelationType; - - Tizen::Ui::Control* pLeftRelation; - RectangleEdgeRelation leftRelationType; - - Tizen::Ui::Control* pRightRelation; - RectangleEdgeRelation rightRelationType; - - Tizen::Ui::Control* pTopRelation; - RectangleEdgeRelation topRelationType; - - bool centerHorizontal; - bool centerVertical; - - int height; - FitPolicy verticalFitPolicy; - - int marginBottom; - int marginLeft; - int marginRight; - int marginTop; - - int width; - FitPolicy horizontalFitPolicy; -}; - -struct UiBuilderGridLayoutContainer -{ - int maxColumn; - int maxRow; - int columnSpacing; - int rowSpacing; - bool columnCollapsed; - bool columnShrinkable; - bool columnStretchable; - bool rowCollapsed; - bool rowShrinkable; - bool rowStretchable; -}; - -struct UiBuilderGridLayoutControl -{ - int marginBottom; - int marginLeft; - int marginRight; - int marginTop; - int positionRow; - int positionColumn; - int positionRowSpan; - int positionColumnSpan; - LayoutHorizontalAlignment horizontalAlignment; - LayoutVerticalAlignment verticalAlignment; -}; - -struct UiBuilderHorizontalBoxLayoutContainer -{ - HorizontalDirection direction; -}; - -struct UiBuilderHorizontalBoxLayoutControl -{ - int height; - FitPolicy verticalFitPolicy; - LayoutVerticalAlignment verticalAlignment; - int verticalBottomMargin; - int verticalTopMargin; - int spacing; - float weight; - int width; - FitPolicy horizontalFitPolicy; -}; - -struct UiBuilderVerticalBoxLayoutContainer -{ - VerticalDirection direction; -}; - -struct UiBuilderVerticalBoxLayoutControl -{ - int height; - FitPolicy verticalFitPolicy; - LayoutHorizontalAlignment horizontalAlignment; - int horizontalLeftMargin; - int horizontalRightMargin; - int spacing; - float weight; - int width; - FitPolicy horizontalFitPolicy; -}; - class _UiBuilder; +//class _LayoutMaker; /** * @class _UiBuilderControlMaker * @brief This class is an implementation of a %_UiBuilderControlMaker. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControlMaker Class contains that information for generating a Control and setting a layout information. * @@ -166,30 +69,19 @@ protected: void ConvertStringToColor32(const Tizen::Base::String& colorString, int transparency, Tizen::Graphics::Color& color); void AddControl(_UiBuilderControl* pUiBuilderControl, Tizen::Ui::Control* pControl); void SetUiBuilderRotateState(_UiBuilderScreenRotate rotate); - result SetGridLayoutContainerProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty) const; - void SetGridLayoutControlProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); - void SetHorizontalBoxLayoutProperty(HorizontalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); - void SetVerticalBoxLayoutProperty(VerticalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); - void SetRelativeLayoutProperty(RelativeLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl); - void SetLayoutProperty(_UiBuilderControl* pUiBuilderControl, Control* pControl); void SetLayoutOrientation(_UiBuilderControl* pUiBuilderCOntrol, Tizen::Ui::Control* pControl); void GetProperty(_UiBuilderControl* pControl, _UiBuilderControlLayout** pControlProperty) const; - bool GetLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& layoutType) const; - bool GetParentLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const; - result GetGridLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; - result GetHorizontalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; - result GetVerticalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; - result GetRelativeLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const; _UiBuilderScreenRotate GetUiBuilderRotateState(void); - result GetLayoutN(_UiBuilderControl* pUiBuilderControl, Layout*& pPortraitLayout, Layout*& pLandscapeLayout) const ; Tizen::Graphics::_ICoordinateSystemTransformer* GetTransformer(void) const; private: _UiBuilderControlMaker(const _UiBuilderControlMaker& rhs); _UiBuilderControlMaker& operator =(const _UiBuilderControlMaker& rhs); - +protected: + std::unique_ptr<_LayoutMaker>__pLayoutMaker; private: _UiBuilder* __pUiBuilder; + }; // _UiBuilderControlMaker } } // Tizen::Ui diff --git a/src/ui/inc/FUi_UiBuilderControlTable.h b/src/ui/inc/FUi_UiBuilderControlTable.h index 2ad0261..3168485 100644 --- a/src/ui/inc/FUi_UiBuilderControlTable.h +++ b/src/ui/inc/FUi_UiBuilderControlTable.h @@ -34,7 +34,7 @@ typedef _UiBuilderControlMaker* (*_UiBuilderControlMakerFunctionPointer)(_UiBuil /** * @class _UiBuilderControlMakerTable * @brief This class is an implementation of a %_UiBuilderControlMakerTable. -* @since 2.0 +* @since 2.1 * * The %_UiBuilderControlTable Class contains that information for controls' maker. * diff --git a/src/ui/inc/FUi_UiBuilderRegister.h b/src/ui/inc/FUi_UiBuilderRegister.h index acf571c..5c16301 100644 --- a/src/ui/inc/FUi_UiBuilderRegister.h +++ b/src/ui/inc/FUi_UiBuilderRegister.h @@ -31,9 +31,9 @@ namespace Tizen { namespace Ui { namespace Controls /** * @class _FormRegister * @brief This class is an implementation of a %_FormRegister. -* @since 2.0 +* @since 2.1 * -* The %_FormRegister Class contains that declaration of Form's maker +* The %_FormRegister Class contains the declaration of Form's maker * * */ @@ -48,9 +48,9 @@ public: /** * @class _CheckButtonRegister * @brief This class is an implementation of a %_CheckButtonRegister. -* @since 2.0 +* @since 2.1 * -* The %_CheckButtonRegister Class contains that declaration of CheckButton's maker +* The %_CheckButtonRegister Class contains the declaration of CheckButton's maker * * */ @@ -65,9 +65,9 @@ public: /** * @class _ButtonRegister * @brief This class is an implementation of a %_ButtonRegister. -* @since 2.0 +* @since 2.1 * -* The %_ButtonRegister Class contains that declaration of Button's maker +* The %_ButtonRegister Class contains the declaration of Button's maker * * */ @@ -82,9 +82,9 @@ public: /** * @class _SliderRegister * @brief This class is an implementation of a %_SliderRegister. -* @since 2.0 +* @since 2.1 * -* The %_SliderRegister Class contains that declaration of Slider's maker +* The %_SliderRegister Class contains the declaration of Slider's maker * * */ @@ -99,9 +99,9 @@ public: /** * @class _SlidableListRegister * @brief This class is an implementation of a %_SlidableListRegister. -* @since 2.0 +* @since 2.1 * -* The %_SlidableListRegister Class contains that declaration of SlidableList's maker +* The %_SlidableListRegister Class contains the declaration of SlidableList's maker * * */ @@ -116,9 +116,9 @@ public: /** * @class _SlidableGroupedListRegister * @brief This class is an implementation of a %_SlidableGroupedListRegister. -* @since 2.0 +* @since 2.1 * -* The %_SlidableGroupedListRegister Class contains that declaration of SlidableGroupedList's maker +* The %_SlidableGroupedListRegister Class contains the declaration of SlidableGroupedList's maker * * */ @@ -133,9 +133,9 @@ public: /** * @class _ScrollPanelRegister * @brief This class is an implementation of a %_ScrollPanelRegister. -* @since 2.0 +* @since 2.1 * -* The %_ScrollPanelRegister Class contains that declaration of ScrollPanel's maker +* The %_ScrollPanelRegister Class contains the declaration of ScrollPanel's maker * * */ @@ -150,9 +150,9 @@ public: /** * @class _TableViewRegister * @brief This class is an implementation of a %_TableViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_TableViewRegister Class contains that declaration of TableView's maker +* The %_TableViewRegister Class contains the declaration of TableView's maker * * */ @@ -167,9 +167,9 @@ public: /** * @class _GroupedTableViewRegister * @brief This class is an implementation of a %_GroupedTableViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_GroupedTableViewRegister Class contains that declaration of GroupedTableView's maker +* The %_GroupedTableViewRegister Class contains the declaration of GroupedTableView's maker * * */ @@ -184,9 +184,9 @@ public: /** * @class _SectionTableViewRegister * @brief This class is an implementation of a %_SectionTableViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_SectionTableViewRegister Class contains that declaration of SectionTableView's maker +* The %_SectionTableViewRegister Class contains the declaration of SectionTableView's maker * * */ @@ -201,9 +201,9 @@ public: /** * @class _ProgressRegister * @brief This class is an implementation of a %_ProgressRegister. -* @since 2.0 +* @since 2.1 * -* The %_ProgressRegister Class contains that declaration of Progress's maker +* The %_ProgressRegister Class contains the declaration of Progress's maker * * */ @@ -218,9 +218,9 @@ public: /** * @class _PopupRegister * @brief This class is an implementation of a %_PopupRegister. -* @since 2.0 +* @since 2.1 * -* The %_PopupRegister Class contains that declaration of Popup's maker +* The %_PopupRegister Class contains the declaration of Popup's maker * * */ @@ -235,9 +235,9 @@ public: /** * @class _PanelRegister * @brief This class is an implementation of a %_PanelRegister. -* @since 2.0 +* @since 2.1 * -* The %_PanelRegister Class contains that declaration of Panel's maker +* The %_PanelRegister Class contains the declaration of Panel's maker * * */ @@ -252,9 +252,9 @@ public: /** * @class _OverlayPanelRegister * @brief This class is an implementation of a %_OverlayPanelRegister. -* @since 2.0 +* @since 2.1 * -* The %_OverlayPanelRegister Class contains that declaration of OverlayPanel's maker +* The %_OverlayPanelRegister Class contains the declaration of OverlayPanel's maker * * */ @@ -269,9 +269,9 @@ public: /** * @class _ListRegister * @brief This class is an implementation of a %_ListRegister. -* @since 2.0 +* @since 2.1 * -* The %_ListRegister Class contains that declaration of List's maker +* The %_ListRegister Class contains the declaration of List's maker * * */ @@ -286,9 +286,9 @@ public: /** * @class _LabelRegister * @brief This class is an implementation of a %_LabelRegister. -* @since 2.0 +* @since 2.1 * -* The %_LabelRegister Class contains that declaration of Label's maker +* The %_LabelRegister Class contains the declaration of Label's maker * * */ @@ -303,9 +303,9 @@ public: /** * @class _IconListRegister * @brief This class is an implementation of a %_IconListRegister. -* @since 2.0 +* @since 2.1 * -* The %_IconListRegister Class contains that declaration of IconList's maker +* The %_IconListRegister Class contains the declaration of IconList's maker * * */ @@ -320,9 +320,9 @@ public: /** * @class _GroupedListRegister * @brief This class is an implementation of a %_GroupedListRegister. -* @since 2.0 +* @since 2.1 * -* The %_GroupedListRegister Class contains that declaration of GroupedList's maker +* The %_GroupedListRegister Class contains the declaration of GroupedList's maker * * */ @@ -337,9 +337,9 @@ public: /** * @class _FlashRegister * @brief This class is an implementation of a %_FlashRegister. -* @since 2.0 +* @since 2.1 * -* The %_FlashRegister Class contains that declaration of Flash's maker +* The %_FlashRegister Class contains the declaration of Flash's maker * * */ @@ -354,9 +354,9 @@ public: /** * @class _ExpandableListRegister * @brief This class is an implementation of a %_ExpandableListRegister. -* @since 2.0 +* @since 2.1 * -* The %_ExpandableListRegister Class contains that declaration of ExpandableList's maker +* The %_ExpandableListRegister Class contains the declaration of ExpandableList's maker * * */ @@ -371,9 +371,9 @@ public: /** * @class _EditTimeRegister * @brief This class is an implementation of a %_EditTimeRegister. -* @since 2.0 +* @since 2.1 * -* The %_EditTimeRegister Class contains that declaration of EditTime's maker +* The %_EditTimeRegister Class contains the declaration of EditTime's maker * * */ @@ -388,9 +388,9 @@ public: /** * @class _EditFieldRegister * @brief This class is an implementation of a %_EditFieldRegister. -* @since 2.0 +* @since 2.1 * -* The %_EditFieldRegister Class contains that declaration of EditField's maker +* The %_EditFieldRegister Class contains the declaration of EditField's maker * * */ @@ -405,9 +405,9 @@ public: /** * @class _EditDateRegister * @brief This class is an implementation of a %_EditDateRegister. -* @since 2.0 +* @since 2.1 * -* The %_EditDateRegister Class contains that declaration of EditDate's maker +* The %_EditDateRegister Class contains the declaration of EditDate's maker * * */ @@ -422,9 +422,9 @@ public: /** * @class _EditAreaRegister * @brief This class is an implementation of a %_EditAreaRegister. -* @since 2.0 +* @since 2.1 * -* The %_EditAreaRegister Class contains that declaration of EditArea's maker +* The %_EditAreaRegister Class contains the declaration of EditArea's maker * * */ @@ -439,9 +439,9 @@ public: /** * @class _CustomListRegister * @brief This class is an implementation of a %_CustomListRegister. -* @since 2.0 +* @since 2.1 * -* The %_CustomListRegister Class contains that declaration of CustomList's maker +* The %_CustomListRegister Class contains the declaration of CustomList's maker * * */ @@ -456,9 +456,9 @@ public: /** * @class _ColorPickerRegister * @brief This class is an implementation of a %_ColorPickerRegister. -* @since 2.0 +* @since 2.1 * -* The %_ColorPickerRegister Class contains that declaration of ColorPicker's maker +* The %_ColorPickerRegister Class contains the declaration of ColorPicker's maker * * */ @@ -473,9 +473,9 @@ public: /** * @class _TabBarRegister * @brief This class is an implementation of a %_TabBarRegister. -* @since 2.0 +* @since 2.1 * -* The %_TabBarRegister Class contains that declaration of TabBar's maker +* The %_TabBarRegister Class contains the declaration of TabBar's maker * * */ @@ -490,9 +490,9 @@ public: /** * @class _HeaderRegister * @brief This class is an implementation of a %_HeaderRegister. -* @since 2.0 +* @since 2.1 * -* The %_HeaderRegister Class contains that declaration of Header's maker +* The %_HeaderRegister Class contains the declaration of Header's maker * * */ @@ -507,9 +507,9 @@ public: /** * @class _FooterRegister * @brief This class is an implementation of a %_FooterRegister. -* @since 2.0 +* @since 2.1 * -* The %_FooterRegister Class contains that declaration of Footer's maker +* The %_FooterRegister Class contains the declaration of Footer's maker * * */ @@ -524,9 +524,9 @@ public: /** * @class _GalleryRegister * @brief This class is an implementation of a %_GalleryRegister. -* @since 2.0 +* @since 2.1 * -* The %_GalleryRegister Class contains that declaration of Gallery's maker +* The %_GalleryRegister Class contains the declaration of Gallery's maker * * */ @@ -541,9 +541,9 @@ public: /** * @class _IconListViewRegister * @brief This class is an implementation of a %_IconListViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_IconListViewRegister Class contains that declaration of IconListView's maker +* The %_IconListViewRegister Class contains the declaration of IconListView's maker * * */ @@ -558,9 +558,9 @@ public: /** * @class _ListViewRegister * @brief This class is an implementation of a %_ListViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_ListViewRegister Class contains that declaration of ListView's maker +* The %_ListViewRegister Class contains the declaration of ListView's maker * * */ @@ -575,9 +575,9 @@ public: /** * @class _GroupedListViewRegister * @brief This class is an implementation of a %_GroupedListViewRegister. -* @since 2.0 +* @since 2.1 * -* The %_GroupedListViewRegister Class contains that declaration of GroupedListView's maker +* The %_GroupedListViewRegister Class contains the declaration of GroupedListView's maker * * */ @@ -592,9 +592,9 @@ public: /** * @class _ExpandableEditAreaRegister * @brief This class is an implementation of a %_ExpandableEditAreaRegister. -* @since 2.0 +* @since 2.1 * -* The %_ExpandableEditAreaRegister Class contains that declaration of ExpandableEditArea's maker +* The %_ExpandableEditAreaRegister Class contains the declaration of ExpandableEditArea's maker * * */ @@ -609,9 +609,9 @@ public: /** * @class _SearchBarRegister * @brief This class is an implementation of a %_SearchBarRegister. -* @since 2.0 +* @since 2.1 * -* The %_SearchBarRegister Class contains that declaration of SearchBar's maker +* The %_SearchBarRegister Class contains the declaration of SearchBar's maker * * */ @@ -626,9 +626,9 @@ public: /** * @class _TextBoxRegister * @brief This class is an implementation of a %_TextBoxRegister. -* @since 2.0 +* @since 2.1 * -* The %_TextBoxRegister Class contains that declaration of TextBox's maker +* The %_TextBoxRegister Class contains the declaration of TextBox's maker * * */ @@ -643,9 +643,9 @@ public: /** * @class _MapRegister * @brief This class is an implementation of a %_MapRegister. -* @since 2.0 +* @since 2.1 * -* The %_MapRegister Class contains that declaration of Map's maker +* The %_MapRegister Class contains the declaration of Map's maker * * */ @@ -660,9 +660,9 @@ public: /** * @class _WebRegister * @brief This class is an implementation of a %_WebRegister. -* @since 2.0 +* @since 2.1 * -* The %_WebRegister Class contains that declaration of Web's maker +* The %_WebRegister Class contains the declaration of Web's maker * * */ @@ -677,9 +677,9 @@ public: /** * @class _AdRegister * @brief This class is an implementation of a %_AdRegister. -* @since 2.0 +* @since 2.1 * -* The %_AdRegister Class contains that declaration of Ad's maker +* The %_AdRegister Class contains the declaration of Ad's maker * * */ @@ -694,9 +694,9 @@ public: /** * @class _SplitPanel * @brief This class is an implementation of a %_SplitPanel. -* @since 2.0 +* @since 2.1 * -* The %_SplitPanel Class contains that declaration of SplitPanel's maker +* The %_SplitPanel Class contains the declaration of SplitPanel's maker * * */ @@ -711,9 +711,9 @@ public: /** * @class _NotificationFrame * @brief This class is an implementation of a %_NotificationFrame. -* @since 2.0 +* @since 2.1 * -* The %_NotificationFrame Class contains that declaration of NotificationFrame maker +* The %_NotificationFrame Class contains the declaration of NotificationFrame maker * * */ @@ -728,9 +728,9 @@ public: /** * @class _QuickPanelFrame * @brief This class is an implementation of a %_QuickPanelFrame. -* @since 2.0 +* @since 2.1 * -* The %_QuickPanelFrame Class contains that declaration of QuickPanelFrame maker +* The %_QuickPanelFrame Class contains the declaration of QuickPanelFrame maker * * */ @@ -742,5 +742,23 @@ public: virtual ~_QuickPanelFrameRegister(void); }; // _QuickPanelFrameRegister +/** +* @class _GroupContainerRegister +* @brief This class is an implementation of a %_GroupContainerRegister. +* @since 2.1 +* +* The %_GroupContainerRegister Class contains the declaration of GroupContainer's maker +* +* +*/ +class _GroupContainerRegister + : public Tizen::Base::Object +{ +public: + _GroupContainerRegister(void); + virtual ~_GroupContainerRegister(void); +}; // _GroupContainerRegister + + } } } // Tizen::Ui::Controls #endif // _FUI_INTERNAL_UI_BUILDER_REGISTER_H_ diff --git a/src/ui/inc/FUi_UiBuilderXmlHandler.h b/src/ui/inc/FUi_UiBuilderXmlHandler.h index 8ef1b67..d48e5bb 100644 --- a/src/ui/inc/FUi_UiBuilderXmlHandler.h +++ b/src/ui/inc/FUi_UiBuilderXmlHandler.h @@ -36,7 +36,7 @@ namespace Tizen { namespace Ui /** * @class _UiBuilderXmlHandler * @brief This class is an implementation of a %_UiBuilderXmlHandler. -* @since 2.0 +* @since 2.1 * * The %_UiBuilerXmlHandler Class contains that control's information by parsing the XML. * diff --git a/src/ui/inc/FUi_UiEvent.h b/src/ui/inc/FUi_UiEvent.h old mode 100644 new mode 100755 index 179d995..06ef530 --- a/src/ui/inc/FUi_UiEvent.h +++ b/src/ui/inc/FUi_UiEvent.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -87,8 +87,10 @@ public: void SetAccessibilityEvent(bool set); bool GetAccessibilityEvent(void) const; +protected: + virtual bool IsEventEnabled(const _Control& control) const; + private: - virtual bool IsEventReceivable(const _Control& control) const; virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered) = 0; virtual result OnEventProcessing(const _Control& control, bool& isFiltered) = 0; virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered) = 0; diff --git a/src/ui/inc/FUi_UiEventManager.h b/src/ui/inc/FUi_UiEventManager.h index 9aab001..ca19229 100644 --- a/src/ui/inc/FUi_UiEventManager.h +++ b/src/ui/inc/FUi_UiEventManager.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_UiEventTypes.h b/src/ui/inc/FUi_UiEventTypes.h index 67f53e7..3b1fe43 100644 --- a/src/ui/inc/FUi_UiEventTypes.h +++ b/src/ui/inc/FUi_UiEventTypes.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_UiFocusEvent.h b/src/ui/inc/FUi_UiFocusEvent.h index 6ac95d6..f7fbc63 100644 --- a/src/ui/inc/FUi_UiFocusEvent.h +++ b/src/ui/inc/FUi_UiFocusEvent.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. diff --git a/src/ui/inc/FUi_UiKeyEvent.h b/src/ui/inc/FUi_UiKeyEvent.h index f080302..4bf7774 100644 --- a/src/ui/inc/FUi_UiKeyEvent.h +++ b/src/ui/inc/FUi_UiKeyEvent.h @@ -452,7 +452,374 @@ enum _KeyCode */ _KEY_DELETE = KEY_DELETE, - _KEY_CTRL_L = KEY_HARDWARE_MAX, + /** + * The apostrophe key + */ + _KEY_APOSTROPHE = KEY_APOSTROPHE, + + /** + * The backslash key + */ + _KEY_BACKSLASH = KEY_BACKSLASH, + + /** + * The end key + */ + _KEY_END_BUTTON = KEY_MOVE_END, + + /** + * The equal key + */ + _KEY_EQUAL = KEY_EQUAL, + + /** + * The esc key + */ + _KEY_ESC = KEY_ESC, + + /** + * The function 10 key + */ + _KEY_FN_10 = KEY_FN_10, + + /** + * The function 11 key + */ + _KEY_FN_11 = KEY_FN_11, + + /** + * The function 12 key + */ + _KEY_FN_12 = KEY_FN_12, + + /** + * The function 6 key + */ + _KEY_FN_6 = KEY_FN_6, + + /** + * The function 7 key + */ + _KEY_FN_7 = KEY_FN_7, + + /** + * The function 8 key + */ + _KEY_FN_8 = KEY_FN_8, + + /** + * The function 9 key + */ + _KEY_FN_9 = KEY_FN_9, + + /** + * The grave key + */ + _KEY_GRAVE = KEY_GRAVE, + + /** + * The home key + */ + _KEY_HOME_BUTTON = KEY_MOVE_HOME, + + /** + * The insert key + */ + _KEY_INSERT = KEY_INSERT, + + /** + * The left alt key + */ + _KEY_LALT = KEY_LEFT_ALT, + + /** + * The left bracket key + */ + _KEY_LBRACKET = KEY_LEFT_BRACKET, + + /** + * The left control key + */ + _KEY_LCTRL = KEY_LEFT_CTRL, + + /** + * The left shift key + */ + _KEY_LSHIFT = KEY_LEFT_SHIFT, + + /** + * The left window key + */ + _KEY_LWIN = KEY_LEFT_WIN, + + /** + * The menu key + */ + _KEY_MENU_BUTTON = KEY_CONTEXT_MENU, + + /** + * The minus key + */ + _KEY_MINUS = KEY_MINUS, + + /** + * The number lock key + */ + _KEY_NUM_LOCK = KEY_NUM_LOCK, + + /** + * The Keypad 0 key + */ + _KEY_NUMPAD_0 = KEY_NUMPAD_0, + + /** + * The Keypad 1 key + */ + _KEY_NUMPAD_1 = KEY_NUMPAD_1, + + /** + * The Keypad 2 key + */ + _KEY_NUMPAD_2 = KEY_NUMPAD_2, + + /** + * The Keypad 3 key + */ + _KEY_NUMPAD_3 = KEY_NUMPAD_3, + + /** + * The Keypad 4 key + */ + _KEY_NUMPAD_4 = KEY_NUMPAD_4, + + /** + * The Keypad 5 key + */ + _KEY_NUMPAD_5 = KEY_NUMPAD_5, + + /** + * The Keypad 6 key + */ + _KEY_NUMPAD_6 = KEY_NUMPAD_6, + + /** + * The Keypad 6 key + */ + _KEY_NUMPAD_7 = KEY_NUMPAD_7, + + /** + * The Keypad 8 key + */ + _KEY_NUMPAD_8 = KEY_NUMPAD_8, + + /** + * The Keypad 9 key + */ + _KEY_NUMPAD_9 = KEY_NUMPAD_9, + + /** + * The Keypad add key + */ + _KEY_NUMPAD_ADD = KEY_NUMPAD_ADD, + + /** + * The Keypad divide key + */ + _KEY_NUMPAD_DIVIDE = KEY_NUMPAD_DIVIDE, + + /** + * The Keypad divide key + */ + _KEY_NUMPAD_DOT = KEY_NUMPAD_DOT, + + /** + * The Keypad enter key + */ + _KEY_NUMPAD_ENTER = KEY_NUMPAD_ENTER, + + /** + * The Keypad multiply key + */ + _KEY_NUMPAD_MULTIPLY = KEY_NUMPAD_MULTIPLY, + + /** + * The Keypad subtract key + */ + _KEY_NUMPAD_SUBTRACT = KEY_NUMPAD_SUBTRACT, + + /** + * The page down key + */ + _KEY_PAGE_DOWN = KEY_PAGE_DOWN, + + /** + * The page up key + */ + _KEY_PAGE_UP = KEY_PAGE_UP, + + /** + * The pause key + */ + _KEY_PAUSEBREAK= KEY_PAUSE_BREAK, + + /** + * The print key + */ + _KEY_PRINT = KEY_PRINT, + + /** + * The right alt key + */ + _KEY_RALT = KEY_RIGHT_ALT, + + /** + * The right bracket key + */ + _KEY_RBRACKET = KEY_RIGHT_BRACKET, + + /** + * The right control key + */ + _KEY_RCTRL = KEY_RIGHT_CTRL, + + /** + * The right shift key + */ + _KEY_RSHIFT = KEY_RIGHT_SHIFT, + + /** + * The right window key + */ + _KEY_RWIN = KEY_RIGHT_WIN, + + /** + * The scroll lock key + */ + _KEY_SCROLL_LOCK = KEY_SCROLL_LOCK, + + /** + * The semicolon key + */ + _KEY_SEMICOLON = KEY_SEMICOLON, + + /** + * The slash key + */ + _KEY_SLASH = KEY_SLASH, + + /** + * tab key + */ + _KEY_TAB = KEY_TAB, + + /** + * The oem 1 key + */ + _KEY_OEM_1 = KEY_OEM_1, + + /** + * The oem 2 key + */ + _KEY_OEM_2 = KEY_OEM_2, + + /** + * The oem 3 key + */ + _KEY_OEM_3 = KEY_OEM_3, + + /** + * The oem 4 key + */ + _KEY_OEM_4 = KEY_OEM_4, + + /** + * The oem 5 key + */ + _KEY_OEM_5 = KEY_OEM_5, + + /** + * The oem 6 key + */ + _KEY_OEM_6 = KEY_OEM_6, + + /** + * The oem 7 key + */ + _KEY_OEM_7 = KEY_OEM_7, + + /** + * The oem 8 key + */ + _KEY_OEM_8 = KEY_OEM_8, + + /** + * The oem 9 key + */ + _KEY_OEM_9 = KEY_OEM_9, + + /** + * The oem 10 key + */ + _KEY_OEM_10 = KEY_OEM_10, + + /** + * The oem 11 key + */ + _KEY_OEM_11 = KEY_OEM_11, + + /** + * The oem 12 key + */ + _KEY_OEM_12 = KEY_OEM_12, + + /** + * The oem 13 key + */ + _KEY_OEM_13 = KEY_OEM_13, + + /** + * The oem 14 key + */ + _KEY_OEM_14 = KEY_OEM_14, + + /** + * The oem 15 key + */ + _KEY_OEM_15 = KEY_OEM_15, + + /** + * The oem 16 key + */ + _KEY_OEM_16 = KEY_OEM_16, + + /** + * The oem 17 key + */ + _KEY_OEM_17 = KEY_OEM_17, + + /** + * The oem 18 key + */ + _KEY_OEM_18 = KEY_OEM_18, + + /** + * The oem 19 key + */ + _KEY_OEM_19 = KEY_OEM_19, + + /** + * The oem 20 key + */ + _KEY_OEM_20 = KEY_OEM_20, + + _KEY_HARDWARE_MAX = KEY_HARDWARE_MAX, + + /** + * The stop key internal only + */ + _KEY_STOP, + + _KEY_CTRL_L, _KEY_CTRL_R, @@ -468,7 +835,6 @@ enum _KeyCode _KEY_NUM_DOWN, - _KEY_HARDWARE_MAX, /** * internal Key - end */ @@ -571,6 +937,7 @@ private: private: virtual _UiKeyEvent* CloneN(void) const; virtual _UiEventType GetEventType(void) const; + virtual bool IsEventEnabled(const _Control& control) const; virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered); virtual result OnEventProcessing(const _Control& control, bool& isFiltered); virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered); diff --git a/src/ui/inc/FUi_UiManagerIpcMessages.h b/src/ui/inc/FUi_UiManagerIpcMessages.h new file mode 100644 index 0000000..b868cdb --- /dev/null +++ b/src/ui/inc/FUi_UiManagerIpcMessages.h @@ -0,0 +1,29 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_UiManagerIpcMessages.h + * @brief This is the header file for the UiManager Ipc message types. + */ + +#include "ipc/ipc_message_macros.h" +#include "FIo_IpcCommonParamTraits.h" +#include "FIo_IpcMessageStart.h" + +#define IPC_MESSAGE_START UiManagerServiceStart + +IPC_SYNC_MESSAGE_CONTROL2_1(UiManager_SetZOrderGroup, unsigned int, int, result) diff --git a/src/ui/inc/FUi_UiNotificationEvent.h b/src/ui/inc/FUi_UiNotificationEvent.h old mode 100644 new mode 100755 index 742e7b6..63b1454 --- a/src/ui/inc/FUi_UiNotificationEvent.h +++ b/src/ui/inc/FUi_UiNotificationEvent.h @@ -2,14 +2,14 @@ // Open Service Platform // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. // -// Licensed under the Flora License, Version 1.0 (the License); +// Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://floralicense.org/license/ +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -69,7 +69,7 @@ public: private: virtual _UiNotificationEvent* CloneN(void) const; virtual _UiEventType GetEventType(void) const; - virtual bool IsEventReceivable(const _Control& control) const; + virtual bool IsEventEnabled(const _Control& control) const; virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered); virtual result OnEventProcessing(const _Control& control, bool& isFiltered); virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered); diff --git a/src/ui/inc/FUi_UiTouchEvent.h b/src/ui/inc/FUi_UiTouchEvent.h index bc4656e..4653cf2 100644 --- a/src/ui/inc/FUi_UiTouchEvent.h +++ b/src/ui/inc/FUi_UiTouchEvent.h @@ -50,6 +50,7 @@ class _OSP_EXPORT_ _TouchInfo public: _TouchInfo(void); _TouchInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::Point& current, const bool isFlick, long long timeStamp); + _TouchInfo(unsigned long pointId, _TouchStatus status, const Tizen::Graphics::FloatPoint& current, const bool isFlick, long long timeStamp); _TouchInfo(const _TouchInfo& rhs); _TouchInfo& operator =(const _TouchInfo& rhs); ~_TouchInfo(void); @@ -69,7 +70,7 @@ public: * @since 2.0 * @return The current position of the touch event */ - Tizen::Graphics::Point GetCurrentPosition(void) const; + Tizen::Graphics::FloatPoint GetCurrentPosition(void) const; /** * This method returns the touch pointId. @@ -82,11 +83,12 @@ public: bool IsFlicked(void) const; long long GetTimeStamp(void) const; void SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::Point& current, bool isFlick, long long timeStamp); + void SetTouchInfo(unsigned long pointId, _TouchStatus status, Tizen::Graphics::FloatPoint& current, bool isFlick, long long timeStamp); private: unsigned long __pointId; _TouchStatus __touchStatus; - Tizen::Graphics::Point __currentPosition; + Tizen::Graphics::FloatPoint __currentPosition; bool __isFlicked; long long __timeStamp; }; // _TouchInfo @@ -127,6 +129,7 @@ public: private: virtual _UiTouchEvent* CloneN(void) const; virtual _UiEventType GetEventType(void) const; + virtual bool IsEventEnabled(const _Control& control) const; virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered); virtual result OnEventProcessing(const _Control& control, bool& isFiltered); virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered); @@ -136,13 +139,13 @@ private: result ProcessGesture(const _Control& control, bool& isFiltered); result FireListener(const _ITouchEventListener* pListener, const _Control* pControl, bool isTouchEvent, bool& isFiltered); result FirePreviewListener(const _ITouchEventPreviewer* pListener, const _Control* pControl, bool& isFiltered); - Tizen::Graphics::Point GetRelativePoint(const _Control& control, const Tizen::Graphics::Point& point) const; + Tizen::Graphics::FloatPoint GetRelativePoint(const _Control& control, const Tizen::Graphics::FloatPoint& point) const; result ResetTouchInfo(const _Control* pControl, const _TouchInfo& touchInfo); bool ExistGlobalGesture(void); private: _TouchInfo __touchInfo; - std::tr1::shared_ptr > __pForcedGestureList; + std::tr1::shared_ptr > __pForcedControlList; }; // _UiTouchEvent }} // Tizen::Ui diff --git a/src/ui/inc/FUi_VariantImpl.h b/src/ui/inc/FUi_VariantImpl.h index ca6e98b..044000e 100644 --- a/src/ui/inc/FUi_VariantImpl.h +++ b/src/ui/inc/FUi_VariantImpl.h @@ -49,6 +49,8 @@ typedef union Tizen::Graphics::Dimension* pDimension; Tizen::Graphics::FloatDimension* pFloatDimension; Tizen::Graphics::FloatMatrix4* pFloatMatrix4; + Tizen::Graphics::FloatPoint3* pFloatPoint3; + Tizen::Graphics::FloatVector4* pFloatVector4; } VariantData; class _VariantImpl diff --git a/src/ui/inc/FUi_Window.h b/src/ui/inc/FUi_Window.h index aca6e24..8ff6156 100644 --- a/src/ui/inc/FUi_Window.h +++ b/src/ui/inc/FUi_Window.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_Window.h * @brief This is the header file for the _Window class. @@ -29,10 +30,8 @@ namespace Tizen { namespace Ui { namespace Animations { class DisplayContext; -// #if defined(MULTI_WINDOW) class _RootVisualElement; class _NativeLayer; -// #endif }}} // Tizen::Ui::Animations namespace Tizen { namespace Ui @@ -46,6 +45,7 @@ public: virtual void OnActivated(void) = 0; virtual void OnNativeWindowActivated(void) = 0; virtual void OnDeactivated(void) = 0; + virtual void OnOwnerChanged(_Control* pOldOwner) = 0; }; // _IWindowDelegate class _OSP_EXPORT_ _Window // Temp: export only for test @@ -69,35 +69,31 @@ public: void Close(void); _Control* GetOwner(void) const; void SetOwner(_Control* pOwner); -#if defined(MULTI_WINDOW) result CreateRootVisualElement(void); virtual result CreateLayer(void); -#endif - virtual bool IsFocusableDescendant(const _Control* pFocus) const; + virtual bool IsLayoutChangable(void) const; // Callbacks virtual void OnActivated(void); virtual void OnNativeWindowActivated(void); virtual void OnDeactivated(void); + virtual void OnOwnerChanged(_Control* pOldOwner); virtual void OnVisibleStateChanged(void); virtual bool OnNotifiedN(const Tizen::Ui::_Control& source, Tizen::Base::Collection::IList* pArgs); -#if defined(MULTI_WINDOW) virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); virtual result OnAttachingToMainTree(const _Control* pParent); virtual result OnDetachingFromMainTree(void); - virtual bool IsLayoutChangable(void) const; -#endif - -#if defined(MULTI_WINDOW) void SetActivationEnabled(bool enable); bool IsActivationEnabled(void); - Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const; -#else - virtual Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const; +#if defined(ROTATION_SYNC) + void SetOrientationEnabled(bool enable); + bool IsOrientationEnabled(void); #endif + + Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const; NativeWindowHandle GetNativeHandle(void) const; // Internal: Only necessary for implementing _Window. Never override this callback except for _Window. @@ -113,9 +109,8 @@ protected: _IWindowDelegate& GetWindowDelegate(void) const; virtual Tizen::Base::String GetDescription(void) const; -#if defined(MULTI_WINDOW) void SetRootVisualElement(const Tizen::Ui::Animations::_RootVisualElement& rootVisualElement); -#endif + void SetLayer(const Tizen::Ui::Animations::_NativeLayer& layer); void SetSystemWindow(bool systemWindow); @@ -140,6 +135,10 @@ private: bool __systemWindow; bool __isOpened; bool __isInitialized; +#if defined(ROTATION_SYNC) + bool __orientationEnabled; +#endif + bool __transient; friend class _ControlManager; }; // _Window diff --git a/src/ui/inc/FUi_WindowImpl.h b/src/ui/inc/FUi_WindowImpl.h old mode 100644 new mode 100755 index 2d9890e..078df12 --- a/src/ui/inc/FUi_WindowImpl.h +++ b/src/ui/inc/FUi_WindowImpl.h @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_WindowImpl.h * @brief This is the header file for the _WindowImpl class. @@ -44,8 +45,10 @@ public: public: // Life Cycle + virtual result Destroy(void); void Initialize(Window* pPublic, _Window* pCore, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout); static _WindowImpl* CreateWindowImplN(Window* pPublic, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); + static _WindowImpl* CreateWindowImplN(Window* pPublic, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); virtual ~_WindowImpl(void); static _WindowImpl* GetInstance(Window& window); @@ -63,14 +66,9 @@ public: virtual void OnActivated(void); virtual void OnNativeWindowActivated(void); virtual void OnDeactivated(void); - - -#if !defined(MULTI_WINDOW) - virtual void Rotate(_ControlRotation rotation); -#else + virtual void OnOwnerChanged(_Control* pOldOwner); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); virtual void OnRotated(_ControlRotation rotation); -#endif // Operations result Open(bool drawAndShow = true); @@ -80,7 +78,7 @@ public: Tizen::Ui::Animations::DisplayContext* GetDisplayContext(void) const; result SetZOrderGroup(WindowZOrderGroup windowZOrderGroup); - _Control* GetOwner(void) const; + Control* GetOwner(void) const; void SetOwner(Tizen::Ui::Control *pControl); NativeWindowHandle GetNativeHandle(void) const; @@ -88,6 +86,7 @@ public: protected: _WindowImpl(Window* pPublic, _Window* pCore, const Layout* pPublicPortraitLayout = null, const Layout* pPublicLandscapeLayout = null); _WindowImpl(Window* pPublic, _Window* pCore, const Tizen::Graphics::Rectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); + _WindowImpl(Window* pPublic, _Window* pCore, const Tizen::Graphics::FloatRectangle& bounds, const Layout* pPublicPortraitLayout, const Layout* pPublicLandscapeLayout, bool resizable, bool movable); private: _WindowImpl(const _WindowImpl& rhs); _WindowImpl& operator =(const _WindowImpl& rhs); diff --git a/src/ui/layout/FUi_LayoutAbsoluteLayout.cpp b/src/ui/layout/FUi_LayoutAbsoluteLayout.cpp old mode 100644 new mode 100755 index 8a0db1c..f8079cd --- a/src/ui/layout/FUi_LayoutAbsoluteLayout.cpp +++ b/src/ui/layout/FUi_LayoutAbsoluteLayout.cpp @@ -88,7 +88,7 @@ AbsoluteLayout::AddItem(LayoutItem& addItem) } result -AbsoluteLayout::OnLayout(int width, int height, bool layoutUpdating) +AbsoluteLayout::OnLayout(float width, float height, bool layoutUpdating) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid"); @@ -104,7 +104,7 @@ AbsoluteLayout::OnLayout(int width, int height, bool layoutUpdating) return E_INVALID_STATE; } - LayoutRect intendedRect = {0, 0, width, height}; + LayoutRect intendedRect = {0.0f, 0.0f, width, height}; pContainerProxy->ConvertWindowToClientBounds(intendedRect, intendedRect); LayoutRect layoutRect = GetLayoutRect(); diff --git a/src/ui/layout/FUi_LayoutLayout.cpp b/src/ui/layout/FUi_LayoutLayout.cpp old mode 100644 new mode 100755 index 6ed59b8..c9da66d --- a/src/ui/layout/FUi_LayoutLayout.cpp +++ b/src/ui/layout/FUi_LayoutLayout.cpp @@ -50,7 +50,7 @@ Layout::~Layout(void) LayoutItemProxy* pContainerProxy = GetContainerProxy(); if (pContainerProxy != null) { - LayoutContainer* pContainer = dynamic_cast (pContainerProxy->GetItem()); + LayoutContainer* pContainer = static_cast (pContainerProxy->GetItem()); if (pContainer) { pContainer->OnDestroyLayout(*this); @@ -75,7 +75,7 @@ Layout::GetContainerProxy(void) if (__rootLayout == false) { - LayoutContainer* pContainer = dynamic_cast (__pContainerProxy->GetItem()); + LayoutContainer* pContainer = static_cast (__pContainerProxy->GetItem()); if (pContainer == null) { SysLog(NID_UI, "Container is null."); @@ -102,7 +102,7 @@ Layout::GetContainerProxy(void) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LayoutContainer* pResultContainer = dynamic_cast (pItemProxy->GetItem()); + LayoutContainer* pResultContainer = static_cast (pItemProxy->GetItem()); if (pContainer == pResultContainer) { __pContainerProxy = pItemProxy; @@ -408,7 +408,7 @@ Layout::OnDetermine(void) while (pCurNode != null) { LayoutItemProxy* pItemProxy = pCurNode->GetItemProxy(); - LayoutContainer* pCurContainer = dynamic_cast(pItemProxy->GetItem()); + LayoutContainer* pCurContainer = static_cast(pItemProxy->GetItem()); SysTryReturn(NID_UI, pCurContainer != null, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This item is not container."); pCurContainer->GetLayout()->OnDetermine(); @@ -449,7 +449,12 @@ Layout::PartialUpdateLayout(void) LayoutUpdateFlag flag = CheckCurrentFlag(); SysTryReturn(NID_UI, flag != UPDATEFLAG_ERROR, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] CheckCurrentFlag is failed."); - return UpdateLayoutInternal(flag); + result r = UpdateLayoutInternal(flag); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Failed to UpdateLayout.", GetErrorMessage(r)); + r = OnDetermine(); + SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Failed to OnDetermine.", GetErrorMessage(r)); + + return r; } @@ -465,7 +470,7 @@ Layout::OnLayoutTrigger(Layout& layout, bool layoutUpdating) LayoutRect containerRect; pContainerProxy->GetItemWindowRect(containerRect); - LayoutContainer* pContainer = dynamic_cast (pContainerProxy->GetItem()); + LayoutContainer* pContainer = static_cast (pContainerProxy->GetItem()); SysTryReturn(NID_UI, pContainer != null, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Did not set the container."); pContainer->ConvertWindowToClientBounds(containerRect, containerRect); @@ -536,14 +541,10 @@ Layout::UpdateLayoutInternal(LayoutUpdateFlag updateFlag) result Layout::AddItem(LayoutItem& addItem) { - //ClearLastResult(); - result r = CheckItem(addItem); - SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - LayoutItemProxy* pItemProxy = CreateProxy(addItem); SysTryReturn(NID_UI, pItemProxy != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to create proxy of layout item."); - LayoutContainer* pContainer = dynamic_cast (&addItem); + LayoutContainer* pContainer = static_cast (&addItem); if (pContainer != null) { LayoutListNode* pCurNode = pContainer->GetLayoutList()->GetFirstNode(); @@ -567,7 +568,7 @@ Layout::AddItem(LayoutItem& addItem) if (__pProxyList->AddNode(*pItemProxy) == null) { pItemProxy->Destroy(); - r = GetLastResult(); + result r = GetLastResult(); SysTryReturn(NID_UI, false, r, r, "[%s] Failed to add layout item.", GetErrorMessage(r)); } @@ -817,7 +818,7 @@ Layout::SetContainer(LayoutContainer* pContainer) { return E_INVALID_STATE; } - LayoutContainer* pResultContainer = dynamic_cast (pItemProxy->GetItem()); + LayoutContainer* pResultContainer = static_cast (pItemProxy->GetItem()); if (pContainer == pResultContainer) { if (__rootLayout && __pContainerProxy != null) diff --git a/src/ui/layout/FUi_LayoutLayoutContainer.cpp b/src/ui/layout/FUi_LayoutLayoutContainer.cpp index e81c405..6156dd6 100755 --- a/src/ui/layout/FUi_LayoutLayoutContainer.cpp +++ b/src/ui/layout/FUi_LayoutLayoutContainer.cpp @@ -35,7 +35,7 @@ LayoutContainer::LayoutContainer(void) : __pCurrentLayout(null) , __defaultLayoutFlag(false) { - LayoutSize zeroSize = {0, 0}; + LayoutSize zeroSize = {0.0f, 0.0f}; __intendedWindowSize = zeroSize; __pLayoutList = new (std::nothrow) LayoutList(); @@ -129,7 +129,7 @@ CATCH: pLayout->RemoveItem(addItem); } - pRollBackNode = __pLayoutList->GetNextNode(*pCurNode); + pRollBackNode = __pLayoutList->GetNextNode(*pRollBackNode); } return r; } @@ -208,7 +208,7 @@ LayoutContainer::GetIntendedWindowSize() const } result -LayoutContainer::Measure(int width, int height) +LayoutContainer::Measure(float width, float height) { LayoutContainer* pContainer = GetParentContainer(); if (pContainer == null) @@ -242,27 +242,17 @@ LayoutContainer::Measure(int width, int height) return re; } - int measuredWidth = 0; - int measuredHeight = 0; + float measuredWidth = 0; + float measuredHeight = 0; GetMeasuredSize(measuredWidth, measuredHeight); - bool wrapContainer = true; - LayoutRect itemBounds; - pLayout->GetItemBaseRect(*this, itemBounds); + bool contentState = GetContentSizeState(); - if (widthMode == WRAP_CONTENT || heightMode == WRAP_CONTENT) - { - if (measuredWidth != itemBounds.w || measuredHeight != itemBounds.h) - { - wrapContainer = false; - } - } - - if (widthMode == WRAP_CONTENT && wrapContainer) + if (widthMode == WRAP_CONTENT && !contentState) { measuredWidth = width; } - if (heightMode == WRAP_CONTENT && wrapContainer) + if (heightMode == WRAP_CONTENT && !contentState) { measuredHeight = height; } @@ -286,11 +276,11 @@ LayoutContainer::Measure(int width, int height) rect = __pCurrentLayout->GetLayoutRect(); } - if (widthMode == WRAP_CONTENT && wrapContainer) + if (widthMode == WRAP_CONTENT && !contentState) { measuredWidth = rect.w; } - if (heightMode == WRAP_CONTENT && wrapContainer) + if (heightMode == WRAP_CONTENT && !contentState) { measuredHeight = rect.h; } diff --git a/src/ui/layout/FUi_LayoutLayoutItem.cpp b/src/ui/layout/FUi_LayoutLayoutItem.cpp old mode 100644 new mode 100755 index 4cda442..610bf53 --- a/src/ui/layout/FUi_LayoutLayoutItem.cpp +++ b/src/ui/layout/FUi_LayoutLayoutItem.cpp @@ -21,6 +21,8 @@ * This file contains the implementation of LayoutItem class. */ +#include +#include #include "FUi_Control.h" #include "FUi_LayoutLayoutItem.h" #include "FUi_LayoutLayout.h" @@ -31,6 +33,7 @@ namespace Tizen { namespace Ui { namespace _Layout LayoutItem::LayoutItem(void) : __pOuterControl(null) , __pParentContainer(null) + , __contentSizeState(false) { __measuredSize.w = 0; __measuredSize.h = 0; @@ -55,21 +58,21 @@ LayoutItem::SetItemWindowRect(const LayoutRect layoutRect) { SysAssertf(__pOuterControl != null, "Did not set a ILayoutItemHandler."); - Tizen::Graphics::Rectangle rect(layoutRect.x, layoutRect.y, layoutRect.w, layoutRect.h); + Tizen::Graphics::FloatRectangle rect(layoutRect.x, layoutRect.y, layoutRect.w, layoutRect.h); return __pOuterControl->SetItemBounds(rect); } void -LayoutItem::GetItemWindowRect(LayoutRect& LayoutRect) const +LayoutItem::GetItemWindowRect(LayoutRect& layoutRect) const { SysAssertf(__pOuterControl != null, "Did not set a ILayoutItemHandler."); - Tizen::Graphics::Rectangle rect = __pOuterControl->GetItemBounds(); + Tizen::Graphics::FloatRectangle rect = __pOuterControl->GetItemBounds(); - LayoutRect.x = rect.x; - LayoutRect.y = rect.y; - LayoutRect.w = rect.width; - LayoutRect.h = rect.height; + layoutRect.x = rect.x; + layoutRect.y = rect.y; + layoutRect.w = rect.width; + layoutRect.h = rect.height; } void @@ -77,8 +80,8 @@ LayoutItem::ConvertWindowToClientBounds(const LayoutRect windowRect, LayoutRect& { SysAssertf(__pOuterControl != null, "Did not set a ILayoutItemHandler."); - Tizen::Graphics::Dimension size(windowRect.w, windowRect.h); - Tizen::Graphics::Rectangle rect = __pOuterControl->GetItemClientBoundsFromSize(size); + Tizen::Graphics::FloatDimension size(windowRect.w, windowRect.h); + Tizen::Graphics::FloatRectangle rect = __pOuterControl->GetItemClientBoundsFromSize(size); clientRect.x = rect.x; clientRect.y = rect.y; @@ -87,7 +90,7 @@ LayoutItem::ConvertWindowToClientBounds(const LayoutRect windowRect, LayoutRect& } result -LayoutItem::Measure(int width, int height) +LayoutItem::Measure(float width, float height) { LayoutContainer* pContainer = __pParentContainer; if (pContainer == null) @@ -137,16 +140,25 @@ LayoutItem::Measure(int width, int height) LayoutSize containerSize = pContainer->GetIntendedWindowSize(); - int measuredWidth = 0; - int measuredHeight = 0; + float measuredWidth = 0; + float measuredHeight = 0; int wrapContentWidth = 0; int wrapContentHeight = 0; - Tizen::Graphics::Dimension size = __pOuterControl->GetItemContentSize(); + Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize(); - wrapContentWidth = size.width; - wrapContentHeight = size.height; + if (size.width > 0 || size.height > 0) + { + __contentSizeState = true; + wrapContentWidth = size.width; + wrapContentHeight = size.height; + } + else + { + wrapContentWidth = width; + wrapContentHeight = height; + } if (widthMode == NONE_MODE) { @@ -193,8 +205,8 @@ LayoutItem::Measure(int width, int height) LayoutSize minSize; LayoutSize maxSize; - Tizen::Graphics::Dimension controlMinSize = __pOuterControl->GetItemMinimumSize(); - Tizen::Graphics::Dimension controlMaxSize = __pOuterControl->GetItemMaximumSize(); + Tizen::Graphics::FloatDimension controlMinSize = __pOuterControl->GetItemMinimumSize(); + Tizen::Graphics::FloatDimension controlMaxSize = __pOuterControl->GetItemMaximumSize(); minSize.w = controlMinSize.width; minSize.h = controlMinSize.height; @@ -226,7 +238,7 @@ LayoutItem::Measure(int width, int height) } void -LayoutItem::RunItemMeasure(int& width, int& height) +LayoutItem::RunItemMeasure(float& width, float& height) { __pOuterControl->OnItemMeasure(width, height); } @@ -253,14 +265,14 @@ LayoutItem::GetParentContainer(void) const } void -LayoutItem::SetMeasuredSize(int width, int height) +LayoutItem::SetMeasuredSize(float width, float height) { __measuredSize.w = width; __measuredSize.h = height; } void -LayoutItem::GetMeasuredSize(int& width, int& height) const +LayoutItem::GetMeasuredSize(float& width, float& height) const { width = __measuredSize.w; height = __measuredSize.h; @@ -270,7 +282,7 @@ void LayoutItem::GetMinSize(LayoutSize& minSize) const { SysAssertf(__pOuterControl != null, "Did not set a ILayoutItemHandler."); - Tizen::Graphics::Dimension controlMinSize = __pOuterControl->GetItemMinimumSize(); + Tizen::Graphics::FloatDimension controlMinSize = __pOuterControl->GetItemMinimumSize(); minSize.w = controlMinSize.width; minSize.h = controlMinSize.height; @@ -280,7 +292,7 @@ void LayoutItem::GetMaxSize(LayoutSize& maxSize) const { SysAssertf(__pOuterControl != null, "Did not set a ILayoutItemHandler."); - Tizen::Graphics::Dimension controlMaxSize = __pOuterControl->GetItemMaximumSize(); + Tizen::Graphics::FloatDimension controlMaxSize = __pOuterControl->GetItemMaximumSize(); maxSize.w = controlMaxSize.width; maxSize.h = controlMaxSize.height; @@ -310,4 +322,10 @@ LayoutItem::OnChangeBaseRect(void) return pLayout->SetItemBaseRect(*this, rect); } +bool +LayoutItem::GetContentSizeState(void) const +{ + return __contentSizeState; +} + }}} // Tizen::Ui::_Layout diff --git a/src/ui/layout/FUi_LayoutLayoutItemInfo.h b/src/ui/layout/FUi_LayoutLayoutItemInfo.h old mode 100644 new mode 100755 index 2896f09..b2a4929 --- a/src/ui/layout/FUi_LayoutLayoutItemInfo.h +++ b/src/ui/layout/FUi_LayoutLayoutItemInfo.h @@ -31,6 +31,12 @@ namespace Tizen { namespace Ui { namespace _Layout { +struct TableLayoutPoint +{ + int x; + int y; +}; + class LayoutItemProxy; class RelativeLayout; class RelativeProxyList; @@ -105,7 +111,7 @@ private: int __id; bool __enable; bool __merged; - LayoutPoint __mergeEndPoint; + TableLayoutPoint __mergeEndPoint; bool __fillWidth; bool __fillHeight; LayoutSize __minSize; @@ -134,7 +140,7 @@ public: private: float __weight; - int __spacing; + float __spacing; bool __fixedSize; LayoutRect __itemRect; diff --git a/src/ui/layout/FUi_LayoutLayoutItemProxy.cpp b/src/ui/layout/FUi_LayoutLayoutItemProxy.cpp old mode 100644 new mode 100755 index e01bece..a6924dc --- a/src/ui/layout/FUi_LayoutLayoutItemProxy.cpp +++ b/src/ui/layout/FUi_LayoutLayoutItemProxy.cpp @@ -38,8 +38,8 @@ LayoutItemProxy::LayoutItemProxy(LayoutItem& pRealItem) { __itemAlign.HAlign = ITEM_HORIZONTAL_ALIGN_LEFT; __itemAlign.VAlign = ITEM_VERTICAL_ALIGN_TOP; - LayoutRect rect = {0, 0, 0, 0}; - ItemMargin margin = {0, 0, 0, 0}; + LayoutRect rect = {0.0f, 0.0f, 0.0f, 0.0f}; + ItemMargin margin = {0.0f, 0.0f, 0.0f, 0.0f}; __itemMargin = margin; __baseRect = rect; __calculatedRect = rect; @@ -60,7 +60,7 @@ LayoutItemProxy::Create(Layout& pLayout, LayoutItem& pRealItem) void LayoutItemProxy::Destroy() { - LayoutContainer* pContainer = dynamic_cast (GetItem()); + LayoutContainer* pContainer = static_cast (GetItem()); if (pContainer) { pContainer->OnDestroyContainerProxy(); @@ -141,14 +141,14 @@ LayoutItemProxy::GetItemBaseRect() const } void -LayoutItemProxy::SetMeasuredSize(int width, int height) +LayoutItemProxy::SetMeasuredSize(float width, float height) { SysAssertf(__pItem != null, "LayoutItem is invalid"); __pItem->SetMeasuredSize(width, height); } void -LayoutItemProxy::GetMeasuredSize(int& width, int& height) const +LayoutItemProxy::GetMeasuredSize(float& width, float& height) const { SysAssertf(__pItem != null, "LayoutItem is invalid"); __pItem->GetMeasuredSize(width, height); @@ -192,7 +192,7 @@ LayoutItemProxy::ConvertWindowToClientBounds(const LayoutRect windowRect, Layout } result -LayoutItemProxy::Measure(int width, int height) +LayoutItemProxy::Measure(float width, float height) { SysAssertf(__pItem != null, "LayoutItem is invalid"); return __pItem->Measure(width, height); diff --git a/src/ui/layout/FUi_LayoutLayoutItemProxy.h b/src/ui/layout/FUi_LayoutLayoutItemProxy.h old mode 100644 new mode 100755 index 4e53733..96d51dc --- a/src/ui/layout/FUi_LayoutLayoutItemProxy.h +++ b/src/ui/layout/FUi_LayoutLayoutItemProxy.h @@ -54,15 +54,15 @@ public: void SetItemBaseRect(const LayoutRect rect); LayoutRect GetItemBaseRect(void) const; - void SetMeasuredSize(int width, int height); - void GetMeasuredSize(int& width, int& height) const; + void SetMeasuredSize(float width, float height); + void GetMeasuredSize(float& width, float& height) const; result SetItemWindowRect(const LayoutRect itemRect, bool calculating = true); void GetItemWindowRect(LayoutRect& itemRect) const; void ConvertWindowToClientBounds(const LayoutRect windowRect, LayoutRect& clientRect); - result Measure(int width, int height); + result Measure(float width, float height); void Visible(const bool visible); void SetParentLayout(Layout* pLayout); diff --git a/src/ui/layout/FUi_LayoutLayoutList.cpp b/src/ui/layout/FUi_LayoutLayoutList.cpp old mode 100644 new mode 100755 index d5405fd..b46c8e4 --- a/src/ui/layout/FUi_LayoutLayoutList.cpp +++ b/src/ui/layout/FUi_LayoutLayoutList.cpp @@ -39,25 +39,25 @@ LayoutList::~LayoutList(void) LayoutListNode* LayoutList::GetFirstNode(void) const { - return dynamic_cast (LinkedList::GetFirstNode()); + return static_cast (LinkedList::GetFirstNode()); } LayoutListNode* LayoutList::GetLastNode(void) const { - return dynamic_cast (LinkedList::GetLastNode()); + return static_cast (LinkedList::GetLastNode()); } LayoutListNode* LayoutList::GetNextNode(const LayoutListNode& node) const { - return dynamic_cast (LinkedList::GetNextNode(node)); + return static_cast (LinkedList::GetNextNode(node)); } LayoutListNode* LayoutList::GetPrevNode(const LayoutListNode& node) const { - return dynamic_cast (LinkedList::GetPrevNode(node)); + return static_cast (LinkedList::GetPrevNode(node)); } LayoutListNode* diff --git a/src/ui/layout/FUi_LayoutLayoutMaker.cpp b/src/ui/layout/FUi_LayoutLayoutMaker.cpp new file mode 100755 index 0000000..62ae7d7 --- /dev/null +++ b/src/ui/layout/FUi_LayoutLayoutMaker.cpp @@ -0,0 +1,1521 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUi_LayoutLayoutMaker.cpp + * @brief This is the implementation file for _LayoutMaker class. + * + * This file contains the implementation of _LayoutMaker class. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "FUi_UiBuilderControlMaker.h" +#include "FUi_UiBuilder.h" + +using namespace Tizen::Base; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::App; +using namespace Tizen::Graphics; + +namespace Tizen { namespace Ui +{ +_LayoutMaker::_LayoutMaker(_UiBuilder* pUibuilder) + : __pUiBuilder(null) +{ + __pUiBuilder = pUibuilder; +} + +_LayoutMaker::~_LayoutMaker(void) +{ +} + +bool +_LayoutMaker::GetLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const +{ + if (pControlProperty == null) + { + return false; + } + + Tizen::Base::String layoutType(L""); + + if (pControlProperty->GetLayoutElement( L"type", layoutType)) + { + + if (layoutType.Equals(L"NONE", false)) + { + returnType = UIBUILDER_LAYOUT_NONE; + } + else if (layoutType.Equals(L"LAYOUT_GRID", false)) + { + returnType = UIBUILDER_LAYOUT_GRID; + } + else if (layoutType.Equals(L"LAYOUT_HORIZONTAL_BOX", false)) + { + returnType = UIBUILDER_LAYOUT_HORIZONTAL_BOX; + } + else if (layoutType.Equals(L"LAYOUT_VERTICAL_BOX", false)) + { + returnType = UIBUILDER_LAYOUT_VERTICAL_BOX; + } + else if (layoutType.Equals(L"LAYOUT_RELATIVE", false)) + { + returnType = UIBUILDER_LAYOUT_RELATIVE; + } + else if (layoutType.Equals(L"LAYOUT_CARD", false)) + { + returnType = UIBUILDER_LAYOUT_CARD; + } + else + { + returnType = UIBUILDER_LAYOUT_NONE; + return false; + } + } + else + { + returnType = UIBUILDER_LAYOUT_NONE; + } + + return true; +} + +bool +_LayoutMaker::GetParentLayoutType(_UiBuilderControlLayout* pControlProperty, _UiBuilderLayoutType& returnType) const +{ + if (pControlProperty == null) + { + return false; + } + Tizen::Base::String parentLayoutType(L""); + + if (pControlProperty->GetLayoutElement(L"parentType", parentLayoutType)) + { + if (parentLayoutType.Equals(L"NONE", false)) + { + returnType = UIBUILDER_LAYOUT_NONE; + } + else if (parentLayoutType.Equals(L"LAYOUT_GRID", false)) + { + returnType = UIBUILDER_LAYOUT_GRID; + } + else if (parentLayoutType.Equals(L"LAYOUT_HORIZONTAL_BOX", false)) + { + returnType = UIBUILDER_LAYOUT_HORIZONTAL_BOX; + } + else if (parentLayoutType.Equals(L"LAYOUT_VERTICAL_BOX", false)) + { + returnType = UIBUILDER_LAYOUT_VERTICAL_BOX; + } + else if (parentLayoutType.Equals(L"LAYOUT_RELATIVE", false)) + { + returnType = UIBUILDER_LAYOUT_RELATIVE; + } + else if (parentLayoutType.Equals(L"LAYOUT_CARD", false)) + { + returnType = UIBUILDER_LAYOUT_CARD; + } + else + { + returnType = UIBUILDER_LAYOUT_NONE; + return false; + } + } + else + { + returnType = UIBUILDER_LAYOUT_NONE; + } + return true; +} + +result +_LayoutMaker::GetGridLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +{ + if (pControlProperty == null) + { + return E_SYSTEM; + } + + result r = E_SUCCESS; + Tizen::Base::String gridLayoutValue(L""); + GridLayout* pGridLayout = null; + int maxColumn = 0; + int maxRow = 0; + + pGridLayout = new (std::nothrow) GridLayout; + SysTryCatch(NID_UI, pGridLayout != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + if (pControlProperty->GetLayoutElement(L"maxColumn", gridLayoutValue)) + { + Integer::Parse(gridLayoutValue, maxColumn); + } + + if (pControlProperty->GetLayoutElement(L"maxRow", gridLayoutValue)) + { + Integer::Parse(gridLayoutValue, maxRow); + } + + r = pGridLayout->Construct(maxRow, maxColumn); + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + delete pGridLayout; + pGridLayout = null; + } + +CATCH: + pLayout = pGridLayout; + + return r; +} + +result +_LayoutMaker::GetHorizontalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +{ + if (pControlProperty == null) + { + return E_SYSTEM; + } + result r = E_SUCCESS; + + Tizen::Base::String horizontalBoxLayoutValue(L""); + + HorizontalBoxLayout* pHboxLayout = null; + HorizontalDirection direction; + + pHboxLayout = new (std::nothrow) HorizontalBoxLayout; + SysTryCatch(NID_UI, pHboxLayout != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + if (pControlProperty->GetLayoutElement(L"horizontalDirection", horizontalBoxLayoutValue)) + { + if (horizontalBoxLayoutValue.Equals(L"HORIZONTAL_DIRECTION_LEFTWARD", false)) + { + direction = HORIZONTAL_DIRECTION_LEFTWARD; + } + else + { + direction = HORIZONTAL_DIRECTION_RIGHTWARD; + } + } + else + { + direction = HORIZONTAL_DIRECTION_RIGHTWARD; + } + + r = pHboxLayout->Construct(direction); + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + delete pHboxLayout; + pHboxLayout = null; + } + +CATCH: + pLayout = pHboxLayout; + + return r; +} + +result +_LayoutMaker::GetVerticalBoxLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +{ + if (pControlProperty == null) + { + return E_SYSTEM; + } + result r = E_SUCCESS; + +Tizen::Base::String verticalBoxLayoutValue(L""); + + VerticalBoxLayout* pVboxLayout = null; + VerticalDirection direction; + + pVboxLayout = new (std::nothrow) VerticalBoxLayout; + SysTryCatch(NID_UI, pVboxLayout != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + if (pControlProperty->GetLayoutElement(L"verticalDirection", verticalBoxLayoutValue)) + { + if (verticalBoxLayoutValue.Equals(L"VERTICAL_DIRECTION_UPWARD", false)) + { + direction = VERTICAL_DIRECTION_UPWARD; + } + else + { + direction = VERTICAL_DIRECTION_DOWNWARD; + } + } + else + { + direction = VERTICAL_DIRECTION_DOWNWARD; + } + + r = pVboxLayout->Construct(direction); + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + delete pVboxLayout; + pVboxLayout = null; + } + +CATCH: + pLayout = pVboxLayout; + + return r; +} + +result +_LayoutMaker::GetRelativeLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +{ + if (pControlProperty == null) + { + return E_SYSTEM; + } + result r = E_SUCCESS; + + RelativeLayout* pRelLayout = null; + + pRelLayout = new (std::nothrow) RelativeLayout; + SysTryCatch(NID_UI, pRelLayout != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + r = pRelLayout->Construct(); + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + delete pRelLayout; + pRelLayout = null; + } +CATCH: + pLayout = pRelLayout; + + return r; +} + +result +_LayoutMaker::GetCardLayoutN(_UiBuilderControlLayout* pControlProperty, Layout*& pLayout) const +{ + if (pControlProperty == null) + { + return E_SYSTEM; + } + result r = E_SUCCESS; + + CardLayout* pCardLayout = null; + + pCardLayout = new (std::nothrow) CardLayout; + SysTryCatch(NID_UI, pCardLayout != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + + r = pCardLayout->Construct(); + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + delete pCardLayout; + pCardLayout = null; + } +CATCH: + pLayout = pCardLayout; + + return r; +} + +result +_LayoutMaker::GetLayoutN(_UiBuilderControl* pUiBuilderControl, Layout*& pPortraitLayout, Layout*& pLandscapeLayout) const +{ + result r = E_SUCCESS; + + _UiBuilderControlLayout* pControlProperty = null; + + Layout* pLayout = null; + Layout* pLayoutPortrait = null; + Layout* pLayoutLandscape = null; + + for (int i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++) + { + _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; + pControlProperty = pUiBuilderControl->GetAttribute(i); + if (pControlProperty == null) + { + SysLog(NID_UI, "Unable to set layout property"); + return E_SYSTEM; + } + if (GetLayoutType(pControlProperty, layoutType) == false) + { + return E_SYSTEM; + } + + switch (layoutType) + { + case UIBUILDER_LAYOUT_GRID: + r = GetGridLayoutN(pControlProperty, pLayout); + break; + + case UIBUILDER_LAYOUT_HORIZONTAL_BOX: + r = GetHorizontalBoxLayoutN(pControlProperty, pLayout); + break; + + case UIBUILDER_LAYOUT_VERTICAL_BOX: + r = GetVerticalBoxLayoutN(pControlProperty, pLayout); + break; + + case UIBUILDER_LAYOUT_RELATIVE: + r = GetRelativeLayoutN(pControlProperty, pLayout); + break; + case UIBUILDER_LAYOUT_CARD: + r = GetCardLayoutN(pControlProperty, pLayout); + break; + + default: + SysLog(NID_UI, "Unknown Layout type = %d", layoutType); + break; + } + if (r != E_SUCCESS) + { + SysLog(NID_UI, "[%s] Propagated.", GetErrorMessage(r)); + return r; + } + if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) + { + pLayoutPortrait = pLayout; + } + else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) + { + pLayoutLandscape = pLayout; + } + } + if ((pLayoutPortrait == null) && (pLayoutLandscape != null)) + { + pLayoutPortrait = pLayoutLandscape; + } + else if ((pLayoutPortrait != null) && (pLayoutLandscape == null)) + { + pLayoutLandscape = pLayoutPortrait; + } + + pPortraitLayout = pLayoutPortrait; + pLandscapeLayout = pLayoutLandscape; + + return r; +} + +result +_LayoutMaker::SetGridLayoutContainerProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty) const +{ + result r = E_SUCCESS; + + if ((null == pLayout) || (null == pControlProperty)) + { + return E_SYSTEM; + } + + GridLayout& layout = *pLayout; + UiBuilderGridLayoutContainer layoutParam; + Tizen::Base::String gridLayoutContainerPropertyValue(L""); + + layoutParam.maxColumn = 0; + layoutParam.maxRow = 0; + if (pControlProperty->GetLayoutElement(L"maxColumn", gridLayoutContainerPropertyValue)) + { + Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.maxColumn); + } + + if (pControlProperty->GetLayoutElement(L"maxRow", gridLayoutContainerPropertyValue)) + { + Integer::Parse(gridLayoutContainerPropertyValue, layoutParam.maxRow); + } + + String headerColumn = "column"; + String headerRow = "row"; + String tempString; + + for (int i = 1; i <= layoutParam.maxColumn; i++) + { + tempString = headerColumn; + tempString.Append(i); + tempString.Append("Collapsed"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.columnCollapsed = true; + } + else + { + layoutParam.columnCollapsed = false; + } + r = layout.SetColumnCollapsed(i - 1, layoutParam.columnCollapsed); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerColumn; + tempString.Append(i); + tempString.Append("Shrinkable"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.columnShrinkable = true; + } + else + { + layoutParam.columnShrinkable = false; + } + r = layout.SetColumnShrinkable(i - 1, layoutParam.columnShrinkable); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerColumn; + tempString.Append(i); + tempString.Append("Stretchable"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.columnStretchable = true; + } + else + { + layoutParam.columnStretchable = false; + } + r = layout.SetColumnStretchable(i - 1, layoutParam.columnStretchable); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerColumn; + tempString.Append(i); + tempString.Append("Spacing"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + Float::Parse(gridLayoutContainerPropertyValue, layoutParam.columnSpacing); + r = layout.SetColumnSpacing(i - 1, layoutParam.columnSpacing); + if (IsFailed(r)) + { + goto CATCH; + } + } + + } + for (int i = 1; i <= layoutParam.maxRow; i++) + { + + tempString = headerRow; + tempString.Append(i); + tempString.Append("Collapsed"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.rowCollapsed = true; + } + else + { + layoutParam.rowCollapsed = false; + } + r = layout.SetRowCollapsed(i - 1, layoutParam.rowCollapsed); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerRow; + tempString.Append(i); + tempString.Append("Shrinkable"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.rowShrinkable = true; + } + else + { + layoutParam.rowShrinkable = false; + } + r = layout.SetRowShrinkable(i - 1, layoutParam.rowShrinkable); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerRow; + tempString.Append(i); + tempString.Append("Stretchable"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + if (gridLayoutContainerPropertyValue.Equals(L"true", false)) + { + layoutParam.rowStretchable = true; + } + else + { + layoutParam.rowStretchable = false; + } + r = layout.SetRowStretchable(i - 1, layoutParam.rowStretchable); + if (IsFailed(r)) + { + goto CATCH; + } + } + + tempString = headerRow; + tempString.Append(i); + tempString.Append("Spacing"); + + if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue)) + { + Float::Parse(gridLayoutContainerPropertyValue, layoutParam.rowSpacing); + r = layout.SetRowSpacing(i - 1, layoutParam.rowSpacing); + if (IsFailed(r)) + { + goto CATCH; + } + } + + } +CATCH: + + return r; +} + +void +_LayoutMaker::SetGridLayoutControlProperty(GridLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) +{ + if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) + { + return ; + } + + GridLayout& layout = *pLayout; + Control& control = *pControl; + UiBuilderGridLayoutControl layoutParam; + Tizen::Base::String gridLayoutValue(L""); + bool alignmentSet = false; + + if (pControlProperty->GetLayoutElement(L"horizontalAlignment", gridLayoutValue)) + { + alignmentSet = true; + if (gridLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_CENTER", false)) + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_CENTER; + } + else if (gridLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_RIGHT", false)) + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_RIGHT; + } + else + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; + } + } + else + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; + } + + if (pControlProperty->GetLayoutElement(L"verticalAlignment", gridLayoutValue)) + { + alignmentSet = true; + if (gridLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_MIDDLE", false)) + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_MIDDLE; + } + else if (gridLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_BOTTOM", false)) + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_BOTTOM; + } + else + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; + } + } + else + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; + } + if (alignmentSet) + { + layout.SetAlignment(control, layoutParam.horizontalAlignment, layoutParam.verticalAlignment); + } + + _ICoordinateSystemTransformer* pTransform = GetTransformer(); + bool marginSet = false; + layoutParam.marginLeft = 0.0f; + layoutParam.marginRight = 0.0f; + layoutParam.marginTop = 0.0f; + layoutParam.marginBottom = 0.0f; + if (pControlProperty->GetLayoutElement(L"marginLeft", gridLayoutValue)) + { + marginSet = true; + Float::Parse(gridLayoutValue, layoutParam.marginLeft); + if (pTransform) + { + + layoutParam.marginLeft = pTransform->Transform(layoutParam.marginLeft); + } + } + if (pControlProperty->GetLayoutElement(L"marginRight", gridLayoutValue)) + { + marginSet = true; + Float::Parse(gridLayoutValue, layoutParam.marginRight); + if (pTransform) + { + + layoutParam.marginRight = pTransform->Transform(layoutParam.marginRight); + } + } + if (pControlProperty->GetLayoutElement(L"marginTop", gridLayoutValue)) + { + marginSet = true; + Float::Parse(gridLayoutValue, layoutParam.marginTop); + if (pTransform) + { + + layoutParam.marginTop = pTransform->Transform(layoutParam.marginTop); + } + } + if (pControlProperty->GetLayoutElement(L"marginBottom", gridLayoutValue)) + { + marginSet = true; + Float::Parse(gridLayoutValue, layoutParam.marginBottom); + if (pTransform) + { + + layoutParam.marginBottom = pTransform->Transform(layoutParam.marginBottom); + } + } + if (marginSet) + { + layout.SetMargin(control, layoutParam.marginLeft, layoutParam.marginRight, layoutParam.marginTop, layoutParam.marginBottom); + } + + bool positionSet = false; + layoutParam.positionRow = 0; + layoutParam.positionColumn = 0; + layoutParam.positionRowSpan = 0; + layoutParam.positionColumnSpan = 0; + if (pControlProperty->GetLayoutElement(L"positionRow", gridLayoutValue)) + { + positionSet = true; + Integer::Parse(gridLayoutValue, layoutParam.positionRow); + } + if (pControlProperty->GetLayoutElement(L"positionColumn", gridLayoutValue)) + { + positionSet = true; + Integer::Parse(gridLayoutValue, layoutParam.positionColumn); + } + if (pControlProperty->GetLayoutElement(L"positionRowSpan", gridLayoutValue)) + { + positionSet = true; + Integer::Parse(gridLayoutValue, layoutParam.positionRowSpan); + } + if (pControlProperty->GetLayoutElement(L"positionColumnSpan", gridLayoutValue)) + { + positionSet = true; + Integer::Parse(gridLayoutValue, layoutParam.positionColumnSpan); + } + if (positionSet) + { + layout.SetPosition(control, layoutParam.positionRow, layoutParam.positionColumn, layoutParam.positionRowSpan, layoutParam.positionColumnSpan); + } +} + +void +_LayoutMaker::SetHorizontalBoxLayoutProperty(HorizontalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) +{ + if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) + { + return ; + } + + HorizontalBoxLayout& layout = *pLayout; + Control& control = *pControl; + UiBuilderHorizontalBoxLayoutControl layoutParam; + Tizen::Base::String horizontalBoxLayoutValue(L""); + _ICoordinateSystemTransformer* pTransform = GetTransformer(); + + if (pControlProperty->GetLayoutElement(L"height", horizontalBoxLayoutValue)) + { + Float::Parse(horizontalBoxLayoutValue, layoutParam.height); + if (pTransform) + { + + layoutParam.height = pTransform->Transform(layoutParam.height); + } + layout.SetHeight(control, layoutParam.height); + } + else + { + layoutParam.height = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", horizontalBoxLayoutValue)) + { + if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + else if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; + } + layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + + if (pControlProperty->GetLayoutElement(L"verticalAlignment", horizontalBoxLayoutValue)) + { + if (horizontalBoxLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_MIDDLE", false)) + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_MIDDLE; + } + else if (horizontalBoxLayoutValue.Equals(L"LAYOUT_VERTICAL_ALIGN_BOTTOM", false)) + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_BOTTOM; + } + else + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; + } + + layout.SetVerticalAlignment(control, layoutParam.verticalAlignment); + } + else + { + layoutParam.verticalAlignment = LAYOUT_VERTICAL_ALIGN_TOP; + } + + bool marginSet = false; + layoutParam.verticalTopMargin = 0.0f; + layoutParam.verticalBottomMargin = 0.0f; + if (pControlProperty->GetLayoutElement(L"verticalTopMargin", horizontalBoxLayoutValue)) + { + marginSet = true; + Float::Parse(horizontalBoxLayoutValue, layoutParam.verticalTopMargin); + if (pTransform) + { + + layoutParam.verticalTopMargin = pTransform->Transform(layoutParam.verticalTopMargin); + } + } + if (pControlProperty->GetLayoutElement(L"verticalBottomMargin", horizontalBoxLayoutValue)) + { + marginSet = true; + Float::Parse(horizontalBoxLayoutValue, layoutParam.verticalBottomMargin); + if (pTransform) + { + + layoutParam.verticalBottomMargin = pTransform->Transform(layoutParam.verticalBottomMargin); + } + } + if (marginSet) + { + layout.SetVerticalMargin(control, layoutParam.verticalTopMargin, layoutParam.verticalBottomMargin); + } + + if (pControlProperty->GetLayoutElement(L"spacing", horizontalBoxLayoutValue)) + { + Float::Parse(horizontalBoxLayoutValue, layoutParam.spacing); + if (pTransform) + { + + layoutParam.spacing = pTransform->Transform(layoutParam.spacing); + } + layout.SetSpacing(control, layoutParam.spacing); + } + else + { + layoutParam.spacing = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"weight", horizontalBoxLayoutValue)) + { + Float::Parse(horizontalBoxLayoutValue, layoutParam.weight); + layout.SetWeight(control, layoutParam.weight); + } + else + { + layoutParam.weight = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"width", horizontalBoxLayoutValue)) + { + Float::Parse(horizontalBoxLayoutValue, layoutParam.width); + if (pTransform) + { + + layoutParam.width = pTransform->Transform(layoutParam.width); + } + layout.SetWidth(control, layoutParam.width); + } + else + { + layoutParam.width = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", horizontalBoxLayoutValue)) + { + if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; + } + else if (horizontalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; + } + layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; + } +} + +void +_LayoutMaker::SetVerticalBoxLayoutProperty(VerticalBoxLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) +{ + if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) + { + return ; + } + + VerticalBoxLayout& layout = *pLayout; + Control& control = *pControl; + UiBuilderVerticalBoxLayoutControl layoutParam; + Tizen::Base::String verticalBoxLayoutValue(L""); + _ICoordinateSystemTransformer* pTransform = GetTransformer(); + + if (pControlProperty->GetLayoutElement(L"height", verticalBoxLayoutValue)) + { + Float::Parse(verticalBoxLayoutValue, layoutParam.height); + if (pTransform) + { + + layoutParam.height = pTransform->Transform(layoutParam.height); + } + layout.SetHeight(control, layoutParam.height); + } + else + { + layoutParam.height = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", verticalBoxLayoutValue)) + { + if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + else if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; + } + layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + + if (pControlProperty->GetLayoutElement(L"horizontalAlignment", verticalBoxLayoutValue)) + { + if (verticalBoxLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_CENTER", false)) + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_CENTER; + } + else if (verticalBoxLayoutValue.Equals(L"LAYOUT_HORIZONTAL_ALIGN_RIGHT", false)) + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_RIGHT; + } + else + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; + } + + layout.SetHorizontalAlignment(control, layoutParam.horizontalAlignment); + } + else + { + layoutParam.horizontalAlignment = LAYOUT_HORIZONTAL_ALIGN_LEFT; + } + + bool marginSet = false; + layoutParam.horizontalLeftMargin = 0.0f; + layoutParam.horizontalRightMargin = 0.0f; + if (pControlProperty->GetLayoutElement(L"horizontalLeftMargin", verticalBoxLayoutValue)) + { + marginSet = true; + Float::Parse(verticalBoxLayoutValue, layoutParam.horizontalLeftMargin); + if (pTransform) + { + layoutParam.horizontalLeftMargin = pTransform->Transform(layoutParam.horizontalLeftMargin); + } + } + if (pControlProperty->GetLayoutElement(L"horizontalRightMargin", verticalBoxLayoutValue)) + { + marginSet = true; + Float::Parse(verticalBoxLayoutValue, layoutParam.horizontalRightMargin); + if (pTransform) + { + layoutParam.horizontalRightMargin = pTransform->Transform(layoutParam.horizontalRightMargin); + } + } + if (marginSet) + { + layout.SetHorizontalMargin(control, layoutParam.horizontalLeftMargin, layoutParam.horizontalRightMargin); + } + + if (pControlProperty->GetLayoutElement(L"spacing", verticalBoxLayoutValue)) + { + Float::Parse(verticalBoxLayoutValue, layoutParam.spacing); + if (pTransform) + { + layoutParam.spacing = pTransform->Transform(layoutParam.spacing); + + } + layout.SetSpacing(control, layoutParam.spacing); + } + else + { + layoutParam.spacing = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"weight", verticalBoxLayoutValue)) + { + Float::Parse(verticalBoxLayoutValue, layoutParam.weight); + layout.SetWeight(control, layoutParam.weight); + } + else + { + layoutParam.weight = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"width", verticalBoxLayoutValue)) + { + Float::Parse(verticalBoxLayoutValue, layoutParam.width); + if (pTransform) + { + layoutParam.width = pTransform->Transform(layoutParam.width); + + } + layout.SetWidth(control, layoutParam.width); + } + else + { + layoutParam.width = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", verticalBoxLayoutValue)) + { + if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; + } + else if (verticalBoxLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; + } + + layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; + } +} + +void +_LayoutMaker::SetRelativeLayoutProperty(RelativeLayout* pLayout, _UiBuilderControlLayout* pControlProperty, Control* pControl) +{ + if ((null == pLayout) || (null == pControlProperty) || (null == pControlProperty) || (null == pControl)) + { + return; + } + + RelativeLayout& layout = *pLayout; + Control& control = *pControl; + UiBuilderRelativeLayout layoutParam; + Tizen::Base::String relativeLayoutValue(L""); + Tizen::Graphics::FloatRectangle rect = pControlProperty->GetRectF(); + + if (pControlProperty->GetLayoutElement(L"bottomRelation", relativeLayoutValue)) + { + if (GetContainer()->GetName().Equals(relativeLayoutValue)) + { + layoutParam.pBottomRelation = GetContainer(); + } + else + { + layoutParam.pBottomRelation = GetContainer()->GetControl(relativeLayoutValue, true); + } + } + else + { + layoutParam.pBottomRelation = null; + } + + if (layoutParam.pBottomRelation) + { + if (pControlProperty->GetLayoutElement(L"bottomRelationType", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM", false)) + { + layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM; + } + else + { + layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_TOP; + } + layout.SetRelation(control, *(layoutParam.pBottomRelation), layoutParam.bottomRelationType); + } + else + { + layoutParam.bottomRelationType = RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM; + } + } + + if (pControlProperty->GetLayoutElement(L"leftRelation", relativeLayoutValue)) + { + if (GetContainer()->GetName().Equals(relativeLayoutValue)) + { + layoutParam.pLeftRelation = GetContainer(); + } + else + { + layoutParam.pLeftRelation = GetContainer()->GetControl(relativeLayoutValue, true); + } + } + else + { + layoutParam.pLeftRelation = null; + } + + if (layoutParam.pLeftRelation) + { + if (pControlProperty->GetLayoutElement(L"leftRelationType", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_LEFT_TO_LEFT", false)) + { + layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_LEFT; + } + else + { + layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_RIGHT; + } + layout.SetRelation(control, *(layoutParam.pLeftRelation), layoutParam.leftRelationType); + } + else + { + layoutParam.leftRelationType = RECT_EDGE_RELATION_LEFT_TO_LEFT; + } + } + + if (pControlProperty->GetLayoutElement(L"rightRelation", relativeLayoutValue)) + { + if (GetContainer()->GetName().Equals(relativeLayoutValue)) + { + layoutParam.pRightRelation = GetContainer(); + } + else + { + layoutParam.pRightRelation = GetContainer()->GetControl(relativeLayoutValue, true); + } + } + else + { + layoutParam.pRightRelation = null; + } + + if (layoutParam.pRightRelation) + { + if (pControlProperty->GetLayoutElement(L"rightRelationType", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_RIGHT_TO_RIGHT", false)) + { + layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_RIGHT; + } + else + { + layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_LEFT; + } + layout.SetRelation(control, *(layoutParam.pRightRelation), layoutParam.rightRelationType); + } + else + { + layoutParam.rightRelationType = RECT_EDGE_RELATION_RIGHT_TO_RIGHT; + } + } + + if (pControlProperty->GetLayoutElement(L"topRelation", relativeLayoutValue)) + { + if (GetContainer()->GetName().Equals(relativeLayoutValue)) + { + layoutParam.pTopRelation = GetContainer(); + } + else + { + layoutParam.pTopRelation = GetContainer()->GetControl(relativeLayoutValue, true); + } + } + else + { + layoutParam.pTopRelation = null; + } + + if (layoutParam.pTopRelation) + { + if (pControlProperty->GetLayoutElement(L"topRelationType", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"RECT_EDGE_RELATION_TOP_TO_TOP", false)) + { + layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_TOP; + } + else + { + layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_BOTTOM; + } + layout.SetRelation(control, *(layoutParam.pTopRelation), layoutParam.topRelationType); + } + else + { + layoutParam.topRelationType = RECT_EDGE_RELATION_TOP_TO_TOP; + } + } + + if (pControlProperty->GetLayoutElement(L"centerHorizontal", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"true", false)) + { + layoutParam.centerHorizontal = true; + layout.SetCenterAligned(control, CENTER_ALIGN_HORIZONTAL); + } + else + { + layoutParam.centerHorizontal = false; + } + } + else + { + layoutParam.centerHorizontal = false; + } + + if (pControlProperty->GetLayoutElement(L"centerVertical", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"true", false)) + { + layoutParam.centerVertical = true; + layout.SetCenterAligned(control, CENTER_ALIGN_VERTICAL); + } + else + { + layoutParam.centerVertical = false; + } + } + else + { + layoutParam.centerVertical = false; + } + + + if (pControlProperty->GetLayoutElement(L"height", relativeLayoutValue)) + { + layoutParam.height = rect.height; + layout.SetHeight(control, layoutParam.height); + } + else + { + layoutParam.height = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"verticalFitPolicy", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + else if (relativeLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.verticalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_FIXED; + } + layout.SetVerticalFitPolicy(control, layoutParam.verticalFitPolicy); + } + else + { + layoutParam.verticalFitPolicy = FIT_POLICY_CONTENT; + } + + if (pControlProperty->GetLayoutElement(L"width", relativeLayoutValue)) + { + layoutParam.width = rect.width; + layout.SetWidth(control, layoutParam.width); + } + else + { + layoutParam.width = 0.0f; + } + + if (pControlProperty->GetLayoutElement(L"horizontalFitPolicy", relativeLayoutValue)) + { + if (relativeLayoutValue.Equals(L"FIT_POLICY_CONTENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; + } + else if (relativeLayoutValue.Equals(L"FIT_POLICY_PARENT", false)) + { + layoutParam.horizontalFitPolicy = FIT_POLICY_PARENT; + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_FIXED; + } + layout.SetHorizontalFitPolicy(control, layoutParam.horizontalFitPolicy); + } + else + { + layoutParam.horizontalFitPolicy = FIT_POLICY_CONTENT; + } + + bool marginSet = false; + layoutParam.marginLeft = 0.0f; + layoutParam.marginRight = 0.0f; + layoutParam.marginTop = 0.0f; + layoutParam.marginBottom = 0.0f; + + Tizen::Graphics::_ICoordinateSystemTransformer* pTransform = GetTransformer(); + + if (pControlProperty->GetLayoutElement(L"marginLeft", relativeLayoutValue)) + { + marginSet = true; + Float::Parse(relativeLayoutValue, layoutParam.marginLeft); + if (pTransform) + { + + layoutParam.marginLeft = pTransform->Transform(layoutParam.marginLeft); + } + } + if (pControlProperty->GetLayoutElement(L"marginRight", relativeLayoutValue)) + { + marginSet = true; + Float::Parse(relativeLayoutValue, layoutParam.marginRight); + if (pTransform) + { + + layoutParam.marginRight = pTransform->Transform(layoutParam.marginRight); + } + } + if (pControlProperty->GetLayoutElement(L"marginTop", relativeLayoutValue)) + { + marginSet = true; + Float::Parse(relativeLayoutValue, layoutParam.marginTop); + if (pTransform) + { + + layoutParam.marginTop = pTransform->Transform(layoutParam.marginTop); + } + } + if (pControlProperty->GetLayoutElement(L"marginBottom", relativeLayoutValue)) + { + marginSet = true; + Float::Parse(relativeLayoutValue, layoutParam.marginBottom); + if (pTransform) + { + + layoutParam.marginBottom = pTransform->Transform(layoutParam.marginBottom); + } + } + if (marginSet) + { + layout.SetMargin(control, layoutParam.marginLeft, layoutParam.marginRight, layoutParam.marginTop, layoutParam.marginBottom); + } +} + +result +_LayoutMaker::SetLayoutProperty(_UiBuilderControl* pUiBuilderControl, Control* pControl) +{ + int i = 0; + _UiBuilderControlLayout* pControlProperty = null; + + Container* pContainer = null; + if (GetContainer()->GetName().Equals(Tizen::Base::String(pUiBuilderControl->GetParentWin()))) + { + pContainer = static_cast(GetContainer()); + } + else + { + pContainer = dynamic_cast(static_cast(GetContainer())->GetControl(pUiBuilderControl->GetParentWin(), true)); + } + + result r = GetLastResult(); + SysTryReturn(NID_UI, pContainer != null, r, r, "[%s] Failed to get Container.", GetErrorMessage(r)); + + for (i = 0; i < UIBUILDER_ATTRIBUTE_NUM; i++) + { + _UiBuilderLayoutType layoutType = UIBUILDER_LAYOUT_NONE; + pControlProperty = pUiBuilderControl->GetAttribute(i); + GetParentLayoutType(pControlProperty, layoutType); + switch (layoutType) + { + case UIBUILDER_LAYOUT_NONE: + case UIBUILDER_LAYOUT_CARD: + break; + + case UIBUILDER_LAYOUT_GRID: + { + GridLayout* pLayout = null; + if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) + { + pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); + } + else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) + { + pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); + } + + if (pLayout) + { + SetGridLayoutControlProperty(pLayout, pControlProperty, pControl); + delete pLayout; + } + break; + } + + case UIBUILDER_LAYOUT_HORIZONTAL_BOX: + { + HorizontalBoxLayout* pLayout = null; + if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) + { + pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); + } + else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) + { + pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); + } + if (pLayout) + { + SetHorizontalBoxLayoutProperty(pLayout, pControlProperty, pControl); + delete pLayout; + } + break; + } + + case UIBUILDER_LAYOUT_VERTICAL_BOX: + { + VerticalBoxLayout* pLayout = null; + if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) + { + pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); + } + else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) + { + pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); + } + if (pLayout) + { + SetVerticalBoxLayoutProperty(pLayout, pControlProperty, pControl); + delete pLayout; + } + break; + } + + case UIBUILDER_LAYOUT_RELATIVE: + { + RelativeLayout* pLayout = null; + if (UIBUILDER_ATTRIBUTE_PORTRAIT == i) + { + pLayout = dynamic_cast(pContainer->GetPortraitLayoutN()); + } + else if (UIBUILDER_ATTRIBUTE_LANDSCAPE == i) + { + pLayout = dynamic_cast(pContainer->GetLandscapeLayoutN()); + } + if (pLayout) + { + SetRelativeLayoutProperty(pLayout, pControlProperty, pControl); + delete pLayout; + } + break; + } + + default: + { + SysLog(NID_UI, "Unknown Layout type = %d", layoutType); + return E_INVALID_STATE; + } + } + } + return E_SUCCESS; +} + +Tizen::Ui::Container* +_LayoutMaker::GetContainer(void) const +{ + return __pUiBuilder->GetContainer(); +} + +Tizen::Graphics::_ICoordinateSystemTransformer* +_LayoutMaker::GetTransformer(void) const +{ + return __pUiBuilder->GetTransformer(); +} + +} } // Tizen::Ui diff --git a/src/ui/layout/FUi_LayoutLinearLayout.cpp b/src/ui/layout/FUi_LayoutLinearLayout.cpp old mode 100644 new mode 100755 index 505a501..928643f --- a/src/ui/layout/FUi_LayoutLinearLayout.cpp +++ b/src/ui/layout/FUi_LayoutLinearLayout.cpp @@ -35,7 +35,7 @@ namespace Tizen { namespace Ui { namespace _Layout LinearLayout::LinearLayout(void) : __orientation(LINEAR_NONE_ORIENTATION) , __direction(LINEAR_NONE_DIRECTION) - , __weightSum(0.0) + , __weightSum(0.0f) { LinearProxyList* pLinearProxyList = new (std::nothrow) LinearProxyList(); SysTryReturnVoidResult(NID_UI, pLinearProxyList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); @@ -296,7 +296,7 @@ LinearLayout::GetDirection(LinearLayoutDirection& direction) const result LinearLayout::SetItemWeight(LayoutItem& item, const float weight) { - SysTryReturn(NID_UI, weight >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The weight value is negative."); + SysTryReturn(NID_UI, weight >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The weight value is negative."); ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); @@ -304,7 +304,7 @@ LinearLayout::SetItemWeight(LayoutItem& item, const float weight) ProxyListNode* pNode = pProxyList->GetNode(item); SysTryReturn(NID_UI, pNode != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Control dose not belong to layout."); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -327,7 +327,7 @@ LinearLayout::GetItemWeight(const LayoutItem& item, float& weight) const ProxyListNode* pNode = pProxyList->GetNode(item); SysTryReturn(NID_UI, pNode != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Control dose not belong to layout."); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -339,7 +339,7 @@ LinearLayout::GetItemWeight(const LayoutItem& item, float& weight) const } result -LinearLayout::SetItemSpacing(LayoutItem& item, int spacing) +LinearLayout::SetItemSpacing(LayoutItem& item, float spacing) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); @@ -347,7 +347,7 @@ LinearLayout::SetItemSpacing(LayoutItem& item, int spacing) ProxyListNode* pNode = pProxyList->GetNode(item); SysTryReturn(NID_UI, pNode != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Control dose not belong to layout."); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -360,7 +360,7 @@ LinearLayout::SetItemSpacing(LayoutItem& item, int spacing) } result -LinearLayout::GetItemSpacing(const LayoutItem& item, int& spacing) const +LinearLayout::GetItemSpacing(const LayoutItem& item, float& spacing) const { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); @@ -368,7 +368,7 @@ LinearLayout::GetItemSpacing(const LayoutItem& item, int& spacing) const ProxyListNode* pNode = pProxyList->GetNode(item); SysTryReturn(NID_UI, pNode != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Control dose not belong to layout."); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -380,7 +380,7 @@ LinearLayout::GetItemSpacing(const LayoutItem& item, int& spacing) const } result -LinearLayout::OnLayout(int width, int height, bool layoutUpdating) +LinearLayout::OnLayout(float width, float height, bool layoutUpdating) { result r = E_SUCCESS; @@ -398,7 +398,7 @@ LinearLayout::OnLayout(int width, int height, bool layoutUpdating) return E_INVALID_STATE; } - LayoutRect intendedRect = {0, 0, width, height}; + LayoutRect intendedRect = {0.0f, 0.0f, width, height}; pContainerProxy->ConvertWindowToClientBounds(intendedRect, intendedRect); LayoutRect layoutRect = GetLayoutRect(); @@ -406,15 +406,15 @@ LinearLayout::OnLayout(int width, int height, bool layoutUpdating) layoutRect.h = intendedRect.h; SetLayoutRect(layoutRect); - int rightBound = 0; - int bottomBound = 0; + float rightBound = 0.0f; + float bottomBound = 0.0f; r = CalculatePositionSize(rightBound, bottomBound); if (r != E_SUCCESS) { return r; } - if (_FloatHardCompare(__weightSum, 0.0f) == false) + if (_FloatCompare(__weightSum, 0.0f) == false) { r = CalculateWeight(rightBound, bottomBound); if (r != E_SUCCESS) @@ -458,7 +458,7 @@ LinearLayout::OnLayout(int width, int height, bool layoutUpdating) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; @@ -477,7 +477,7 @@ LinearLayout::OnLayout(int width, int height, bool layoutUpdating) } result -LinearLayout::CalculatePositionSize(int& rightBound, int& bottomBound) +LinearLayout::CalculatePositionSize(float& rightBound, float& bottomBound) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); @@ -498,13 +498,13 @@ LinearLayout::CalculatePositionSize(int& rightBound, int& bottomBound) } result -LinearLayout::CalculateHorizontalPositionSize(int& rightBound, int& bottomBound) +LinearLayout::CalculateHorizontalPositionSize(float& rightBound, float& bottomBound) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); LayoutRect layoutRect = GetLayoutRect(); - int x = layoutRect.x; + float x = layoutRect.x; if (__direction == LINEAR_RIGHT_TO_LEFT) { x += layoutRect.w; @@ -515,7 +515,7 @@ LinearLayout::CalculateHorizontalPositionSize(int& rightBound, int& bottomBound) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; @@ -569,7 +569,7 @@ LinearLayout::CalculateHorizontalPositionSize(int& rightBound, int& bottomBound) ItemMargin margin = pItemProxy->GetItemMargin(); if (pItemProxy->GetItemHeightMatchMode() != MATCH_PARENT) { - int itemBottomPosition = 0; + float itemBottomPosition = 0.0f; if (align.VAlign == ITEM_VERTICAL_ALIGN_TOP) { itemBottomPosition = margin.top + itemRect.h; @@ -605,13 +605,13 @@ LinearLayout::CalculateHorizontalPositionSize(int& rightBound, int& bottomBound) } result -LinearLayout::CalculateVerticalPositonSize(int& rightBound, int& bottomBound) +LinearLayout::CalculateVerticalPositonSize(float& rightBound, float& bottomBound) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); LayoutRect layoutRect = GetLayoutRect(); - int y = layoutRect.y; + float y = layoutRect.y; if (__direction == LINEAR_BOTTOM_TO_TOP) { y += layoutRect.h; @@ -622,7 +622,7 @@ LinearLayout::CalculateVerticalPositonSize(int& rightBound, int& bottomBound) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; @@ -676,7 +676,7 @@ LinearLayout::CalculateVerticalPositonSize(int& rightBound, int& bottomBound) ItemMargin margin = pItemProxy->GetItemMargin(); if (pItemProxy->GetItemWidthMatchMode() != MATCH_PARENT) { - int itemRightPosition = 0; + float itemRightPosition = 0.0f; if (align.HAlign == ITEM_HORIZONTAL_ALIGN_LEFT) { itemRightPosition = margin.left + itemRect.w; @@ -712,11 +712,11 @@ LinearLayout::CalculateVerticalPositonSize(int& rightBound, int& bottomBound) } result -LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) +LinearLayout::CalculateWeight(float& rightBound, float& bottomBound) { float originalWeightSum = __weightSum; LayoutRect layoutRect = GetLayoutRect(); - int emptySpace = 0; + float emptySpace = 0.0f; result r = E_SUCCESS; ProxyList* pProxyList = GetProxyList(); @@ -735,7 +735,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) { return E_INVALID_STATE; } - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -744,7 +744,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) emptySpace = pItemInfo->__itemRect.x - layoutRect.x; } - while (emptySpace != 0) + while (!_FloatCompare(emptySpace, 0.0f)) { r = CalculateHorizontalWeight(emptySpace); if (r != E_SUCCESS) @@ -766,7 +766,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) { return E_INVALID_STATE; } - LinearItemInfo* pBoundInfo = dynamic_cast (pBoundNode->GetItemInfo()); + LinearItemInfo* pBoundInfo = static_cast (pBoundNode->GetItemInfo()); if (pBoundInfo == null) { return E_INVALID_STATE; @@ -786,7 +786,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) { return E_INVALID_STATE; } - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -795,7 +795,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) emptySpace = pItemInfo->__itemRect.y - layoutRect.y; } - while (emptySpace != 0) + while (!_FloatCompare(emptySpace, 0.0f)) { r = CalculateVerticalWeight(emptySpace); if (r != E_SUCCESS) @@ -817,7 +817,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) { return E_INVALID_STATE; } - LinearItemInfo* pBoundInfo = dynamic_cast (pBoundNode->GetItemInfo()); + LinearItemInfo* pBoundInfo = static_cast (pBoundNode->GetItemInfo()); if (pBoundInfo == null) { return E_INVALID_STATE; @@ -828,7 +828,7 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) ProxyListNode* pNode = pProxyList->GetFirstNode(); while (pNode != null) { - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -844,21 +844,21 @@ LinearLayout::CalculateWeight(int& rightBound, int& bottomBound) } result -LinearLayout::CalculateHorizontalWeight(int& emptySpace) +LinearLayout::CalculateHorizontalWeight(float& emptySpace) { ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); - if (_FloatHardCompare(__weightSum, 0.0f) == true) + if (_FloatCompare(__weightSum, 0.0f) == true) { - emptySpace = 0; + emptySpace = 0.0f; return E_SUCCESS; } result r = E_SUCCESS; - int x = 0; - int measuredWidth = 0; - int usedEmptySpace = emptySpace; + float x = 0.0f; + float measuredWidth = 0.0f; + float usedEmptySpace = emptySpace; int itemCount = pProxyList->GetNodeCount(); if (usedEmptySpace <= itemCount && usedEmptySpace >= -itemCount) @@ -867,18 +867,25 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; } LayoutRect itemRect = pItemInfo->__itemRect; itemRect.x += x; - if (pItemInfo->__fixedSize == false && usedEmptySpace != 0) + if (pItemInfo->__fixedSize == false && !_FloatCompare(usedEmptySpace, 0.0f)) { - if (usedEmptySpace > 0) + if (usedEmptySpace > 0.0f) { - itemRect.w++; + if (usedEmptySpace < 1.0f) + { + itemRect.w += usedEmptySpace; + } + else + { + itemRect.w++; + } r = pItemProxy->Measure(itemRect.w, itemRect.h); if (r != E_SUCCESS) @@ -887,17 +894,33 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) } pItemProxy->GetMeasuredSize(measuredWidth, itemRect.h); - if (measuredWidth == itemRect.w) + if (_FloatCompare(measuredWidth, itemRect.w)) { - usedEmptySpace--; - if (__direction == LINEAR_LEFT_TO_RIGHT) + if (usedEmptySpace < 1.0f) { - x++; + if (__direction == LINEAR_LEFT_TO_RIGHT) + { + x += usedEmptySpace; + } + else + { + itemRect.x -= usedEmptySpace; + x -= usedEmptySpace; + } + usedEmptySpace = 0.0f; } else { - itemRect.x--; - x--; + usedEmptySpace--; + if (__direction == LINEAR_LEFT_TO_RIGHT) + { + x++; + } + else + { + itemRect.x--; + x--; + } } } else @@ -909,11 +932,18 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) } else { - itemRect.w--; + if (usedEmptySpace > -1.0f) + { + itemRect.w -= usedEmptySpace; + } + else + { + itemRect.w--; + } #ifdef NOT_SUPPORT_NEGATIVE_SIZE - if (itemRect.w < 0) + if (itemRect.w < 0.0f) { - itemRect.w = 0; + itemRect.w = 0.0f; } #endif r = pItemProxy->Measure(itemRect.w, itemRect.h); @@ -923,17 +953,33 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) } pItemProxy->GetMeasuredSize(measuredWidth, itemRect.h); - if (measuredWidth == itemRect.w) + if (_FloatCompare(measuredWidth, itemRect.w)) { - usedEmptySpace++; - if (__direction == LINEAR_LEFT_TO_RIGHT) + if (usedEmptySpace > -1.0f) { - x--; + if (__direction == LINEAR_LEFT_TO_RIGHT) + { + x -= usedEmptySpace; + } + else + { + itemRect.x += usedEmptySpace; + x += usedEmptySpace; + } + usedEmptySpace = 0.0f; } else { - itemRect.x++; - x++; + usedEmptySpace++; + if (__direction == LINEAR_LEFT_TO_RIGHT) + { + x--; + } + else + { + itemRect.x++; + x++; + } } } else @@ -954,7 +1000,7 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) } float unitSize = emptySpace / __weightSum; - int correctionValue = emptySpace - (int) (unitSize * 100.0) * (int) (__weightSum) / 100; + int correctionValue = emptySpace - (int)(unitSize * 100.0) * (int) (__weightSum) / 100.0f; if (correctionValue < 0) { correctionValue = -correctionValue; @@ -964,14 +1010,14 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; } LayoutRect itemRect = pItemInfo->__itemRect; - int correctionSize = (int) (unitSize * pItemInfo->__weight); - if (correctionValue) + int correctionSize = unitSize * pItemInfo->__weight; + if (correctionValue != 0) { if (correctionSize < 0) { @@ -1016,9 +1062,9 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) pItemInfo->__fixedSize = true; } #ifdef NOT_SUPPORT_NEGATIVE_SIZE - if (itemRect.w < 0) + if (itemRect.w < 0.0f) { - itemRect.w = 0; + itemRect.w = 0.0f; } #endif pItemInfo->__itemRect = itemRect; @@ -1031,21 +1077,21 @@ LinearLayout::CalculateHorizontalWeight(int& emptySpace) } result -LinearLayout::CalculateVerticalWeight(int& emptySpace) +LinearLayout::CalculateVerticalWeight(float& emptySpace) { - if (_FloatHardCompare(__weightSum, 0.0f)) + ProxyList* pProxyList = GetProxyList(); + SysAssertf(pProxyList != null, "ProxyList is invalid."); + + if (_FloatCompare(__weightSum, 0.0f)) { emptySpace = 0; return E_SUCCESS; } - ProxyList* pProxyList = GetProxyList(); - SysAssertf(pProxyList != null, "ProxyList is invalid."); - result r = E_SUCCESS; - int y = 0; - int measuredHeight = 0; - int usedEmptySpace = emptySpace; + float y = 0.0f; + float measuredHeight = 0.0f; + float usedEmptySpace = emptySpace; int itemCount = pProxyList->GetNodeCount(); if (usedEmptySpace <= itemCount && usedEmptySpace >= -itemCount) @@ -1054,18 +1100,25 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; } LayoutRect itemRect = pItemInfo->__itemRect; itemRect.y += y; - if (pItemInfo->__fixedSize == false && usedEmptySpace != 0) + if (pItemInfo->__fixedSize == false && !_FloatCompare(usedEmptySpace, 0.0f)) { - if (usedEmptySpace > 0) + if (usedEmptySpace > 0.0f) { - itemRect.h++; + if (usedEmptySpace < 1.0f) + { + itemRect.h += usedEmptySpace; + } + else + { + itemRect.h++; + } r = pItemProxy->Measure(itemRect.w, itemRect.h); if (r != E_SUCCESS) @@ -1076,15 +1129,32 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) pItemProxy->GetMeasuredSize(itemRect.w, measuredHeight); if (measuredHeight == itemRect.h) { - usedEmptySpace--; - if (__direction == LINEAR_TOP_TO_BOTTOM) + if (usedEmptySpace < 1.0f) { - y++; + if (__direction == LINEAR_TOP_TO_BOTTOM) + { + y += usedEmptySpace; + } + else + { + itemRect.y -= usedEmptySpace; + y -= usedEmptySpace; + } + + usedEmptySpace = 0.0f; } else { - itemRect.y--; - y--; + usedEmptySpace--; + if (__direction == LINEAR_TOP_TO_BOTTOM) + { + y++; + } + else + { + itemRect.y--; + y--; + } } } else @@ -1096,11 +1166,18 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) } else { - itemRect.h--; + if (usedEmptySpace > -1.0f) + { + itemRect.h -= usedEmptySpace; + } + else + { + itemRect.h--; + } #ifdef NOT_SUPPORT_NEGATIVE_SIZE - if (itemRect.h < 0) + if (itemRect.h < 0.0f) { - itemRect.h = 0; + itemRect.h = 0.0f; } #endif r = pItemProxy->Measure(itemRect.w, itemRect.h); @@ -1112,15 +1189,31 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) pItemProxy->GetMeasuredSize(itemRect.w, measuredHeight); if (measuredHeight == itemRect.h) { - usedEmptySpace++; - if (__direction == LINEAR_TOP_TO_BOTTOM) + if (usedEmptySpace > -1.0f) { - y--; + if (__direction == LINEAR_TOP_TO_BOTTOM) + { + y -= usedEmptySpace; + } + else + { + itemRect.y += usedEmptySpace; + y += usedEmptySpace; + } + usedEmptySpace = 0.0f; } else { - itemRect.y++; - y++; + usedEmptySpace++; + if (__direction == LINEAR_TOP_TO_BOTTOM) + { + y--; + } + else + { + itemRect.y++; + y++; + } } } else @@ -1151,16 +1244,16 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; } LayoutRect itemRect = pItemInfo->__itemRect; - int correctionSize = (int) (unitSize * pItemInfo->__weight); - if (correctionValue) + int correctionSize = unitSize * pItemInfo->__weight; + if (correctionValue != 0) { - if (correctionSize < 0) + if (correctionSize < 0.0f) { correctionSize--; } @@ -1218,7 +1311,7 @@ LinearLayout::CalculateVerticalWeight(int& emptySpace) } result -LinearLayout::CalculateWrapContent(LayoutItemProxy& containerProxy, int rightBound, int bottomBound, bool layoutUpdating) +LinearLayout::CalculateWrapContent(LayoutItemProxy& containerProxy, float rightBound, float bottomBound, bool layoutUpdating) { LayoutMatchMode widthMatchMode = containerProxy.GetItemWidthMatchMode(); LayoutMatchMode heightMatchMode = containerProxy.GetItemHeightMatchMode(); @@ -1233,8 +1326,8 @@ LinearLayout::CalculateWrapContent(LayoutItemProxy& containerProxy, int rightBou containerProxy.GetItemWindowRect(containerRect); containerProxy.ConvertWindowToClientBounds(containerRect, clientRect); - int correctionWidth = containerRect.w - clientRect.w; - int correctionHeight = containerRect.h - clientRect.h; + float correctionWidth = containerRect.w - clientRect.w; + float correctionHeight = containerRect.h - clientRect.h; LayoutSize minSize; LayoutSize maxSize; containerProxy.GetMinSize(minSize); @@ -1316,7 +1409,7 @@ LinearLayout::CalculateMatchParent(void) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; @@ -1384,7 +1477,7 @@ LinearLayout::CalculateCorrectedAlignment(void) while (pNode != null) { LayoutItemProxy* pItemProxy = pNode->GetItemProxy(); - LinearItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemProxy == null || pItemInfo == null) { return E_INVALID_STATE; diff --git a/src/ui/layout/FUi_LayoutProxyList.cpp b/src/ui/layout/FUi_LayoutProxyList.cpp old mode 100644 new mode 100755 index bff4870..0dba2e1 --- a/src/ui/layout/FUi_LayoutProxyList.cpp +++ b/src/ui/layout/FUi_LayoutProxyList.cpp @@ -43,25 +43,25 @@ ProxyList::~ProxyList(void) ProxyListNode* ProxyList::GetFirstNode(void) const { - return dynamic_cast (LinkedList::GetFirstNode()); + return static_cast (LinkedList::GetFirstNode()); } ProxyListNode* ProxyList::GetLastNode(void) const { - return dynamic_cast (LinkedList::GetLastNode()); + return static_cast (LinkedList::GetLastNode()); } ProxyListNode* ProxyList::GetNextNode(const LinkedListNode& node) const { - return dynamic_cast (LinkedList::GetNextNode(node)); + return static_cast (LinkedList::GetNextNode(node)); } ProxyListNode* ProxyList::GetPrevNode(const LinkedListNode& node) const { - return dynamic_cast (LinkedList::GetPrevNode(node)); + return static_cast (LinkedList::GetPrevNode(node)); } ProxyListNode* @@ -81,7 +81,7 @@ ProxyList::GetNode(const LayoutItem& item) const while (pCurNode) { pNextNode = GetNextNode(*pCurNode); - ProxyListNode* pProxyNode = dynamic_cast (pCurNode); + ProxyListNode* pProxyNode = static_cast (pCurNode); if (pProxyNode == null) { return null; @@ -123,7 +123,7 @@ ProxyList::GetItemProxy(const LayoutItem& item) const while (pCurNode) { pNextNode = GetNextNode(*pCurNode); - ProxyListNode* pProxyNode = dynamic_cast (pCurNode); + ProxyListNode* pProxyNode = static_cast (pCurNode); if (pProxyNode == null) { return null; @@ -219,11 +219,6 @@ ProxyList::RefreshIndex(void) ProxyListNode* ProxyList::AddNode(LayoutItemProxy& addProxy) { - if (SearchNode(addProxy) != null) - { - SysLog(NID_UI, "SearchNode() is failed."); - return null; - } ProxyListNode* pAddNode = new (std::nothrow) ProxyListNode(); SysTryReturn(NID_UI, pAddNode != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to add to ProxyList."); @@ -250,7 +245,7 @@ ProxyList::AddNode(LayoutItemProxy& addProxy) result ProxyList::RemoveNode(LinkedListNode& removeNode) { - ProxyListNode* pProxyNode = dynamic_cast (&removeNode); + ProxyListNode* pProxyNode = static_cast (&removeNode); result re = E_SYSTEM; re = OnRemoveNode(*pProxyNode); if (re != E_SUCCESS) @@ -388,7 +383,7 @@ RelativeProxyList::OnAddNode(ProxyListNode& addNode) result RelativeProxyList::OnRemoveNode(ProxyListNode& removeNode) { - RelativeItemInfo* pItemInfo = dynamic_cast (removeNode.GetItemInfo()); + RelativeItemInfo* pItemInfo = static_cast (removeNode.GetItemInfo()); if (pItemInfo == null) { return E_INVALID_ARG; @@ -408,7 +403,7 @@ RelativeProxyList::OnRemoveNode(ProxyListNode& removeNode) int RelativeProxyList::GetReferenceCount(ProxyListNode& node) const { - RelativeItemInfo* pItemInfo = dynamic_cast (node.GetItemInfo()); + RelativeItemInfo* pItemInfo = static_cast (node.GetItemInfo()); if (pItemInfo == null) { return 0; @@ -451,7 +446,7 @@ TableProxyList::OnAddNode(ProxyListNode& addNode) result TableProxyList::OnRemoveNode(ProxyListNode& removeNode) { - TableItemInfo* pItemInfo = dynamic_cast (removeNode.GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (removeNode.GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -491,7 +486,7 @@ LinearProxyList::OnAddNode(ProxyListNode& addNode) result LinearProxyList::OnRemoveNode(ProxyListNode& removeNode) { - LinearItemInfo* pItemInfo = dynamic_cast (removeNode.GetItemInfo()); + LinearItemInfo* pItemInfo = static_cast (removeNode.GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; diff --git a/src/ui/layout/FUi_LayoutRelativeLayout.cpp b/src/ui/layout/FUi_LayoutRelativeLayout.cpp old mode 100644 new mode 100755 index 3a2bc20..c7242ae --- a/src/ui/layout/FUi_LayoutRelativeLayout.cpp +++ b/src/ui/layout/FUi_LayoutRelativeLayout.cpp @@ -109,13 +109,13 @@ RelativeLayout::SetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, } // release to relation if exist relation - result re = E_SYSTEM; + result r = E_SYSTEM; if (GetRelation(item, itemEdge, null) != null) { - re = UnsetRelation(item, itemEdge); - if (re != E_SUCCESS) + r = UnsetRelation(item, itemEdge); + if (r != E_SUCCESS) { - return re; + return r; } } @@ -123,30 +123,30 @@ RelativeLayout::SetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, RelativeItemInfo* pTargetItemInfo = null; if (pTargetNode != null) { - pTargetItemInfo = dynamic_cast (pTargetNode->GetItemInfo()); + pTargetItemInfo = static_cast (pTargetNode->GetItemInfo()); if (pTargetItemInfo == null) { return E_INVALID_STATE; } rollBackRefCount = pTargetItemInfo->__refCount; } - re = SetAlignment(*pSourceNode, itemEdge, pTargetNode, targetEdge); - if (re != E_SUCCESS) + r = SetAlignment(*pSourceNode, itemEdge, pTargetNode, targetEdge); + if (r != E_SUCCESS) { - return re; + return r; } if (pTargetItemInfo != null && IncreaseReferenceCount(*pSourceNode) != E_SUCCESS) { - re = UnsetAlignment(*pSourceNode, itemEdge, null); - if (re != E_SUCCESS) + r = UnsetAlignment(*pSourceNode, itemEdge, null); + if (r != E_SUCCESS) { SysAssert(false); } DecreaseReferenceCount(*pSourceNode, *pTargetNode); pTargetItemInfo->__refCount = rollBackRefCount; - re = IncreaseReferenceCount(*pTargetNode); - if (re != E_SUCCESS) + r = IncreaseReferenceCount(*pTargetNode); + if (r != E_SUCCESS) { SysAssert(false); } @@ -154,8 +154,8 @@ RelativeLayout::SetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, ProxyListNode* pCurNode = pProxyList->GetFirstNode(); while (pCurNode) { - re = IncreaseReferenceCount(*pCurNode); - if (re != E_SUCCESS) + r = IncreaseReferenceCount(*pCurNode); + if (r != E_SUCCESS) { SysAssert(false); } @@ -187,13 +187,13 @@ RelativeLayout::UnsetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdg return E_INVALID_ARG; } - result re = E_SYSTEM; + result r = E_SYSTEM; ProxyListNode* pTargetNode = null; LayoutItemProxy* pTargetProxy = null; - re = UnsetAlignment(*pItemNode, itemEdge, &pTargetProxy); - if (re != E_SUCCESS) + r = UnsetAlignment(*pItemNode, itemEdge, &pTargetProxy); + if (r != E_SUCCESS) { - return re; + return r; } if (pTargetProxy != null) { @@ -244,10 +244,10 @@ RelativeLayout::UnsetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdg } // Nodes Recalculation - re = IncreaseReferenceCount(*pTargetNode); - if (re != E_SUCCESS) + r = IncreaseReferenceCount(*pTargetNode); + if (r != E_SUCCESS) { - return re; + return r; } return E_SUCCESS; @@ -274,9 +274,9 @@ RelativeLayout::GetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, } result -RelativeLayout::OnLayout(int width, int height, bool updateLayouting) +RelativeLayout::OnLayout(float width, float height, bool updateLayouting) { - result re = E_SUCCESS; + result r = E_SUCCESS; ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); @@ -286,7 +286,7 @@ RelativeLayout::OnLayout(int width, int height, bool updateLayouting) return E_INVALID_STATE; } - LayoutRect windowRect = {0, 0, width, height}; + LayoutRect windowRect = {0.0f, 0.0f, width, height}; LayoutRect clientRect; pContainerProxy->ConvertWindowToClientBounds(windowRect, clientRect); @@ -294,8 +294,8 @@ RelativeLayout::OnLayout(int width, int height, bool updateLayouting) clientRect.x = layoutRect.x; clientRect.y = layoutRect.y; - int correctionWidth = windowRect.w - clientRect.w; - int correctionHeight = windowRect.h - clientRect.h; + float correctionWidth = windowRect.w - clientRect.w; + float correctionHeight = windowRect.h - clientRect.h; LayoutMatchMode widthMatchMode = pContainerProxy->GetItemWidthMatchMode(); @@ -303,19 +303,19 @@ RelativeLayout::OnLayout(int width, int height, bool updateLayouting) SetLayoutRect(clientRect); - int childrenMaxPosX = 0; - int childrenMaxPosY = 0; - LayoutRect childRect = {0, 0, 0, 0}; + float childrenMaxPosX = 0.0f; + float childrenMaxPosY = 0.0f; + LayoutRect childRect = {0.0f, 0.0f, 0.0f, 0.0f}; ProxyListNode* pCurNode = pProxyList->GetFirstNode(); while (pCurNode != null) { - re = CalculatePosition(*pCurNode); - re = CalculateCenter(*pCurNode, re == E_SUCCESS); - if (re != E_SUCCESS) + r = CalculatePosition(*pCurNode); + r = CalculateCenter(*pCurNode, r == E_SUCCESS); + if (r != E_SUCCESS) { - return re; + return r; } LayoutItemProxy* pItemProxy = pCurNode->GetItemProxy(); @@ -382,13 +382,13 @@ RelativeLayout::OnLayout(int width, int height, bool updateLayouting) pCurNode = pProxyList->GetFirstNode(); while (pCurNode) { - re = CalculatePosition(*pCurNode); - re = CalculateCenter(*pCurNode, re == E_SUCCESS); + r = CalculatePosition(*pCurNode); + r = CalculateCenter(*pCurNode, r == E_SUCCESS); pCurNode = pProxyList->GetNextNode(*pCurNode); } } - return re; + return r; } result @@ -398,7 +398,7 @@ RelativeLayout::IncreaseReferenceCount(ProxyListNode& node) SysAssertf(pProxyList != null, "ProxyList is invalid."); ProxyListNode* pTargetNode = null; - result re = E_SUCCESS; + result r = E_SUCCESS; for (int i = EDGE_LEFT; i < EDGE_ALL; i++) { LayoutItemProxy* pProxy = GetAlignment(node, static_cast (i)); @@ -409,18 +409,18 @@ RelativeLayout::IncreaseReferenceCount(ProxyListNode& node) pTargetNode = pProxyList->GetNode(*(pProxy->GetItem())); if (pTargetNode != null) { - re = IncreaseReference(*pTargetNode, node); - if (re == E_SUCCESS) + r = IncreaseReference(*pTargetNode, node); + if (r == E_SUCCESS) { - re = IncreaseReferenceCount(*pTargetNode); - if (re != E_SUCCESS) + r = IncreaseReferenceCount(*pTargetNode); + if (r != E_SUCCESS) { - return re; + return r; } } else { - return re; + return r; } } } @@ -493,7 +493,7 @@ RelativeLayout::AlignItemNodeMaxRefMove() result RelativeLayout::DeleteTargetInfo(ProxyListNode& targetNode, ProxyListNode& deleteNode) { - RelativeItemInfo* pItemInfo = dynamic_cast (targetNode.GetItemInfo()); + RelativeItemInfo* pItemInfo = static_cast (targetNode.GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -516,11 +516,9 @@ RelativeLayout::CalculatePosition(ProxyListNode& curNode) ItemMargin curItemMargin = {0, 0, 0, 0}; LayoutRect curItemRect = {0, 0, 0, 0}; LayoutPoint targetPosition = {0, 0}; - result re = E_SYSTEM; - int relatedRight = 0; - int relatedBottom = 0; + result r = E_SYSTEM; - pCurItemInfo = dynamic_cast (curNode.GetItemInfo()); + pCurItemInfo = static_cast (curNode.GetItemInfo()); pCurProxy = curNode.GetItemProxy(); if (pCurItemInfo == null || pCurProxy == null) @@ -531,32 +529,39 @@ RelativeLayout::CalculatePosition(ProxyListNode& curNode) curItemRect = pCurProxy->GetItemBaseRect(); GetItemMargin(*(pCurProxy->GetItem()), curItemMargin); + r = pCurProxy->Measure(curItemRect.w, curItemRect.h); + if (r != E_SUCCESS) + { + return r; + } + pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h); + if (pCurItemInfo->__pTarget[EDGE_LEFT] != null) { - re = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_LEFT], pCurItemInfo->__targetEdge[EDGE_LEFT], targetPosition); - if (re != E_SUCCESS) + r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_LEFT], pCurItemInfo->__targetEdge[EDGE_LEFT], targetPosition); + if (r != E_SUCCESS) { - return re; + return r; } curItemRect.x = targetPosition.x + curItemMargin.left; } if (pCurItemInfo->__pTarget[EDGE_TOP] != null) { - re = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_TOP], pCurItemInfo->__targetEdge[EDGE_TOP], targetPosition); - if (re != E_SUCCESS) + r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_TOP], pCurItemInfo->__targetEdge[EDGE_TOP], targetPosition); + if (r != E_SUCCESS) { - return re; + return r; } curItemRect.y = targetPosition.y + curItemMargin.top; } if (pCurItemInfo->__pTarget[EDGE_RIGHT] != null) { - re = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_RIGHT], pCurItemInfo->__targetEdge[EDGE_RIGHT], targetPosition); - if (re != E_SUCCESS) + r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_RIGHT], pCurItemInfo->__targetEdge[EDGE_RIGHT], targetPosition); + if (r != E_SUCCESS) { - return re; + return r; } if (pCurItemInfo->__pTarget[EDGE_LEFT] != null) @@ -564,15 +569,14 @@ RelativeLayout::CalculatePosition(ProxyListNode& curNode) curItemRect.w = targetPosition.x - curItemRect.x - curItemMargin.right; } curItemRect.x = targetPosition.x - curItemMargin.right - curItemRect.w; - relatedRight = curItemRect.x + curItemRect.w; } if (pCurItemInfo->__pTarget[EDGE_BOTTOM] != null) { - re = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_BOTTOM], pCurItemInfo->__targetEdge[EDGE_BOTTOM], targetPosition); - if (re != E_SUCCESS) + r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_BOTTOM], pCurItemInfo->__targetEdge[EDGE_BOTTOM], targetPosition); + if (r != E_SUCCESS) { - return re; + return r; } if (pCurItemInfo->__pTarget[EDGE_TOP] != null) @@ -580,33 +584,22 @@ RelativeLayout::CalculatePosition(ProxyListNode& curNode) curItemRect.h = targetPosition.y - curItemRect.y - curItemMargin.bottom; } curItemRect.y = targetPosition.y - curItemMargin.bottom - curItemRect.h; - relatedBottom = curItemRect.y + curItemRect.h; } - re = pCurProxy->Measure(curItemRect.w, curItemRect.h); - if (re != E_SUCCESS) + r = pCurProxy->Measure(curItemRect.w, curItemRect.h); + if (r != E_SUCCESS) { - return re; + return r; } pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h); - if (pCurItemInfo->__pTarget[EDGE_LEFT] == null && pCurItemInfo->__pTarget[EDGE_RIGHT] != null) - { - curItemRect.x = relatedRight - curItemRect.w; - } - - if (pCurItemInfo->__pTarget[EDGE_TOP] == null && pCurItemInfo->__pTarget[EDGE_BOTTOM] != null) + r = pCurProxy->SetItemWindowRect(curItemRect); + if (r != E_SUCCESS) { - curItemRect.y = relatedBottom - curItemRect.h; + return r; } - re = pCurProxy->SetItemWindowRect(curItemRect); - if (re != E_SUCCESS) - { - return re; - } - - return re; + return r; } result @@ -616,9 +609,9 @@ RelativeLayout::CalculateCenter(ProxyListNode& curNode, bool calcPosition) RelativeItemInfo* pCurItemInfo = null; LayoutItemProxy* pCurProxy = null; LayoutRect curItemRect = {0, 0, 0, 0}; - result re = E_SYSTEM; + result r = E_SYSTEM; - pCurItemInfo = dynamic_cast (curNode.GetItemInfo()); + pCurItemInfo = static_cast (curNode.GetItemInfo()); pCurProxy = curNode.GetItemProxy(); if (pCurItemInfo == null || pCurProxy == null) @@ -640,45 +633,43 @@ RelativeLayout::CalculateCenter(ProxyListNode& curNode, bool calcPosition) curItemRect = pCurProxy->GetItemBaseRect(); } - re = pCurProxy->Measure(curItemRect.w, curItemRect.h); - if (re != E_SUCCESS) + r = pCurProxy->Measure(curItemRect.w, curItemRect.h); + if (r != E_SUCCESS) { - return re; + return r; } pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h); if (pCurItemInfo->__pTarget[EDGE_HCENTER] == __pTargetParent) { - //targetRect = __pTarget[EDGE_HCENTER]->GetItemWindowRect(); targetRect = GetLayoutRect(); - int targetWidth = targetRect.w; - int margin = ((targetWidth - curItemRect.w) >> 1); + float targetWidth = targetRect.w; + float margin = ((targetWidth - curItemRect.w) / 2); curItemRect.x = margin + targetRect.x; } if (pCurItemInfo->__pTarget[EDGE_VCENTER] == __pTargetParent) { - //targetRect = __pTarget[EDGE_VCENTER]->GetItemWindowRect(); targetRect = GetLayoutRect(); - int targetHeight = targetRect.h; - int margin = ((targetHeight - curItemRect.h) >> 1); + float targetHeight = targetRect.h; + float margin = ((targetHeight - curItemRect.h) / 2); curItemRect.y = margin + targetRect.y; } - re = pCurProxy->Measure(curItemRect.w, curItemRect.h); - if (re != E_SUCCESS) + r = pCurProxy->Measure(curItemRect.w, curItemRect.h); + if (r != E_SUCCESS) { - return re; + return r; } pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h); - re = pCurProxy->SetItemWindowRect(curItemRect); - if (re != E_SUCCESS) + r = pCurProxy->SetItemWindowRect(curItemRect); + if (r != E_SUCCESS) { - return re; + return r; } - return re; + return r; } bool @@ -713,7 +704,6 @@ RelativeLayout::CheckTargetEdge(const RelativeLayoutEdge sourceEdge, const Relat result RelativeLayout::SetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge sourceEdge, ProxyListNode* pTargetNode, const RelativeLayoutEdge targetEdge) { - //RelativeLayoutEdge realTargetEdge = const_cast(targetEdge); RelativeLayoutEdge realTargetEdge = targetEdge; if (realTargetEdge == EDGE_NONE) { @@ -725,7 +715,7 @@ RelativeLayout::SetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge return E_INVALID_ARG; } - RelativeItemInfo* pSourceItemInfo = dynamic_cast (sourceNode.GetItemInfo()); + RelativeItemInfo* pSourceItemInfo = static_cast (sourceNode.GetItemInfo()); if (pSourceItemInfo == null || pSourceItemInfo->__targetEdge[sourceEdge] != EDGE_NONE || pSourceItemInfo->__pTarget[sourceEdge] != null) { @@ -755,7 +745,7 @@ RelativeLayout::SetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge result RelativeLayout::UnsetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge sourceEdge, LayoutItemProxy** ppTargetProxy) { - RelativeItemInfo* pSourceItemInfo = dynamic_cast (sourceNode.GetItemInfo()); + RelativeItemInfo* pSourceItemInfo = static_cast (sourceNode.GetItemInfo()); if (pSourceItemInfo == null) { @@ -795,7 +785,7 @@ RelativeLayout::GetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge { SysTryReturn(NID_UI, sourceEdge >= EDGE_NONE, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Argument is out of range."); SysTryReturn(NID_UI, sourceEdge <= EDGE_VCENTER, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Argument is out of range."); - RelativeItemInfo* pSourceItemInfo = dynamic_cast (sourceNode.GetItemInfo()); + RelativeItemInfo* pSourceItemInfo = static_cast (sourceNode.GetItemInfo()); SysTryReturn(NID_UI, pSourceItemInfo, null, E_INVALID_STATE, "[E_INVALID_STATE] RelativeItemInfo is invalid."); @@ -820,8 +810,8 @@ RelativeLayout::IncreaseReference(ProxyListNode& targetNode, ProxyListNode& sour ProxyList* pProxyList = GetProxyList(); SysAssertf(pProxyList != null, "ProxyList is invalid."); - RelativeItemInfo* pTargetItemInfo = dynamic_cast (targetNode.GetItemInfo()); - RelativeItemInfo* pSourceItemInfo = dynamic_cast (sourceNode.GetItemInfo()); + RelativeItemInfo* pTargetItemInfo = static_cast (targetNode.GetItemInfo()); + RelativeItemInfo* pSourceItemInfo = static_cast (sourceNode.GetItemInfo()); if (pTargetItemInfo == null || pSourceItemInfo == null) { @@ -859,18 +849,14 @@ RelativeLayout::GetTargetNode(ProxyListNode& node, RelativeLayoutEdge sourceEdge result RelativeLayout::SetZeroReference(ProxyListNode& node, ProxyListNode& baseNode) { - RelativeItemInfo* pTargetItemInfo = dynamic_cast (node.GetItemInfo()); + RelativeItemInfo* pTargetItemInfo = static_cast (node.GetItemInfo()); if (pTargetItemInfo == null) { return E_INVALID_STATE; } - //int refCount = ((RelativeProxyList*)_pProxyList)->GetReferenceCount(pBaseNode) + 1; - - //if (refCount == pTargetItemInfo->__refCount) - //{ pTargetItemInfo->__refCount = 0; - //} + return E_SUCCESS; } @@ -920,7 +906,7 @@ RelativeLayout::GetTargetPosition(LayoutItemProxy* pTargetProxy, const RelativeL RelativeProxyList* RelativeLayout::GetRelativeProxyList(void) { - return dynamic_cast (GetProxyList()); + return static_cast (GetProxyList()); } }}} // Tizen::Ui::_Layout diff --git a/src/ui/layout/FUi_LayoutTableLayout.cpp b/src/ui/layout/FUi_LayoutTableLayout.cpp index 5c2539d..d07cfed 100755 --- a/src/ui/layout/FUi_LayoutTableLayout.cpp +++ b/src/ui/layout/FUi_LayoutTableLayout.cpp @@ -26,6 +26,7 @@ #include #include #include +#include "FUi_Math.h" #include "FUi_LayoutTableLayout.h" #include "FUi_LayoutLayoutItemProxy.h" #include "FUi_LayoutProxyList.h" @@ -81,7 +82,7 @@ TableLayout::CreateTableLayoutN(void) } result -TableLayout::CreateTable(int row, int column, int spacing) +TableLayout::CreateTable(int row, int column, float spacing) { if (row < 1 || column < 1) { @@ -125,8 +126,8 @@ TableLayout::CalculateSize() return E_SUCCESS; } - int nextPosX = 0; //-__pColInfo[0].widthSpacing + m_nPosX; - int nextPosY = 0; //-__pRowInfo[0].heightSpacing + m_nPosY; + float nextPosX = 0.0f; + float nextPosY = 0.0f; __shrinkRowCount = 0; __shrinkColumnCount = 0; @@ -135,10 +136,10 @@ TableLayout::CalculateSize() for (int j = 0; j < __column; j++) { - __pColInfo[j].x = 0; - __pColInfo[j].width = 0; - __pColInfo[j].maxWidth = 0; - __pColInfo[j].mergedWidth = 0; + __pColInfo[j].x = 0.0f; + __pColInfo[j].width = 0.0f; + __pColInfo[j].maxWidth = 0.0f; + __pColInfo[j].mergedWidth = 0.0f; } ProxyListNode* pCurNode = null; @@ -147,17 +148,17 @@ TableLayout::CalculateSize() for (int i = 0; i < __row; i++) { - __pRowInfo[i].y = 0; - __pRowInfo[i].height = 0; - __pRowInfo[i].maxHeight = 0; - __pRowInfo[i].mergedHeight = 0; + __pRowInfo[i].y = 0.0f; + __pRowInfo[i].height = 0.0f; + __pRowInfo[i].maxHeight = 0.0f; + __pRowInfo[i].mergedHeight = 0.0f; for (int j = 0; j < __column; j++) { pCurNode = GetNode(i, j); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); pItemProxy = pCurNode->GetItemProxy(); if (pItemInfo == null || pItemProxy == null) @@ -236,7 +237,7 @@ TableLayout::CalculateSize() __shrinkRowCount++; } - if (__pRowInfo[i].maxHeight != 0) + if (!_FloatHardCompare(__pRowInfo[i].maxHeight, 0.0f)) { __pRowInfo[i].height = __pRowInfo[i].maxHeight; } @@ -256,7 +257,7 @@ TableLayout::CalculateSize() __shrinkColumnCount++; } - if (__pColInfo[j].maxWidth != 0) + if (!_FloatHardCompare(__pColInfo[j].maxWidth, 0.0f)) { __pColInfo[j].width = __pColInfo[j].maxWidth; } @@ -267,8 +268,8 @@ TableLayout::CalculateSize() pItemInfo = null; pItemProxy = null; - int mergedHeight = 0; - int mergedWidth = 0; + float mergedHeight = 0; + float mergedWidth = 0; for (int i = __row - 1; i >= 0; i--) { if (!__pRowInfo[i].rowCollapsed) @@ -280,7 +281,7 @@ TableLayout::CalculateSize() pCurNode = GetNode(i, j); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -295,7 +296,7 @@ TableLayout::CalculateSize() pItemProxy->GetMeasuredSize(mergedWidth, mergedHeight); - int rowHeightSum = 0; + float rowHeightSum = 0; if (startRow == 0) { rowHeightSum -= __pRowInfo[startRow].heightSpacing; @@ -309,7 +310,7 @@ TableLayout::CalculateSize() __pRowInfo[startRow].height += mergedHeight - rowHeightSum; } - int colWidthSum = 0; + float colWidthSum = 0; if (startColumn == 0) { colWidthSum -= __pColInfo[startColumn].widthSpacing; @@ -373,8 +374,8 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) LayoutRect layoutRect = GetLayoutRect(); - int shrinkTotalWidth = layoutRect.w - containerRect.w; - int shrinkTotalHeight = layoutRect.h - containerRect.h; + float shrinkTotalWidth = layoutRect.w - containerRect.w; + float shrinkTotalHeight = layoutRect.h - containerRect.h; int shrinkColumnCount = __shrinkColumnCount; int shrinkRowCount = __shrinkRowCount; @@ -412,18 +413,18 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) for (int j = 0; j < __column; j++) { int shrinkWidth = shrinkTotalWidth / shrinkColumnCount; - int shrinkedColWidth = __pColInfo[j].width; + float shrinkedColWidth = __pColInfo[j].width; if (__pColInfo[j].widthShrinkable && !__pColInfo[j].columnCollapsed) { shrinkedColWidth -= shrinkWidth; - if (shrinkedColWidth < 0) + if (shrinkedColWidth < 0.0f) { shrinkWidth += shrinkedColWidth; - __pColInfo[j].width = 0; - shrinkedColWidth = 0; + __pColInfo[j].width = 0.0f; + shrinkedColWidth = 0.0f; __pColInfo[j].widthShrinkable = false; } @@ -434,7 +435,7 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo != null && shrinkedColWidth < pItemInfo->__minSize.w) { @@ -459,7 +460,7 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) } } - int nextPosX = -__pColInfo[0].widthSpacing + layoutRect.x; + float nextPosX = -__pColInfo[0].widthSpacing + layoutRect.x; for (int j = 0; j < __column; j++) { @@ -483,10 +484,10 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) } nextPosX = -__pColInfo[0].widthSpacing + layoutRect.x; - int shrinkWidth = 0; - if (shrinkTotalWidth != 0 && shrinkColumnCount != 0) + float shrinkWidth = 0.0f; + if (!_FloatCompare(shrinkTotalWidth, 0.0f) && shrinkColumnCount != 0) { - shrinkWidth = shrinkTotalWidth % shrinkColumnCount; + shrinkWidth = (int)shrinkTotalWidth % shrinkColumnCount; } bool shrinkableColumn = true; @@ -509,9 +510,9 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } - if ((pItemInfo != null && ((__pColInfo[j].width - 1) < pItemInfo->__minSize.w)) || (__pColInfo[j].width - 1) < 0) + if ((pItemInfo != null && ((__pColInfo[j].width - 1.0f) < pItemInfo->__minSize.w)) || (__pColInfo[j].width - 1.0f) < 0.0f) { pShrinkedColumns[shrinkedColumnCount++] = j; __pColInfo[j].widthShrinkable = false; @@ -520,12 +521,22 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) } } - if (__pColInfo[j].widthShrinkable && shrinkWidth > 0) + if (__pColInfo[j].widthShrinkable && shrinkWidth > 0.0f) { - __pColInfo[j].width--; - layoutRect.w--; - shrinkWidth--; - shrinkableColumn = true; + if (shrinkWidth < 1.0f) + { + __pColInfo[j].width -= shrinkWidth; + layoutRect.w -= shrinkWidth; + shrinkWidth = 0.0f; + shrinkableColumn = true; + } + else + { + __pColInfo[j].width--; + layoutRect.w--; + shrinkWidth--; + shrinkableColumn = true; + } } } } @@ -542,7 +553,7 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) delete[] pShrinkedColumns; } - if (shrinkTotalHeight > 0 && __shrinkRowCount > 0) + if (shrinkTotalHeight > 0.0f && __shrinkRowCount > 0) { if (pContainerProxy->GetItemHeightMatchMode() == WRAP_CONTENT) { @@ -565,18 +576,18 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) for (int i = 0; i < __row; i++) { int shrinkHeight = shrinkTotalHeight / shrinkRowCount; - int shrinkedRowHeight = __pRowInfo[i].height; + float shrinkedRowHeight = __pRowInfo[i].height; if (__pRowInfo[i].heightShrinkable && !__pRowInfo[i].rowCollapsed) { shrinkedRowHeight -= shrinkHeight; - if (shrinkedRowHeight < 0) + if (shrinkedRowHeight < 0.0f) { shrinkHeight += shrinkedRowHeight; - __pRowInfo[i].height = 0; - shrinkedRowHeight = 0; + __pRowInfo[i].height = 0.0f; + shrinkedRowHeight = 0.0f; __pRowInfo[i].heightShrinkable = false; } @@ -587,7 +598,7 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo != null && shrinkedRowHeight < pItemInfo->__minSize.h) { @@ -612,7 +623,7 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) } } - int nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; + float nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; for (int i = 0; i < __row; i++) { @@ -635,10 +646,10 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) } nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; - int shrinkHeight = 0; - if (shrinkTotalHeight != 0 && shrinkRowCount != 0) + float shrinkHeight = 0.0f; + if (!_FloatHardCompare(shrinkTotalHeight, 0.0f) && shrinkRowCount != 0) { - shrinkHeight = shrinkTotalHeight % shrinkRowCount; + shrinkHeight = (int)shrinkTotalHeight % shrinkRowCount; } bool shrinkableRow = true; @@ -659,9 +670,9 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } - if ((pItemInfo != null && ((__pRowInfo[i].height - 1) < pItemInfo->__minSize.h)) || (__pRowInfo[i].height - 1) < 0) + if ((pItemInfo != null && ((__pRowInfo[i].height - 1.0f) < pItemInfo->__minSize.h)) || (__pRowInfo[i].height - 1.0f) < 0.0f) { pShrinkedRows[shrinkedRowCount++] = i; __pRowInfo[i].heightShrinkable = false; @@ -672,10 +683,20 @@ TableLayout::CalculateShrinkCell(const LayoutRect windowRect) if (__pRowInfo[i].heightShrinkable && shrinkHeight > 0) { - __pRowInfo[i].height--; - layoutRect.h--; - shrinkHeight--; - shrinkableRow = true; + if (shrinkHeight < 1.0f) + { + __pRowInfo[i].height -= shrinkHeight; + layoutRect.h -= shrinkHeight; + shrinkHeight = 0.0f; + shrinkableRow = true; + } + else + { + __pRowInfo[i].height--; + layoutRect.h--; + shrinkHeight--; + shrinkableRow = true; + } } } } @@ -713,8 +734,8 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) LayoutRect layoutRect = GetLayoutRect(); - int stretchTotalWidth = containerRect.w - layoutRect.w; - int stretchTotalHeight = containerRect.h - layoutRect.h; + float stretchTotalWidth = containerRect.w - layoutRect.w; + float stretchTotalHeight = containerRect.h - layoutRect.h; int stretchColumnCount = __stretchColumnCount; int stretchRowCount = __stretchRowCount; @@ -753,8 +774,8 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) { if (__pColInfo[j].widthStretchable && !__pColInfo[j].columnCollapsed) { - int maxWidth = 0; - int stretchedColWidth = __pColInfo[j].width; + float maxWidth = 0.0f; + float stretchedColWidth = __pColInfo[j].width; stretchedColWidth += stretchWidth; for (int i = 0; i < __row; i++) { @@ -762,7 +783,7 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo != null && maxWidth < pItemInfo->__maxSize.w) { @@ -805,10 +826,10 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) } } nextPosX = -__pColInfo[0].widthSpacing + layoutRect.x; - int stretchWidth = 0; - if (stretchTotalWidth != 0 && stretchColumnCount != 0) + float stretchWidth = 0.0f; + if (!_FloatHardCompare(stretchTotalWidth, 0.0f) && stretchColumnCount) { - stretchWidth = stretchTotalWidth % stretchColumnCount; + stretchWidth = (int)stretchTotalWidth % stretchColumnCount; } bool stretchableColumn = true; @@ -842,10 +863,20 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) if (__pColInfo[j].widthStretchable && stretchWidth > 0) { - __pColInfo[j].width++; - layoutRect.w++; - stretchWidth--; - stretchableColumn = true; + if (stretchWidth < 1.0f) + { + __pColInfo[j].width += stretchWidth; + layoutRect.w += stretchWidth; + stretchWidth = 0.0f; + stretchableColumn = true; + } + else + { + __pColInfo[j].width++; + layoutRect.w++; + stretchWidth--; + stretchableColumn = true; + } } } } @@ -888,8 +919,8 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) { if (__pRowInfo[i].heightStretchable && !__pRowInfo[i].rowCollapsed) { - int maxHeight = 0; - int stretchedRowHeight = __pRowInfo[i].height; + float maxHeight = 0.0f; + float stretchedRowHeight = __pRowInfo[i].height; stretchedRowHeight += stretchHeight; for (int j = 0; j < __column; j++) @@ -898,7 +929,7 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo != null && maxHeight < pItemInfo->__maxSize.h) { @@ -923,7 +954,7 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) } } - int nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; + float nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; for (int i = 0; i < __row; i++) { if (!__pRowInfo[i].rowCollapsed) @@ -941,10 +972,10 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) } nextPosY = -__pRowInfo[0].heightSpacing + layoutRect.y; - int stretchHeight = 0; - if (stretchTotalHeight != 0 && stretchRowCount != 0) + float stretchHeight = 0.0f; + if (!_FloatHardCompare(stretchTotalHeight, 0.0f) && stretchRowCount != 0) { - stretchHeight = stretchTotalHeight % stretchRowCount; + stretchHeight = (int)stretchTotalHeight % stretchRowCount; } bool stretchableRow = true; @@ -965,7 +996,7 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo != null && ((__pRowInfo[i].height + 1) > pItemInfo->__maxSize.h) && !pItemInfo->__merged) { @@ -976,12 +1007,22 @@ TableLayout::CalculateStretchCell(const LayoutRect windowRect) } } - if (__pRowInfo[i].heightStretchable && stretchHeight > 0) + if (__pRowInfo[i].heightStretchable && stretchHeight > 0.0f) { - __pRowInfo[i].height++; - layoutRect.h++; - stretchHeight--; - stretchableRow = true; + if (stretchHeight < 1.0f) + { + __pRowInfo[i].height += stretchHeight; + layoutRect.h += stretchHeight; + stretchHeight = 0.0f; + stretchableRow = true; + } + else + { + __pRowInfo[i].height++; + layoutRect.h++; + stretchHeight--; + stretchableRow = true; + } } } } @@ -1047,7 +1088,7 @@ TableLayout::Merge(int startRow, int startCol, int endRow, int endCol) pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); } if (pItemInfo == null) { @@ -1080,7 +1121,7 @@ TableLayout::Merge(int startRow, int startCol, int endRow, int endCol) pCurNode = GetNode(startRow, startCol); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1094,7 +1135,7 @@ TableLayout::Merge(int startRow, int startCol, int endRow, int endCol) } result -TableLayout::OnLayout(int width, int height, bool updateLayouting) +TableLayout::OnLayout(float width, float height, bool updateLayouting) { LayoutRect layoutRect = GetLayoutRect(); LayoutRect windowRect = {layoutRect.x, layoutRect.y, width, height}; @@ -1148,7 +1189,7 @@ TableLayout::AdjustTableLayout(const LayoutRect windowRect, bool updateLayouting pItemInfo = null; if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); pItemProxy = pCurNode->GetItemProxy(); } if (pItemInfo != null && pItemInfo->__enable) @@ -1186,7 +1227,7 @@ TableLayout::AdjustTableLayout(const LayoutRect windowRect, bool updateLayouting (__pRowInfo[i].heightStretchable && __rowStretchable) || pItemInfo->__fillHeight) { - int height = 0; + float height = 0; r = pItemProxy->Measure(rect.w, cellRect.h); if (r != E_SUCCESS) { @@ -1212,7 +1253,7 @@ TableLayout::AdjustTableLayout(const LayoutRect windowRect, bool updateLayouting (__pColInfo[j].widthStretchable && __columnStretchable) || pItemInfo->__fillWidth) { - int width = 0; + float width = 0; r = pItemProxy->Measure(cellRect.w, rect.h); if (r != E_SUCCESS) { @@ -1257,8 +1298,8 @@ TableLayout::AdjustTableLayout(const LayoutRect windowRect, bool updateLayouting containerRect.x = windowRect.x; containerRect.y = windowRect.y; - int correctionWidth = windowRect.w - containerRect.w; - int correctionHeight = windowRect.h - containerRect.h; + float correctionWidth = windowRect.w - containerRect.w; + float correctionHeight = windowRect.h - containerRect.h; LayoutRect layoutRect = GetLayoutRect(); if (widthMode == WRAP_CONTENT) @@ -1367,7 +1408,7 @@ TableLayout::AddItem(LayoutItem& item, int row, int column, bool mergedState) { return E_INVALID_STATE; } - TableItemInfo* pAddItemInfo = dynamic_cast (pAddNode->GetItemInfo()); + TableItemInfo* pAddItemInfo = static_cast (pAddNode->GetItemInfo()); if (pAddItemInfo == null) { return E_INVALID_STATE; @@ -1440,7 +1481,7 @@ TableLayout::SetItemPosition(const LayoutItem& item, int row, int column) SysTryReturn(NID_UI, (pTargetNode == null), E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] The (%d, %d) cell is not available.", row, column); int cellIndex = MakeCellID(row, column); - TableItemInfo* pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1472,7 +1513,7 @@ TableLayout::GetItemPosition(const LayoutItem& item, int& row, int& column) cons SysTryReturn(NID_UI, (pCurNode != null), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Controls have not been added to the container."); - TableItemInfo* pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1550,7 +1591,7 @@ TableLayout::DeleteRow(int row) pCurNode = GetNode(i, j); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1613,7 +1654,7 @@ TableLayout::DeleteColumn(int column) pCurNode = GetNode(i, j); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1664,7 +1705,7 @@ TableLayout::CalculateMergeCell(int row, int column, LayoutSize& size) return E_INVALID_ARG; } - TableItemInfo* pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1681,7 +1722,7 @@ TableLayout::CalculateMergeCell(int row, int column, LayoutSize& size) if (pItemInfo->__mergeEndPoint.y > NOT_MERGED && !__pColInfo[pItemInfo->__mergeEndPoint.y].columnCollapsed) { - int endColPos = __pColInfo[pItemInfo->__mergeEndPoint.y].x; + float endColPos = __pColInfo[pItemInfo->__mergeEndPoint.y].x; size.w = __pColInfo[pItemInfo->__mergeEndPoint.y].width + endColPos - __pColInfo[column].x; } else @@ -1724,7 +1765,7 @@ TableLayout::CalculateAlign(LayoutItemProxy& itemProxy, LayoutRect cellRect, Lay { if (cellRect.h > itemRect.h) { - itemRect.y = cellRect.y + ((cellRect.h - itemRect.h) >> 1); + itemRect.y = cellRect.y + ((cellRect.h - itemRect.h) / 2); } else { @@ -1751,7 +1792,7 @@ TableLayout::CalculateAlign(LayoutItemProxy& itemProxy, LayoutRect cellRect, Lay { if (cellRect.w > itemRect.w) { - itemRect.x = cellRect.x + ((cellRect.w - itemRect.w) >> 1); + itemRect.x = cellRect.x + ((cellRect.w - itemRect.w) / 2); } else { @@ -1790,7 +1831,7 @@ TableLayout::GetCellSize(int cellIndex, LayoutRect& rect) ProxyListNode* pCurNode = GetNode(row, column); if (pCurNode != null) { - TableItemInfo* pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1843,7 +1884,7 @@ TableLayout::SetColumnCollapsed(int columnIndex, bool collapsed) pCurNode = GetNode(i, columnIndex); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -1904,7 +1945,7 @@ TableLayout::SetRowCollapsed(int rowIndex, bool collapsed) pCurNode = GetNode(rowIndex, i); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -2050,13 +2091,13 @@ TableLayout::GetColumnStretchable(int column) const } result -TableLayout::SetRowSpacing(int row, int heightSpacing) +TableLayout::SetRowSpacing(int row, float heightSpacing) { SysTryReturn(NID_UI, row >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : row(%d)", row); SysTryReturn(NID_UI, row < __row, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Input Argument row over the max row : row(%d), maxRow(%d)", row, __row); - SysTryReturn(NID_UI, heightSpacing >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, + SysTryReturn(NID_UI, heightSpacing >= 0.0f, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : spacing(%d)", heightSpacing); __pRowInfo[row].heightSpacing = heightSpacing; @@ -2066,7 +2107,7 @@ TableLayout::SetRowSpacing(int row, int heightSpacing) } result -TableLayout::GetRowSpacing(int row, int& spacing) const +TableLayout::GetRowSpacing(int row, float& spacing) const { SysTryReturn(NID_UI, row >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : row(%d)", row); @@ -2078,13 +2119,13 @@ TableLayout::GetRowSpacing(int row, int& spacing) const } result -TableLayout::SetColumnSpacing(int column, int widthSpacing) +TableLayout::SetColumnSpacing(int column, float widthSpacing) { SysTryReturn(NID_UI, column >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : column(%d)", column); SysTryReturn(NID_UI, column < __column, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Input Argument column over the max column : column(%d), maxColumn(%d)", column, __column); - SysTryReturn(NID_UI, widthSpacing >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, + SysTryReturn(NID_UI, widthSpacing >= 0.0f, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : spacing(%d)", widthSpacing); __pColInfo[column].widthSpacing = widthSpacing; @@ -2094,7 +2135,7 @@ TableLayout::SetColumnSpacing(int column, int widthSpacing) } result -TableLayout::GetColumnSpacing(int column, int& spacing) const +TableLayout::GetColumnSpacing(int column, float& spacing) const { SysTryReturn(NID_UI, column >= 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Negative input argument : column(%d)", column); @@ -2121,7 +2162,7 @@ TableLayout::SetFillCell(int row, int column, bool fillWidth, bool fillHeight) ProxyListNode* pNode = GetNode(row, column); if (pNode != null) { - TableItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -2148,7 +2189,7 @@ TableLayout::GetFillCell(int row, int column, bool& fillWidth, bool& fillHeight) ProxyListNode* pNode = GetNode(row, column); if (pNode != null) { - TableItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -2171,8 +2212,8 @@ TableLayout::SwapItemPosition(LayoutItem& item1, LayoutItem& item2) SysTryReturn(NID_UI, (pNode1 != null && pNode2 != null), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Control dose not belong to layout.") - TableItemInfo* pItemInfo1 = dynamic_cast (pNode1->GetItemInfo()); - TableItemInfo* pItemInfo2 = dynamic_cast (pNode2->GetItemInfo()); + TableItemInfo* pItemInfo1 = static_cast (pNode1->GetItemInfo()); + TableItemInfo* pItemInfo2 = static_cast (pNode2->GetItemInfo()); if (pItemInfo1 == null || pItemInfo2 == null) { return E_INVALID_STATE; @@ -2239,7 +2280,7 @@ TableLayout::Unmerge(int row, int column) pCurNode = GetNode(row, column); SysTryReturn(NID_UI, pCurNode, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALIDE_ARG] (%d, %d) cell is not merged.", row, column); - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -2263,7 +2304,7 @@ TableLayout::Unmerge(int row, int column) pCurNode = GetNode(i, j); if (pCurNode != null) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo == null) { return E_INVALID_STATE; @@ -2315,7 +2356,7 @@ TableLayout::GetMergeSize(int row, int column, int& rowSize, int& colSize) const colSize = 1; return E_SUCCESS; } - TableItemInfo* pItemInfo = dynamic_cast (pNode->GetItemInfo()); + TableItemInfo* pItemInfo = static_cast (pNode->GetItemInfo()); if (pItemInfo == null || pItemInfo->__enable == false) { return E_INVALID_STATE; @@ -2347,7 +2388,7 @@ TableLayout::GetNode(int row, int column) const int columnIndex = 0; while (pCurNode) { - pItemInfo = dynamic_cast (pCurNode->GetItemInfo()); + pItemInfo = static_cast (pCurNode->GetItemInfo()); if (pItemInfo != null) { rowIndex = GetRow(pItemInfo->__id); diff --git a/src/ui/resource/FUi_ResourceAccessibilityConfig.cpp b/src/ui/resource/FUi_ResourceAccessibilityConfig.cpp old mode 100644 new mode 100755 index 1d2a52a..4242ff1 --- a/src/ui/resource/FUi_ResourceAccessibilityConfig.cpp +++ b/src/ui/resource/FUi_ResourceAccessibilityConfig.cpp @@ -23,8 +23,8 @@ START_UI_CONFIG(ACCESSIBILITY); ADD_COLOR_CONFIG(POINT_TEXT, #0xFF3B73B6); ADD_COLOR_CONFIG(TEXT, #0xFF000000); - ADD_IMAGE_CONFIG(POPUP_BG,#TTS_popup_bg.9.png); - ADD_IMAGE_CONFIG(FOCUS,#TTS_focus.9.png); + ADD_IMAGE_CONFIG(POPUP_BG,#TTS_popup_bg.#.png); + ADD_IMAGE_CONFIG(FOCUS,#TTS_focus.#.png); START_UI_CONFIG_MODE(720x1280); ADD_SHAPE_CONFIG(TITLE_FONT_SIZE, 40); @@ -36,6 +36,11 @@ START_UI_CONFIG(ACCESSIBILITY); ADD_SHAPE_CONFIG(TITLE_HEIGHT, 63); ADD_SHAPE_CONFIG(TEXT_TOP_MARGIN, 16); ADD_SHAPE_CONFIG(TEXT_HEGIHT,42); + ADD_SHAPE_CONFIG(GIANT_FONT_SIZE, 98); + ADD_SHAPE_CONFIG(HUGE_FONT_SIZE, 81); + ADD_SHAPE_CONFIG(LARGE_FONT_SIZE, 64); + ADD_SHAPE_CONFIG(NORMAL_FONT_SIZE, 44); + ADD_SHAPE_CONFIG(SMALL_FONT_SIZE, 36); END_UI_CONFIG_MODE(1280x720); } END_UI_CONFIG(ACCESSIBILITY); diff --git a/src/ui/resource/FUi_ResourceButtonConfig.cpp b/src/ui/resource/FUi_ResourceButtonConfig.cpp index 0f8c766..cd5d9ba 100644 --- a/src/ui/resource/FUi_ResourceButtonConfig.cpp +++ b/src/ui/resource/FUi_ResourceButtonConfig.cpp @@ -25,7 +25,7 @@ START_UI_CONFIG(BUTTON); { ADD_COLOR_CONFIG(BG_NORMAL, $W011); ADD_COLOR_CONFIG(BG_DISABLED, $W011); - ADD_COLOR_CONFIG(BG_PRESSED, $B042); + ADD_COLOR_CONFIG(BG_PRESSED, $B041); ADD_COLOR_CONFIG(BG_HIGHLIGHTED, $B042); ADD_COLOR_CONFIG(TEXT_NORMAL, $F031L1); @@ -33,15 +33,15 @@ START_UI_CONFIG(BUTTON); ADD_COLOR_CONFIG(TEXT_PRESSED, $F031L1P); ADD_COLOR_CONFIG(TEXT_HIGHLIGHTED, $F031L1P); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_button_02.9.png); - ADD_IMAGE_CONFIG(BG_DISABLED, #00_button_02.9.png); - ADD_IMAGE_CONFIG(BG_PRESSED, #00_button_02.9.png); - ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_button_02.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_button_02.#.png); + ADD_IMAGE_CONFIG(BG_DISABLED, #00_button_02.#.png); + ADD_IMAGE_CONFIG(BG_PRESSED, #00_button_02.#.png); + ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_button_02.#.png); - ADD_IMAGE_CONFIG(BG_EFFECT_NORMAL, #00_button_02_ef.9.png); - ADD_IMAGE_CONFIG(BG_EFFECT_DISABLED, #00_button_03_dim_ef.9.png); - ADD_IMAGE_CONFIG(BG_EFFECT_PRESSED, #00_button_02_ef_press.9.png); - ADD_IMAGE_CONFIG(BG_EFFECT_HIGHLIGHTED, #00_button_02_ef_press.9.png); + ADD_IMAGE_CONFIG(BG_EFFECT_NORMAL, #00_button_02_ef.#.png); + ADD_IMAGE_CONFIG(BG_EFFECT_DISABLED, #00_button_03_dim_ef.#.png); + ADD_IMAGE_CONFIG(BG_EFFECT_PRESSED, #00_button_02_ef_press.#.png); + ADD_IMAGE_CONFIG(BG_EFFECT_HIGHLIGHTED, #00_button_02_ef_press.#.png); START_UI_CONFIG_MODE(480x800); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); @@ -52,6 +52,8 @@ START_UI_CONFIG(BUTTON); ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE, 28); ADD_SHAPE_CONFIG(LEFT_MARGIN, 12); ADD_SHAPE_CONFIG(TOP_MARGIN, 4); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 12); + ADD_SHAPE_CONFIG(BOTTOM_MARGIN, 4); ADD_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 60); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); END_UI_CONFIG_MODE(720x1280); @@ -61,6 +63,8 @@ START_UI_CONFIG(BUTTON); ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE, 28); ADD_SHAPE_CONFIG(LEFT_MARGIN, 12); ADD_SHAPE_CONFIG(TOP_MARGIN, 4); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 12); + ADD_SHAPE_CONFIG(BOTTOM_MARGIN, 4) ADD_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 60); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); END_UI_CONFIG_MODE(1280x720); diff --git a/src/ui/resource/FUi_ResourceCheckButtonConfig.cpp b/src/ui/resource/FUi_ResourceCheckButtonConfig.cpp index c9bb3ca..00a64ff 100644 --- a/src/ui/resource/FUi_ResourceCheckButtonConfig.cpp +++ b/src/ui/resource/FUi_ResourceCheckButtonConfig.cpp @@ -53,42 +53,10 @@ START_UI_CONFIG(CHECKBUTTON); ADD_COLOR_CONFIG(DETAILED_ICON_TEXT_HIGHLIGHTED, $F032L1P); ADD_COLOR_CONFIG(DETAILED_ICON_TEXT_SELECTED, $F032L1P); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(BG_DISABLED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(BG_PRESSED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(BG_SELECTED, #00_list_group_bg.9.png); - - ADD_IMAGE_CONFIG(BG_EFFECT_NORMAL, #00_list_group_bg_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(BG_EFFECT_PRESSED, #00_list_group_bg_ef.9.png); //not supported by theme - - ADD_IMAGE_CONFIG(TOP_BG_NORMAL, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(TOP_BG_DISABLED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(TOP_BG_PRESSED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(TOP_BG_HIGHLIGHTED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(TOP_BG_SELECTED, #00_list_group_bg_top.9.png); - - ADD_IMAGE_CONFIG(TOP_BG_EFFECT_NORMAL, #00_list_group_bg_top_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(TOP_BG_EFFECT_PRESSED, #00_list_group_bg_top_ef.9.png); //not supported by theme - - ADD_IMAGE_CONFIG(CENTER_BG_NORMAL, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(CENTER_BG_DISABLED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(CENTER_BG_PRESSED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(CENTER_BG_HIGHLIGHTED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(CENTER_BG_SELECTED, #00_list_group_bg_center.9.png); - - ADD_IMAGE_CONFIG(CENTER_BG_EFFECT_NORMAL, #00_list_group_bg_center_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(CENTER_BG_EFFECT_PRESSED, #00_list_group_bg_center_ef.9.png); //not supported by theme - - ADD_IMAGE_CONFIG(BOTTOM_BG_NORMAL, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(BOTTOM_BG_DISABLED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(BOTTOM_BG_PRESSED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(BOTTOM_BG_HIGHLIGHTED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(BOTTOM_BG_SELECTED, #00_list_group_bg_bottom.9.png); - - ADD_IMAGE_CONFIG(BOTTOM_BG_EFFECT_NORMAL, #00_list_group_bg_bottom_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(BOTTOM_BG_EFFECT_PRESSED, #00_list_group_bg_bottom_ef.9.png); //not supported by theme + ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_NORMAL, $B0223); + ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_NORMAL, $B0222); + // bitmap ADD_IMAGE_CONFIG(MARK_ICON_BG_NORMAL, #00_check_bg.png); ADD_IMAGE_CONFIG(MARK_ICON_BG_DISABLED, #00_check_bg_dim.png); ADD_IMAGE_CONFIG(MARK_ICON_BG_PRESSED, #00_check_bg_press.png); @@ -113,17 +81,23 @@ START_UI_CONFIG(CHECKBUTTON); ADD_IMAGE_CONFIG(ONOFF_ICON_HIGHLIGHTED, #00_button_radio_select.png); ADD_IMAGE_CONFIG(ONOFF_ICON_SELECTED, #00_button_radio_select.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_ON_NORMAL, #00_button_on_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_ON_DISABLED, #00_button_on_dim_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_ON_PRESSED, #00_button_on_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_ON_HIGHLIGHTED, #00_button_on_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_ON_SELECTED, #00_button_on_temp.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_ON_BG_NORMAL, #00_button_on.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_ON_BG_DISABLED, #00_button_on_dim.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_ON_BG_PRESSED, #00_button_on.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_ON_BG_HIGHLIGHTED, #00_button_on.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_ON_BG_SELECTED, #00_button_on.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_OFF_NORMAL, #00_button_off_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_OFF_DISABLED, #00_button_off_dim_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_OFF_PRESSED, #00_button_off_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_OFF_HIGHLIGHTED, #00_button_off_temp.png); - ADD_IMAGE_CONFIG(ONOFF_SLIDING_ICON_OFF_SELECTED, #00_button_off_temp.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_OFF_BG_NORMAL, #00_button_off.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_OFF_BG_DISABLED, #00_button_off_dim.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_OFF_BG_PRESSED, #00_button_off.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_OFF_BG_HIGHLIGHTED, #00_button_off.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_OFF_BG_SELECTED, #00_button_off.png); + + ADD_IMAGE_CONFIG(ONOFF_SLIDING_HANDLER_NORMAL, #00_button_on_off_handler.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_HANDLER_DISABLED, #00_button_on_off_handler_dim.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_HANDLER_PRESSED, #00_button_on_off_handler.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_HANDLER_HIGHLIGHTED, #00_button_on_off_handler.png); + ADD_IMAGE_CONFIG(ONOFF_SLIDING_HANDLER_SELECTED, #00_button_on_off_handler.png); ADD_IMAGE_CONFIG(DETAILED_BG_NORMAL, #00_circle_bg.png); ADD_IMAGE_CONFIG(DETAILED_BG_DISABLED, #00_circle_bg.png); @@ -157,12 +131,17 @@ START_UI_CONFIG(CHECKBUTTON); ADD_SHAPE_CONFIG(TEXT_HEIGHT, 60); ADD_SHAPE_CONFIG(LEFT_MARGIN, 26); ADD_SHAPE_CONFIG(TOP_MARGIN, 10); - ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 64); - ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 64); - ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 128); - ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_HEIGHT, 66); - ADD_SHAPE_CONFIG(DETAILED_BITMAP_WIDTH, 74); - ADD_SHAPE_CONFIG(DETAILED_BITMAP_HEIGHT, 74); + ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 63); + ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 135); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_HEIGHT, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_HANDLER_WIDTH, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_HANDLER_MARGIN, 2); + ADD_SHAPE_CONFIG(DETAILED_BITMAP_WIDTH, 72); + ADD_SHAPE_CONFIG(DETAILED_BITMAP_HEIGHT, 72); + ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 2); + ADD_SHAPE_CONFIG(DIVIDER_TOP_MARGIN, 30); + ADD_SHAPE_CONFIG(DIVIDER_RIGHT_MARGIN, 18); ADD_FIXED_VALUE_CONFIG(TITLE_TEXT_MAX_LENGTH, 60); ADD_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 60); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); @@ -175,12 +154,17 @@ START_UI_CONFIG(CHECKBUTTON); ADD_SHAPE_CONFIG(TEXT_HEIGHT, 60); ADD_SHAPE_CONFIG(LEFT_MARGIN, 26); ADD_SHAPE_CONFIG(TOP_MARGIN, 10); - ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 64); - ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 64); - ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 128); - ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_HEIGHT, 66); - ADD_SHAPE_CONFIG(DETAILED_BITMAP_WIDTH, 74); - ADD_SHAPE_CONFIG(DETAILED_BITMAP_HEIGHT, 74); + ADD_SHAPE_CONFIG(MARK_BITMAP_WIDTH, 63); + ADD_SHAPE_CONFIG(MARK_BITMAP_HEIGHT, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_WIDTH, 135); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_BITMAP_HEIGHT, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_HANDLER_WIDTH, 63); + ADD_SHAPE_CONFIG(ONOFF_SLIDING_HANDLER_MARGIN, 2); + ADD_SHAPE_CONFIG(DETAILED_BITMAP_WIDTH, 72); + ADD_SHAPE_CONFIG(DETAILED_BITMAP_HEIGHT, 72); + ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 2); + ADD_SHAPE_CONFIG(DIVIDER_TOP_MARGIN, 30); + ADD_SHAPE_CONFIG(DIVIDER_RIGHT_MARGIN, 18); ADD_FIXED_VALUE_CONFIG(TITLE_TEXT_MAX_LENGTH, 60); ADD_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 60); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); diff --git a/src/ui/resource/FUi_ResourceColorPickerConfig.cpp b/src/ui/resource/FUi_ResourceColorPickerConfig.cpp old mode 100644 new mode 100755 index 48c9d92..b06f3fd --- a/src/ui/resource/FUi_ResourceColorPickerConfig.cpp +++ b/src/ui/resource/FUi_ResourceColorPickerConfig.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ResourceColorPickerConfig.cpp * @brief This is the implementation file for the color, image and shape properties of ColorPicker. @@ -23,7 +24,8 @@ START_UI_CONFIG(COLORPICKER); { - ADD_COLOR_CONFIG(DIVIDER_NORMAL, $B0231); + ADD_COLOR_CONFIG(DIVIDER_TOP_HALF, $B0224); + ADD_COLOR_CONFIG(DIVIDER_BOTTOM_HALF, $B0222); ADD_COLOR_CONFIG(ARROW_BUTTON_BG_NORMAL, $W011); ADD_COLOR_CONFIG(ARROW_BUTTON_BG_PRESSED, $B042); ADD_COLOR_CONFIG(ARROW_BUTTON_BG_DISABLED, $W011); @@ -34,12 +36,12 @@ START_UI_CONFIG(COLORPICKER); ADD_IMAGE_CONFIG(HUE_BAR_PORTRAIT_NORMAL, #00_color_picker_color.png); ADD_IMAGE_CONFIG(LUMINANCE_BAR_PORTRAIT_NORMAL, #00_color_picker_brightness.png); ADD_IMAGE_CONFIG(SATURATION_BAR_PORTRAIT_NORMAL, #00_color_picker_saturation.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_NORMAL, #00_button_01.9.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_PRESSED, #00_button_01.9.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_DISABLED, #00_button_01.9.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_NORMAL, #00_button_01_ef.9.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_PRESSED, #00_button_01_ef_press.9.png); - ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_DISABLED, #00_button_01_ef_dim.9.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_NORMAL, #00_button_01.#.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_PRESSED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_DISABLED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_NORMAL, #00_button_01_ef.#.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_PRESSED, #00_button_01_ef_press.#.png); + ADD_IMAGE_CONFIG(ARROW_BUTTON_BG_EFFECT_DISABLED, #00_button_01_ef_dim.#.png); ADD_IMAGE_CONFIG(LEFT_ARROW_BUTTON_NORMAL, #00_button_left.png); ADD_IMAGE_CONFIG(LEFT_ARROW_BUTTON_PRESSED, #00_button_left.png); ADD_IMAGE_CONFIG(LEFT_ARROW_BUTTON_DISABLED, #00_button_left.png); @@ -75,7 +77,7 @@ START_UI_CONFIG(COLORPICKER); ADD_SHAPE_CONFIG(BAR_WIDTH, 476); ADD_SHAPE_CONFIG(DIVIDER_MARGIN, 16); ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 656); - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 688, 338); + ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 688, 336); } END_UI_CONFIG_MODE(720x1280); @@ -84,7 +86,7 @@ START_UI_CONFIG(COLORPICKER); ADD_SHAPE_CONFIG(ARROW_BUTTON_LEFT_MARGIN, 184); ADD_SHAPE_CONFIG(BAR_WIDTH, 700); ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 1216); - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 1248, 338); + ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 1248, 336); } END_UI_CONFIG_MODE(1280x720); } diff --git a/src/ui/resource/FUi_ResourceConfigMacro.h b/src/ui/resource/FUi_ResourceConfigMacro.h index 98cc8b0..ebcec8c 100644 --- a/src/ui/resource/FUi_ResourceConfigMacro.h +++ b/src/ui/resource/FUi_ResourceConfigMacro.h @@ -29,18 +29,25 @@ #include #include #include -#include +#include #include -#include +#include #include #include "FUi_ResourceConfigLoader.h" #include "FUi_ResourceConfigParser.h" #include "FUi_ResourceMapContainer.h" +#define SysDebugLog SysConfigLog//SysLog + #define START_UI_CONFIG(control)\ using namespace Tizen::Base;\ using namespace Tizen::Base::Collection;\ using namespace Tizen::Graphics;\ +using namespace Tizen::Ui;\ +namespace Tizen { namespace Ui\ +{\ +extern int _SCREEN_HEIGHT_;\ +}}\ namespace Tizen { namespace Ui { namespace _Resource\ {\ class control ## Config\ @@ -53,6 +60,7 @@ public:\ ~control ## Config(void){};\ static bool Initialize(MapContainer & table, const String & mode);\ private:\ + static void SysConfigLog(LogID NID, ...){};\ static const char* GetControlName(void)\ {\ return #control;\ @@ -82,7 +90,7 @@ private:\ len = strlen(pString);\ if (len < 1)\ {\ - SysLog(NID_UI, "String is empty");\ + SysDebugLog(NID_UI, "String is empty");\ return;\ }\ for (index = 1; index < len + 1; index++)\ @@ -109,9 +117,9 @@ private:\ }\ color.SetRGB32(temp, true);\ };\ - static void AddDimensionConfig(MapContainer & table, const char* key, int width, int height)\ + static void AddDimensionConfig(MapContainer & table, const char* key, float width, float height)\ {\ - Dimension* pDimension = null;\ + FloatDimension* pDimension = null;\ ResourceDimensionMap* pDimensionMap = table.GetDimensionMap();\ if(pDimensionMap != null)\ {\ @@ -121,7 +129,7 @@ private:\ result r = pDimensionMap->GetValue(_key, pDimension);\ if(r == E_OBJ_NOT_FOUND)\ {\ - pDimension = new (std::nothrow) Dimension(width, height);\ + pDimension = new (std::nothrow) FloatDimension(width, height);\ SysAssert(pDimension);\ pDimensionMap->Add(_key, pDimension);\ }\ @@ -131,9 +139,9 @@ private:\ }\ }\ };\ - static void AddShapeConfig(MapContainer & table, const char* key, int value)\ + static void AddShapeConfig(MapContainer & table, const char* key, float value)\ {\ - Integer* pInteger = null;\ + Float* pInteger = null;\ ResourceShapeMap* pShapeMap = table.GetShapeMap();\ if(pShapeMap != null)\ {\ @@ -143,7 +151,7 @@ private:\ result r = pShapeMap->GetValue(_key, pInteger);\ if(r == E_OBJ_NOT_FOUND)\ {\ - pInteger = new (std::nothrow) Integer(value);\ + pInteger = new (std::nothrow) Float(value);\ SysAssert(pInteger);\ pShapeMap->Add(_key, pInteger);\ }\ @@ -153,9 +161,9 @@ private:\ }\ }\ };\ - static void AddFixedValueConfig(MapContainer & table, const char* key, int value)\ + static void AddFixedValueConfig(MapContainer & table, const char* key, float value)\ {\ - Integer* pInteger = null;\ + Float* pInteger = null;\ ResourceShapeMap* pFixedValueMap = table.GetFixedValueMap();\ if(pFixedValueMap != null)\ {\ @@ -165,7 +173,7 @@ private:\ result r = pFixedValueMap->GetValue(_key, pInteger);\ if(r == E_OBJ_NOT_FOUND)\ {\ - pInteger = new (std::nothrow) Integer(value);\ + pInteger = new (std::nothrow) Float(value);\ SysAssert(pInteger);\ pFixedValueMap->Add(_key, pInteger);\ }\ @@ -191,6 +199,7 @@ private:\ SysAssert(pString);\ pString->SubString(1,*pString);\ pImageMap->Add(_key, pString);\ + SysDebugLog(NID_UI, "Resourceimage is added , key : %ls, value : %ls", _key.GetPointer(), pString->GetPointer());\ }\ else if(r == E_SUCCESS)\ {\ @@ -218,12 +227,12 @@ private:\ valueString.SubString(1, key2);\ if(!(key2.Contains(L"::")))\ {\ - key2.Insert("DEFAULTCOLORTABLE::",0);\ + key2.Insert("BASIC::",0);\ }\ r = pColorMap->GetValue(key2, pColor);\ if(r != E_SUCCESS)\ {\ - SysLog(NID_UI,"[OBJ_NOT_FOUND] Resource color code is not valid : %s", value);\ + SysDebugLog(NID_UI,"[OBJ_NOT_FOUND] Resource color code is not valid : %s", value);\ r = pColorMap->GetValue(L"foreground", pColor);\ if(r == E_SUCCESS)\ {\ @@ -251,7 +260,7 @@ private:\ pColor2 = new (std::nothrow) Color(*pColor);\ SysAssert(pColor2);\ pColorMap->Add(_key, pColor2);\ - SysLog(NID_UI, "Resource Color is added , key : %ls, value : %x", _key.GetPointer(), pColor2->GetRGB32());\ + SysDebugLog(NID_UI, "Resource Color is added , key : %ls, value : %x", _key.GetPointer(), pColor2->GetRGB32());\ }\ }\ }\ @@ -304,6 +313,29 @@ bool control ## Config::Initialize(MapContainer & table, const String & mode)\ #define ADD_FIXED_VALUE_CONFIG(key, value) AddFixedValueConfig(table, #key, value); #define ADD_IMAGE_CONFIG(key, value) AddImageConfig(table, #key, #value); +#define START_ANIMATION_CONFIG(key)\ + ResourceAnimationMap* pAnimationMap = table.GetAnimationMap();\ + if (pAnimationMap != null)\ + {\ + ResourceAnimationFrameList* pList = null;\ + pList = new (std::nothrow) ResourceAnimationFrameList;\ + SysAssert(pList); + +#define ADD_ANIMATION_FRAME(frame, duration) \ + {\ + String fileName(#frame);\ + fileName.SubString(1,fileName);\ + pList->Add(ResourceAnimationFrame(fileName,duration));\ + SysDebugLog(NID_UI, "Resourceimage is added , fileName : %ls", fileName.GetPointer());\ + } + +#define END_ANIMATION_CONFIG(key)\ + String _key = GetControlName();\ + _key.Append(L"::");\ + _key.Append(#key);\ + pAnimationMap->Add(_key, pList);\ + } + #define END_UI_CONFIG(control)\ return true;\ };\ diff --git a/src/ui/resource/FUi_ResourceConfigParser.cpp b/src/ui/resource/FUi_ResourceConfigParser.cpp index 0d19ef1..695b8d5 100644 --- a/src/ui/resource/FUi_ResourceConfigParser.cpp +++ b/src/ui/resource/FUi_ResourceConfigParser.cpp @@ -31,6 +31,7 @@ #include #include #include +#include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceMapContainer.h" #include "FUi_ResourceConfigParser.h" @@ -355,6 +356,7 @@ ConfigParser::GetMatchingTable(void) ConfigParser::ConfigParser(void) : __pMapContainer(null) , __currentAttribute(L"") + , __pCurrentAnimationList(null) { } ConfigParser::~ConfigParser(void) @@ -440,7 +442,7 @@ ConfigParser::StartSaxFunc(void* pXmlParserCtxt, const xmlChar* pName, const xml { pConfigXmlHandler->AddColor(pAttributes); } - else if (xmlStrcasecmp(pName, (xmlChar*) "Resource") == 0) + else if (xmlStrcasecmp(pName, (xmlChar*) "Theme") == 0) { pConfigXmlHandler->SetInformation(pAttributes); } @@ -452,6 +454,14 @@ ConfigParser::StartSaxFunc(void* pXmlParserCtxt, const xmlChar* pName, const xml { pConfigXmlHandler->StartAttribute(pAttributes); } + else if (xmlStrcasecmp(pName, (xmlChar*) "Animation") == 0) + { + pConfigXmlHandler->AddAnimation(pAttributes); + } + else if (xmlStrcasecmp(pName, (xmlChar*) "AnimationFrame") == 0) + { + pConfigXmlHandler->AddAnimationFrame(pAttributes); + } else { ;//nothing to do @@ -515,14 +525,14 @@ ConfigParser::AddColor(const xmlChar** pAttributes) { Color color; GetValue((char*) pAttributes[i], color); - SysLog(NID_UI,"The resource config parser changes resource color value, key %s, color %s", pAttributes[i - 1], pAttributes[i]); +// SysLog(NID_UI,"The resource config parser changes resource color value, key %s, color %s", pAttributes[i - 1], pAttributes[i]); __pMapContainer->GetColorMap()->SetValue(key,&color); } else { Color* pColor = new (std::nothrow) Color(); SysTryReturnVoidResult(NID_UI, pColor, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); - SysLog(NID_UI,"The resource config parser adds resource color, key %s, color %s", pAttributes[i - 1], pAttributes[i]); +// SysLog(NID_UI,"The resource config parser adds resource color, key %s, color %s", pAttributes[i - 1], pAttributes[i]); GetValue((char*) pAttributes[i], *pColor); result r = __pMapContainer->GetColorMap()->Add(key, pColor); if(r != E_SUCCESS) @@ -573,6 +583,67 @@ ConfigParser::AddImage(const xmlChar** pAttributes) } void +ConfigParser::AddAnimation(const xmlChar** pAttributes) +{ + __pCurrentAnimationList = null; + if (pAttributes != null) + { + for (int i = 0; (pAttributes[i] != null); i++) + { + if (xmlStrcasecmp(pAttributes[i], (xmlChar*) "Name") == 0) + { + bool exist = false; + String key =__currentAttribute + L"::" + (char*) pAttributes[++i]; + if(__pMapContainer->GetAnimationMap()->ContainsKey(key, exist) == E_SUCCESS) + { + if(exist) + { + __pMapContainer->GetAnimationMap()->GetValue(key,__pCurrentAnimationList); + __pCurrentAnimationList->Clear(); + } + else + { + __pCurrentAnimationList = new ResourceAnimationFrameList(); + } + } + } + } + } +} +void +ConfigParser::AddAnimationFrame(const xmlChar** pAttributes) +{ + ResourceAnimationFrame* pFrame = null; + String fileName; + String duration; + if (pAttributes != null) + { + for (int i = 0; (pAttributes[i] != null); i++) + { + if (xmlStrcasecmp(pAttributes[i], (xmlChar*) "Image") == 0) + { + fileName = (char*) pAttributes[++i]; + fileName.SubString(1, fileName); + } + if (xmlStrcasecmp(pAttributes[i], (xmlChar*) "Duration") == 0) + { + duration = (char*) pAttributes[++i]; + } + } + } + if (!fileName.IsEmpty() && !duration.IsEmpty()) + { + int durationInt =0; + if (Integer::Parse(duration, durationInt) == E_SUCCESS) + { + pFrame = new (std::nothrow) ResourceAnimationFrame(fileName, durationInt); + SysTryReturn(NID_UI, pFrame, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory was insufficient."); + __pCurrentAnimationList->Add(*pFrame); + } + } +} + +void ConfigParser::ConvertStringToColor32(const char* pString, Color& color) { int index = 0; diff --git a/src/ui/resource/FUi_ResourceConfigParser.h b/src/ui/resource/FUi_ResourceConfigParser.h index 90a1a02..8f5abdc 100644 --- a/src/ui/resource/FUi_ResourceConfigParser.h +++ b/src/ui/resource/FUi_ResourceConfigParser.h @@ -9,7 +9,7 @@ // http://floralicense.org/license/ // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. @@ -45,7 +45,7 @@ namespace Tizen { namespace Graphics namespace Tizen { namespace Ui { namespace _Resource { class MapContainer; - +class ResourceAnimationFrameList; class ConfigParser { public: @@ -72,6 +72,8 @@ private: void StartAttribute(const xmlChar** pAttributes); void AddColor(const xmlChar** pAttributes); void AddImage(const xmlChar** pAttributes); + void AddAnimation(const xmlChar** pAttributes); + void AddAnimationFrame(const xmlChar** pAttributes); void SetColorMatchingMap(const Tizen::Base::String& version); void ConvertStringToColor32(const char* pString, Tizen::Graphics::Color& color); void GetValue(const Tizen::Base::String& value, Tizen::Base::String& out); @@ -79,6 +81,7 @@ private: MapContainer* __pMapContainer; Tizen::Base::String __currentAttribute; + ResourceAnimationFrameList* __pCurrentAnimationList; }; //class ConfigParser }}}//Tizen::Ui diff --git a/src/ui/resource/FUi_ResourceContextMenuConfig.cpp b/src/ui/resource/FUi_ResourceContextMenuConfig.cpp old mode 100644 new mode 100755 index 29cd1d3..0c7acfb --- a/src/ui/resource/FUi_ResourceContextMenuConfig.cpp +++ b/src/ui/resource/FUi_ResourceContextMenuConfig.cpp @@ -24,22 +24,24 @@ START_UI_CONFIG(CONTEXTMENU); { ADD_COLOR_CONFIG(BG_NORMAL, $B061L4); - ADD_COLOR_CONFIG(LIST_ITEM_DIVIDER1, $B0622L1); - ADD_COLOR_CONFIG(LIST_ITEM_DIVIDER2, $B0622L2); + ADD_COLOR_CONFIG(LIST_ITEM_DIVIDER_01_NORMAL, $B0622L1); + ADD_COLOR_CONFIG(LIST_ITEM_DIVIDER_02_NORMAL, $B0622L2); + ADD_COLOR_CONFIG(ITEM_BG_NORMAL, $B061L4); ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $B044); - ADD_COLOR_CONFIG(GRID_ITEM_DIVIDER_01, $B0623L1); - ADD_COLOR_CONFIG(GRID_ITEM_DIVIDER_02, $B0623L2); + ADD_COLOR_CONFIG(ITEM_BG_HIGHLIGHTED, $B044); + ADD_COLOR_CONFIG(GRID_ITEM_DIVIDER_01_NORMAL, $B0623L1); + ADD_COLOR_CONFIG(GRID_ITEM_DIVIDER_02_NORMAL, $B0623L2); ADD_COLOR_CONFIG(ITEM_TEXT_NORMAL, $B063L5); ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $B063L5); - ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $B0622L5D); + ADD_COLOR_CONFIG(ITEM_TEXT_HIGHLIGHTED, $B063L5); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_popup_bubble_bg.9.png); - ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, #00_popup_bubble_bg_ef.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_popup_bubble_bg.#.png); + ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, #00_popup_bubble_bg_ef.#.png); - ADD_IMAGE_CONFIG(ANCHOR_NORMAL_UP, #00_popup_bubble_tail_bottom_bg.png); - ADD_IMAGE_CONFIG(ANCHOR_NORMAL_DOWN, #00_popup_bubble_tail_top_bg.png); - ADD_IMAGE_CONFIG(ANCHOR_NORMAL_LEFT, #00_popup_bubble_tail_right_bg.png); - ADD_IMAGE_CONFIG(ANCHOR_NORMAL_RIGHT, #00_popup_bubble_tail_left_bg.png); + ADD_IMAGE_CONFIG(ANCHOR_NORMAL_UP, #00_popup_bubble_tail_bottom.png); + ADD_IMAGE_CONFIG(ANCHOR_NORMAL_DOWN, #00_popup_bubble_tail_top.png); + ADD_IMAGE_CONFIG(ANCHOR_NORMAL_LEFT, #00_popup_bubble_tail_right.png); + ADD_IMAGE_CONFIG(ANCHOR_NORMAL_RIGHT, #00_popup_bubble_tail_left.png); ADD_IMAGE_CONFIG(ANCHOR_EFFECT_UP, #00_popup_bubble_tail_bottom_ef.png); ADD_IMAGE_CONFIG(ANCHOR_EFFECT_DOWN, #00_popup_bubble_tail_top_ef.png); ADD_IMAGE_CONFIG(ANCHOR_EFFECT_LEFT, #00_popup_bubble_tail_right_ef.png); @@ -55,6 +57,10 @@ START_UI_CONFIG(CONTEXTMENU); END_UI_CONFIG_MODE(800x480); START_UI_CONFIG_MODE(720x1280); + ADD_SHAPE_CONFIG(ITEM_MAX_COUNT, 7); + ADD_SHAPE_CONFIG(LIST_ITEM_FONT_SIZE, 40); + ADD_SHAPE_CONFIG(GRID_ITEM_FONT_SIZE, 32); + ADD_SHAPE_CONFIG(LIST_ITEM_HEIGHT, 112); ADD_SHAPE_CONFIG(LIST_MIN_WIDTH, 368); ADD_SHAPE_CONFIG(LIST_MAX_WIDTH, 620); @@ -63,44 +69,44 @@ START_UI_CONFIG(CONTEXTMENU); ADD_SHAPE_CONFIG(LIST_LEFT_MARGIN, 12); ADD_SHAPE_CONFIG(LIST_RIGHT_MARGIN, 12); - ADD_SHAPE_CONFIG(LIST_ICON_WIDTH, 64); - ADD_SHAPE_CONFIG(LIST_ICON_HEIGHT, 64); + ADD_SHAPE_CONFIG(LIST_ICON_WIDTH, 45); + ADD_SHAPE_CONFIG(LIST_ICON_HEIGHT, 45); ADD_SHAPE_CONFIG(LIST_TEXT_WIDTH, 266); ADD_SHAPE_CONFIG(LIST_TEXT_HEIGHT, 64); ADD_SHAPE_CONFIG(LIST_ITEM_GAP, 16); ADD_SHAPE_CONFIG(LIST_DIVIDER_HEIGHT, 1); - ADD_SHAPE_CONFIG(GRID_MIN_WIDTH, 128); ADD_SHAPE_CONFIG(GRID_MAX_WIDTH, 648); + ADD_SHAPE_CONFIG(GRID_MIN_WIDTH, 112); ADD_SHAPE_CONFIG(GRID_ITEM_WIDTH, 128); - ADD_SHAPE_CONFIG(GRID_ITEM_HEIGHT, 92); + ADD_SHAPE_CONFIG(GRID_ITEM_HEIGHT, 96); ADD_SHAPE_CONFIG(GRID_ITEM_MAX_WIDTH, 324); - ADD_FIXED_VALUE_CONFIG(GRID_ITEM_GAP, 2); - ADD_SHAPE_CONFIG(GRID_TEXT_MARGIN, 20); + ADD_SHAPE_CONFIG(GRID_TEXT_MARGIN, 16); ADD_SHAPE_CONFIG(GRID_DIVIDER_HEIGHT, 74); ADD_SHAPE_CONFIG(GRID_TOP_MARGIN, 12); ADD_SHAPE_CONFIG(GRID_BOTTOM_MARGIN, 12); ADD_SHAPE_CONFIG(GRID_LEFT_MARGIN, 12); ADD_SHAPE_CONFIG(GRID_RIGHT_MARGIN, 12); - ADD_SHAPE_CONFIG(GRID_ICON_WIDTH, 48); - ADD_SHAPE_CONFIG(GRID_ICON_HEIGHT, 48); + ADD_SHAPE_CONFIG(GRID_ICON_WIDTH, 45); + ADD_SHAPE_CONFIG(GRID_ICON_HEIGHT, 45); + ADD_FIXED_VALUE_CONFIG(GRID_ITEM_GAP, 2); ADD_FIXED_VALUE_CONFIG(SCREEN_TOP_MARGIN, 24); ADD_FIXED_VALUE_CONFIG(SCREEN_BOTTOM_MARGIN, 24); ADD_FIXED_VALUE_CONFIG(SCREEN_LEFT_MARGIN, 24); ADD_FIXED_VALUE_CONFIG(SCREEN_RIGHT_MARGIN, 24); - ADD_SHAPE_CONFIG(ITEM_MAX_COUNT, 7); - ADD_SHAPE_CONFIG(LIST_ITEM_FONT_SIZE, 40); - ADD_SHAPE_CONFIG(GRID_ITEM_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(ANCHOR_WIDTH, 42); - ADD_SHAPE_CONFIG(ANCHOR_HEIGHT, 28); - ADD_SHAPE_CONFIG(ANCHOR_MARGIN, 12); + ADD_SHAPE_CONFIG(ANCHOR_WIDTH, 36); + ADD_SHAPE_CONFIG(ANCHOR_HEIGHT, 36); + ADD_SHAPE_CONFIG(ANCHOR_MARGIN, 14); + + ADD_SHAPE_CONFIG(APPEARING_ANIMATION_DISTANCE_X, 40); + ADD_SHAPE_CONFIG(APPEARING_ANIMATION_DISTANCE_Y, 40); END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); - ADD_SHAPE_CONFIG(GRID_MAX_WIDTH, 1152); ADD_SHAPE_CONFIG(ITEM_MAX_COUNT, 5); + ADD_SHAPE_CONFIG(GRID_MAX_WIDTH, 1152); END_UI_CONFIG_MODE(1280x720); } END_UI_CONFIG(CONTEXTMENU); diff --git a/src/ui/resource/FUi_ResourceDateTimeBarConfig.cpp b/src/ui/resource/FUi_ResourceDateTimeBarConfig.cpp old mode 100644 new mode 100755 index 827a410..7e1f88d --- a/src/ui/resource/FUi_ResourceDateTimeBarConfig.cpp +++ b/src/ui/resource/FUi_ResourceDateTimeBarConfig.cpp @@ -28,13 +28,13 @@ START_UI_CONFIG(DATETIMEBAR); ADD_COLOR_CONFIG(TEXT_NORMAL, $W084); ADD_COLOR_CONFIG(TEXT_PRESSED, $W084P); - ADD_IMAGE_CONFIG(TIMEPICKERBAR_BG_NORMAL, #00_timepicker_number_bg.9.png); + ADD_IMAGE_CONFIG(TIMEPICKERBAR_BG_NORMAL, #00_timepicker_number_bg.#.png); ADD_IMAGE_CONFIG(TAIL_DOWN, #00_timepicker_tail.png); ADD_IMAGE_CONFIG(TAIL_UP, #00_timepicker_tail_01.png); START_UI_CONFIG_MODE(800x480); { - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 800, 102); + ADD_DIMENSION_CONFIG(DEFAULT_SIZE, _SCREEN_HEIGHT_, 102); } END_UI_CONFIG_MODE(800x480); @@ -45,7 +45,6 @@ START_UI_CONFIG(DATETIMEBAR); ADD_SHAPE_CONFIG(YEAR_ITEM_WIDTH, 120); ADD_SHAPE_CONFIG(ITEM_HEIGHT, 102); - ADD_SHAPE_CONFIG(TOP_MARGIN, 22); ADD_SHAPE_CONFIG(DAY_ITEM_MARGIN, 0); ADD_SHAPE_CONFIG(MONTH_ITEM_MARGIN, 0); ADD_SHAPE_CONFIG(YEAR_ITEM_MARGIN, 22); @@ -67,7 +66,7 @@ START_UI_CONFIG(DATETIMEBAR); START_UI_CONFIG_MODE(1280x720); { - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 1280, 102); + ADD_DIMENSION_CONFIG(DEFAULT_SIZE, _SCREEN_HEIGHT_, 102); } END_UI_CONFIG_MODE(1280x720); } diff --git a/src/ui/resource/FUi_ResourceDateTimePickerConfig.cpp b/src/ui/resource/FUi_ResourceDateTimePickerConfig.cpp old mode 100644 new mode 100755 index af4b3d2..6b4df2a --- a/src/ui/resource/FUi_ResourceDateTimePickerConfig.cpp +++ b/src/ui/resource/FUi_ResourceDateTimePickerConfig.cpp @@ -41,13 +41,15 @@ START_UI_CONFIG(DATETIMEPICKER); ADD_COLOR_CONFIG(AMPM_TEXT_HIGHLIGHTED, $F031L1P); ADD_COLOR_CONFIG(AMPM_TEXT_DISABLED, $F031L1D); - ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0231L1); - ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0231L2); + ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224); + ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222); - ADD_IMAGE_CONFIG(AMPM_BG_NORMAL, #00_button_01.9.png); - ADD_IMAGE_CONFIG(AMPM_BG_EFFECT, #00_button_01_ef.9.png); - ADD_IMAGE_CONFIG(AMPM_BG_PRESSED_EFFECT, #00_button_01_ef_press.9.png); - ADD_IMAGE_CONFIG(AMPM_BG_DISABLED_EFFECT, #00_button_01_ef_dim.9.png); + ADD_IMAGE_CONFIG(AMPM_BG_NORMAL, #00_button_01.#.png); + ADD_IMAGE_CONFIG(AMPM_BG_PRESSED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(AMPM_BG_HIGHLIGHTED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(AMPM_BG_EFFECT, #00_button_01_ef.#.png); + ADD_IMAGE_CONFIG(AMPM_BG_PRESSED_EFFECT, #00_button_01_ef_press.#.png); + ADD_IMAGE_CONFIG(AMPM_BG_DISABLED_EFFECT, #00_button_01_ef_dim.#.png); ADD_IMAGE_CONFIG(COLON_BG_NORMAL, #00_date_picker_dot.png); @@ -56,7 +58,9 @@ START_UI_CONFIG(DATETIMEPICKER); ADD_SHAPE_CONFIG(FOOTER_HEIGHT, 94); ADD_SHAPE_CONFIG(INPUTPAD_HEIGHT, 484); ADD_SHAPE_CONFIG(OUTPUT_AREA_HEIGHT, 112); - ADD_SHAPE_CONFIG(DISPLAY_BOX_HEIGHT, 56); + + ADD_SHAPE_CONFIG(DATETIME_DISPLAY_BOX_HEIGHT, 46); + ADD_SHAPE_CONFIG(AMPM_DISPLAY_BOX_HEIGHT, 56); ADD_SHAPE_CONFIG(TOP_MARGIN, 32); ADD_SHAPE_CONFIG(LEFT_MARGIN, 16); diff --git a/src/ui/resource/FUi_ResourceEditConfig.cpp b/src/ui/resource/FUi_ResourceEditConfig.cpp old mode 100644 new mode 100755 index 76ef28e..0e0e333 --- a/src/ui/resource/FUi_ResourceEditConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditConfig.cpp @@ -42,30 +42,18 @@ START_UI_CONFIG(EDIT); ADD_COLOR_CONFIG(CUT_LINK_BG_NORMAL, $B0217); ADD_COLOR_CONFIG(CURSOR_NORMAL, $F052); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_edit_field_no_line_square_bg.9.png); - ADD_IMAGE_CONFIG(BG_PRESSED, #00_edit_field_no_line_square_bg.9.png); - ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_edit_field_no_line_square_bg.9.png); - ADD_IMAGE_CONFIG(BG_DISABLED, #00_edit_field_no_line_square_bg.9.png); - ADD_IMAGE_CONFIG(BG_EFFECT, #00_edit_field_no_line_square_bg.9.png); - ADD_IMAGE_CONFIG(BG_SINGLE_NORMAL, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(BG_SINGLE_EFFECT, #00_list_group_bg_ef.9.png); - ADD_IMAGE_CONFIG(BG_SINGLE_PRESSED , #00_groupedlist_bg_press.9.png); - ADD_IMAGE_CONFIG(BG_TOP, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(BG_TOP_EFFECT, #00_list_group_bg_top_ef.9.png); - ADD_IMAGE_CONFIG(BG_TOP_PRESSED, #00_groupedlist_top_bg_press.9.png); - ADD_IMAGE_CONFIG(BG_CENTER, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(BG_CENTER_EFFECT, #00_list_group_bg_center_ef.9.png); - ADD_IMAGE_CONFIG(BG_CENTER_PRESSED, #00_groupedlist_center_bg_press.9.png); - ADD_IMAGE_CONFIG(BG_BOTTOM, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(BG_BOTTOM_EFFECT, #00_list_group_bg_bottom_ef.9.png); - ADD_IMAGE_CONFIG(BG_BOTTOM_PRESSED, #00_groupedlist_bottom_bg_press.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_edit_field_no_line_square_bg.#.png); + ADD_IMAGE_CONFIG(BG_PRESSED, #00_edit_field_no_line_square_bg.#.png); + ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_edit_field_no_line_square_bg.#.png); + ADD_IMAGE_CONFIG(BG_DISABLED, #00_edit_field_no_line_square_bg.#.png); + ADD_IMAGE_CONFIG(BG_EFFECT, #00_edit_field_no_line_square_bg.#.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_LEFT_NORMAL, #copy&paste_Icon_left.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_LEFT_PRESSED, #copy&paste_Icon_left_press.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_RIGHT_NORMAL, #copy&paste_Icon_right.png); ADD_IMAGE_CONFIG(COPY_PASTE_ICON_RIGHT_PRESSED, #copy&paste_Icon_right_press.png); ADD_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, #copy&paste_icon_search.png); - ADD_IMAGE_CONFIG(BG_ROUND_NORMAL, #00_edit_field_round_bg.9.png); - ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.9.png); + ADD_IMAGE_CONFIG(BG_ROUND_NORMAL, #00_edit_field_round_bg.#.png); + ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.#.png); ADD_IMAGE_CONFIG(CLEAR_ICON_NORMAL, #00_edit_field_clear.png); ADD_IMAGE_CONFIG(CLEAR_ICON_PRESSED, #00_edit_field_clear.png); @@ -88,8 +76,8 @@ START_UI_CONFIG(EDIT); ADD_FIXED_VALUE_CONFIG(FONT_MIN_SIZE, 4); ADD_SHAPE_CONFIG(DEFAULT_FONT_SIZE, 44); ADD_SHAPE_CONFIG(DEFAULT_TITLE_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(CLEAR_ICON_HEIGHT, 42); - ADD_SHAPE_CONFIG(CLEAR_ICON_WIDTH, 42); + ADD_SHAPE_CONFIG(CLEAR_ICON_HEIGHT, 45); + ADD_SHAPE_CONFIG(CLEAR_ICON_WIDTH, 45); ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_WIDTH, 48); ADD_SHAPE_CONFIG(COPYPASTE_HANDLER_HEIGHT, 68); ADD_SHAPE_CONFIG(FIELD_BORDER_WIDTH, 1); diff --git a/src/ui/resource/FUi_ResourceEditDateConfig.cpp b/src/ui/resource/FUi_ResourceEditDateConfig.cpp index 9b0eb0d..ea68714 100644 --- a/src/ui/resource/FUi_ResourceEditDateConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditDateConfig.cpp @@ -29,15 +29,15 @@ START_UI_CONFIG(EDITDATE); ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $F011L5); ADD_COLOR_CONFIG(TITLE_TEXT_DISABLED, $F011L5); - ADD_COLOR_CONFIG(DIVIDER_HALF_LEFT, $B0231L1); - ADD_COLOR_CONFIG(DIVIDER_HALF_RIGHT, $B0231L2); + ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224); + ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222); START_UI_CONFIG_MODE(720x1280); { ADD_SHAPE_CONFIG(WIDTH, 720); ADD_SHAPE_CONFIG(HEIGHT, 112); ADD_SHAPE_CONFIG(DATE_HEIGHT, 46); - ADD_SHAPE_CONFIG(TEXT_HEIGHT, 36); + ADD_SHAPE_CONFIG(TITLE_HEIGHT, 36); ADD_SHAPE_CONFIG(DATE_FONT_SIZE, 36); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); ADD_SHAPE_CONFIG(DATE_TEXT_LEFT_MARGIN, 20); @@ -45,15 +45,16 @@ START_UI_CONFIG(EDITDATE); ADD_FIXED_VALUE_CONFIG(ITEM_DIVIDER_WIDTH, 2); ADD_SHAPE_CONFIG(ITEM_DIVIDER_HEIGHT, 42); ADD_SHAPE_CONFIG(TITLE_DATE_MARGIN, 5); + ADD_SHAPE_CONFIG(DATE_BAR_MARGIN, 10); - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 720, 112); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); } END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); { - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 1280, 112); - ADD_SHAPE_CONFIG(WIDTH, 1280); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); + ADD_SHAPE_CONFIG(WIDTH, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(TEXT_ELEMENT_WIDTH, 242); } END_UI_CONFIG_MODE(1280x720); diff --git a/src/ui/resource/FUi_ResourceEditTimeConfig.cpp b/src/ui/resource/FUi_ResourceEditTimeConfig.cpp old mode 100644 new mode 100755 index 5936e47..5e08a4b --- a/src/ui/resource/FUi_ResourceEditTimeConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditTimeConfig.cpp @@ -29,7 +29,7 @@ START_UI_CONFIG(EDITTIME); ADD_COLOR_CONFIG(BUTTON_BG_DISABLED, $W011); ADD_COLOR_CONFIG(BUTTON_TEXT_NORMAL, $F031L1); ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $F031L1P); - ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $F031L1); + ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $F031L1D); ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L1); ADD_COLOR_CONFIG(TEXT_PRESSED, $F011L2); ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1); @@ -37,10 +37,12 @@ START_UI_CONFIG(EDITTIME); ADD_COLOR_CONFIG(TITLE_TEXT_DISABLED, $F011L5); ADD_IMAGE_CONFIG(COLON_BG_NORMAL, #00_date_picker_dot.png); - ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_button_01.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_NORMAL, #00_button_01_ef.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_DISABLED, #00_button_01_ef_dim.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_PRESSED, #00_button_01_ef_press.9.png); + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_button_01.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_DISABLED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_NORMAL, #00_button_01_ef.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_DISABLED, #00_button_01_ef_dim.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_PRESSED, #00_button_01_ef_press.#.png); START_UI_CONFIG_MODE(720x1280); { @@ -49,26 +51,26 @@ START_UI_CONFIG(EDITTIME); ADD_SHAPE_CONFIG(TIME_WIDTH, 114); ADD_SHAPE_CONFIG(HOUR_MINUTE_WIDTH, 48); ADD_SHAPE_CONFIG(TITLE_TIME_MARGIN, 5); + ADD_SHAPE_CONFIG(TIME_BAR_MARGIN, 10); ADD_SHAPE_CONFIG(TIME_HEIGHT, 46); ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 24); ADD_SHAPE_CONFIG(AMPM_WIDTH, 106); ADD_SHAPE_CONFIG(AMPM_HEIGHT, 56); - ADD_SHAPE_CONFIG(TEXT_HEIGHT, 36); + ADD_SHAPE_CONFIG(TITLE_HEIGHT, 36); ADD_SHAPE_CONFIG(TIME_FONT_SIZE, 36); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); ADD_SHAPE_CONFIG(AMPM_FONT_SIZE, 36); ADD_SHAPE_CONFIG(COLON_WIDTH, 12); ADD_SHAPE_CONFIG(COLON_MARGIN, 3); ADD_SHAPE_CONFIG(TIME_TEXT_LEFT_MARGIN, 20); - - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 720, 112); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); } END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); { - ADD_DIMENSION_CONFIG(DEFAULT_SIZE, 1280, 112); - ADD_SHAPE_CONFIG(WIDTH, 1280); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); + ADD_SHAPE_CONFIG(WIDTH, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(TIME_WIDTH, 242); ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 84); } diff --git a/src/ui/resource/FUi_ResourceFastScrollConfig.cpp b/src/ui/resource/FUi_ResourceFastScrollConfig.cpp old mode 100644 new mode 100755 index 46a6770..8726dae --- a/src/ui/resource/FUi_ResourceFastScrollConfig.cpp +++ b/src/ui/resource/FUi_ResourceFastScrollConfig.cpp @@ -19,37 +19,36 @@ START_UI_CONFIG(FASTSCROLL); { - ADD_COLOR_CONFIG(INDEX_BAR, $B0723); - ADD_COLOR_CONFIG(INDEX_LEFT_LINE, $B0725); - ADD_COLOR_CONFIG(INDEX_BAR_TEXT, $B0721); - ADD_COLOR_CONFIG(INDEX_SEPARATOR, $B0724); + ADD_COLOR_CONFIG(INDEX_BG_NORMAL, $B0723); + ADD_COLOR_CONFIG(INDEX_LINE_PRESSED, $B0725); + ADD_COLOR_CONFIG(INDEX_TEXT_NORMAL, $B0721); + ADD_COLOR_CONFIG(INDEX_DIVIDER_NORMAL, $B0724); - ADD_COLOR_CONFIG(SELECTED_INDEX_BG, $B011); - ADD_COLOR_CONFIG(SELECTED_INDEX_TEXT, $B0722); - ADD_COLOR_CONFIG(SELECTED_INDEX_OUTLINE, $B0725); + ADD_COLOR_CONFIG(INDEX_BG_PRESSED, $B011); + ADD_COLOR_CONFIG(INDEX_TEXT_PRESSED, $B0722); - ADD_COLOR_CONFIG(POPUP_BG, $B0731); - ADD_COLOR_CONFIG(POPUP_TEXT, $B0732); + ADD_COLOR_CONFIG(POPUP_BG_NORMAL, $B0731); + ADD_COLOR_CONFIG(POPUP_TEXT_NORMAL, $B0732); - ADD_IMAGE_CONFIG(INDEX_BG, #00_fast_scroll_rollover_bg.9.png); - ADD_IMAGE_CONFIG(SELECTED_INDEX_BG, #00_fast_scroll_rollover_bg_focus.9.png); - ADD_IMAGE_CONFIG(SELECTED_INDEX_OUTLINE, #00_fast_scroll_rollover_bg_line_focus.9.png); - ADD_IMAGE_CONFIG(POPUP_BG, #00_fast_scroll_popup_bg_ef.9.png); - ADD_IMAGE_CONFIG(POPUP_BG_EFFECT, #00_fast_scroll_popup_bg.9.png); + ADD_IMAGE_CONFIG(INDEX_BG_NORMAL, #00_fast_scroll_rollover_bg.#.png); + ADD_IMAGE_CONFIG(INDEX_BG_PRESSED, #00_fast_scroll_rollover_bg_focus.#.png); + ADD_IMAGE_CONFIG(INDEX_LINE_PRESSED, #00_fast_scroll_rollover_bg_line_focus.#.png); + ADD_IMAGE_CONFIG(POPUP_BG_NORMAL, #00_fast_scroll_popup_bg.#.png); + ADD_IMAGE_CONFIG(POPUP_BG_EFFECT, #00_fast_scroll_popup_bg_ef.#.png); START_UI_CONFIG_MODE(720x1280); - ADD_SHAPE_CONFIG(INDEX_WIDTH, 51); + ADD_SHAPE_CONFIG(INDEX_WIDTH, 52); ADD_SHAPE_CONFIG(INDEX_HEIGHT, 33); ADD_SHAPE_CONFIG(INDEX_TOP_MARGIN, 17); ADD_SHAPE_CONFIG(INDEX_LEFT_LINE_THICKNESS, 3); ADD_SHAPE_CONFIG(INDEX_TEXT_SIZE, 26); ADD_FIXED_VALUE_CONFIG(INDEX_SEPARATOR_THICKNESS, 1); ADD_SHAPE_CONFIG(SELECTED_INDEX_RIGHT_MARGIN, 4); - ADD_SHAPE_CONFIG(SELECTED_INDEX_HEIGHT, 92); + ADD_SHAPE_CONFIG(SELECTED_INDEX_HEIGHT, 38); ADD_SHAPE_CONFIG(POPUP_WIDTH, 208); ADD_SHAPE_CONFIG(POPUP_HEIGHT, 200); - ADD_SHAPE_CONFIG(POPUP_WIDTH_INCREMENT, 76); + ADD_SHAPE_CONFIG(POPUP_WIDTH_INCREMENT, 70); ADD_SHAPE_CONFIG(POPUP_RIGHT_SHADOW, 10); ADD_SHAPE_CONFIG(POPUP_BOTTOM_SHADOW, 10); ADD_SHAPE_CONFIG(POPUP_TEXT_SIZE, 136); diff --git a/src/ui/resource/FUi_ResourceFooterConfig.cpp b/src/ui/resource/FUi_ResourceFooterConfig.cpp index 8ee13bf..c45cba9 100644 --- a/src/ui/resource/FUi_ResourceFooterConfig.cpp +++ b/src/ui/resource/FUi_ResourceFooterConfig.cpp @@ -48,7 +48,7 @@ START_UI_CONFIG(FOOTER); ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); - ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_NORMAL, $B0515); + ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_NORMAL, $B0515); // $B0543 is 0x00000000, transparent ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_DISABLED, $B0515); ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_PRESSED, $B0514P1); ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_HIGHLIGHTED, $B0514P1); @@ -72,6 +72,30 @@ START_UI_CONFIG(FOOTER); ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_TEXT_SELECTED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_BG_NORMAL, $B0515); + ADD_COLOR_CONFIG(TAB_ITEM_BG_DISABLED, $B0515); + ADD_COLOR_CONFIG(TAB_ITEM_BG_PRESSED, $B0514P1); + ADD_COLOR_CONFIG(TAB_ITEM_BG_HIGHLIGHTED, $B0514P1); + ADD_COLOR_CONFIG(TAB_ITEM_BG_SELECTED, $B0515); + + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_NORMAL, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_DISABLED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013); + + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_NORMAL, $B052L6); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L4D); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6P); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_HIGHLIGHTED, $B052L6P); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_SELECTED, $B052L6P); + + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_NORMAL, $B052L8); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_DISABLED, $B052L8); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_PRESSED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_SELECTED, $B052L8P); + ADD_COLOR_CONFIG(BUTTON_ITEM_BG_NORMAL, $W011); ADD_COLOR_CONFIG(BUTTON_ITEM_BG_DISABLED, $W011); @@ -115,16 +139,23 @@ START_UI_CONFIG(FOOTER); ADD_COLOR_CONFIG(SOFTKEY_ICON_PRESSED, $B052L9); ADD_COLOR_CONFIG(SOFTKEY_ICON_HIGHLIGHTED, $B052L9); + ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_NORMAL, $B0221); + ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_NORMAL, $B0222); + ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_TRANSLUCENT_NORMAL, $B0227); + ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_TRANSLUCENT_NORMAL, $B0228); // BITMAP - ADD_IMAGE_CONFIG(BG_NORMAL, #00_toolbar_bg.9.png); - ADD_IMAGE_CONFIG(BG_DISABLED, #00_toolbar_bg.9.png); - ADD_IMAGE_CONFIG(BG_PRESSED, #00_toolbar_press.9.png); - ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_toolbar_press.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_toolbar_bg.#.png); + ADD_IMAGE_CONFIG(TRANSLUCENT_BG_NORMAL, #00_toolbar_bg.#.png); + + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_toolbar_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_DISABLED, #00_toolbar_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_toolbar_press.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_HIGHLIGHTED, #00_toolbar_press.#.png); - ADD_IMAGE_CONFIG(BG_EFFECT_NORMAL, #00_toolbar_bg_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(BG_EFFECT_PRESSED, #00_toolbar_ef_press.9.png); //not supported by theme + ADD_IMAGE_CONFIG(BG_EFFECT_NORMAL, #00_toolbar_bg_ef.#.png); //not supported by theme + ADD_IMAGE_CONFIG(BG_EFFECT_PRESSED, #00_toolbar_ef_press.#.png); //not supported by theme ADD_IMAGE_CONFIG(BACK_ICON_NORMAL, #00_icon_Back.png); ADD_IMAGE_CONFIG(BACK_ICON_DISABLED, #00_icon_Back.png); @@ -140,6 +171,20 @@ START_UI_CONFIG(FOOTER); ADD_IMAGE_CONFIG(BACK_ICON_TRANSLUCENT_EFFECT_NORMAL, #00_icon_Back_trans_ef.png); //not supported by theme ADD_IMAGE_CONFIG(BACK_ICON_TRANSLUCENT_EFFECT_PRESSED, #00_icon_Back_trans_ef.png); //not supported by theme + ADD_IMAGE_CONFIG(HIDE_ICON_NORMAL, #00_icon_Hide.png); + ADD_IMAGE_CONFIG(HIDE_ICON_DISABLED, #00_icon_Hide.png); + ADD_IMAGE_CONFIG(HIDE_ICON_PRESSED, #00_icon_Hide.png); + ADD_IMAGE_CONFIG(HIDE_ICON_HIGHLIGHTED, #00_icon_Hide.png); + + ADD_IMAGE_CONFIG(HIDE_ICON_EFFECT_NORMAL, #00_icon_Hide_ef.png); //not supported by theme + ADD_IMAGE_CONFIG(HIDE_ICON_EFFECT_PRESSED, #00_icon_Hide_ef.png); //not supported by theme + + ADD_IMAGE_CONFIG(HIDE_ICON_EFFECT_NORMAL2, #00_icon_Hide_ef_02.png); //not supported by theme + ADD_IMAGE_CONFIG(HIDE_ICON_EFFECT_PRESSED2, #00_icon_Hide_ef_02.png); //not supported by theme + + ADD_IMAGE_CONFIG(HIDE_ICON_TRANSLUCENT_EFFECT_NORMAL, #00_icon_Hide_trans_ef.png); //not supported by theme + ADD_IMAGE_CONFIG(HIDE_ICON_TRANSLUCENT_EFFECT_PRESSED, #00_icon_Hide_trans_ef.png); //not supported by theme + ADD_IMAGE_CONFIG(MORE_ICON_NORMAL, #00_icon_more.png); ADD_IMAGE_CONFIG(MORE_ICON_DISABLED, #00_icon_more.png); ADD_IMAGE_CONFIG(MORE_ICON_PRESSED, #00_icon_more.png); @@ -148,18 +193,18 @@ START_UI_CONFIG(FOOTER); ADD_IMAGE_CONFIG(MORE_ICON_EFFECT_NORMAL, #00_icon_more_ef.png); //not supported by theme ADD_IMAGE_CONFIG(MORE_ICON_EFFECT_PRESSED, #00_icon_more_ef.png); //not supported by theme - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_NORMAL, #00_toolbar_button_bg.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_DISABLED, #00_toolbar_button_bg.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_PRESSED, #00_toolbar_button_bg.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_HIGHLIGHTED, #00_toolbar_button_bg.9.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_NORMAL, #00_toolbar_button_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_DISABLED, #00_toolbar_button_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_PRESSED, #00_toolbar_button_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_HIGHLIGHTED, #00_toolbar_button_bg.#.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_EFFECT_NORMAL, #00_toolbar_button_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_EFFECT_PRESSED, #00_toolbar_button_ef_press.9.png); //not supported by theme + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_EFFECT_NORMAL, #00_toolbar_button_ef.#.png); //not supported by theme + ADD_IMAGE_CONFIG(BUTTON_ITEM_BG_EFFECT_PRESSED, #00_toolbar_button_ef_press.#.png); //not supported by theme - ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_NORMAL, #00_toolbar_button.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_DISABLED, #00_toolbar_button.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, #00_toolbar_button_press.9.png); - ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, #00_toolbar_button_press.9.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_NORMAL, #00_toolbar_button.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_DISABLED, #00_toolbar_button.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, #00_toolbar_button_press.#.png); + ADD_IMAGE_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, #00_toolbar_button_press.#.png); ADD_IMAGE_CONFIG(SOFTKEY_LEFT_BG_NORMAL, #00_softkey_left_bg.png); ADD_IMAGE_CONFIG(SOFTKEY_LEFT_BG_DISABLED, #00_softkey_left_bg.png); @@ -208,19 +253,28 @@ START_UI_CONFIG(FOOTER); ADD_IMAGE_CONFIG(OPTIONKEY_BG_PRESSED, #00_option_panel_handle_bg_press.png); ADD_IMAGE_CONFIG(OPTIONKEY_BG_HIGHLIGHTED, #00_option_panel_handle_bg_press.png); + ADD_IMAGE_CONFIG(OPTIONKEY_HANDLE_MORE_NORMAL, #00_option_panel_handle_more.png); + ADD_IMAGE_CONFIG(OPTIONKEY_HANDLE_MORE_DISABLED, #00_option_panel_handle_more.png); + ADD_IMAGE_CONFIG(OPTIONKEY_HANDLE_MORE_PRESSED, #00_option_panel_handle_more_press.png); + ADD_IMAGE_CONFIG(OPTIONKEY_HANDLE_MORE_HIGHLIGHTED, #00_option_panel_handle_more.png); + ADD_IMAGE_CONFIG(OPTIONKEY_BG_EFFECT_NORMAL, #00_option_panel_handle_bg_ef.png); //not supported by theme ADD_IMAGE_CONFIG(OPTIONKEY_BG_EFFECT_PRESSED, #00_option_panel_handle_bg_ef_press.png); //not supported by theme + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL, #00_effect_toolbar_tab_bounce_left.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL, #00_effect_toolbar_tab_bounce_right.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL, #00_effect_toolbar_tab_bounce_left_h.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL, #00_effect_toolbar_tab_bounce_right_h.png); //SHAPE START_UI_CONFIG_MODE(720x1280); ADD_SHAPE_CONFIG(HEIGHT, 98); ADD_SHAPE_CONFIG(WIDTH, 720); - ADD_SHAPE_CONFIG(LEFT_MARGIN, 28); + ADD_SHAPE_CONFIG(LEFT_MARGIN, 26); ADD_SHAPE_CONFIG(VERTICAL_MARGIN, 0); ADD_SHAPE_CONFIG(BUTTON_ITEM_FONT_SIZE, 20); ADD_SHAPE_CONFIG(FOOTER_ITEM_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(FOOTER_ITEM_ICON_SIZE, 56); + ADD_SHAPE_CONFIG(FOOTER_ITEM_ICON_SIZE, 63); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE, 48); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE_WITH_TEXT, 40); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_SIDE_MARGIN, 28); @@ -239,11 +293,15 @@ START_UI_CONFIG(FOOTER); ADD_SHAPE_CONFIG(BUTTON_ITEM_TEXT_FONT_SIZE_ITEM_5_WITH_ICON, 18); ADD_SHAPE_CONFIG(SEGMENTED_ITEM_FONT_SIZE, 30); ADD_SHAPE_CONFIG(SEGMENTED_ICON_TEXT_GAP, 20); - ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MAX, 490); + ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MAX, 496); ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MIN, 182); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 56); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 56); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 56); + ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 85); + ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 98); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63); + ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 18); + ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 17); ADD_SHAPE_CONFIG(SOFTKEY_HEIGHT, 118);//720x1280 ADD_SHAPE_CONFIG(SOFTKEY_TEXT_SIZE, 42); ADD_SHAPE_CONFIG(SOFTKEY_0_LEFT_MARGIN, 3); @@ -258,12 +316,12 @@ START_UI_CONFIG(FOOTER); START_UI_CONFIG_MODE(1280x720); ADD_SHAPE_CONFIG(HEIGHT, 85); - ADD_SHAPE_CONFIG(WIDTH, 1280); - ADD_SHAPE_CONFIG(LEFT_MARGIN, 28); + ADD_SHAPE_CONFIG(WIDTH, _SCREEN_HEIGHT_); + ADD_SHAPE_CONFIG(LEFT_MARGIN, 26); ADD_SHAPE_CONFIG(VERTICAL_MARGIN, 0); ADD_SHAPE_CONFIG(BUTTON_ITEM_FONT_SIZE, 20); ADD_SHAPE_CONFIG(FOOTER_ITEM_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(FOOTER_ITEM_ICON_SIZE, 56); + ADD_SHAPE_CONFIG(FOOTER_ITEM_ICON_SIZE, 63); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE, 48); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE_WITH_TEXT, 40); ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_SIDE_MARGIN, 28); @@ -282,11 +340,15 @@ START_UI_CONFIG(FOOTER); ADD_SHAPE_CONFIG(BUTTON_ITEM_TEXT_FONT_SIZE_ITEM_5_WITH_ICON, 18); ADD_SHAPE_CONFIG(SEGMENTED_ITEM_FONT_SIZE, 30); ADD_SHAPE_CONFIG(SEGMENTED_ICON_TEXT_GAP, 54); - ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MAX, 1000); + ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MAX, 1012); ADD_SHAPE_CONFIG(FOOTER_ITEM_WIDTH_1_MIN, 330);//1280x720 - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 56); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 56); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 56); + ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 85); + ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 85); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63); + ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 11); ADD_SHAPE_CONFIG(SOFTKEY_HEIGHT, 118); ADD_SHAPE_CONFIG(SOFTKEY_TEXT_SIZE, 42); ADD_SHAPE_CONFIG(SOFTKEY_0_LEFT_MARGIN, 3); diff --git a/src/ui/resource/FUi_ResourceFormConfig.cpp b/src/ui/resource/FUi_ResourceFormConfig.cpp index d217fa4..3715b82 100644 --- a/src/ui/resource/FUi_ResourceFormConfig.cpp +++ b/src/ui/resource/FUi_ResourceFormConfig.cpp @@ -24,15 +24,16 @@ START_UI_CONFIG(FORM); { ADD_COLOR_CONFIG(BG_NORMAL, $B011); + ADD_COLOR_CONFIG(INDICATOR_BG_NORMAL, $B011); START_UI_CONFIG_MODE(480x800); ADD_SHAPE_CONFIG(INDICATOR_WIDTH, 480); - ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 38); + ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 40); END_UI_CONFIG_MODE(480x800); START_UI_CONFIG_MODE(800x480); - ADD_SHAPE_CONFIG(INDICATOR_WIDTH, 800); - ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 38); + ADD_SHAPE_CONFIG(INDICATOR_WIDTH, _SCREEN_HEIGHT_); + ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 40); END_UI_CONFIG_MODE(800x480); START_UI_CONFIG_MODE(720x1280); @@ -41,7 +42,7 @@ START_UI_CONFIG(FORM); END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); - ADD_SHAPE_CONFIG(INDICATOR_WIDTH, 1280); + ADD_SHAPE_CONFIG(INDICATOR_WIDTH, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 60); END_UI_CONFIG_MODE(1280x720); diff --git a/src/ui/resource/FUi_ResourceGalleryConfig.cpp b/src/ui/resource/FUi_ResourceGalleryConfig.cpp old mode 100644 new mode 100755 index 1885c9b..8349411 --- a/src/ui/resource/FUi_ResourceGalleryConfig.cpp +++ b/src/ui/resource/FUi_ResourceGalleryConfig.cpp @@ -23,7 +23,7 @@ START_UI_CONFIG(GALLERY); { - ADD_COLOR_CONFIG(EMPTY_GALLERY_TEXT_NORMAL, $F011L21); + ADD_COLOR_CONFIG(EMPTY_TEXT_NORMAL, $F011L21); START_UI_CONFIG_MODE(480x800); END_UI_CONFIG_MODE(480x800); diff --git a/src/ui/resource/FUi_ResourceGroupContainerConfig.cpp b/src/ui/resource/FUi_ResourceGroupContainerConfig.cpp new file mode 100644 index 0000000..d9686eb --- /dev/null +++ b/src/ui/resource/FUi_ResourceGroupContainerConfig.cpp @@ -0,0 +1,37 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_ResourceGroupContainerConfig.cpp + * @brief This is the implementation file for the properties of GroupContainer. + */ + +#include "FUi_ResourceConfigMacro.h" + +START_UI_CONFIG(GROUPCONTAINER); +{ + ADD_COLOR_CONFIG(NORMAL_BG, $B0217); + ADD_COLOR_CONFIG(LINE_COLOR_FG, $F032L1); + ADD_IMAGE_CONFIG(BORDER_BG_EFFECT, #00_list_group_bg_ef.#.png); + ADD_IMAGE_CONFIG(SYSTEM_CONTROL_BG, #00_system_control_bg.#.png); + + START_UI_CONFIG_MODE(720x1280); + ADD_FIXED_VALUE_CONFIG(DEFAULT_MARGIN, 2); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); + END_UI_CONFIG_MODE(720x1280); +} +END_UI_CONFIG(GROUPCONTAINER); diff --git a/src/ui/resource/FUi_ResourceHeaderConfig.cpp b/src/ui/resource/FUi_ResourceHeaderConfig.cpp index f2b316a..d45723e 100644 --- a/src/ui/resource/FUi_ResourceHeaderConfig.cpp +++ b/src/ui/resource/FUi_ResourceHeaderConfig.cpp @@ -53,8 +53,7 @@ START_UI_CONFIG(HEADER); ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_TEXT_PRESSED, $B052L8P); ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); - - + // $B0543 is 0x00000000, transparent ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_NORMAL, $B0513); ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_DISABLED, $B0513); ADD_COLOR_CONFIG(SEGMENTED_ITEM_BG_PRESSED, $B0514P1); @@ -79,6 +78,30 @@ START_UI_CONFIG(HEADER); ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_TEXT_SELECTED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_BG_NORMAL, $B0513); + ADD_COLOR_CONFIG(TAB_ITEM_BG_DISABLED, $B0513); + ADD_COLOR_CONFIG(TAB_ITEM_BG_PRESSED, $B0514P1); + ADD_COLOR_CONFIG(TAB_ITEM_BG_HIGHLIGHTED, $B0514P1); + ADD_COLOR_CONFIG(TAB_ITEM_BG_SELECTED, $B0513); + + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_NORMAL, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_DISABLED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B013); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013); + + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_NORMAL, $B052L6); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L4D); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6P); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_HIGHLIGHTED, $B052L6P); + ADD_COLOR_CONFIG(TAB_ITEM_TEXT_SELECTED, $B052L6P); + + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_NORMAL, $B052L8); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_DISABLED, $B052L8); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_PRESSED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_HIGHLIGHTED, $B052L8P); + ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_TEXT_SELECTED, $B052L8P); + ADD_COLOR_CONFIG(BADGE_ICON_BG_NORMAL, $B0519); ADD_COLOR_CONFIG(BADGE_ICON_BG_DISABLED, $B0519); ADD_COLOR_CONFIG(BADGE_ICON_BG_PRESSED, $B0519); @@ -89,62 +112,82 @@ START_UI_CONFIG(HEADER); ADD_COLOR_CONFIG(BADGE_ICON_TEXT_PRESSED, $B052L7); ADD_COLOR_CONFIG(BADGE_ICON_TEXT_HIGHLIGHTED, $B052L7); + ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_NORMAL, $B0221); + ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_NORMAL, $B0222); + + ADD_COLOR_CONFIG(DIVIDER_LINE_LEFT_TRANSLUCENT_NORMAL, $B0227); + ADD_COLOR_CONFIG(DIVIDER_LINE_RIGHT_TRANSLUCENT_NORMAL, $B0228); // BITMAP - ADD_IMAGE_CONFIG(BG_NORMAL, #00_title_bg.9.png); - ADD_IMAGE_CONFIG(TAB_ITEM_BG_EFFECT_PRESSED, #00_tab_press_ef.9.png); - ADD_IMAGE_CONFIG(TAB_ITEM_BG_SELECTED, #00_tab_focus.9.png); - - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_01, #00_list_process_01_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_02, #00_list_process_02_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_03, #00_list_process_03_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_04, #00_list_process_04_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_05, #00_list_process_05_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_06, #00_list_process_06_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_07, #00_list_process_07_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_08, #00_list_process_08_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_09, #00_list_process_09_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_10, #00_list_process_10_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_11, #00_list_process_11_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_12, #00_list_process_12_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_13, #00_list_process_13_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_14, #00_list_process_14_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_15, #00_list_process_15_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_16, #00_list_process_16_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_17, #00_list_process_17_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_18, #00_list_process_18_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_19, #00_list_process_19_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_20, #00_list_process_20_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_21, #00_list_process_21_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_22, #00_list_process_22_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_23, #00_list_process_23_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_24, #00_list_process_24_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_25, #00_list_process_25_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_26, #00_list_process_26_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_27, #00_list_process_27_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_28, #00_list_process_28_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_29, #00_list_process_29_32x32.png); - ADD_IMAGE_CONFIG(PROCESSING_ANIMATION_30, #00_list_process_30_32x32.png); - - ADD_IMAGE_CONFIG(BADGE_ICON_BG_NORMAL, #00_badge_bg.9.png); - ADD_IMAGE_CONFIG(BADGE_ICON_BG_DISABLED, #00_badge_bg.9.png); - ADD_IMAGE_CONFIG(BADGE_ICON_BG_PRESSED, #00_badge_bg.9.png); - ADD_IMAGE_CONFIG(BADGE_ICON_BG_HIGHLIGHTED, #00_badge_bg.9.png); - - ADD_IMAGE_CONFIG(BADGE_ICON_BG_EFFECT_NORMAL, #00_badge_bg_ef.9.png); //not supported by theme - ADD_IMAGE_CONFIG(BADGE_ICON_BG_EFFECT_PRESSED, #00_badge_bg_ef.9.png); //not supported by theme - - ADD_IMAGE_CONFIG(DIVIDER_LINE_NORMAL, #00_divider_line.9.png); - ADD_IMAGE_CONFIG(DIVIDER_LINE_TRANSLUCENT_NORMAL, #00_divider_line_translucent.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_title_bg.#.png); + ADD_IMAGE_CONFIG(TRANSLUCENT_BG_NORMAL, #00_title_bg.#.png); + + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_title_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_DISABLED, #00_title_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_title_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_HIGHLIGHTED, #00_title_bg.#.png); + + ADD_IMAGE_CONFIG(TAB_ITEM_BG_EFFECT_PRESSED, #00_tab_press_ef.#.png); + ADD_IMAGE_CONFIG(TAB_ITEM_SELECTED, #00_tab_focus.#.png); + + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL, #00_effect_tab_bounce_left.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL, #00_effect_tab_bounce_right.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL, #00_effect_tab_bounce_left_h.png); + ADD_IMAGE_CONFIG(TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL, #00_effect_tab_bounce_right_h.png); + ADD_IMAGE_CONFIG(TITLE_TAB_ITEM_BOUNCING_EFFECT_LEFT, #00_effect_title_tab_bounce_left.png); + ADD_IMAGE_CONFIG(TITLE_TAB_ITEM_BOUNCING_EFFECT_RIGHT, #00_effect_title_tab_bounce_right.png); + + START_ANIMATION_CONFIG(PROCESSING_ANIMATION); + ADD_ANIMATION_FRAME(#00_header_process_01.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_02.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_03.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_04.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_05.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_06.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_07.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_08.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_09.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_10.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_11.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_12.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_13.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_14.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_15.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_16.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_17.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_18.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_19.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_20.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_21.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_22.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_23.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_24.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_25.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_26.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_27.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_28.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_29.png, 16); + ADD_ANIMATION_FRAME(#00_header_process_30.png, 16); + END_ANIMATION_CONFIG(PROCESSING_ANIMATION); + + ADD_IMAGE_CONFIG(BADGE_ICON_BG_NORMAL, #00_badge_bg.#.png); + ADD_IMAGE_CONFIG(BADGE_ICON_BG_DISABLED, #00_badge_bg.#.png); + ADD_IMAGE_CONFIG(BADGE_ICON_BG_PRESSED, #00_badge_bg.#.png); + ADD_IMAGE_CONFIG(BADGE_ICON_BG_HIGHLIGHTED, #00_badge_bg.#.png); + + ADD_IMAGE_CONFIG(BADGE_ICON_BG_EFFECT_NORMAL, #00_badge_bg_ef.#.png); //not supported by theme + ADD_IMAGE_CONFIG(BADGE_ICON_BG_EFFECT_PRESSED, #00_badge_bg_ef.#.png); //not supported by theme + + ADD_IMAGE_CONFIG(DIVIDER_LINE_NORMAL, #00_divider_line.#.png); + ADD_IMAGE_CONFIG(DIVIDER_LINE_TRANSLUCENT_NORMAL, #00_divider_line_translucent.#.png); // SHAPE START_UI_CONFIG_MODE(720x1280); ADD_SHAPE_CONFIG(HEIGHT, 111); ADD_SHAPE_CONFIG(WIDTH, 720); ADD_SHAPE_CONFIG(LEFT_MARGIN, 16); - ADD_SHAPE_CONFIG(TOP_MARGIN, 34); - ADD_SHAPE_CONFIG(RIGHT_MARGIN, 28); - ADD_SHAPE_CONFIG(RIGHT_MARGIN_WITH_SEGMENTED_BUTTON, 6); + ADD_SHAPE_CONFIG(TOP_MARGIN, 32); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 26); ADD_SHAPE_CONFIG(TITLE_FONT_SIZE, 56); ADD_SHAPE_CONFIG(TITLE_FONT_SIZE_WITH_DESCRIPTION, 44); @@ -156,8 +199,10 @@ START_UI_CONFIG(HEADER); ADD_SHAPE_CONFIG(TAB_ITEM_FONT_SIZE_3_ITEM, 28);//720x1280 ADD_SHAPE_CONFIG(TAB_ITEM_FONT_SIZE_4_ITEM, 24); ADD_SHAPE_CONFIG(BADGE_FONT_SIZE, 26); + ADD_SHAPE_CONFIG(BADGE_FONT_SIZE_WITH_BUTTON, 20); + ADD_SHAPE_CONFIG(BADGE_FONT_SIZE_WITH_BUTTON_2, 16); - ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT, 64); + ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT, 68); ADD_SHAPE_CONFIG(TITLE_TOP_MARGIN_WITH_DESCRIPTION, 18); ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT_WITH_DESCRIPTION, 50); ADD_SHAPE_CONFIG(TITLE_TOTAL_HEIGHT_WITH_SEGMENTED_ITEM, 165); @@ -166,47 +211,56 @@ START_UI_CONFIG(HEADER); ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT_WITH_SEGMENTED_ITEM, 60); ADD_SHAPE_CONFIG(DESCRIPTION_TEXT_HEIGHT, 36); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 64); + ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 85); ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_WITH_TEXT, 114); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 64); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_OF_SEGMENTED, 128); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_OF_SEGMENTED_2, 106); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT_OF_SEGMENTED, 111); + ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 111); ADD_SHAPE_CONFIG(BUTTON_ITEM_GAP, 4); - ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN, 34); - ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN_OF_SEGMENTED, 0); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 32); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 64); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN, 0); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 34); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63); + + ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 34); + ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 13); - ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 64); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 36); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 12); - ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 64); - ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 44); + ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 63); + + ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 63); + ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 45); ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 16); - ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 40); - ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 33); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 0); + ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 32); - ADD_SHAPE_CONFIG(ICON_WIDTH, 38); + ADD_SHAPE_CONFIG(ICON_WIDTH, 45); ADD_SHAPE_CONFIG(ICON_TEXT_GAP, 8); - ADD_SHAPE_CONFIG(SEPARATOR_WIDTH, 4); - ADD_SHAPE_CONFIG(SEPARATOR_HEIGHT, 26); + ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 4); + ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 26); - ADD_SHAPE_CONFIG(BADGE_HEIGHT, 48); - ADD_SHAPE_CONFIG(BADGE_WIDTH_1DIGIT, 54); + ADD_SHAPE_CONFIG(BADGE_HEIGHT, 54); + ADD_SHAPE_CONFIG(BADGE_HEIGHT_WITH_BUTTON, 45); + ADD_SHAPE_CONFIG(BADGE_WIDTH_1DIGIT, 50); ADD_SHAPE_CONFIG(BADGE_WIDTH_2DIGIT, 64); - ADD_SHAPE_CONFIG(BADGE_WIDTH_3DIGIT, 70); - ADD_SHAPE_CONFIG(BADGE_WIDTH_4DIGIT, 80); - ADD_SHAPE_CONFIG(BADGE_WIDTH_5DIGIT, 90); + ADD_SHAPE_CONFIG(BADGE_WIDTH_3DIGIT, 78); + ADD_SHAPE_CONFIG(BADGE_WIDTH_4DIGIT, 92); + ADD_SHAPE_CONFIG(BADGE_WIDTH_5DIGIT, 106); + + ADD_SHAPE_CONFIG(TITLE_BADGE_ICON_GAP, 2); + ADD_SHAPE_CONFIG(TITLE_BADGE_TOP_MARGIN, 3); ADD_SHAPE_CONFIG(HEADER_ITEM_SELECTED_BITMAP_MARGIN, 16); ADD_SHAPE_CONFIG(HEADER_ITEM_SELECTED_BITMAP_HEIGHT, 3); - ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_SIZE, 32); + ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_SIZE, 36); ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_GAP, 16); - ADD_SHAPE_CONFIG(HEADER_ITEM_WIDTH_1_MIN, 182); ADD_SHAPE_CONFIG(TITLE_MINIMUM_WIDTH, 60); ADD_SHAPE_CONFIG(ITEM_MINIMUM_WIDTH, 60); ADD_SHAPE_CONFIG(COMMON_MINIMUM_MARGIN, 8); @@ -215,11 +269,10 @@ START_UI_CONFIG(HEADER); START_UI_CONFIG_MODE(1280x720); ADD_SHAPE_CONFIG(HEIGHT, 91); - ADD_SHAPE_CONFIG(WIDTH, 1280); + ADD_SHAPE_CONFIG(WIDTH, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(LEFT_MARGIN, 16); - ADD_SHAPE_CONFIG(TOP_MARGIN, 17); - ADD_SHAPE_CONFIG(RIGHT_MARGIN, 28); - ADD_SHAPE_CONFIG(RIGHT_MARGIN_WITH_SEGMENTED_BUTTON, 6); + ADD_SHAPE_CONFIG(TOP_MARGIN, 15); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 26); ADD_SHAPE_CONFIG(TITLE_FONT_SIZE, 50); ADD_SHAPE_CONFIG(TITLE_FONT_SIZE_WITH_DESCRIPTION, 38); @@ -231,8 +284,10 @@ START_UI_CONFIG(HEADER); ADD_SHAPE_CONFIG(TAB_ITEM_FONT_SIZE_3_ITEM, 28); ADD_SHAPE_CONFIG(TAB_ITEM_FONT_SIZE_4_ITEM, 24); ADD_SHAPE_CONFIG(BADGE_FONT_SIZE, 26); + ADD_SHAPE_CONFIG(BADGE_FONT_SIZE_WITH_BUTTON, 20); + ADD_SHAPE_CONFIG(BADGE_FONT_SIZE_WITH_BUTTON_2, 16); - ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT, 64); + ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT, 68); ADD_SHAPE_CONFIG(TITLE_TOP_MARGIN_WITH_DESCRIPTION, 11); ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT_WITH_DESCRIPTION, 42); ADD_SHAPE_CONFIG(TITLE_TOTAL_HEIGHT_WITH_SEGMENTED_ITEM, 145); @@ -241,47 +296,56 @@ START_UI_CONFIG(HEADER); ADD_SHAPE_CONFIG(TITLE_DISPLAY_HEIGHT_WITH_SEGMENTED_ITEM, 60); ADD_SHAPE_CONFIG(DESCRIPTION_TEXT_HEIGHT, 32); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 64); + ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 85); ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_WITH_TEXT, 114); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 64); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_OF_SEGMENTED, 128); - ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH_OF_SEGMENTED_2, 106); - ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT_OF_SEGMENTED, 91); + ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 91); ADD_SHAPE_CONFIG(BUTTON_ITEM_GAP, 4); - ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN, 17); - ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN_OF_SEGMENTED, 0); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 15); - ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 64); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN, 0); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 17); + ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63); + + ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 17); + ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 10); - ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 64); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 11); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 11); - ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 64); - ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 44); + ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 63); + + ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 63); + ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 45); ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 34); - ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 40);//1280x720 - ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 33); + ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 0);//1280x720 + ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 32); - ADD_SHAPE_CONFIG(ICON_WIDTH, 38); + ADD_SHAPE_CONFIG(ICON_WIDTH, 45); ADD_SHAPE_CONFIG(ICON_TEXT_GAP, 8); - ADD_SHAPE_CONFIG(SEPARATOR_WIDTH, 4); - ADD_SHAPE_CONFIG(SEPARATOR_HEIGHT, 26); + ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 4); + ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 26); - ADD_SHAPE_CONFIG(BADGE_HEIGHT, 48); - ADD_SHAPE_CONFIG(BADGE_WIDTH_1DIGIT, 54); + ADD_SHAPE_CONFIG(BADGE_HEIGHT, 54); + ADD_SHAPE_CONFIG(BADGE_HEIGHT_WITH_BUTTON, 45); + ADD_SHAPE_CONFIG(BADGE_WIDTH_1DIGIT, 50); ADD_SHAPE_CONFIG(BADGE_WIDTH_2DIGIT, 64); - ADD_SHAPE_CONFIG(BADGE_WIDTH_3DIGIT, 70); - ADD_SHAPE_CONFIG(BADGE_WIDTH_4DIGIT, 80); - ADD_SHAPE_CONFIG(BADGE_WIDTH_5DIGIT, 90); + ADD_SHAPE_CONFIG(BADGE_WIDTH_3DIGIT, 78); + ADD_SHAPE_CONFIG(BADGE_WIDTH_4DIGIT, 92); + ADD_SHAPE_CONFIG(BADGE_WIDTH_5DIGIT, 106); + + ADD_SHAPE_CONFIG(TITLE_BADGE_ICON_GAP, 2); + ADD_SHAPE_CONFIG(TITLE_BADGE_TOP_MARGIN, 3); ADD_SHAPE_CONFIG(HEADER_ITEM_SELECTED_BITMAP_MARGIN, 16); ADD_SHAPE_CONFIG(HEADER_ITEM_SELECTED_BITMAP_HEIGHT, 3); - ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_SIZE, 32); + ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_SIZE, 36); ADD_SHAPE_CONFIG(PROCESSING_ANIMATION_ICON_GAP, 16); - ADD_SHAPE_CONFIG(HEADER_ITEM_WIDTH_1_MIN, 330);//1280x720 ADD_SHAPE_CONFIG(TITLE_MINIMUM_WIDTH, 60); ADD_SHAPE_CONFIG(ITEM_MINIMUM_WIDTH, 60); ADD_SHAPE_CONFIG(COMMON_MINIMUM_MARGIN, 8); diff --git a/src/ui/resource/FUi_ResourceIconListConfig.cpp b/src/ui/resource/FUi_ResourceIconListConfig.cpp old mode 100644 new mode 100755 index fcdf603..9d0bcc4 --- a/src/ui/resource/FUi_ResourceIconListConfig.cpp +++ b/src/ui/resource/FUi_ResourceIconListConfig.cpp @@ -33,9 +33,9 @@ START_UI_CONFIG(ICONLIST); ADD_COLOR_CONFIG(ITEM_BORDER_NORMAL, $W151); ADD_COLOR_CONFIG(ITEM_BORDER_PRESSED, $W151); ADD_COLOR_CONFIG(ITEM_BORDER_HIGHLIGHTED, $W153); - ADD_IMAGE_CONFIG(ITEM_BORDER_NORMAL, #00_thumbs_line_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BORDER_PRESSED, #00_thumbs_line_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BORDER_HIGHLIGHTED, #00_thumbs_bg_focus.9.png); + ADD_IMAGE_CONFIG(ITEM_BORDER_NORMAL, #00_thumbs_line_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BORDER_PRESSED, #00_thumbs_line_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BORDER_HIGHLIGHTED, #00_thumbs_bg_focus.#.png); ADD_IMAGE_CONFIG(CHECK_BG_NORMAL, #00_grid_select_check_bg.png); ADD_IMAGE_CONFIG(CHECK_BG_SELECTED, #00_grid_select_check_bg_press.png); ADD_IMAGE_CONFIG(CHECK_SELECTED, #00_grid_select_check.png); diff --git a/src/ui/resource/FUi_ResourceInputPadConfig.cpp b/src/ui/resource/FUi_ResourceInputPadConfig.cpp old mode 100644 new mode 100755 index 2a216ad..06a488d --- a/src/ui/resource/FUi_ResourceInputPadConfig.cpp +++ b/src/ui/resource/FUi_ResourceInputPadConfig.cpp @@ -30,9 +30,10 @@ START_UI_CONFIG(INPUTPAD); ADD_COLOR_CONFIG(BUTTON_BG_NORMAL, $W011); ADD_COLOR_CONFIG(BUTTON_BG_PRESSED, $B042); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_time_picker_keypad_bg.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_time_picker_keypad_button_bg.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_NORMAL, #00_time_picker_keypad_button_bg_ef.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_time_picker_keypad_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_time_picker_keypad_button_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_time_picker_keypad_button_bg.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT_NORMAL, #00_time_picker_keypad_button_bg_ef.#.png); START_UI_CONFIG_MODE(720x1280); { diff --git a/src/ui/resource/FUi_ResourceLabelConfig.cpp b/src/ui/resource/FUi_ResourceLabelConfig.cpp index 51c660f..6c79ec2 100644 --- a/src/ui/resource/FUi_ResourceLabelConfig.cpp +++ b/src/ui/resource/FUi_ResourceLabelConfig.cpp @@ -31,15 +31,19 @@ START_UI_CONFIG(LABEL); START_UI_CONFIG_MODE(720x1280); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(TOP_MARGIN, 0); ADD_SHAPE_CONFIG(LEFT_MARGIN, 16); + ADD_SHAPE_CONFIG(TOP_MARGIN, 0); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 16); + ADD_SHAPE_CONFIG(BOTTOM_MARGIN, 0); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(TOP_MARGIN, 0); ADD_SHAPE_CONFIG(LEFT_MARGIN, 16); + ADD_SHAPE_CONFIG(TOP_MARGIN, 0); + ADD_SHAPE_CONFIG(RIGHT_MARGIN, 16); + ADD_SHAPE_CONFIG(BOTTOM_MARGIN, 0); ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); END_UI_CONFIG_MODE(1280x720); } diff --git a/src/ui/resource/FUi_ResourceListConfig.cpp b/src/ui/resource/FUi_ResourceListConfig.cpp index 4c0485e..56c9763 100644 --- a/src/ui/resource/FUi_ResourceListConfig.cpp +++ b/src/ui/resource/FUi_ResourceListConfig.cpp @@ -24,9 +24,8 @@ START_UI_CONFIG(LIST); { - ADD_COLOR_CONFIG(LISTITEM_DIVIDER_LEFT_HALF_COLOR, $B0231L1); - ADD_COLOR_CONFIG(LISTITEM_DIVIDER_RIGHT_HALF_COLOR, $B0231L2); - ADD_COLOR_CONFIG(EXPANDABLELIST_DOWN_AND_UP_ARROW_COLOR, $B0231L1); + ADD_COLOR_CONFIG(LISTITEM_DIVIDER_LEFT_HALF_COLOR, $B0223); + ADD_COLOR_CONFIG(LISTITEM_DIVIDER_RIGHT_HALF_COLOR, $B0222); ADD_COLOR_CONFIG(EXPANDABLELIST_SUB_ITEM_BG_COLOR, $B0217); ADD_COLOR_CONFIG(ELEMENT_TEXT_NORMAL, $F011L1); ADD_COLOR_CONFIG(ELEMENT_TEXT_PRESSED, $F011L1P); @@ -37,8 +36,8 @@ START_UI_CONFIG(LIST); ADD_IMAGE_CONFIG(CHECK_DIM_BITMAP, #00_check_dim.png); ADD_IMAGE_CONFIG(BUTTON_RADIO_BITMAP, #00_button_radio_normal2.png); ADD_IMAGE_CONFIG(BUTTON_RADIO_SELECTED_BITMAP, #00_button_radio_normal1.png); - ADD_IMAGE_CONFIG(BUTTON_OFF_BITMAP, #00_button_off_temp.png); - ADD_IMAGE_CONFIG(BUTTON_ON_BITMAP, #00_button_on_temp.png); + ADD_IMAGE_CONFIG(BUTTON_OFF_BITMAP, #00_button_off.png); + ADD_IMAGE_CONFIG(BUTTON_ON_BITMAP, #00_button_on.png); ADD_IMAGE_CONFIG(BUTTON_EXPAND_GROUP, #00_button_expand_opened.png); ADD_IMAGE_CONFIG(BUTTON_COLLAPSE_GROUP, #00_button_expand_closed.png); diff --git a/src/ui/resource/FUi_ResourceListViewConfig.cpp b/src/ui/resource/FUi_ResourceListViewConfig.cpp index 19b1abc..5552ab5 100644 --- a/src/ui/resource/FUi_ResourceListViewConfig.cpp +++ b/src/ui/resource/FUi_ResourceListViewConfig.cpp @@ -23,16 +23,6 @@ START_UI_CONFIG(LISTVIEW); { - ADD_COLOR_CONFIG(EMPTY_LIST_TEXT_NORMAL, $F011L21); - ADD_COLOR_CONFIG(ITEM_TEXT_NORMAL, $F011L1); - ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $F011L1P); - ADD_COLOR_CONFIG(ITEM_TEXT_HIGHLIGHTED, $F011L1P); - ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $F011L1D); - ADD_COLOR_CONFIG(ITEM_DESCRIPTION_TEXT_NORMAL, $F011L21); - ADD_COLOR_CONFIG(GROUPITEM_TEXT_NORMAL, $W021L2); - ADD_COLOR_CONFIG(GROUPITEM_DIVIDER_NORMAL, $W021L2); - ADD_COLOR_CONFIG(CONTEXTITEM_BG_NORMAL, $B0212); - START_UI_CONFIG_MODE(480x800); END_UI_CONFIG_MODE(480x800); @@ -45,7 +35,6 @@ START_UI_CONFIG(LISTVIEW); ADD_SHAPE_CONFIG(ITEM_DESCRIPTION_TEXT_LEFT_MARGIN, 16); ADD_SHAPE_CONFIG(ITEM_DESCRIPTION_TEXT_TOP_MARGIN, 8); ADD_SHAPE_CONFIG(ITEM_DESCRIPTION_TEXT_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(ITEM_PROGRESS_BOTTOM_MARGIN, 16); ADD_SHAPE_CONFIG(GROUPITEM_DEFAULT_HEIGHT, 48); ADD_SHAPE_CONFIG(GROUPITEM_DEFAULT_FONT_SIZE, 32); ADD_SHAPE_CONFIG(GROUPITEM_ELEMENT_LEFT_MARGIN, 26); diff --git a/src/ui/resource/FUi_ResourceLiveboxConfig.cpp b/src/ui/resource/FUi_ResourceLiveboxConfig.cpp new file mode 100644 index 0000000..0e1552e --- /dev/null +++ b/src/ui/resource/FUi_ResourceLiveboxConfig.cpp @@ -0,0 +1,44 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +/** + * @file FUi_ResourceLiveboxConfig.cpp + * @brief This is the implementation file for the properties of Livebox. + */ + +#include "FUi_ResourceConfigMacro.h" + +START_UI_CONFIG(LIVEBOX); +{ + ADD_IMAGE_CONFIG(POPUP_BG, #pd_btn_bg.#.png); + ADD_IMAGE_CONFIG(POPUP_BG_ARROW_UP, #pd_btn_bg_arrow_up.png); + ADD_IMAGE_CONFIG(POPUP_BG_ARROW_DOWN, #pd_btn_bg_arrow_down.png); + + START_UI_CONFIG_MODE(720x1280); + ADD_SHAPE_CONFIG(POPUP_LEFT_MARGIN, 18); + ADD_SHAPE_CONFIG(POPUP_RIGHT_MARGIN, 18); + ADD_SHAPE_CONFIG(POPUP_TOP_MARGIN, 30); + ADD_SHAPE_CONFIG(POPUP_BOTTOM_MARGIN, 30); + END_UI_CONFIG_MODE(720x1280); + + START_UI_CONFIG_MODE(1280x720); + ADD_SHAPE_CONFIG(POPUP_LEFT_MARGIN, 18); + ADD_SHAPE_CONFIG(POPUP_RIGHT_MARGIN, 18); + ADD_SHAPE_CONFIG(POPUP_TOP_MARGIN, 30); + ADD_SHAPE_CONFIG(POPUP_BOTTOM_MARGIN, 30); + END_UI_CONFIG_MODE(1280x720); +} +END_UI_CONFIG(LIVEBOX); diff --git a/src/ui/resource/FUi_ResourceMap.h b/src/ui/resource/FUi_ResourceMap.h index b82afde..d93ed22 100644 --- a/src/ui/resource/FUi_ResourceMap.h +++ b/src/ui/resource/FUi_ResourceMap.h @@ -29,12 +29,9 @@ #include #include +#include #include -namespace Tizen { namespace Base { - class String; -}}// Tizen::Base - namespace Tizen { namespace Ui { namespace _Resource { enum _ResourceType @@ -46,6 +43,7 @@ enum _ResourceType RESOURCE_TYPE_FONT, RESOURCE_TYPE_IMAGE, RESOURCE_TYPE_SHAPE, + RESOURCE_TYPE_ANIMATION, RESOURCE_TYPE_MAX, }; @@ -83,6 +81,82 @@ public: } }; +class ResourceAnimationFrame +{ +public: + ResourceAnimationFrame(void) + : __fileName(L"") + , __duration(0) + { + } + ResourceAnimationFrame(const Tizen::Base::String& fileName, int duration) + : __fileName(fileName) + , __duration(duration) + { + } + ResourceAnimationFrame(const ResourceAnimationFrame& rhs) + { + __fileName = rhs.__fileName; + __duration = rhs.__duration; + } + ~ResourceAnimationFrame(void) + { + } + ResourceAnimationFrame& operator =(const ResourceAnimationFrame& rhs) + { + __fileName = rhs.__fileName; + __duration = rhs.__duration; + return *this; + } + bool operator ==(const ResourceAnimationFrame& rhs) const + { + if (__duration != rhs.__duration) + { + return false; + } + if (__fileName != rhs.__fileName) + { + return false; + } + return true; + } + + Tizen::Base::String __fileName; + int __duration; +}; + +class ResourceAnimationFrameList +{ +public: + ResourceAnimationFrameList(void) + { + } + ~ResourceAnimationFrameList(void) + { + __list.RemoveAll(); + } + void Clear(void) + { + __list.RemoveAll(); + } + ResourceAnimationFrameList& operator =(const ResourceAnimationFrameList& rhs) + { + __list.RemoveAll(); + __list.InsertItemsFrom(rhs.__list, 0); + return *this; + } + void Add(const ResourceAnimationFrame& frame) + { + __list.Add(frame); + } + Tizen::Base::Collection::IListT* GetAnimationList(void) + { + return &__list; + } +private: + Tizen::Base::Collection::LinkedListT __list; +}; + template class Map : public Tizen::Base::Collection::HashMapT @@ -156,7 +230,7 @@ public: result SetValue(const Tizen::Base::String& key, const ValueType& value) { ValueType _value = null; - if(GetValue(key, _value) == E_SUCCESS) + if(Tizen::Base::Collection::HashMapT::GetValue(key, _value) == E_SUCCESS) { __modifiedItemTable.Add(key, true); *_value = *value; diff --git a/src/ui/resource/FUi_ResourceMapContainer.cpp b/src/ui/resource/FUi_ResourceMapContainer.cpp index 3bf8893..819c82a 100644 --- a/src/ui/resource/FUi_ResourceMapContainer.cpp +++ b/src/ui/resource/FUi_ResourceMapContainer.cpp @@ -44,6 +44,7 @@ MapContainer::MapContainer(void) , __pFixedValueMap(null) , __pImageMap(null) , __pShapeMap(null) + , __pAnimationMap(null) , __pProvider(null) , __pComparer(null) , __version(L"") @@ -68,6 +69,8 @@ MapContainer::~MapContainer(void) __pImageMap = null; delete __pShapeMap; __pShapeMap = null; + delete __pAnimationMap; + __pAnimationMap = null; delete __pProvider; __pProvider = null; delete __pComparer; @@ -120,6 +123,14 @@ MapContainer::CreateMap(_ResourceType type) __pShapeMap->Construct(0, 0, *__pProvider, *__pComparer); } break; + case RESOURCE_TYPE_ANIMATION: + if(__pAnimationMap == null) + { + __pAnimationMap = new (std::nothrow) ResourceAnimationMap(type); + SysTryReturnVoidResult(NID_UI, __pAnimationMap, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed."); + __pAnimationMap->Construct(0, 0, *__pProvider, *__pComparer); + } + break; default: break; } @@ -160,6 +171,12 @@ MapContainer::InitializeMap(_ResourceType type) __pShapeMap->Initialize(); } break; + case RESOURCE_TYPE_ANIMATION: + if(__pAnimationMap != null) + { + __pAnimationMap->Initialize(); + } + break; default: break; } @@ -194,6 +211,13 @@ MapContainer::GetShapeMap(void) const { return __pShapeMap; } + +ResourceAnimationMap* +MapContainer::GetAnimationMap(void) const +{ + return __pAnimationMap; +} + void MapContainer::SetVersion (const Tizen::Base::String& version) { diff --git a/src/ui/resource/FUi_ResourceMapContainer.h b/src/ui/resource/FUi_ResourceMapContainer.h index f25ae56..84c6683 100644 --- a/src/ui/resource/FUi_ResourceMapContainer.h +++ b/src/ui/resource/FUi_ResourceMapContainer.h @@ -27,31 +27,36 @@ #ifndef _FUI_INTERNAL_RESOURCE_MAP_CONTAINER_H_ #define _FUI_INTERNAL_RESOURCE_MAP_CONTAINER_H_ +#include +#include +#include #include "FUi_ResourceMap.h" namespace Tizen { namespace Base { -class Integer; +class Float; }}// Tizen::Base namespace Tizen { namespace Base { namespace Collection { template class IHashCodeProviderT; template class IComparerT; +template class LinkedListT; }}}//Tizen::Base::Collection namespace Tizen { namespace Graphics { class Color; -class Dimension; +class FloatDimension; }}//Tizen::Graphics namespace Tizen { namespace Ui { namespace _Resource { typedef Map ResourceColorMap; -typedef Map ResourceDimensionMap; +typedef Map ResourceDimensionMap; typedef Map ResourceImageMap; -typedef Map ResourceShapeMap; +typedef Map ResourceShapeMap; +typedef Map ResourceAnimationMap; class MapContainer { @@ -65,6 +70,7 @@ public: ResourceShapeMap* GetFixedValueMap(void) const; ResourceImageMap* GetImageMap(void) const; ResourceShapeMap* GetShapeMap(void) const; + ResourceAnimationMap* GetAnimationMap(void) const; void SetVersion(const Tizen::Base::String& information); Tizen::Base::String GetVersion(void); void SetThemeName(const Tizen::Base::String& ThemeName); @@ -84,6 +90,7 @@ private: ResourceShapeMap* __pFixedValueMap; ResourceImageMap* __pImageMap; ResourceShapeMap* __pShapeMap; + ResourceAnimationMap* __pAnimationMap; Tizen::Base::Collection::IHashCodeProviderT* __pProvider; Tizen::Base::Collection::IComparerT* __pComparer; diff --git a/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp b/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp old mode 100644 new mode 100755 index 060c703..f986c64 --- a/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp +++ b/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ResourceMessageBoxConfig.cpp * @brief This is the implementation file for the color/shape properties of MessageBox. @@ -27,8 +28,8 @@ START_UI_CONFIG(MESSAGEBOX); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B052L5); ADD_COLOR_CONFIG(TEXT_NORMAL, $B063L1); - ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.9.png); - ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.#.png); + ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.#.png); START_UI_CONFIG_MODE(480x800); { diff --git a/src/ui/resource/FUi_ResourceOptionMenuConfig.cpp b/src/ui/resource/FUi_ResourceOptionMenuConfig.cpp index 244f02b..623ee65 100644 --- a/src/ui/resource/FUi_ResourceOptionMenuConfig.cpp +++ b/src/ui/resource/FUi_ResourceOptionMenuConfig.cpp @@ -25,22 +25,27 @@ START_UI_CONFIG(OPTIONMENU); { ADD_COLOR_CONFIG(ITEM_TEXT_NORMAL, $W1121); ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $W1122); + ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $W1123); ADD_COLOR_CONFIG(ITEM_BG_NORMAL, $W111); ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $B0520P); - ADD_COLOR_CONFIG(HANDLE_NORMAL, $B0518); - ADD_COLOR_CONFIG(HANDLE_PRESSED, $B043); - ADD_COLOR_CONFIG(ARROW_NORMAL, $W1121); - ADD_COLOR_CONFIG(ARROW_PRESSED, $W1122); - ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_panel_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_panel_list_press_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_PRESSED, #00_panel_list_press_bg_ef.9.png); + ADD_COLOR_CONFIG(HANDLE_BG_NORMAL, $B0520); + ADD_COLOR_CONFIG(HANDLE_BG_PRESSED, $B0520P); + ADD_COLOR_CONFIG(HANDLE_BG_DISABLED, $B0520); + ADD_COLOR_CONFIG(CONTEXTUAL_POPUP_ARROW_NORMAL, $W1121); + ADD_COLOR_CONFIG(CONTEXTUAL_POPUP_ARROW_PRESSED, $W1122); + ADD_COLOR_CONFIG(CONTEXTUAL_POPUP_ARROW_DISABLED, $W1121); + ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_panel_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_panel_list_press_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_PRESSED, #00_panel_list_press_bg_ef.#.png); ADD_IMAGE_CONFIG(CONTEXTUAL_POPUP_ARROW, #00_option_panel_contextual_popup_arrow.png); - ADD_IMAGE_CONFIG(HANDLE_BG_NORMAL, #00_panel_handle_bg.9.png); - ADD_IMAGE_CONFIG(HANDLE_BG_PRESSED, #00_panel_handle_bg.9.png); - ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_NORMAL, #00_panel_handle_bg_ef.9.png); - ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_PRESSED, #00_panel_handle_bg_ef_press.9.png); + ADD_IMAGE_CONFIG(HANDLE_BG_NORMAL, #00_panel_handle_bg.#.png); + ADD_IMAGE_CONFIG(HANDLE_BG_PRESSED, #00_panel_handle_bg.#.png); + ADD_IMAGE_CONFIG(HANDLE_BG_DISABLED, #00_panel_handle_bg.#.png); + ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_NORMAL, #00_panel_handle_bg_ef.#.png); + ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_PRESSED, #00_panel_handle_bg_ef_press.#.png); ADD_IMAGE_CONFIG(HANDLE_ARROW_NORMAL, #00_panel_handle_arrow.png); ADD_IMAGE_CONFIG(HANDLE_ARROW_PRESSED, #00_panel_handle_arrow.png); + ADD_IMAGE_CONFIG(HANDLE_ARROW_DISABLED, #00_panel_handle_arrow.png); START_UI_CONFIG_MODE(720x1280); { @@ -56,7 +61,7 @@ START_UI_CONFIG(OPTIONMENU); ADD_SHAPE_CONFIG(TEXT_RIGHT_MARGIN, 8); ADD_SHAPE_CONFIG(TEXT_TOP_MARGIN, 8); ADD_SHAPE_CONFIG(TEXT_BOTTOM_MARGIN, 8); - ADD_SHAPE_CONFIG(ARROW_MARGIN, 24); + ADD_SHAPE_CONFIG(ARROW_MARGIN, 36); ADD_SHAPE_CONFIG(ITEM_PRESS_LEFT_MARGIN, 3); ADD_SHAPE_CONFIG(ITEM_PRESS_RIGHT_MARGIN, 5); ADD_SHAPE_CONFIG(ITEM_PRESS_TOP_MARGIN, 3); diff --git a/src/ui/resource/FUi_ResourcePanelConfig.cpp b/src/ui/resource/FUi_ResourcePanelConfig.cpp old mode 100644 new mode 100755 index 2102f9c..700d29e --- a/src/ui/resource/FUi_ResourcePanelConfig.cpp +++ b/src/ui/resource/FUi_ResourcePanelConfig.cpp @@ -17,49 +17,51 @@ #include "FUi_ResourceConfigMacro.h" -START_UI_CONFIG(Panel); +START_UI_CONFIG(PANEL); { - ADD_COLOR_CONFIG(BG_NORMAL, $B0217); + ADD_COLOR_CONFIG(GROUPED_STYLE_BG_NORMAL, $B0217); + ADD_COLOR_CONFIG(GROUPED_STYLE_BG_PRESSED, $B043); + ADD_COLOR_CONFIG(GROUPED_STYLE_BG_EFFECT_SELECTED, $B043); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, #00_list_group_bg_ef.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_PRESSED, #00_groupedlist_bg_press.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_SELECTED, #00_groupedlist_bg_focus.9.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, #00_list_group_bg_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_PRESSED, #00_list_group_bg_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_SELECTED, #00_groupedlist_bg_focus.#.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_DISABLED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_PRESSED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_HIGHLIGHTED, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_SELECTED, #00_list_group_bg.9.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, #00_list_group_bg.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_DISABLED, #00_list_group_bg.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_PRESSED, #00_list_group_bg.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_HIGHLIGHTED, #00_list_group_bg.#.png); + ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_SELECTED, #00_list_group_bg.#.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, #00_list_group_bg_top_ef.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_PRESSED, #00_groupedlist_top_bg_press.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_SELECTED, #00_groupedlist_top_bg_focus.9.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, #00_list_group_bg_top_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_PRESSED, #00_list_group_bg_top_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_SELECTED, #00_groupedlist_top_bg_focus.#.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_DISABLED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_PRESSED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_HIGHLIGHTED, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(GROUPED_TOP_BG_SELECTED, #00_list_group_bg_top.9.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, #00_list_group_bg_top.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_DISABLED, #00_list_group_bg_top.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_PRESSED, #00_list_group_bg_top.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_HIGHLIGHTED, #00_list_group_bg_top.#.png); + ADD_IMAGE_CONFIG(GROUPED_TOP_BG_SELECTED, #00_list_group_bg_top.#.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, #00_list_group_bg_center_ef.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_PRESSED, #00_groupedlist_center_bg_press.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_SELECTED, #00_groupedlist_center_bg_focus.9.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, #00_list_group_bg_center_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_PRESSED, #00_list_group_bg_center_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_SELECTED, #00_groupedlist_center_bg_focus.#.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_DISABLED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_PRESSED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_HIGHLIGHTED, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_SELECTED, #00_list_group_bg_center.9.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, #00_list_group_bg_center.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_DISABLED, #00_list_group_bg_center.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_PRESSED, #00_list_group_bg_center.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_HIGHLIGHTED, #00_list_group_bg_center.#.png); + ADD_IMAGE_CONFIG(GROUPED_MIDDLE_BG_SELECTED, #00_list_group_bg_center.#.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, #00_list_group_bg_bottom_ef.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_PRESSED, #00_groupedlist_bottom_bg_press.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_SELECTED, #00_groupedlist_bottom_bg_focus.9.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, #00_list_group_bg_bottom_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_PRESSED, #00_list_group_bg_bottom_ef.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_SELECTED, #00_groupedlist_bottom_bg_focus.#.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_DISABLED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_PRESSED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_HIGHLIGHTED, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_SELECTED, #00_list_group_bg_bottom.9.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, #00_list_group_bg_bottom.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_DISABLED, #00_list_group_bg_bottom.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_PRESSED, #00_list_group_bg_bottom.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_HIGHLIGHTED, #00_list_group_bg_bottom.#.png); + ADD_IMAGE_CONFIG(GROUPED_BOTTOM_BG_SELECTED, #00_list_group_bg_bottom.#.png); } -END_UI_CONFIG(Panel); +END_UI_CONFIG(PANEL); diff --git a/src/ui/resource/FUi_ResourcePopupConfig.cpp b/src/ui/resource/FUi_ResourcePopupConfig.cpp old mode 100644 new mode 100755 index b881f16..ec0e639 --- a/src/ui/resource/FUi_ResourcePopupConfig.cpp +++ b/src/ui/resource/FUi_ResourcePopupConfig.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ResourcePopupConfig.cpp * @brief This is the implementation file for the color/shape properties of Popup. @@ -26,39 +27,41 @@ START_UI_CONFIG(POPUP); ADD_COLOR_CONFIG(BG_NORMAL, $B061L1); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B052L5); - ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.9.png); - ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.9.png); - - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_01, $00_list_process_01.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_02, $00_list_process_02.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_03, $00_list_process_03.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_04, $00_list_process_04.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_05, $00_list_process_05.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_06, $00_list_process_06.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_07, $00_list_process_07.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_08, $00_list_process_08.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_09, $00_list_process_09.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_10, $00_list_process_10.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_11, $00_list_process_11.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_12, $00_list_process_12.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_13, $00_list_process_13.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_14, $00_list_process_14.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_15, $00_list_process_15.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_16, $00_list_process_16.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_17, $00_list_process_17.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_18, $00_list_process_18.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_19, $00_list_process_19.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_20, $00_list_process_20.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_21, $00_list_process_21.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_22, $00_list_process_22.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_23, $00_list_process_23.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_24, $00_list_process_24.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_25, $00_list_process_25.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_26, $00_list_process_26.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_27, $00_list_process_27.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_28, $00_list_process_28.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_29, $00_list_process_29.png); - ADD_IMAGE_CONFIG(PROCESS_ICON_IMAGE_NORMAL_30, $00_list_process_30.png); + ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.#.png); + ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.#.png); + + START_ANIMATION_CONFIG(PROCESSING_ANIMATION); + ADD_ANIMATION_FRAME(#00_list_process_01.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_02.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_03.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_04.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_05.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_06.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_07.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_08.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_09.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_10.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_11.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_12.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_13.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_14.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_15.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_16.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_17.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_18.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_19.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_20.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_21.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_22.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_23.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_24.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_25.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_26.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_27.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_28.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_29.png, 50); + ADD_ANIMATION_FRAME(#00_list_process_30.png, 50); + END_ANIMATION_CONFIG(PROCESSING_ANIMATION); START_UI_CONFIG_MODE(480x800); { @@ -73,13 +76,12 @@ START_UI_CONFIG(POPUP); START_UI_CONFIG_MODE(720x1280); { - ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); - ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128); - ADD_DIMENSION_CONFIG(MAX_SIZE, 720, 1280); - - ADD_SHAPE_CONFIG(TITLE_HEIGHT, 80); - ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); - ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 18); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); // 20121010 + ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128); // 20130116 + + ADD_SHAPE_CONFIG(TITLE_HEIGHT, 80); //20121113 + ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); //20121113 + ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 18); //20121113 ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 20); ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 20); @@ -87,30 +89,29 @@ START_UI_CONFIG(POPUP); ADD_SHAPE_CONFIG(BOTTOM_BORDER, 30); // Compatibility 2.0 ADD_SHAPE_CONFIG(SIDE_BORDER, 12); // Compatibility 2.0 - ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14); - ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 34); + ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14); //20121113 + ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 34); //20121113 ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 16); ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 16); ADD_SHAPE_CONFIG(OUTLINE_BORDER, 3); - ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WIDTH, 64); - ADD_SHAPE_CONFIG(PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, 32); + ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WIDTH, 64); //20120803 + ADD_SHAPE_CONFIG(PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, 32); //20120803 - ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 10); - ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20); + ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 10); //20120803 + ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20); //20121113 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 8); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 12); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 8); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 12); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 14); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 34); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 16); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 16); //20130122 } END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); { ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); - ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128); - ADD_DIMENSION_CONFIG(MAX_SIZE, 1280, 720); + ADD_DIMENSION_CONFIG(MIN_SIZE_WITH_TITLE, 72, 128); // 20130116 ADD_SHAPE_CONFIG(TITLE_HEIGHT, 80); ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); @@ -134,10 +135,10 @@ START_UI_CONFIG(POPUP); ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 10); ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20); - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 8); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 12); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 8); //20130122 - ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 12); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 14); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 34); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 16); //20130122 + ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 16); //20130122 } END_UI_CONFIG_MODE(1280x720); diff --git a/src/ui/resource/FUi_ResourceProgressConfig.cpp b/src/ui/resource/FUi_ResourceProgressConfig.cpp new file mode 100755 index 0000000..2905884 --- /dev/null +++ b/src/ui/resource/FUi_ResourceProgressConfig.cpp @@ -0,0 +1,46 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUi_ResourceSliderConfig.cpp + * @brief This is a configuration file for color, image and shape values of Slider, Progress. + */ + +#include "FUi_ResourceConfigMacro.h" + +START_UI_CONFIG(PROGRESS); +{ + ADD_COLOR_CONFIG(BAR_BG_NORMAL, $W062L1); + ADD_COLOR_CONFIG(BAR_NORMAL, $W062L2); + + ADD_IMAGE_CONFIG(BAR_BG_NORMAL, #00_progress_bg.#.png); + ADD_IMAGE_CONFIG(BAR_NORMAL, #00_progress_bar.#.png); + ADD_IMAGE_CONFIG(BAR_BG_EFFECT, #00_progress_ef_bg.#.png); + ADD_IMAGE_CONFIG(BAR_EFFECT, #00_progress_bar_ef.#.png); + + START_UI_CONFIG_MODE(720x1280); + { + ADD_SHAPE_CONFIG(BAR_HEIGHT, 36); + ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 26); + ADD_SHAPE_CONFIG(BAR_TOP_MARGIN, 12); + ADD_SHAPE_CONFIG(BAR_OFFSET, 9); + + ADD_SHAPE_CONFIG(MINIMUM_SIZE, 276); + } + END_UI_CONFIG_MODE(720x1280); +} +END_UI_CONFIG(PROGRESS); diff --git a/src/ui/resource/FUi_ResourceScrollConfig.cpp b/src/ui/resource/FUi_ResourceScrollConfig.cpp old mode 100644 new mode 100755 index d3dc528..ec2bcad --- a/src/ui/resource/FUi_ResourceScrollConfig.cpp +++ b/src/ui/resource/FUi_ResourceScrollConfig.cpp @@ -19,39 +19,41 @@ START_UI_CONFIG(SCROLL); { - ADD_COLOR_CONFIG(THUMB, $B071); + ADD_COLOR_CONFIG(THUMB_BG_NORMAL, $B071); - ADD_COLOR_CONFIG(JUMP_TO_TOP_BG, $W011); ADD_COLOR_CONFIG(JUMP_TO_TOP_NORMAL, $F032L1); ADD_COLOR_CONFIG(JUMP_TO_TOP_PRESSED, $F032L1P); - ADD_COLOR_CONFIG(BUTTON_BG, $W011); + ADD_COLOR_CONFIG(BUTTON_BG_NORMAL, $W011); ADD_COLOR_CONFIG(BUTTON_BG_PRESSED, $B042); - ADD_IMAGE_CONFIG(THUMB, #00_scroll_bar.9.png); - ADD_IMAGE_CONFIG(THUMB_EFFECT, #00_scroll_bar_ef.9.png); - ADD_IMAGE_CONFIG(JUMP_TO_TOP, #00_icon_jump.png); + ADD_IMAGE_CONFIG(THUMB_HORIZONTAL_BG_NORMAL, #00_scroll_bar_h.#.png); + ADD_IMAGE_CONFIG(THUMB_HORIZONTAL_EFFECT, #00_scroll_bar_h_ef.#.png); + ADD_IMAGE_CONFIG(THUMB_VERTICAL_BG_NORMAL, #00_scroll_bar_v.#.png); + ADD_IMAGE_CONFIG(THUMB_VERTICAL_EFFECT, #00_scroll_bar_v_ef.#.png); + ADD_IMAGE_CONFIG(JUMP_TO_TOP_NORMAL, #00_icon_jump.png); + ADD_IMAGE_CONFIG(JUMP_TO_TOP_PRESSED, #00_icon_jump.png); ADD_IMAGE_CONFIG(JUMP_TO_TOP_EFFECT, #00_icon_jump_ef.png); - ADD_IMAGE_CONFIG(JUMP_TO_TOP_LEFT, #00_icon_jump_left.png); - ADD_IMAGE_CONFIG(JUMP_TO_TOP_LEFT_EFFECT, #00_icon_jump_left_ef.png); - ADD_IMAGE_CONFIG(BUTTON_BG, #00_button_01.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_EFFECT, #00_button_01_ef.9.png); - ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_button_01_ef_press.9.png); - ADD_IMAGE_CONFIG(HANDLER_BG, #00_scroll_bar_handler_bg.9.png); - ADD_IMAGE_CONFIG(HANDLER_BG_EFFECT, #00_scroll_bar_handler_bg_ef.9.png); - ADD_IMAGE_CONFIG(HANDLER_HORIZONTAL, #00_scroll_bar_handler_h.png); - ADD_IMAGE_CONFIG(HANDLER_VERTICAL, #00_scroll_bar_handler_v.png); + ADD_IMAGE_CONFIG(JUMP_TO_LEFT_NORMAL, #00_icon_jump_left.png); + ADD_IMAGE_CONFIG(JUMP_TO_LEFT_PRESSED, #00_icon_jump_left.png); + ADD_IMAGE_CONFIG(JUMP_TO_LEFT_EFFECT, #00_icon_jump_left_ef.png); + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL, #00_button_01.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_NORMAL_EFFECT, #00_button_01_ef.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED, #00_button_01.#.png); + ADD_IMAGE_CONFIG(BUTTON_BG_PRESSED_EFFECT, #00_button_01_ef_press.#.png); + ADD_IMAGE_CONFIG(HANDLER_HORIZONTAL, #00_fast_scroll_handler_h.#.png); + ADD_IMAGE_CONFIG(HANDLER_VERTICAL, #00_fast_scroll_handler.#.png); - ADD_IMAGE_CONFIG(OVERSCROLLING_TOP_BG, #00_overscrolling_top.9.png); - ADD_IMAGE_CONFIG(OVERSCROLLING_BOTTOM_BG, #00_overscrolling_bottom.9.png); - ADD_IMAGE_CONFIG(OVERSCROLLING_LEFT_BG, #00_overscrolling_left.9.png); - ADD_IMAGE_CONFIG(OVERSCROLLING_RIGHT_BG, #00_overscrolling_right.9.png); + ADD_IMAGE_CONFIG(OVERSCROLLING_TOP_BG, #00_overscrolling_top.#.png); + ADD_IMAGE_CONFIG(OVERSCROLLING_BOTTOM_BG, #00_overscrolling_bottom.#.png); + ADD_IMAGE_CONFIG(OVERSCROLLING_LEFT_BG, #00_overscrolling_left.#.png); + ADD_IMAGE_CONFIG(OVERSCROLLING_RIGHT_BG, #00_overscrolling_right.#.png); START_UI_CONFIG_MODE(720x1280); - ADD_SHAPE_CONFIG(VERTICAL_THUMB_MIN_WIDTH, 16); - ADD_SHAPE_CONFIG(VERTICAL_THUMB_MIN_HEIGHT, 16); + ADD_SHAPE_CONFIG(VERTICAL_THUMB_MIN_WIDTH, 18); + ADD_SHAPE_CONFIG(VERTICAL_THUMB_MIN_HEIGHT, 27); ADD_SHAPE_CONFIG(VERTICAL_THUMB_MARGIN, 6); - ADD_SHAPE_CONFIG(HORIZONTAL_THUMB_MIN_WIDTH, 16); - ADD_SHAPE_CONFIG(HORIZONTAL_THUMB_MIN_HEIGHT, 16); + ADD_SHAPE_CONFIG(HORIZONTAL_THUMB_MIN_WIDTH, 27); + ADD_SHAPE_CONFIG(HORIZONTAL_THUMB_MIN_HEIGHT, 18); ADD_SHAPE_CONFIG(HORIZONTAL_THUMB_MARGIN, 6); ADD_SHAPE_CONFIG(JUMP_TO_TOP_RIGHT_MARGIN, 26); @@ -60,20 +62,20 @@ START_UI_CONFIG(SCROLL); ADD_FIXED_VALUE_CONFIG(JUMP_TO_TOP_HEIGHT, 74); ADD_SHAPE_CONFIG(HANDLER_MARGIN, 4); - ADD_SHAPE_CONFIG(HANDLER_MIN_WIDTH, 54); - ADD_SHAPE_CONFIG(HANDLER_MIN_HEIGHT, 214); + ADD_SHAPE_CONFIG(HANDLER_MIN_WIDTH, 36); + ADD_SHAPE_CONFIG(HANDLER_MIN_HEIGHT, 234); - ADD_SHAPE_CONFIG(OVERSCROLLING_TOP_HEIGHT, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_BOTTOM_HEIGHT, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_LEFT_WIDTH, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_RIGHT_WIDTH, 30); + ADD_SHAPE_CONFIG(OVERSCROLLING_TOP_HEIGHT, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_BOTTOM_HEIGHT, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_LEFT_WIDTH, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_RIGHT_WIDTH, 36); END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); - ADD_SHAPE_CONFIG(OVERSCROLLING_TOP_HEIGHT, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_BOTTOM_HEIGHT, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_LEFT_WIDTH, 30); - ADD_SHAPE_CONFIG(OVERSCROLLING_RIGHT_WIDTH, 30); + ADD_SHAPE_CONFIG(OVERSCROLLING_TOP_HEIGHT, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_BOTTOM_HEIGHT, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_LEFT_WIDTH, 36); + ADD_SHAPE_CONFIG(OVERSCROLLING_RIGHT_WIDTH, 36); END_UI_CONFIG_MODE(1280x720); } END_UI_CONFIG(SCROLL); diff --git a/src/ui/resource/FUi_ResourceSearchBarConfig.cpp b/src/ui/resource/FUi_ResourceSearchBarConfig.cpp old mode 100644 new mode 100755 index a818cee..da2cbac --- a/src/ui/resource/FUi_ResourceSearchBarConfig.cpp +++ b/src/ui/resource/FUi_ResourceSearchBarConfig.cpp @@ -25,9 +25,9 @@ START_UI_CONFIG(SEARCHBAR); { ADD_COLOR_CONFIG(BUTTON_BG_NORMAL, $W011); - ADD_COLOR_CONFIG(BUTTON_PRESSED, $B042); - ADD_COLOR_CONFIG(BUTTON_DISABLED, $W011); - ADD_COLOR_CONFIG(BUTTON_HIGHLIGHTED, $B041); + ADD_COLOR_CONFIG(BUTTON_BG_PRESSED, $B042); + ADD_COLOR_CONFIG(BUTTON_BG_DISABLED, $W011); + ADD_COLOR_CONFIG(BUTTON_BG_HIGHLIGHTED, $B041); ADD_COLOR_CONFIG(BUTTON_TEXT_NORMAL, $B052L4); ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $F032L2P); ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $B052L4D); @@ -35,18 +35,18 @@ START_UI_CONFIG(SEARCHBAR); ADD_COLOR_CONFIG(EDIT_BG_NORMAL, $W031); ADD_COLOR_CONFIG(EDIT_BG_DISABLED, $W031D); - ADD_COLOR_CONFIG(EDIT_TEXT_NORMAL, $W032); - ADD_COLOR_CONFIG(EDIT_TEXT_DISABLED, $W032D); - ADD_COLOR_CONFIG(EDIT_TEXT_HIGHLIGHTED, $W032P); - ADD_COLOR_CONFIG(ICON_COLOR_NORMAL, $F041i); - ADD_COLOR_CONFIG(ICON_COLOR_DISABLED, $F041iD); + ADD_COLOR_CONFIG(GUIDE_TEXT_NORMAL, $W032); + ADD_COLOR_CONFIG(GUIDE_TEXT_DISABLED, $W032D); + ADD_COLOR_CONFIG(GUIDE_TEXT_HIGHLIGHTED, $W032P); + ADD_COLOR_CONFIG(ICON_BG_NORMAL, $F041i); + ADD_COLOR_CONFIG(ICON_BG_DISABLED, $F041iD); ADD_COLOR_CONFIG(CONTENT_AREA_BG_NORMAL, $B013); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_search_edit_field_bg.9.png); - ADD_IMAGE_CONFIG(BG_DISABLED, #00_search_edit_field_bg.9.png); - ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_search_edit_field_bg.9.png); - ADD_IMAGE_CONFIG(BG_PRESSED, #00_search_edit_field_bg.9.png); - ADD_IMAGE_CONFIG(BG_EFFECT, #00_search_edit_field_bg_ef.9.png);//00_edit_field_no_line_square_bg_01.9.png + ADD_IMAGE_CONFIG(BG_NORMAL, #00_search_edit_field_bg.#.png); + ADD_IMAGE_CONFIG(BG_DISABLED, #00_search_edit_field_bg.#.png); + ADD_IMAGE_CONFIG(BG_HIGHLIGHTED, #00_search_edit_field_bg.#.png); + ADD_IMAGE_CONFIG(BG_PRESSED, #00_search_edit_field_bg.#.png); + ADD_IMAGE_CONFIG(BG_EFFECT, #00_search_edit_field_bg_ef.#.png); ADD_IMAGE_CONFIG(ICON_NORMAL, #00_search_icon.png); ADD_IMAGE_CONFIG(ICON_EFFECT_NORMAL, #00_search_icon_ef.png); @@ -54,19 +54,19 @@ START_UI_CONFIG(SEARCHBAR); START_UI_CONFIG_MODE(720x1280); { - ADD_SHAPE_CONFIG(HORIZONTAL_MARGIN, 26); + ADD_SHAPE_CONFIG(HORIZONTAL_MARGIN, 16); ADD_SHAPE_CONFIG(VERTICAL_MARGIN, 10); ADD_SHAPE_CONFIG(TEXT_HORIZONTAL_MARGIN, 18); ADD_SHAPE_CONFIG(ICON_HORIZONTAL_MARGIN, 18); - ADD_SHAPE_CONFIG(ICON_WIDTH, 40); - ADD_SHAPE_CONFIG(ICON_HEIGHT, 40); + ADD_SHAPE_CONFIG(ICON_WIDTH, 45); + ADD_SHAPE_CONFIG(ICON_HEIGHT, 45); + ADD_SHAPE_CONFIG(MIN_HEIGHT, 86); ADD_SHAPE_CONFIG(SEARCH_FIELD_MIN_WIDTH, 218); - ADD_SHAPE_CONFIG(SEARCH_FIELD_MIN_HEIGHT, 66); ADD_SHAPE_CONFIG(BUTTON_WIDTH, 136); ADD_SHAPE_CONFIG(BUTTON_MIN_WIDTH, 74); ADD_SHAPE_CONFIG(BUTTON_HEIGHT, 66); ADD_SHAPE_CONFIG(BUTTON_LEFT_MARGIN, 10); - ADD_SHAPE_CONFIG(BUTTON_RIGHT_MARGIN, 20); + ADD_SHAPE_CONFIG(BUTTON_RIGHT_MARGIN, 16); ADD_SHAPE_CONFIG(EDIT_TEXT_SIZE, 32); ADD_SHAPE_CONFIG(BUTTON_TEXT_SIZE, 30); } diff --git a/src/ui/resource/FUi_ResourceSizeInfo.cpp b/src/ui/resource/FUi_ResourceSizeInfo.cpp index 711fac5..3020238 100644 --- a/src/ui/resource/FUi_ResourceSizeInfo.cpp +++ b/src/ui/resource/FUi_ResourceSizeInfo.cpp @@ -32,7 +32,6 @@ #include "FUiCtrl_FormImpl.h" #include "FUiCtrl_SearchBarImpl.h" #include "FUiCtrl_EditFieldImpl.h" -#include "FUiCtrl_TabBarImpl.h" #include "FUiCtrl_CustomListImpl.h" #include "FUiCtrl_ExpandableListImpl.h" #include "FUiCtrl_GroupedListImpl.h" @@ -167,8 +166,8 @@ SizeInfo::GetSearchBarSizeInfo(void) _ControlImpl::SizeInfo& SizeInfo::GetTabBarSizeInfo(void) { - static _TabBarImpl::TabBarSizeInfo tabSizeInfo; - return tabSizeInfo; + static _ControlImpl::SizeInfo tabBarSizeInfo; + return tabBarSizeInfo; } _ControlImpl::SizeInfo& @@ -243,19 +242,17 @@ SizeInfo::GetMapSizeInfo(void) } Tizen::Ui::_ControlImpl::SizeInfo& -SizeInfo::GetEditDateSizeInfo(bool titleStyle) +SizeInfo::GetEditDateSizeInfo(void) { - static Tizen::Ui::Controls::_EditDateImpl::EditDateSizeInfo editDateSizeInfo; - editDateSizeInfo.SetTitleStyle(titleStyle); - return editDateSizeInfo; + static _ControlImpl::SizeInfo sizeInfo; + return sizeInfo; } Tizen::Ui::_ControlImpl::SizeInfo& -SizeInfo::GetEditTimeSizeInfo(bool titleStyle) +SizeInfo::GetEditTimeSizeInfo(void) { - static Tizen::Ui::Controls::_EditTimeImpl::EditTimeSizeInfo editTimeSizeInfo; - editTimeSizeInfo.SetTitleStyle(titleStyle); - return editTimeSizeInfo; + static _ControlImpl::SizeInfo sizeInfo; + return sizeInfo; } Tizen::Ui::_ControlImpl::SizeInfo& diff --git a/src/ui/resource/FUi_ResourceSliderConfig.cpp b/src/ui/resource/FUi_ResourceSliderConfig.cpp old mode 100644 new mode 100755 index e364f7d..7fc9dee --- a/src/ui/resource/FUi_ResourceSliderConfig.cpp +++ b/src/ui/resource/FUi_ResourceSliderConfig.cpp @@ -35,30 +35,17 @@ START_UI_CONFIG(SLIDER); ADD_COLOR_CONFIG(HANDLE_BG_PRESSED, $W0641P); ADD_COLOR_CONFIG(HANDLE_BG_DISABLED, $W0641D); ADD_COLOR_CONFIG(HANDLE_BG_HIGHLIGHTED, $W0641); - ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_DISABLED, $W0611D); + ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_DISABLED, $0611D); ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_NORMAL, $W0611); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $F011L3); ADD_COLOR_CONFIG(OVERLAY_BG_NORMAL, $W063); ADD_COLOR_CONFIG(OVERLAY_TEXT_NORMAL, $F011L10); - ADD_IMAGE_CONFIG(BAR_BG_NORMAL, #00_progress_bg.9.png); - ADD_IMAGE_CONFIG(BAR_NORMAL, #00_progress_bar.9.png); - ADD_IMAGE_CONFIG(BAR_BG_EFFECT, #00_progress_ef_bg.9.png); - ADD_IMAGE_CONFIG(BAR_EFFECT, #00_progress_bar_ef.9.png); - - - ADD_IMAGE_CONFIG(PROGRESS_BAR_NORMAL, #00_progress_bar_m.9.png); - ADD_IMAGE_CONFIG(PROGRESS_BAR_EFFECT, #00_progress_bar_ef_m.9.png); - - ADD_IMAGE_CONFIG(GROUP_TOP_BG, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(GROUP_TOP_EFFECT, #00_list_group_bg_top_ef.9.png); - ADD_IMAGE_CONFIG(GROUP_MIDDLE_BG, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(GROUP_MIDDLE_EFFECT, #00_list_group_bg_center_ef.9.png); - ADD_IMAGE_CONFIG(GROUP_BOTTOM_BG, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(GROUP_BOTTOM_EFFECT, #00_list_group_bg_bottom_ef.9.png); - ADD_IMAGE_CONFIG(GROUP_SINGLE_BG, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(GROUP_SINGLE_EFFECT, #00_list_group_bg_ef.9.png); + ADD_IMAGE_CONFIG(BAR_BG_NORMAL, #00_progress_bg.#.png); + ADD_IMAGE_CONFIG(BAR_NORMAL, #00_progress_bar.#.png); + ADD_IMAGE_CONFIG(BAR_BG_EFFECT, #00_progress_ef_bg.#.png); + ADD_IMAGE_CONFIG(BAR_EFFECT, #00_progress_bar_ef.#.png); ADD_IMAGE_CONFIG(HANDLE_BG_NORMAL, #00_slider_handle.png); ADD_IMAGE_CONFIG(HANDLE_BG_PRESSED, #00_slider_handle.png); @@ -85,10 +72,10 @@ START_UI_CONFIG(SLIDER); ADD_SHAPE_CONFIG(HANDLE_TWO_DIGIT_TEXT_SIZE, 34); ADD_SHAPE_CONFIG(HANDLE_THREE_DIGIT_TEXT_SIZE, 26); - ADD_SHAPE_CONFIG(BAR_HEIGHT, 34); + ADD_SHAPE_CONFIG(BAR_HEIGHT, 36); ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 26); ADD_SHAPE_CONFIG(BAR_TOP_MARGIN, 12); - ADD_SHAPE_CONFIG(BAR_OFFSET, 8); + ADD_SHAPE_CONFIG(BAR_OFFSET, 9); ADD_SHAPE_CONFIG(ICON_WIDTH, 74); ADD_SHAPE_CONFIG(ICON_HEIGHT, 74); diff --git a/src/ui/resource/FUi_ResourceSplitPanelConfig.cpp b/src/ui/resource/FUi_ResourceSplitPanelConfig.cpp old mode 100644 new mode 100755 index c48a038..c260d46 --- a/src/ui/resource/FUi_ResourceSplitPanelConfig.cpp +++ b/src/ui/resource/FUi_ResourceSplitPanelConfig.cpp @@ -14,6 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + /** * @file FUi_ResourceSplitPanelConfig.cpp * @brief This is the implementation file for the color, image and shape properties of SplitPanel. @@ -26,10 +27,10 @@ START_UI_CONFIG(SPLITPANEL); ADD_COLOR_CONFIG(DIVIDER_BG_NORMAL, $W131); ADD_COLOR_CONFIG(DIVIDER_BG_PRESSED, $W132); - ADD_IMAGE_CONFIG(DIVIDER_BG_NORMAL, #00_splite_handler_bg.9.png); - ADD_IMAGE_CONFIG(VERTICAL_DIVIDER_BG_EFFECT, #00_splite_handler_bg_ef_v.9.png); + ADD_IMAGE_CONFIG(DIVIDER_BG_NORMAL, #00_splite_handler_bg.#.png); + ADD_IMAGE_CONFIG(VERTICAL_DIVIDER_BG_EFFECT, #00_splite_handler_bg_ef_v.#.png); ADD_IMAGE_CONFIG(VERTICAL_DIVIDER_BG_NORMAL, #00_splite_handler_v.png); - ADD_IMAGE_CONFIG(HORIZONTAL_DIVIDER_BG_EFFECT, #00_splite_handler_bg_ef_h.9.png); + ADD_IMAGE_CONFIG(HORIZONTAL_DIVIDER_BG_EFFECT, #00_splite_handler_bg_ef_h.#.png); ADD_IMAGE_CONFIG(HORIZONTAL_DIVIDER_BG_NORMAL, #00_splite_handler_h.png); START_UI_CONFIG_MODE(720x1280); diff --git a/src/ui/resource/FUi_ResourceTabBarConfig.cpp b/src/ui/resource/FUi_ResourceTabBarConfig.cpp old mode 100644 new mode 100755 index a904bd4..7ed3feb --- a/src/ui/resource/FUi_ResourceTabBarConfig.cpp +++ b/src/ui/resource/FUi_ResourceTabBarConfig.cpp @@ -26,19 +26,19 @@ START_UI_CONFIG(TABBAR); ADD_COLOR_CONFIG(BG_NORMAL, $W0813); ADD_COLOR_CONFIG(ITEM_BG_NORMAL, $W0813); ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $W101); - ADD_COLOR_CONFIG(ITEM_BG_HIGHLIGHTED, $W101); + ADD_COLOR_CONFIG(ITEM_BG_SELECTED, $W101); ADD_COLOR_CONFIG(ITEM_TEXT_NORMAL, $F031L3); ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $F031L3P); - ADD_COLOR_CONFIG(ITEM_TEXT_HIGHLIGHTED, $F031L3P); - ADD_COLOR_CONFIG(ARROW_NORMAL, $F031L3); + ADD_COLOR_CONFIG(ITEM_TEXT_SELECTED, $F031L3P); + ADD_COLOR_CONFIG(ARROW_BG_NORMAL, $F031L3); - ADD_IMAGE_CONFIG(ARROW_BG_LEFT, #00_category_left_gradation.png); - ADD_IMAGE_CONFIG(ARROW_BG_RIGHT, #00_category_right_gradation.png); - ADD_IMAGE_CONFIG(BG_NORMAL, #00_category_panel_bg.9.png) - ADD_IMAGE_CONFIG(ARROW_LEFT, #00_arrow_left.png); - ADD_IMAGE_CONFIG(ARROW_RIGHT, #00_arrow_right.png); - ADD_IMAGE_CONFIG(ITEM_PRESSED, #00_category_button_focus.9.png); - ADD_IMAGE_CONFIG(ITEM_SELECTED, #00_category_button.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_category_panel_bg.#.png) + ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, #00_category_panel_bg_ef.#.png); + ADD_IMAGE_CONFIG(LEFT_ARROW_NORMAL, #00_arrow_left.png); + ADD_IMAGE_CONFIG(RIGHT_ARROW_NORMAL, #00_arrow_right.png); + ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_category_button.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_category_button_focus.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_SELECTED, #00_category_button.#.png); START_UI_CONFIG_MODE(480x800); END_UI_CONFIG_MODE(480x800); @@ -47,17 +47,14 @@ START_UI_CONFIG(TABBAR); ADD_SHAPE_CONFIG(FONT_SIZE, 40); ADD_SHAPE_CONFIG(FONT_MARGIN, 10); ADD_SHAPE_CONFIG(TOP_MARGIN, 9); - ADD_SHAPE_CONFIG(SIDE_MARGIN, 56); + ADD_SHAPE_CONFIG(SIDE_MARGIN, 54); ADD_SHAPE_CONFIG(ITEM_MARGIN, 12); ADD_SHAPE_CONFIG(ITEM_MIN_WIDTH, 140); ADD_SHAPE_CONFIG(ITEM_MAX_WIDTH, 444); ADD_SHAPE_CONFIG(ITEM_HEIGHT, 72); ADD_SHAPE_CONFIG(HEIGHT, 90); - ADD_SHAPE_CONFIG(MIN_WIDTH, 0); - ADD_SHAPE_CONFIG(MAX_WIDTH, 0xFFFF); ADD_SHAPE_CONFIG(ITEM_COUNT_MAX, 100); - ADD_SHAPE_CONFIG(ARROW_MARGIN, 6); + ADD_SHAPE_CONFIG(ARROW_MARGIN, 8); END_UI_CONFIG_MODE(720x1280); - } END_UI_CONFIG(TABBAR); diff --git a/src/ui/resource/FUi_ResourceTabConfig.cpp b/src/ui/resource/FUi_ResourceTabConfig.cpp old mode 100644 new mode 100755 index 9de9cb2..d444f0a --- a/src/ui/resource/FUi_ResourceTabConfig.cpp +++ b/src/ui/resource/FUi_ResourceTabConfig.cpp @@ -25,32 +25,35 @@ START_UI_CONFIG(TAB); { ADD_COLOR_CONFIG(ITEM_BG_NORMAL, $B0513); - ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $B0514P1); + ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $B0513); + ADD_COLOR_CONFIG(ITEM_BG_EFFECT_PRESSED, $B0514P1); ADD_COLOR_CONFIG(ITEM_BG_SELECTED, $B0513); ADD_COLOR_CONFIG(ITEM_BG_HIGHLIGHTED, $B0513); ADD_COLOR_CONFIG(ITEM_BG_DISABLED, $B0513); ADD_COLOR_CONFIG(ITEM_TEXT_NORMAL, $B052L6); - ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $B052L6P); + ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $B052L6); ADD_COLOR_CONFIG(ITEM_TEXT_SELECTED, $B052L6P); ADD_COLOR_CONFIG(ITEM_TEXT_HIGHLIGHTED, $B052L1P); - ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $B052L6P); - ADD_IMAGE_CONFIG(VERTICAL_DIVIDER_NORMAL, #00_divider_line.9.png); - ADD_IMAGE_CONFIG(ITEM_SELECTED, #00_tab_focus.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_tab_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_tab_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_SELECTED, #00_tab_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_HIGHLIGHTED, #00_tab_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_DISABLED, #00_tab_bg.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_PRESSED, #00_tab_press_ef.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_SELECTED, #00_tab_press_ef.9.png); - ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_HIGHLIGHTED, #00_tab_press_ef.9.png); + ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $B052L6); + ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0221); + ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222); + ADD_IMAGE_CONFIG(VERTICAL_DIVIDER_NORMAL, #00_divider_line.#.png); + ADD_IMAGE_CONFIG(ITEM_SELECTED, #00_tab_focus.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_NORMAL, #00_tab_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_PRESSED, #00_tab_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_SELECTED, #00_tab_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_HIGHLIGHTED, #00_tab_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_DISABLED, #00_tab_bg.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_PRESSED, #00_tab_press_ef.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_SELECTED, #00_tab_press_ef.#.png); + ADD_IMAGE_CONFIG(ITEM_BG_EFFECT_HIGHLIGHTED, #00_tab_press_ef.#.png); ADD_IMAGE_CONFIG(TAB_BOUNCE_EFFECT_LEFT, #00_effect_tab_bounce_left.png); ADD_IMAGE_CONFIG(TAB_BOUNCE_EFFECT_RIGHT, #00_effect_tab_bounce_right.png); START_UI_CONFIG_MODE(480x800); { - ADD_SHAPE_CONFIG(SCREEN_HEIGHT, 800); + ADD_SHAPE_CONFIG(SCREEN_HEIGHT, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(SCREEN_WIDTH, 480); } END_UI_CONFIG_MODE(480x800); @@ -64,18 +67,18 @@ START_UI_CONFIG(TAB); ADD_SHAPE_CONFIG(SELECTED_LINE_RIGHT_MARGIN, 16); ADD_SHAPE_CONFIG(SELECTED_LINE_HEIGHT, 3); ADD_SHAPE_CONFIG(SCREEN_WIDTH, 720); - ADD_SHAPE_CONFIG(SCREEN_HEIGHT, 1280); + ADD_SHAPE_CONFIG(SCREEN_HEIGHT, _SCREEN_HEIGHT_); ADD_SHAPE_CONFIG(HEIGHT, 111); ADD_SHAPE_CONFIG(ICON_TEXT_HEIGHT, 111); ADD_FIXED_VALUE_CONFIG(FONT_CHANGE_ITEM_COUNT, 3); ADD_SHAPE_CONFIG(FONT_SIZE_01, 30); - ADD_SHAPE_CONFIG(FONT_SIZE_02, 28); + ADD_SHAPE_CONFIG(FONT_SIZE_02, 26); ADD_SHAPE_CONFIG(FONT_SIZE_03, 24); ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE_01, 30); - ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE_02, 28); + ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE_02, 26); ADD_SHAPE_CONFIG(MULTILINE_FONT_SIZE_03, 24); ADD_SHAPE_CONFIG(ICON_TEXT_FONT_SIZE_01, 30); - ADD_SHAPE_CONFIG(ICON_TEXT_FONT_SIZE_02, 28); + ADD_SHAPE_CONFIG(ICON_TEXT_FONT_SIZE_02, 26); ADD_SHAPE_CONFIG(ICON_TEXT_FONT_SIZE_03, 24); ADD_SHAPE_CONFIG(TOP_MARGIN, 22); ADD_SHAPE_CONFIG(BOTTOM_MARGIN, 21); @@ -89,8 +92,8 @@ START_UI_CONFIG(TAB); ADD_SHAPE_CONFIG(ICON_WIDTH, 64); ADD_SHAPE_CONFIG(ICON_HEIGHT, 64); ADD_SHAPE_CONFIG(BADGE_ICON_MARGIN, 6); - ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 4); - ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 32); + ADD_FIXED_VALUE_CONFIG(DIVIDER_WIDTH, 4); + ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 26); ADD_SHAPE_CONFIG(TAB_MINIMUM_SIZE, 342); } END_UI_CONFIG_MODE(720x1280); @@ -98,6 +101,8 @@ START_UI_CONFIG(TAB); START_UI_CONFIG_MODE(1280x720); { ADD_SHAPE_CONFIG(HEIGHT, 91); + ADD_SHAPE_CONFIG(SCREEN_WIDTH, 1280); + ADD_SHAPE_CONFIG(SCREEN_HEIGHT, 720); ADD_SHAPE_CONFIG(ICON_TEXT_HEIGHT, 142); ADD_SHAPE_CONFIG(LEFT_MARGIN, 34); ADD_SHAPE_CONFIG(RIGHT_MARGIN, 34); diff --git a/src/ui/resource/FUi_ResourceTableViewConfig.cpp b/src/ui/resource/FUi_ResourceTableViewConfig.cpp old mode 100644 new mode 100755 index 4006016..681b74e --- a/src/ui/resource/FUi_ResourceTableViewConfig.cpp +++ b/src/ui/resource/FUi_ResourceTableViewConfig.cpp @@ -25,6 +25,9 @@ START_UI_CONFIG(TABLEVIEW); { ADD_COLOR_CONFIG(BG_NORMAL, 0x00000000); + ADD_COLOR_CONFIG(EXPANDABLE_ARROW_NORMAL, $F032L1); + ADD_COLOR_CONFIG(EXPANDABLE_ARROW_DISABLED, $F032L1D); + ADD_COLOR_CONFIG(EXPANDABLE_ARROW_PRESSED, $F032L1P); ADD_COLOR_CONFIG(ITEM_DIVIDER_TOP_BG_NORMAL, $B0222); ADD_COLOR_CONFIG(ITEM_DIVIDER_BOTTOM_BG_NORMAL, $B0221); ADD_COLOR_CONFIG(ITEM_BG_NORMAL, 0x00000000); @@ -35,29 +38,48 @@ START_UI_CONFIG(TABLEVIEW); ADD_COLOR_CONFIG(ITEM_TEXT_PRESSED, $F011L1P); ADD_COLOR_CONFIG(ITEM_TEXT_HIGHLIGHTED, $F011L1P); ADD_COLOR_CONFIG(ITEM_TEXT_DISABLED, $F011L1D); + ADD_COLOR_CONFIG(ITEM_DESCRIPTION_TEXT_NORMAL, $F011L21); + ADD_COLOR_CONFIG(ITEM_ANNEX_CANVAS_BG_NORMAL, 0x00ffffff); ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_NORMAL, $F032L1); ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_PRESSED, $F032L1P); + ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_HIGHLIGHTED, $F032L1P); ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_BG_NORMAL, $W011); ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_BG_PRESSED, $B041); + ADD_COLOR_CONFIG(ITEM_ANNEX_DETAIL_BG_HIGHLIGHTED, $B041); ADD_COLOR_CONFIG(GROUPITEM_BG_NORMAL, $B0217); ADD_COLOR_CONFIG(GROUPITEM_TEXT_NORMAL, $W021L3); ADD_COLOR_CONFIG(GROUPITEM_TEXT_PRESSED, $W021L3P); + ADD_COLOR_CONFIG(GROUPITEM_TEXT_HIGHLIGHTED, $W021L3); ADD_COLOR_CONFIG(GROUPITEM_INDEX_BAR_NORMAL, $W021L2); ADD_COLOR_CONFIG(GROUPITEM_INDEX_BAR_PRESSED, $W021L2P); + ADD_COLOR_CONFIG(GROUPITEM_INDEX_BAR_HIGHLIGHTED, $W021L2P); ADD_COLOR_CONFIG(GROUPITEM_BAR_NORMAL, $B0232); + ADD_COLOR_CONFIG(GROUPITEM_BAR_PRESSED, $B0232); + ADD_COLOR_CONFIG(GROUPITEM_BAR_HIGHLIGHTED, $B0232); ADD_COLOR_CONFIG(SECTIONITEM_BG_NORMAL, $B0217); - ADD_IMAGE_CONFIG(GROUPITEM_BG_NORMAL, #00_indexlist_bg.9.png); - ADD_IMAGE_CONFIG(GROUPITEM_BG_EFFECT, #00_indexlist_bg_ef.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_NORMAL, #00_list_group_bg.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_PRESSED, #00_list_group_bg_ef.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_NORMAL, #00_list_group_bg_top.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_PRESSED, #00_list_group_bg_top_ef.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_NORMAL, #00_list_group_bg_center.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_PRESSED, #00_list_group_bg_center_ef.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_NORMAL, #00_list_group_bg_bottom.9.png); - ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_PRESSED, #00_list_group_bg_bottom_ef.9.png); + ADD_COLOR_CONFIG(CONTEXTITEM_BG_NORMAL, $B0212); + ADD_COLOR_CONFIG(EMPTY_CONTENTS_TEXT_NORMAL, $F011L21); + ADD_IMAGE_CONFIG(GROUPITEM_BG_NORMAL, #00_indexlist_bg.#.png); + ADD_IMAGE_CONFIG(GROUPITEM_BG_EFFECT, #00_indexlist_bg_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_NORMAL, #00_list_group_bg.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_PRESSED, #00_list_group_bg_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_HIGHLIGHTED, #00_list_group_bg_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_SINGLE_BG_COVER, #00_list_group_press_bg.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_NORMAL, #00_list_group_bg_top.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_PRESSED, #00_list_group_bg_top_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_HIGHLIGHTED, #00_list_group_bg_top_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_TOP_BG_COVER, #00_list_group_press_bg_top.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_NORMAL, #00_list_group_bg_center.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_PRESSED, #00_list_group_bg_center_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_HIGHLIGHTED, #00_list_group_bg_center_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_CENTER_BG_COVER, #00_list_group_press_bg_center.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_NORMAL, #00_list_group_bg_bottom.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_PRESSED, #00_list_group_bg_bottom_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_HIGHLIGHTED, #00_list_group_bg_bottom_ef.#.png); + ADD_IMAGE_CONFIG(SECTIONITEM_BOTTOM_BG_COVER, #00_list_group_press_bg_bottom.#.png); ADD_IMAGE_CONFIG(CHECKBOX_BG_NORMAL, #00_check_bg.png); ADD_IMAGE_CONFIG(CHECKBOX_BG_PRESSED, #00_check_bg_press.png); + ADD_IMAGE_CONFIG(CHECKBOX_BG_HIGHLIGHTED, #00_check_bg_press.png); ADD_IMAGE_CONFIG(CHECKBOX_CHECK_MARK_NORMAL, #00_check_checking.png); ADD_IMAGE_CONFIG(RADIOBUTTON_NORMAL, #00_button_radio.png); ADD_IMAGE_CONFIG(RADIOBUTTON_PRESSED, #00_button_radio_press.png); @@ -66,21 +88,27 @@ START_UI_CONFIG(TABLEVIEW); ADD_IMAGE_CONFIG(ONOFFBUTTON_OFF, #00_button_off.png); ADD_IMAGE_CONFIG(ONOFFBUTTON_HANDLER, #00_button_on_off_handler.png); ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_NORMAL, #00_circle_bg.png); - ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_EFFECT, #00_circle_bg_ef.png); ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_PRESSED, #00_circle_bg_ef_press.png); + ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_HIGHLIGHTED, #00_circle_bg_ef_press.png); + ADD_IMAGE_CONFIG(CIRCLE_BUTTON_BG_EFFECT, #00_circle_bg_ef.png); ADD_IMAGE_CONFIG(CIRCLE_BUTTON_REVEAL, #00_button_reveal.png); ADD_IMAGE_CONFIG(SEARCH_ICON_NORMAL, #00_search_icon.png); + ADD_IMAGE_CONFIG(BUTTON_EXPAND_CLOSED_EFFECT, #00_button_expand_closed_ef.png); + ADD_IMAGE_CONFIG(BUTTON_EXPAND_OPENED_EFFECT, #00_button_expand_opened_ef.png); + START_UI_CONFIG_MODE(720x1280); - ADD_DIMENSION_CONFIG(MIN_SIZE, 90, 72); + ADD_DIMENSION_CONFIG(MIN_SIZE, 0, 0); ADD_SHAPE_CONFIG(ITEM_DEFAULT_FONT_SIZE, 44); ADD_SHAPE_CONFIG(ITEM_LEFT_MARGIN, 26); - ADD_SHAPE_CONFIG(ITEM_ANNEX_WIDTH, 64); - ADD_SHAPE_CONFIG(ITEM_ANNEX_HEIGHT, 64); - ADD_SHAPE_CONFIG(ITEM_ANNEX_ONOFF_WIDTH, 132); - ADD_SHAPE_CONFIG(ITEM_ANNEX_ONOFF_HEIGHT, 70); - ADD_SHAPE_CONFIG(ITEM_ANNEX_MORE_WIDTH, 74); - ADD_SHAPE_CONFIG(ITEM_ANNEX_MORE_HEIGHT, 74); + ADD_SHAPE_CONFIG(ITEM_ANNEX_WIDTH, 63); + ADD_SHAPE_CONFIG(ITEM_ANNEX_HEIGHT, 63); + ADD_SHAPE_CONFIG(ITEM_ANNEX_MARGIN, 16); + ADD_SHAPE_CONFIG(ITEM_ANNEX_ONOFF_WIDTH, 135); + ADD_SHAPE_CONFIG(ITEM_ANNEX_ONOFF_HEIGHT, 63); + ADD_SHAPE_CONFIG(ITEM_ANNEX_ONOFF_MARGIN, 2); + ADD_SHAPE_CONFIG(ITEM_ANNEX_MORE_WIDTH, 72); + ADD_SHAPE_CONFIG(ITEM_ANNEX_MORE_HEIGHT, 72); ADD_SHAPE_CONFIG(CONTEXTITEM_RIGHT_MARGIN, 0); ADD_SHAPE_CONFIG(GROUPITEM_DEFAULT_HEIGHT, 78); ADD_SHAPE_CONFIG(GROUPITEM_DEFAULT_TEXT_HEIGHT, 46); @@ -94,6 +122,8 @@ START_UI_CONFIG(TABLEVIEW); ADD_SHAPE_CONFIG(FASTSCROLL_INDEX_WIDTH, 51); ADD_FIXED_VALUE_CONFIG(ITEM_DIVIDER_HEIGHT, 1); ADD_FIXED_VALUE_CONFIG(SECTIONITEM_TOP_MARGIN, 0); + ADD_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_WIDTH, 1); + ADD_FIXED_VALUE_CONFIG(ITEM_ANNEX_DIVIDER_MARGIN, 30); END_UI_CONFIG_MODE(720x1280); } END_UI_CONFIG(TABLEVIEW); diff --git a/src/ui/resource/FUi_ResourceTokenEditConfig.cpp b/src/ui/resource/FUi_ResourceTokenEditConfig.cpp old mode 100644 new mode 100755 index f2bfe81..69ce0c2 --- a/src/ui/resource/FUi_ResourceTokenEditConfig.cpp +++ b/src/ui/resource/FUi_ResourceTokenEditConfig.cpp @@ -24,12 +24,14 @@ START_UI_CONFIG(TOKENEDIT); { - ADD_COLOR_CONFIG(TOKEN_BG_NORMAL, $W0711); - ADD_COLOR_CONFIG(TOKEN_BG_SELECTED, $W0713); - ADD_COLOR_CONFIG(TOKEN_TEXT_NORMAL, $F011L10); - ADD_COLOR_CONFIG(TOKEN_TEXT_SELECTED, $F011L10); + ADD_COLOR_CONFIG(BG_NORMAL, $W0711); + ADD_COLOR_CONFIG(BG_SELECTED, $W0713); + ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L10); + ADD_COLOR_CONFIG(TEXT_SELECTED, $F011L10); - ADD_IMAGE_CONFIG(TOKEN_BG, #00_contacts_button_bg.9.png); + ADD_IMAGE_CONFIG(BG_NORMAL, #00_contacts_button_bg.#.png); + ADD_IMAGE_CONFIG(BG_NORMAL_EFFECT, #00_contacts_button_bg_ef.#.png); + ADD_IMAGE_CONFIG(BG_PRESSED_EFFECT, #00_contacts_button_bg_press_ef.#.png); START_UI_CONFIG_MODE(720x1280); { diff --git a/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp b/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp old mode 100644 new mode 100755 index cfe9156..03e1a7c --- a/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp +++ b/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp @@ -44,9 +44,11 @@ #include "FUi_Control.h" #include "FUi_ControlManager.h" #include "FUi_ContainerImpl.h" +#include "FUiCtrl_FrameImpl.h" using namespace Tizen::Base; +using namespace Tizen::Base::Runtime; using namespace Tizen::Base::Collection; using namespace Tizen::App; using namespace Tizen::Io; @@ -104,6 +106,8 @@ _SceneManagerImpl::_SceneManagerImpl(void) , __destroyReservedScene(L"") , __pCorrespondFrame(null) , __correspondFrameControlHandle() + , __sceneTransitionProgressing(false) + , __pDisabledForm(null) { for (int i = 0; i < FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_MAX; i++) { @@ -112,6 +116,7 @@ _SceneManagerImpl::_SceneManagerImpl(void) __animationDescriptions[i].duration = ANIMATION_DURATION; __animationDescriptions[i].interpolatorType = ANIMATION_INTERPOLATOR_LINEAR; } + __sceneTransitionMutex.Create(); } _SceneManagerImpl::~_SceneManagerImpl(void) @@ -450,35 +455,77 @@ _SceneManagerImpl::SetFormTransitionAnimationDefaultValues(SceneTransitionAnimat result _SceneManagerImpl::GoForward(const ForwardSceneTransition& sceneTransition, const Tizen::Base::Collection::IList* pArgs) { - SysTryReturnResult(NID_UI_SCENES, IsAnimationCompleted() == true, E_IN_PROGRESS, "Previous operation in progressing"); - result r = E_SUCCESS; + //## Temporary - Currently no support Non-Recursive Lock(Mutex). + SysTryReturnResult(NID_UI_SCENES, !__sceneTransitionProgressing, E_IN_PROGRESS, "Previous operation in progressing"); + + result r = __sceneTransitionMutex.TryToAcquire(); + SysLog(NID_UI_SCENES, "TryToAcquire result= %s", GetErrorMessage(r)); + SysTryReturnResult(NID_UI_SCENES, r != E_OBJECT_LOCKED, E_IN_PROGRESS, "Previous operation in progressing"); + SysTryReturnResult(NID_UI_SCENES, r != E_SYSTEM, E_SYSTEM, "A system error has been occurred."); + r = __sceneTransitionMutex.Acquire(); + SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred. Mutex acquire failed."); + __sceneTransitionProgressing = true; //## Temporary + SysLog(NID_UI_SCENES, "##### Mutex acquired."); + + SceneId sceneId; + _SceneTransitionImpl forwardSceneTransition; - const _SceneTransitionImpl& forwardSceneTransition - = *_SceneTransitionImpl::GetInstance(static_cast(sceneTransition)); - SysTryReturnResult(NID_UI_SCENES, forwardSceneTransition.GetDirection() == SCENE_TRANSITION_DIRECTION_FORWARD, E_INVALID_ARG, - "Invalid argument is used. sceneTransition's direction is not SCENE_TRANSITION_DIRECTION_FORWARD."); + forwardSceneTransition = *_SceneTransitionImpl::GetInstance(static_cast(sceneTransition)); + SysTryCatch(NID_UI_SCENES, forwardSceneTransition.GetDirection() == SCENE_TRANSITION_DIRECTION_FORWARD, r= E_INVALID_ARG, + E_INVALID_ARG, "[%s] Invalid argument is used. sceneTransition's direction is not SCENE_TRANSITION_DIRECTION_FORWARD.", GetErrorMessage(E_INVALID_ARG)); - SceneId sceneId = forwardSceneTransition.GetDestinationSceneId(); + sceneId = forwardSceneTransition.GetDestinationSceneId(); if (sceneId.GetLength() > 0) - { // Goto the specified scene + { + // Prevent transit to current scene + SysTryCatch(NID_UI_SCENES, __currentSceneId != sceneId, r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. Can't forward to current Scene.", GetErrorMessage(E_INVALID_ARG)); + + // Stop animation + if (!IsAnimationCompleted()) + { + r = StopAllAnimations(); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } + + // Go to the specified scene r = GotoScene(true, sceneId, forwardSceneTransition.GetAnimationType(), forwardSceneTransition.GetHistoryOption(), forwardSceneTransition.GetDestroyOption(), pArgs); - SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); } else { // Transition via PolicyProvider - SysTryReturnResult(NID_UI_SCENES, __pPolicyProvider != null, E_INVALID_STATE, - "SceneManager is in an invalid state. Policy provider not registered."); + SysTryCatch(NID_UI_SCENES, __pPolicyProvider != null, r = E_INVALID_STATE, E_INVALID_STATE, + "[%s] SceneManager is in an invalid state. Policy provider not registered.", GetErrorMessage(E_INVALID_STATE)); + + SceneId nextSceneId = __pPolicyProvider->GetNextScene(__currentSceneId, pArgs); + SysTryCatch(NID_UI_SCENES, !nextSceneId.IsEmpty(), r = E_INVALID_STATE, E_INVALID_STATE, + "[%s] SceneManager is in an invalid state. Policy provider does not know next scene. Current scene= %ls", + GetErrorMessage(E_INVALID_STATE), __currentSceneId.GetPointer()); + + // Prevent transit to current scene + SysTryCatch(NID_UI_SCENES, __currentSceneId != nextSceneId, r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. Can't forward to current Scene.", GetErrorMessage(E_INVALID_ARG)); - String nextSceneId = __pPolicyProvider->GetNextScene(__currentSceneId, pArgs); - SysTryReturnResult(NID_UI_SCENES, !nextSceneId.IsEmpty(), E_INVALID_STATE, - "SceneManager is in an invalid state. Policy provider does not know next scene."); + // Stop animation + if (!IsAnimationCompleted()) + { + r = StopAllAnimations(); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } r = GotoScene(true, nextSceneId, forwardSceneTransition.GetAnimationType(), forwardSceneTransition.GetHistoryOption(), forwardSceneTransition.GetDestroyOption(), pArgs); - SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); } + r = E_SUCCESS; + +CATCH: + __sceneTransitionProgressing = false; //## Temporary + SysTryReturnResult(NID_UI_SCENES, !IsFailed(__sceneTransitionMutex.Release()), E_SYSTEM, + "A system error has been occurred. Mutext release failed."); + SysLog(NID_UI_SCENES, "##### Mutex released."); return r; } @@ -496,21 +543,33 @@ _SceneManagerImpl::GoForward(const SceneTransitionId& transitionId, const Tizen: result _SceneManagerImpl::GoBackward(const BackwardSceneTransition& sceneTransition, const Tizen::Base::Collection::IList* pArgs) { - SysTryReturnResult(NID_UI_SCENES, IsAnimationCompleted() == true, E_IN_PROGRESS, "Previous operation in progressing"); - result r = E_SUCCESS; - - const int historyCount = __sceneHistory.GetCount(); - SysTryReturnResult(NID_UI_SCENES, historyCount != 0, E_UNDERFLOW, "The Scene history is empty."); - - const _SceneTransitionImpl& backwardSceneTransition = *_SceneTransitionImpl::GetInstance(sceneTransition); - SysTryReturnResult(NID_UI_SCENES, backwardSceneTransition.GetDirection() == SCENE_TRANSITION_DIRECTION_BACKWARD, - E_INVALID_ARG, - "Invalid argument is used. sceneTransition's direction is not SCENE_TRANSITION_DIRECTION_BACKWARD!"); - SysTryReturnResult(NID_UI_SCENES, backwardSceneTransition.GetHistoryOption() == SCENE_HISTORY_OPTION_NO_HISTORY, - E_INVALID_ARG, - "Invalid argument is used. sceneTransition's history option is not SCENE_HISTORY_OPTION_NO_HISTORY!"); - - SceneId sceneId = backwardSceneTransition.GetDestinationSceneId(); + //## Temporary - Currently no support Non-Recursive Lock(Mutex). + SysTryReturnResult(NID_UI_SCENES, !__sceneTransitionProgressing, E_IN_PROGRESS, "Previous operation in progressing"); + + result r = __sceneTransitionMutex.TryToAcquire(); + SysTryReturnResult(NID_UI_SCENES, r != E_OBJECT_LOCKED, E_IN_PROGRESS, "Previous operation in progressing"); + SysTryReturnResult(NID_UI_SCENES, r != E_SYSTEM, E_SYSTEM, "A system error has been occurred."); + r = __sceneTransitionMutex.Acquire(); + SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred. Mutex acquire failed."); + __sceneTransitionProgressing = true; //## Temporary + + int historyCount = 0; + _SceneTransitionImpl backwardSceneTransition; + SceneId sceneId; + + historyCount = __sceneHistory.GetCount(); + SysTryCatch(NID_UI_SCENES, historyCount != 0, r = E_UNDERFLOW, E_UNDERFLOW, "[%s] The Scene history is empty.", + GetErrorMessage(E_UNDERFLOW)); + + backwardSceneTransition = *_SceneTransitionImpl::GetInstance(sceneTransition); + SysTryCatch(NID_UI_SCENES, backwardSceneTransition.GetDirection() == SCENE_TRANSITION_DIRECTION_BACKWARD, + r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. sceneTransition's direction is not SCENE_TRANSITION_DIRECTION_BACKWARD!", GetErrorMessage(E_INVALID_ARG)); + SysTryCatch(NID_UI_SCENES, backwardSceneTransition.GetHistoryOption() == SCENE_HISTORY_OPTION_NO_HISTORY, + r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. sceneTransition's history option is not SCENE_HISTORY_OPTION_NO_HISTORY!", GetErrorMessage(E_INVALID_ARG)); + + sceneId = backwardSceneTransition.GetDestinationSceneId(); if (sceneId.GetLength() > 0) { // Back to specific scene and clean up history between destination and last point. int historyIndex = -1; @@ -518,10 +577,11 @@ _SceneManagerImpl::GoBackward(const BackwardSceneTransition& sceneTransition, co // 1. Back tracking and pick a first matching sceneId r = __sceneHistory.LastIndexOf(sceneId, historyIndex); - SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_OBJ_NOT_FOUND, - "The given sceneId was not found in the registered scenes."); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, + "[%s] The given sceneId was not found in the registered scenes.", GetErrorMessage(E_OBJ_NOT_FOUND)); r = __sceneHistory.GetAt(historyIndex, destinationSceneId); - SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred."); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred.", + GetErrorMessage(E_SYSTEM)); // 2. if destoryOption == SCENE_DESTROY_OPTION_DESTROY then destroy all scenes except matching scene. if (backwardSceneTransition.GetDestroyOption() == SCENE_DESTROY_OPTION_DESTROY) @@ -546,28 +606,58 @@ _SceneManagerImpl::GoBackward(const BackwardSceneTransition& sceneTransition, co // 3. Remove all scenes on history between latest scene to matching scene. r = __sceneHistory.RemoveItems(historyIndex, historyCount-historyIndex); - SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred."); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred.", + GetErrorMessage(E_SYSTEM)); + + // Prevent transit to current scene + SysTryCatch(NID_UI_SCENES, __currentSceneId != destinationSceneId, r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. Can't backward to current Scene.", GetErrorMessage(E_INVALID_ARG)); + + // Stop previous animation + if (!IsAnimationCompleted()) + { + r = StopAllAnimations(); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } // Transition r = GotoScene(false, destinationSceneId, backwardSceneTransition.GetAnimationType(), SCENE_HISTORY_OPTION_NO_HISTORY, backwardSceneTransition.GetDestroyOption(), pArgs); - SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); } else { // Adjacent backward transition SceneId previousSceneId; r = __sceneHistory.GetAt(historyCount-1, previousSceneId); - SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_OBJ_NOT_FOUND, - "The given sceneId was not found in the registered scenes."); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, + "[%s] The given sceneId was not found in the registered scenes.", GetErrorMessage(E_OBJ_NOT_FOUND)); r = __sceneHistory.RemoveAt(historyCount-1); - SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred."); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), r = E_SYSTEM, E_SYSTEM, "[%s] A system error has been occurred.", + GetErrorMessage(E_SYSTEM)); + + // Prevent transit to current scene + SysTryCatch(NID_UI_SCENES, __currentSceneId != previousSceneId, r = E_INVALID_ARG, E_INVALID_ARG, + "[%s] Invalid argument is used. Can't backward to current Scene.", GetErrorMessage(E_INVALID_ARG)); + + // Stop previous animation + if (!IsAnimationCompleted()) + { + r = StopAllAnimations(); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } r = GotoScene(false, previousSceneId, backwardSceneTransition.GetAnimationType(), SCENE_HISTORY_OPTION_NO_HISTORY, backwardSceneTransition.GetDestroyOption(), pArgs); - SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); } + r = E_SUCCESS; + +CATCH: + __sceneTransitionProgressing = false; //## Temporary + SysTryReturnResult(NID_UI_SCENES, !IsFailed(__sceneTransitionMutex.Release()), E_SYSTEM, + "A system error has been occurred. Mutext release failed."); return r; } @@ -737,6 +827,9 @@ _SceneManagerImpl::GetInstance(const SceneManager& pSceneManager) void _SceneManagerImpl::OnFormTransitionAnimationFinished(FrameAnimator& source, Frame& frame, Form& form1, Form& form2) { + SetInputEventEnableState(form1, true); + SetInputEventEnableState(form2, true); + source.RemoveFrameAnimatorEventListener(*this); DestroyReservedScene(); } @@ -750,28 +843,39 @@ _SceneManagerImpl::OnFormTransitionAnimationStarted(FrameAnimator& source, Frame void _SceneManagerImpl::OnFormTransitionAnimationStopped(FrameAnimator& source, Frame& frame, Form& form1, Form& form2) { + SetInputEventEnableState(form1, true); + SetInputEventEnableState(form2, true); + source.RemoveFrameAnimatorEventListener(*this); DestroyReservedScene(); } void -_SceneManagerImpl::OnControlAnimationFinished(ControlAnimator& source, Control& control) +_SceneManagerImpl::OnAnimationTransactionFinished(int transactionId) { - source.RemoveControlAnimatorEventListener(*this); - DestroyReservedScene(); + if (__pDisabledForm) + { + SetInputEventEnableState(*__pDisabledForm, true); + __pDisabledForm = null; + } + AnimationTransaction::SetCurrentTransactionEventListener(null); } void -_SceneManagerImpl::OnControlAnimationStarted(ControlAnimator& source, Control& control) +_SceneManagerImpl::OnAnimationTransactionStarted(int transactionId) { // Nothing to do. } void -_SceneManagerImpl::OnControlAnimationStopped(ControlAnimator& source, Control& control) +_SceneManagerImpl::OnAnimationTransactionStopped(int transactionId) { - source.RemoveControlAnimatorEventListener(*this); - DestroyReservedScene(); + if (__pDisabledForm) + { + SetInputEventEnableState(*__pDisabledForm, true); + __pDisabledForm = null; + } + AnimationTransaction::SetCurrentTransactionEventListener(null); } void @@ -847,7 +951,7 @@ _SceneManagerImpl::GotoScene(bool forward, const SceneId& sceneId, SceneTransiti // Prevent self forward SysTryCatch(NID_UI_SCENES, __currentSceneId != sceneId, r = E_INVALID_ARG, E_INVALID_ARG, - "[%s] Invalid argument is used. Can't forward to current Scene.", GetErrorMessage(E_INVALID_ARG)); + "[%s] Invalid argument is used. Can't transit to current Scene.", GetErrorMessage(E_INVALID_ARG)); CallListenerOnSceneTransitionStarted(__currentSceneId, sceneId); // Call listener - ISceneManagerEventListener's if (__pCurrentScene) { // Call listener - ISceneEventListener's @@ -917,7 +1021,7 @@ _SceneManagerImpl::GotoScene(bool forward, const SceneId& sceneId, SceneTransiti String panelId(pScene->GetPanelId()); // First of all, get the Panel from the based Form. // Because, base Form loaded from the resources, the child Panel also loaded and created. - // So, do not create a new Panel instance but get from base Form with panelId as resouce Id. + // So, do not create a new Panel instance but get from base Form with panelId as resource Id. pPanel = dynamic_cast(pForm->GetControl(panelId)); if (pPanel) { @@ -982,6 +1086,21 @@ _SceneManagerImpl::GotoScene(bool forward, const SceneId& sceneId, SceneTransiti __animationDescriptions[animationType-SCENE_TRANSITION_ANIMATION_TYPE_LEFT].duration, __animationDescriptions[animationType-SCENE_TRANSITION_ANIMATION_TYPE_LEFT].interpolatorType); } + + if (formTransition) + { // Disable user input + if (__pCurrentScene) + { + r = SetInputEventEnableState(*__pCurrentScene->GetForm(), false); + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } + r = SetInputEventEnableState(*pForm, false); + if (IsFailed(r)) + { + SetInputEventEnableState(*__pCurrentScene->GetForm(), true); + } + SysTryCatch(NID_UI_SCENES, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r)); + } } // Prepare animation for customization. @@ -1083,7 +1202,6 @@ _SceneManagerImpl::GotoScene(bool forward, const SceneId& sceneId, SceneTransiti } DrawForm(*pScene->GetForm()); - return r; CATCH: @@ -1112,6 +1230,7 @@ CATCH: delete pScene; pScene = null; } + return r; } @@ -1184,6 +1303,15 @@ void _SceneManagerImpl::SwitchToPanel(const String& formId, Panel* pPanel, bool useAnimator) { Panel* pShowPanel = null; + Form* pBaseForm = null; + if (useAnimator) + { + pBaseForm = dynamic_cast(pPanel->GetParent()); + if (pBaseForm == null) + { + useAnimator = false; + } + } std::unique_ptr > pSceneEnum(__formToPanelMultiMap.GetValuesN(formId)); SysTryReturnVoidResult(NID_UI_SCENES, pSceneEnum != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", @@ -1206,7 +1334,7 @@ _SceneManagerImpl::SwitchToPanel(const String& formId, Panel* pPanel, bool useAn if (useAnimator && pShowPanel && pPanel) { int transactionId = 0; - AnimationTransaction::Begin(transactionId); + AnimationTransaction::Begin(transactionId); // transactionId was set } if (pShowPanel) @@ -1216,9 +1344,12 @@ _SceneManagerImpl::SwitchToPanel(const String& formId, Panel* pPanel, bool useAn ControlAnimator* pControlAnimator = pShowPanel->GetControlAnimator(); if (pControlAnimator) { - pControlAnimator->AddControlAnimatorEventListener(*this); pControlAnimator->SetShowState(false); } + else + { + pShowPanel->SetShowState(false); + } } else { @@ -1234,6 +1365,10 @@ _SceneManagerImpl::SwitchToPanel(const String& formId, Panel* pPanel, bool useAn { pControlAnimator->SetShowState(true); } + else + { + pPanel->SetShowState(true); + } } else { @@ -1243,8 +1378,19 @@ _SceneManagerImpl::SwitchToPanel(const String& formId, Panel* pPanel, bool useAn if (useAnimator && pShowPanel && pPanel) { + // Set event listener & start animations + AnimationTransaction::SetCurrentTransactionEventListener(this); result r = AnimationTransaction::Commit(); - if (r != E_SUCCESS) + if (!IsFailed(r)) + { + // Disable input for base Form + if (pBaseForm) + { + __pDisabledForm = pBaseForm; + SetInputEventEnableState(*pBaseForm, false); + } + } + else { SysLog(NID_UI_SCENES, "Animation Commit() failed"); } @@ -1563,7 +1709,7 @@ bool _SceneManagerImpl::IsAnimationCompleted(void) { Frame* pFrame = GetFrame(); - SysTryReturn(NID_UI_SCENES, pFrame != null, false, E_SYSTEM, "[%s] A system error has been occurred. Cannot get Frame.", + SysTryReturn(NID_UI_SCENES, pFrame != null, true, E_SYSTEM, "[%s] A system error has been occurred. Cannot get Frame.", GetErrorMessage(E_SYSTEM)); FrameAnimator* pFrameAnimator = pFrame->GetFrameAnimator(); @@ -1576,6 +1722,16 @@ _SceneManagerImpl::IsAnimationCompleted(void) } result +_SceneManagerImpl::SetInputEventEnableState(Tizen::Ui::Control& control, bool enableState) +{ + _ControlImpl* pControlImpl = _ControlImpl::GetInstance(control); + SysTryReturnResult(NID_UI_SCENES, pControlImpl != null, E_SYSTEM, "A system error has been occurred. Cannot get _ControlImpl."); + _Control& controlCore = pControlImpl->GetCore(); + controlCore.SetInputEventEnableState(enableState); + return E_SUCCESS; +} + +result _SceneManagerImpl::GetSceneTransition(const SceneTransitionId& transitionId, SceneTransition& sceneTransition) const { result r = E_SUCCESS; @@ -1805,4 +1961,20 @@ CATCH: return r; } +result +_SceneManagerImpl::StopAllAnimations(void) +{ + Frame* pFrame = GetFrame(); + SysTryReturnResult(NID_UI_SCENES, pFrame != null, E_SYSTEM, "A system error has been occurred. Cannot get Frame."); + FrameAnimator* pFrameAnimator = pFrame->GetFrameAnimator(); + SysTryReturnResult(NID_UI_SCENES, pFrameAnimator != null, E_SYSTEM, "A system error has been occurred. Cannot get FrameAnimator."); + pFrameAnimator->StopAllAnimations(); + if (!__destroyReservedScene.IsEmpty()) + { + DestroyScene(__destroyReservedScene); + __destroyReservedScene.Clear(); + } + return E_SUCCESS; +} + } } } // Tizen::Ui::Scenes diff --git a/src/ui/scenes/FUiScenes_SceneManagerImpl.h b/src/ui/scenes/FUiScenes_SceneManagerImpl.h old mode 100644 new mode 100755 index 5425f6f..7013398 --- a/src/ui/scenes/FUiScenes_SceneManagerImpl.h +++ b/src/ui/scenes/FUiScenes_SceneManagerImpl.h @@ -33,8 +33,9 @@ #include #include #include +#include #include -#include +#include #include #include #include "FUiScenes_ISceneControlEventListener.h" @@ -49,7 +50,7 @@ class SceneTransition; class _SceneManagerImpl : public Tizen::Base::Object , virtual public Tizen::Ui::Animations::IFrameAnimatorEventListener - , virtual public Tizen::Ui::Animations::IControlAnimatorEventListener + , virtual public Tizen::Ui::Animations::IAnimationTransactionEventListener , virtual public _ISceneControlEventListener { public: @@ -108,9 +109,9 @@ public: Tizen::Ui::Controls::Form &form1, Tizen::Ui::Controls::Form &form2); virtual void OnFormTransitionAnimationStopped(Tizen::Ui::Animations::FrameAnimator &source, Tizen::Ui::Controls::Frame &frame, Tizen::Ui::Controls::Form &form1, Tizen::Ui::Controls::Form &form2); - virtual void OnControlAnimationFinished(Tizen::Ui::Animations::ControlAnimator &source, Tizen::Ui::Control &control); - virtual void OnControlAnimationStarted(Tizen::Ui::Animations::ControlAnimator &source, Tizen::Ui::Control &control); - virtual void OnControlAnimationStopped(Tizen::Ui::Animations::ControlAnimator &source, Tizen::Ui::Control &control); + virtual void OnAnimationTransactionFinished(int transactionId); + virtual void OnAnimationTransactionStarted(int transactionId); + virtual void OnAnimationTransactionStopped(int transactionId); virtual void OnSceneControlEventReceived(_SceneControlEventArg::SceneControlEventType eventType, const SceneId& sceneId); // Internal operations @@ -165,9 +166,11 @@ private: void DestroySiblingPanelScene(const SceneId& sceneId); Tizen::Ui::Controls::Frame* GetFrame(void); bool IsAnimationCompleted(void); + result SetInputEventEnableState(Tizen::Ui::Control& control, bool enableState); result GetSceneTransition(const SceneTransitionId& transitionId, SceneTransition& sceneTransition) const; result RegisterScene(xmlNodePtr pNode); result RegisterSceneTransition(xmlNodePtr pNode); + result StopAllAnimations(void); private: SceneId __currentSceneId; @@ -204,6 +207,9 @@ private: SceneId __destroyReservedScene; Tizen::Ui::Controls::Frame* __pCorrespondFrame; Tizen::Ui::_ControlHandle __correspondFrameControlHandle; + bool __sceneTransitionProgressing; + Tizen::Base::Runtime::Mutex __sceneTransitionMutex; + Tizen::Ui::Controls::Form* __pDisabledForm; }; // _SceneManagerImpl } } } // Tizen::Ui::Scenes diff --git a/src/uifw/CMakeLists.txt b/src/uifw/CMakeLists.txt old mode 100755 new mode 100644 index bec61d1..77ad34d --- a/src/uifw/CMakeLists.txt +++ b/src/uifw/CMakeLists.txt @@ -88,16 +88,18 @@ TARGET_LINK_LIBRARIES(${this_target} "-lXext" ) TARGET_LINK_LIBRARIES(${this_target} "-lEGL" ) TARGET_LINK_LIBRARIES(${this_target} "-lXv" ) TARGET_LINK_LIBRARIES(${this_target} "-ltts" ) +TARGET_LINK_LIBRARIES(${this_target} "-lfeedback" ) IF (NOT OSP_EMUL) TARGET_LINK_LIBRARIES(${this_target} "-ldri2" ) TARGET_LINK_LIBRARIES(${this_target} "-ldrm" ) -TARGET_LINK_LIBRARIES(${this_target} "-ldrm_slp" ) +TARGET_LINK_LIBRARIES(${this_target} "-ltbm" ) ENDIF (NOT OSP_EMUL) TARGET_LINK_LIBRARIES(${this_target} "-llua" ) TARGET_LINK_LIBRARIES(${this_target} "-ltolua++" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-system-runtime-info") TARGET_LINK_LIBRARIES(${this_target} "-lutilX" ) TARGET_LINK_LIBRARIES(${this_target} "-lXtst" ) +TARGET_LINK_LIBRARIES(${this_target} "-lchromium" ) SET_TARGET_PROPERTIES(${this_target} PROPERTIES