X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fpage-turn-view%2Fpage-turn-view.h;h=f6ab9adce602b733e745a250601444a07f2be273;hb=refs%2Fchanges%2F81%2F261081%2F7;hp=6b4ee7e095934997327e4df6c126047aba3d06bb;hpb=f58b8383147de70affa1e3949cf1c6757d705d3c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h b/dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h index 6b4ee7e..f6ab9ad 100644 --- a/dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h +++ b/dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_PAGE_TURN_VIEW_H__ -#define __DALI_TOOLKIT_PAGE_TURN_VIEW_H__ +#ifndef DALI_TOOLKIT_PAGE_TURN_VIEW_H +#define DALI_TOOLKIT_PAGE_TURN_VIEW_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -23,10 +23,8 @@ namespace Dali { - namespace Toolkit { - // Forward declarations class PageFactory; @@ -36,7 +34,8 @@ class PageTurnView; } /** - * PageTurnView is a base class of different mode of pageTurnViews ( portrait or landscape ) + * @brief PageTurnView is a base class of different mode of pageTurnViews ( portrait or landscape ) + * * Page actors are provided from an external PageFactory * PanGesture is used to activate the page bending, streching and tuning forward/backward * @@ -51,168 +50,152 @@ class PageTurnView; * 3) Pan with no animation: PagePanStarted -> PagePanFinished * Pan with no animation will occur when the user touches the page in an area that does not start the * page turning. + * + * Signals + * | %Signal Name | Method | + * |------------------|-------------------------------| + * | pageTurnStarted | @ref PageTurnStartedSignal() | + * | pageTurnFinished | @ref PageTurnFinishedSignal() | + * | pagePanStarted | @ref PagePanStartedSignal() | + * | pagePanFinished | @ref PagePanFinishedSignal() | + * + * @SINCE_1_1.4 */ -class DALI_IMPORT_API PageTurnView : public Control +class DALI_TOOLKIT_API PageTurnView : public Control { public: + /** + * @brief The start and end property ranges for this control. + * @SINCE_1_1.4 + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_1.4 + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices @SINCE_1_1.4 + }; + + struct Property + { + enum + { + VIEW_PAGE_SIZE = PROPERTY_START_INDEX, ///< name "viewPageSize", type Vector2 @SINCE_1_1.4 + CURRENT_PAGE_ID, ///< name "currentPageId", type Integer @SINCE_1_1.4 + + /** + * The two values are the major&minor radius (in pixels) to form an ellipse shape. + * The top-left quarter of this ellipse is used to calculate spine normal for simulating shadow. + */ + SPINE_SHADOW, ///< name "spineShadow", type Vector2 @SINCE_1_1.4 + }; + }; /** - * Creates an empty PageTurnView handle. Only derived versions can be instantiated. + * @brief Creates an empty PageTurnView handle. Only derived versions can be instantiated. * Calling member function with an uninitialized handle is not allowed. + * @SINCE_1_1.4 */ PageTurnView(); /** - * Copy constructor. Creates another handle that points to the same real object + * @brief Copy constructor. Creates another handle that points to the same real object + * @SINCE_1_1.4 * @param[in] handle Handle to copy from */ - PageTurnView( const PageTurnView& handle ); + PageTurnView(const PageTurnView& handle); /** - * Assignment operator. Changes this handle to point to another real object + * @brief Assignment operator. Changes this handle to point to another real object + * @SINCE_1_1.4 */ - PageTurnView& operator=( const PageTurnView& handle ); + PageTurnView& operator=(const PageTurnView& handle); /** * @brief Destructor * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_1.4 */ ~PageTurnView(); /** - * Downcast an Object handle to PageTurnView. + * @brief Downcast an Object handle to PageTurnView. * If handle points to an PageTurnView the downcast produces valid handle. * If not the returned handle is left uninitialized. + * @SINCE_1_1.4 * @param[in] handle Handle to an object * @return handle to a PageTurnView or an uninitialized handle */ - static PageTurnView DownCast( BaseHandle handle ); - - /** - * Set the spine shadow parameter to the shader effects - * The two parameters are the major&minor radius (in pixels) to form an ellipse shape - * The top-left quarter of this ellipse is used to calculate spine normal for simulating shadow - * @param [in] spineShadowParameter The major&minor ellipse radius for the simulated spine shadow - */ - void SetSpineShadowParameter( const Vector2& spineShadowParameter ); - - /** - * Retrieve the spine shadow parameter of the shader effects - * @return The major&minor ellipse radius for the simulated spine shadow - */ - Vector2 GetSpineShadowParameter(); - - /* - * Go to a specific page - * @param[in] pageId The new current page index - */ - void GoToPage( unsigned int pageId ); - - /** - * Retrieve the index of the current Page - * @return The index of the current page - */ - unsigned int GetCurrentPage(); - - /** - * Enter edit mode - * Case 1, the page factory passes image actor into the view as page content, do nothing. - * Case 2, the page factory passes an actor tree into the view as page content, - * the actor tree will receive the touch event in edit mode, and set the refresh rate of the off screen render task to always - * @return an empty actor in case 1; the actor tree root of the current page - */ - Actor EnterEditMode(); - - /** - * Leave edit mode - * Case 1, the page factory passes image actor into the view as page content, do nothing. - * Case 2, the page factory passes an actor tree into the view as page content, - * the page actor will receive all the touch event, and set the refresh rage of the off screen render task to once. - */ - void LeaveEditMode(); - - /** - * Return the actor get hit in the actor tree of the current page by given the touch position on the PageTurnView - * @param[in] screenCoordinates The hit position of the PageTurnView - * @param[out] actorCoordinates The local hit position of the hitted actor - * @return the hitted actor - */ - Actor GetHitActor( Vector2& screenCoordinates, Vector2& actorCoordinates ); - - /** - * Refresh all the cached pages by calling the render task to refresh. - */ - void RefreshAll(); - - /** - * Refresh current page by calling the render task to refresh - */ - void RefreshCurrentPage(); + static PageTurnView DownCast(BaseHandle handle); public: //Signal - // Page Turned signal, with page index and boolean turning direction (true = forward, false = backward) - typedef Signal< void ( PageTurnView, unsigned int, bool ) > PageTurnSignal; - typedef Signal< void ( PageTurnView ) > PagePanSignal; + typedef Signal PageTurnSignal; + typedef Signal PagePanSignal; /** - * Signal emitted when a page has started to turn over. + * @brief Signal emitted when a page has started to turn over. * A callback of the following type may be connected: * @code * void YourCallBackName( PageTurnView pageTurnView, unsigned int pageIndex, bool isTurningForward ); * @endcode + * @SINCE_1_1.4 * @return The signal to connect to */ PageTurnSignal& PageTurnStartedSignal(); /** - * Signal emitted when a page has finished turning over. + * @brief Signal emitted when a page has finished turning over. * A callback of the following type may be connected: * @code * void YourCallBackName( PageTurnView pageTurnView, unsigned int pageIndex, bool isTurningForward ); * @endcode + * @SINCE_1_1.4 * @return The signal to connect to */ PageTurnSignal& PageTurnFinishedSignal(); /** - * Signal emitted when a page pan has commenced + * @brief Signal emitted when a page pan has commenced * A callback of the following type may be connected: * @code * void YourCallBackName( PageTurnView pageTurnView ); * @endcode + * @SINCE_1_1.4 * @return The signal to connect to */ PagePanSignal& PagePanStartedSignal(); /** - * Signal emitted when a page pan has finished + * @brief Signal emitted when a page pan has finished * A callback of the following type may be connected: * @code * void YourCallBackName( PageTurnView pageTurnView ); * @endcode + * @SINCE_1_1.4 * @return The signal to connect to */ PagePanSignal& PagePanFinishedSignal(); public: // Not intended for application developers - + /// @cond internal /** - * Creates a handle using the Toolkit::Internal implementation. + * @brief Creates a handle using the Toolkit::Internal implementation. + * @SINCE_1_1.4 * @param[in] implementation The Control implementation. */ DALI_INTERNAL PageTurnView(Internal::PageTurnView& implementation); /** - * Allows the creation of this Control from an Internal::CustomActor pointer. + * @brief Allows the creation of this Control from an Internal::CustomActor pointer. + * @SINCE_1_1.4 * @param[in] internal A pointer to the internal CustomActor. */ explicit DALI_INTERNAL PageTurnView(Dali::Internal::CustomActor* internal); + /// @endcond }; } // namespace Toolkit } // namespace Dali -#endif /* __DALI_TOOLKIT_PAGE_TURN_VIEW_H__ */ +#endif /* DALI_TOOLKIT_PAGE_TURN_VIEW_H */