[3.0] Fixed dali-demo keyboard focus and updated appearance
[platform/core/uifw/dali-demo.git] / demo / dali-table-view.h
index aa2a469..749bf4b 100644 (file)
@@ -103,7 +103,7 @@ private: // Application callbacks & implementation
   enum ShapeType
   {
     CIRCLE,
-    SQUARE
+    BUBBLE
   };
 
   /**
@@ -135,35 +135,38 @@ private: // Application callbacks & implementation
   void Rotate( unsigned int degrees );
 
   /**
-   * Creates a tile for the main menu and toolbar.
+   * Creates a tile for the main menu.
    *
    * @param[in] name The unique name for this Tile
    * @param[in] title The text caption that appears on the Tile
    * @param[in] parentSize Tile's parent size.
-   * @param[in] addBackground Whether to add a background graphic to the tile or not
+   * @param[in] position The tiles relative position within a page
    *
    * @return The Actor for the created tile.
    */
-  Dali::Actor CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, bool addBackground );
+  Dali::Actor CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, Dali::Vector2& position );
+
+  // Signal handlers
 
   /**
-   * Create a stencil image
+   * Signal emitted when any tile has been pressed
    *
-   * @return The stencil image
+   * @param[in] actor The Actor representing this tile.
+   * @param[in] event The Touch information.
+   *
+   * @return Consume flag
    */
-  Dali::Toolkit::ImageView NewStencilImage();
-
-  // Signal handlers
+  bool OnTilePressed( Dali::Actor actor, const Dali::TouchData& event );
 
   /**
-   * Signal emitted when any tile has been pressed
+   * Called by OnTilePressed & Accessibility to do the appropriate action.
    *
    * @param[in] actor The Actor representing this tile.
-   * @param[in] event The TouchEvent
+   * @param[in] state The Touch state
    *
    * @return Consume flag
    */
-  bool OnTilePressed( Dali::Actor actor, const Dali::TouchEvent& event );
+  bool DoTilePress( Dali::Actor actor, Dali::PointState::Type state );
 
   /**
    * Signal emitted when any tile has been hovered
@@ -210,11 +213,11 @@ private: // Application callbacks & implementation
    * (other than those touches consumed by OnTilePressed)
    *
    * @param[in] actor The Actor touched.
-   * @param[in] event The TouchEvent
+   * @param[in] event The Touch information.
    *
    * @return Consume flag
    */
-  bool OnScrollTouched( Dali::Actor actor, const Dali::TouchEvent& event );
+  bool OnScrollTouched( Dali::Actor actor, const Dali::TouchData& event );
 
   /**
    * Setup the effect on the scroll view
@@ -258,9 +261,9 @@ private: // Application callbacks & implementation
    *
    * @param[in] layer The layer to add the actors to
    * @param[in] count The number of actors to generate
-   * @param[in] distanceField The distance field bitmap to use
+   * @param[in] distanceField A array (pointer) to 2 distance field types to use
    */
-  void AddBackgroundActors( Dali::Actor layer, int count, Dali::BufferImage distanceField );
+  void AddBackgroundActors( Dali::Actor layer, int count, Dali::BufferImage* distanceField );
 
   /**
    * Create a bitmap with the specified shape and also output a distance field
@@ -286,8 +289,9 @@ private: // Application callbacks & implementation
    * @param[in] size The size of the bitmap to create
    * @param[out] imageOut The return bitmap
    * @param[out] distanceFieldOut The return depth field alpha map
+   * @param[in] hollow Optional - Set to true for a thick circle outline without fill
    */
-  void GenerateCircle( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut );
+  void GenerateCircle( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut, bool hollow = false );
 
   /**
    * Creates the logo.
@@ -353,6 +357,12 @@ private: // Application callbacks & implementation
  void OnButtonsPageRelayout( const Dali::Actor& actor );
 
  /**
+  * @brief The is connected to the keyboard focus highlight actor, and called when it is placed on stage.
+  * @param[in] actor The actor that has been placed on stage.
+  */
+ void OnStageConnect( Dali::Actor actor );
+
+ /**
   * @brief Callback called to set up background actors
   *
   * @param[in] actor The actor raising the callback
@@ -362,11 +372,9 @@ private: // Application callbacks & implementation
 private:
 
   Dali::Application&              mApplication;              ///< Application instance.
-  Dali::Layer                     mBackgroundLayer;          ///< Background resides on a separate layer.
-  Dali::Toolkit::TableView        mRootActor;                ///< All content (excluding background is anchored to this Actor)
+  Dali::Toolkit::Control          mRootActor;                ///< All content (excluding background is anchored to this Actor)
   Dali::Animation                 mRotateAnimation;          ///< Animation to rotate and resize mRootActor.
   Dali::Animation                 mPressedAnimation;         ///< Button press scaling animation.
-  Dali::Layer                     mScrollViewLayer;          ///< ScrollView resides on a separate layer.
   Dali::Toolkit::ScrollView       mScrollView;               ///< ScrollView container (for all Examples)
   Dali::Toolkit::ScrollViewEffect mScrollViewEffect;         ///< Effect to be applied to the scroll view
   Dali::Toolkit::RulerPtr         mScrollRulerX;             ///< ScrollView X (horizontal) ruler
@@ -376,10 +384,16 @@ private:
   Dali::TapGestureDetector        mLogoTapDetector;          ///< To detect taps on the logo
   Dali::Toolkit::Popup            mVersionPopup;             ///< Displays DALi library version information
 
+  Dali::Toolkit::ImageView        mFocusContainer;           ///< The parent keyboard focus highlight actor
+  Dali::Toolkit::ImageView        mFocusInner;               ///< The child keyboard focus highlight actor
+  Dali::Animation                 mFocusAnimation;           ///< The animation for the parent keyboard focus highlight actor
+  Dali::Animation                 mFocusAnimationInner;      ///< The animation for the child keyboard focus highlight actor
+
   std::vector< Dali::Actor >      mPages;                    ///< List of pages.
   AnimationList                   mBackgroundAnimations;     ///< List of background bubble animations
   ExampleList                     mExampleList;              ///< List of examples.
 
+  float                           mPageWidth;                ///< The width of a page within the scroll-view, used to calculate the domain
   int                             mTotalPages;               ///< Total pages within scrollview.
 
   bool                            mScrolling:1;              ///< Flag indicating whether view is currently being scrolled