X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Fpage-turn-view%2Fpage-factory.h;h=5be2d34d4e0f071a2408fd5c55eb6195dad88f50;hb=0512ac82e2c23d8eada7840b5a72cdabe13a5f54;hp=c0d09a2ad3cf0190f67cc6ff147b8bf57cf0f3c8;hpb=f58b8383147de70affa1e3949cf1c6757d705d3c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/controls/page-turn-view/page-factory.h b/dali-toolkit/devel-api/controls/page-turn-view/page-factory.h index c0d09a2..5be2d34 100644 --- a/dali-toolkit/devel-api/controls/page-turn-view/page-factory.h +++ b/dali-toolkit/devel-api/controls/page-turn-view/page-factory.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_PAGE_FACTORY_H__ -#define __DALI_TOOLKIT_PAGE_FACTORY_H__ +#ifndef DALI_TOOLKIT_PAGE_FACTORY_H +#define DALI_TOOLKIT_PAGE_FACTORY_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. @@ -19,105 +19,63 @@ */ // EXTERNAL INCLUDES -#include +#include + +// INTERNAL INCLUDES +#include namespace Dali { - namespace Toolkit { - /** - * PageFactory is an abstract interface for providing image actors to PageTurnView - * Each image actor is identified by a unique ID, and has a linear order from 0 to GetNumberOfPages()-1 + * @brief PageFactory is an abstract interface for providing textures to PageTurnView + * Each page is identified by a unique ID, and has a linear order from 0 to GetNumberOfPages()-1 + * + * @SINCE_1_1.4 */ -class DALI_IMPORT_API PageFactory +class DALI_TOOLKIT_API PageFactory { public: - // Property Names - static const std::string ACTOR_HITTABLE; ///< name "actor-hittable", type bool - -public: - - /** - * Constructor - * By default, the off screen rendering is disabled - * Is off screen rendering is required to create the page image, - * call EnableOffscreenRendering() before pass it as parameter to the PageTurnView - */ - PageFactory(); - - /** - * Virtual destructor - */ - virtual ~PageFactory(); + class Extension; ///< Forward declare future extension interface /** - * Enable the off screen rendering to create the page image from actor tree + * @brief Virtual destructor */ - void EnableOffscreenRendering( ); + virtual ~PageFactory(){}; /** - * Query whether offscreen rendering is needed to create the page image - * @return - */ - bool IsOffscreenRenderingNeeded(); - - /** - * Query the number of pages available from the factory. + * @brief Query the number of pages available from the factory. + * * The maximum available page has an ID of GetNumberOfPages()-1. + * @return The page count. */ virtual unsigned int GetNumberOfPages() = 0; /** - * Create an actor to represent the page content. + * @brief Return the texture for the page + * + * For double-sided page( PageTurnLandscapeView ), the left half of texture is used as page front side, and the right half as page back side. + * + * @note Must return a valid texture handle! + * * @param[in] pageId The ID of the page to create. * @return An actor, or an uninitialized pointer if the ID is out of range. */ - virtual Actor NewPage( unsigned int pageId ) = 0; + virtual Texture NewPage(unsigned int pageId) = 0; -public: //Signal /** - * Signal type for notification + * @brief Retrieve the extension for this factory + * + * @return The extension if available, NULL otherwise. */ - typedef Signal< void ( int ) > RefreshSignal; - - /** - * Signal emitted when the Actor tree is ready for rendering into the page image. - * The signal is connected to the page refresh function inside PageTurnView. - */ - RefreshSignal& PageRefreshSignal(); - - /** - * Emit the page ready singal. The PageTurn view will be notified to refresh the given page accordingly. - * @param[in] pageId the index of the page which is ready for refreshing. - */ - void EmitPageRefreshSignal( int pageId ); - -protected: - - /** - * Sets whether an actor should be hittable for the PageTurnView::GetHitActor(). - * It is useful when a sub-tree should be hit instead of the 'leaf' actor in the actor tree. - * By default, actors are not hittable for PageTurnView::GetHitActor() - * @param[in] actor The actor to be set with the hittablity - * @param[in] hittable True to be hittable, false otherwise. - */ - void SetActorHittability( Actor actor, bool hittable ); - - /** - * Query whether an actor is hittable for the PageTurnView::GetHitActor(). - */ - bool GetActorHittability( Actor actor ); - -private: - - bool mNeedOffscreenRendering; - - RefreshSignal mPageRefreshSignal; + virtual Extension* GetExtension() + { + return NULL; + } }; } // namespace Toolkit } // namespace Dali -#endif /* __DALI_TOOLKIT_PAGE_FACTORY_H__ */ +#endif /* DALI_TOOLKIT_PAGE_FACTORY_H */